UNPKG

@progress/kendo-ui

Version:

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

1 lines 4.47 kB
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:function(e,t,n){n(1484),e.exports=n(1484)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},939:function(e,t){e.exports=require("./range")},1484:function(e,t,n){var r,o,i;!function(u,define){o=[n(1485),n(939)],r=u,i="function"==typeof r?r.apply(t,o):r,!(void 0!==i&&(e.exports=i))}(function(){"use strict";function e(e){var t,n,r,o,i,u=e.length,l=(u+1)/2,f=e.reduce(function(e,t){return e+t},0)/u,a=0,c=0;for(t=0;t<u;t++)n=t+1-l,r=e[t]-f,a+=n*r,c+=n*n;return c?(o=a/c,i=f-o*l,function(e){return i+o*(e+1)}):function(t){return e[t%e.length]}}function t(t){function o(e){var t,n=e[1]-e[0];for(t=2;t<e.length;++t)if(e[t]-e[t-1]!=n)return null;return n}function i(e){return e.map(function(e){return e.number})}var u=[],l=t.map(function(e){return e.formula||e.value});return r(l,function(t,n,r,f){var a,c,s,h,p;for("number"==r?(c=i(f),a=e(c)):"string"==r||"formula"==r||"boolean"==r?a=function(e,t){return l[t]}:Array.isArray(r)?1==f.length?a=function(e){return r[(f[0].number+e)%r.length]}:(s=o(i(f)),a=null==s?function(e){return f[e%f.length].value}:function(e){var t=f[0].number+s*e;return r[t%r.length]}):"null"!=r?(c=i(f),1==c.length&&c.push(c[0]+1),c=e(c),a=function(e,t){return l[t].replace(/^(.*\D)\d+/,"$1"+c(e,t))}):a=function(){return null},h={f:a,begin:t,end:n,len:n-t},p=t;p<n;++p)u[p]=h}),function(e,r){var o=u[r],i=e/l.length|0,f=e%l.length,a=i*o.len+f-o.begin,c=o.f(a,r),h=n(t[r]);return delete h.enable,c instanceof s?h.formula=c:h.value=c,h}}function n(e){var t={};return Object.keys(e||{}).forEach(function(n){t[n]=e[n]}),t}function r(e,t){var n,r,i=null,u=0,l=[];for(r=0;r<e.length;++r)n=o(e[r]),l.push(n),null!=i&&n.type!==i.type&&(t(u,r,i.type,l.slice(u,r)),u=r),i=n;t(u,r,i.type,l.slice(u,r))}function o(e){var t,n;if("number"==typeof e)return{type:"number",number:e};if("string"==typeof e)return(t=u(e))?t:(n=/^(.*\D)(\d+)/.exec(e),n?(e=e.replace(/^(.*\D)\d+/,"$1-######"),{type:e,match:n,number:parseFloat(n[2])}):{type:"string"});if("boolean"==typeof e)return{type:"boolean"};if(null==e)return{type:"null"};if(e instanceof s)return{type:"formula"};throw window.console.error(e),Error("Cannot fill data")}function i(){var e=kendo.culture();return[e.calendars.standard.days.namesAbbr,e.calendars.standard.days.names,e.calendars.standard.months.namesAbbr,e.calendars.standard.months.names]}function u(e){var t,n,r,o,u=e.toLowerCase(),l=i();for(t=0;t<l.length;++t)for(n=l[t],r=n.length;--r>=0;)if(o=n[r].toLowerCase(),o==u)return{type:n,number:r,value:e}}function l(e){var t,n,r=e.length,o=e[0].length,i=[];for(t=0;t<o;++t)for(i[t]=[],n=0;n<r;++n)i[t][n]=e[n][t];return i}var f,a,c,s,h,p,d;kendo.support.browser.msie&&kendo.support.browser.version<9||(f=kendo.spreadsheet,a=f.Range,c=f.calc.runtime,s=c.Formula,h="incompatibleRanges",p="noFillDirection",d=a.FillError=function(e){this.code=e},a.prototype._previewFillFrom=function(e,n){var r,o,i,u,f,a,c,s,g,m,w,v,b,y,L,x,F=this,R=F._sheet;if("string"==typeof e&&(e=R.range(e)),r=e._ref.toRangeRef().clone().setSheet(R.name()),o=F._ref.toRangeRef().clone().setSheet(R.name()),r.intersects(o)){if(r.eq(o))return null;if(o=o.clone(),r.topLeft.eq(o.topLeft))if(r.width()==o.width())o.topLeft.row+=r.height(),n=0;else{if(r.height()!=o.height())throw new d(h);o.topLeft.col+=r.width(),n=1}else{if(!r.bottomRight.eq(o.bottomRight))throw new d(h);if(r.width()==o.width())o.bottomRight.row-=r.height(),n=2;else{if(r.height()!=o.height())throw new d(h);o.bottomRight.col-=r.width(),n=3}}return R.range(o)._previewFillFrom(e,n)}if(null==n)if(r.topLeft.col==o.topLeft.col)n=r.topLeft.row<o.topLeft.row?0:2;else{if(r.topLeft.row!=o.topLeft.row)throw new d(p);n=r.topLeft.col<o.topLeft.col?1:3}if(i=1&n,u=2&n,i&&r.height()!=o.height()||!i&&r.width()!=o.width())throw new d(h);for(f=e._properties(),i?a=o.width():(f=l(f),a=o.height()),c=Array(f.length),s=null,g=0;g<f.length;++g)for(m=f[g],w=t(m),v=c[g]=Array(a),b=0;b<a;++b)y=u?-b-1:m.length+b,L=u?m.length-b%m.length-1:b%m.length,x=v[u?a-b-1:b]=w(y,L),null!=x.value&&(s=x.value);return i||(c=l(c)),{props:c,direction:n,dest:F,hint:s}},a.prototype.fillFrom=function(e,t){var n=this._previewFillFrom(e,t);return n.dest._properties(n.props,!0),n.dest})},n(3))},1485:function(e,t){e.exports=require("./runtime")}});