Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tableexport

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tableexport - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

src/v3/tableexport-3.1.3.js

2

bower.json
{
"name": "tableexport.js",
"version": "3.1.2",
"version": "3.1.3",
"authors": [

@@ -5,0 +5,0 @@ "clarketm <travis.m.clarke@gmail.com>"

/*!
* TableExport.js v3.1.2 (http://www.clarketravis.com)
* TableExport.js v3.1.3 (http://www.clarketravis.com)
* Copyright 2015 Travis Clarke

@@ -34,11 +34,12 @@ * Licensed under the MIT license

var dataURL = $rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).text()
});
}).get(),
dataObject = JSON.stringify({
var $cols = $(val).find('th, td');
return [$cols.map(function (i, val) {
return $(val).text();
}).get()];
}).get(),
dataObject = escapeHtml(
JSON.stringify({
data: dataURL,
name: name
}).replace(/'/g, "&#39;"),
})),
myFile = name + ".xlsx",

@@ -51,7 +52,7 @@ myContent = $.fn.tableExport.xlsx.buttonContent,

var colD = $.fn.tableExport.xls.separator,
dataURL = 'data:application/vnd.ms-excel;charset=utf-16,' +
dataURL = 'data:application/vnd.ms-excel;charset=utf-8,' +
encodeURIComponent($rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).html()
return $(val).text();
}).get().join(colD);

@@ -67,7 +68,7 @@ }).get().join(rdel)),

var colD = '"' + $.fn.tableExport.csv.separator + '"',
dataURL = 'data:text/csv;charset=utf-16,' +
dataURL = 'data:text/csv;charset=utf-8,' +
encodeURIComponent('"' + $rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).text().replace(/"/g, '""')
return $(val).text().replace(/"/g, '""');
}).get().join(colD);

@@ -82,7 +83,7 @@ }).get().join(rdel) + '"'),

var colD = $.fn.tableExport.txt.separator,
dataURL = 'data:text/plain;charset=utf-16,' +
dataURL = 'data:text/plain;charset=utf-8,' +
encodeURIComponent($rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).text()
return $(val).text();
}).get().join(colD);

@@ -175,2 +176,10 @@ }).get().join(rdel)),

$.fn.tableExport.entityMap = {"&": "&#38;", "<": "&#60;", ">": "&#62;", "'": '&#39;', "/": '&#47'};
function escapeHtml(string) {
return String(string).replace(/[&<>'\/]/g, function (s) {
return $.fn.tableExport.entityMap[s];
});
}
function dateNum(v, date1904) {

@@ -177,0 +186,0 @@ if (date1904) v += 1462;

/*!
* TableExport.js v3.1.2 (http://www.clarketravis.com)
* TableExport.js v3.1.3 (http://www.clarketravis.com)
* Copyright 2015 Travis Clarke
* Licensed under the MIT license
*/
!function(t,n){function e(t,n){n&&(t+=1462);var e=Date.parse(t);return(e-new Date(Date.UTC(1899,11,30)))/864e5}function a(t,n){for(var a={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=0;r!=t.length;++r)for(var l=0;l!=t[r].length;++l){o.s.r>r&&(o.s.r=r),o.s.c>l&&(o.s.c=l),o.e.r<r&&(o.e.r=r),o.e.c<l&&(o.e.c=l);var s={v:t[r][l]};if(null!=s.v){var f=XLSX.utils.encode_cell({c:l,r:r});"number"==typeof s.v?s.t="n":"boolean"==typeof s.v?s.t="b":s.v instanceof Date?(s.t="n",s.z=XLSX.SSF._table[14],s.v=e(s.v)):s.t="s",a[f]=s}}return o.s.c<1e7&&(a["!ref"]=XLSX.utils.encode_range(o)),a}function o(){return this instanceof o?(this.SheetNames=[],void(this.Sheets={})):new o}function r(t){for(var n=new ArrayBuffer(t.length),e=new Uint8Array(n),a=0;a!=t.length;++a)e[a]=255&t.charCodeAt(a);return n}function l(t,n){var e=new o,l=a(t);e.SheetNames.push(n),e.Sheets[n]=l;var s={bookType:"xlsx",bookSST:!1,type:"binary"},f=XLSX.write(e,s);saveAs(new Blob([r(f)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),n+".xlsx")}var s=t.jQuery;s.fn.tableExport=function(t){var n,e,a,o=s.extend({},s.fn.tableExport.defaults,t),r=s.fn.tableExport.rowDel;return o.bootstrap?(n=s.fn.tableExport.bootstrap[0]+" ",e=s.fn.tableExport.bootstrap[1]+" ",a=s.fn.tableExport.bootstrap[2]+" "):(n=s.fn.tableExport.defaultButton+" ",e=a=""),this.each(function(){function t(t){var n=u.find("caption:not(.head)");n.length?n.append(t):u.prepend('<caption class="'+a+o.position+'">'+t+"</caption>")}function f(a,o,r,l){var s='<a href="'+a+'" download="'+o+'" role="button" class="'+n+e+l+'">'+r+"</a>";t(s)}function i(a,o,r,l){var s="<a href='#' data-obj='"+a+"' download='"+o+"' role='button' class='"+n+e+l+"'>"+r+"</a>";t(s),p(l)}function p(t){var n="."+t;return s(n).on("click",function(t){if(s(this).data("obj")){t.preventDefault();var n=s(this).data("obj"),e=n.data,a=n.name;l(e,a)}})}var u=s(this),x=o.headings?u.find("tr"):u.find("tr:has(td)"),c="id"===o.fileName?u.attr("id")?u.attr("id"):s.fn.tableExport.defaultFileName:o.fileName,d={xlsx:function(t,n){var e=x.map(function(t,n){var e=s(n).find("th, td");return e.map(function(t,n){return s(n).text()})}).get(),a=JSON.stringify({data:e,name:n}).replace(/'/g,"&#39;"),o=n+".xlsx",r=s.fn.tableExport.xlsx.buttonContent,l=s.fn.tableExport.xlsx.defaultClass;i(a,o,r,l)},xls:function(t,n){var e=s.fn.tableExport.xls.separator,a="data:application/vnd.ms-excel;charset=utf-16,"+encodeURIComponent(x.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).html()}).get().join(e)}).get().join(t)),o=n+".xls",r=s.fn.tableExport.xls.buttonContent,l=s.fn.tableExport.xls.defaultClass;f(a,o,r,l)},csv:function(t,n){t='"'+t+'"';var e='"'+s.fn.tableExport.csv.separator+'"',a="data:text/csv;charset=utf-16,"+encodeURIComponent('"'+x.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text().replace(/"/g,'""')}).get().join(e)}).get().join(t)+'"'),o=n+".csv",r=s.fn.tableExport.csv.buttonContent,l=s.fn.tableExport.csv.defaultClass;f(a,o,r,l)},txt:function(t,n){var e=s.fn.tableExport.txt.separator,a="data:text/plain;charset=utf-16,"+encodeURIComponent(x.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text()}).get().join(e)}).get().join(t)),o=n+".txt",r=s.fn.tableExport.txt.buttonContent,l=s.fn.tableExport.txt.defaultClass;f(a,o,r,l)}};o.formats.forEach(function(t){d[t](r,c)})})},s.fn.tableExport.defaults={headings:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom"},s.fn.tableExport.xlsx={defaultClass:"xlsx",buttonContent:"Export to xlsx"},s.fn.tableExport.xls={defaultClass:"xls",buttonContent:"Export to xls",separator:" "},s.fn.tableExport.csv={defaultClass:"csv",buttonContent:"Export to csv",separator:","},s.fn.tableExport.txt={defaultClass:"txt",buttonContent:"Export to txt",separator:" "},s.fn.tableExport.defaultFileName="myDownload",s.fn.tableExport.defaultButton="button-default",s.fn.tableExport.bootstrap=["btn","btn-default","btn-toolbar"],s.fn.tableExport.rowDel="\r\n"}(window);
!function(t,n){function e(t){return String(t).replace(/[&<>'\/]/g,function(t){return s.fn.tableExport.entityMap[t]})}function a(t,n){n&&(t+=1462);var e=Date.parse(t);return(e-new Date(Date.UTC(1899,11,30)))/864e5}function o(t,n){for(var e={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=0;r!=t.length;++r)for(var l=0;l!=t[r].length;++l){o.s.r>r&&(o.s.r=r),o.s.c>l&&(o.s.c=l),o.e.r<r&&(o.e.r=r),o.e.c<l&&(o.e.c=l);var f={v:t[r][l]};if(null!=f.v){var s=XLSX.utils.encode_cell({c:l,r:r});"number"==typeof f.v?f.t="n":"boolean"==typeof f.v?f.t="b":f.v instanceof Date?(f.t="n",f.z=XLSX.SSF._table[14],f.v=a(f.v)):f.t="s",e[s]=f}}return o.s.c<1e7&&(e["!ref"]=XLSX.utils.encode_range(o)),e}function r(){return this instanceof r?(this.SheetNames=[],void(this.Sheets={})):new r}function l(t){for(var n=new ArrayBuffer(t.length),e=new Uint8Array(n),a=0;a!=t.length;++a)e[a]=255&t.charCodeAt(a);return n}function f(t,n){var e=new r,a=o(t);e.SheetNames.push(n),e.Sheets[n]=a;var f={bookType:"xlsx",bookSST:!1,type:"binary"},s=XLSX.write(e,f);saveAs(new Blob([l(s)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),n+".xlsx")}var s=t.jQuery;s.fn.tableExport=function(t){var n,a,o,r=s.extend({},s.fn.tableExport.defaults,t),l=s.fn.tableExport.rowDel;return r.bootstrap?(n=s.fn.tableExport.bootstrap[0]+" ",a=s.fn.tableExport.bootstrap[1]+" ",o=s.fn.tableExport.bootstrap[2]+" "):(n=s.fn.tableExport.defaultButton+" ",a=o=""),this.each(function(){function t(t){var n=x.find("caption:not(.head)");n.length?n.append(t):x.prepend('<caption class="'+o+r.position+'">'+t+"</caption>")}function i(e,o,r,l){var f='<a href="'+e+'" download="'+o+'" role="button" class="'+n+a+l+'">'+r+"</a>";t(f)}function p(e,o,r,l){var f="<a href='#' data-obj='"+e+"' download='"+o+"' role='button' class='"+n+a+l+"'>"+r+"</a>";t(f),u(l)}function u(t){var n="."+t;return s(n).on("click",function(t){if(s(this).data("obj")){t.preventDefault();var n=s(this).data("obj"),e=n.data,a=n.name;f(e,a)}})}var x=s(this),c=r.headings?x.find("tr"):x.find("tr:has(td)"),b="id"===r.fileName?x.attr("id")?x.attr("id"):s.fn.tableExport.defaultFileName:r.fileName,d={xlsx:function(t,n){var a=c.map(function(t,n){var e=s(n).find("th, td");return[e.map(function(t,n){return s(n).text()}).get()]}).get(),o=e(JSON.stringify({data:a,name:n})),r=n+".xlsx",l=s.fn.tableExport.xlsx.buttonContent,f=s.fn.tableExport.xlsx.defaultClass;p(o,r,l,f)},xls:function(t,n){var e=s.fn.tableExport.xls.separator,a="data:application/vnd.ms-excel;charset=utf-8,"+encodeURIComponent(c.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text()}).get().join(e)}).get().join(t)),o=n+".xls",r=s.fn.tableExport.xls.buttonContent,l=s.fn.tableExport.xls.defaultClass;i(a,o,r,l)},csv:function(t,n){t='"'+t+'"';var e='"'+s.fn.tableExport.csv.separator+'"',a="data:text/csv;charset=utf-8,"+encodeURIComponent('"'+c.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text().replace(/"/g,'""')}).get().join(e)}).get().join(t)+'"'),o=n+".csv",r=s.fn.tableExport.csv.buttonContent,l=s.fn.tableExport.csv.defaultClass;i(a,o,r,l)},txt:function(t,n){var e=s.fn.tableExport.txt.separator,a="data:text/plain;charset=utf-8,"+encodeURIComponent(c.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text()}).get().join(e)}).get().join(t)),o=n+".txt",r=s.fn.tableExport.txt.buttonContent,l=s.fn.tableExport.txt.defaultClass;i(a,o,r,l)}};r.formats.forEach(function(t){d[t](l,b)})})},s.fn.tableExport.defaults={headings:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom"},s.fn.tableExport.xlsx={defaultClass:"xlsx",buttonContent:"Export to xlsx"},s.fn.tableExport.xls={defaultClass:"xls",buttonContent:"Export to xls",separator:" "},s.fn.tableExport.csv={defaultClass:"csv",buttonContent:"Export to csv",separator:","},s.fn.tableExport.txt={defaultClass:"txt",buttonContent:"Export to txt",separator:" "},s.fn.tableExport.defaultFileName="myDownload",s.fn.tableExport.defaultButton="button-default",s.fn.tableExport.bootstrap=["btn","btn-default","btn-toolbar"],s.fn.tableExport.rowDel="\r\n",s.fn.tableExport.entityMap={"&":"&#38;","<":"&#60;",">":"&#62;","'":"&#39;","/":"&#47"}}(window);

@@ -0,0 +0,0 @@ var gulp = require('gulp'),

@@ -0,0 +0,0 @@ The MIT License (MIT)

{
"name": "tableexport",
"version": "3.1.2",
"version": "3.1.3",
"authors": [

@@ -5,0 +5,0 @@ "clarketm <travis.m.clarke@gmail.com>"

@@ -0,0 +0,0 @@ [![Build Status](https://travis-ci.org/clarketm/TableExport.svg?branch=master)](https://travis-ci.org/clarketm/TableExport)

/*!
* TableExport.js v3.1.2 (http://www.clarketravis.com)
* TableExport.js v3.1.3 (http://www.clarketravis.com)
* Copyright 2015 Travis Clarke

@@ -34,11 +34,12 @@ * Licensed under the MIT license

var dataURL = $rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).text()
});
}).get(),
dataObject = JSON.stringify({
var $cols = $(val).find('th, td');
return [$cols.map(function (i, val) {
return $(val).text();
}).get()];
}).get(),
dataObject = escapeHtml(
JSON.stringify({
data: dataURL,
name: name
}).replace(/'/g, "&#39;"),
})),
myFile = name + ".xlsx",

@@ -51,7 +52,7 @@ myContent = $.fn.tableExport.xlsx.buttonContent,

var colD = $.fn.tableExport.xls.separator,
dataURL = 'data:application/vnd.ms-excel;charset=utf-16,' +
dataURL = 'data:application/vnd.ms-excel;charset=utf-8,' +
encodeURIComponent($rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).html()
return $(val).text();
}).get().join(colD);

@@ -67,7 +68,7 @@ }).get().join(rdel)),

var colD = '"' + $.fn.tableExport.csv.separator + '"',
dataURL = 'data:text/csv;charset=utf-16,' +
dataURL = 'data:text/csv;charset=utf-8,' +
encodeURIComponent('"' + $rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).text().replace(/"/g, '""')
return $(val).text().replace(/"/g, '""');
}).get().join(colD);

@@ -82,7 +83,7 @@ }).get().join(rdel) + '"'),

var colD = $.fn.tableExport.txt.separator,
dataURL = 'data:text/plain;charset=utf-16,' +
dataURL = 'data:text/plain;charset=utf-8,' +
encodeURIComponent($rows.map(function (i, val) {
var $cols = $(val).find('th, td');
return $cols.map(function (i, val) {
return $(val).text()
return $(val).text();
}).get().join(colD);

@@ -175,2 +176,10 @@ }).get().join(rdel)),

$.fn.tableExport.entityMap = {"&": "&#38;", "<": "&#60;", ">": "&#62;", "'": '&#39;', "/": '&#47'};
function escapeHtml(string) {
return String(string).replace(/[&<>'\/]/g, function (s) {
return $.fn.tableExport.entityMap[s];
});
}
function dateNum(v, date1904) {

@@ -177,0 +186,0 @@ if (date1904) v += 1462;

/*!
* TableExport.js v3.1.2 (http://www.clarketravis.com)
* TableExport.js v3.1.3 (http://www.clarketravis.com)
* Copyright 2015 Travis Clarke
* Licensed under the MIT license
*/
!function(t,n){function e(t,n){n&&(t+=1462);var e=Date.parse(t);return(e-new Date(Date.UTC(1899,11,30)))/864e5}function a(t,n){for(var a={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=0;r!=t.length;++r)for(var l=0;l!=t[r].length;++l){o.s.r>r&&(o.s.r=r),o.s.c>l&&(o.s.c=l),o.e.r<r&&(o.e.r=r),o.e.c<l&&(o.e.c=l);var s={v:t[r][l]};if(null!=s.v){var f=XLSX.utils.encode_cell({c:l,r:r});"number"==typeof s.v?s.t="n":"boolean"==typeof s.v?s.t="b":s.v instanceof Date?(s.t="n",s.z=XLSX.SSF._table[14],s.v=e(s.v)):s.t="s",a[f]=s}}return o.s.c<1e7&&(a["!ref"]=XLSX.utils.encode_range(o)),a}function o(){return this instanceof o?(this.SheetNames=[],void(this.Sheets={})):new o}function r(t){for(var n=new ArrayBuffer(t.length),e=new Uint8Array(n),a=0;a!=t.length;++a)e[a]=255&t.charCodeAt(a);return n}function l(t,n){var e=new o,l=a(t);e.SheetNames.push(n),e.Sheets[n]=l;var s={bookType:"xlsx",bookSST:!1,type:"binary"},f=XLSX.write(e,s);saveAs(new Blob([r(f)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),n+".xlsx")}var s=t.jQuery;s.fn.tableExport=function(t){var n,e,a,o=s.extend({},s.fn.tableExport.defaults,t),r=s.fn.tableExport.rowDel;return o.bootstrap?(n=s.fn.tableExport.bootstrap[0]+" ",e=s.fn.tableExport.bootstrap[1]+" ",a=s.fn.tableExport.bootstrap[2]+" "):(n=s.fn.tableExport.defaultButton+" ",e=a=""),this.each(function(){function t(t){var n=u.find("caption:not(.head)");n.length?n.append(t):u.prepend('<caption class="'+a+o.position+'">'+t+"</caption>")}function f(a,o,r,l){var s='<a href="'+a+'" download="'+o+'" role="button" class="'+n+e+l+'">'+r+"</a>";t(s)}function i(a,o,r,l){var s="<a href='#' data-obj='"+a+"' download='"+o+"' role='button' class='"+n+e+l+"'>"+r+"</a>";t(s),p(l)}function p(t){var n="."+t;return s(n).on("click",function(t){if(s(this).data("obj")){t.preventDefault();var n=s(this).data("obj"),e=n.data,a=n.name;l(e,a)}})}var u=s(this),x=o.headings?u.find("tr"):u.find("tr:has(td)"),c="id"===o.fileName?u.attr("id")?u.attr("id"):s.fn.tableExport.defaultFileName:o.fileName,d={xlsx:function(t,n){var e=x.map(function(t,n){var e=s(n).find("th, td");return e.map(function(t,n){return s(n).text()})}).get(),a=JSON.stringify({data:e,name:n}).replace(/'/g,"&#39;"),o=n+".xlsx",r=s.fn.tableExport.xlsx.buttonContent,l=s.fn.tableExport.xlsx.defaultClass;i(a,o,r,l)},xls:function(t,n){var e=s.fn.tableExport.xls.separator,a="data:application/vnd.ms-excel;charset=utf-16,"+encodeURIComponent(x.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).html()}).get().join(e)}).get().join(t)),o=n+".xls",r=s.fn.tableExport.xls.buttonContent,l=s.fn.tableExport.xls.defaultClass;f(a,o,r,l)},csv:function(t,n){t='"'+t+'"';var e='"'+s.fn.tableExport.csv.separator+'"',a="data:text/csv;charset=utf-16,"+encodeURIComponent('"'+x.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text().replace(/"/g,'""')}).get().join(e)}).get().join(t)+'"'),o=n+".csv",r=s.fn.tableExport.csv.buttonContent,l=s.fn.tableExport.csv.defaultClass;f(a,o,r,l)},txt:function(t,n){var e=s.fn.tableExport.txt.separator,a="data:text/plain;charset=utf-16,"+encodeURIComponent(x.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text()}).get().join(e)}).get().join(t)),o=n+".txt",r=s.fn.tableExport.txt.buttonContent,l=s.fn.tableExport.txt.defaultClass;f(a,o,r,l)}};o.formats.forEach(function(t){d[t](r,c)})})},s.fn.tableExport.defaults={headings:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom"},s.fn.tableExport.xlsx={defaultClass:"xlsx",buttonContent:"Export to xlsx"},s.fn.tableExport.xls={defaultClass:"xls",buttonContent:"Export to xls",separator:" "},s.fn.tableExport.csv={defaultClass:"csv",buttonContent:"Export to csv",separator:","},s.fn.tableExport.txt={defaultClass:"txt",buttonContent:"Export to txt",separator:" "},s.fn.tableExport.defaultFileName="myDownload",s.fn.tableExport.defaultButton="button-default",s.fn.tableExport.bootstrap=["btn","btn-default","btn-toolbar"],s.fn.tableExport.rowDel="\r\n"}(window);
!function(t,n){function e(t){return String(t).replace(/[&<>'\/]/g,function(t){return s.fn.tableExport.entityMap[t]})}function a(t,n){n&&(t+=1462);var e=Date.parse(t);return(e-new Date(Date.UTC(1899,11,30)))/864e5}function o(t,n){for(var e={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},r=0;r!=t.length;++r)for(var l=0;l!=t[r].length;++l){o.s.r>r&&(o.s.r=r),o.s.c>l&&(o.s.c=l),o.e.r<r&&(o.e.r=r),o.e.c<l&&(o.e.c=l);var f={v:t[r][l]};if(null!=f.v){var s=XLSX.utils.encode_cell({c:l,r:r});"number"==typeof f.v?f.t="n":"boolean"==typeof f.v?f.t="b":f.v instanceof Date?(f.t="n",f.z=XLSX.SSF._table[14],f.v=a(f.v)):f.t="s",e[s]=f}}return o.s.c<1e7&&(e["!ref"]=XLSX.utils.encode_range(o)),e}function r(){return this instanceof r?(this.SheetNames=[],void(this.Sheets={})):new r}function l(t){for(var n=new ArrayBuffer(t.length),e=new Uint8Array(n),a=0;a!=t.length;++a)e[a]=255&t.charCodeAt(a);return n}function f(t,n){var e=new r,a=o(t);e.SheetNames.push(n),e.Sheets[n]=a;var f={bookType:"xlsx",bookSST:!1,type:"binary"},s=XLSX.write(e,f);saveAs(new Blob([l(s)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),n+".xlsx")}var s=t.jQuery;s.fn.tableExport=function(t){var n,a,o,r=s.extend({},s.fn.tableExport.defaults,t),l=s.fn.tableExport.rowDel;return r.bootstrap?(n=s.fn.tableExport.bootstrap[0]+" ",a=s.fn.tableExport.bootstrap[1]+" ",o=s.fn.tableExport.bootstrap[2]+" "):(n=s.fn.tableExport.defaultButton+" ",a=o=""),this.each(function(){function t(t){var n=x.find("caption:not(.head)");n.length?n.append(t):x.prepend('<caption class="'+o+r.position+'">'+t+"</caption>")}function i(e,o,r,l){var f='<a href="'+e+'" download="'+o+'" role="button" class="'+n+a+l+'">'+r+"</a>";t(f)}function p(e,o,r,l){var f="<a href='#' data-obj='"+e+"' download='"+o+"' role='button' class='"+n+a+l+"'>"+r+"</a>";t(f),u(l)}function u(t){var n="."+t;return s(n).on("click",function(t){if(s(this).data("obj")){t.preventDefault();var n=s(this).data("obj"),e=n.data,a=n.name;f(e,a)}})}var x=s(this),c=r.headings?x.find("tr"):x.find("tr:has(td)"),b="id"===r.fileName?x.attr("id")?x.attr("id"):s.fn.tableExport.defaultFileName:r.fileName,d={xlsx:function(t,n){var a=c.map(function(t,n){var e=s(n).find("th, td");return[e.map(function(t,n){return s(n).text()}).get()]}).get(),o=e(JSON.stringify({data:a,name:n})),r=n+".xlsx",l=s.fn.tableExport.xlsx.buttonContent,f=s.fn.tableExport.xlsx.defaultClass;p(o,r,l,f)},xls:function(t,n){var e=s.fn.tableExport.xls.separator,a="data:application/vnd.ms-excel;charset=utf-8,"+encodeURIComponent(c.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text()}).get().join(e)}).get().join(t)),o=n+".xls",r=s.fn.tableExport.xls.buttonContent,l=s.fn.tableExport.xls.defaultClass;i(a,o,r,l)},csv:function(t,n){t='"'+t+'"';var e='"'+s.fn.tableExport.csv.separator+'"',a="data:text/csv;charset=utf-8,"+encodeURIComponent('"'+c.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text().replace(/"/g,'""')}).get().join(e)}).get().join(t)+'"'),o=n+".csv",r=s.fn.tableExport.csv.buttonContent,l=s.fn.tableExport.csv.defaultClass;i(a,o,r,l)},txt:function(t,n){var e=s.fn.tableExport.txt.separator,a="data:text/plain;charset=utf-8,"+encodeURIComponent(c.map(function(t,n){var a=s(n).find("th, td");return a.map(function(t,n){return s(n).text()}).get().join(e)}).get().join(t)),o=n+".txt",r=s.fn.tableExport.txt.buttonContent,l=s.fn.tableExport.txt.defaultClass;i(a,o,r,l)}};r.formats.forEach(function(t){d[t](l,b)})})},s.fn.tableExport.defaults={headings:!0,formats:["xls","csv","txt"],fileName:"id",bootstrap:!0,position:"bottom"},s.fn.tableExport.xlsx={defaultClass:"xlsx",buttonContent:"Export to xlsx"},s.fn.tableExport.xls={defaultClass:"xls",buttonContent:"Export to xls",separator:" "},s.fn.tableExport.csv={defaultClass:"csv",buttonContent:"Export to csv",separator:","},s.fn.tableExport.txt={defaultClass:"txt",buttonContent:"Export to txt",separator:" "},s.fn.tableExport.defaultFileName="myDownload",s.fn.tableExport.defaultButton="button-default",s.fn.tableExport.bootstrap=["btn","btn-default","btn-toolbar"],s.fn.tableExport.rowDel="\r\n",s.fn.tableExport.entityMap={"&":"&#38;","<":"&#60;",">":"&#62;","'":"&#39;","/":"&#47"}}(window);

@@ -0,0 +0,0 @@ /* Blob.js

@@ -0,0 +0,0 @@ /*! FileSaver.js

@@ -0,0 +0,0 @@ (function ($) {

@@ -0,0 +0,0 @@ function generateArray(table) {

@@ -0,0 +0,0 @@ /* Blob.js

@@ -0,0 +0,0 @@ function dateNum(v, date1904) {

@@ -0,0 +0,0 @@ /* FileSaver.js

@@ -0,0 +0,0 @@ $(function () {

@@ -0,0 +0,0 @@ // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.

@@ -0,0 +0,0 @@ /* Blob.js

@@ -0,0 +0,0 @@ function dateNum(v, date1904) {

@@ -0,0 +0,0 @@ /* FileSaver.js

@@ -0,0 +0,0 @@ (function ($) {

@@ -0,0 +0,0 @@ $(function () {

@@ -0,0 +0,0 @@ // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.

@@ -0,0 +0,0 @@ /* Blob.js

@@ -0,0 +0,0 @@ function dateNum(v, date1904) {

@@ -0,0 +0,0 @@ /* FileSaver.js

@@ -0,0 +0,0 @@ (function ($) {

@@ -0,0 +0,0 @@ (function ($) {

@@ -0,0 +0,0 @@ function dateNum(v, date1904) {

@@ -0,0 +0,0 @@ (function ($) {

@@ -0,0 +0,0 @@ /*!

@@ -0,0 +0,0 @@ /*!

@@ -0,0 +0,0 @@ /*!

@@ -0,0 +0,0 @@ /*!

@@ -0,0 +0,0 @@ /*!

@@ -0,0 +0,0 @@ /*!

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

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 too big to display

Sorry, the diff of this file is too big to display

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc