From 7a1ca52797e62d0f926b35e0b19d11f79d67682b Mon Sep 17 00:00:00 2001 From: Travis Clarke Date: Wed, 21 Nov 2018 23:20:09 -0800 Subject: [PATCH] v5.0.5 - side is now applied directly to "style" attribute and does not require css --- README.md | 6 +++--- bower.json | 2 +- dist/css/tableexport.css | 2 +- dist/css/tableexport.min.css | 2 +- dist/js/tableexport.js | 4 ++-- dist/js/tableexport.min.js | 4 ++-- dist/tableexport.d.ts | 4 ++-- docs | 2 +- package.json | 2 +- src/stable/css/tableexport.css | 2 +- src/stable/css/tableexport.min.css | 2 +- src/stable/js/tableexport.js | 4 ++-- src/stable/js/tableexport.min.js | 4 ++-- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 57ea605..9fd5b57 100644 --- a/README.md +++ b/README.md @@ -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.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__ | — | [🔗xlsx](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/xlsx.svg)[🔗xls](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/xls.svg)[🔗csv](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/csv.svg)[🔗txt](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.4/img/txt.svg) | +| __CSS__ | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/css/tableexport.css) | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/css/tableexport.min.css) | +| __JS__ | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/js/tableexport.js) | [🔗](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/js/tableexport.min.js) | +| __Images__ | — | [🔗xlsx](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/img/xlsx.svg)[🔗xls](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/img/xls.svg)[🔗csv](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/img/csv.svg)[🔗txt](https://cdnjs.cloudflare.com/ajax/libs/TableExport/5.0.5/img/txt.svg) | #### [unpkg](https://unpkg.com/#/) diff --git a/bower.json b/bower.json index 700da7a..bd1485c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tableexport.js", - "version": "5.0.4", + "version": "5.0.5", "authors": [ "clarketm " ], diff --git a/dist/css/tableexport.css b/dist/css/tableexport.css index 34d392b..a445d33 100644 --- a/dist/css/tableexport.css +++ b/dist/css/tableexport.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * diff --git a/dist/css/tableexport.min.css b/dist/css/tableexport.min.css index 7bbb392..892ac75 100644 --- a/dist/css/tableexport.min.css +++ b/dist/css/tableexport.min.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * diff --git a/dist/js/tableexport.js b/dist/js/tableexport.js index f219c00..c559b0c 100644 --- a/dist/js/tableexport.js +++ b/dist/js/tableexport.js @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * @@ -149,7 +149,7 @@ * Version. * @memberof TableExport.prototype */ - version: '5.0.4', + version: '5.0.5', /** * Default library options. * @memberof TableExport.prototype diff --git a/dist/js/tableexport.min.js b/dist/js/tableexport.min.js index 11aa4bf..c65b4aa 100644 --- a/dist/js/tableexport.min.js +++ b/dist/js/tableexport.min.js @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * @@ -16,4 +16,4 @@ * limitations under the License. * */ -!function(t,r){if("function"==typeof define&&define.amd)define(function(t){var e;try{e=t("jquery")}catch(t){}return r(e,t("blobjs"),t("file-saverjs"),t("xlsx"))});else if("object"==typeof exports&&"string"!=typeof exports.nodeName){var e;try{e=require("jquery")}catch(t){}module.exports=r(e,require("blobjs"),require("file-saverjs"),require("xlsx"))}else t.TableExport=r(t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(e,s,l,c){"use strict";var o=function(t,e){var a=this;if(!t)return S('"selectors" is required. \nUsage: TableExport(selectors, options)');if(!a)return new o(t,e);a.settings=y({},a.defaults,e),a.selectors=C(t);var i=a.settings;i.ignoreRows=i.ignoreRows instanceof Array?i.ignoreRows:[i.ignoreRows],i.ignoreCols=i.ignoreCols instanceof Array?i.ignoreCols:[i.ignoreCols],i.ignoreCSS=a.ignoreCSS instanceof Array?a.ignoreCSS:[a.ignoreCSS],i.emptyCSS=a.emptyCSS instanceof Array?a.emptyCSS:[a.emptyCSS],i.formatValue=a.formatValue.bind(this,i.trimWhitespace),i.bootstrapSettings=function(t,e,r){var o={};o.bootstrapSpacing=t?(o.bootstrapClass=e[0]+" ",o.bootstrapTheme=e[1]+" ",e[2]+" "):(o.bootstrapClass=r+" ",o.bootstrapTheme="","");return o}(i.bootstrap,a.bootstrapConfig,a.defaultButton);var s={};a.getExportData=function(){return s},a.selectors.forEach(function(r){var o={};o.rows=C(r.querySelectorAll("tbody > tr")),o.rows=i.headers?C(r.querySelectorAll("thead > tr")).concat(o.rows):o.rows,o.rows=i.footers?o.rows.concat(C(r.querySelectorAll("tfoot > tr"))):o.rows,o.thAdj=i.headers?r.querySelectorAll("thead > tr").length:0,o.filename="id"===i.filename?r.getAttribute("id")?r.getAttribute("id"):a.defaultFilename:i.filename?i.filename:a.defaultFilename,o.uuid=b(r),o.checkCaption=function(t){var e=r.querySelectorAll("caption."+a.defaultCaptionClass);e.length?e[0].appendChild(t):((e=document.createElement("caption")).className=i.bootstrapSettings.bootstrapSpacing+a.defaultCaptionClass,e.style="caption-side: "+i.position,e.appendChild(t),r.insertBefore(e,r.firstChild))},o.setExportData=function(t){var e=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);s[o.uuid]=s[o.uuid]||{},s[o.uuid][r]=JSON.parse(e)},o.rcMap=(new p).build(o,i);var n=h.reduce(function(t,e){return t[e]=0,t},{});i.formats.forEach(function(t){return e=t,~h.indexOf(e)?function(t){var e;switch(t){case m.TXT:case m.CSV:case m.XLS:e=!0;break;default:e=d(t)}return e}(t)?void(n[t]||(o.setExportData(a.exporters.build.call(a,o,t)),n[t]++)):S('"'+t+'" requires "js-xlsx".'):S('"'+t+'" is not a valid format. \nFormats: '+h.join(", "));var e})});var r=document.querySelectorAll("button["+a.storageKey+"]");return n(r,"click",a.downloadHandler,a),a};o.prototype={version:"5.0.4",defaults:{headers:!0,footers:!0,formats:["xlsx","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},CONSTANTS:{FORMAT:{XLSX:"xlsx",XLSM:"xlsm",XLSB:"xlsb",BIFF2:"biff2",XLS:"xls",CSV:"csv",TXT:"txt"},TYPE:{STRING:"s",NUMBER:"n",BOOLEAN:"b",DATE:"d"}},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",defaultCaptionClass:"tableexport-caption",defaultNamespace:"tableexport-",tableKey:"tableexport-key",storageKey:"tableexport-id",ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",bootstrapConfig:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},formatConfig:{xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xlsm:{defaultClass:"xlsm",buttonContent:"Export to xlsm",mimeType:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",fileExtension:".xlsm"},xlsb:{defaultClass:"xlsb",buttonContent:"Export to xlsb",mimeType:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",fileExtension:".xlsb"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls",enforceStrictRFC4180:!1},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv",enforceStrictRFC4180:!0},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt",enforceStrictRFC4180:!0}},typeConfig:{string:{defaultClass:"tableexport-string"},number:{defaultClass:"tableexport-number",assert:function(t){return!isNaN(t)}},boolean:{defaultClass:"tableexport-boolean",assert:function(t){return"true"===t.toLowerCase()||"false"===t.toLowerCase()}},date:{defaultClass:"tableexport-date",assert:function(t){return!/.*%/.test(t)&&!isNaN(Date.parse(t))}}},exporters:{build:function(t,n){var a=this,i=a.settings,e=a.formatConfig[n],s=e.separator,l=t.rcMap,r=C(t.rows).map(function(t,o){return l.isIgnore(o)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o)?l.handleRowColMapProp(l.TYPE.EMPTY):C(t.querySelectorAll("th, td")).map(function(t,e){var r=function(t){if(d(n))return{v:i.formatValue(t.textContent),t:a.getType(t.className)};switch(n){case m.CSV:return'"'+i.formatValue(t.textContent.replace(/"/g,'""'))+'"';default:return i.formatValue(t.textContent)}}(t);return l.isIgnore(o,e)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o,e)?l.handleRowColMapProp(l.TYPE.EMPTY):l.handleRowColMapProp(l.TYPE.DEFAULT,o,e,n,r,s)}).processCols(n,s)}).processRows(n,a.rowDel),o=JSON.stringify({data:r,filename:t.filename,mimeType:e.mimeType,fileExtension:e.fileExtension,merges:l.merges}),p=v({uuid:t.uuid,type:n});return i.exportButtons&&t.checkCaption(a.createObjButton(p,o,e.buttonContent,e.defaultClass,i.bootstrapSettings)),u.getInstance().setItem(p,o,!0)}},createObjButton:function(t,e,r,o,n){var a=document.createElement("button");return a.setAttribute("type","button"),a.setAttribute(this.storageKey,t),a.className=n.bootstrapClass+n.bootstrapTheme+o,a.textContent=r,a},escapeHtml:function(t){var e=this;return String(t).replace(/[&<>'\/]/g,function(t){return e.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var r in this.entityMap)e=e.replace(RegExp(this.entityMap[r],"g"),r);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=this.typeConfig;return~t.indexOf(e.string.defaultClass)?g.STRING:~t.indexOf(e.number.defaultClass)?g.NUMBER:~t.indexOf(e.boolean.defaultClass)?g.BOOLEAN:~t.indexOf(e.date.defaultClass)?g.DATE:""},dateNum:function(t,e){e&&(t+=1462);var r=(Date.parse(t)-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t,e){for(var r={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},n=this.typeConfig,a=0;a!==t.length;++a)for(var i=0;i!==t[a].length;++i){o.s.r>a&&(o.s.r=a),o.s.c>i&&(o.s.c=i),o.e.r tr")),o.rows=i.headers?C(r.querySelectorAll("thead > tr")).concat(o.rows):o.rows,o.rows=i.footers?o.rows.concat(C(r.querySelectorAll("tfoot > tr"))):o.rows,o.thAdj=i.headers?r.querySelectorAll("thead > tr").length:0,o.filename="id"===i.filename?r.getAttribute("id")?r.getAttribute("id"):a.defaultFilename:i.filename?i.filename:a.defaultFilename,o.uuid=b(r),o.checkCaption=function(t){var e=r.querySelectorAll("caption."+a.defaultCaptionClass);e.length?e[0].appendChild(t):((e=document.createElement("caption")).className=i.bootstrapSettings.bootstrapSpacing+a.defaultCaptionClass,e.style="caption-side: "+i.position,e.appendChild(t),r.insertBefore(e,r.firstChild))},o.setExportData=function(t){var e=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);s[o.uuid]=s[o.uuid]||{},s[o.uuid][r]=JSON.parse(e)},o.rcMap=(new p).build(o,i);var n=h.reduce(function(t,e){return t[e]=0,t},{});i.formats.forEach(function(t){return e=t,~h.indexOf(e)?function(t){var e;switch(t){case m.TXT:case m.CSV:case m.XLS:e=!0;break;default:e=d(t)}return e}(t)?void(n[t]||(o.setExportData(a.exporters.build.call(a,o,t)),n[t]++)):S('"'+t+'" requires "js-xlsx".'):S('"'+t+'" is not a valid format. \nFormats: '+h.join(", "));var e})});var r=document.querySelectorAll("button["+a.storageKey+"]");return n(r,"click",a.downloadHandler,a),a};o.prototype={version:"5.0.5",defaults:{headers:!0,footers:!0,formats:["xlsx","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},CONSTANTS:{FORMAT:{XLSX:"xlsx",XLSM:"xlsm",XLSB:"xlsb",BIFF2:"biff2",XLS:"xls",CSV:"csv",TXT:"txt"},TYPE:{STRING:"s",NUMBER:"n",BOOLEAN:"b",DATE:"d"}},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",defaultCaptionClass:"tableexport-caption",defaultNamespace:"tableexport-",tableKey:"tableexport-key",storageKey:"tableexport-id",ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",bootstrapConfig:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},formatConfig:{xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xlsm:{defaultClass:"xlsm",buttonContent:"Export to xlsm",mimeType:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",fileExtension:".xlsm"},xlsb:{defaultClass:"xlsb",buttonContent:"Export to xlsb",mimeType:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",fileExtension:".xlsb"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls",enforceStrictRFC4180:!1},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv",enforceStrictRFC4180:!0},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt",enforceStrictRFC4180:!0}},typeConfig:{string:{defaultClass:"tableexport-string"},number:{defaultClass:"tableexport-number",assert:function(t){return!isNaN(t)}},boolean:{defaultClass:"tableexport-boolean",assert:function(t){return"true"===t.toLowerCase()||"false"===t.toLowerCase()}},date:{defaultClass:"tableexport-date",assert:function(t){return!/.*%/.test(t)&&!isNaN(Date.parse(t))}}},exporters:{build:function(t,n){var a=this,i=a.settings,e=a.formatConfig[n],s=e.separator,l=t.rcMap,r=C(t.rows).map(function(t,o){return l.isIgnore(o)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o)?l.handleRowColMapProp(l.TYPE.EMPTY):C(t.querySelectorAll("th, td")).map(function(t,e){var r=function(t){if(d(n))return{v:i.formatValue(t.textContent),t:a.getType(t.className)};switch(n){case m.CSV:return'"'+i.formatValue(t.textContent.replace(/"/g,'""'))+'"';default:return i.formatValue(t.textContent)}}(t);return l.isIgnore(o,e)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o,e)?l.handleRowColMapProp(l.TYPE.EMPTY):l.handleRowColMapProp(l.TYPE.DEFAULT,o,e,n,r,s)}).processCols(n,s)}).processRows(n,a.rowDel),o=JSON.stringify({data:r,filename:t.filename,mimeType:e.mimeType,fileExtension:e.fileExtension,merges:l.merges}),p=v({uuid:t.uuid,type:n});return i.exportButtons&&t.checkCaption(a.createObjButton(p,o,e.buttonContent,e.defaultClass,i.bootstrapSettings)),u.getInstance().setItem(p,o,!0)}},createObjButton:function(t,e,r,o,n){var a=document.createElement("button");return a.setAttribute("type","button"),a.setAttribute(this.storageKey,t),a.className=n.bootstrapClass+n.bootstrapTheme+o,a.textContent=r,a},escapeHtml:function(t){var e=this;return String(t).replace(/[&<>'\/]/g,function(t){return e.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var r in this.entityMap)e=e.replace(RegExp(this.entityMap[r],"g"),r);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=this.typeConfig;return~t.indexOf(e.string.defaultClass)?g.STRING:~t.indexOf(e.number.defaultClass)?g.NUMBER:~t.indexOf(e.boolean.defaultClass)?g.BOOLEAN:~t.indexOf(e.date.defaultClass)?g.DATE:""},dateNum:function(t,e){e&&(t+=1462);var r=(Date.parse(t)-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t,e){for(var r={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},n=this.typeConfig,a=0;a!==t.length;++a)for(var i=0;i!==t[a].length;++i){o.s.r>a&&(o.s.r=a),o.s.c>i&&(o.s.c=i),o.e.r /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * diff --git a/docs b/docs index 2817317..906f024 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 281731775ea991cea3c5f6bb914b3fa3d5803eca +Subproject commit 906f024d03f32d9ecacd24896fd5969c5dd9e352 diff --git a/package.json b/package.json index 91c88d8..faa038a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tableexport", - "version": "5.0.4", + "version": "5.0.5", "authors": [ "clarketm " ], diff --git a/src/stable/css/tableexport.css b/src/stable/css/tableexport.css index 34d392b..a445d33 100644 --- a/src/stable/css/tableexport.css +++ b/src/stable/css/tableexport.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * diff --git a/src/stable/css/tableexport.min.css b/src/stable/css/tableexport.min.css index 7bbb392..892ac75 100644 --- a/src/stable/css/tableexport.min.css +++ b/src/stable/css/tableexport.min.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * diff --git a/src/stable/js/tableexport.js b/src/stable/js/tableexport.js index f219c00..c559b0c 100644 --- a/src/stable/js/tableexport.js +++ b/src/stable/js/tableexport.js @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * @@ -149,7 +149,7 @@ * Version. * @memberof TableExport.prototype */ - version: '5.0.4', + version: '5.0.5', /** * Default library options. * @memberof TableExport.prototype diff --git a/src/stable/js/tableexport.min.js b/src/stable/js/tableexport.min.js index 11aa4bf..c65b4aa 100644 --- a/src/stable/js/tableexport.min.js +++ b/src/stable/js/tableexport.min.js @@ -1,5 +1,5 @@ /*! - * TableExport.js v5.0.4 (https://www.travismclarke.com) + * TableExport.js v5.0.5 (https://www.travismclarke.com) * * Copyright (c) 2018 - Travis Clarke - https://www.travismclarke.com * @@ -16,4 +16,4 @@ * limitations under the License. * */ -!function(t,r){if("function"==typeof define&&define.amd)define(function(t){var e;try{e=t("jquery")}catch(t){}return r(e,t("blobjs"),t("file-saverjs"),t("xlsx"))});else if("object"==typeof exports&&"string"!=typeof exports.nodeName){var e;try{e=require("jquery")}catch(t){}module.exports=r(e,require("blobjs"),require("file-saverjs"),require("xlsx"))}else t.TableExport=r(t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(e,s,l,c){"use strict";var o=function(t,e){var a=this;if(!t)return S('"selectors" is required. \nUsage: TableExport(selectors, options)');if(!a)return new o(t,e);a.settings=y({},a.defaults,e),a.selectors=C(t);var i=a.settings;i.ignoreRows=i.ignoreRows instanceof Array?i.ignoreRows:[i.ignoreRows],i.ignoreCols=i.ignoreCols instanceof Array?i.ignoreCols:[i.ignoreCols],i.ignoreCSS=a.ignoreCSS instanceof Array?a.ignoreCSS:[a.ignoreCSS],i.emptyCSS=a.emptyCSS instanceof Array?a.emptyCSS:[a.emptyCSS],i.formatValue=a.formatValue.bind(this,i.trimWhitespace),i.bootstrapSettings=function(t,e,r){var o={};o.bootstrapSpacing=t?(o.bootstrapClass=e[0]+" ",o.bootstrapTheme=e[1]+" ",e[2]+" "):(o.bootstrapClass=r+" ",o.bootstrapTheme="","");return o}(i.bootstrap,a.bootstrapConfig,a.defaultButton);var s={};a.getExportData=function(){return s},a.selectors.forEach(function(r){var o={};o.rows=C(r.querySelectorAll("tbody > tr")),o.rows=i.headers?C(r.querySelectorAll("thead > tr")).concat(o.rows):o.rows,o.rows=i.footers?o.rows.concat(C(r.querySelectorAll("tfoot > tr"))):o.rows,o.thAdj=i.headers?r.querySelectorAll("thead > tr").length:0,o.filename="id"===i.filename?r.getAttribute("id")?r.getAttribute("id"):a.defaultFilename:i.filename?i.filename:a.defaultFilename,o.uuid=b(r),o.checkCaption=function(t){var e=r.querySelectorAll("caption."+a.defaultCaptionClass);e.length?e[0].appendChild(t):((e=document.createElement("caption")).className=i.bootstrapSettings.bootstrapSpacing+a.defaultCaptionClass,e.style="caption-side: "+i.position,e.appendChild(t),r.insertBefore(e,r.firstChild))},o.setExportData=function(t){var e=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);s[o.uuid]=s[o.uuid]||{},s[o.uuid][r]=JSON.parse(e)},o.rcMap=(new p).build(o,i);var n=h.reduce(function(t,e){return t[e]=0,t},{});i.formats.forEach(function(t){return e=t,~h.indexOf(e)?function(t){var e;switch(t){case m.TXT:case m.CSV:case m.XLS:e=!0;break;default:e=d(t)}return e}(t)?void(n[t]||(o.setExportData(a.exporters.build.call(a,o,t)),n[t]++)):S('"'+t+'" requires "js-xlsx".'):S('"'+t+'" is not a valid format. \nFormats: '+h.join(", "));var e})});var r=document.querySelectorAll("button["+a.storageKey+"]");return n(r,"click",a.downloadHandler,a),a};o.prototype={version:"5.0.4",defaults:{headers:!0,footers:!0,formats:["xlsx","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},CONSTANTS:{FORMAT:{XLSX:"xlsx",XLSM:"xlsm",XLSB:"xlsb",BIFF2:"biff2",XLS:"xls",CSV:"csv",TXT:"txt"},TYPE:{STRING:"s",NUMBER:"n",BOOLEAN:"b",DATE:"d"}},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",defaultCaptionClass:"tableexport-caption",defaultNamespace:"tableexport-",tableKey:"tableexport-key",storageKey:"tableexport-id",ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",bootstrapConfig:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},formatConfig:{xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xlsm:{defaultClass:"xlsm",buttonContent:"Export to xlsm",mimeType:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",fileExtension:".xlsm"},xlsb:{defaultClass:"xlsb",buttonContent:"Export to xlsb",mimeType:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",fileExtension:".xlsb"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls",enforceStrictRFC4180:!1},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv",enforceStrictRFC4180:!0},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt",enforceStrictRFC4180:!0}},typeConfig:{string:{defaultClass:"tableexport-string"},number:{defaultClass:"tableexport-number",assert:function(t){return!isNaN(t)}},boolean:{defaultClass:"tableexport-boolean",assert:function(t){return"true"===t.toLowerCase()||"false"===t.toLowerCase()}},date:{defaultClass:"tableexport-date",assert:function(t){return!/.*%/.test(t)&&!isNaN(Date.parse(t))}}},exporters:{build:function(t,n){var a=this,i=a.settings,e=a.formatConfig[n],s=e.separator,l=t.rcMap,r=C(t.rows).map(function(t,o){return l.isIgnore(o)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o)?l.handleRowColMapProp(l.TYPE.EMPTY):C(t.querySelectorAll("th, td")).map(function(t,e){var r=function(t){if(d(n))return{v:i.formatValue(t.textContent),t:a.getType(t.className)};switch(n){case m.CSV:return'"'+i.formatValue(t.textContent.replace(/"/g,'""'))+'"';default:return i.formatValue(t.textContent)}}(t);return l.isIgnore(o,e)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o,e)?l.handleRowColMapProp(l.TYPE.EMPTY):l.handleRowColMapProp(l.TYPE.DEFAULT,o,e,n,r,s)}).processCols(n,s)}).processRows(n,a.rowDel),o=JSON.stringify({data:r,filename:t.filename,mimeType:e.mimeType,fileExtension:e.fileExtension,merges:l.merges}),p=v({uuid:t.uuid,type:n});return i.exportButtons&&t.checkCaption(a.createObjButton(p,o,e.buttonContent,e.defaultClass,i.bootstrapSettings)),u.getInstance().setItem(p,o,!0)}},createObjButton:function(t,e,r,o,n){var a=document.createElement("button");return a.setAttribute("type","button"),a.setAttribute(this.storageKey,t),a.className=n.bootstrapClass+n.bootstrapTheme+o,a.textContent=r,a},escapeHtml:function(t){var e=this;return String(t).replace(/[&<>'\/]/g,function(t){return e.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var r in this.entityMap)e=e.replace(RegExp(this.entityMap[r],"g"),r);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=this.typeConfig;return~t.indexOf(e.string.defaultClass)?g.STRING:~t.indexOf(e.number.defaultClass)?g.NUMBER:~t.indexOf(e.boolean.defaultClass)?g.BOOLEAN:~t.indexOf(e.date.defaultClass)?g.DATE:""},dateNum:function(t,e){e&&(t+=1462);var r=(Date.parse(t)-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t,e){for(var r={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},n=this.typeConfig,a=0;a!==t.length;++a)for(var i=0;i!==t[a].length;++i){o.s.r>a&&(o.s.r=a),o.s.c>i&&(o.s.c=i),o.e.r tr")),o.rows=i.headers?C(r.querySelectorAll("thead > tr")).concat(o.rows):o.rows,o.rows=i.footers?o.rows.concat(C(r.querySelectorAll("tfoot > tr"))):o.rows,o.thAdj=i.headers?r.querySelectorAll("thead > tr").length:0,o.filename="id"===i.filename?r.getAttribute("id")?r.getAttribute("id"):a.defaultFilename:i.filename?i.filename:a.defaultFilename,o.uuid=b(r),o.checkCaption=function(t){var e=r.querySelectorAll("caption."+a.defaultCaptionClass);e.length?e[0].appendChild(t):((e=document.createElement("caption")).className=i.bootstrapSettings.bootstrapSpacing+a.defaultCaptionClass,e.style="caption-side: "+i.position,e.appendChild(t),r.insertBefore(e,r.firstChild))},o.setExportData=function(t){var e=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);s[o.uuid]=s[o.uuid]||{},s[o.uuid][r]=JSON.parse(e)},o.rcMap=(new p).build(o,i);var n=h.reduce(function(t,e){return t[e]=0,t},{});i.formats.forEach(function(t){return e=t,~h.indexOf(e)?function(t){var e;switch(t){case m.TXT:case m.CSV:case m.XLS:e=!0;break;default:e=d(t)}return e}(t)?void(n[t]||(o.setExportData(a.exporters.build.call(a,o,t)),n[t]++)):S('"'+t+'" requires "js-xlsx".'):S('"'+t+'" is not a valid format. \nFormats: '+h.join(", "));var e})});var r=document.querySelectorAll("button["+a.storageKey+"]");return n(r,"click",a.downloadHandler,a),a};o.prototype={version:"5.0.5",defaults:{headers:!0,footers:!0,formats:["xlsx","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},CONSTANTS:{FORMAT:{XLSX:"xlsx",XLSM:"xlsm",XLSB:"xlsb",BIFF2:"biff2",XLS:"xls",CSV:"csv",TXT:"txt"},TYPE:{STRING:"s",NUMBER:"n",BOOLEAN:"b",DATE:"d"}},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",defaultCaptionClass:"tableexport-caption",defaultNamespace:"tableexport-",tableKey:"tableexport-key",storageKey:"tableexport-id",ignoreCSS:".tableexport-ignore",emptyCSS:".tableexport-empty",bootstrapConfig:["btn","btn-default","btn-toolbar"],rowDel:"\r\n",entityMap:{"&":"&","<":"<",">":">","'":"'","/":"/"},formatConfig:{xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xlsm:{defaultClass:"xlsm",buttonContent:"Export to xlsm",mimeType:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",fileExtension:".xlsm"},xlsb:{defaultClass:"xlsb",buttonContent:"Export to xlsb",mimeType:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",fileExtension:".xlsb"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:"\t",mimeType:"application/vnd.ms-excel",fileExtension:".xls",enforceStrictRFC4180:!1},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"text/csv",fileExtension:".csv",enforceStrictRFC4180:!0},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt",enforceStrictRFC4180:!0}},typeConfig:{string:{defaultClass:"tableexport-string"},number:{defaultClass:"tableexport-number",assert:function(t){return!isNaN(t)}},boolean:{defaultClass:"tableexport-boolean",assert:function(t){return"true"===t.toLowerCase()||"false"===t.toLowerCase()}},date:{defaultClass:"tableexport-date",assert:function(t){return!/.*%/.test(t)&&!isNaN(Date.parse(t))}}},exporters:{build:function(t,n){var a=this,i=a.settings,e=a.formatConfig[n],s=e.separator,l=t.rcMap,r=C(t.rows).map(function(t,o){return l.isIgnore(o)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o)?l.handleRowColMapProp(l.TYPE.EMPTY):C(t.querySelectorAll("th, td")).map(function(t,e){var r=function(t){if(d(n))return{v:i.formatValue(t.textContent),t:a.getType(t.className)};switch(n){case m.CSV:return'"'+i.formatValue(t.textContent.replace(/"/g,'""'))+'"';default:return i.formatValue(t.textContent)}}(t);return l.isIgnore(o,e)?l.handleRowColMapProp(l.TYPE.IGNORE):l.isEmpty(o,e)?l.handleRowColMapProp(l.TYPE.EMPTY):l.handleRowColMapProp(l.TYPE.DEFAULT,o,e,n,r,s)}).processCols(n,s)}).processRows(n,a.rowDel),o=JSON.stringify({data:r,filename:t.filename,mimeType:e.mimeType,fileExtension:e.fileExtension,merges:l.merges}),p=v({uuid:t.uuid,type:n});return i.exportButtons&&t.checkCaption(a.createObjButton(p,o,e.buttonContent,e.defaultClass,i.bootstrapSettings)),u.getInstance().setItem(p,o,!0)}},createObjButton:function(t,e,r,o,n){var a=document.createElement("button");return a.setAttribute("type","button"),a.setAttribute(this.storageKey,t),a.className=n.bootstrapClass+n.bootstrapTheme+o,a.textContent=r,a},escapeHtml:function(t){var e=this;return String(t).replace(/[&<>'\/]/g,function(t){return e.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var r in this.entityMap)e=e.replace(RegExp(this.entityMap[r],"g"),r);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=this.typeConfig;return~t.indexOf(e.string.defaultClass)?g.STRING:~t.indexOf(e.number.defaultClass)?g.NUMBER:~t.indexOf(e.boolean.defaultClass)?g.BOOLEAN:~t.indexOf(e.date.defaultClass)?g.DATE:""},dateNum:function(t,e){e&&(t+=1462);var r=(Date.parse(t)-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t,e){for(var r={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},n=this.typeConfig,a=0;a!==t.length;++a)for(var i=0;i!==t[a].length;++i){o.s.r>a&&(o.s.r=a),o.s.c>i&&(o.s.c=i),o.e.r