Files
2022-11-04 13:24:24 +02:00

27 lines
15 KiB
JavaScript
Executable File

/**
* Kendo UI v2021.1.224 (http://www.telerik.com/kendo-ui)
* Copyright 2021 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
!function(e,define){define("excel/kendo-excel.min",["kendo.core.min"],e)}(function(){!function(e){function t(e){return e.title+": "+e.value}function o(e,t){var o,n=[];for(o=0;o<e;o++)n.push(t(o));return n}function n(e){return e.id}var r,l,i,a,s;window.kendo.excel=window.kendo.excel||{},r=kendo.getter,l=e.map,i={compile:function(e){return e}},a=kendo.Class.extend({}),a.register=function(e){i=e},a.compile=function(e){return i.compile(e)},s=kendo.Class.extend({init:function(e){e.columns=this._trimColumns(e.columns||[]),this.allColumns=l(this._leafColumns(e.columns||[]),this._prepareColumn),this.columns=this._visibleColumns(this.allColumns),this.options=e,this.data=e.data||[],this.aggregates=e.aggregates||{},this.groups=[].concat(e.groups||[]),this.hasGroups=this.groups.length>0,this.hierarchy=e.hierarchy,this.hasGroupHeaderColumn=this.columns.some(function(e){return e.groupHeaderColumnTemplate}),this.collapsible=this.options.collapsible},workbook:function(){var e={sheets:[{columns:this._columns(),rows:this.hierarchy?this._hierarchyRows():this._rows(),freezePane:this._freezePane(),filter:this._filter()}]};return e},_trimColumns:function(e){var t=this;return e.filter(function(e){var o=!!e.field;return!o&&e.columns&&(o=t._trimColumns(e.columns).length>0),o})},_leafColumns:function(e){var t,o=this,n=[];for(t=0;t<e.length;t++)e[t].columns?n=n.concat(o._leafColumns(e[t].columns)):n.push(e[t]);return n},_prepareColumn:function(o){var n,l;return o.field?(n=function(e){return r(o.field,!0)(e)},l=null,o.values&&(l={},o.values.forEach(function(e){l[e.value]=e.text}),n=function(e){return l[r(o.field,!0)(e)]}),e.extend({},o,{value:n,values:l,groupHeaderTemplate:o.groupHeaderTemplate?a.compile(o.groupHeaderTemplate):t,groupHeaderColumnTemplate:o.groupHeaderColumnTemplate?a.compile(o.groupHeaderColumnTemplate):null,groupFooterTemplate:o.groupFooterTemplate?a.compile(o.groupFooterTemplate):null,footerTemplate:o.footerTemplate?a.compile(o.footerTemplate):null})):null},_filter:function(){if(!this.options.filterable)return null;var e=this._depth();return{from:e,to:e+this.columns.length-1}},_createPaddingCells:function(t){var n=this;return o(t,function(){return e.extend({background:"#dfdfdf",color:"#333"},n.options.paddingCellOptions)})},_dataRow:function(e,t,o){var n,r,l,i=this,a=this._createPaddingCells(t);if(this.hasGroups&&o&&e.items)return a=a.concat(this._groupHeaderCells(e,t,o)),n=this._dataRows(e.items,t+1),n.unshift({type:"group-header",cells:a,level:this.collapsible?t:null}),n.concat(this._footer(e,t));for(r=[],l=0;l<this.columns.length;l++)r[l]=i._cell(e,i.columns[l]);return this.hierarchy&&(r[0].colSpan=o-t+1),[{type:"data",cells:a.concat(r),level:this.collapsible?t:null}]},_groupHeaderCells:function(t,o,n){var r=[],l=this.allColumns.filter(function(e){return e.field===t.field})[0]||{},i=l&&l.title?l.title:t.field,a=l?l.groupHeaderTemplate||l.groupHeaderColumnTemplate:null,s=e.extend({title:i,field:t.field,value:l&&l.values?l.values[t.value]:t.value,aggregates:t.aggregates,items:t.items},t.aggregates[t.field]),u=a?a(s):i+": "+t.value;return r.push(e.extend({value:u,background:"#dfdfdf",color:"#333",colSpan:(this.hasGroupHeaderColumn?1:this.columns.length)+n-o},l.groupHeaderCellOptions)),this.hasGroupHeaderColumn&&this.columns.forEach(function(o,n){n>0&&r.push(e.extend({background:"#dfdfdf",color:"#333",value:o.groupHeaderColumnTemplate?o.groupHeaderColumnTemplate(e.extend({group:s},s,t.aggregates[o.field])):void 0},o.groupHeaderCellOptions))}),r},_dataRows:function(e,t){var o,n=this,r=this._depth(),l=[];for(o=0;o<e.length;o++)l.push.apply(l,n._dataRow(e[o],t,r));return l},_hierarchyRows:function(){var e,t,o,r,l,i=this,a=this._depth(),s=this.data,u=this.hierarchy.itemLevel,c=this.hierarchy.itemId||n,h=this._hasFooterTemplate(),p=[],d=[],f=0;for(h||(this.collapsible=!1),t=0;t<s.length;t++)o=s[t],r=u(o,t),h&&(r>f?d.push({id:e,level:f}):r<f&&p.push.apply(p,i._hierarchyFooterRows(d,r,a)),f=r,e=c(o,t)),p.push.apply(p,i._dataRow(o,r+1,a));return h&&(p.push.apply(p,this._hierarchyFooterRows(d,0,a)),l=s.length?this.aggregates[s[0].parentId]:{},p.push(this._hierarchyFooter(l,0,a))),this._prependHeaderRows(p),p},_hierarchyFooterRows:function(e,t,o){for(var n,r=this,l=[];e.length&&e[e.length-1].level>=t;)n=e.pop(),l.push(r._hierarchyFooter(r.aggregates[n.id],n.level+1,o));return l},_hasFooterTemplate:function(){var e,t=this.columns;for(e=0;e<t.length;e++)if(t[e].footerTemplate)return!0},_hierarchyFooter:function(t,o,n){var r=this.columns.map(function(r,l){var i,a=l?1:n-o+1;return r.footerTemplate?(i=(t||{})[r.field],e.extend({background:"#dfdfdf",color:"#333",colSpan:a,value:r.footerTemplate(e.extend({aggregates:t},i))},r.footerCellOptions)):e.extend({background:"#dfdfdf",color:"#333",colSpan:a},r.footerCellOptions)});return{type:"footer",cells:this._createPaddingCells(o).concat(r),level:this.collapsible?o:null}},_footer:function(t,o){var n,r,l,i=[],a=this.columns.some(function(e){return e.groupFooterTemplate});return a&&(r={group:{items:t.items,field:t.field,value:t.value}},n={},Object.keys(t.aggregates).forEach(function(o){n[o]=e.extend({},t.aggregates[o],r)})),l=this.columns.map(function(o){if(o.groupFooterTemplate){var l=e.extend({},n,t.aggregates[o.field],r);return e.extend({background:"#dfdfdf",color:"#333",value:o.groupFooterTemplate(l)},o.groupFooterCellOptions)}return e.extend({background:"#dfdfdf",color:"#333"},o.groupFooterCellOptions)}),a&&i.push({type:"group-footer",cells:this._createPaddingCells(this.groups.length).concat(l),level:this.collapsible?o:null}),i},_isColumnVisible:function(e){return this._visibleColumns([e]).length>0&&(e.field||e.columns)},_visibleColumns:function(e){var t=this;return e.filter(function(e){var o,n,r,l=e.exportable;return"object"==typeof l&&(l=e.exportable.excel),o=!e.hidden&&l!==!1,n=e.hidden&&l===!0,r=o||n,r&&e.columns&&(r=t._visibleColumns(e.columns).length>0),r})},_headerRow:function(t,n){var r=this,l=t.cells.map(function(o){return e.extend(o,{colSpan:o.colSpan>1?o.colSpan:1,rowSpan:t.rowSpan>1&&!o.colSpan?t.rowSpan:1})});return this.hierarchy&&l[0].firstCell&&(l[0].colSpan+=this._depth()),{type:"header",cells:o(n.length,function(){return e.extend({background:"#7a7a7a",color:"#fff"},r.options.headerPaddingCellOptions)}).concat(l)}},_prependHeaderRows:function(e){var t,o=this,n=this.groups,r=[{rowSpan:1,cells:[],index:0}];for(this._prepareHeaderRows(r,this.options.columns),t=r.length-1;t>=0;t--)e.unshift(o._headerRow(r[t],n))},_prepareHeaderRows:function(t,o,n,r){var l,i,a,s=this,u=r||t[t.length-1],c=t[u.index+1],h=0;for(l=0;l<o.length;l++)i=o[l],s._isColumnVisible(i)&&(a=e.extend({background:"#7a7a7a",color:"#fff",value:i.title||i.field,colSpan:0,firstCell:0===l&&(!n||n.firstCell)},i.headerCellOptions),u.cells.push(a),i.columns&&i.columns.length&&(c||(c={rowSpan:0,cells:[],index:t.length},t.push(c)),a.colSpan=s._trimColumns(s._visibleColumns(i.columns)).length,s._prepareHeaderRows(t,i.columns,a,c),h+=a.colSpan-1,u.rowSpan=t.length-u.index));n&&(n.colSpan+=h)},_rows:function(){var t,o,n=this,r=this._dataRows(this.data,0);return this.columns.length&&(this._prependHeaderRows(r),t=!1,o=this.columns.map(function(o){return o.footerTemplate?(t=!0,e.extend({background:"#dfdfdf",color:"#333",value:o.footerTemplate(e.extend({},n.aggregates,n.aggregates[o.field]))},o.footerCellOptions)):e.extend({background:"#dfdfdf",color:"#333"},o.footerCellOptions)}),t&&r.push({type:"footer",cells:this._createPaddingCells(this.groups.length).concat(o)})),r},_headerDepth:function(e){var t,o,n=this,r=1,l=0;for(t=0;t<e.length;t++)e[t].columns&&(o=n._headerDepth(e[t].columns),o>l&&(l=o));return r+l},_freezePane:function(){var e=this._visibleColumns(this.options.columns||[]),t=this._visibleColumns(this._trimColumns(this._leafColumns(e.filter(function(e){return e.locked})))).length;return{rowSplit:this._headerDepth(e),colSplit:t?t+this.groups.length:0}},_cell:function(t,o){return e.extend({value:o.value(t)},o.cellOptions)},_depth:function(){var e=0;return e=this.hierarchy?this.hierarchy.depth:this.groups.length},_columns:function(){var e=this._depth(),t=o(e,function(){return{width:20}});return t.concat(this.columns.map(function(e){return{width:parseInt(e.width,10),autoWidth:!e.width}}))}}),kendo.deepExtend(kendo.excel,{ExcelExporter:s,TemplateService:a})}(window.kendo.jQuery)},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()}),function(e,define){define("excel/main.min",["kendo.core.min","kendo.data.min","excel/kendo-excel.min"],e)}(function(){return function(e,t){var o=t.excel.ExcelExporter,n=e.extend;t.excel.TemplateService.register({compile:t.template}),t.ExcelExporter=t.Class.extend({init:function(e){var o,r,l,i;if(this.options=e,o=e.dataSource,o instanceof t.data.DataSource){if(o.filter()||(o.options.filter=void 0),this.dataSource=new o.constructor(n({},o.options,{page:e.allPages?0:o.page(),filter:o.filter(),pageSize:e.allPages?o.total():o.pageSize()||o.total(),sort:o.sort(),group:o.group(),aggregate:o.aggregate()})),r=o.data(),r.length>0){if(e.hierarchy)for(l=0;l<r.length;l++)r[l].expanded!==!1&&void 0!==r[l].expanded||(r[l].expanded=!0);this.dataSource._data=r,i=this.dataSource.transport,o._isServerGrouped()&&i.options&&i.options.data&&(i.options.data=null)}}else this.dataSource=t.data.DataSource.create(o)},_hierarchy:function(){var e,t,o,n,r=this.options.hierarchy,l=this.dataSource;if(r&&l.level){for(r={itemLevel:function(e){return l.level(e)}},e=l.view(),t=0,n=0;n<e.length;n++)o=l.level(e[n]),o>t&&(t=o);r.depth=t+1}else r=!1;return{hierarchy:r}},workbook:function(){return e.Deferred(e.proxy(function(t){this.dataSource.fetch().then(e.proxy(function(){var e=new o(n({},this.options,this._hierarchy(),{data:this.dataSource.view(),groups:this.dataSource.group(),aggregates:this.dataSource.aggregates()})).workbook();t.resolve(e,this.dataSource.view())},this))},this)).promise()}})}(kendo.jQuery,kendo),kendo},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()}),function(e,define){define("excel/mixins.min",["excel/main.min","kendo.ooxml.min"],e)}(function(){return function(e,t){t.ExcelMixin={extend:function(t){t.events.push("excelExport"),t.options.excel=e.extend(t.options.excel,this.options),t.saveAsExcel=this.saveAsExcel},options:{proxyURL:"",allPages:!1,filterable:!1,fileName:"Export.xlsx",collapsible:!1},saveAsExcel:function(){var o=this.options.excel||{},n=new t.ExcelExporter({columns:this.columns,dataSource:this.dataSource,allPages:o.allPages,filterable:o.filterable,hierarchy:o.hierarchy,collapsible:o.collapsible});n.workbook().then(e.proxy(function(e,n){if(!this.trigger("excelExport",{workbook:e,data:n})){var r=new t.ooxml.Workbook(e);r.options||(r.options={}),r.options.skipCustomHeight=!0,r.toDataURLAsync().then(function(n){t.saveAs({dataURI:n,fileName:e.fileName||o.fileName,proxyURL:o.proxyURL,forceProxy:o.forceProxy})})}},this))}}}(kendo.jQuery,kendo),kendo},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()}),function(e,define){define("kendo.excel.min",["excel/main.min","excel/mixins.min"],e)}(function(){},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()});
//# sourceMappingURL=kendo.excel.min.js.map