@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 5.44 kB
JavaScript
module.exports=function(i){var o={};function n(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return i[t].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}return n.m=i,n.c=o,n.p="",n(0)}({0:function(t,e,i){t.exports=i(1711)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},20:function(t,e){t.exports=require("../kendo.core")},1711:function(t,e,i){var o;i(3),i=[i(20),i(1712)],void 0===(e="function"==typeof(o=function(){var e=kendo,f=e.spreadsheet.CellRef,c=e.spreadsheet.RangeRef,i=e.spreadsheet.UnionRef,o=e.Class.extend({init:function t(e,i,o,n){this.left=e;this.top=i;this.width=o;this.height=n;this.right=this.left+this.width;this.bottom=this.top+this.height},offset:function(t,e){return new o(this.left+t,this.top+e,this.width,this.height)},resize:function(t,e){return new o(this.left,this.top,this.width+t,this.height+e)},intersects:function(t,e){if(t instanceof o)return this.intersectsRect(t);return this.left<t&&t<this.left+this.width&&this.top<e&&e<this.top+this.height},intersectsRect:function(t){var e=this;return e.left<=t.right&&t.left<=e.right&&e.top<=t.bottom&&t.top<=e.bottom},toDiv:function(t){return e.dom.element("div",{className:t,style:{width:this.width+"px",height:this.height+"px",top:this.top+"px",left:this.left+"px"}})}}),t=e.Class.extend({init:function(t,e,i,o,n,r){this.rowCount=i;this.columnCount=o;this._columns=e;this._rows=t;this._headerHeight=n;this._headerWidth=r},_resize:function(t,e){this.rowCount=t;this.columnCount=e},isAxis:function(t){t=t.toRangeRef();var e=t.topLeft;var i=t.bottomRight;return e.row===0&&i.row===this.rowCount-1||e.col===0&&i.col===this.columnCount-1},width:function(t,e){return this._columns.sum(t,e)},height:function(t,e){return this._rows.sum(t,e)},totalHeight:function(){return this._rows.total+this._headerHeight},totalWidth:function(){return this._columns.total+this._headerWidth},index:function(t,e){return e*this.rowCount+t},cellRef:function(t){return new f(t%this.rowCount,t/this.rowCount>>0)},rowRef:function(t){return new c(new f(t,0),new f(t,this.columnCount-1))},colRef:function(t){return new c(new f(0,t),new f(this.rowCount-1,t))},cellRefIndex:function(t){return this.index(t.row,t.col)},normalize:function(t){if(t instanceof c)return new c(this.normalize(t.topLeft),this.normalize(t.bottomRight)).setSheet(t.sheet,t.hasSheet());if(t instanceof i)return t.map(function(t){return this.normalize(t)},this);if(t instanceof f){t=t.clone();t.col=Math.max(0,Math.min(this.columnCount-1,t.col));t.row=Math.max(0,Math.min(this.rowCount-1,t.row))}return t},rectangle:function(t){var e=this.normalize(t.topLeft);var i=this.normalize(t.bottomRight);return new o(this.width(0,e.col-1),this.height(0,e.row-1),this.width(e.col,i.col),this.height(e.row,i.row))},pane:function(t){return new n(new e.spreadsheet.PaneAxis(this._rows,t.row,t.rowCount,this._headerHeight),new e.spreadsheet.PaneAxis(this._columns,t.column,t.columnCount,this._headerWidth),this)},rangeDimensions:function(t){return{rows:this._rows.values.iterator(t.topLeft.row,t.bottomRight.row),columns:this._columns.values.iterator(t.topLeft.col,t.bottomRight.col)}},forEach:function(t,e){var i=this.normalize(t.topLeft);var o=this.normalize(t.bottomRight);for(var n=i.col;n<=o.col;n++)for(var r=i.row;r<=o.row;r++)e(new f(r,n))},trim:function(t,e){var i=this.normalize(t.topLeft);var o=this.normalize(t.bottomRight);var n=i.row;var r=i.col;for(var s=i.col;s<=o.col;s++){var h=this.index(i.row,s);var a=this.index(o.row,s);var l=e.tree.intersecting(h,a);if(l.length){var u=this.cellRef(l[l.length-1].end);n=Math.max(n,u.row);r=s}}return new c(t.topLeft,new f(Math.min(n,t.bottomRight.row),r))}}),n=e.Class.extend({init:function(t,e,i){this.rows=t;this.columns=e;this._grid=i;this.headerHeight=t.headerSize;this.headerWidth=e.headerSize;this.hasRowHeader=e.hasHeader;this.hasColumnHeader=t.hasHeader},refresh:function(t,e){this.columns.viewSize(t);this.rows.viewSize(e);var i=this.columns.paneSegment();var o=this.rows.paneSegment();this.left=i.offset;this.top=o.offset;this.right=i.offset+i.length;this.bottom=o.offset+o.length;this.style={top:o.offset+"px",left:i.offset+"px",height:o.length+"px",width:i.length+"px"}},view:function(t,e){var i=this.rows.visible(e);var o=this.columns.visible(t);return{rows:i,columns:o,rowOffset:i.offset,columnOffset:o.offset,mergedCellLeft:o.start,mergedCellTop:i.start,ref:new c(new f(i.values.start,o.values.start),new f(i.values.end,o.values.end))}},contains:function(t){return this.rows.contains(t.topLeft.row,t.bottomRight.row)&&this.columns.contains(t.topLeft.col,t.bottomRight.col)},index:function(t,e){return this._grid.index(t,e)},boundingRectangle:function(t){return this._grid.rectangle(t)},cellRefIndex:function(t){return this._grid.cellRefIndex(t)},scrollBoundaries:function(t){var e=this.boundingRectangle(t);var i={top:Math.max(0,e.top-this.top+(this.hasColumnHeader?0:this.headerHeight)),left:Math.max(0,e.left-this.left+(this.hasRowHeader?0:this.headerWidth)),right:e.right-this.columns._viewSize+this.headerWidth,bottom:e.bottom-this.rows._viewSize+this.headerHeight};var o=this.columns.defaultValue/2;var n=this.rows.defaultValue/2;i.scrollTop=i.top-n;i.scrollBottom=i.bottom+n;i.scrollLeft=i.left-o;i.scrollRight=i.right+o;return i}});e.spreadsheet.Grid=t,e.spreadsheet.PaneGrid=n,e.spreadsheet.Rectangle=o})?o.apply(e,i):o)||(t.exports=e)},1712:function(t,e){t.exports=require("./references")}});