tableexport
Advanced tools
Comparing version 4.0.8 to 4.0.9
{ | ||
"name": "tableexport.js", | ||
"version": "4.0.8", | ||
"version": "4.0.9", | ||
"authors": [ | ||
@@ -28,3 +28,3 @@ "clarketm <travis.m.clarke@gmail.com>" | ||
}, | ||
"license": "MIT", | ||
"license": "Apache-2.0", | ||
"homepage": "https://www.travismclarke.com/tableexport/", | ||
@@ -31,0 +31,0 @@ "ignore": [ |
/*! | ||
* TableExport.js v4.0.8 (https://www.travismclarke.com) | ||
* Copyright 2017 Travis Clarke | ||
* Licensed under the MIT license | ||
* TableExport.js v4.0.9 (https://www.travismclarke.com) | ||
* | ||
* Copyright (c) 2017 - Travis Clarke - https://www.travismclarke.com | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
@@ -131,3 +144,3 @@ | ||
*/ | ||
version: '4.0.8', | ||
version: '4.0.9', | ||
/** | ||
@@ -134,0 +147,0 @@ * Default library options. |
/*! | ||
* TableExport.js v4.0.8 (https://www.travismclarke.com) | ||
* Copyright 2017 Travis Clarke | ||
* Licensed under the MIT license | ||
* TableExport.js v4.0.9 (https://www.travismclarke.com) | ||
* | ||
* Copyright (c) 2017 - Travis Clarke - https://www.travismclarke.com | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
!function(t,e){if("function"==typeof define&&define.amd)define(function(t){var n;try{n=t("jquery")}catch(r){}return e(n,t("blobjs"),t("file-saverjs"),t("xlsx"))});else if("object"==typeof exports&&"string"!=typeof exports.nodeName){var n;try{n=require("jquery")}catch(r){}module.exports=e(n,require("blobjs"),require("file-saverjs"),require("xlsx"))}else t.TableExport=e(t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(t,e,n,r){"use strict";function o(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return"undefined"==typeof t.length?[].concat(t):[].slice.call(t)}function a(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}function s(t,e,n){var r={};return t?(r.bootstrapClass=e[0]+" ",r.bootstrapTheme=e[1]+" ",r.bootstrapSpacing=e[2]+" "):(r.bootstrapClass=n+" ",r.bootstrapTheme="",r.bootstrapSpacing=""),r}var l=function(t,e){var n=this;if(!t)return new Error('"selectors" is required');if(!n)return new l(t,e);n.settings=o({},n.defaults,e),n.selectors=i(t);var a=n.settings;a.ignoreRows=a.ignoreRows instanceof Array?a.ignoreRows:[a.ignoreRows],a.ignoreCols=a.ignoreCols instanceof Array?a.ignoreCols:[a.ignoreCols],a.ignoreCSS=n.ignoreCSS instanceof Array?n.ignoreCSS.join(", "):n.ignoreCSS,a.emptyCSS=n.emptyCSS instanceof Array?n.emptyCSS.join(", "):n.emptyCSS,a.formatValue=n.formatValue.bind(this,a.trimWhitespace),a.bootstrapSettings=s(a.bootstrap,n.bootstrapConfig,n.defaultButton);var c={};n.getExportData=function(){return c},n.selectors.forEach(function(t){var e={};e.rows=i(t.querySelectorAll("tbody > tr")),e.rows=a.headers?i(t.querySelectorAll("thead > tr")).concat(e.rows):e.rows,e.rows=a.footers?e.rows.concat(i(t.querySelectorAll("tfoot > tr"))):e.rows,e.thAdj=a.headers?t.querySelectorAll("thead > tr").length:0,e.filename="id"===a.filename?t.getAttribute("id")?t.getAttribute("id"):n.defaultFilename:a.filename?a.filename:n.defaultFilename,e.uuid=p(t),e.checkCaption=function(e){var n=t.querySelectorAll("caption.tableexport-caption");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=a.bootstrapSettings.bootstrapSpacing+a.position+" tableexport-caption",n.appendChild(e),t.insertBefore(n,t.firstChild))},e.setExportData=function(){return function(t){var n=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);c[e.uuid]=c[e.uuid]||{},c[e.uuid][r]=JSON.parse(n)}}();var o={};for(var s in f)o[s]=0;a.formats.forEach(function(t){!(!r||m||t!==f.xls)&&(t=f.biff2),!(r&&!m||t!==f.xlsx)&&(t=f.xls),o[t]||(e.setExportData(n.exporters[t].call(n,e)),o[t]++)})});var x=document.querySelectorAll("button[tableexport-id]");return d(x,"click",n.downloadHandler,n),n};l.prototype={version:"4.0.8",defaults:{headers:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",ignoreCSS:"tableexport-ignore",emptyCSS:"tableexport-empty",bootstrapConfig:["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"},types:{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:{xlsx:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xlsx.mimeType,fileExtension:l.prototype.xlsx.fileExtension}),p=l.prototype.xlsx.buttonContent,d=l.prototype.xlsx.defaultClass,m=c({uuid:t.uuid,type:f.xlsx}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},biff2:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},xls:function(t){var e=this,n=e.settings,r=l.prototype.xls.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":t.textContent}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},csv:function(t){var e=this,n=e.settings,r=l.prototype.csv.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":'"'+n.formatValue(t.textContent.replace(/"/g,'""'))+'"'}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.csv.mimeType,fileExtension:l.prototype.csv.fileExtension}),p=l.prototype.csv.buttonContent,d=l.prototype.csv.defaultClass,m=c({uuid:t.uuid,type:f.csv}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},txt:function(t){var e=this,n=e.settings,r=l.prototype.txt.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":n.formatValue(t.textContent)}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.txt.mimeType,fileExtension:l.prototype.txt.fileExtension}),p=l.prototype.txt.buttonContent,d=l.prototype.txt.defaultClass,m=c({uuid:t.uuid,type:f.txt}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m}},createObjButton:function(t,e,n,r,o){var i=document.createElement("button");return i.setAttribute("tableexport-id",t),i.className=o.bootstrapClass+o.bootstrapTheme+r,i.textContent=n,i},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return l.prototype.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var n in this.entityMap)e=e.replace(RegExp(this.entityMap[n],"g"),n);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=l.prototype.types;return~t.indexOf(e.string.defaultClass)?"s":~t.indexOf(e.number.defaultClass)?"n":~t.indexOf(e["boolean"].defaultClass)?"b":~t.indexOf(e.date.defaultClass)?"d":""},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t),r=(n-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=l.prototype.types,i=0;i!==t.length;++i)for(var a=0;a!==t[i].length;++a){n.s.r>i&&(n.s.r=i),n.s.c>a&&(n.s.c=a),n.e.r<i&&(n.e.r=i),n.e.c<a&&(n.e.c=a);var s=t[i][a];if(s&&s.v){var u=r.utils.encode_cell({c:a,r:i});s.t||(o.number.assert(s.v)?s.t="n":o["boolean"].assert(s.v)?s.t="b":o.date.assert(s.v)?s.t="d":s.t="s"),"d"===s.t&&(s.t="n",s.z=r.SSF._table[14],s.v=this.dateNum(s.v)),e[u]=s}}return n.s.c<1e7&&(e["!ref"]=r.utils.encode_range(n)),e},downloadHandler:function(t){var e=t.target,n=JSON.parse(u.getInstance().getItem(e.getAttribute("tableexport-id"))),r=n.data,o=n.filename,i=n.mimeType,a=n.fileExtension;this.export2file(r,i,o,a)},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},export2file:function(t,r,o,i){if(t=this.getBinaryData(t,i,o),m){var a="data:"+r+";"+this.charset+","+t;this.downloadDataURI(a,o,i)}else n(new e([t],{type:r+";"+this.charset}),o+i,!0)},downloadDataURI:function(t,e,n){var r=encodeURI(t),o=document.createElement("a");o.setAttribute("href",r),o.setAttribute("download",e+n),document.body.appendChild(o),o.click()},getBinaryData:function(t,e,n){if(r&&!m&&".xls"===e.substr(0,4)){var o=new this.Workbook,i=this.createSheet(t),a=e.substr(1)===f.xls?f.biff2:f.xlsx;n=n||"",o.SheetNames.push(n),o.Sheets[n]=i;var s={bookType:a,bookSST:!1,type:"binary"},l=r.write(o,s);t=this.string2ArrayBuffer(l)}return t},update:function(t){return l.prototype.remove.call(this),new l(this.selectors,o({},this.defaults,t))},reset:function(){return l.prototype.remove.call(this),new l(this.selectors,this.settings)},remove:function(){this.selectors.forEach(function(t){var e=t.querySelector("caption.tableexport-caption");e&&t.removeChild(e)})},LocalStorage:function(){this.store=localStorage,this.namespace="te-",this.getKey=function(t){return this.namespace+t},this.setItem=function(t,e,n){var r=this.getKey(t);if(!this.exists(r)||n)return"string"!=typeof e?this.error('"value" must be a string'):this.store.setItem(r,e)},this.getItem=function(t){var e=this.getKey(t);return this.store.getItem(e)},this.exists=function(t){var e=this.getKey(t);return null!==this.store.getItem(e)},this.removeItem=function(t){var e=this.getKey(t);return this.store.removeItem(e)},this.error=function(t){return new Error("error:",t)}}};var u=l.prototype.LocalStorage;u.getInstance=function(){return u._instance=null,function(){return u._instance||(u._instance=new u),u._instance}}();var p=function(){var t=0;return function(e){return e.id||(e.id="tableexport-"+ ++t),e.id}}(),f=function(){return{xlsx:"xlsx",biff2:"biff2",xls:"xls",csv:"csv",txt:"txt"}}(),c=function(){var t,e,n=0;return function(r){var o=r.type;if(r=JSON.stringify(r),0===r.length)return n;for(t=0;t<r.length;t++)e=r.charCodeAt(t),n=(n<<5)-n+e,n|=0;return n.toString(16).substring(1)+"-"+o}}(),d=function(){var t=null;return function(e,n,r,o){for(var i=r.bind(o),a=0;a<e.length;++a)t&&e[a].removeEventListener(n,t,!1),e[a].addEventListener(n,i,!1);t=i}}(),m=function(t){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}(navigator.userAgent||navigator.vendor||window.opera);if(t){t.fn.tableExport=function(t){return new l(this,t)};for(var x in l.prototype)t.fn.tableExport[x]=l.prototype[x]}return l.TableExport=l,l}); | ||
!function(t,e){if("function"==typeof define&&define.amd)define(function(t){var n;try{n=t("jquery")}catch(r){}return e(n,t("blobjs"),t("file-saverjs"),t("xlsx"))});else if("object"==typeof exports&&"string"!=typeof exports.nodeName){var n;try{n=require("jquery")}catch(r){}module.exports=e(n,require("blobjs"),require("file-saverjs"),require("xlsx"))}else t.TableExport=e(t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(t,e,n,r){"use strict";function o(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return"undefined"==typeof t.length?[].concat(t):[].slice.call(t)}function a(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}function s(t,e,n){var r={};return t?(r.bootstrapClass=e[0]+" ",r.bootstrapTheme=e[1]+" ",r.bootstrapSpacing=e[2]+" "):(r.bootstrapClass=n+" ",r.bootstrapTheme="",r.bootstrapSpacing=""),r}var l=function(t,e){var n=this;if(!t)return new Error('"selectors" is required');if(!n)return new l(t,e);n.settings=o({},n.defaults,e),n.selectors=i(t);var a=n.settings;a.ignoreRows=a.ignoreRows instanceof Array?a.ignoreRows:[a.ignoreRows],a.ignoreCols=a.ignoreCols instanceof Array?a.ignoreCols:[a.ignoreCols],a.ignoreCSS=n.ignoreCSS instanceof Array?n.ignoreCSS.join(", "):n.ignoreCSS,a.emptyCSS=n.emptyCSS instanceof Array?n.emptyCSS.join(", "):n.emptyCSS,a.formatValue=n.formatValue.bind(this,a.trimWhitespace),a.bootstrapSettings=s(a.bootstrap,n.bootstrapConfig,n.defaultButton);var c={};n.getExportData=function(){return c},n.selectors.forEach(function(t){var e={};e.rows=i(t.querySelectorAll("tbody > tr")),e.rows=a.headers?i(t.querySelectorAll("thead > tr")).concat(e.rows):e.rows,e.rows=a.footers?e.rows.concat(i(t.querySelectorAll("tfoot > tr"))):e.rows,e.thAdj=a.headers?t.querySelectorAll("thead > tr").length:0,e.filename="id"===a.filename?t.getAttribute("id")?t.getAttribute("id"):n.defaultFilename:a.filename?a.filename:n.defaultFilename,e.uuid=p(t),e.checkCaption=function(e){var n=t.querySelectorAll("caption.tableexport-caption");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=a.bootstrapSettings.bootstrapSpacing+a.position+" tableexport-caption",n.appendChild(e),t.insertBefore(n,t.firstChild))},e.setExportData=function(){return function(t){var n=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);c[e.uuid]=c[e.uuid]||{},c[e.uuid][r]=JSON.parse(n)}}();var o={};for(var s in f)o[s]=0;a.formats.forEach(function(t){!(!r||m||t!==f.xls)&&(t=f.biff2),!(r&&!m||t!==f.xlsx)&&(t=f.xls),o[t]||(e.setExportData(n.exporters[t].call(n,e)),o[t]++)})});var x=document.querySelectorAll("button[tableexport-id]");return d(x,"click",n.downloadHandler,n),n};l.prototype={version:"4.0.9",defaults:{headers:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",ignoreCSS:"tableexport-ignore",emptyCSS:"tableexport-empty",bootstrapConfig:["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"},types:{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:{xlsx:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xlsx.mimeType,fileExtension:l.prototype.xlsx.fileExtension}),p=l.prototype.xlsx.buttonContent,d=l.prototype.xlsx.defaultClass,m=c({uuid:t.uuid,type:f.xlsx}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},biff2:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},xls:function(t){var e=this,n=e.settings,r=l.prototype.xls.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":t.textContent}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},csv:function(t){var e=this,n=e.settings,r=l.prototype.csv.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":'"'+n.formatValue(t.textContent.replace(/"/g,'""'))+'"'}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.csv.mimeType,fileExtension:l.prototype.csv.fileExtension}),p=l.prototype.csv.buttonContent,d=l.prototype.csv.defaultClass,m=c({uuid:t.uuid,type:f.csv}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},txt:function(t){var e=this,n=e.settings,r=l.prototype.txt.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":n.formatValue(t.textContent)}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.txt.mimeType,fileExtension:l.prototype.txt.fileExtension}),p=l.prototype.txt.buttonContent,d=l.prototype.txt.defaultClass,m=c({uuid:t.uuid,type:f.txt}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m}},createObjButton:function(t,e,n,r,o){var i=document.createElement("button");return i.setAttribute("tableexport-id",t),i.className=o.bootstrapClass+o.bootstrapTheme+r,i.textContent=n,i},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return l.prototype.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var n in this.entityMap)e=e.replace(RegExp(this.entityMap[n],"g"),n);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=l.prototype.types;return~t.indexOf(e.string.defaultClass)?"s":~t.indexOf(e.number.defaultClass)?"n":~t.indexOf(e["boolean"].defaultClass)?"b":~t.indexOf(e.date.defaultClass)?"d":""},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t),r=(n-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=l.prototype.types,i=0;i!==t.length;++i)for(var a=0;a!==t[i].length;++a){n.s.r>i&&(n.s.r=i),n.s.c>a&&(n.s.c=a),n.e.r<i&&(n.e.r=i),n.e.c<a&&(n.e.c=a);var s=t[i][a];if(s&&s.v){var u=r.utils.encode_cell({c:a,r:i});s.t||(o.number.assert(s.v)?s.t="n":o["boolean"].assert(s.v)?s.t="b":o.date.assert(s.v)?s.t="d":s.t="s"),"d"===s.t&&(s.t="n",s.z=r.SSF._table[14],s.v=this.dateNum(s.v)),e[u]=s}}return n.s.c<1e7&&(e["!ref"]=r.utils.encode_range(n)),e},downloadHandler:function(t){var e=t.target,n=JSON.parse(u.getInstance().getItem(e.getAttribute("tableexport-id"))),r=n.data,o=n.filename,i=n.mimeType,a=n.fileExtension;this.export2file(r,i,o,a)},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},export2file:function(t,r,o,i){if(t=this.getBinaryData(t,i,o),m){var a="data:"+r+";"+this.charset+","+t;this.downloadDataURI(a,o,i)}else n(new e([t],{type:r+";"+this.charset}),o+i,!0)},downloadDataURI:function(t,e,n){var r=encodeURI(t),o=document.createElement("a");o.setAttribute("href",r),o.setAttribute("download",e+n),document.body.appendChild(o),o.click()},getBinaryData:function(t,e,n){if(r&&!m&&".xls"===e.substr(0,4)){var o=new this.Workbook,i=this.createSheet(t),a=e.substr(1)===f.xls?f.biff2:f.xlsx;n=n||"",o.SheetNames.push(n),o.Sheets[n]=i;var s={bookType:a,bookSST:!1,type:"binary"},l=r.write(o,s);t=this.string2ArrayBuffer(l)}return t},update:function(t){return l.prototype.remove.call(this),new l(this.selectors,o({},this.defaults,t))},reset:function(){return l.prototype.remove.call(this),new l(this.selectors,this.settings)},remove:function(){this.selectors.forEach(function(t){var e=t.querySelector("caption.tableexport-caption");e&&t.removeChild(e)})},LocalStorage:function(){this.store=localStorage,this.namespace="te-",this.getKey=function(t){return this.namespace+t},this.setItem=function(t,e,n){var r=this.getKey(t);if(!this.exists(r)||n)return"string"!=typeof e?this.error('"value" must be a string'):this.store.setItem(r,e)},this.getItem=function(t){var e=this.getKey(t);return this.store.getItem(e)},this.exists=function(t){var e=this.getKey(t);return null!==this.store.getItem(e)},this.removeItem=function(t){var e=this.getKey(t);return this.store.removeItem(e)},this.error=function(t){return new Error("error:",t)}}};var u=l.prototype.LocalStorage;u.getInstance=function(){return u._instance=null,function(){return u._instance||(u._instance=new u),u._instance}}();var p=function(){var t=0;return function(e){return e.id||(e.id="tableexport-"+ ++t),e.id}}(),f=function(){return{xlsx:"xlsx",biff2:"biff2",xls:"xls",csv:"csv",txt:"txt"}}(),c=function(){var t,e,n=0;return function(r){var o=r.type;if(r=JSON.stringify(r),0===r.length)return n;for(t=0;t<r.length;t++)e=r.charCodeAt(t),n=(n<<5)-n+e,n|=0;return n.toString(16).substring(1)+"-"+o}}(),d=function(){var t=null;return function(e,n,r,o){for(var i=r.bind(o),a=0;a<e.length;++a)t&&e[a].removeEventListener(n,t,!1),e[a].addEventListener(n,i,!1);t=i}}(),m=function(t){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}(navigator.userAgent||navigator.vendor||window.opera);if(t){t.fn.tableExport=function(t){return new l(this,t)};for(var x in l.prototype)t.fn.tableExport[x]=l.prototype[x]}return l.TableExport=l,l}); |
@@ -1,6 +0,24 @@ | ||
// Type definitions for TableExport v4.0.8 | ||
// Type definitions for TableExport v4.0.9 | ||
// Project: https://tableexport.v4.travismclarke.com | ||
// Definitions by: Travis Clarke <https://github.com/clarketm> | ||
/*! | ||
* TableExport.js v4.0.9 (https://www.travismclarke.com) | ||
* | ||
* Copyright (c) 2017 - Travis Clarke - https://www.travismclarke.com | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
/** | ||
@@ -7,0 +25,0 @@ * TableExport main library constructor |
@@ -319,5 +319,7 @@ # [TableExport](https://tableexport.v4.travismclarke.com) [![Build Status](https://travis-ci.org/clarketm/TableExport.svg?branch=master)](https://travis-ci.org/clarketm/TableExport) | ||
* [TableExport + Flask](https://github.com/clarketm/tableexport_flask_app) skeleton. | ||
* [TableExport + Webpack 1](https://github.com/clarketm/tableexport_webpack-v1_app) skeleton. | ||
* [TableExport + Angular 4 + Webpack 2](https://github.com/clarketm/tableexport_angular4_webpack2_app) skeleton. | ||
### License | ||
[TableExport](https://tableexport.v4.travismclarke.com) is licensed under the terms of the [MIT](http://opensource.org/licenses/mit-license.php) License | ||
[TableExport](https://tableexport.v4.travismclarke.com) is licensed under the terms of the [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) License | ||
@@ -324,0 +326,0 @@ ### Going Forward |
@@ -7,5 +7,5 @@ [![Build Status](https://travis-ci.org/clarketm/TableExport.svg?branch=3.x.x)](https://travis-ci.org/clarketm/TableExport) | ||
> **Notice:** In May 2017, [v3.3](https://github.com/clarketm/TableExport/releases/tag/v3.3.12) will be superceded by [v4.0.8](https://github.com/clarketm/TableExport/releases/tag/v4.0.8). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible. | ||
> **Notice:** In May 2017, [v3.3](https://github.com/clarketm/TableExport/releases/tag/v3.3.13) will be superceded by [v4.0.9](https://github.com/clarketm/TableExport/releases/tag/v4.0.9). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible. | ||
### [`v4.0.8`](https://github.com/clarketm/TableExport/releases/tag/v4.0.8) Release Candidate: | ||
### [`v4.0.9`](https://github.com/clarketm/TableExport/releases/tag/v4.0.9) Release Candidate: | ||
#### Examples: | ||
@@ -28,3 +28,3 @@ ##### Property | ||
> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.8](https://github.com/clarketm/TableExport/releases/tag/v4.0.8) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project. | ||
> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.9](https://github.com/clarketm/TableExport/releases/tag/v4.0.9) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project. | ||
@@ -78,3 +78,3 @@ ## Getting Started | ||
> `*` jQuery dependency requirement is removed as of [v4.0.8](https://github.com/clarketm/TableExport/tree/v4.0.8) | ||
> `*` jQuery dependency requirement is removed as of [v4.0.9](https://github.com/clarketm/TableExport/tree/v4.0.9) | ||
@@ -264,5 +264,7 @@ #### Optional / Theming: | ||
* [TableExport + Flask](https://github.com/clarketm/tableexport_flask_app) skeleton. | ||
* [TableExport + Webpack 1](https://github.com/clarketm/tableexport_webpack-v1_app) skeleton. | ||
* [TableExport + Angular 4 + Webpack 2](https://github.com/clarketm/tableexport_angular4_webpack2_app) skeleton. | ||
### License | ||
[TableExport.js](https://www.travismclarke.com/tableexport) is licensed under the terms of the [MIT](http://opensource.org/licenses/mit-license.php) License | ||
[TableExport.js](https://www.travismclarke.com/tableexport) is licensed under the terms of the [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) License | ||
@@ -269,0 +271,0 @@ ### :star: Credits |
@@ -319,5 +319,7 @@ # [TableExport](https://tableexport.v4.travismclarke.com) [![Build Status](https://travis-ci.org/clarketm/TableExport.svg?branch=master)](https://travis-ci.org/clarketm/TableExport) | ||
* [TableExport + Flask](https://github.com/clarketm/tableexport_flask_app) skeleton. | ||
* [TableExport + Webpack 1](https://github.com/clarketm/tableexport_webpack-v1_app) skeleton. | ||
* [TableExport + Angular 4 + Webpack 2](https://github.com/clarketm/tableexport_angular4_webpack2_app) skeleton. | ||
### License | ||
[TableExport](https://tableexport.v4.travismclarke.com) is licensed under the terms of the [MIT](http://opensource.org/licenses/mit-license.php) License | ||
[TableExport](https://tableexport.v4.travismclarke.com) is licensed under the terms of the [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) License | ||
@@ -324,0 +326,0 @@ ### Going Forward |
@@ -7,5 +7,5 @@ [![Build Status](https://travis-ci.org/clarketm/TableExport.svg?branch=3.x.x)](https://travis-ci.org/clarketm/TableExport) | ||
> **Notice:** In May 2017, [v3.3](https://github.com/clarketm/TableExport/releases/tag/v3.3.12) will be superceded by [v4.0.8](https://github.com/clarketm/TableExport/releases/tag/v4.0.8). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible. | ||
> **Notice:** In May 2017, [v3.3](https://github.com/clarketm/TableExport/releases/tag/v3.3.13) will be superceded by [v4.0.9](https://github.com/clarketm/TableExport/releases/tag/v4.0.9). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible. | ||
### [`v4.0.8`](https://github.com/clarketm/TableExport/releases/tag/v4.0.8) Release Candidate: | ||
### [`v4.0.9`](https://github.com/clarketm/TableExport/releases/tag/v4.0.9) Release Candidate: | ||
#### Examples: | ||
@@ -28,3 +28,3 @@ ##### Property | ||
> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.8](https://github.com/clarketm/TableExport/releases/tag/v4.0.8) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project. | ||
> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.9](https://github.com/clarketm/TableExport/releases/tag/v4.0.9) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project. | ||
@@ -78,3 +78,3 @@ ## Getting Started | ||
> `*` jQuery dependency requirement is removed as of [v4.0.8](https://github.com/clarketm/TableExport/tree/v4.0.8) | ||
> `*` jQuery dependency requirement is removed as of [v4.0.9](https://github.com/clarketm/TableExport/tree/v4.0.9) | ||
@@ -264,5 +264,7 @@ #### Optional / Theming: | ||
* [TableExport + Flask](https://github.com/clarketm/tableexport_flask_app) skeleton. | ||
* [TableExport + Webpack 1](https://github.com/clarketm/tableexport_webpack-v1_app) skeleton. | ||
* [TableExport + Angular 4 + Webpack 2](https://github.com/clarketm/tableexport_angular4_webpack2_app) skeleton. | ||
### License | ||
[TableExport.js](https://www.travismclarke.com/tableexport) is licensed under the terms of the [MIT](http://opensource.org/licenses/mit-license.php) License | ||
[TableExport.js](https://www.travismclarke.com/tableexport) is licensed under the terms of the [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) License | ||
@@ -269,0 +271,0 @@ ### :star: Credits |
@@ -31,3 +31,5 @@ var gulp = require('gulp'), | ||
gulp.task('bump', ['bump-js', 'bump-css', 'bump-typings'], function(){ | ||
gulp.task('bump-all', ['bump', 'bump-js', 'bump-css', 'bump-typings', 'bump-readme']); | ||
gulp.task('bump', function(){ | ||
return gulp.src(['./bower.json', './package.json']) | ||
@@ -71,2 +73,10 @@ .pipe(bump()) | ||
gulp.task('bump-readme', function () { | ||
gulp.src(['gitbook/READMEv3.md']) | ||
.pipe(replace(/(v[124567890]\d*\.\d+\.)(\d+)/g, function (matches, match1, match2) { | ||
return match1 + (Number(match2) + 1); | ||
})) | ||
.pipe(gulp.dest('gitbook/')) | ||
}); | ||
gulp.task('clean', function () { | ||
@@ -73,0 +83,0 @@ return del(['dist/js']); |
203
LICENSE.txt
@@ -1,21 +0,190 @@ | ||
The MIT License (MIT) | ||
Apache License | ||
Version 2.0, January 2004 | ||
http://www.apache.org/licenses/ | ||
Copyright (c) 2016 - Travis Clarke - https://www.travismclarke.com | ||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
1. Definitions. | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
"License" shall mean the terms and conditions for use, reproduction, | ||
and distribution as defined by Sections 1 through 9 of this document. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
"Licensor" shall mean the copyright owner or entity authorized by | ||
the copyright owner that is granting the License. | ||
"Legal Entity" shall mean the union of the acting entity and all | ||
other entities that control, are controlled by, or are under common | ||
control with that entity. For the purposes of this definition, | ||
"control" means (i) the power, direct or indirect, to cause the | ||
direction or management of such entity, whether by contract or | ||
otherwise, or (ii) ownership of fifty percent (50%) or more of the | ||
outstanding shares, or (iii) beneficial ownership of such entity. | ||
"You" (or "Your") shall mean an individual or Legal Entity | ||
exercising permissions granted by this License. | ||
"Source" form shall mean the preferred form for making modifications, | ||
including but not limited to software source code, documentation | ||
source, and configuration files. | ||
"Object" form shall mean any form resulting from mechanical | ||
transformation or translation of a Source form, including but | ||
not limited to compiled object code, generated documentation, | ||
and conversions to other media types. | ||
"Work" shall mean the work of authorship, whether in Source or | ||
Object form, made available under the License, as indicated by a | ||
copyright notice that is included in or attached to the work | ||
(an example is provided in the Appendix below). | ||
"Derivative Works" shall mean any work, whether in Source or Object | ||
form, that is based on (or derived from) the Work and for which the | ||
editorial revisions, annotations, elaborations, or other modifications | ||
represent, as a whole, an original work of authorship. For the purposes | ||
of this License, Derivative Works shall not include works that remain | ||
separable from, or merely link (or bind by name) to the interfaces of, | ||
the Work and Derivative Works thereof. | ||
"Contribution" shall mean any work of authorship, including | ||
the original version of the Work and any modifications or additions | ||
to that Work or Derivative Works thereof, that is intentionally | ||
submitted to Licensor for inclusion in the Work by the copyright owner | ||
or by an individual or Legal Entity authorized to submit on behalf of | ||
the copyright owner. For the purposes of this definition, "submitted" | ||
means any form of electronic, verbal, or written communication sent | ||
to the Licensor or its representatives, including but not limited to | ||
communication on electronic mailing lists, source code control systems, | ||
and issue tracking systems that are managed by, or on behalf of, the | ||
Licensor for the purpose of discussing and improving the Work, but | ||
excluding communication that is conspicuously marked or otherwise | ||
designated in writing by the copyright owner as "Not a Contribution." | ||
"Contributor" shall mean Licensor and any individual or Legal Entity | ||
on behalf of whom a Contribution has been received by Licensor and | ||
subsequently incorporated within the Work. | ||
2. Grant of Copyright License. Subject to the terms and conditions of | ||
this License, each Contributor hereby grants to You a perpetual, | ||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
copyright license to reproduce, prepare Derivative Works of, | ||
publicly display, publicly perform, sublicense, and distribute the | ||
Work and such Derivative Works in Source or Object form. | ||
3. Grant of Patent License. Subject to the terms and conditions of | ||
this License, each Contributor hereby grants to You a perpetual, | ||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
(except as stated in this section) patent license to make, have made, | ||
use, offer to sell, sell, import, and otherwise transfer the Work, | ||
where such license applies only to those patent claims licensable | ||
by such Contributor that are necessarily infringed by their | ||
Contribution(s) alone or by combination of their Contribution(s) | ||
with the Work to which such Contribution(s) was submitted. If You | ||
institute patent litigation against any entity (including a | ||
cross-claim or counterclaim in a lawsuit) alleging that the Work | ||
or a Contribution incorporated within the Work constitutes direct | ||
or contributory patent infringement, then any patent licenses | ||
granted to You under this License for that Work shall terminate | ||
as of the date such litigation is filed. | ||
4. Redistribution. You may reproduce and distribute copies of the | ||
Work or Derivative Works thereof in any medium, with or without | ||
modifications, and in Source or Object form, provided that You | ||
meet the following conditions: | ||
(a) You must give any other recipients of the Work or | ||
Derivative Works a copy of this License; and | ||
(b) You must cause any modified files to carry prominent notices | ||
stating that You changed the files; and | ||
(c) You must retain, in the Source form of any Derivative Works | ||
that You distribute, all copyright, patent, trademark, and | ||
attribution notices from the Source form of the Work, | ||
excluding those notices that do not pertain to any part of | ||
the Derivative Works; and | ||
(d) If the Work includes a "NOTICE" text file as part of its | ||
distribution, then any Derivative Works that You distribute must | ||
include a readable copy of the attribution notices contained | ||
within such NOTICE file, excluding those notices that do not | ||
pertain to any part of the Derivative Works, in at least one | ||
of the following places: within a NOTICE text file distributed | ||
as part of the Derivative Works; within the Source form or | ||
documentation, if provided along with the Derivative Works; or, | ||
within a display generated by the Derivative Works, if and | ||
wherever such third-party notices normally appear. The contents | ||
of the NOTICE file are for informational purposes only and | ||
do not modify the License. You may add Your own attribution | ||
notices within Derivative Works that You distribute, alongside | ||
or as an addendum to the NOTICE text from the Work, provided | ||
that such additional attribution notices cannot be construed | ||
as modifying the License. | ||
You may add Your own copyright statement to Your modifications and | ||
may provide additional or different license terms and conditions | ||
for use, reproduction, or distribution of Your modifications, or | ||
for any such Derivative Works as a whole, provided Your use, | ||
reproduction, and distribution of the Work otherwise complies with | ||
the conditions stated in this License. | ||
5. Submission of Contributions. Unless You explicitly state otherwise, | ||
any Contribution intentionally submitted for inclusion in the Work | ||
by You to the Licensor shall be under the terms and conditions of | ||
this License, without any additional terms or conditions. | ||
Notwithstanding the above, nothing herein shall supersede or modify | ||
the terms of any separate license agreement you may have executed | ||
with Licensor regarding such Contributions. | ||
6. Trademarks. This License does not grant permission to use the trade | ||
names, trademarks, service marks, or product names of the Licensor, | ||
except as required for reasonable and customary use in describing the | ||
origin of the Work and reproducing the content of the NOTICE file. | ||
7. Disclaimer of Warranty. Unless required by applicable law or | ||
agreed to in writing, Licensor provides the Work (and each | ||
Contributor provides its Contributions) on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
implied, including, without limitation, any warranties or conditions | ||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | ||
PARTICULAR PURPOSE. You are solely responsible for determining the | ||
appropriateness of using or redistributing the Work and assume any | ||
risks associated with Your exercise of permissions under this License. | ||
8. Limitation of Liability. In no event and under no legal theory, | ||
whether in tort (including negligence), contract, or otherwise, | ||
unless required by applicable law (such as deliberate and grossly | ||
negligent acts) or agreed to in writing, shall any Contributor be | ||
liable to You for damages, including any direct, indirect, special, | ||
incidental, or consequential damages of any character arising as a | ||
result of this License or out of the use or inability to use the | ||
Work (including but not limited to damages for loss of goodwill, | ||
work stoppage, computer failure or malfunction, or any and all | ||
other commercial damages or losses), even if such Contributor | ||
has been advised of the possibility of such damages. | ||
9. Accepting Warranty or Additional Liability. While redistributing | ||
the Work or Derivative Works thereof, You may choose to offer, | ||
and charge a fee for, acceptance of support, warranty, indemnity, | ||
or other liability obligations and/or rights consistent with this | ||
License. However, in accepting such obligations, You may act only | ||
on Your own behalf and on Your sole responsibility, not on behalf | ||
of any other Contributor, and only if You agree to indemnify, | ||
defend, and hold each Contributor harmless for any liability | ||
incurred by, or claims asserted against, such Contributor by reason | ||
of your accepting any such warranty or additional liability. | ||
END OF TERMS AND CONDITIONS | ||
Copyright (c) 2017 - Travis Clarke - https://www.travismclarke.com | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
{ | ||
"name": "tableexport", | ||
"version": "4.0.8", | ||
"version": "4.0.9", | ||
"authors": [ | ||
@@ -56,3 +56,3 @@ "clarketm <travis.m.clarke@gmail.com>" | ||
}, | ||
"license": "MIT", | ||
"license": "Apache-2.0", | ||
"homepage": "https://tableexport.v4.travismclarke.com/", | ||
@@ -59,0 +59,0 @@ "ignore": [ |
@@ -319,5 +319,7 @@ # [TableExport](https://tableexport.v4.travismclarke.com) [![Build Status](https://travis-ci.org/clarketm/TableExport.svg?branch=master)](https://travis-ci.org/clarketm/TableExport) | ||
* [TableExport + Flask](https://github.com/clarketm/tableexport_flask_app) skeleton. | ||
* [TableExport + Webpack 1](https://github.com/clarketm/tableexport_webpack-v1_app) skeleton. | ||
* [TableExport + Angular 4 + Webpack 2](https://github.com/clarketm/tableexport_angular4_webpack2_app) skeleton. | ||
### License | ||
[TableExport](https://tableexport.v4.travismclarke.com) is licensed under the terms of the [MIT](http://opensource.org/licenses/mit-license.php) License | ||
[TableExport](https://tableexport.v4.travismclarke.com) is licensed under the terms of the [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) License | ||
@@ -324,0 +326,0 @@ ### Going Forward |
/*! | ||
* TableExport.js v4.0.8 (https://www.travismclarke.com) | ||
* Copyright 2017 Travis Clarke | ||
* Licensed under the MIT license | ||
* TableExport.js v4.0.9 (https://www.travismclarke.com) | ||
* | ||
* Copyright (c) 2017 - Travis Clarke - https://www.travismclarke.com | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
@@ -131,3 +144,3 @@ | ||
*/ | ||
version: '4.0.8', | ||
version: '4.0.9', | ||
/** | ||
@@ -134,0 +147,0 @@ * Default library options. |
/*! | ||
* TableExport.js v4.0.8 (https://www.travismclarke.com) | ||
* Copyright 2017 Travis Clarke | ||
* Licensed under the MIT license | ||
* TableExport.js v4.0.9 (https://www.travismclarke.com) | ||
* | ||
* Copyright (c) 2017 - Travis Clarke - https://www.travismclarke.com | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
!function(t,e){if("function"==typeof define&&define.amd)define(function(t){var n;try{n=t("jquery")}catch(r){}return e(n,t("blobjs"),t("file-saverjs"),t("xlsx"))});else if("object"==typeof exports&&"string"!=typeof exports.nodeName){var n;try{n=require("jquery")}catch(r){}module.exports=e(n,require("blobjs"),require("file-saverjs"),require("xlsx"))}else t.TableExport=e(t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(t,e,n,r){"use strict";function o(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return"undefined"==typeof t.length?[].concat(t):[].slice.call(t)}function a(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}function s(t,e,n){var r={};return t?(r.bootstrapClass=e[0]+" ",r.bootstrapTheme=e[1]+" ",r.bootstrapSpacing=e[2]+" "):(r.bootstrapClass=n+" ",r.bootstrapTheme="",r.bootstrapSpacing=""),r}var l=function(t,e){var n=this;if(!t)return new Error('"selectors" is required');if(!n)return new l(t,e);n.settings=o({},n.defaults,e),n.selectors=i(t);var a=n.settings;a.ignoreRows=a.ignoreRows instanceof Array?a.ignoreRows:[a.ignoreRows],a.ignoreCols=a.ignoreCols instanceof Array?a.ignoreCols:[a.ignoreCols],a.ignoreCSS=n.ignoreCSS instanceof Array?n.ignoreCSS.join(", "):n.ignoreCSS,a.emptyCSS=n.emptyCSS instanceof Array?n.emptyCSS.join(", "):n.emptyCSS,a.formatValue=n.formatValue.bind(this,a.trimWhitespace),a.bootstrapSettings=s(a.bootstrap,n.bootstrapConfig,n.defaultButton);var c={};n.getExportData=function(){return c},n.selectors.forEach(function(t){var e={};e.rows=i(t.querySelectorAll("tbody > tr")),e.rows=a.headers?i(t.querySelectorAll("thead > tr")).concat(e.rows):e.rows,e.rows=a.footers?e.rows.concat(i(t.querySelectorAll("tfoot > tr"))):e.rows,e.thAdj=a.headers?t.querySelectorAll("thead > tr").length:0,e.filename="id"===a.filename?t.getAttribute("id")?t.getAttribute("id"):n.defaultFilename:a.filename?a.filename:n.defaultFilename,e.uuid=p(t),e.checkCaption=function(e){var n=t.querySelectorAll("caption.tableexport-caption");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=a.bootstrapSettings.bootstrapSpacing+a.position+" tableexport-caption",n.appendChild(e),t.insertBefore(n,t.firstChild))},e.setExportData=function(){return function(t){var n=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);c[e.uuid]=c[e.uuid]||{},c[e.uuid][r]=JSON.parse(n)}}();var o={};for(var s in f)o[s]=0;a.formats.forEach(function(t){!(!r||m||t!==f.xls)&&(t=f.biff2),!(r&&!m||t!==f.xlsx)&&(t=f.xls),o[t]||(e.setExportData(n.exporters[t].call(n,e)),o[t]++)})});var x=document.querySelectorAll("button[tableexport-id]");return d(x,"click",n.downloadHandler,n),n};l.prototype={version:"4.0.8",defaults:{headers:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",ignoreCSS:"tableexport-ignore",emptyCSS:"tableexport-empty",bootstrapConfig:["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"},types:{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:{xlsx:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xlsx.mimeType,fileExtension:l.prototype.xlsx.fileExtension}),p=l.prototype.xlsx.buttonContent,d=l.prototype.xlsx.defaultClass,m=c({uuid:t.uuid,type:f.xlsx}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},biff2:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},xls:function(t){var e=this,n=e.settings,r=l.prototype.xls.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":t.textContent}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},csv:function(t){var e=this,n=e.settings,r=l.prototype.csv.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":'"'+n.formatValue(t.textContent.replace(/"/g,'""'))+'"'}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.csv.mimeType,fileExtension:l.prototype.csv.fileExtension}),p=l.prototype.csv.buttonContent,d=l.prototype.csv.defaultClass,m=c({uuid:t.uuid,type:f.csv}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},txt:function(t){var e=this,n=e.settings,r=l.prototype.txt.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":n.formatValue(t.textContent)}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.txt.mimeType,fileExtension:l.prototype.txt.fileExtension}),p=l.prototype.txt.buttonContent,d=l.prototype.txt.defaultClass,m=c({uuid:t.uuid,type:f.txt}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m}},createObjButton:function(t,e,n,r,o){var i=document.createElement("button");return i.setAttribute("tableexport-id",t),i.className=o.bootstrapClass+o.bootstrapTheme+r,i.textContent=n,i},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return l.prototype.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var n in this.entityMap)e=e.replace(RegExp(this.entityMap[n],"g"),n);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=l.prototype.types;return~t.indexOf(e.string.defaultClass)?"s":~t.indexOf(e.number.defaultClass)?"n":~t.indexOf(e["boolean"].defaultClass)?"b":~t.indexOf(e.date.defaultClass)?"d":""},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t),r=(n-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=l.prototype.types,i=0;i!==t.length;++i)for(var a=0;a!==t[i].length;++a){n.s.r>i&&(n.s.r=i),n.s.c>a&&(n.s.c=a),n.e.r<i&&(n.e.r=i),n.e.c<a&&(n.e.c=a);var s=t[i][a];if(s&&s.v){var u=r.utils.encode_cell({c:a,r:i});s.t||(o.number.assert(s.v)?s.t="n":o["boolean"].assert(s.v)?s.t="b":o.date.assert(s.v)?s.t="d":s.t="s"),"d"===s.t&&(s.t="n",s.z=r.SSF._table[14],s.v=this.dateNum(s.v)),e[u]=s}}return n.s.c<1e7&&(e["!ref"]=r.utils.encode_range(n)),e},downloadHandler:function(t){var e=t.target,n=JSON.parse(u.getInstance().getItem(e.getAttribute("tableexport-id"))),r=n.data,o=n.filename,i=n.mimeType,a=n.fileExtension;this.export2file(r,i,o,a)},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},export2file:function(t,r,o,i){if(t=this.getBinaryData(t,i,o),m){var a="data:"+r+";"+this.charset+","+t;this.downloadDataURI(a,o,i)}else n(new e([t],{type:r+";"+this.charset}),o+i,!0)},downloadDataURI:function(t,e,n){var r=encodeURI(t),o=document.createElement("a");o.setAttribute("href",r),o.setAttribute("download",e+n),document.body.appendChild(o),o.click()},getBinaryData:function(t,e,n){if(r&&!m&&".xls"===e.substr(0,4)){var o=new this.Workbook,i=this.createSheet(t),a=e.substr(1)===f.xls?f.biff2:f.xlsx;n=n||"",o.SheetNames.push(n),o.Sheets[n]=i;var s={bookType:a,bookSST:!1,type:"binary"},l=r.write(o,s);t=this.string2ArrayBuffer(l)}return t},update:function(t){return l.prototype.remove.call(this),new l(this.selectors,o({},this.defaults,t))},reset:function(){return l.prototype.remove.call(this),new l(this.selectors,this.settings)},remove:function(){this.selectors.forEach(function(t){var e=t.querySelector("caption.tableexport-caption");e&&t.removeChild(e)})},LocalStorage:function(){this.store=localStorage,this.namespace="te-",this.getKey=function(t){return this.namespace+t},this.setItem=function(t,e,n){var r=this.getKey(t);if(!this.exists(r)||n)return"string"!=typeof e?this.error('"value" must be a string'):this.store.setItem(r,e)},this.getItem=function(t){var e=this.getKey(t);return this.store.getItem(e)},this.exists=function(t){var e=this.getKey(t);return null!==this.store.getItem(e)},this.removeItem=function(t){var e=this.getKey(t);return this.store.removeItem(e)},this.error=function(t){return new Error("error:",t)}}};var u=l.prototype.LocalStorage;u.getInstance=function(){return u._instance=null,function(){return u._instance||(u._instance=new u),u._instance}}();var p=function(){var t=0;return function(e){return e.id||(e.id="tableexport-"+ ++t),e.id}}(),f=function(){return{xlsx:"xlsx",biff2:"biff2",xls:"xls",csv:"csv",txt:"txt"}}(),c=function(){var t,e,n=0;return function(r){var o=r.type;if(r=JSON.stringify(r),0===r.length)return n;for(t=0;t<r.length;t++)e=r.charCodeAt(t),n=(n<<5)-n+e,n|=0;return n.toString(16).substring(1)+"-"+o}}(),d=function(){var t=null;return function(e,n,r,o){for(var i=r.bind(o),a=0;a<e.length;++a)t&&e[a].removeEventListener(n,t,!1),e[a].addEventListener(n,i,!1);t=i}}(),m=function(t){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}(navigator.userAgent||navigator.vendor||window.opera);if(t){t.fn.tableExport=function(t){return new l(this,t)};for(var x in l.prototype)t.fn.tableExport[x]=l.prototype[x]}return l.TableExport=l,l}); | ||
!function(t,e){if("function"==typeof define&&define.amd)define(function(t){var n;try{n=t("jquery")}catch(r){}return e(n,t("blobjs"),t("file-saverjs"),t("xlsx"))});else if("object"==typeof exports&&"string"!=typeof exports.nodeName){var n;try{n=require("jquery")}catch(r){}module.exports=e(n,require("blobjs"),require("file-saverjs"),require("xlsx"))}else t.TableExport=e(t.jQuery,t.Blob,t.saveAs,t.XLSX)}(this,function(t,e,n,r){"use strict";function o(){for(var t=arguments,e=1;e<t.length;e++)for(var n in t[e])t[e].hasOwnProperty(n)&&(t[0][n]=t[e][n]);return t[0]}function i(t){return"undefined"==typeof t.length?[].concat(t):[].slice.call(t)}function a(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.cls)}function s(t,e,n){var r={};return t?(r.bootstrapClass=e[0]+" ",r.bootstrapTheme=e[1]+" ",r.bootstrapSpacing=e[2]+" "):(r.bootstrapClass=n+" ",r.bootstrapTheme="",r.bootstrapSpacing=""),r}var l=function(t,e){var n=this;if(!t)return new Error('"selectors" is required');if(!n)return new l(t,e);n.settings=o({},n.defaults,e),n.selectors=i(t);var a=n.settings;a.ignoreRows=a.ignoreRows instanceof Array?a.ignoreRows:[a.ignoreRows],a.ignoreCols=a.ignoreCols instanceof Array?a.ignoreCols:[a.ignoreCols],a.ignoreCSS=n.ignoreCSS instanceof Array?n.ignoreCSS.join(", "):n.ignoreCSS,a.emptyCSS=n.emptyCSS instanceof Array?n.emptyCSS.join(", "):n.emptyCSS,a.formatValue=n.formatValue.bind(this,a.trimWhitespace),a.bootstrapSettings=s(a.bootstrap,n.bootstrapConfig,n.defaultButton);var c={};n.getExportData=function(){return c},n.selectors.forEach(function(t){var e={};e.rows=i(t.querySelectorAll("tbody > tr")),e.rows=a.headers?i(t.querySelectorAll("thead > tr")).concat(e.rows):e.rows,e.rows=a.footers?e.rows.concat(i(t.querySelectorAll("tfoot > tr"))):e.rows,e.thAdj=a.headers?t.querySelectorAll("thead > tr").length:0,e.filename="id"===a.filename?t.getAttribute("id")?t.getAttribute("id"):n.defaultFilename:a.filename?a.filename:n.defaultFilename,e.uuid=p(t),e.checkCaption=function(e){var n=t.querySelectorAll("caption.tableexport-caption");n.length?n[0].appendChild(e):(n=document.createElement("caption"),n.className=a.bootstrapSettings.bootstrapSpacing+a.position+" tableexport-caption",n.appendChild(e),t.insertBefore(n,t.firstChild))},e.setExportData=function(){return function(t){var n=u.getInstance().getItem(t),r=t.substring(t.indexOf("-")+1);c[e.uuid]=c[e.uuid]||{},c[e.uuid][r]=JSON.parse(n)}}();var o={};for(var s in f)o[s]=0;a.formats.forEach(function(t){!(!r||m||t!==f.xls)&&(t=f.biff2),!(r&&!m||t!==f.xlsx)&&(t=f.xls),o[t]||(e.setExportData(n.exporters[t].call(n,e)),o[t]++)})});var x=document.querySelectorAll("button[tableexport-id]");return d(x,"click",n.downloadHandler,n),n};l.prototype={version:"4.0.9",defaults:{headers:!0,footers:!0,formats:["xls","csv","txt"],filename:"id",bootstrap:!1,exportButtons:!0,position:"bottom",ignoreRows:null,ignoreCols:null,trimWhitespace:!0},charset:"charset=utf-8",defaultFilename:"myDownload",defaultButton:"button-default",ignoreCSS:"tableexport-ignore",emptyCSS:"tableexport-empty",bootstrapConfig:["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"},types:{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:{xlsx:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xlsx.mimeType,fileExtension:l.prototype.xlsx.fileExtension}),p=l.prototype.xlsx.buttonContent,d=l.prototype.xlsx.defaultClass,m=c({uuid:t.uuid,type:f.xlsx}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},biff2:function(t){var e=this,n=e.settings,r={},o=i(t.rows).map(function(o,s){if(!~n.ignoreRows.indexOf(s-t.thAdj)&&!a(o,n.ignoreCSS)){var l=o.querySelectorAll("th, td");return i(l).map(function(t,o){if(!~n.ignoreCols.indexOf(o)&&!a(t,n.ignoreCSS)){if(a(t,n.emptyCSS))return" ";if(t.hasAttribute("colspan")&&(r[s]=r[s]||{},r[s][o+1]=t.getAttribute("colspan")-1),t.hasAttribute("rowspan"))for(var i=1;i<t.getAttribute("rowspan");i++)r[s+i]=r[s+i]||{},r[s+i][o]=1;if(r[s]){for(var l=o+1,u=0,p=0,i=0;i<=Math.max.apply(Math,Object.keys(r[s]))&&(r[s][i]?u=p>=o?u+r[s][i]:u:p++,p!==l);i++);return new Array(u).concat({v:n.formatValue(t.textContent),t:e.getType(t.className)})}return{v:n.formatValue(t.textContent),t:e.getType(t.className)}}}).filter(function(t){return"undefined"!=typeof t})}}).map(function(t){return t&&[].concat.apply([],t)}).filter(function(t){return"undefined"!=typeof t}),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},xls:function(t){var e=this,n=e.settings,r=l.prototype.xls.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":t.textContent}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.xls.mimeType,fileExtension:l.prototype.xls.fileExtension}),p=l.prototype.xls.buttonContent,d=l.prototype.xls.defaultClass,m=c({uuid:t.uuid,type:f.xls}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},csv:function(t){var e=this,n=e.settings,r=l.prototype.csv.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":'"'+n.formatValue(t.textContent.replace(/"/g,'""'))+'"'}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.csv.mimeType,fileExtension:l.prototype.csv.fileExtension}),p=l.prototype.csv.buttonContent,d=l.prototype.csv.defaultClass,m=c({uuid:t.uuid,type:f.csv}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m},txt:function(t){var e=this,n=e.settings,r=l.prototype.txt.separator,o=i(t.rows).map(function(e,o){if(!~n.ignoreRows.indexOf(o-t.thAdj)&&!a(e,n.ignoreCSS)){var s=e.querySelectorAll("th, td");return i(s).map(function(t,e){if(!~n.ignoreCols.indexOf(e)&&!a(t,n.ignoreCSS))return a(t,n.emptyCSS)?" ":n.formatValue(t.textContent)}).filter(function(t){return"undefined"!=typeof t}).join(r)}}).filter(function(t){return"undefined"!=typeof t}).join(e.rowDel),s=JSON.stringify({data:o,filename:t.filename,mimeType:l.prototype.txt.mimeType,fileExtension:l.prototype.txt.fileExtension}),p=l.prototype.txt.buttonContent,d=l.prototype.txt.defaultClass,m=c({uuid:t.uuid,type:f.txt}),x=n.exportButtons&&l.prototype.createObjButton(m,s,p,d,n.bootstrapSettings);return x&&t.checkCaption(x),u.getInstance().setItem(m,s,!0),m}},createObjButton:function(t,e,n,r,o){var i=document.createElement("button");return i.setAttribute("tableexport-id",t),i.className=o.bootstrapClass+o.bootstrapTheme+r,i.textContent=n,i},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return l.prototype.entityMap[t]})},unescapeHtml:function(t){var e=String(t);for(var n in this.entityMap)e=e.replace(RegExp(this.entityMap[n],"g"),n);return e},formatValue:function(t,e){return t?e.trim():e},getType:function(t){if(!t)return"";var e=l.prototype.types;return~t.indexOf(e.string.defaultClass)?"s":~t.indexOf(e.number.defaultClass)?"n":~t.indexOf(e["boolean"].defaultClass)?"b":~t.indexOf(e.date.defaultClass)?"d":""},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t),r=(n-new Date(Date.UTC(1899,11,30)))/864e5;return Math.floor(r)},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},o=l.prototype.types,i=0;i!==t.length;++i)for(var a=0;a!==t[i].length;++a){n.s.r>i&&(n.s.r=i),n.s.c>a&&(n.s.c=a),n.e.r<i&&(n.e.r=i),n.e.c<a&&(n.e.c=a);var s=t[i][a];if(s&&s.v){var u=r.utils.encode_cell({c:a,r:i});s.t||(o.number.assert(s.v)?s.t="n":o["boolean"].assert(s.v)?s.t="b":o.date.assert(s.v)?s.t="d":s.t="s"),"d"===s.t&&(s.t="n",s.z=r.SSF._table[14],s.v=this.dateNum(s.v)),e[u]=s}}return n.s.c<1e7&&(e["!ref"]=r.utils.encode_range(n)),e},downloadHandler:function(t){var e=t.target,n=JSON.parse(u.getInstance().getItem(e.getAttribute("tableexport-id"))),r=n.data,o=n.filename,i=n.mimeType,a=n.fileExtension;this.export2file(r,i,o,a)},Workbook:function(){this.SheetNames=[],this.Sheets={}},string2ArrayBuffer:function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return e},export2file:function(t,r,o,i){if(t=this.getBinaryData(t,i,o),m){var a="data:"+r+";"+this.charset+","+t;this.downloadDataURI(a,o,i)}else n(new e([t],{type:r+";"+this.charset}),o+i,!0)},downloadDataURI:function(t,e,n){var r=encodeURI(t),o=document.createElement("a");o.setAttribute("href",r),o.setAttribute("download",e+n),document.body.appendChild(o),o.click()},getBinaryData:function(t,e,n){if(r&&!m&&".xls"===e.substr(0,4)){var o=new this.Workbook,i=this.createSheet(t),a=e.substr(1)===f.xls?f.biff2:f.xlsx;n=n||"",o.SheetNames.push(n),o.Sheets[n]=i;var s={bookType:a,bookSST:!1,type:"binary"},l=r.write(o,s);t=this.string2ArrayBuffer(l)}return t},update:function(t){return l.prototype.remove.call(this),new l(this.selectors,o({},this.defaults,t))},reset:function(){return l.prototype.remove.call(this),new l(this.selectors,this.settings)},remove:function(){this.selectors.forEach(function(t){var e=t.querySelector("caption.tableexport-caption");e&&t.removeChild(e)})},LocalStorage:function(){this.store=localStorage,this.namespace="te-",this.getKey=function(t){return this.namespace+t},this.setItem=function(t,e,n){var r=this.getKey(t);if(!this.exists(r)||n)return"string"!=typeof e?this.error('"value" must be a string'):this.store.setItem(r,e)},this.getItem=function(t){var e=this.getKey(t);return this.store.getItem(e)},this.exists=function(t){var e=this.getKey(t);return null!==this.store.getItem(e)},this.removeItem=function(t){var e=this.getKey(t);return this.store.removeItem(e)},this.error=function(t){return new Error("error:",t)}}};var u=l.prototype.LocalStorage;u.getInstance=function(){return u._instance=null,function(){return u._instance||(u._instance=new u),u._instance}}();var p=function(){var t=0;return function(e){return e.id||(e.id="tableexport-"+ ++t),e.id}}(),f=function(){return{xlsx:"xlsx",biff2:"biff2",xls:"xls",csv:"csv",txt:"txt"}}(),c=function(){var t,e,n=0;return function(r){var o=r.type;if(r=JSON.stringify(r),0===r.length)return n;for(t=0;t<r.length;t++)e=r.charCodeAt(t),n=(n<<5)-n+e,n|=0;return n.toString(16).substring(1)+"-"+o}}(),d=function(){var t=null;return function(e,n,r,o){for(var i=r.bind(o),a=0;a<e.length;++a)t&&e[a].removeEventListener(n,t,!1),e[a].addEventListener(n,i,!1);t=i}}(),m=function(t){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}(navigator.userAgent||navigator.vendor||window.opera);if(t){t.fn.tableExport=function(t){return new l(this,t)};for(var x in l.prototype)t.fn.tableExport[x]=l.prototype[x]}return l.TableExport=l,l}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7680897
52689
340