diff --git a/dist/xlsx_html.full.min.js b/dist/xlsx_html.full.min.js index d070de7..d5662ac 100644 --- a/dist/xlsx_html.full.min.js +++ b/dist/xlsx_html.full.min.js @@ -17,4 +17,4 @@ var $alignment=XmlNode("alignment");if(attributes.alignment.horizontal){$alignme /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})} -var html_utils={};function make_html_utils_lib(XLSX){function is_dom_element_hidden(element){var display="",get_computed_style=function(element){return element.ownerDocument.defaultView&&"function"==typeof element.ownerDocument.defaultView.getComputedStyle?element.ownerDocument.defaultView.getComputedStyle:"function"==typeof getComputedStyle?getComputedStyle:null}(element);return get_computed_style&&(display=get_computed_style(element).getPropertyValue("display")),display||(display=element.style.display),"none"===display}var entities,htmldecode=(entities=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(x){return[new RegExp("&"+x[0]+";","g"),x[1]]}),function(str){for(var o=str.trim().replace(/\s+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),i=0;i"],["lt","<"],["amp","&"]].map(function(x){return[new RegExp("&"+x[0]+";","g"),x[1]]}),function(str){for(var o=str.trim().replace(/\s+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),i=0;i"],["lt","<"],["amp","&"]].map(function(x){return[new RegExp("&"+x[0]+";","g"),x[1]]}),function(str){for(var o=str.trim().replace(/\s+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),i=0;i"],["lt","<"],["amp","&"]].map(function(x){return[new RegExp("&"+x[0]+";","g"),x[1]]}),function(str){for(var o=str.trim().replace(/\s+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,""),i=0;i - - + - - - + + + + - - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
- Sample Excel -
- Italic and horizontal center in Arial -
Col 1 (number)Col 2Wrapped TextCol 4 (date)Col 5exclude in export
- 1 - - ABC1 - - Striked Text - - 05-20-2018 - - 2210.00 - - X -
- 2 - - ABC 2 - - Merged cell - - 05-21-2018 - - 230.00 - - X -
+ + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - - + + + - - - - - - - -
+ Sample Excel +
+ Italic and horizontal center in Arial +
Col 1 (number)Col 2Wrapped TextCol 4 (date)Col 5exclude in export
1 + ABC1 + Striked Text05-20-20182210.00X
- 05-22-2018 -
2 + ABC 2 + Merged cell05-21-2018230.00X
05-22-2018 - 2493.00 - - X -
2493.00X
- Total - - 4933.00 - - X -
- + + + Hyperlink + + + 4933.00 + + X + + + +
- - - \ No newline at end of file + + diff --git a/src/xlsx_html_utils.js b/src/xlsx_html_utils.js index 0652d48..74af00a 100644 --- a/src/xlsx_html_utils.js +++ b/src/xlsx_html_utils.js @@ -72,6 +72,7 @@ function make_html_utils_lib(XLSX) { var _b_l_s = elt.getAttribute("data-b-l-s"); var _b_r_s = elt.getAttribute("data-b-r-s"); var _b_a_s = elt.getAttribute("data-b-a-s"); + var _link_target = elt.getAttribute("data-link"); if (v != null) { if (v.length == 0) o.t = _t || "z"; else if (opts.raw || v.trim().length == 0 || _t == "s") { @@ -104,6 +105,12 @@ function make_html_utils_lib(XLSX) { if (_fillFgColor) { o.s.fill = { patternType: "solid", fgColor: { rgb: _fillFgColor } }; } + if (_link_target) { + o.l = { + Target: _link_target, + Tooltip: _link_target + }; + } } if (opts.dense) { if (!ws[R]) ws[R] = [];