UNPKG

@progress/kendo-react-excel-export

Version:
1 lines • 9.07 kB
System.register("@progress/kendo-react-excel-export",["@progress/kendo-ooxml","prop-types","react","@progress/kendo-file-saver","react-dom/server"],function(s){var i,l,a,p,u;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){i=e(t)},function(t){l=e(t)},function(t){a=e(t)},function(t){p=e(t)},function(t){u=e(t)}],execute:function(){function n(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}var r,o;o={},n.m=r=[function(t,e){t.exports=a},function(t,e){t.exports=l},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),i=r(7);e.workbookOptions=function(t){var e,r=i.toExporterColumns(t.columns),o=new n.ExcelExporter({columns:r,data:t.data,filterable:t.filterable,groups:t.group,paddingCellOptions:t.paddingCellOptions,headerPaddingCellOptions:t.headerPaddingCellOptions,hierarchy:t.hierarchy?{depth:(e=t.data,Math.max.apply(Math,e.map(function(t){return t.level}))+1),itemLevel:function(t){return t.level}}:null,collapsible:t.collapsible}).workbook();return o.creator=t.creator,o.date=t.date,o.rtl="rtl"===t.dir,o},e.toDataURL=function(t){return new n.Workbook(t).toDataURL()},e.isWorkbookOptions=function(t){return t&&t.sheets}},function(t,e){t.exports=i},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=e(5);r.ExcelExport=o.default;var n=e(9);r.ExcelExportColumn=n.default;var i=e(10);r.ExcelExportColumnGroup=i.default;var l=e(11);r.ExcelExportFooter=l.default;var a=e(12);r.ExcelExportGroupFooter=a.default;var p=e(13);r.ExcelExportGroupHeader=p.default;var u=e(3);r.KendoOoxml=u,function(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}(e(2)),function(t){for(var e in t)s(e,t[e])}(r)},function(t,e,r){"use strict";var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var l,a=r(0),p=r(1),u=r(6),s=r(2),c=(l=a.Component,n(f,l),f.prototype.save=function(t,e){this.toDataURL(t,e).then(this.saveFile)},f.prototype.toDataURL=function(t,e){var r=s.isWorkbookOptions(t)?t:this.workbookOptions(t,e);return s.toDataURL(r)},f.prototype.workbookOptions=function(t,e){var r=this.getExportData(t),o=this.props.children,n=o&&o.type&&"KendoReactGrid"===o.type.displayName&&o.props&&a.Children.toArray(o.props.children),i=this.extractColumns(n||e||this.props.columns||a.Children.toArray(o));return s.workbookOptions({columns:i,data:r.data,group:r.group,filterable:this.props.filterable,creator:this.props.creator,date:this.props.date,dir:this.props.dir,hierarchy:this.props.hierarchy,paddingCellOptions:this.props.paddingCellOptions,headerPaddingCellOptions:this.props.headerPaddingCellOptions})},f.prototype.render=function(){return this.props.children||null},f.propTypes={children:p.any,columns:p.arrayOf(p.any),creator:p.string,data:p.any,date:p.any,filterable:p.bool,fileName:p.string,forceProxy:p.bool,group:p.any,headerPaddingCellOptions:p.any,paddingCellOptions:p.any,proxyURL:p.string,dir:p.string,hierarchy:p.bool,collapsible:p.bool},f.defaultProps={fileName:"Export.xlsx",forceProxy:!1,collapsible:!1},f);function f(t){var r=l.call(this,t)||this;return r.saveFile=function(t){u.saveAs(t,r.props.fileName,{forceProxy:r.props.forceProxy,proxyURL:r.props.proxyURL})},r.extractColumns=function(t,e){return void 0===e&&(e=0),Array.isArray(t)?t.map(function(t){return r.extractChild(t,e)}):[t,r.extractChild(t,e)]},r.extractChild=function(t,e){return void 0===e&&(e=0),a.isValidElement(t)?i({},t.props,{width:t.props.width&&parseInt(""+t.props.width,10),level:e,children:t.props.children&&r.extractColumns(t.props.children,e+1)}):i({},t,{level:e,children:t.children&&r.extractColumns(t.children,e+1)})},r.getExportData=function(t){return t?Array.isArray(t)?{data:t}:t:{data:r.props.data,group:r.props.group}},r.save=r.save.bind(r),r.toDataURL=r.toDataURL.bind(r),r.workbookOptions=r.workbookOptions.bind(r),r}e.default=c},function(t,e){t.exports=p},function(t,e,r){"use strict";var l=this&&this.__assign||function(){return(l=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});function o(o,n,i){return function(t){i(n,t);var e=u.renderToStaticMarkup(p.createElement(o,l({},n))),r=Number(e);return isNaN(r)?e:r}}function n(t,e){t.$implicit=t.group=e,t.field=e.field,t.value=e.value,t.aggregates=e.aggregates}function i(t,e){t.group=e.group,t.$implicit=t.aggregates=e}function a(t,e){}var p=r(0),u=r(8);e.toExporterColumns=function(t){var e=[],i=0,l=function(t,o,n){t.forEach(function(t){var e,r;t.level===n&&(e=new s(t,i),o.push(e),t.children&&1<t.children.length?(r=e.columns=[],l(t.children,r,n+1)):i++)})};return l(t,e,0),e};var s=function(t,e){this.title=t.title,this.field=t.field,this.hidden=t.hidden,this.locked=t.locked,this.width=t.width,this.headerCellOptions=t.headerCellOptions,this.cellOptions=t.cellOptions,this.groupHeaderCellOptions=t.groupHeaderCellOptions,this.groupFooterCellOptions=t.groupFooterCellOptions,this.footerCellOptions=t.footerCellOptions,t.footer&&(this.footerTemplate=o(t.footer,{$implicit:t,column:t,columnIndex:e},a)),t.groupFooter&&(this.groupFooterTemplate=o(t.groupFooter,{column:t,field:t.field},i)),t.groupHeader&&(this.groupHeaderTemplate=o(t.groupHeader,{},n))};e.ExporterColumn=s},function(t,e){t.exports=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function o(t){return null}var n=r(1);o.propTypes={cellOptions:n.any,field:n.string,footerCellOptions:n.any,footer:n.oneOfType([n.func,n.element]),groupFooterCellOptions:n.any,groupFooter:n.oneOfType([n.func,n.element]),groupHeaderCellOptions:n.any,groupHeader:n.oneOfType([n.func,n.element]),headerCellOptions:n.any,hidden:n.bool,level:n.number,locked:n.bool,title:n.string,width:n.number},e.default=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function o(t){return null}var n=r(1);o.propTypes={children:n.oneOfType([n.arrayOf(n.element),n.element]),headerCellOptions:n.any,hidden:n.bool,level:n.number,locked:n.bool,title:n.string,width:n.number},e.default=o},function(t,e,r){"use strict";var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i,l=(i=r(0).PureComponent,n(a,i),a);function a(){return null!==i&&i.apply(this,arguments)||this}e.default=l},function(t,e,r){"use strict";var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i,l=(i=r(0).PureComponent,n(a,i),a);function a(){return null!==i&&i.apply(this,arguments)||this}e.default=l},function(t,e,r){"use strict";var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i,l=(i=r(0).PureComponent,n(a,i),a);function a(){return null!==i&&i.apply(this,arguments)||this}e.default=l}],n.c=o,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}}});