diff --git a/bower.json b/bower.json index ab4eb26..67a0cd8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tableexport.js", - "version": "3.2.8", + "version": "3.2.9", "authors": [ "clarketm " ], diff --git a/dist/css/tableexport.css b/dist/css/tableexport.css index d8e9221..ead872d 100644 --- a/dist/css/tableexport.css +++ b/dist/css/tableexport.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ diff --git a/dist/css/tableexport.min.css b/dist/css/tableexport.min.css index 051e508..4fb95b9 100644 --- a/dist/css/tableexport.min.css +++ b/dist/css/tableexport.min.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv:before,.txt:before,.xls:before,.xlsx:before{content:""}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{background:url(../img/xlsx.svg) center no-repeat #006400}.xls:before{background:url(../img/xls.svg) center no-repeat green}.csv:before{background:url(../img/csv.svg) center no-repeat #00f}.txt:before{background:url(../img/txt.svg) center no-repeat purple} \ No newline at end of file diff --git a/dist/js/tableexport.js b/dist/js/tableexport.js index a833b49..da5408a 100644 --- a/dist/js/tableexport.js +++ b/dist/js/tableexport.js @@ -1,26 +1,21 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ ;(function (root, factory) { if (typeof define === 'function' && define.amd) { - // AMD - define(['jquery', 'file-saver', 'xlsx'], factory); - } else if (typeof exports === 'object') { - // Node, CommonJS-like - module.exports = function (root, jQuery) { - if (jQuery === undefined) { - jQuery = typeof window !== 'undefined' ? require('jquery') : require('jquery')(root); - } - return factory(jQuery, require('file-saver'), require('xlsx')); - }; + // AMD. Register as an anonymous module. + define(['exports', 'jquery', 'file-saver', 'xlsx'], factory); + } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { + // CommonJS + factory(exports, require('jquery'), require('file-saver'), require('xlsx')); } else { - // Browser globals (root is window) - root.TableExport = factory(root.jQuery, root.saveAs, root.XLSX) + // Browser globals + factory(root, root.jQuery, root.saveAs, root.XLSX); } -}(this, function ($, saveAs, XLSX) { +}(this, function (exports, $, saveAs, XLSX) { 'use strict'; /** * TableExport main plugin constructor @@ -482,7 +477,7 @@ $.fn.tableExport[prop] = TableExport.prototype[prop]; } - return TableExport; + exports.default = exports.TableExport = TableExport; } )); \ No newline at end of file diff --git a/dist/js/tableexport.min.js b/dist/js/tableexport.min.js index 7371e58..ab3f9a3 100644 --- a/dist/js/tableexport.min.js +++ b/dist/js/tableexport.min.js @@ -1,6 +1,6 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ -!function(t,e){"function"==typeof define&&define.amd?define(["jquery","file-saver","xlsx"],e):"object"==typeof exports?module.exports=function(t,n){return void 0===n&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(n,require("file-saver"),require("xlsx"))}:t.TableExport=e(t.jQuery,t.saveAs,t.XLSX)}(this,function(t,e,n){"use strict";var o=function(e,i,r){var s=this;s.settings=r?i:t.extend({},o.prototype.defaults,i),s.selectors=e;var a,p,f,l=o.prototype.rowDel,u=s.settings.ignoreRows instanceof Array?s.settings.ignoreRows:[s.settings.ignoreRows],c=s.settings.ignoreCols instanceof Array?s.settings.ignoreCols:[s.settings.ignoreCols],x=s.settings.ignoreCSS instanceof Array?s.settings.ignoreCSS.join(", "):s.settings.ignoreCSS;return s.settings.bootstrap?(a=o.prototype.bootstrap[0]+" ",p=o.prototype.bootstrap[1]+" ",f=o.prototype.bootstrap[2]+" "):(a=o.prototype.defaultButton+" ",p=f=""),s.selectors.each(function(){function e(t){var e=d.find("caption:not(.head)");e.length?e.append(t):d.prepend(''+t+"")}function i(t,n,o){var i="";e(i)}var d=t(this);r&&d.find("caption:not(.head)").remove();var y=d.find("tbody").find("tr"),y=s.settings.headings?y.add(d.find("thead>tr")):y,y=s.settings.footers?y.add(d.find("tfoot>tr")):y,m=s.settings.headings?d.find("thead>tr").length:0,g="id"===s.settings.fileName?d.attr("id")?d.attr("id"):o.prototype.defaultFileName:s.settings.fileName,v={xlsx:function(e,n){var r={},s=y.map(function(e,n){if(!~u.indexOf(e-m)&&!t(n).is(x)){var o=t(n).find("th, td");return[o.map(function(n,o){if(!~c.indexOf(n)&&!t(o).is(x)){if(r[e]&&r[e][n])return new Array(r[e][n]).concat(t(o).text());if(o.hasAttribute("colspan")&&(r[e]=r[e]||{},r[e][n+1]=o.getAttribute("colspan")-1),o.hasAttribute("rowspan"))for(var i=1;i":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:" ",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"application/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return o.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},i=0;i!=t.length;++i)for(var r=0;r!=t[i].length;++r){o.s.r>i&&(o.s.r=i),o.s.c>r&&(o.s.c=r),o.e.r'+t+"")}function n(e,n,o){var i="";t(i)}var d=e(this);r&&d.find("caption:not(.head)").remove();var y=d.find("tbody").find("tr"),y=s.settings.headings?y.add(d.find("thead>tr")):y,y=s.settings.footers?y.add(d.find("tfoot>tr")):y,m=s.settings.headings?d.find("thead>tr").length:0,g="id"===s.settings.fileName?d.attr("id")?d.attr("id"):i.prototype.defaultFileName:s.settings.fileName,v={xlsx:function(t,o){var r={},s=y.map(function(t,n){if(!~u.indexOf(t-m)&&!e(n).is(x)){var o=e(n).find("th, td");return[o.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x)){if(r[t]&&r[t][n])return new Array(r[t][n]).concat(e(o).text());if(o.hasAttribute("colspan")&&(r[t]=r[t]||{},r[t][n+1]=o.getAttribute("colspan")-1),o.hasAttribute("rowspan"))for(var i=1;i":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:" ",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"application/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return i.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},i=0;i!=t.length;++i)for(var r=0;r!=t[i].length;++r){n.s.r>i&&(n.s.r=i),n.s.c>r&&(n.s.c=r),n.e.r" ], diff --git a/src/stable/css/tableexport.css b/src/stable/css/tableexport.css index d8e9221..ead872d 100644 --- a/src/stable/css/tableexport.css +++ b/src/stable/css/tableexport.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ diff --git a/src/stable/css/tableexport.min.css b/src/stable/css/tableexport.min.css index 051e508..4fb95b9 100644 --- a/src/stable/css/tableexport.min.css +++ b/src/stable/css/tableexport.min.css @@ -1,5 +1,5 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */.top{caption-side:top}.bottom{caption-side:bottom}.button-default,.button-default:active,.button-default:focus,.button-default:hover{text-decoration:none}.button-default{font:700 12px sans-serif;color:#222;cursor:pointer;padding:5px;margin:5px}.button-default.csv:before,.button-default.txt:before,.button-default.xls:before,.button-default.xlsx:before{content:none}.csv:before,.txt:before,.xls:before,.xlsx:before{content:""}.csv,.txt,.xls,.xlsx{margin:4px 0}.csv:before,.txt:before,.xls:before,.xlsx:before{margin-right:10px;padding:11px 15px 12px;box-shadow:1px 1px 2px rgba(0,0,0,.2)}.xlsx:before{background:url(../img/xlsx.svg) center no-repeat #006400}.xls:before{background:url(../img/xls.svg) center no-repeat green}.csv:before{background:url(../img/csv.svg) center no-repeat #00f}.txt:before{background:url(../img/txt.svg) center no-repeat purple} \ No newline at end of file diff --git a/src/stable/js/tableexport.js b/src/stable/js/tableexport.js index a833b49..da5408a 100644 --- a/src/stable/js/tableexport.js +++ b/src/stable/js/tableexport.js @@ -1,26 +1,21 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ ;(function (root, factory) { if (typeof define === 'function' && define.amd) { - // AMD - define(['jquery', 'file-saver', 'xlsx'], factory); - } else if (typeof exports === 'object') { - // Node, CommonJS-like - module.exports = function (root, jQuery) { - if (jQuery === undefined) { - jQuery = typeof window !== 'undefined' ? require('jquery') : require('jquery')(root); - } - return factory(jQuery, require('file-saver'), require('xlsx')); - }; + // AMD. Register as an anonymous module. + define(['exports', 'jquery', 'file-saver', 'xlsx'], factory); + } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { + // CommonJS + factory(exports, require('jquery'), require('file-saver'), require('xlsx')); } else { - // Browser globals (root is window) - root.TableExport = factory(root.jQuery, root.saveAs, root.XLSX) + // Browser globals + factory(root, root.jQuery, root.saveAs, root.XLSX); } -}(this, function ($, saveAs, XLSX) { +}(this, function (exports, $, saveAs, XLSX) { 'use strict'; /** * TableExport main plugin constructor @@ -482,7 +477,7 @@ $.fn.tableExport[prop] = TableExport.prototype[prop]; } - return TableExport; + exports.default = exports.TableExport = TableExport; } )); \ No newline at end of file diff --git a/src/stable/js/tableexport.min.js b/src/stable/js/tableexport.min.js index 7371e58..ab3f9a3 100644 --- a/src/stable/js/tableexport.min.js +++ b/src/stable/js/tableexport.min.js @@ -1,6 +1,6 @@ /*! - * TableExport.js v3.2.8 (https://www.travismclarke.com) + * TableExport.js v3.2.9 (https://www.travismclarke.com) * Copyright 2016 Travis Clarke * Licensed under the MIT license */ -!function(t,e){"function"==typeof define&&define.amd?define(["jquery","file-saver","xlsx"],e):"object"==typeof exports?module.exports=function(t,n){return void 0===n&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(n,require("file-saver"),require("xlsx"))}:t.TableExport=e(t.jQuery,t.saveAs,t.XLSX)}(this,function(t,e,n){"use strict";var o=function(e,i,r){var s=this;s.settings=r?i:t.extend({},o.prototype.defaults,i),s.selectors=e;var a,p,f,l=o.prototype.rowDel,u=s.settings.ignoreRows instanceof Array?s.settings.ignoreRows:[s.settings.ignoreRows],c=s.settings.ignoreCols instanceof Array?s.settings.ignoreCols:[s.settings.ignoreCols],x=s.settings.ignoreCSS instanceof Array?s.settings.ignoreCSS.join(", "):s.settings.ignoreCSS;return s.settings.bootstrap?(a=o.prototype.bootstrap[0]+" ",p=o.prototype.bootstrap[1]+" ",f=o.prototype.bootstrap[2]+" "):(a=o.prototype.defaultButton+" ",p=f=""),s.selectors.each(function(){function e(t){var e=d.find("caption:not(.head)");e.length?e.append(t):d.prepend(''+t+"")}function i(t,n,o){var i="";e(i)}var d=t(this);r&&d.find("caption:not(.head)").remove();var y=d.find("tbody").find("tr"),y=s.settings.headings?y.add(d.find("thead>tr")):y,y=s.settings.footers?y.add(d.find("tfoot>tr")):y,m=s.settings.headings?d.find("thead>tr").length:0,g="id"===s.settings.fileName?d.attr("id")?d.attr("id"):o.prototype.defaultFileName:s.settings.fileName,v={xlsx:function(e,n){var r={},s=y.map(function(e,n){if(!~u.indexOf(e-m)&&!t(n).is(x)){var o=t(n).find("th, td");return[o.map(function(n,o){if(!~c.indexOf(n)&&!t(o).is(x)){if(r[e]&&r[e][n])return new Array(r[e][n]).concat(t(o).text());if(o.hasAttribute("colspan")&&(r[e]=r[e]||{},r[e][n+1]=o.getAttribute("colspan")-1),o.hasAttribute("rowspan"))for(var i=1;i":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:" ",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"application/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return o.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},o={s:{c:1e7,r:1e7},e:{c:0,r:0}},i=0;i!=t.length;++i)for(var r=0;r!=t[i].length;++r){o.s.r>i&&(o.s.r=i),o.s.c>r&&(o.s.c=r),o.e.r'+t+"")}function n(e,n,o){var i="";t(i)}var d=e(this);r&&d.find("caption:not(.head)").remove();var y=d.find("tbody").find("tr"),y=s.settings.headings?y.add(d.find("thead>tr")):y,y=s.settings.footers?y.add(d.find("tfoot>tr")):y,m=s.settings.headings?d.find("thead>tr").length:0,g="id"===s.settings.fileName?d.attr("id")?d.attr("id"):i.prototype.defaultFileName:s.settings.fileName,v={xlsx:function(t,o){var r={},s=y.map(function(t,n){if(!~u.indexOf(t-m)&&!e(n).is(x)){var o=e(n).find("th, td");return[o.map(function(n,o){if(!~c.indexOf(n)&&!e(o).is(x)){if(r[t]&&r[t][n])return new Array(r[t][n]).concat(e(o).text());if(o.hasAttribute("colspan")&&(r[t]=r[t]||{},r[t][n+1]=o.getAttribute("colspan")-1),o.hasAttribute("rowspan"))for(var i=1;i":">","'":"'","/":"/"},xlsx:{defaultClass:"xlsx",buttonContent:"Export to xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileExtension:".xlsx"},xls:{defaultClass:"xls",buttonContent:"Export to xls",separator:" ",mimeType:"application/vnd.ms-excel",fileExtension:".xls"},csv:{defaultClass:"csv",buttonContent:"Export to csv",separator:",",mimeType:"application/csv",fileExtension:".csv"},txt:{defaultClass:"txt",buttonContent:"Export to txt",separator:" ",mimeType:"text/plain",fileExtension:".txt"},escapeHtml:function(t){return String(t).replace(/[&<>'\/]/g,function(t){return i.prototype.entityMap[t]})},dateNum:function(t,e){e&&(t+=1462);var n=Date.parse(t);return(n-new Date(Date.UTC(1899,11,30)))/864e5},createSheet:function(t){for(var e={},n={s:{c:1e7,r:1e7},e:{c:0,r:0}},i=0;i!=t.length;++i)for(var r=0;r!=t[i].length;++r){n.s.r>i&&(n.s.r=i),n.s.c>r&&(n.s.c=r),n.e.r