@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 5.42 kB
JavaScript
module.exports=function(t){function e(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return t[o].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}({0:function(t,e,i){i(1515),t.exports=i(1515)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},19:function(t,e){t.exports=require("../kendo.core")},1515:function(t,e,i){var o,n,s;!function(r,define){n=[i(19),i(1516)],o=r,s="function"==typeof o?o.apply(e,n):o,!(void 0!==s&&(t.exports=s))}(function(){!function(t){var e,i,o,n,s,r;t.support.browser.msie&&t.support.browser.version<9||(e=t.spreadsheet.CellRef,i=t.spreadsheet.RangeRef,o=t.spreadsheet.UnionRef,n=t.Class.extend({init:function(t,e,i,o){this.left=t,this.top=e,this.width=i,this.height=o,this.right=this.left+this.width,this.bottom=this.top+this.height},offset:function(t,e){return new n(this.left+t,this.top+e,this.width,this.height)},resize:function(t,e){return new n(this.left,this.top,this.width+t,this.height+e)},intersects:function(t,e){return t instanceof n?this.intersectsRect(t):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(e){return t.dom.element("div",{className:e,style:{width:this.width+"px",height:this.height+"px",top:this.top+"px",left:this.left+"px"}})}}),s=t.Class.extend({init:function(t,e,i,o,n,s){this.rowCount=i,this.columnCount=o,this._columns=e,this._rows=t,this._headerHeight=n,this._headerWidth=s},isAxis:function(t){var e,i;return t=t.toRangeRef(),e=t.topLeft,i=t.bottomRight,0===e.row&&i.row===this.rowCount-1||0===e.col&&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 e(t%this.rowCount,t/this.rowCount>>0)},rowRef:function(t){return new i(new e(t,0),new e(t,this.columnCount-1))},colRef:function(t){return new i(new e(0,t),new e(this.rowCount-1,t))},cellRefIndex:function(t){return this.index(t.row,t.col)},normalize:function(t){return t instanceof i?new i(this.normalize(t.topLeft),this.normalize(t.bottomRight)).setSheet(t.sheet,t.hasSheet()):t instanceof o?t.map(function(t){return this.normalize(t)},this):(t instanceof e&&(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))),t)},rectangle:function(t){var e=this.normalize(t.topLeft),i=this.normalize(t.bottomRight);return new n(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(e){return new r(new t.spreadsheet.PaneAxis(this._rows,e.row,e.rowCount,this._headerHeight),new t.spreadsheet.PaneAxis(this._columns,e.column,e.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,i){var o,n,s=this.normalize(t.topLeft),r=this.normalize(t.bottomRight);for(o=s.col;o<=r.col;o++)for(n=s.row;n<=r.row;n++)i(new e(n,o))},trim:function(t,o){var n,s,r,h,l,u=this.normalize(t.topLeft),a=this.normalize(t.bottomRight),f=u.row,c=u.col;for(n=u.col;n<=a.col;n++)s=this.index(u.row,n),r=this.index(a.row,n),h=o.tree.intersecting(s,r),h.length&&(l=this.cellRef(h[h.length-1].end),f=Math.max(f,l.row),c=n);return new i(t.topLeft,new e(Math.min(f,t.bottomRight.row),c))}}),r=t.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){var i,o;this.columns.viewSize(t),this.rows.viewSize(e),i=this.columns.paneSegment(),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,o){var n=this.rows.visible(o),s=this.columns.visible(t);return{rows:n,columns:s,rowOffset:n.offset,columnOffset:s.offset,mergedCellLeft:s.start,mergedCellTop:n.start,ref:new i(new e(n.values.start,s.values.start),new e(n.values.end,s.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),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},o=this.columns.defaultValue/2,n=this.rows.defaultValue/2;return i.scrollTop=i.top-n,i.scrollBottom=i.bottom+n,i.scrollLeft=i.left-o,i.scrollRight=i.right+o,i}}),t.spreadsheet.Grid=s,t.spreadsheet.PaneGrid=r,t.spreadsheet.Rectangle=n)}(kendo)},i(3))},1516:function(t,e){t.exports=require("./references")}});