UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

1 lines 2.06 kB
module.exports=function(e){function t(o){if(r[o])return r[o].exports;var a=r[o]={exports:{},id:o,loaded:!1};return e[o].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}({0:function(e,t,r){r(994),e.exports=r(994)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},5:function(e,t){e.exports=require("../kendo.data")},19:function(e,t){e.exports=require("../kendo.core")},994:function(e,t,r){var o,a,i;!function(n,define){a=[r(19),r(5),r(995)],o=n,i="function"==typeof o?o.apply(t,a):o,!(void 0!==i&&(e.exports=i))}(function(){return function(e,t){var r=t.excel.ExcelExporter,o=e.extend;t.excel.TemplateService.register({compile:t.template}),t.ExcelExporter=t.Class.extend({init:function(e){var r,a,i,n;if(this.options=e,r=e.dataSource,r instanceof t.data.DataSource){if(r.filter()||(r.options.filter=void 0),this.dataSource=new r.constructor(o({},r.options,{page:e.allPages?0:r.page(),filter:r.filter(),pageSize:e.allPages?r.total():r.pageSize()||r.total(),sort:r.sort(),group:r.group(),aggregate:r.aggregate()})),a=r.data(),a.length>0){if(e.hierarchy)for(i=0;i<a.length;i++)a[i].expanded!==!1&&void 0!==a[i].expanded||(a[i].expanded=!0);this.dataSource._data=a,n=this.dataSource.transport,r._isServerGrouped()&&n.options&&n.options.data&&(n.options.data=null)}}else this.dataSource=t.data.DataSource.create(r)},_hierarchy:function(){var e,t,r,o,a=this.options.hierarchy,i=this.dataSource;if(a&&i.level){for(a={itemLevel:function(e){return i.level(e)}},e=i.view(),t=0,o=0;o<e.length;o++)r=i.level(e[o]),r>t&&(t=r);a.depth=t+1}else a=!1;return{hierarchy:a}},workbook:function(){return e.Deferred(e.proxy(function(t){this.dataSource.fetch().then(e.proxy(function(){var e=new r(o({},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},r(3))},995:function(e,t){e.exports=require("./kendo-excel")}});