UNPKG

@progress/kendo-ui

Version:

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

1 lines 3.4 kB
module.exports=function(e){function o(n){if(t[n])return t[n].exports;var r=t[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}var t={};return o.m=e,o.c=t,o.p="",o(0)}({0:function(e,o,t){t(1513),e.exports=t(1513)},3:function(e,o){e.exports=function(){throw Error("define cannot be used indirect")}},19:function(e,o){e.exports=require("../kendo.core")},1513:function(e,o,t){var n,r,a;!function(i,define){r=[t(19)],n=i,a="function"==typeof n?n.apply(o,r):n,!(void 0!==a&&(e.exports=a))}(function(){var e,o,t,n,r,a,i,l;kendo.support.browser.msie&&kendo.support.browser.version<9||(e=kendo.spreadsheet,o=e.CellRef,t=e.RangeRef,n=e.UnionRef,r=e.NameRef,a=e.Ref,i=kendo.Class.extend({init:function(e){this.workbook=e},getRefCells:function(e,i,l,u,s,c){var f,h,d,m,p,k,w,v,x,g,R,b,C,_,y,E,F;if(e instanceof o)return f=this.workbook.sheetByName(e.sheet),f&&e.valid()?(h=f.formula(e),d=f.range(e.row,e.col).value(),c||null!=h||null!=d?[{formula:h,value:d,row:e.row,col:e.col,sheet:e.sheet,hidden:!!i&&(0===f.columnWidth(e.col)||0===f.rowHeight(e.row))}]:[]):[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];if(e instanceof t){if(m=this.workbook.sheetIndex(e.sheet),p=[],k=m,e.endSheet&&(k=this.workbook.sheetIndex(e.endSheet),m>k&&(w=m,m=k,k=w)),m<0||k<0||!e.valid())return[{value:new kendo.spreadsheet.calc.runtime.CalcError("REF")}];for(;m<=k;)for(f=this.workbook.sheetByIndex(m++),v=f._grid.normalize(e.topLeft),x=f._grid.normalize(e.bottomRight),g=f._grid.cellRefIndex(v),R=f._grid.cellRefIndex(x),b=f._properties.iterator("value",g,R),C=v.col;C<=x.col;++C)for(_=v.row;_<=x.row;++_)y=f._grid.index(_,C),h=f._properties.get("formula",y),d=b.at(y),(c||null!=h||null!=d)&&p.push({formula:h,value:d,row:_,col:C,sheet:f.name(),hidden:!!i&&(0===f.columnWidth(C)||0===f.rowHeight(_))});return p}if(e instanceof n){for(E=[],m=0;m<e.refs.length;++m)E=E.concat(this.getRefCells(e.refs[m],i,l,u,s));return E}return e instanceof r?(F=this.nameValue(e,l,u,s),F instanceof a?this.getRefCells(F,i,l,u,s):[{value:null==F?new kendo.spreadsheet.calc.runtime.CalcError("NAME"):F}]):[]},nameValue:function(e,o,t,n){var r;return e.hasSheet()?r=this.workbook.nameValue(e.print()):(e=e.clone().setSheet(o,!0),r=this.workbook.nameValue(e.print()),null==r&&(r=this.workbook.nameValue(e.name))),r instanceof a&&(r=r.absolute(t,n)),r},getData:function(e,t,n,a,i){var l,u=e instanceof o;return e instanceof r&&(u=this.workbook.nameValue(e.name)instanceof o),l=this.getRefCells(e,!1,t,n,a,i).map(function(e){var o=e.value;return o instanceof kendo.spreadsheet.calc.runtime.Formula&&(o=o.value),o}),u?l[0]:l},onFormula:function(e){var o,t,n,r,i,l=this.workbook.sheetByName(e.sheet),u=e.row,s=e.col,c=e.value,f=l.formula({row:u,col:s});return f===e&&(o=e.arrayFormulaRange,o?(r=c.width,i=c.height,l.forEach(o,function(e,o){var a,u,s;void 0===t&&(t=e,n=o),a=e-t,u=o-n,s=a<i&&u<r?c.get(a,u):new kendo.spreadsheet.calc.runtime.CalcError("N/A"),l._value(e,o,s)})):(c instanceof a&&(c=this.getData(c,e.sheet,u,s),Array.isArray(c)&&(c=c[0]),void 0===c&&(c=null)),c instanceof kendo.spreadsheet.calc.runtime.Matrix&&(c=c.get(0,0)),l._value(u,s,c)),clearTimeout(l._formulaContextRefresh),l._formulaContextRefresh=setTimeout(function(){l.batch(function(){},{layout:!0})},50),!0)}}),l=i.extend({onFormula:function(){return!0}}),e.FormulaContext=i,e.ValidationFormulaContext=l)},t(3))}});