UNPKG

@progress/kendo-ui

Version:

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

1 lines 13 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(1529),t.exports=n(1529)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},19:function(t,e){t.exports=require("../kendo.core")},1529:function(t,e,n){var i,o,r;!function(s,define){o=[n(19)],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,f,c;kendo.support.browser.msie&&kendo.support.browser.version<9||(i=kendo.spreadsheet,o=kendo.Class,r=o.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)!==s},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,i,o,r=this,h=t;if(r===s||h===s)return r===h;if((h instanceof u||h instanceof f&&!(r instanceof u))&&(r=t,h=this),r instanceof u)return h=h.simplify(),h instanceof u&&r.row==h.row&&r.col==h.col&&r.sheet==h.sheet;if(r instanceof f){if(h instanceof f)return h.topLeft.eq(r.topLeft)&&h.bottomRight.eq(r.bottomRight);if(h instanceof c)return h.single()&&r.eq(h.refs[0])}else if(r instanceof c&&h instanceof c){if(e=r.refs,n=h.refs,e.length!=n.length)return!1;for(i=0,o=e.length;i<o;i++)if(!e[i].eq(n[i]))return!1;return!0}return r===h},concat:function(t){return new c([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}}),r.display=n,s=new(r.extend({init:function(){},print:function(){return"#NULL!"},eq:function(t){return t===this},forEach:function(){}})),h=r.extend({ref:"name",init:function(t){this.name=t},clone:function(){return new h(this.name).setSheet(this.sheet,this.hasSheet())},print:function(){var t=e(this.name);return this.hasSheet()&&(t=e(this.sheet)+"!"+t),t}}),u=r.extend({ref:"cell",init:function(t,e,n){this.row=t,this.col=e,this.rel=n||0},clone:function(){return new u(this.row,this.col,this.rel).setSheet(this.sheet,this.hasSheet())},intersect:function(t){return t instanceof u?this.eq(t)?this:s: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 f(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 u(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,i,o,r,h){var u=this.absolute(t,e);if(o){if(u.row>=r){if(h<0&&u.row<r-h)return s;u.row+=h}}else if(u.col>=r){if(h<0&&u.col<r-h)return s;u.col+=h}return null!=n&&null!=i&&(u=u.relative(n,i,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)}}),f=r.extend({ref:"range",init:function(t,e){t._hasSheet&&e._hasSheet&&t.sheet.toLowerCase()!=e.sheet.toLowerCase()&&(this.endSheet=e.sheet),this.topLeft=new u(t.row,t.col,t.rel),this.bottomRight=new u(e.row,e.col,e.rel),this.normalize()},clone:function(){return new f(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 u?this._containsCell(t):t instanceof f&&this._containsRange(t)},_intersectRange:function(t){var e,n,i,o,r,h,c,l;return this.sheet!=t.sheet?s:(e=this.topLeft.col,n=this.topLeft.row,i=this.bottomRight.col,o=this.bottomRight.row,r=t.topLeft.col,h=t.topLeft.row,c=t.bottomRight.col,l=t.bottomRight.row,e<=c&&r<=i&&n<=l&&h<=o?new f(new u(Math.max(n,h),Math.max(e,r)),new u(Math.min(o,l),Math.min(i,c))).setSheet(this.sheet,this.hasSheet()):s)},intersect:function(t){return t instanceof u?this._containsCell(t)?t:s:t instanceof f?this._intersectRange(t).simplify():t instanceof c?t.intersect(this):s},simplify:function(){return this.isCell()?new u(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,r=n.row,s=n.col,h=2&e.rel,f=1&e.rel,c=2&n.rel,l=1&n.rel,a=!1;return h===c&&f===l&&(i>r&&(a=!0,t=i,i=r,r=t,t=h,h=c,c=t),o>s&&(a=!0,t=o,o=s,s=t,t=f,f=l,l=t),a&&(this.topLeft=new u(i,o,f|h),this.bottomRight=new u(r,s,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 f(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 f(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 f(this.topLeft,new u(this.bottomRight.row,this.topLeft.col))},rightColumn:function(){return new f(new u(this.topLeft.row,this.bottomRight.col),this.bottomRight)},topRow:function(){return new f(this.topLeft,new u(this.topLeft.row,this.bottomRight.col))},bottomRow:function(){return new f(new u(this.bottomRight.row,this.topLeft.col),this.bottomRight)},toRangeRef:function(){return this},toRow:function(t){return t+=Math.max(0,this.topLeft.row),new f(new u(t,this.topLeft.col),new u(t,this.bottomRight.col)).setSheet(this.sheet,this.hasSheet())},toColumn:function(t){return t+=Math.max(0,this.topLeft.col),new f(new u(this.topLeft.row,t),new u(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 u(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,r=this.bottomRight.col;for(e=n;e<=i;e++)t(new f(new u(e,o),new u(e,r)))},forEachColumn:function(t){var e,n=this.topLeft.row,i=this.bottomRight.row,o=this.topLeft.col,r=this.bottomRight.col;for(e=o;e<=r;e++)t(new f(new u(n,e),new u(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,r=this.topLeft.col,s=this.bottomRight.row,h=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<r&&(c=!0,r=t.topLeft.col),t.bottomRight.row>s&&(c=!0,s=t.bottomRight.row),t.bottomRight.col>h&&(c=!0,h=t.bottomRight.col),e&&e(t)}),n=new f(new u(o,r),new u(s,h)),c?n.union(t,e):n},resize:function(t){function e(t){return t||0}var n=Math.max.bind(Math,0),i=this.topLeft.row+e(t.top),o=this.topLeft.col+e(t.left),r=this.bottomRight.row+e(t.bottom),h=this.bottomRight.col+e(t.right);return o<0&&h<0||i<0&&r<0?s:i<=r&&o<=h?new f(new u(n(i),n(o)),new u(n(r),n(h))):s},move:function(t,e){return new f(new u(this.topLeft.row+t,this.topLeft.col+e),new u(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,i,o,r,h){var u=this.topLeft.adjust(t,e,n,i,o,r,h),c=this.bottomRight.adjust(t,e,n,i,o,r,h);return u===s&&c===s?s:(u===s?(u=this.topLeft.absolute(t,e),o?u.row=r:u.col=r,null!=n&&null!=i&&(u=u.relative(n,i,this.topLeft.rel))):c===s&&(c=this.bottomRight.absolute(t,e),o?c.row=r-1:c.col=r-1,null!=n&&null!=i&&(c=c.relative(n,i,this.bottomRight.rel))),new f(u,c).setSheet(this.sheet,this.hasSheet()).simplify())},valid:function(){return this.topLeft.valid()&&this.bottomRight.valid()}}),c=r.extend({init:function(t){this.refs=t,this.length=t.length},clone:function(){return new c(this.refs.slice())},intersect:function(t){var e,n,i=[];for(e=0;e<this.length;++e)n=t.intersect(this.refs[e]),n!==s&&i.push(n);return i.length>0?new c(i).simplify():s},simplify:function(){var t=new c(this.refs.reduce(function(t,e){return e=e.simplify(),e!==s&&t.push(e),t},[]));return t.empty()?s:t.single()?t.refs[0]:t},absolute:function(t,e){return new c(this.refs.map(function(n){return n.absolute(t,e)}))},forEach:function(t,e){this.refs.forEach(function(n){n instanceof c?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 c(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 c(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 c(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)})}}),i.NULLREF=s,i.SHEETREF=new f(new u(0,0),new u(1/0,1/0)),i.FIRSTREF=new u(0,0),i.Ref=r,i.NameRef=h,i.CellRef=u,i.RangeRef=f,i.UnionRef=c,i.SHEETREF.print=function(){return"#SHEET"})},n(3))}});