@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 2.04 kB
JavaScript
module.exports=function(r){var o={};function a(e){if(o[e])return o[e].exports;var t=o[e]={exports:{},id:e,loaded:!1};return r[e].call(t.exports,t,t.exports,a),t.loaded=!0,t.exports}return a.m=r,a.c=o,a.p="",a(0)}({0:function(e,t,r){e.exports=r(1030)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},5:function(e,t){e.exports=require("../kendo.data")},20:function(e,t){e.exports=require("../kendo.core")},1030:function(e,t,r){var o;r(3),r=[r(20),r(5),r(1031)],void 0===(t="function"==typeof(o=function(){var e=kendo.jQuery,i=kendo,r=i.excel.ExcelExporter,n=e.extend;return i.excel.TemplateService.register({compile:i.template}),i.ExcelExporter=i.Class.extend({init:function(e){this.options=e;var t=e.dataSource;if(t instanceof i.data.DataSource){if(!t.filter())t.options.filter=undefined;this.dataSource=new t.constructor(n({},t.options,{page:e.allPages?0:t.page(),filter:t.filter(),pageSize:e.allPages?t.total():t.pageSize()||t.total(),sort:t.sort(),group:t.group(),aggregate:t.aggregate()}));var r=t.data();if(r.length>0){if(e.hierarchy)for(var o=0;o<r.length;o++)if(r[o].expanded===false||r[o].expanded===undefined)r[o].expanded=true;this.dataSource._data=r;var a=this.dataSource.transport;if(t._isServerGrouped()&&a.options&&a.options.data)a.options.data=null}}else this.dataSource=i.data.DataSource.create(t)},_hierarchy:function(){var e=this.options.hierarchy;var t=this.dataSource;if(e&&t.level){e={itemLevel:function(e){return t.level(e)}};var r=t.view();var o=0;var a;for(var i=0;i<r.length;i++){a=t.level(r[i]);if(a>o)o=a}e.depth=o+1}else e=false;return{hierarchy:e}},workbook:function(){return e.Deferred(function(t){this.dataSource.fetch().then(function(){var e=new r(n({},this.options,this._hierarchy(),{data:this.dataSource.view(),groups:this.dataSource.group(),aggregates:this.dataSource.aggregates()})).workbook();t.resolve(e,this.dataSource.view())}.bind(this))}.bind(this)).promise()}}),kendo})?o.apply(t,r):o)||(e.exports=t)},1031:function(e,t){e.exports=require("./kendo-excel")}});