From 53c20342fcd66835edfc4a60d9ea4ce06cffc104 Mon Sep 17 00:00:00 2001 From: Arash Gharibi Date: Sat, 31 Oct 2020 22:38:10 +0100 Subject: [PATCH] - Resolved the issue with the xls export for IE and Edge. --- dist/objectexporter.min.js | 1013 +++++++++++++++++++++++++++++++- dist/objectexporter.min.js.map | 1 + examples/example.html | 2 +- package.json | 16 +- src/js/xls.js | 6 +- 5 files changed, 1025 insertions(+), 13 deletions(-) create mode 100644 dist/objectexporter.min.js.map diff --git a/dist/objectexporter.min.js b/dist/objectexporter.min.js index d49b96d..20f24d8 100644 --- a/dist/objectexporter.min.js +++ b/dist/objectexporter.min.js @@ -1 +1,1012 @@ -!function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="./src/index.js")}({"./node_modules/detect-browser/es/index.js":function(e,y,v){"use strict";v.r(y),function(t){v.d(y,"BrowserInfo",function(){return i}),v.d(y,"NodeInfo",function(){return e}),v.d(y,"SearchBotDeviceInfo",function(){return s}),v.d(y,"BotInfo",function(){return a}),v.d(y,"ReactNativeInfo",function(){return n}),v.d(y,"detect",function(){return o}),v.d(y,"browserName",function(){return p}),v.d(y,"parseUserAgent",function(){return m}),v.d(y,"detectOS",function(){return h}),v.d(y,"getNodeVersion",function(){return b});var r=function(){for(var e=0,t=0,n=arguments.length;t=t.status}function s(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var u="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof e&&e.global===e?e:void 0,a=u.saveAs||("object"!=typeof window||window!==u?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var o=u.URL||u.webkitURL,r=document.createElement("a");t=t||e.name||"download",r.download=t,r.rel="noopener","string"==typeof e?(r.href=e,r.origin===location.origin?s(r):i(r.href)?d(e,t,n):s(r,r.target="_blank")):(r.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(r.href)},4e4),setTimeout(function(){s(r)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(r(e,n),t);else if(i(e))d(e,t,n);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){s(o)})}}:function(e,t,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return d(e,t,n);var r="application/octet-stream"===e.type,i=/constructor/i.test(u.HTMLElement)||u.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||r&&i)&&"object"==typeof FileReader){var a=new FileReader;a.onloadend=function(){var e=a.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},a.readAsDataURL(e)}else{var l=u.URL||u.webkitURL,c=l.createObjectURL(e);o?o.location=c:location.href=c,o=null,setTimeout(function(){l.revokeObjectURL(c)},4e4)}});u.saveAs=a.saveAs=a,true&&(o.exports=a)})?n.apply(r,t):n)||(o.exports=n)}).call(this,e("./node_modules/webpack/buildin/global.js"))},"./node_modules/process/browser.js":function(e,t){var n,o,e=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{o="function"==typeof clearTimeout?clearTimeout:i}catch(e){o=i}}();var a,l=[],c=!1,d=-1;function u(){c&&a&&(c=!1,a.length?l=a.concat(l):d=-1,l.length&&f())}function f(){if(!c){var e=s(u);c=!0;for(var t=l.length;t;){for(a=l,l=[];++d",a=new Uint8Array(s.length),l=0;l");var a,l,c,d,u,f=0;if("object"!==x(t[0])){s+="";for(var p=0;p'+t[p]+"";s+="",!0===i&&(s+="");for(var m=0;m';for(var h=0;h/i.test(u)?s+=u:s+='"+u+"";s+=""}s+=""}else{for(var b=0;b";for(var y=0;y'+t[y].alias+"";s+="",!0===i&&(s+="");for(var v=0;v';for(var w=0;w/i.test(l)?s+=l:s+='"+l+"";s+=""}}return s}n.r(t),n.d(t,"htmlTblCreater",function(){return o})},"./src/js/html.js":function(e,t,n){"use strict";n.r(t);var r=n("./src/js/placeholder.js"),i=n("./node_modules/detect-browser/es/index.js").detect;t.default={export:function(e){var t=i(),n=document.getElementById(e.exportable);if(void 0===n)throw new Error("There is no DOM object available for the requested id.");n=r.default.generateFrame(e,n.innerHTML);document.getElementById("jsObjExporterFrameId")&&document.getElementById("jsObjExporterFrameId").remove(),document.getElementsByTagName("body")[0].appendChild(n);var o=document.getElementById("jsObjExporterFrameId");n.onload=function(){o.focus(),"edge"===t.name||"ie"===t.name?o.contentWindow.document.execCommand("print",!1,null):o.contentWindow.print()}}}},"./src/js/init.js":function(e,t,n){"use strict";n.r(t);var o=n("./src/js/csv.js"),r=n("./src/js/xls.js"),i=n("./src/js/pdf.js"),s=n("./src/js/doc.js"),a=n("./src/js/html.js");function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}t.default={init:function(e){var t={type:"object",headers:null,exportable:null,fileName:"export",headerStyle:"font-size:16px; font-weight:bold;",cellStyle:"font-size:14px;",sheetName:"worksheet",documentTitle:"test document title",documentTitleStyle:"color:red;",repeatHeader:!0,columnSeparator:","},e=e;if(void 0===e)throw new Error("obj2csv expects at least 1 exportable!");if("object"!==l(e))throw new Error('Unexpected argument type! Expected "object", got '+l(e));if(t.exportable=e.exportable,t.type=(void 0!==e.type?e:t).type,t.headers=(void 0!==e.headers?e:t).headers,t.fileName=(void 0!==e.fileName?e:t).fileName,t.headerStyle=(void 0!==e.headerStyle?e:t).headerStyle,t.cellStyle=(void 0!==e.cellStyle?e:t).cellStyle,t.sheetName=(void 0!==e.sheetName?e:t).sheetName,t.documentTitle=(void 0!==e.documentTitle?e:t).documentTitle,t.documentTitleStyle=(void 0!==e.documentTitleStyle?e:t).documentTitleStyle,t.repeatHeader=(void 0!==e.repeatHeader?e:t).repeatHeader,t.columnSeparator=(void 0!==e.columnSeparator?e:t).columnSeparator,!t.exportable)throw new Error("Invalid exportable!");if(!t.type||"string"!=typeof t.type)throw new Error("Invalid exportable type! only string type is acceptable!");if(-1===["csv","xls","pdf","doc","html"].indexOf(t.type.toLowerCase()))throw new Error('Invalid exportable type. Available types are "CSV", "XLS", "pdf" and "DOC".');if("boolean"!=typeof t.repeatHeader&&void 0!==t.repeatHeader)throw new Error('Invalid value for the repeat header parameter. Available types are "true" and "false".');switch(t.type){case"csv":o.default.export(t);break;case"xls":r.default.export(t);break;case"pdf":i.default.export(t);break;case"doc":s.default.export(t);break;case"html":a.default.export(t)}}}},"./src/js/pdf.js":function(e,t,n){"use strict";n.r(t);var u=n("./src/js/el.js"),f=n("./node_modules/detect-browser/es/index.js").detect;t.default={export:function(e){!function(o,r,i,s,a,l,c){var e=document.createElement("iframe");e.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute;"),e.setAttribute("id","objectExporterPrintableBodyId"),e.srcdoc="",document.getElementsByTagName("body")[0].appendChild(e);var d=document.getElementById("objectExporterPrintableBodyId");e.onload=function(){var e=f(),t=d.contentWindow||d.contentDocument;t.document&&(t=t.document);var n=''+o+"
";n+=Object(u.htmlTblCreater)("pdf",i,s,a,l,c),t.body.innerHTML=n;n=document.createElement("style");n.innerHTML="",t.head.appendChild(n),d.focus(),"edge"===e.name||"ie"===e.name?d.contentWindow.document.execCommand("print",!1,null):d.contentWindow.print()}}(e.documentTitle,e.documentTitleStyle,e.headers,e.exportable,e.headerStyle,e.cellStyle,e.repeatHeader)}}},"./src/js/placeholder.js":function(e,t,n){"use strict";n.r(t);n={generateFrame:function(e,t){var n=document.createElement("iframe");return n.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute;"),n.setAttribute("id","jsObjExporterFrameId"),n.srcdoc=""+t+"",n}};t.default=n},"./src/js/xls.js":function(e,t,n){"use strict";n.r(t);var l=n("./src/js/el.js"),c=n("./node_modules/detect-browser/es/index.js").detect;t.default={export:function(e){!function(e,t,n,o,r,i,s,a){s=''+s+"
";s+=Object(l.htmlTblCreater)("xls",e,t,o,r,!1);r={worksheet:i,table:s},i=document.createElement("a"),n+=".xls";i.setAttribute("href",f+d(u(p,r))),i.setAttribute("download",n),i.style.visibility="hidden";r=c();"edge"===r.name||"ie"===r.name?window.navigator.msSaveBlob&&(s=new Blob([s],{type:"data:application/vnd.ms-excel;"}),navigator.msSaveBlob(s,n)):(document.body.appendChild(i),i.click(),document.body.removeChild(i))}(e.headers,e.exportable,e.fileName,e.headerStyle,e.cellStyle,e.sheetName,e.documentTitle,e.documentTitleStyle)}};var d=function(e){return window.btoa(unescape(encodeURIComponent(e)))},u=function(e,n){return e.replace(/{(\w+)}/g,function(e,t){return n[t]})},f="data:application/vnd.ms-excel;base64,",p='\x3c!--[if gte mso 9]>{worksheet}{table}
'}}); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/index.js": +/*!**********************!*\ + !*** ./src/index.js ***! + \**********************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +/* harmony import */ var _js_init__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./js/init */ "./src/js/init.js"); + +var objectExporter = _js_init__WEBPACK_IMPORTED_MODULE_0__.default.init; + +if (typeof window !== 'undefined') { + window.objectExporter = objectExporter; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (objectExporter); + +/***/ }), + +/***/ "./src/js/csv.js": +/*!***********************!*\ + !*** ./src/js/csv.js ***! + \***********************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + "export": function _export(params) { + exportObject2CSV(params.headers, params.exportable, params.fileName, params.columnSeparator); + } +}); +/** + * Function to export the object as csv. + * @param {array} headers the columns of the csv file. + * @param {object} exportable the records of csv file. + * @param {string} fileName the title of the file which needs to be exported. + * @param {char} columnSeparator the character that separates one colum from another. + */ + +function exportObject2CSV(headers, exportable, fileName, columnSeparator) { + // Check if there is headers provided + if (headers) { + // Check if the provided header is an arry (backward-compatibility for version below 3.3.0 - more info at: https://github.com/gharibi/JsObjExporter/issues/4) + if (_typeof(headers[0]) !== 'object') { + exportable.unshift(headers); + } else { + var headerDataset = {}; + + for (var i = 0; i < headers.length; i++) { + headerDataset[headers[i].name] = headers[i].alias; + } + + exportable.unshift(headerDataset); + } + } // Convert Object to JSON + + + var jsonObject = JSON.stringify(exportable); + var csv = convert2csv(jsonObject, columnSeparator); + var exportFileName = fileName + '.csv'; + var blob = new Blob([csv], { + type: 'text/csv;charset=utf-8;' + }); + + if (navigator.msSaveBlob) { + // IE 10+ + navigator.msSaveBlob(blob, exportFileName); + } else { + var link = document.createElement('a'); + + if (link.download !== undefined) { + // Browsers that support HTML5 download attribute + var url = URL.createObjectURL(blob); + link.setAttribute('href', url); + link.setAttribute('download', exportFileName); + link.style.visibility = 'hidden'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } + } +} +/** + * Function to create an object of arrays to csv. + * @param {object} objArray the json data which needs to be converted to an array. + * @param {char} columnSeparator the character that separates one column from another. + */ + + +function convert2csv(objArray, columnSeparator) { + var array = _typeof(objArray) !== 'object' ? JSON.parse(objArray) : objArray; + var str = ''; + + for (var i = 0; i < array.length; i++) { + var line = ''; + + for (var index in array[i]) { + line += array[i][index] + columnSeparator; + } + + line = line.substring(0, line.length - 1); + str += line + '\r\n'; + } + + return str; +} + +/***/ }), + +/***/ "./src/js/doc.js": +/*!***********************!*\ + !*** ./src/js/doc.js ***! + \***********************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +/* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! file-saver */ "./node_modules/file-saver/dist/FileSaver.min.js"); +/* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(file_saver__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _el__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./el */ "./src/js/el.js"); + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + "export": function _export(params) { + exportObject2Doc(params.headers, params.exportable, params.fileName, params.headerStyle, params.cellStyle, params.repeatHeader); + } +}); +/** + * Function to export the dataset as doc. + * @param {array} headers the columns of the csv file. + * @param {object} exportable the records of csv file. + * @param {string} fileName the title of the file which needs to be exported. + * @param {string} headerStyle the style which can be applied to the headers. + * @param {string} cellStyle the style which can be applied to the cells. + * @param {boolean} repeatHeader determines whether there should be a repeated header on each page. + */ + +function exportObject2Doc(headers, exportable, fileName, headerStyle, cellStyle, repeatHeader) { + // Create the html structured dataset + var dataset = (0,_el__WEBPACK_IMPORTED_MODULE_1__.htmlTblCreater)('doc', headers, exportable, headerStyle, cellStyle, repeatHeader); + var htmlString = '' + dataset + ''; // Create the bytes + + var bytes = new Uint8Array(htmlString.length); + + for (var i = 0; i < htmlString.length; i++) { + bytes[i] = htmlString.charCodeAt(i); + } // Convert the contents to blob + + + var blob = new Blob([bytes], { + type: 'text/html' + }); // Save the file as doc + + (0,file_saver__WEBPACK_IMPORTED_MODULE_0__.saveAs)(blob, fileName + '.doc'); +} + +/***/ }), + +/***/ "./src/js/el.js": +/*!**********************!*\ + !*** ./src/js/el.js ***! + \**********************/ +/*! namespace exports */ +/*! export htmlTblCreater [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "htmlTblCreater": () => /* binding */ htmlTblCreater +/* harmony export */ }); +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function htmlTblCreater(type, headers, exportable, headerStyle, cellStyle, repeatHeader) { + // Construct the html structure for the provided exportable + var dataset = ''; // Check if the headers should be repeated + + if (repeatHeader === true) { + dataset += ''; + } // Check if the provided header is an arry (backward-compatibility for version below 3.3.0 - more info at: https://github.com/gharibi/JsObjExporter/issues/4) + + + var columnFlex = 0; + + if (_typeof(headers[0]) !== 'object') { + // Construct the table headers + dataset += ''; + + for (var j = 0; j < headers.length; j++) { + dataset += ''; + } + + dataset += ''; // Check if the headers should be repeated + + if (repeatHeader === true) { + dataset += ''; + } // Construct the body elements + + + for (var _j = 0; _j < exportable.length; _j++) { + dataset += ''; + + var _loop = function _loop(k) { + // Check if the input string is HTML, if so, do not add the cell tags + var cellContents = exportable[_j][Object.keys(exportable[_j])[k]]; + + if (/<[a-z][\s\S]*>/i.test(cellContents) === true) { + dataset += cellContents; + } else { + dataset += ''; + } + }; + + for (var k = 0; k < Object.keys(exportable[_j]).length - 1; k++) { + _loop(k); + } + + dataset += ''; + } + + dataset += '
' + headers[j] + '
' + cellContents + '
'; + } else { + var _loop2 = function _loop2(i) { + // Check if the header contains a flex, otherwise consider flex=1 to have equal sized columns + columnFlex += function () { + return 'flex' in headers[i] ? headers[i].flex : 1; + }(); + }; + + for (var i = 0; i < headers.length; i++) { + _loop2(i); + } // Construct the table headers + + + dataset += ''; + + for (var _j2 = 0; _j2 < headers.length; _j2++) { + dataset += '' + headers[_j2].alias + ''; + } + + dataset += ''; // Check if the headers should be repeated + + if (repeatHeader === true) { + dataset += ''; + } // Construct the body elements + + + for (var _j3 = 0; _j3 < exportable.length; _j3++) { + dataset += ''; // Loop through the header items to show only the items associated with a header + + var _loop3 = function _loop3(_k) { + // Check if the input string is HTML, if so, do not add the cell tags + var cellContents = exportable[_j3][headers[_k].name]; + + if (/<[a-z][\s\S]*>/i.test(cellContents) === true) { + dataset += cellContents; + } else { + dataset += '' + cellContents + ''; + } + }; + + for (var _k = 0; _k < headers.length; _k++) { + _loop3(_k); + } + + dataset += ''; + } + } // Return the dataset + + + return dataset; +} + +/***/ }), + +/***/ "./src/js/html.js": +/*!************************!*\ + !*** ./src/js/html.js ***! + \************************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +/* harmony import */ var _placeholder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./placeholder */ "./src/js/placeholder.js"); + + +var _require = __webpack_require__(/*! detect-browser */ "./node_modules/detect-browser/es/index.js"), + detect = _require.detect; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + "export": function _export(params) { + // Detect the browser information + var browser = detect(); // Retrieve the DOM for the requested exportable + + var elementDom = document.getElementById(params.exportable); // Check if the DOM is available + + if (typeof elementDom === 'undefined') { + throw new Error('There is no DOM object available for the requested id.'); + } // Construct the exportable for the print + + + var exportableFrame = _placeholder__WEBPACK_IMPORTED_MODULE_0__.default.generateFrame(params, elementDom.innerHTML); // Cleanup the DOM from the exportable frame + + if (document.getElementById('jsObjExporterFrameId')) document.getElementById('jsObjExporterFrameId').remove(); // Attach the exportable frame to the document body + + document.getElementsByTagName('body')[0].appendChild(exportableFrame); // Get the iframe element + + var iframeElement = document.getElementById('jsObjExporterFrameId'); // Set the onload method + + exportableFrame.onload = function () { + // Focus on the frame for priting + iframeElement.focus(); // Check the if the browser is Edge or Internet Explorer + + if (browser.name === 'edge' || browser.name === 'ie') { + iframeElement.contentWindow.document.execCommand('print', false, null); + } else { + // All other browsers + iframeElement.contentWindow.print(); + } + }; + } +}); + +/***/ }), + +/***/ "./src/js/init.js": +/*!************************!*\ + !*** ./src/js/init.js ***! + \************************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +/* harmony import */ var _csv__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./csv */ "./src/js/csv.js"); +/* harmony import */ var _xls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xls */ "./src/js/xls.js"); +/* harmony import */ var _pdf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pdf */ "./src/js/pdf.js"); +/* harmony import */ var _doc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./doc */ "./src/js/doc.js"); +/* harmony import */ var _html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./html */ "./src/js/html.js"); + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + init: function init() { + var params = { + type: 'object', + headers: null, + exportable: null, + fileName: 'export', + headerStyle: 'font-size:16px; font-weight:bold;', + cellStyle: 'font-size:14px;', + sheetName: 'worksheet', + documentTitle: 'test document title', + documentTitleStyle: 'color:red;', + repeatHeader: true, + columnSeparator: ',' + }; // Check if an exportable document or object was supplied + + var args = arguments[0]; + if (args === undefined) throw new Error('obj2csv expects at least 1 exportable!'); // Process parameters + + switch (_typeof(args)) { + case 'object': + params.exportable = args.exportable; + params.type = typeof args.type !== 'undefined' ? args.type : params.type; + params.headers = typeof args.headers !== 'undefined' ? args.headers : params.headers; + params.fileName = typeof args.fileName !== 'undefined' ? args.fileName : params.fileName; + params.headerStyle = typeof args.headerStyle !== 'undefined' ? args.headerStyle : params.headerStyle; + params.cellStyle = typeof args.cellStyle !== 'undefined' ? args.cellStyle : params.cellStyle; + params.sheetName = typeof args.sheetName !== 'undefined' ? args.sheetName : params.sheetName; + params.documentTitle = typeof args.documentTitle !== 'undefined' ? args.documentTitle : params.documentTitle; + params.documentTitleStyle = typeof args.documentTitleStyle !== 'undefined' ? args.documentTitleStyle : params.documentTitleStyle; + params.repeatHeader = typeof args.repeatHeader !== 'undefined' ? args.repeatHeader : params.repeatHeader; + params.columnSeparator = typeof args.columnSeparator !== 'undefined' ? args.columnSeparator : params.columnSeparator; + break; + + default: + throw new Error('Unexpected argument type! Expected "object", got ' + _typeof(args)); + } // Validate type + + + if (!params.exportable) { + throw new Error('Invalid exportable!'); + } + + if (!params.type || typeof params.type !== 'string') { + throw new Error('Invalid exportable type! only string type is acceptable!'); + } + + if (['csv', 'xls', 'pdf', 'doc', 'html'].indexOf(params.type.toLowerCase()) === -1) { + throw new Error('Invalid exportable type. Available types are "CSV", "XLS", "pdf" and "DOC".'); + } + + if (typeof params.repeatHeader !== 'boolean' && typeof params.repeatHeader !== 'undefined') { + throw new Error('Invalid value for the repeat header parameter. Available types are "true" and "false".'); + } // Check exportable type + + + switch (params.type) { + case 'csv': + _csv__WEBPACK_IMPORTED_MODULE_0__.default.export(params); + break; + + case 'xls': + _xls__WEBPACK_IMPORTED_MODULE_1__.default.export(params); + break; + + case 'pdf': + _pdf__WEBPACK_IMPORTED_MODULE_2__.default.export(params); + break; + + case 'doc': + _doc__WEBPACK_IMPORTED_MODULE_3__.default.export(params); + break; + + case 'html': + _html__WEBPACK_IMPORTED_MODULE_4__.default.export(params); + break; + } + } +}); + +/***/ }), + +/***/ "./src/js/pdf.js": +/*!***********************!*\ + !*** ./src/js/pdf.js ***! + \***********************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +/* harmony import */ var _el__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./el */ "./src/js/el.js"); + + +var _require = __webpack_require__(/*! detect-browser */ "./node_modules/detect-browser/es/index.js"), + detect = _require.detect; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + "export": function _export(params) { + exportObject2PDF(params.documentTitle, params.documentTitleStyle, params.headers, params.exportable, params.headerStyle, params.cellStyle, params.repeatHeader); + } +}); + +function exportObject2PDF(documentTitle, documentTitleStyle, headers, exportable, headerStyle, cellStyle, repeatHeader) { + // Define a printable body element + var printableBody = document.createElement('iframe'); // Set the prontableBody to hidden + + printableBody.setAttribute('style', 'visibility: hidden; height: 0; width: 0; position: absolute;'); + printableBody.setAttribute('id', 'objectExporterPrintableBodyId'); // Construct the document title + + printableBody.srcdoc = ''; // Append the printableBody to the current document + + document.getElementsByTagName('body')[0].appendChild(printableBody); // Get the printable elements + + var printableElements = document.getElementById('objectExporterPrintableBodyId'); // Check when the printableBody is loaded successfully + + printableBody.onload = function () { + // Detect the browser information + var browser = detect(); // Define a printable document + + var printableDocument = printableElements.contentWindow || printableElements.contentDocument; // Check if there is document element + + if (printableDocument.document) printableDocument = printableDocument.document; + var printableDocumentContents = '' + documentTitle + '
'; + printableDocumentContents += (0,_el__WEBPACK_IMPORTED_MODULE_0__.htmlTblCreater)('pdf', headers, exportable, headerStyle, cellStyle, repeatHeader); + printableDocument.body.innerHTML = printableDocumentContents; // Assign style to the printable + + var style = document.createElement('style'); + style.innerHTML = ''; + printableDocument.head.appendChild(style); // Prepare the printable for the print + + printableElements.focus(); // Check the if the browser is Edge or Internet Explorer + + if (browser.name === 'edge' || browser.name === 'ie') { + printableElements.contentWindow.document.execCommand('print', false, null); + } else { + // All other browsers + printableElements.contentWindow.print(); + } + }; +} + +/***/ }), + +/***/ "./src/js/placeholder.js": +/*!*******************************!*\ + !*** ./src/js/placeholder.js ***! + \*******************************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +var placeholder = { + /** + * Method to generate the frame for opening the print/export dialog. + * @param {object} params parameters which will are provided at the API level. + * @param {string} body the body of the element which needs to be exported. + */ + generateFrame: function generateFrame(params, body) { + var printFrame = document.createElement('iframe'); + printFrame.setAttribute('style', 'visibility: hidden; height: 0; width: 0; position: absolute;'); + printFrame.setAttribute('id', 'jsObjExporterFrameId'); + printFrame.srcdoc = '' + body + ''; + return printFrame; + } +}; // Export the module + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (placeholder); + +/***/ }), + +/***/ "./src/js/xls.js": +/*!***********************!*\ + !*** ./src/js/xls.js ***! + \***********************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => __WEBPACK_DEFAULT_EXPORT__ +/* harmony export */ }); +/* harmony import */ var _el__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./el */ "./src/js/el.js"); + + +var _require = __webpack_require__(/*! detect-browser */ "./node_modules/detect-browser/es/index.js"), + detect = _require.detect; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + "export": function _export(params) { + exportObject2XLS(params.headers, params.exportable, params.fileName, params.headerStyle, params.cellStyle, params.sheetName, params.documentTitle, params.documentTitleStyle); + } +}); // Defining the required functions + +var base64 = function base64(s) { + return window.btoa(unescape(encodeURIComponent(s))); +}; + +var format = function format(s, c) { + return s.replace(/{(\w+)}/g, function (m, p) { + return c[p]; + }); +}; + +var uri = 'data:application/vnd.ms-excel;base64,'; +var template = '{table}
'; +/** + * Function to export the dataset as xls. + * @param {array} headers the columns of the csv file. + * @param {object} exportable the records of csv file. + * @param {string} fileName the title of the file which needs to be exported. + * @param {string} headerStyle the style which can be applied to the headers. + * @param {string} cellStyle the style which can be applied to the cells. + * @param {string} sheetName the excel sheet name which needs to be applied to the exported xls file. + * @param {string} documentTitle the document title which needs to be written as a header on the excel sheet. + * @param {string} documentTitleStyle the style of the document title. + */ + +function exportObject2XLS(headers, exportable, fileName, headerStyle, cellStyle, sheetName, documentTitle, documentTitleStyle) { + // Construct the html structure for the provided exportable + var dataset = '' + documentTitle + '
'; + dataset += (0,_el__WEBPACK_IMPORTED_MODULE_0__.htmlTblCreater)('xls', headers, exportable, headerStyle, cellStyle, false); // Push the file for being downloaded + + var ctx = { + worksheet: sheetName, + table: dataset + }; + var link = document.createElement('a'); + var exportFileName = fileName + '.xls'; + link.setAttribute('href', uri + base64(format(template, ctx))); + link.setAttribute('download', exportFileName); + link.style.visibility = 'hidden'; // Detect the browser information + + var browser = detect(); // Check the if the browser is Edge or Internet Explorer + + if (browser.name === 'edge' || browser.name === 'ie') { + if (window.navigator.msSaveBlob) { + var blob = new Blob([dataset], { + type: 'data:application/vnd.ms-excel;' + }); + navigator.msSaveBlob(blob, exportFileName); + } + } else { + // All other browsers + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } +} + +/***/ }), + +/***/ "./node_modules/detect-browser/es/index.js": +/*!*************************************************!*\ + !*** ./node_modules/detect-browser/es/index.js ***! + \*************************************************/ +/*! namespace exports */ +/*! export BotInfo [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export BrowserInfo [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export NodeInfo [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export ReactNativeInfo [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export SearchBotDeviceInfo [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export browserName [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export detect [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export detectOS [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export getNodeVersion [provided] [no usage info] [missing usage info prevents renaming] */ +/*! export parseUserAgent [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "BrowserInfo": () => /* binding */ BrowserInfo, +/* harmony export */ "NodeInfo": () => /* binding */ NodeInfo, +/* harmony export */ "SearchBotDeviceInfo": () => /* binding */ SearchBotDeviceInfo, +/* harmony export */ "BotInfo": () => /* binding */ BotInfo, +/* harmony export */ "ReactNativeInfo": () => /* binding */ ReactNativeInfo, +/* harmony export */ "detect": () => /* binding */ detect, +/* harmony export */ "browserName": () => /* binding */ browserName, +/* harmony export */ "parseUserAgent": () => /* binding */ parseUserAgent, +/* harmony export */ "detectOS": () => /* binding */ detectOS, +/* harmony export */ "getNodeVersion": () => /* binding */ getNodeVersion +/* harmony export */ }); +var __spreadArrays = (undefined && undefined.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; +var BrowserInfo = /** @class */ (function () { + function BrowserInfo(name, version, os) { + this.name = name; + this.version = version; + this.os = os; + this.type = 'browser'; + } + return BrowserInfo; +}()); + +var NodeInfo = /** @class */ (function () { + function NodeInfo(version) { + this.version = version; + this.type = 'node'; + this.name = 'node'; + this.os = process.platform; + } + return NodeInfo; +}()); + +var SearchBotDeviceInfo = /** @class */ (function () { + function SearchBotDeviceInfo(name, version, os, bot) { + this.name = name; + this.version = version; + this.os = os; + this.bot = bot; + this.type = 'bot-device'; + } + return SearchBotDeviceInfo; +}()); + +var BotInfo = /** @class */ (function () { + function BotInfo() { + this.type = 'bot'; + this.bot = true; // NOTE: deprecated test name instead + this.name = 'bot'; + this.version = null; + this.os = null; + } + return BotInfo; +}()); + +var ReactNativeInfo = /** @class */ (function () { + function ReactNativeInfo() { + this.type = 'react-native'; + this.name = 'react-native'; + this.version = null; + this.os = null; + } + return ReactNativeInfo; +}()); + +// tslint:disable-next-line:max-line-length +var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/; +var SEARCHBOT_OS_REGEX = /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/; +var REQUIRED_VERSION_PARTS = 3; +var userAgentRules = [ + ['aol', /AOLShield\/([0-9\._]+)/], + ['edge', /Edge\/([0-9\._]+)/], + ['edge-ios', /EdgiOS\/([0-9\._]+)/], + ['yandexbrowser', /YaBrowser\/([0-9\._]+)/], + ['kakaotalk', /KAKAOTALK\s([0-9\.]+)/], + ['samsung', /SamsungBrowser\/([0-9\.]+)/], + ['silk', /\bSilk\/([0-9._-]+)\b/], + ['miui', /MiuiBrowser\/([0-9\.]+)$/], + ['beaker', /BeakerBrowser\/([0-9\.]+)/], + ['edge-chromium', /EdgA?\/([0-9\.]+)/], + [ + 'chromium-webview', + /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/, + ], + ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], + ['phantomjs', /PhantomJS\/([0-9\.]+)(:?\s|$)/], + ['crios', /CriOS\/([0-9\.]+)(:?\s|$)/], + ['firefox', /Firefox\/([0-9\.]+)(?:\s|$)/], + ['fxios', /FxiOS\/([0-9\.]+)/], + ['opera-mini', /Opera Mini.*Version\/([0-9\.]+)/], + ['opera', /Opera\/([0-9\.]+)(?:\s|$)/], + ['opera', /OPR\/([0-9\.]+)(:?\s|$)/], + ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], + ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], + ['ie', /MSIE\s(7\.0)/], + ['bb10', /BB10;\sTouch.*Version\/([0-9\.]+)/], + ['android', /Android\s([0-9\.]+)/], + ['ios', /Version\/([0-9\._]+).*Mobile.*Safari.*/], + ['safari', /Version\/([0-9\._]+).*Safari/], + ['facebook', /FBAV\/([0-9\.]+)/], + ['instagram', /Instagram\s([0-9\.]+)/], + ['ios-webview', /AppleWebKit\/([0-9\.]+).*Mobile/], + ['ios-webview', /AppleWebKit\/([0-9\.]+).*Gecko\)$/], + ['searchbot', SEARCHBOX_UA_REGEX], +]; +var operatingSystemRules = [ + ['iOS', /iP(hone|od|ad)/], + ['Android OS', /Android/], + ['BlackBerry OS', /BlackBerry|BB10/], + ['Windows Mobile', /IEMobile/], + ['Amazon OS', /Kindle/], + ['Windows 3.11', /Win16/], + ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/], + ['Windows 98', /(Windows 98)|(Win98)/], + ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/], + ['Windows XP', /(Windows NT 5.1)|(Windows XP)/], + ['Windows Server 2003', /(Windows NT 5.2)/], + ['Windows Vista', /(Windows NT 6.0)/], + ['Windows 7', /(Windows NT 6.1)/], + ['Windows 8', /(Windows NT 6.2)/], + ['Windows 8.1', /(Windows NT 6.3)/], + ['Windows 10', /(Windows NT 10.0)/], + ['Windows ME', /Windows ME/], + ['Open BSD', /OpenBSD/], + ['Sun OS', /SunOS/], + ['Chrome OS', /CrOS/], + ['Linux', /(Linux)|(X11)/], + ['Mac OS', /(Mac_PowerPC)|(Macintosh)/], + ['QNX', /QNX/], + ['BeOS', /BeOS/], + ['OS/2', /OS\/2/], +]; +function detect(userAgent) { + if (!!userAgent) { + return parseUserAgent(userAgent); + } + if (typeof document === 'undefined' && + typeof navigator !== 'undefined' && + navigator.product === 'ReactNative') { + return new ReactNativeInfo(); + } + if (typeof navigator !== 'undefined') { + return parseUserAgent(navigator.userAgent); + } + return getNodeVersion(); +} +function matchUserAgent(ua) { + // opted for using reduce here rather than Array#first with a regex.test call + // this is primarily because using the reduce we only perform the regex + // execution once rather than once for the test and for the exec again below + // probably something that needs to be benchmarked though + return (ua !== '' && + userAgentRules.reduce(function (matched, _a) { + var browser = _a[0], regex = _a[1]; + if (matched) { + return matched; + } + var uaMatch = regex.exec(ua); + return !!uaMatch && [browser, uaMatch]; + }, false)); +} +function browserName(ua) { + var data = matchUserAgent(ua); + return data ? data[0] : null; +} +function parseUserAgent(ua) { + var matchedRule = matchUserAgent(ua); + if (!matchedRule) { + return null; + } + var name = matchedRule[0], match = matchedRule[1]; + if (name === 'searchbot') { + return new BotInfo(); + } + var versionParts = match[1] && match[1].split(/[._]/).slice(0, 3); + if (versionParts) { + if (versionParts.length < REQUIRED_VERSION_PARTS) { + versionParts = __spreadArrays(versionParts, createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length)); + } + } + else { + versionParts = []; + } + var version = versionParts.join('.'); + var os = detectOS(ua); + var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua); + if (searchBotMatch && searchBotMatch[1]) { + return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]); + } + return new BrowserInfo(name, version, os); +} +function detectOS(ua) { + for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) { + var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1]; + var match = regex.exec(ua); + if (match) { + return os; + } + } + return null; +} +function getNodeVersion() { + var isNode = typeof process !== 'undefined' && process.version; + return isNode ? new NodeInfo(process.version.slice(1)) : null; +} +function createVersionParts(count) { + var output = []; + for (var ii = 0; ii < count; ii++) { + output.push('0'); + } + return output; +} + + +/***/ }), + +/***/ "./node_modules/file-saver/dist/FileSaver.min.js": +/*!*******************************************************!*\ + !*** ./node_modules/file-saver/dist/FileSaver.min.js ***! + \*******************************************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: top-level-this-exports, module, __webpack_require__.g, __webpack_exports__, __webpack_require__.* */ +/*! CommonJS bailout: this is used directly at 1:154-158 */ +/*! CommonJS bailout: module.exports is used directly at 1:2545-2559 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof __webpack_require__.g&&__webpack_require__.g.global===__webpack_require__.g?__webpack_require__.g:void 0,a=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open("","_blank"),e&&(e.document.title=e.document.body.innerText="downloading..."),"string"==typeof a)return c(a,b,d);var g="application/octet-stream"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||g&&h)&&"object"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),e?e.location.href=a:location=a,e=null},j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l,e=null,setTimeout(function(){k.revokeObjectURL(l)},4E4)}});f.saveAs=a.saveAs=a, true&&(module.exports=a)}); + +//# sourceMappingURL=FileSaver.min.js.map + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => module['default'] : +/******/ () => module; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ // startup +/******/ // Load entry module +/******/ __webpack_require__("./src/index.js"); +/******/ // This entry module used 'exports' so it can't be inlined +/******/ })() +; +//# sourceMappingURL=objectexporter.min.js.map \ No newline at end of file diff --git a/dist/objectexporter.min.js.map b/dist/objectexporter.min.js.map new file mode 100644 index 0000000..b3ada1e --- /dev/null +++ b/dist/objectexporter.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://object-exporter/./src/index.js","webpack://object-exporter/./src/js/csv.js","webpack://object-exporter/./src/js/doc.js","webpack://object-exporter/./src/js/el.js","webpack://object-exporter/./src/js/html.js","webpack://object-exporter/./src/js/init.js","webpack://object-exporter/./src/js/pdf.js","webpack://object-exporter/./src/js/placeholder.js","webpack://object-exporter/./src/js/xls.js","webpack://object-exporter/./node_modules/detect-browser/es/index.js","webpack://object-exporter/./node_modules/file-saver/dist/FileSaver.min.js","webpack://object-exporter/webpack/bootstrap","webpack://object-exporter/webpack/runtime/compat get default export","webpack://object-exporter/webpack/runtime/define property getters","webpack://object-exporter/webpack/runtime/global","webpack://object-exporter/webpack/runtime/hasOwnProperty shorthand","webpack://object-exporter/webpack/runtime/make namespace object","webpack://object-exporter/webpack/startup"],"names":["objectExporter","exporter","window","params","exportObject2CSV","headers","exportable","fileName","columnSeparator","unshift","headerDataset","i","length","name","alias","jsonObject","JSON","stringify","csv","convert2csv","exportFileName","blob","Blob","type","navigator","msSaveBlob","link","document","createElement","download","undefined","url","URL","createObjectURL","setAttribute","style","visibility","body","appendChild","click","removeChild","objArray","array","parse","str","line","index","substring","exportObject2Doc","headerStyle","cellStyle","repeatHeader","dataset","htmlTblCreater","htmlString","bytes","Uint8Array","charCodeAt","saveAs","columnFlex","j","k","cellContents","Object","keys","test","toLowerCase","flex","require","detect","browser","elementDom","getElementById","Error","exportableFrame","placeholder","innerHTML","remove","getElementsByTagName","iframeElement","onload","focus","contentWindow","execCommand","print","init","sheetName","documentTitle","documentTitleStyle","args","arguments","indexOf","xls","pdf","doc","html","exportObject2PDF","printableBody","srcdoc","printableElements","printableDocument","contentDocument","printableDocumentContents","head","generateFrame","printFrame","exportObject2XLS","base64","s","btoa","unescape","encodeURIComponent","format","c","replace","m","p","uri","template","ctx","worksheet","table"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAEA,IAAMA,cAAc,GAAGC,kDAAvB;;AAEA,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;AACjCA,QAAM,CAACF,cAAP,GAAwBA,cAAxB;AACD;;AAED,iEAAeA,cAAf,E;;;;;;;;;;;;;;;;;;;;;ACRA,iEAAe;AACb,YAAQ,iBAACG,MAAD,EAAY;AAClBC,oBAAgB,CAACD,MAAM,CAACE,OAAR,EAAiBF,MAAM,CAACG,UAAxB,EAAoCH,MAAM,CAACI,QAA3C,EAAqDJ,MAAM,CAACK,eAA5D,CAAhB;AACD;AAHY,CAAf;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASJ,gBAAT,CAA2BC,OAA3B,EAAoCC,UAApC,EAAgDC,QAAhD,EAA0DC,eAA1D,EAA2E;AACzE;AACA,MAAIH,OAAJ,EAAa;AACX;AACA,QAAI,QAAOA,OAAO,CAAC,CAAD,CAAd,MAAsB,QAA1B,EAAoC;AAClCC,gBAAU,CAACG,OAAX,CAAmBJ,OAAnB;AACD,KAFD,MAEO;AACL,UAAMK,aAAa,GAAG,EAAtB;;AACA,WAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGN,OAAO,CAACO,MAA5B,EAAoCD,CAAC,EAArC,EAAyC;AACvCD,qBAAa,CAACL,OAAO,CAACM,CAAD,CAAP,CAAWE,IAAZ,CAAb,GAAiCR,OAAO,CAACM,CAAD,CAAP,CAAWG,KAA5C;AACD;;AACDR,gBAAU,CAACG,OAAX,CAAmBC,aAAnB;AACD;AACF,GAbwE,CAezE;;;AACA,MAAMK,UAAU,GAAGC,IAAI,CAACC,SAAL,CAAeX,UAAf,CAAnB;AACA,MAAMY,GAAG,GAAGC,WAAW,CAACJ,UAAD,EAAaP,eAAb,CAAvB;AACA,MAAMY,cAAc,GAA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CAgB9H;;AACA,MAAIC,OAAO,CAACzD,IAAR,KAAiB,MAAjB,IAA2ByD,OAAO,CAACzD,IAAR,KAAiB,IAAhD,EAAsD;AACpD,QAAIX,MAAM,CAACsB,SAAP,CAAiBC,UAArB,EAAiC;AAC/B,UAAMJ,IAAI,GAAG,IAAIC,IAAJ,CAAS,CAAC8B,OAAD,CAAT,EAAoB;AAC/B7B,YAAI,EAAE;AADyB,OAApB,CAAb;AAGAC,eAAS,CAACC,UAAV,CAAqBJ,IAArB,EAA2BD,cAA3B;AACD;AACF,GAPD,MAOO;AACL;AACAO,YAAQ,CAACU,IAAT,CAAcC,WAAd,CAA0BZ,IAA1B;AACAA,QAAI,CAACa,KAAL;AACAZ,YAAQ,CAACU,IAAT,CAAcG,WAAd,CAA0Bd,IAA1B;AACD;AACF,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5DD,sBAAsB,SAAI,IAAI,SAAI;AAClC,iDAAiD,QAAQ;AACzD,wCAAwC,QAAQ;AAChD,wDAAwD,QAAQ;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACmB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC8B;AAC/B;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA,CAAC;AACkB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCrBA;WACA;WACA;WACA;WACA;WACA,gCAAgC,YAAY;WAC5C;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,wCAAwC,yCAAyC;WACjF;WACA;WACA,E;;;;;WCPA;WACA;WACA;WACA;WACA,EAAE;WACF;WACA;WACA,CAAC,I;;;;;WCPD,sF;;;;;WCAA;WACA;WACA;WACA,sDAAsD,kBAAkB;WACxE;WACA,+CAA+C,cAAc;WAC7D,E;;;;UCNA;UACA;UACA;UACA","file":"objectexporter.min.js","sourcesContent":["import exporter from './js/init'\n\nconst objectExporter = exporter.init\n\nif (typeof window !== 'undefined') {\n window.objectExporter = objectExporter\n}\n\nexport default objectExporter\n","export default {\n export: (params) => {\n exportObject2CSV(params.headers, params.exportable, params.fileName, params.columnSeparator)\n }\n}\n\n/**\n * Function to export the object as csv.\n * @param {array} headers the columns of the csv file.\n * @param {object} exportable the records of csv file.\n * @param {string} fileName the title of the file which needs to be exported.\n * @param {char} columnSeparator the character that separates one colum from another.\n */\nfunction exportObject2CSV (headers, exportable, fileName, columnSeparator) {\n // Check if there is headers provided\n if (headers) {\n // Check if the provided header is an arry (backward-compatibility for version below 3.3.0 - more info at: https://github.com/gharibi/JsObjExporter/issues/4)\n if (typeof headers[0] !== 'object') {\n exportable.unshift(headers)\n } else {\n const headerDataset = {}\n for (let i = 0; i < headers.length; i++) {\n headerDataset[headers[i].name] = headers[i].alias\n }\n exportable.unshift(headerDataset)\n }\n }\n\n // Convert Object to JSON\n const jsonObject = JSON.stringify(exportable)\n const csv = convert2csv(jsonObject, columnSeparator)\n const exportFileName = fileName + '.csv'\n const blob = new Blob([csv], {\n type: 'text/csv;charset=utf-8;'\n })\n if (navigator.msSaveBlob) { // IE 10+\n navigator.msSaveBlob(blob, exportFileName)\n } else {\n const link = document.createElement('a')\n if (link.download !== undefined) {\n // Browsers that support HTML5 download attribute\n const url = URL.createObjectURL(blob)\n link.setAttribute('href', url)\n link.setAttribute('download', exportFileName)\n link.style.visibility = 'hidden'\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n }\n }\n}\n\n/**\n * Function to create an object of arrays to csv.\n * @param {object} objArray the json data which needs to be converted to an array.\n * @param {char} columnSeparator the character that separates one column from another.\n */\nfunction convert2csv (objArray, columnSeparator) {\n const array = typeof objArray !== 'object' ? JSON.parse(objArray) : objArray\n let str = ''\n for (let i = 0; i < array.length; i++) {\n let line = ''\n for (const index in array[i]) {\n line += array[i][index] + columnSeparator\n }\n line = line.substring(0, line.length - 1)\n str += line + '\\r\\n'\n }\n return str\n}\n","import { saveAs } from 'file-saver'\nimport { htmlTblCreater } from './el'\n\nexport default {\n export: (params) => {\n exportObject2Doc(params.headers, params.exportable, params.fileName, params.headerStyle, params.cellStyle, params.repeatHeader)\n }\n}\n\n/**\n * Function to export the dataset as doc.\n * @param {array} headers the columns of the csv file.\n * @param {object} exportable the records of csv file.\n * @param {string} fileName the title of the file which needs to be exported.\n * @param {string} headerStyle the style which can be applied to the headers.\n * @param {string} cellStyle the style which can be applied to the cells.\n * @param {boolean} repeatHeader determines whether there should be a repeated header on each page.\n */\nfunction exportObject2Doc (headers, exportable, fileName, headerStyle, cellStyle, repeatHeader) {\n // Create the html structured dataset\n const dataset = htmlTblCreater('doc', headers, exportable, headerStyle, cellStyle, repeatHeader)\n const htmlString = '' + dataset + ''\n\n // Create the bytes\n const bytes = new Uint8Array(htmlString.length)\n for (let i = 0; i < htmlString.length; i++) {\n bytes[i] = htmlString.charCodeAt(i)\n }\n\n // Convert the contents to blob\n const blob = new Blob([bytes], { type: 'text/html' })\n\n // Save the file as doc\n saveAs(blob, fileName + '.doc')\n}\n","export function htmlTblCreater (type, headers, exportable, headerStyle, cellStyle, repeatHeader) {\n // Construct the html structure for the provided exportable\n let dataset = ''\n\n // Check if the headers should be repeated\n if (repeatHeader === true) {\n dataset += ''\n }\n\n // Check if the provided header is an arry (backward-compatibility for version below 3.3.0 - more info at: https://github.com/gharibi/JsObjExporter/issues/4)\n let columnFlex = 0\n if (typeof headers[0] !== 'object') {\n // Construct the table headers\n dataset += ''\n for (let j = 0; j < headers.length; j++) {\n dataset += ''\n }\n dataset += ''\n\n // Check if the headers should be repeated\n if (repeatHeader === true) {\n dataset += ''\n }\n\n // Construct the body elements\n for (let j = 0; j < exportable.length; j++) {\n dataset += ''\n for (let k = 0; k < Object.keys(exportable[j]).length - 1; k++) {\n // Check if the input string is HTML, if so, do not add the cell tags\n const cellContents = exportable[j][Object.keys(exportable[j])[k]]\n if (/<[a-z][\\s\\S]*>/i.test(cellContents) === true) {\n dataset += cellContents\n } else {\n dataset += ''\n }\n }\n dataset += ''\n }\n dataset += '
' + headers[j] + '
' + cellContents + '
'\n } else {\n for (let i = 0; i < headers.length; i++) {\n // Check if the header contains a flex, otherwise consider flex=1 to have equal sized columns\n columnFlex += (function () {\n return ('flex' in headers[i]) ? headers[i].flex : 1\n })()\n }\n\n // Construct the table headers\n dataset += ''\n for (let j = 0; j < headers.length; j++) {\n dataset += '' + headers[j].alias + ''\n }\n dataset += ''\n\n // Check if the headers should be repeated\n if (repeatHeader === true) {\n dataset += ''\n }\n\n // Construct the body elements\n for (let j = 0; j < exportable.length; j++) {\n dataset += ''\n // Loop through the header items to show only the items associated with a header\n for (let k = 0; k < headers.length; k++) {\n // Check if the input string is HTML, if so, do not add the cell tags\n const cellContents = exportable[j][headers[k].name]\n if (/<[a-z][\\s\\S]*>/i.test(cellContents) === true) {\n dataset += cellContents\n } else {\n dataset += '' + cellContents + ''\n }\n }\n dataset += ''\n }\n }\n\n // Return the dataset\n return dataset\n}\n","import placeholder from './placeholder'\nconst { detect } = require('detect-browser')\n\nexport default {\n export: (params) => {\n // Detect the browser information\n const browser = detect()\n\n // Retrieve the DOM for the requested exportable\n const elementDom = document.getElementById(params.exportable)\n\n // Check if the DOM is available\n if (typeof elementDom === 'undefined') {\n throw new Error('There is no DOM object available for the requested id.')\n }\n\n // Construct the exportable for the print\n const exportableFrame = placeholder.generateFrame(params, elementDom.innerHTML)\n\n // Cleanup the DOM from the exportable frame\n if (document.getElementById('jsObjExporterFrameId')) document.getElementById('jsObjExporterFrameId').remove()\n\n // Attach the exportable frame to the document body\n document.getElementsByTagName('body')[0].appendChild(exportableFrame)\n\n // Get the iframe element\n const iframeElement = document.getElementById('jsObjExporterFrameId')\n\n // Set the onload method\n exportableFrame.onload = () => {\n // Focus on the frame for priting\n iframeElement.focus()\n\n // Check the if the browser is Edge or Internet Explorer\n if (browser.name === 'edge' || browser.name === 'ie') {\n iframeElement.contentWindow.document.execCommand('print', false, null)\n } else {\n // All other browsers\n iframeElement.contentWindow.print()\n }\n }\n }\n}\n","'use strict'\n\nimport csv from './csv'\nimport xls from './xls'\nimport pdf from './pdf'\nimport doc from './doc'\nimport html from './html'\n\nexport default {\n init () {\n const params = {\n type: 'object',\n headers: null,\n exportable: null,\n fileName: 'export',\n headerStyle: 'font-size:16px; font-weight:bold;',\n cellStyle: 'font-size:14px;',\n sheetName: 'worksheet',\n documentTitle: 'test document title',\n documentTitleStyle: 'color:red;',\n repeatHeader: true,\n columnSeparator: ','\n }\n\n // Check if an exportable document or object was supplied\n const args = arguments[0]\n if (args === undefined) throw new Error('obj2csv expects at least 1 exportable!')\n\n // Process parameters\n switch (typeof args) {\n case 'object':\n params.exportable = args.exportable\n params.type = typeof args.type !== 'undefined' ? args.type : params.type\n params.headers = typeof args.headers !== 'undefined' ? args.headers : params.headers\n params.fileName = typeof args.fileName !== 'undefined' ? args.fileName : params.fileName\n params.headerStyle = typeof args.headerStyle !== 'undefined' ? args.headerStyle : params.headerStyle\n params.cellStyle = typeof args.cellStyle !== 'undefined' ? args.cellStyle : params.cellStyle\n params.sheetName = typeof args.sheetName !== 'undefined' ? args.sheetName : params.sheetName\n params.documentTitle = typeof args.documentTitle !== 'undefined' ? args.documentTitle : params.documentTitle\n params.documentTitleStyle = typeof args.documentTitleStyle !== 'undefined' ? args.documentTitleStyle : params.documentTitleStyle\n params.repeatHeader = typeof args.repeatHeader !== 'undefined' ? args.repeatHeader : params.repeatHeader\n params.columnSeparator = typeof args.columnSeparator !== 'undefined' ? args.columnSeparator : params.columnSeparator\n break\n default:\n throw new Error('Unexpected argument type! Expected \"object\", got ' + typeof args)\n }\n\n // Validate type\n if (!params.exportable) {\n throw new Error('Invalid exportable!')\n }\n if (!params.type || typeof params.type !== 'string') {\n throw new Error('Invalid exportable type! only string type is acceptable!')\n }\n if (['csv', 'xls', 'pdf', 'doc', 'html'].indexOf(params.type.toLowerCase()) === -1) {\n throw new Error('Invalid exportable type. Available types are \"CSV\", \"XLS\", \"pdf\" and \"DOC\".')\n }\n if (typeof params.repeatHeader !== 'boolean' && typeof params.repeatHeader !== 'undefined') {\n throw new Error('Invalid value for the repeat header parameter. Available types are \"true\" and \"false\".')\n }\n\n // Check exportable type\n switch (params.type) {\n case 'csv':\n csv.export(params)\n break\n case 'xls':\n xls.export(params)\n break\n case 'pdf':\n pdf.export(params)\n break\n case 'doc':\n doc.export(params)\n break\n case 'html':\n html.export(params)\n break\n }\n }\n}\n","import { htmlTblCreater } from './el'\nconst { detect } = require('detect-browser')\n\nexport default {\n export: (params) => {\n exportObject2PDF(params.documentTitle, params.documentTitleStyle, params.headers, params.exportable, params.headerStyle, params.cellStyle, params.repeatHeader)\n }\n}\n\nfunction exportObject2PDF (documentTitle, documentTitleStyle, headers, exportable, headerStyle, cellStyle, repeatHeader) {\n // Define a printable body element\n const printableBody = document.createElement('iframe')\n\n // Set the prontableBody to hidden\n printableBody.setAttribute('style', 'visibility: hidden; height: 0; width: 0; position: absolute;')\n printableBody.setAttribute('id', 'objectExporterPrintableBodyId')\n\n // Construct the document title\n printableBody.srcdoc = ''\n\n // Append the printableBody to the current document\n document.getElementsByTagName('body')[0].appendChild(printableBody)\n\n // Get the printable elements\n const printableElements = document.getElementById('objectExporterPrintableBodyId')\n\n // Check when the printableBody is loaded successfully\n printableBody.onload = () => {\n // Detect the browser information\n const browser = detect()\n\n // Define a printable document\n let printableDocument = (printableElements.contentWindow || printableElements.contentDocument)\n\n // Check if there is document element\n if (printableDocument.document) printableDocument = printableDocument.document\n let printableDocumentContents = '' + documentTitle + '
'\n printableDocumentContents += htmlTblCreater('pdf', headers, exportable, headerStyle, cellStyle, repeatHeader)\n printableDocument.body.innerHTML = printableDocumentContents\n\n // Assign style to the printable\n const style = document.createElement('style')\n style.innerHTML = ''\n printableDocument.head.appendChild(style)\n\n // Prepare the printable for the print\n printableElements.focus()\n\n // Check the if the browser is Edge or Internet Explorer\n if (browser.name === 'edge' || browser.name === 'ie') {\n printableElements.contentWindow.document.execCommand('print', false, null)\n } else {\n // All other browsers\n printableElements.contentWindow.print()\n }\n }\n}\n","const placeholder = {\n /**\n * Method to generate the frame for opening the print/export dialog.\n * @param {object} params parameters which will are provided at the API level.\n * @param {string} body the body of the element which needs to be exported.\n */\n generateFrame: (params, body) => {\n const printFrame = document.createElement('iframe')\n printFrame.setAttribute('style', 'visibility: hidden; height: 0; width: 0; position: absolute;')\n printFrame.setAttribute('id', 'jsObjExporterFrameId')\n printFrame.srcdoc = '' + body + ''\n return printFrame\n }\n}\n\n// Export the module\nexport default placeholder\n","import { htmlTblCreater } from './el'\nconst { detect } = require('detect-browser')\n\nexport default {\n export: (params) => {\n exportObject2XLS(params.headers, params.exportable, params.fileName, params.headerStyle, params.cellStyle, params.sheetName, params.documentTitle, params.documentTitleStyle)\n }\n}\n\n// Defining the required functions\nconst base64 = s => {\n return window.btoa(unescape(encodeURIComponent(s)))\n}\nconst format = (s, c) => {\n return s.replace(/{(\\w+)}/g, function (m, p) { return c[p] })\n}\nconst uri = 'data:application/vnd.ms-excel;base64,'\nconst template = '{table}
'\n\n/**\n * Function to export the dataset as xls.\n * @param {array} headers the columns of the csv file.\n * @param {object} exportable the records of csv file.\n * @param {string} fileName the title of the file which needs to be exported.\n * @param {string} headerStyle the style which can be applied to the headers.\n * @param {string} cellStyle the style which can be applied to the cells.\n * @param {string} sheetName the excel sheet name which needs to be applied to the exported xls file.\n * @param {string} documentTitle the document title which needs to be written as a header on the excel sheet.\n * @param {string} documentTitleStyle the style of the document title.\n */\nfunction exportObject2XLS (headers, exportable, fileName, headerStyle, cellStyle, sheetName, documentTitle, documentTitleStyle) {\n // Construct the html structure for the provided exportable\n let dataset = '' + documentTitle + '
'\n dataset += htmlTblCreater('xls', headers, exportable, headerStyle, cellStyle, false)\n\n // Push the file for being downloaded\n const ctx = { worksheet: sheetName, table: dataset }\n const link = document.createElement('a')\n const exportFileName = fileName + '.xls'\n link.setAttribute('href', uri + base64(format(template, ctx)))\n link.setAttribute('download', exportFileName)\n link.style.visibility = 'hidden'\n\n // Detect the browser information\n const browser = detect()\n\n // Check the if the browser is Edge or Internet Explorer\n if (browser.name === 'edge' || browser.name === 'ie') {\n if (window.navigator.msSaveBlob) {\n const blob = new Blob([dataset], {\n type: 'data:application/vnd.ms-excel;'\n })\n navigator.msSaveBlob(blob, exportFileName)\n }\n } else {\n // All other browsers\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n }\n}\n","var __spreadArrays = (this && this.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\nvar BrowserInfo = /** @class */ (function () {\n function BrowserInfo(name, version, os) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.type = 'browser';\n }\n return BrowserInfo;\n}());\nexport { BrowserInfo };\nvar NodeInfo = /** @class */ (function () {\n function NodeInfo(version) {\n this.version = version;\n this.type = 'node';\n this.name = 'node';\n this.os = process.platform;\n }\n return NodeInfo;\n}());\nexport { NodeInfo };\nvar SearchBotDeviceInfo = /** @class */ (function () {\n function SearchBotDeviceInfo(name, version, os, bot) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.bot = bot;\n this.type = 'bot-device';\n }\n return SearchBotDeviceInfo;\n}());\nexport { SearchBotDeviceInfo };\nvar BotInfo = /** @class */ (function () {\n function BotInfo() {\n this.type = 'bot';\n this.bot = true; // NOTE: deprecated test name instead\n this.name = 'bot';\n this.version = null;\n this.os = null;\n }\n return BotInfo;\n}());\nexport { BotInfo };\nvar ReactNativeInfo = /** @class */ (function () {\n function ReactNativeInfo() {\n this.type = 'react-native';\n this.name = 'react-native';\n this.version = null;\n this.os = null;\n }\n return ReactNativeInfo;\n}());\nexport { ReactNativeInfo };\n// tslint:disable-next-line:max-line-length\nvar SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;\nvar SEARCHBOT_OS_REGEX = /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\\ Jeeves\\/Teoma|ia_archiver)/;\nvar REQUIRED_VERSION_PARTS = 3;\nvar userAgentRules = [\n ['aol', /AOLShield\\/([0-9\\._]+)/],\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['edge-ios', /EdgiOS\\/([0-9\\._]+)/],\n ['yandexbrowser', /YaBrowser\\/([0-9\\._]+)/],\n ['kakaotalk', /KAKAOTALK\\s([0-9\\.]+)/],\n ['samsung', /SamsungBrowser\\/([0-9\\.]+)/],\n ['silk', /\\bSilk\\/([0-9._-]+)\\b/],\n ['miui', /MiuiBrowser\\/([0-9\\.]+)$/],\n ['beaker', /BeakerBrowser\\/([0-9\\.]+)/],\n ['edge-chromium', /EdgA?\\/([0-9\\.]+)/],\n [\n 'chromium-webview',\n /(?!Chrom.*OPR)wv\\).*Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/,\n ],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['phantomjs', /PhantomJS\\/([0-9\\.]+)(:?\\s|$)/],\n ['crios', /CriOS\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['fxios', /FxiOS\\/([0-9\\.]+)/],\n ['opera-mini', /Opera Mini.*Version\\/([0-9\\.]+)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['bb10', /BB10;\\sTouch.*Version\\/([0-9\\.]+)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['ios', /Version\\/([0-9\\._]+).*Mobile.*Safari.*/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n ['facebook', /FBAV\\/([0-9\\.]+)/],\n ['instagram', /Instagram\\s([0-9\\.]+)/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Mobile/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Gecko\\)$/],\n ['searchbot', SEARCHBOX_UA_REGEX],\n];\nvar operatingSystemRules = [\n ['iOS', /iP(hone|od|ad)/],\n ['Android OS', /Android/],\n ['BlackBerry OS', /BlackBerry|BB10/],\n ['Windows Mobile', /IEMobile/],\n ['Amazon OS', /Kindle/],\n ['Windows 3.11', /Win16/],\n ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/],\n ['Windows 98', /(Windows 98)|(Win98)/],\n ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/],\n ['Windows XP', /(Windows NT 5.1)|(Windows XP)/],\n ['Windows Server 2003', /(Windows NT 5.2)/],\n ['Windows Vista', /(Windows NT 6.0)/],\n ['Windows 7', /(Windows NT 6.1)/],\n ['Windows 8', /(Windows NT 6.2)/],\n ['Windows 8.1', /(Windows NT 6.3)/],\n ['Windows 10', /(Windows NT 10.0)/],\n ['Windows ME', /Windows ME/],\n ['Open BSD', /OpenBSD/],\n ['Sun OS', /SunOS/],\n ['Chrome OS', /CrOS/],\n ['Linux', /(Linux)|(X11)/],\n ['Mac OS', /(Mac_PowerPC)|(Macintosh)/],\n ['QNX', /QNX/],\n ['BeOS', /BeOS/],\n ['OS/2', /OS\\/2/],\n];\nexport function detect(userAgent) {\n if (!!userAgent) {\n return parseUserAgent(userAgent);\n }\n if (typeof document === 'undefined' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative') {\n return new ReactNativeInfo();\n }\n if (typeof navigator !== 'undefined') {\n return parseUserAgent(navigator.userAgent);\n }\n return getNodeVersion();\n}\nfunction matchUserAgent(ua) {\n // opted for using reduce here rather than Array#first with a regex.test call\n // this is primarily because using the reduce we only perform the regex\n // execution once rather than once for the test and for the exec again below\n // probably something that needs to be benchmarked though\n return (ua !== '' &&\n userAgentRules.reduce(function (matched, _a) {\n var browser = _a[0], regex = _a[1];\n if (matched) {\n return matched;\n }\n var uaMatch = regex.exec(ua);\n return !!uaMatch && [browser, uaMatch];\n }, false));\n}\nexport function browserName(ua) {\n var data = matchUserAgent(ua);\n return data ? data[0] : null;\n}\nexport function parseUserAgent(ua) {\n var matchedRule = matchUserAgent(ua);\n if (!matchedRule) {\n return null;\n }\n var name = matchedRule[0], match = matchedRule[1];\n if (name === 'searchbot') {\n return new BotInfo();\n }\n var versionParts = match[1] && match[1].split(/[._]/).slice(0, 3);\n if (versionParts) {\n if (versionParts.length < REQUIRED_VERSION_PARTS) {\n versionParts = __spreadArrays(versionParts, createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length));\n }\n }\n else {\n versionParts = [];\n }\n var version = versionParts.join('.');\n var os = detectOS(ua);\n var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);\n if (searchBotMatch && searchBotMatch[1]) {\n return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);\n }\n return new BrowserInfo(name, version, os);\n}\nexport function detectOS(ua) {\n for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {\n var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1];\n var match = regex.exec(ua);\n if (match) {\n return os;\n }\n }\n return null;\n}\nexport function getNodeVersion() {\n var isNode = typeof process !== 'undefined' && process.version;\n return isNode ? new NodeInfo(process.version.slice(1)) : null;\n}\nfunction createVersionParts(count) {\n var output = [];\n for (var ii = 0; ii < count; ii++) {\n output.push('0');\n }\n return output;\n}\n","(function(a,b){if(\"function\"==typeof define&&define.amd)define([],b);else if(\"undefined\"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){\"use strict\";function b(a,b){return\"undefined\"==typeof b?b={autoBom:!1}:\"object\"!=typeof b&&(console.warn(\"Deprecated: Expected third argument to be a object\"),b={autoBom:!b}),b.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(a.type)?new Blob([\"\\uFEFF\",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open(\"GET\",b),e.responseType=\"blob\",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error(\"could not download file\")},e.send()}function d(a){var b=new XMLHttpRequest;b.open(\"HEAD\",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent(\"click\"))}catch(c){var b=document.createEvent(\"MouseEvents\");b.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f=\"object\"==typeof window&&window.window===window?window:\"object\"==typeof self&&self.self===self?self:\"object\"==typeof global&&global.global===global?global:void 0,a=f.saveAs||(\"object\"!=typeof window||window!==f?function(){}:\"download\"in HTMLAnchorElement.prototype?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement(\"a\");g=g||b.name||\"download\",j.download=g,j.rel=\"noopener\",\"string\"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target=\"_blank\")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:\"msSaveOrOpenBlob\"in navigator?function(f,g,h){if(g=g||f.name||\"download\",\"string\"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement(\"a\");i.href=f,i.target=\"_blank\",setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open(\"\",\"_blank\"),e&&(e.document.title=e.document.body.innerText=\"downloading...\"),\"string\"==typeof a)return c(a,b,d);var g=\"application/octet-stream\"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((i||g&&h)&&\"object\"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,\"data:attachment/file;\"),e?e.location.href=a:location=a,e=null},j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l,e=null,setTimeout(function(){k.revokeObjectURL(l)},4E4)}});f.saveAs=a.saveAs=a,\"undefined\"!=typeof module&&(module.exports=a)});\n\n//# sourceMappingURL=FileSaver.min.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => module['default'] :\n\t\t() => module;\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// startup\n// Load entry module\n__webpack_require__(\"./src/index.js\");\n// This entry module used 'exports' so it can't be inlined\n"],"sourceRoot":""} \ No newline at end of file diff --git a/examples/example.html b/examples/example.html index 8f9fa2f..4853521 100644 --- a/examples/example.html +++ b/examples/example.html @@ -227,7 +227,7 @@

JsObj to XLS

- +
diff --git a/package.json b/package.json index 72fe352..f6ab22f 100644 --- a/package.json +++ b/package.json @@ -2,24 +2,24 @@ "name": "object-exporter", "homepage": "https://github.com/gharibi", "description": "A little JavaScript plugin to generate PDF, XLS, CSV and DOC from JavaScript Object or DOM element only from the frontend!", - "version": "3.6.0", + "version": "3.6.1", "main": "dist/objectexporter.min.js", "repository": "https://github.com/gharibi/JsObjExporter", "license": "MIT", "dependences": {}, "devDependencies": { - "@babel/core": "^7.11.6", - "@babel/preset-env": "^7.11.5", + "@babel/core": "^7.12.3", + "@babel/preset-env": "^7.12.1", "babel-loader": "^8.1.0", "babel-preset-es2015": "^6.24.1", - "detect-browser": "^5.1.1", + "detect-browser": "^5.2.0", "file-saver": "^2.0.2", "install": "^0.13.0", "npm": "^6.14.8", - "standard": "^14.3.4", + "standard": "^16.0.1", "uglifyjs-webpack-plugin": "^2.2.0", - "webpack": "^4.44.2", - "webpack-cli": "^3.3.12" + "webpack": "^5.3.2", + "webpack-cli": "^4.1.0" }, "scripts": { "test": "standard", @@ -52,4 +52,4 @@ "javascript-doc", "javascript-html" ] -} +} \ No newline at end of file diff --git a/src/js/xls.js b/src/js/xls.js index dca8172..2d318c5 100644 --- a/src/js/xls.js +++ b/src/js/xls.js @@ -48,9 +48,9 @@ function exportObject2XLS (headers, exportable, fileName, headerStyle, cellStyle if (browser.name === 'edge' || browser.name === 'ie') { if (window.navigator.msSaveBlob) { const blob = new Blob([dataset], { - type: "data:application/vnd.ms-excel;" - }); - navigator.msSaveBlob(blob, exportFileName); + type: 'data:application/vnd.ms-excel;' + }) + navigator.msSaveBlob(blob, exportFileName) } } else { // All other browsers