UNPKG

@progress/kendo-ui

Version:

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

1 lines 12.9 kB
module.exports=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){n(1631),t.exports=n(1631)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},20:function(t,e){t.exports=require("../kendo.core")},1631:function(t,e,n){var i,o,r;!function(s,define){o=[n(20)],i=s,r="function"==typeof i?i.apply(e,o):i,!(void 0!==r&&(t.exports=r))}(function(){"use strict";function t(e){var n=Math.floor(e/26)-1;return(n>=0?t(n):"")+String.fromCharCode(65+e%26)}function e(t){return/^[a-z_][a-z0-9_]*$/i.test(t)?t:"'"+t.replace(/\x27/g,"\\'")+"'"}function n(n,i,o,r){var s="";return++i,isFinite(i)?null==r||2&r||(i="$"+i):i="",isFinite(o)?(s=t(o),null==r||1&r||(s="$"+s)):o="",n?e(n)+"!"+s+i:s+i}var i,o,r,s,h,u=kendo.spreadsheet,f=kendo.Class,c=f.extend({type:"ref",sheet:"",clone:function(){return this},hasSheet:function(){return this._hasSheet},simplify:function(){return this},setSheet:function(t,e){return this.sheet=t,null!=e&&(this._hasSheet=e),this},absolute:function(){return this},relative:function(){return this},adjust:function(){return this},toString:function(){return this.relative(0,0,3,3).print(0,0)},forEach:function(t,e){t.call(e,this)},map:function(t,e){return t.call(e,this)},intersects:function(t){return this.intersect(t)!==i},isCell:function(){return!1},toRow:function(){return this},toColumn:function(){return this},first:function(){return this},lastRange:function(){return this},size:function(){return 1},rangeAt:function(){return this},nextRangeIndex:function(){return 0},previousRangeIndex:function(){return 0},eq:function(t){var e,n,o,u,f=this,c=t;if(f===i||c===i)return f===c;if((c instanceof r||c instanceof s&&!(f instanceof r))&&(f=t,c=this),f instanceof r)return c=c.simplify(),c instanceof r&&f.row==c.row&&f.col==c.col&&f.sheet==c.sheet;if(f instanceof s){if(c instanceof s)return c.topLeft.eq(f.topLeft)&&c.bottomRight.eq(f.bottomRight);if(c instanceof h)return c.single()&&f.eq(c.refs[0])}else if(f instanceof h&&c instanceof h){if(e=f.refs,n=c.refs,e.length!=n.length)return!1;for(o=0,u=e.length;o<u;o++)if(!e[o].eq(n[o]))return!1;return!0}return f===c},concat:function(t){return new h([this,t])},replaceAt:function(t,e){return e},forEachColumnIndex:function(t){this.forEachAxisIndex("col",t)},forEachRowIndex:function(t){this.forEachAxisIndex("row",t)},forEachAxisIndex:function(t,e){var n=[],i="row"===t?"forEachRow":"forEachColumn";this[i](function(e){var i=e.first()[t];n.indexOf(i)===-1&&n.push(i)}),n.sort(function(t,e){return t>e?1:t<e?-1:0}).forEach(e)},valid:function(){return!1},renameSheet:function(t,e){if(this.sheet&&this.sheet.toLowerCase()==t.toLowerCase())return this.sheet=e,!0}});c.display=n,i=new(c.extend({init:function(){},print:function(){return"#NULL!"},eq:function(t){return t===this},forEach:function(){}})),o=c.extend({ref:"name",init:function(t){this.name=t},clone:function(){return new o(this.name).setSheet(this.sheet,this.hasSheet())},print:function(){var t=e(this.name);return this.hasSheet()&&(t=e(this.sheet)+"!"+t),t}}),r=c.extend({ref:"cell",init:function(t,e,n){this.row=t,this.col=e,this.rel=n||0},clone:function(){return new r(this.row,this.col,this.rel).setSheet(this.sheet,this.hasSheet())},intersect:function(t){return t instanceof r?this.eq(t)?this:i:t.intersect(this)},print:function(t,i,o){var r,s,h=this.col,u=this.row,f=this.rel;return null==t&&f?(s=this.hasSheet()?e(this.sheet)+"!":"",h=isFinite(h)?1&f?"C["+h+"]":"C"+(h+1):"",u=isFinite(u)?2&f?"R["+u+"]":"R"+(u+1):"",s+u+h):(r=this.absolute(t,i),o?(u=r.row%1048576,h=r.col%16384,u<0&&(u+=1048576),h<0&&(h+=16384),n(this._hasSheet&&this.sheet,u,h,f)):r.valid()?n(this._hasSheet&&this.sheet,r.row,r.col,f):"#REF!")},absolute:function(t,e){var n=this.clone();return n.rel&!1?n:(1&n.rel&&(n.col=(n.col+e)%16384),2&n.rel&&(n.row=(n.row+t)%1048576),n.rel=0,n)},toRangeRef:function(){return new s(this,this)},relative:function(t,e,n){var i,o;return null==n&&(n=this.rel),i=2&n?this.row-t:this.row,o=1&n?this.col-e:this.col,new r(i,o,n).setSheet(this.sheet,this.hasSheet())},height:function(){return 1},width:function(){return 1},toString:function(){return n(null,this.row,this.col,3)},isCell:function(){return!0},leftColumn:function(){return this},rightColumn:function(){return this},topRow:function(){return this},bottomRow:function(){return this},forEachRow:function(t){t(this.toRangeRef())},forEachColumn:function(t){t(this.toRangeRef())},adjust:function(t,e,n,o,r,s,h){var u=this.absolute(t,e);if(r){if(u.row>=s){if(h<0&&u.row<s-h)return i;u.row+=h}}else if(u.col>=s){if(h<0&&u.col<s-h)return i;u.col+=h}return null!=n&&null!=o&&(u=u.relative(n,o,this.rel)),u},valid:function(){if(this.rel)throw Error("valid() called on relative reference");var t=this.col,e=this.row;return!(isFinite(t)&&t<0||isFinite(e)&&e<0)}}),s=c.extend({ref:"range",init:function(t,e){t._hasSheet&&e._hasSheet&&t.sheet.toLowerCase()!=e.sheet.toLowerCase()&&(this.endSheet=e.sheet),this.topLeft=new r(t.row,t.col,t.rel),this.bottomRight=new r(e.row,e.col,e.rel),this.normalize()},clone:function(){return new s(this.topLeft.clone(),this.bottomRight.clone()).setSheet(this.sheet,this.hasSheet())},_containsRange:function(t){return this._containsCell(t.topLeft)&&this._containsCell(t.bottomRight)},_containsCell:function(t){return t.sheet==this.sheet&&t.row>=this.topLeft.row&&t.col>=this.topLeft.col&&t.row<=this.bottomRight.row&&t.col<=this.bottomRight.col},contains:function(t){if(t instanceof Array){var e=this;return t.some(function(t){return e.contains(t)})}return t instanceof r?this._containsCell(t):t instanceof s&&this._containsRange(t)},_intersectRange:function(t){var e,n,o,h,u,f,c,l;return this.sheet!=t.sheet?i:(e=this.topLeft.col,n=this.topLeft.row,o=this.bottomRight.col,h=this.bottomRight.row,u=t.topLeft.col,f=t.topLeft.row,c=t.bottomRight.col,l=t.bottomRight.row,e<=c&&u<=o&&n<=l&&f<=h?new s(new r(Math.max(n,f),Math.max(e,u)),new r(Math.min(h,l),Math.min(o,c))).setSheet(this.sheet,this.hasSheet()):i)},intersect:function(t){return t instanceof r?this._containsCell(t)?t:i:t instanceof s?this._intersectRange(t).simplify():t instanceof h?t.intersect(this):i},simplify:function(){return this.isCell()?new r(this.topLeft.row,this.topLeft.col,this.topLeft.rel).setSheet(this.sheet,this.hasSheet()):this},normalize:function(){var t,e=this.topLeft,n=this.bottomRight,i=e.row,o=e.col,s=n.row,h=n.col,u=2&e.rel,f=1&e.rel,c=2&n.rel,l=1&n.rel,a=!1;return u===c&&f===l&&(i>s&&(a=!0,t=i,i=s,s=t,t=u,u=c,c=t),o>h&&(a=!0,t=o,o=h,h=t,t=f,f=l,l=t),a&&(this.topLeft=new r(i,o,f|u),this.bottomRight=new r(s,h,l|c))),this},print:function(t,n,i){if(i||this.absolute(t,n).valid()){var o=this.topLeft.print(t,n,i)+":"+this.bottomRight.print(t,n,i);return this.hasSheet()&&(o=e(this.sheet)+(this.endSheet?":"+e(this.endSheet):"")+"!"+o),o}return"#REF!"},absolute:function(t,e){return new s(this.topLeft.absolute(t,e),this.bottomRight.absolute(t,e)).setSheet(this.sheet,this.hasSheet())},relative:function(t,e,n,i){return null==i&&(i=n),new s(this.topLeft.relative(t,e,n),this.bottomRight.relative(t,e,i)).setSheet(this.sheet,this.hasSheet())},height:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.row-this.topLeft.row+1},width:function(){if(this.topLeft.rel!=this.bottomRight.rel)throw Error("Mixed relative/absolute references");return this.bottomRight.col-this.topLeft.col+1},collapse:function(){return this.topLeft.toRangeRef()},leftColumn:function(){return new s(this.topLeft,new r(this.bottomRight.row,this.topLeft.col))},rightColumn:function(){return new s(new r(this.topLeft.row,this.bottomRight.col),this.bottomRight)},topRow:function(){return new s(this.topLeft,new r(this.topLeft.row,this.bottomRight.col))},bottomRow:function(){return new s(new r(this.bottomRight.row,this.topLeft.col),this.bottomRight)},toRangeRef:function(){return this},toRow:function(t){return t+=Math.max(0,this.topLeft.row),new s(new r(t,this.topLeft.col),new r(t,this.bottomRight.col)).setSheet(this.sheet,this.hasSheet())},toColumn:function(t){return t+=Math.max(0,this.topLeft.col),new s(new r(this.topLeft.row,t),new r(this.bottomRight.row,t)).setSheet(this.sheet,this.hasSheet())},toCell:function(t,e){return t+=Math.max(0,this.topLeft.row),e+=Math.max(0,this.topLeft.col),new r(t,e,0).setSheet(this.sheet,this.hasSheet())},forEachRow:function(t){var e,n=this.topLeft.row,i=this.bottomRight.row,o=this.topLeft.col,h=this.bottomRight.col;for(e=n;e<=i;e++)t(new s(new r(e,o),new r(e,h)))},forEachColumn:function(t){var e,n=this.topLeft.row,i=this.bottomRight.row,o=this.topLeft.col,h=this.bottomRight.col;for(e=o;e<=h;e++)t(new s(new r(n,e),new r(i,e)))},intersecting:function(t){return t.filter(function(t){return t.toRangeRef().intersects(this)},this)},union:function(t,e){var n,i=this.intersecting(t),o=this.topLeft.row,h=this.topLeft.col,u=this.bottomRight.row,f=this.bottomRight.col,c=!1;return i.forEach(function(t){t=t.toRangeRef(),t.topLeft.row<o&&(c=!0,o=t.topLeft.row),t.topLeft.col<h&&(c=!0,h=t.topLeft.col),t.bottomRight.row>u&&(c=!0,u=t.bottomRight.row),t.bottomRight.col>f&&(c=!0,f=t.bottomRight.col),e&&e(t)}),n=new s(new r(o,h),new r(u,f)),c?n.union(t,e):n},resize:function(t){function e(t){return t||0}var n=Math.max.bind(Math,0),o=this.topLeft.row+e(t.top),h=this.topLeft.col+e(t.left),u=this.bottomRight.row+e(t.bottom),f=this.bottomRight.col+e(t.right);return h<0&&f<0||o<0&&u<0?i:o<=u&&h<=f?new s(new r(n(o),n(h)),new r(n(u),n(f))):i},move:function(t,e){return new s(new r(this.topLeft.row+t,this.topLeft.col+e),new r(this.bottomRight.row+t,this.bottomRight.col+e))},first:function(){return this.topLeft.clone().setSheet(this.sheet,this.hasSheet())},isCell:function(){return!this.endSheet&&this.topLeft.eq(this.bottomRight)},toString:function(){return this.topLeft+":"+this.bottomRight},adjust:function(t,e,n,o,r,h,u){var f=this.topLeft.adjust(t,e,n,o,r,h,u),c=this.bottomRight.adjust(t,e,n,o,r,h,u);return f===i&&c===i?i:(f===i?(f=this.topLeft.absolute(t,e),r?f.row=h:f.col=h,null!=n&&null!=o&&(f=f.relative(n,o,this.topLeft.rel))):c===i&&(c=this.bottomRight.absolute(t,e),r?c.row=h-1:c.col=h-1,null!=n&&null!=o&&(c=c.relative(n,o,this.bottomRight.rel))),new s(f,c).setSheet(this.sheet,this.hasSheet()).simplify())},valid:function(){return this.topLeft.valid()&&this.bottomRight.valid()}}),h=c.extend({init:function(t){this.refs=t,this.length=t.length},clone:function(){return new h(this.refs.slice())},intersect:function(t){var e,n,o=[];for(e=0;e<this.length;++e)n=t.intersect(this.refs[e]),n!==i&&o.push(n);return o.length>0?new h(o).simplify():i},simplify:function(){var t=new h(this.refs.reduce(function(t,e){return e=e.simplify(),e!==i&&t.push(e),t},[]));return t.empty()?i:t.single()?t.refs[0]:t},absolute:function(t,e){return new h(this.refs.map(function(n){return n.absolute(t,e)}))},forEach:function(t,e){this.refs.forEach(function(n){n instanceof h?n.forEach(t,e):t.call(e,n)},e)},toRangeRef:function(){return this.refs[0].toRangeRef()},contains:function(t){return this.refs.some(function(e){return e.contains(t)})},map:function(t,e){var n=[];return this.forEach(function(i){n.push(t.call(e,i))}),new h(n)},first:function(){return this.refs[0].first()},lastRange:function(){return this.refs[this.length-1]},size:function(){return this.length},single:function(){return 1==this.length},empty:function(){return 0===this.length},isCell:function(){return this.single()&&this.refs[0].isCell()},rangeAt:function(t){return this.refs[t]},nextRangeIndex:function(t){return t===this.length-1?0:t+1},previousRangeIndex:function(t){return 0===t?this.length-1:t-1},concat:function(t){return new h(this.refs.concat([t]))},print:function(t,e,n){return this.refs.map(function(i){return i.print(t,e,n)}).join(",")},replaceAt:function(t,e){var n=this.refs.slice();return n.splice(t,1,e),new h(n)},leftColumn:function(){return this.map(function(t){return t.leftColumn()})},rightColumn:function(){return this.map(function(t){return t.rightColumn()})},topRow:function(){return this.map(function(t){return t.topRow()})},bottomRow:function(){return this.map(function(t){return t.bottomRow()})},forEachRow:function(t){this.forEach(function(e){e.forEachRow(t)})},forEachColumn:function(t){this.forEach(function(e){e.forEachColumn(t)})},adjust:function(t,e,n,i,o,r,s){return this.map(function(h){return h.adjust(t,e,n,i,o,r,s)}).simplify()},toString:function(){return this.refs.map(function(t){return""+t}).join(", ")},valid:function(){for(var t=this.refs.length;--t>=0;)if(this.refs[t].valid())return!1;return!0},renameSheet:function(t,e){this.refs.forEach(function(n){n.renameSheet(t,e)})}}),u.NULLREF=i,u.SHEETREF=new s(new r(0,0),new r(1/0,1/0)),u.FIRSTREF=new r(0,0),u.Ref=c,u.NameRef=o,u.CellRef=r,u.RangeRef=s,u.UnionRef=h,u.SHEETREF.print=function(){return"#SHEET"}},n(3))}});