Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Commit

Permalink
v5.0.4 - fix issue with xlsx on mobile, closes #156, closes #131
Browse files Browse the repository at this point in the history
  • Loading branch information
clarketm committed Nov 22, 2018
1 parent 774d9b0 commit c1e023e
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 26 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ $ npm install tableexport
#### [CDNjs](https://cdnjs.com/libraries/TableExport)
| | uncompressed | compressed |
| :------: | :----------: | :--------: |
| __CSS__ | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/css/tableexport.css) | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/css/tableexport.min.css) |
| __JS__ | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/js/tableexport.js) | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/js/tableexport.min.js) |
| __Images__ | &mdash; | [🔗<sup>xlsx</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/img/xlsx.svg)[🔗<sup>xls</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/img/xls.svg)[🔗<sup>csv</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/img/csv.svg)[🔗<sup>txt</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.3/img/txt.svg) |
| __CSS__ | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/css/tableexport.css) | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/css/tableexport.min.css) |
| __JS__ | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/js/tableexport.js) | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/js/tableexport.min.js) |
| __Images__ | &mdash; | [🔗<sup>xlsx</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/xlsx.svg)[🔗<sup>xls</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/xls.svg)[🔗<sup>csv</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/csv.svg)[🔗<sup>txt</sup>](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/txt.svg) |


#### [unpkg](https://unpkg.com/#/)
Expand Down
2 changes: 1 addition & 1 deletion dist/css/tableexport.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v5.0.3 (https://www.travismclarke.com)
* TableExport.js v5.0.4 (https://www.travismclarke.com)
*
* Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com
*
Expand Down
2 changes: 1 addition & 1 deletion dist/css/tableexport.min.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v5.0.3 (https://www.travismclarke.com)
* TableExport.js v5.0.4 (https://www.travismclarke.com)
*
* Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com
*
Expand Down
9 changes: 4 additions & 5 deletions dist/js/tableexport.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v5.0.3 (https://www.travismclarke.com)
* TableExport.js v5.0.4 (https://www.travismclarke.com)
*
* Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com
*
Expand Down Expand Up @@ -148,7 +148,7 @@
* Version.
* @memberof TableExport.prototype
*/
version: '5.0.3',
version: '5.0.4',
/**
* Default library options.
* @memberof TableExport.prototype
Expand Down Expand Up @@ -568,10 +568,10 @@
* @param merges {Object[]}
*/
export2file: function (data, mime, name, extension, merges) {
var format = extension.slice(1);
data = this.getRawData(data, extension, name, merges);

if (_isMobile) {
// TODO: fix dataURI on iphone (xlsx & xls)
if (_isMobile && (format === _FORMAT.CSV || format === _FORMAT.TXT)) {
var dataURI = 'data:' + mime + ';' + this.charset + ',' + data;
this.downloadDataURI(dataURI, name, extension);
} else {
Expand Down Expand Up @@ -942,7 +942,6 @@
return function (key) {
return (
XLSX
&& !_isMobile
&& !(TableExport.prototype.formatConfig[key].enforceStrictRFC4180)
);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/tableexport.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/tableexport.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Type definitions for TableExport v5.0.3
// Type definitions for TableExport v5.0.4
// Project: https://tableexport.travismclarke.com
// Definitions by: Travis Clarke <https://github.com/clarketm>

/*!
* TableExport.js v5.0.3 (https://www.travismclarke.com)
* TableExport.js v5.0.4 (https://www.travismclarke.com)
*
* Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com
*
Expand Down Expand Up @@ -261,5 +261,5 @@ declare global {
*/
tableExport(options?: Defaults): TableExport;
}
}

}
2 changes: 1 addition & 1 deletion docs
Submodule docs updated 1 files
+3 −3 README.md
2 changes: 1 addition & 1 deletion src/stable/css/tableexport.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v5.0.3 (https://www.travismclarke.com)
* TableExport.js v5.0.4 (https://www.travismclarke.com)
*
* Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com
*
Expand Down
2 changes: 1 addition & 1 deletion src/stable/css/tableexport.min.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v5.0.3 (https://www.travismclarke.com)
* TableExport.js v5.0.4 (https://www.travismclarke.com)
*
* Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com
*
Expand Down
9 changes: 4 additions & 5 deletions src/stable/js/tableexport.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js v5.0.3 (https://www.travismclarke.com)
* TableExport.js v5.0.4 (https://www.travismclarke.com)
*
* Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com
*
Expand Down Expand Up @@ -148,7 +148,7 @@
* Version.
* @memberof TableExport.prototype
*/
version: '5.0.3',
version: '5.0.4',
/**
* Default library options.
* @memberof TableExport.prototype
Expand Down Expand Up @@ -568,10 +568,10 @@
* @param merges {Object[]}
*/
export2file: function (data, mime, name, extension, merges) {
var format = extension.slice(1);
data = this.getRawData(data, extension, name, merges);

if (_isMobile) {
// TODO: fix dataURI on iphone (xlsx & xls)
if (_isMobile && (format === _FORMAT.CSV || format === _FORMAT.TXT)) {
var dataURI = 'data:' + mime + ';' + this.charset + ',' + data;
this.downloadDataURI(dataURI, name, extension);
} else {
Expand Down Expand Up @@ -942,7 +942,6 @@
return function (key) {
return (
XLSX
&& !_isMobile
&& !(TableExport.prototype.formatConfig[key].enforceStrictRFC4180)
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/stable/js/tableexport.min.js

Large diffs are not rendered by default.

0 comments on commit c1e023e

Please sign in to comment.