Skip to content

Commit

Permalink
Merge pull request #332 from jmaister/bump-version-350
Browse files Browse the repository at this point in the history
Update version 3.5.0
  • Loading branch information
jmaister authored Aug 23, 2020
2 parents f29f80f + 68fb79e commit a36d12d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ Check my blog page for testing:

[ExcellentExport.js update: JavaScript export to Excel and CSV](http://jordiburgos.com/post/2017/excellentexport-javascript-export-to-excel-csv.html)

# TODO:
# Revision history:

* Filter and process cell values.
* Set fonts to the sheet.
* Insert images ?
### 3.5.0

# Revision history:
* Add fixValue and fixArray functions to configuration
* Update npm dependencies to fix vulnerabilities

### 3.4.3

Expand Down Expand Up @@ -192,11 +191,24 @@ ES6 import
array: [...], // Array with data
arrayHasHeader: true, // Array first row is the header
removeColumns: [...], // Array of column indexes (from 0)
filterRowFn: function(row) {return true} // Return true to keep
filterRowFn: function(row) {return true}, // Function to decide which rows are returned
fixValue: function(value, row, column) {return fixedValue} // Function to fix values, receiving value, row num, column num
fixArray: function(array) {return array} // Function to manipulate the whole data array
},
...
}

## fixValue example

This is an example for the fixValue function to handle HTML tags inside a table cell. It transforms BR to line breaks and then strips all the HTML tags.

fixValue: (value, row, col) => {
let v = value.replace(/<br>/gi, "\n");
let strippedString = v.replace(/(<([^>]+)>)/gi, "");
return strippedString;
}


# Notes

IE8 or lower do not support *data:* url schema.
Expand Down
2 changes: 1 addition & 1 deletion dist/excellentexport.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions excellentexport.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* ExcellentExport 3.4.3
* ExcellentExport 3.5.0
* A client side Javascript export to Excel.
*
* @author: Jordi Burgos ([email protected])
Expand Down Expand Up @@ -44,7 +44,7 @@ const ExcellentExport = function() {
});
};

const version = "3.4.3";
const version = "3.5.0";
const template = {excel: '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=ProgId content=Excel.Sheet> <meta name=Generator content="Microsoft Excel 11"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'};
let csvDelimiter = ",";
let csvNewLine = "\r\n";
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "excellentexport",
"version": "3.4.3",
"version": "3.5.0",
"description": "Client side JavaScript export to Excel or CSV",
"license": "MIT",
"homepage": "http://jordiburgos.com",
Expand Down

0 comments on commit a36d12d

Please sign in to comment.