From bb0cc67658f65095872418ee7a0dc524447ea5ee Mon Sep 17 00:00:00 2001 From: Travis Clarke Date: Fri, 28 Apr 2017 13:43:46 -0700 Subject: [PATCH] v3.3.10 - fix export does not work on IE, closes #43 --- bower.json | 2 +- dist/css/tableexport.css | 2 +- dist/css/tableexport.min.css | 4 ++-- dist/js/tableexport.js | 15 +++++++++------ dist/js/tableexport.min.js | 4 ++-- package.json | 2 +- src/stable/css/tableexport.css | 2 +- src/stable/css/tableexport.min.css | 4 ++-- src/stable/js/tableexport.js | 8 ++++---- src/stable/js/tableexport.min.js | 4 ++-- 10 files changed, 25 insertions(+), 22 deletions(-) diff --git a/bower.json b/bower.json index b04ea5e..8dfa4c7 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tableexport.js", - "version": "3.3.9", + "version": "3.3.10", "authors": [ "clarketm " ], diff --git a/dist/css/tableexport.css b/dist/css/tableexport.css index e8ee678..b63f8ad 100644 --- a/dist/css/tableexport.css +++ b/dist/css/tableexport.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ diff --git a/dist/css/tableexport.min.css b/dist/css/tableexport.min.css index c84a7dd..b6218c4 100644 --- a/dist/css/tableexport.min.css +++ b/dist/css/tableexport.min.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license - */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv:before,.txt:before,.xls:before,.xlsx:before{content:""}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{background:url(../img/xlsx.svg) center no-repeat #006400}.xls:before{background:url(../img/xls.svg) center no-repeat green}.csv:before{background:url(../img/csv.svg) center no-repeat #00f}.txt:before{background:url(../img/txt.svg) center no-repeat purple} \ No newline at end of file + */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{content:"";background:#006400 url(../img/xlsx.svg) no-repeat center}.xls:before{content:"";background:green url(../img/xls.svg) no-repeat center}.csv:before{content:"";background:#00f url(../img/csv.svg) no-repeat center}.txt:before{content:"";background:purple url(../img/txt.svg) no-repeat center} \ No newline at end of file diff --git a/dist/js/tableexport.js b/dist/js/tableexport.js index bebcae2..8c0112a 100644 --- a/dist/js/tableexport.js +++ b/dist/js/tableexport.js @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ @@ -309,7 +309,7 @@ * Version. * @memberof TableExport.prototype */ - version: "3.3.9", + version: "3.3.10", /** * Default plugin options. * @memberof TableExport.prototype @@ -502,9 +502,12 @@ data = this.string2ArrayBuffer(wbout); } - saveAs(new Blob([data], - {type: mime + ";" + this.charset}), - name + extension, true); + var blob = new Blob([data], {type: mime + ";" + this.charset}); + if (typeof saveAs === "undefined" && typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { + window.navigator.msSaveOrOpenBlob(blob, name + extension); + } else { + saveAs(blob, name + extension, true); + } }, /** * Updates the plugin instance with new/updated options @@ -549,4 +552,4 @@ return exports.default = exports.TableExport = TableExport; } -)); \ No newline at end of file +)); diff --git a/dist/js/tableexport.min.js b/dist/js/tableexport.min.js index 69c30af..2824d3a 100644 --- a/dist/js/tableexport.min.js +++ b/dist/js/tableexport.min.js @@ -1,6 +1,6 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ -!function(t,e){"function"==typeof define&&define.amd?define(["exports","jquery","blobjs","file-saverjs","xlsx-js"],e):"object"==typeof exports&&"string"!=typeof exports.nodeName?e(exports,require("jquery"),require("blobjs"),require("file-saverjs"),require("xlsx-js")):e(t,t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this||window,function(t,e,n,o,i){"use strict";var r=function(t,n,o){var s=this;s.settings=o?n:e.extend({},r.prototype.defaults,n),s.selectors=t;var a,p,f,l=r.prototype.rowDel,u=s.settings.ignoreRows instanceof Array?s.settings.ignoreRows:[s.settings.ignoreRows],c=s.settings.ignoreCols instanceof Array?s.settings.ignoreCols:[s.settings.ignoreCols],x=s.settings.ignoreCSS instanceof Array?s.settings.ignoreCSS.join(", "):s.settings.ignoreCSS,y=s.settings.emptyCSS instanceof Array?s.settings.emptyCSS.join(", "):s.settings.emptyCSS;return s.settings.bootstrap?(a=r.prototype.bootstrap[0]+" ",p=r.prototype.bootstrap[1]+" ",f=r.prototype.bootstrap[2]+" "):(a=r.prototype.defaultButton+" ",p=f=""),s.selectors.each(function(){function t(t){return s.settings.trimWhitespace?t.trim():t}function n(t){var e=m.find("caption:not(.head)");e.length?e.append(t):m.prepend(''+t+"")}function d(t,e,o){var i="";n(i)}var m=e(this);o&&m.find("caption:not(.head)").remove();var g=m.find("tbody").find("tr"),g=s.settings.headings?g.add(m.find("thead>tr")):g,g=s.settings.footers?g.add(m.find("tfoot>tr")):g,b=s.settings.headings?m.find("thead>tr").length:0,h="id"===s.settings.fileName?m.attr("id")?m.attr("id"):r.prototype.defaultFileName:s.settings.fileName,v={xlsx:function(n,o){var i={},s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return[r.map(function(o,r){if(!~c.indexOf(o)&&!e(r).is(x)){if(e(r).is(y))return" ";if(r.hasAttribute("colspan")&&(i[n]=i[n]||{},i[n][o+1]=r.getAttribute("colspan")-1),r.hasAttribute("rowspan"))for(var s=1;s=o?p+i[n][s]:p:f++,f!==a);s++);return new Array(p).concat(e(r).text())}return t(e(r).text())}}).get()]}}).get(),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xlsx.mimeType,fileExtension:r.prototype.xlsx.fileExtension})),p=r.prototype.xlsx.buttonContent,f=r.prototype.xlsx.defaultClass;d(a,p,f)},xlsm:function(n,o){var i={},s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return[r.map(function(o,r){if(!~c.indexOf(o)&&!e(r).is(x)){if(e(r).is(y))return" ";if(r.hasAttribute("colspan")&&(i[n]=i[n]||{},i[n][o+1]=r.getAttribute("colspan")-1),r.hasAttribute("rowspan"))for(var s=1;s=o?p+i[n][s]:p:f++,f!==a);s++);return new Array(p).concat(e(r).text())}return t(e(r).text())}}).get()]}}).get(),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xls.mimeType,fileExtension:r.prototype.xls.fileExtension})),p=r.prototype.xls.buttonContent,f=r.prototype.xls.defaultClass;d(a,p,f)},xls:function(n,o){var i=r.prototype.xls.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(y)?" ":t(e(o).text())}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xls.mimeType,fileExtension:r.prototype.xls.fileExtension})),p=r.prototype.xls.buttonContent,f=r.prototype.xls.defaultClass;d(a,p,f)},csv:function(n,o){var i=r.prototype.csv.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(y)?" ":'"'+t(e(o).text().replace(/"/g,'""'))+'"'}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.csv.mimeType,fileExtension:r.prototype.csv.fileExtension})),p=r.prototype.csv.buttonContent,f=r.prototype.csv.defaultClass;d(a,p,f)},txt:function(n,o){var i=r.prototype.txt.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(y)?" ":t(e(o).text())}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.txt.mimeType,fileExtension:r.prototype.txt.fileExtension})),p=r.prototype.txt.buttonContent,f=r.prototype.txt.defaultClass;d(a,p,f)}};s.settings.formats.forEach(function(t){!(!i||"xls"!==t)&&(t="xlsm"),!i&&"xlsx"===t&&(t=null),t&&v[t](l,h)})}),e("button[data-fileblob]").off("click").on("click",function(){var t=e(this).data("fileblob"),n=t.data,o=t.fileName,i=t.mimeType,s=t.fileExtension;r.prototype.export2file(n,i,o,s)}),s};r.prototype={version:"3.3.9",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",trimWhitespace:!1},charset:"charset=utf-8",defaultFileName:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return r.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=0;o!=t.length;++o)for(var r=0;r!=t[o].length;++r){n.s.r>o&&(n.s.r=o),n.s.c>r&&(n.s.c=r),n.e.r'+t+"")}function y(t,e,o){var i="";n(i)}var m=e(this);o&&m.find("caption:not(.head)").remove();var g=m.find("tbody").find("tr"),g=s.settings.headings?g.add(m.find("thead>tr")):g,g=s.settings.footers?g.add(m.find("tfoot>tr")):g,b=s.settings.headings?m.find("thead>tr").length:0,v="id"===s.settings.fileName?m.attr("id")?m.attr("id"):r.prototype.defaultFileName:s.settings.fileName,h={xlsx:function(n,o){var i={},s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return[r.map(function(o,r){if(!~c.indexOf(o)&&!e(r).is(x)){if(e(r).is(d))return" ";if(r.hasAttribute("colspan")&&(i[n]=i[n]||{},i[n][o+1]=r.getAttribute("colspan")-1),r.hasAttribute("rowspan"))for(var s=1;s=o?p+i[n][s]:p:f++,f!==a);s++);return new Array(p).concat(e(r).text())}return t(e(r).text())}}).get()]}}).get(),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xlsx.mimeType,fileExtension:r.prototype.xlsx.fileExtension})),p=r.prototype.xlsx.buttonContent,f=r.prototype.xlsx.defaultClass;y(a,p,f)},xlsm:function(n,o){var i={},s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return[r.map(function(o,r){if(!~c.indexOf(o)&&!e(r).is(x)){if(e(r).is(d))return" ";if(r.hasAttribute("colspan")&&(i[n]=i[n]||{},i[n][o+1]=r.getAttribute("colspan")-1),r.hasAttribute("rowspan"))for(var s=1;s=o?p+i[n][s]:p:f++,f!==a);s++);return new Array(p).concat(e(r).text())}return t(e(r).text())}}).get()]}}).get(),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xls.mimeType,fileExtension:r.prototype.xls.fileExtension})),p=r.prototype.xls.buttonContent,f=r.prototype.xls.defaultClass;y(a,p,f)},xls:function(n,o){var i=r.prototype.xls.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(d)?" ":t(e(o).text())}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xls.mimeType,fileExtension:r.prototype.xls.fileExtension})),p=r.prototype.xls.buttonContent,f=r.prototype.xls.defaultClass;y(a,p,f)},csv:function(n,o){var i=r.prototype.csv.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(d)?" ":'"'+t(e(o).text().replace(/"/g,'""'))+'"'}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.csv.mimeType,fileExtension:r.prototype.csv.fileExtension})),p=r.prototype.csv.buttonContent,f=r.prototype.csv.defaultClass;y(a,p,f)},txt:function(n,o){var i=r.prototype.txt.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(d)?" ":t(e(o).text())}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.txt.mimeType,fileExtension:r.prototype.txt.fileExtension})),p=r.prototype.txt.buttonContent,f=r.prototype.txt.defaultClass;y(a,p,f)}};s.settings.formats.forEach(function(t){!(!i||"xls"!==t)&&(t="xlsm"),!i&&"xlsx"===t&&(t=null),t&&h[t](l,v)})}),e("button[data-fileblob]").off("click").on("click",function(){var t=e(this).data("fileblob"),n=t.data,o=t.fileName,i=t.mimeType,s=t.fileExtension;r.prototype.export2file(n,i,o,s)}),s};r.prototype={version:"3.3.10",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",trimWhitespace:!1},charset:"charset=utf-8",defaultFileName:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return r.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=0;o!=t.length;++o)for(var r=0;r!=t[o].length;++r){n.s.r>o&&(n.s.r=o),n.s.c>r&&(n.s.c=r),n.e.r" ], diff --git a/src/stable/css/tableexport.css b/src/stable/css/tableexport.css index e8ee678..b63f8ad 100644 --- a/src/stable/css/tableexport.css +++ b/src/stable/css/tableexport.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ diff --git a/src/stable/css/tableexport.min.css b/src/stable/css/tableexport.min.css index c84a7dd..b6218c4 100644 --- a/src/stable/css/tableexport.min.css +++ b/src/stable/css/tableexport.min.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license - */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv:before,.txt:before,.xls:before,.xlsx:before{content:""}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{background:url(../img/xlsx.svg) center no-repeat #006400}.xls:before{background:url(../img/xls.svg) center no-repeat green}.csv:before{background:url(../img/csv.svg) center no-repeat #00f}.txt:before{background:url(../img/txt.svg) center no-repeat purple} \ No newline at end of file + */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{content:"";background:#006400 url(../img/xlsx.svg) no-repeat center}.xls:before{content:"";background:green url(../img/xls.svg) no-repeat center}.csv:before{content:"";background:#00f url(../img/csv.svg) no-repeat center}.txt:before{content:"";background:purple url(../img/txt.svg) no-repeat center} \ No newline at end of file diff --git a/src/stable/js/tableexport.js b/src/stable/js/tableexport.js index 5b6bd07..8c0112a 100644 --- a/src/stable/js/tableexport.js +++ b/src/stable/js/tableexport.js @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ @@ -309,7 +309,7 @@ * Version. * @memberof TableExport.prototype */ - version: "3.3.9", + version: "3.3.10", /** * Default plugin options. * @memberof TableExport.prototype @@ -503,9 +503,9 @@ data = this.string2ArrayBuffer(wbout); } var blob = new Blob([data], {type: mime + ";" + this.charset}); - if (navigator.appVersion.toString().indexOf('.NET') > 0) { + if (typeof saveAs === "undefined" && typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(blob, name + extension); - } else { + } else { saveAs(blob, name + extension, true); } }, diff --git a/src/stable/js/tableexport.min.js b/src/stable/js/tableexport.min.js index 29f4585..2824d3a 100644 --- a/src/stable/js/tableexport.min.js +++ b/src/stable/js/tableexport.min.js @@ -1,6 +1,6 @@ /*! - * TableExport.js v3.3.9 (https://www.travismclarke.com) + * TableExport.js v3.3.10 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ -!function(a,b){"function"==typeof define&&define.amd?define(["exports","jquery","blobjs","file-saverjs","xlsx-js"],b):"object"==typeof exports&&"string"!=typeof exports.nodeName?b(exports,require("jquery"),require("blobjs"),require("file-saverjs"),require("xlsx-js")):b(a,a.jQuery,a.Blob,a.saveAs,a.XLSX)}(this||window,function(a,b,c,d,e){"use strict";var f=function(a,c,d){var g=this;g.settings=d?c:b.extend({},f.prototype.defaults,c),g.selectors=a;var m,n,o,h=f.prototype.rowDel,i=g.settings.ignoreRows instanceof Array?g.settings.ignoreRows:[g.settings.ignoreRows],j=g.settings.ignoreCols instanceof Array?g.settings.ignoreCols:[g.settings.ignoreCols],k=g.settings.ignoreCSS instanceof Array?g.settings.ignoreCSS.join(", "):g.settings.ignoreCSS,l=g.settings.emptyCSS instanceof Array?g.settings.emptyCSS.join(", "):g.settings.emptyCSS;return g.settings.bootstrap?(m=f.prototype.bootstrap[0]+" ",n=f.prototype.bootstrap[1]+" ",o=f.prototype.bootstrap[2]+" "):(m=f.prototype.defaultButton+" ",n=o=""),g.selectors.each(function(){function s(a){return g.settings.trimWhitespace?a.trim():a}function t(b){var c=a.find("caption:not(.head)");c.length?c.append(b):a.prepend(''+b+"")}function u(a,b,c){var d="";t(d)}var a=b(this);d&&a.find("caption:not(.head)").remove();var c=a.find("tbody").find("tr"),c=g.settings.headings?c.add(a.find("thead>tr")):c,c=g.settings.footers?c.add(a.find("tfoot>tr")):c,p=g.settings.headings?a.find("thead>tr").length:0,q="id"===g.settings.fileName?a.attr("id")?a.attr("id"):f.prototype.defaultFileName:g.settings.fileName,r={xlsx:function(a,d){var e={},g=c.map(function(a,c){if(!~i.indexOf(a-p)&&!b(c).is(k)){var d=b(c).find("th, td");return[d.map(function(c,d){if(!~j.indexOf(c)&&!b(d).is(k)){if(b(d).is(l))return" ";if(d.hasAttribute("colspan")&&(e[a]=e[a]||{},e[a][c+1]=d.getAttribute("colspan")-1),d.hasAttribute("rowspan"))for(var f=1;f=c?h+e[a][f]:h:i++,i!==g);f++);return new Array(h).concat(b(d).text())}return s(b(d).text())}}).get()]}}).get(),h=f.prototype.escapeHtml(JSON.stringify({data:g,fileName:d,mimeType:f.prototype.xlsx.mimeType,fileExtension:f.prototype.xlsx.fileExtension})),m=f.prototype.xlsx.buttonContent,n=f.prototype.xlsx.defaultClass;u(h,m,n)},xlsm:function(a,d){var e={},g=c.map(function(a,c){if(!~i.indexOf(a-p)&&!b(c).is(k)){var d=b(c).find("th, td");return[d.map(function(c,d){if(!~j.indexOf(c)&&!b(d).is(k)){if(b(d).is(l))return" ";if(d.hasAttribute("colspan")&&(e[a]=e[a]||{},e[a][c+1]=d.getAttribute("colspan")-1),d.hasAttribute("rowspan"))for(var f=1;f=c?h+e[a][f]:h:i++,i!==g);f++);return new Array(h).concat(b(d).text())}return s(b(d).text())}}).get()]}}).get(),h=f.prototype.escapeHtml(JSON.stringify({data:g,fileName:d,mimeType:f.prototype.xls.mimeType,fileExtension:f.prototype.xls.fileExtension})),m=f.prototype.xls.buttonContent,n=f.prototype.xls.defaultClass;u(h,m,n)},xls:function(a,d){var e=f.prototype.xls.separator,g=c.map(function(a,c){if(!~i.indexOf(a-p)&&!b(c).is(k)){var d=b(c).find("th, td");return d.map(function(a,c){if(!~j.indexOf(a)&&!b(c).is(k))return b(c).is(l)?" ":s(b(c).text())}).get().join(e)}}).get().join(a),h=f.prototype.escapeHtml(JSON.stringify({data:g,fileName:d,mimeType:f.prototype.xls.mimeType,fileExtension:f.prototype.xls.fileExtension})),m=f.prototype.xls.buttonContent,n=f.prototype.xls.defaultClass;u(h,m,n)},csv:function(a,d){var e=f.prototype.csv.separator,g=c.map(function(a,c){if(!~i.indexOf(a-p)&&!b(c).is(k)){var d=b(c).find("th, td");return d.map(function(a,c){if(!~j.indexOf(a)&&!b(c).is(k))return b(c).is(l)?" ":'"'+s(b(c).text().replace(/"/g,'""'))+'"'}).get().join(e)}}).get().join(a),h=f.prototype.escapeHtml(JSON.stringify({data:g,fileName:d,mimeType:f.prototype.csv.mimeType,fileExtension:f.prototype.csv.fileExtension})),m=f.prototype.csv.buttonContent,n=f.prototype.csv.defaultClass;u(h,m,n)},txt:function(a,d){var e=f.prototype.txt.separator,g=c.map(function(a,c){if(!~i.indexOf(a-p)&&!b(c).is(k)){var d=b(c).find("th, td");return d.map(function(a,c){if(!~j.indexOf(a)&&!b(c).is(k))return b(c).is(l)?" ":s(b(c).text())}).get().join(e)}}).get().join(a),h=f.prototype.escapeHtml(JSON.stringify({data:g,fileName:d,mimeType:f.prototype.txt.mimeType,fileExtension:f.prototype.txt.fileExtension})),m=f.prototype.txt.buttonContent,n=f.prototype.txt.defaultClass;u(h,m,n)}};g.settings.formats.forEach(function(a){!(!e||"xls"!==a)&&(a="xlsm"),!e&&"xlsx"===a&&(a=null),a&&r[a](h,q)})}),b("button[data-fileblob]").off("click").on("click",function(){var a=b(this).data("fileblob"),c=a.data,d=a.fileName,e=a.mimeType,g=a.fileExtension;f.prototype.export2file(c,e,d,g)}),g};f.prototype={version:"3.3.9",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",trimWhitespace:!1},charset:"charset=utf-8",defaultFileName:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(a){return String(a).replace(/[&<>'\/]/g,function(a){return f.prototype.entityMap[a]})},dateNum:function(a,b){b&&(a+=1462);var c=Date.parse(a);return(c-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(a){for(var b={},c={s:{c:1e7,r:1e7},e:{c:0,r:0}},d=0;d!=a.length;++d)for(var f=0;f!=a[d].length;++f){c.s.r>d&&(c.s.r=d),c.s.c>f&&(c.s.c=f),c.e.r0?window.navigator.msSaveOrOpenBlob(l,f+g):d(l,f+g,!0)},update:function(a){return new f(this.selectors,b.extend({},this.settings,a),!0)},reset:function(){return new f(this.selectors,this.settings,!0)},remove:function(){this.selectors.each(function(){b(this).find("caption:not(.head)").remove()})}},b.fn.tableExport=function(a,b){return new f(this,a,b)};for(var g in f.prototype)b.fn.tableExport[g]=f.prototype[g];return a.default=a.TableExport=f}); \ No newline at end of file +!function(t,e){"function"==typeof define&&define.amd?define(["exports","jquery","blobjs","file-saverjs","xlsx-js"],e):"object"==typeof exports&&"string"!=typeof exports.nodeName?e(exports,require("jquery"),require("blobjs"),require("file-saverjs"),require("xlsx-js")):e(t,t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this||window,function(t,e,n,o,i){"use strict";var r=function(t,n,o){var s=this;s.settings=o?n:e.extend({},r.prototype.defaults,n),s.selectors=t;var a,p,f,l=r.prototype.rowDel,u=s.settings.ignoreRows instanceof Array?s.settings.ignoreRows:[s.settings.ignoreRows],c=s.settings.ignoreCols instanceof Array?s.settings.ignoreCols:[s.settings.ignoreCols],x=s.settings.ignoreCSS instanceof Array?s.settings.ignoreCSS.join(", "):s.settings.ignoreCSS,d=s.settings.emptyCSS instanceof Array?s.settings.emptyCSS.join(", "):s.settings.emptyCSS;return s.settings.bootstrap?(a=r.prototype.bootstrap[0]+" ",p=r.prototype.bootstrap[1]+" ",f=r.prototype.bootstrap[2]+" "):(a=r.prototype.defaultButton+" ",p=f=""),s.selectors.each(function(){function t(t){return s.settings.trimWhitespace?t.trim():t}function n(t){var e=m.find("caption:not(.head)");e.length?e.append(t):m.prepend(''+t+"")}function y(t,e,o){var i="";n(i)}var m=e(this);o&&m.find("caption:not(.head)").remove();var g=m.find("tbody").find("tr"),g=s.settings.headings?g.add(m.find("thead>tr")):g,g=s.settings.footers?g.add(m.find("tfoot>tr")):g,b=s.settings.headings?m.find("thead>tr").length:0,v="id"===s.settings.fileName?m.attr("id")?m.attr("id"):r.prototype.defaultFileName:s.settings.fileName,h={xlsx:function(n,o){var i={},s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return[r.map(function(o,r){if(!~c.indexOf(o)&&!e(r).is(x)){if(e(r).is(d))return" ";if(r.hasAttribute("colspan")&&(i[n]=i[n]||{},i[n][o+1]=r.getAttribute("colspan")-1),r.hasAttribute("rowspan"))for(var s=1;s=o?p+i[n][s]:p:f++,f!==a);s++);return new Array(p).concat(e(r).text())}return t(e(r).text())}}).get()]}}).get(),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xlsx.mimeType,fileExtension:r.prototype.xlsx.fileExtension})),p=r.prototype.xlsx.buttonContent,f=r.prototype.xlsx.defaultClass;y(a,p,f)},xlsm:function(n,o){var i={},s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return[r.map(function(o,r){if(!~c.indexOf(o)&&!e(r).is(x)){if(e(r).is(d))return" ";if(r.hasAttribute("colspan")&&(i[n]=i[n]||{},i[n][o+1]=r.getAttribute("colspan")-1),r.hasAttribute("rowspan"))for(var s=1;s=o?p+i[n][s]:p:f++,f!==a);s++);return new Array(p).concat(e(r).text())}return t(e(r).text())}}).get()]}}).get(),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xls.mimeType,fileExtension:r.prototype.xls.fileExtension})),p=r.prototype.xls.buttonContent,f=r.prototype.xls.defaultClass;y(a,p,f)},xls:function(n,o){var i=r.prototype.xls.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(d)?" ":t(e(o).text())}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.xls.mimeType,fileExtension:r.prototype.xls.fileExtension})),p=r.prototype.xls.buttonContent,f=r.prototype.xls.defaultClass;y(a,p,f)},csv:function(n,o){var i=r.prototype.csv.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(d)?" ":'"'+t(e(o).text().replace(/"/g,'""'))+'"'}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.csv.mimeType,fileExtension:r.prototype.csv.fileExtension})),p=r.prototype.csv.buttonContent,f=r.prototype.csv.defaultClass;y(a,p,f)},txt:function(n,o){var i=r.prototype.txt.separator,s=g.map(function(n,o){if(!~u.indexOf(n-b)&&!e(o).is(x)){var r=e(o).find("th, td");return r.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x))return e(o).is(d)?" ":t(e(o).text())}).get().join(i)}}).get().join(n),a=r.prototype.escapeHtml(JSON.stringify({data:s,fileName:o,mimeType:r.prototype.txt.mimeType,fileExtension:r.prototype.txt.fileExtension})),p=r.prototype.txt.buttonContent,f=r.prototype.txt.defaultClass;y(a,p,f)}};s.settings.formats.forEach(function(t){!(!i||"xls"!==t)&&(t="xlsm"),!i&&"xlsx"===t&&(t=null),t&&h[t](l,v)})}),e("button[data-fileblob]").off("click").on("click",function(){var t=e(this).data("fileblob"),n=t.data,o=t.fileName,i=t.mimeType,s=t.fileExtension;r.prototype.export2file(n,i,o,s)}),s};r.prototype={version:"3.3.10",defaults:{headings:!0,footers:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom",ignoreRows:null,ignoreCols:null,ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",trimWhitespace:!1},charset:"charset=utf-8",defaultFileName:"myDownload",defaultButton:"button-default",bootstrap:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return r.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=0;o!=t.length;++o)for(var r=0;r!=t[o].length;++r){n.s.r>o&&(n.s.r=o),n.s.c>r&&(n.s.c=r),n.e.r