Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
LCluber committed Mar 13, 2019
2 parents c5212b1 + 52829aa commit ea1c920
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 0.1.7 (March 13th 2019)
-----------------------------
* Added byte order mark U+FEFF at the beginning of the data stream

Version 0.1.6 (March 01st 2019)
-----------------------------
* Default name to 'export.csv' if filename parameter is empty
Expand Down
13 changes: 10 additions & 3 deletions dist/csvx.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ var CSVx = (function (exports) {
this.setOptions(options);
}

var table = 'data:' + this.options.data + ';charset=' + this.options.charset + ',';
var table = 'data:' + this.options.data + ';charset=' + this.options.charset + ",\uFEFF";

if (this.options.labels) {
if (this.options.customLabels.length > 0) {
Expand Down Expand Up @@ -504,7 +504,8 @@ var CSVx = (function (exports) {
};

return Export;
}();
}(); // default option values

Export.options = {
data: 'text/csv',
charset: 'utf-8',
Expand All @@ -515,6 +516,8 @@ var CSVx = (function (exports) {
customLabels: []
};

// import { Dom } from '@lcluber/weejs';
// import { Is } from '@lcluber/chjs';
var Convert =
/*#__PURE__*/
function () {
Expand Down Expand Up @@ -620,8 +623,12 @@ var CSVx = (function (exports) {
};

return Convert;
}();
}(); // static html: string = null;
// default option values

Convert.options = {
// data: 'text/csv',
// charset: 'utf-8',
labels: true,
quote: '"',
separator: ',',
Expand Down
2 changes: 1 addition & 1 deletion dist/csvx.iife.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion dist/csvx.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Export {
if (options) {
this.setOptions(options);
}
let table = 'data:' + this.options.data + ';charset=' + this.options.charset + ',';
let table = 'data:' + this.options.data + ';charset=' + this.options.charset + ',\uFEFF';
if (this.options.labels) {
if (this.options.customLabels.length > 0) {
table += this.createCustomLabels(this.options.customLabels);
Expand Down Expand Up @@ -108,6 +108,7 @@ class Export {
return this.options.quote + content + this.options.quote + this.options.separator;
}
}
// default option values
Export.options = {
data: 'text/csv',
charset: 'utf-8',
Expand All @@ -118,6 +119,8 @@ Export.options = {
customLabels: []
};

// import { Dom } from '@lcluber/weejs';
// import { Is } from '@lcluber/chjs';
class Convert {
static setOptions(options) {
this.setObject('options', options);
Expand Down Expand Up @@ -186,7 +189,11 @@ class Convert {
}
}
}
// static html: string = null;
// default option values
Convert.options = {
// data: 'text/csv',
// charset: 'utf-8',
labels: true,
quote: '"',
separator: ',',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lcluber/csvxjs",
"version": "0.1.6",
"version": "0.1.7",
"description": "CSV Export library written in TypeScript.",
"keywords": [],
"homepage": "http://csvxjs.lcluber.com",
Expand Down
2 changes: 1 addition & 1 deletion src/ts/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class Export {
if (options) {
this.setOptions(options);
}
let table: string = 'data:' + this.options.data + ';charset=' + this.options.charset + ',';
let table: string = 'data:' + this.options.data + ';charset=' + this.options.charset + ',\uFEFF';
if(this.options.labels) {
if (this.options.customLabels.length > 0) {
table += this.createCustomLabels(this.options.customLabels);
Expand Down
2 changes: 1 addition & 1 deletion web/js/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var array = [
{
firstname:'Galileo',
lastname:'Galilei',
lastname:'Galiléi',
born:1564,
died:1642
},
Expand Down
2 changes: 1 addition & 1 deletion web/public/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit ea1c920

Please sign in to comment.