| 12345678910111213 |
- /*!
- *
- * SpreadJS Library 13.1.0
- *
- * Copyright(c) GrapeCity, Inc. All rights reserved.
- *
- * Licensed under the SpreadJS Commercial License.
- * us.sales@grapecity.com
- * http://www.grapecity.com/en/licensing/grapecity/
- *
- *
- */
- var GC="object"==typeof GC?GC:{};GC.Spread=GC.Spread||{},GC.Spread.Sheets=GC.Spread.Sheets||{},GC.Spread.Sheets.CellState=function(a){var b={};function c(d){if(b[d])return b[d].exports;var e=b[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,c),e.l=!0,e.exports}return c.m=a,c.c=b,c.d=function(a,b,d){c.o(a,b)||Object.defineProperty(a,b,{enumerable:!0,get:d})},c.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},c.t=function(a,b){var d,e;if(1&b&&(a=c(a)),8&b)return a;if(4&b&&"object"==typeof a&&a&&a.__esModule)return a;if(d=Object.create(null),c.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&b&&"string"!=typeof a)for(e in a)c.d(d,e,function(b){return a[b]}.bind(null,e));return d},c.n=function(a){var b=a&&a.__esModule?function b(){return a.default}:function b(){return a};return c.d(b,"a",b),b},c.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},c.p="/assets/",c(c.s="./dist/plugins/cellState/cellstate.entry.js")}({"./dist/plugins/cellState/cellStateManager.js":function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n,o=this&&this.__assign||function(){return o=Object.assign||function(a){var b,c,d,e;for(c=1,d=arguments.length;c<d;c++){b=arguments[c];for(e in b)Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e])}return a},o.apply(this,arguments)},p=this&&this.__rest||function(a,b){var c,d,e={};for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.indexOf(c)<0&&(e[c]=a[c]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(d=0,c=Object.getOwnPropertySymbols(a);d<c.length;d++)b.indexOf(c[d])<0&&(e[c[d]]=a[c[d]]);return e};Object.defineProperty(b,"__esModule",{value:!0}),d=c("Common"),e=c("Core"),f=d.Common.j.Fa,g=e.GC$.extend,h=void 0,i="cellState",j=[e.CellStatesType.readonly,e.CellStatesType.invalid,e.CellStatesType.dirty,e.CellStatesType.selected,e.CellStatesType.active,e.CellStatesType.hover,e.CellStatesType.edit];function q(a){var b=a.row,c=a.col,d=a.rowCount,f=a.colCount;return new e.Range(b,c,d,f)}k=function(){function a(a,b){this.kj=a,this.io=b,this.xn=[];for(var c=1;c<=3;c++)this.sCb(c)}return a.prototype.sCb=function(a){this.xn[a]=[]},a.prototype.tCb=function(a){return this.xn[a]},a.prototype.uCb=function(a,b){this.xn[b]=a},a.prototype.FJb=function(a,b){var c,d,e;for(c=0,d=a.length;c<d;c++)if(e=a[c],e.range.equals(b))return c;return-1},a.prototype.Fb=function(a,b){var c,d=this,e=d.tCb(b),f=this.FJb(e,a);f>-1&&(c=e[f],d.GJb(f,c.range,c.style,e),e.splice(f,1))},a.prototype.Sb=function(a,b,c){var d=this,e=d.tCb(c),f=d.FJb(e,a),g={range:a,style:b};d.vCb({index:f,cache:e,range:a,style:b}),f===-1?e.push(g):e[f]=g},a.prototype.zR=function(a){var b=this.tCb(a),c=this.io;return b.map(function(a){var b=a.range,d=a.style;return{range:q(b),style:d.clone(),state:c}})},a.prototype.Gq=function(a,b,c){var d,e,f,g=this.tCb(c),h=[];for(e=g.length,f=0;f<e;f++)d=g[f],v(a,b,d.range)&&h.push(d);return h.length>0?h:null},a.prototype.HJb=function(a,b,c){var d,e,f,g=this,h=g.tCb(c);if(h&&h.length>0)for(d=0,e=h;d<e.length;d++)if(f=e[d].range,v(a,b,f))return!0;return!1},a.prototype.wCb=function(a,b,c,d,g,h){var i,j,k,l,m=this,n=m.kj,o=m.tCb(g);if(o&&0===o.length)return!1;if(m.io===e.CellStatesType.dirty&&(f(d)||(d&m.io)>0))return n.IJb(b,c,g);if(m.io===e.CellStatesType.selected&&(f(d)||(d&m.io)>0)){for(i=m.kj.getSelections(),j=0,k=i;j<k.length;j++)if(l=k[j],v(b,c,l))return!0;return!1}return m.io===e.CellStatesType.invalid?!(!n.isValid||!(f(d)||(d&m.io)>0))&&!n.isValid(b,c,n.getValue(b,c,g)):m.io===e.CellStatesType.readonly?h&&m.kj.options.isProtected:(m.io&a)>0},a.prototype.xCb=function(a,b){var c=this,d=this.tCb(b);this.yCb({cache:d,sheetArea:b,collection:c}),this.uCb(r(this.kj,d,a),b)},a.prototype.toJSON=function(){var a,b,c=this,d={};for(b=0;b<=3;b++)a=c.tCb(b),a&&a.length>0&&(d[b]=s(a));return d},a.prototype.fromJSON=function(a,b,c){var d,e,f,g=this;for(g.xn=[],e=1;e<=3;e++)g.sCb(e);for(f in a)a.hasOwnProperty(f)&&(d=g.tCb(f),t(d,a[f],b,c))},a.prototype.zCb=function(a){var b=p(a,[]),c=this,d=c.kj.ITa;d.ACb(o({type:"rangeChange"},b))},a.prototype.vCb=function(a){var b=a.index,c=a.cache,d=a.range,e=a.style,f=this,g=f.kj.ITa;b!==-1&&(e=c[b].style),g.ACb({type:"add",index:b,cache:c,range:d,style:e})},a.prototype.GJb=function(a,b,c,d){var e=this,f=e.kj.ITa;f.ACb({type:"remove",index:a,range:b,style:c,cache:d})},a.prototype.yCb=function(a){var b=p(a,[]),c=this,d=c.kj.ITa;d.ACb(o({type:"clear"},b))},a.prototype.rI=function(a,b){var c,d,e=this;for(d=0;d<=3;d++)c=e.tCb(d),c&&c.length>0&&c.forEach(function(c){var d=c.range,f=d.row,g=d.rowCount;a<=f?(d.row=f+b,e.zCb({range:d,row:f})):f<a&&a<f+g&&(d.rowCount=d.rowCount+b,e.zCb({range:d,rowCount:g}))})},a.prototype.GR=function(a,b){var c,d,e=this;for(d=0;d<=3;d++)c=e.tCb(d),c&&c.length>0&&c.forEach(function(c){var d,f=c.range,g=f.row,h=f.rowCount;a<g?(d=a+b-g,d<=0?g-=b:(g-=d,f.rowCount-=d),g<0&&(f.rowCount=h+g,g=0),f.row=g,e.zCb({range:f,row:g,rowCount:h})):g<=a&&a<g+h&&(f.rowCount=f.rowCount-Math.min(b,g+h-a),e.zCb({range:f,rowCount:h}))})},a.prototype.tI=function(a,b){var c,d,e=this;for(d=0;d<=3;d++)c=e.tCb(d),c&&c.length>0&&c.forEach(function(c){var d=c.range,f=d.col,g=d.colCount;a<=f?(d.col=f+b,e.zCb({range:d,col:f})):f<a&&a<f+d.colCount&&(d.colCount=g+b,e.zCb({range:d,colCount:g}))})},a.prototype.HR=function(a,b){var c,d,e=this;for(d=0;d<=3;d++)c=e.tCb(d),c&&c.length>0&&c.forEach(function(c){var d,f=c.range,g=f.col,h=f.colCount;a<g?(d=a+b-g,d<=0?g-=b:(g-=d,f.colCount-=d),g<0&&(f.colCount+=g,g=0),f.col=g,e.zCb({range:f,col:g,colCount:h})):g<=a&&a<g+h&&(f.colCount-=Math.min(b,g+h-a),e.zCb({range:f,colCount:h}))})},a.prototype.BCb=function(){this.xn=[],this.kj=null},a}(),l=function(){function a(a){this.kj=a,this.CCb={}}return a.prototype.getCollection=function(a,b){var c=this;return!c.CCb[a]&&b&&(c.CCb[a]=new k(c.kj,a)),c.CCb[a]},a.prototype.hasIntersectInSeletionState=function(a,b,c,d){var f,g,h,i,j=this,k=j.CCb[e.CellStatesType.selected];if(k&&(f=k.tCb(e.SheetArea.viewport),f&&f.length>0))for(g=0,h=f;g<h.length;g++)if(i=h[g].range,i.intersect(a,b,c,d))return!0;return!1},a.prototype.getState=function(a,b,c){var d=this.kj.ITa.XTa(c);return d.getCellState(a,b)||0},a.prototype.remove=function(a,b,c){void 0===c&&(c=e.SheetArea.viewport);var d=this.CCb[b];d.Fb(a,c)},a.prototype.all=function(a,b){var c,d;if(void 0===b&&(b=e.SheetArea.viewport),c=[],f(a))for(d in this.CCb)this.CCb.hasOwnProperty(d)&&(c=c.concat(this.CCb[d].zR(b)));else c=this.CCb[a].zR(b);return c},a.prototype.add=function(a,b,c,d){var f,g,i;if(void 0===d&&(d=3),e.CellStatesType[b]===h)throw Error("Unmatched Cell State Type");f=this.getCollection(b,!0),f.Sb(q(a),c,d),g=this.kj,d===e.SheetArea.viewport?g.repaint(g.cm(a)):(i=g.am(),d===e.SheetArea.colHeader&&g.repaint(new e.Rect(i.pt,i.Ar,i.er,i.Cr)),d===e.SheetArea.rowHeader&&g.repaint(new e.Rect(i.zr,i.qt,i.Br,i.jr)))},a.prototype.clear=function(a,b){this.DCb(a,b)},a.prototype.DCb=function(a,b){for(var c in this.CCb)this.CCb.hasOwnProperty(c)&&this.CCb[c].xCb(a,b)},a.prototype.JJb=function(a,b,c,d,e,f){var g=this,h=g.kj,i=g.CCb[a];i&&i.HJb(b,c,d)&&e!==-1&&f!==-1&&h.repaint(h.gCb(h,b,c,e,f))},a.prototype.getStyle=function(a,b,c,d,g){var i,k,l,m,n,o,p,q,r,s;if(f(c)&&(c=3),i=new e.Style,k=[],n=f(d)?this.getState(a,b,c):this.getState(a,b,c)&d,n!==h&&null!==n){for(o=0,p=j;o<p.length;o++)q=p[o],m=this.CCb[q],m&&m.wCb(n,a,b,d,c,g)&&(l=m.Gq(a,b,c),l&&l.length>0&&(k=k.concat(l)));if(k.length>0){for(r=k.length,s=r-1;s>=0;s--)i.Yo(k[s].style);return i}}return null},a.prototype.destory=function(){for(var a in this.CCb)this.CCb.hasOwnProperty(a)&&this.CCb[a].BCb();delete this.CCb,delete this.kj},a.prototype.toJSON=function(){var a,b,c={};for(b in this.CCb)this.CCb.hasOwnProperty(b)&&(a=this.CCb[b],c[b]=a.toJSON());return c},a.prototype.fromJSON=function(a,b,c){var d,e,f,g=this;for(e in a)a.hasOwnProperty(e)&&(f=parseInt(e,10),d=g.getCollection(f,!0),d.fromJSON(a[f],b,c))},a.prototype.rI=function(a,b){for(var c in this.CCb)this.CCb.hasOwnProperty(c)&&this.CCb[c].rI(a,b)},a.prototype.GR=function(a,b){for(var c in this.CCb)this.CCb.hasOwnProperty(c)&&this.CCb[c].GR(a,b)},a.prototype.tI=function(a,b){for(var c in this.CCb)this.CCb.hasOwnProperty(c)&&this.CCb[c].tI(a,b)},a.prototype.HR=function(a,b){for(var c in this.CCb)this.CCb.hasOwnProperty(c)&&this.CCb[c].HR(a,b)},a}(),b.CellStateManager=l;function r(a,b,c){var d=[],e=a.getRowCount(3),f=a.getColumnCount(3);return b.forEach(function(b){d=d.concat(u(a,b.style,b.range,c,e,f))}),d}function s(a){var b,c,d,e,f,g,h,i,j,k,l=[];for(c=0,d=a.length;c<d;c++)b=a[c],e=b.style,f=b.range,g=f.row,h=f.col,i=f.colCount,j=f.rowCount,k={range:{row:g,col:h,colCount:i,rowCount:j},style:e.toJSON()},l.push(k);return l}function t(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,p;for(h=0,i=b.length;h<i;h++)g=b[h],j=g.range,k=j.row,l=j.col,m=j.rowCount,n=j.colCount,o=g.style,p=new e.Style,p.fromJSON(o,c,d),f={style:p,range:new e.Range(k,l,m,n)},a.push(f)}function u(a,b,c,d,e,f){var g=a.v_a(c,d,e,f);return g.map(function(a){return{range:a,style:b}})}function v(a,b,c){return c.contains(a,b)}m={init:function(){this.cellStates=new l(this)},dispose:function(a){var b=this;b.cellStates&&a.clearCache!==!1&&(b.cellStates.destory(),b.cellStates=null)},onLayoutChanged:function(a){var b,c,d=a.changeType,f=a.row,g=a.rowCount,h=a.col,i=a.colCount,j=a.sheetArea,k=this.cellStates;if("addRows"===d)k.rI(f,g);else if("deleteRows"===d)k.GR(f,g);else if("addColumns"===d)k.tI(h,i);else if("deleteColumns"===d)k.HR(h,i);else if("clear"===d&&(3===j&&2===(2&a.type)&&k.DCb(new e.Range(f,h,g,i),j),3===j&&1===(1&a.type)))for(b=f;b<f+g;b++)for(c=h;c<h+i;c++)this.ITa.XTa(j).setCellState(b,c,e.CellStatesType.invalid,!1)},toJson:function(a,b){(!b||b&&!b.ignoreStyle)&&(a.cellStates=this.cellStates.toJSON())},fromJson:function(a,b,c){var d=this,e=c&&!c.ignoreStyle||!c;a&&a.cellStates&&e&&(d.cellStates=new l(d),d.cellStates.fromJSON(a.cellStates,b,c))}},n={zIb:function(a,b,c,d,e,f){d&&d<=3&&d>0&&this.cellStates.JJb(a,b,c,d,e,f)},IJb:function(a,b,c){var d=this,e=d.ITa.hUa(c);return e&&e[a]&&e[a][b]}},g(e.Worksheet.prototype,n),e.Worksheet.$n(i,m),g(e.lUa.prototype,{ACb:function(a){var b,c=this,d=c.zTa;d&&(b=void 0,b=d.ECb?d.ECb:[],b.push(a),d.ECb=b)},FCb:function(a){var b=this;a&&a.length>0&&a.forEach(function(a){var c=a.type,d=p(a,["type"]);switch(c){case"rangeChange":b.GCb(o({},d));break;case"add":b.HCb(o({},d));break;case"clear":b.ICb(o({},d));break;case"remove":b.KJb(o({},d))}})},ICb:function(a){var b=a.cache,c=a.sheetArea,d=a.collection;d.uCb(b,c)},KJb:function(a){var b=a.cache,c=a.range,d=a.style,e=a.index;b.splice(e,0,{range:c,style:d})},HCb:function(a){var b,c=a.cache,d=a.range,e=a.style,f=a.index;f===-1?(c.forEach(function(a,c){var f=a.range,g=a.style;f===d&&g===e&&(b=c)}),c.splice(b,1)):c[f].style=e},GCb:function(a){var b=a.range,c=a.row,d=a.col,e=a.rowCount,f=a.colCount;c!==h&&(b.row=c),d!==h&&(b.col=d),e!==h&&(b.rowCount=e),f!==h&&(b.colCount=f)}}),e.lUa.$n(i,{undo:function(a){var b=a.ECb;b&&this.FCb(b)}})},"./dist/plugins/cellState/cellstate.entry.js":function(a,b,c){"use strict";function d(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])}Object.defineProperty(b,"__esModule",{value:!0}),d(c("./dist/plugins/cellState/cellStateManager.js"))},Common:function(a,b){a.exports=GC.Spread},Core:function(a,b){a.exports=GC.Spread.Sheets}});
|