From f382166ff3da5f47240df696fbed106f3e55c2eb Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 6 Nov 2017 10:57:42 +0800 Subject: [PATCH] update --- bi/base.js | 11 +++++------ dist/base.js | 11 +++++------ dist/bundle.js | 11 +++++------ dist/bundle.min.js | 2 +- src/base/table/table.js | 11 +++++------ 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/bi/base.js b/bi/base.js index 5868ba494..1c179e02d 100644 --- a/bi/base.js +++ b/bi/base.js @@ -32404,18 +32404,17 @@ BI.Table = BI.inherit(BI.Widget, { })))); this._initFreezeScroll(); - BI.nextTick(function () { - if (self.element.is(":visible")) { - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); - } - }); BI.ResizeDetector.addResizeListener(this, function () { self._resize(); self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); }); }, + mounted: function () { + this._resize(); + this.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); + }, + _initFreezeScroll: function () { var self = this, o = this.options; scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element); diff --git a/dist/base.js b/dist/base.js index 5868ba494..1c179e02d 100644 --- a/dist/base.js +++ b/dist/base.js @@ -32404,18 +32404,17 @@ BI.Table = BI.inherit(BI.Widget, { })))); this._initFreezeScroll(); - BI.nextTick(function () { - if (self.element.is(":visible")) { - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); - } - }); BI.ResizeDetector.addResizeListener(this, function () { self._resize(); self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); }); }, + mounted: function () { + this._resize(); + this.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); + }, + _initFreezeScroll: function () { var self = this, o = this.options; scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element); diff --git a/dist/bundle.js b/dist/bundle.js index 1826c59f2..7ab731076 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -58145,18 +58145,17 @@ BI.Table = BI.inherit(BI.Widget, { })))); this._initFreezeScroll(); - BI.nextTick(function () { - if (self.element.is(":visible")) { - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); - } - }); BI.ResizeDetector.addResizeListener(this, function () { self._resize(); self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); }); }, + mounted: function () { + this._resize(); + this.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); + }, + _initFreezeScroll: function () { var self = this, o = this.options; scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element); diff --git a/dist/bundle.min.js b/dist/bundle.min.js index beed342cc..0b1b9cd1f 100644 --- a/dist/bundle.min.js +++ b/dist/bundle.min.js @@ -25,7 +25,7 @@ hs:1,rg:1},fa=/,?([achlmqrstvxz]),?/gi,ga=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\ },ab=function(a,c){return function(d,e,f){d=Ia(d);for(var g,h,i,j,k,l="",m={},n=0,o=0,p=d.length;oe){if(c&&!m.start){if(k=_a(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),l+=["C"+k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y],f)return l;m.start=l,l=["M"+k.x,k.y+"C"+k.n.x,k.n.y,k.end.x,k.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!c)return k=_a(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),{x:k.x,y:k.y,alpha:k.alpha}}n+=j,g=+i[5],h=+i[6]}l+=i.shift()+i}return m.end=l,k=a?n:c?m:b.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),k.alpha&&(k={x:k.x,y:k.y,alpha:k.alpha}),k}},bb=ab(1),cb=ab(),db=ab(0,1);b.getTotalLength=bb,b.getPointAtLength=cb,b.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return db(a,b).end;var d=db(a,c,1);return b?db(d,b).end:d},Xa.getTotalLength=function(){var a=this.getPath();if(a)return this.node.getTotalLength?this.node.getTotalLength():bb(a)},Xa.getPointAtLength=function(a){var b=this.getPath();if(b)return cb(b,a)},Xa.getPath=function(){var a,c=b._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return c&&(a=c(this)),a},Xa.getSubpath=function(a,c){var d=this.getPath();if(d)return b.getSubpath(d,a,c)};var eb=b.easing_formulas={linear:function(a){return a},"<":function(a){return Q(a,1.7)},">":function(a){return Q(a,.48)},"<>":function(a){var b=.48-a/1.04,c=M.sqrt(.1734+b*b),d=c-b,e=Q(P(d),1/3)*(d<0?-1:1),f=-c-b,g=Q(P(f),1/3)*(f<0?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){return a==!!a?a:Q(2,-10*a)*M.sin((a-.075)*(2*R)/.3)+1},bounce:function(a){var b,c=7.5625,d=2.75;return a<1/d?b=c*a*a:a<2/d?(a-=1.5/d,b=c*a*a+.75):a<2.5/d?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b}};eb.easeIn=eb["ease-in"]=eb["<"],eb.easeOut=eb["ease-out"]=eb[">"],eb.easeInOut=eb["ease-in-out"]=eb["<>"],eb["back-in"]=eb.backIn,eb["back-out"]=eb.backOut;var fb=[],gb=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},hb=function(){for(var c=+new Date,d=0;d1&&!e.next){for(g in m)m[y](g)&&(p[g]=e.totalOrigin[g]);e.el.attr(p),r(e.anim,e.el,e.anim.percents[0],null,e.totalOrigin,e.repeat-1)}e.next&&!e.stop&&r(e.anim,e.el,e.next,null,e.totalOrigin,e.repeat)}}}fb.length&&gb(hb)},ib=function(a){return a>255?255:a<0?0:a};Xa.animateWith=function(a,c,d,e,f,g){var h=this;if(h.removed)return g&&g.call(h),h;var i=d instanceof q?d:b.animation(d,e,f,g);r(i,h,i.percents[0],null,h.attr());for(var j=0,k=fb.length;ji&&(i=k)}i+="%",!a[i].callback&&(a[i].callback=e)}return new q(a,c)},Xa.animate=function(a,c,d,e){var f=this;if(f.removed)return e&&e.call(f),f;var g=a instanceof q?a:b.animation(a,c,d,e);return r(g,f,g.percents[0],null,f.attr()),f},Xa.setTime=function(a,b){return a&&null!=b&&this.status(a,O(b,a.ms)/a.ms),this},Xa.status=function(a,b){var c,d,e=[],f=0;if(null!=b)return r(a,this,-1,O(b,1)),this;for(c=fb.length;f.5)-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&.5!=n&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/),"linear"==j){var t=e.shift();if(t=-d(t),isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;if(k=k.replace(/[\(\)\s,\xb0#]/g,"_"),b.gradient&&k!=b.gradient.id&&(p.defs.removeChild(b.gradient),delete b.gradient),!b.gradient){s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,"radial"==j?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x1?H.opacity/100:H.opacity});case"stroke":H=a.getRGB(p),i.setAttribute(o,H.hex),"stroke"==o&&H[b]("opacity")&&q(i,{"stroke-opacity":H.opacity>1?H.opacity/100:H.opacity}),"stroke"==o&&d._.arrows&&("startString"in d._.arrows&&t(d,d._.arrows.startString),"endString"in d._.arrows&&t(d,d._.arrows.endString,1));break;case"gradient":("circle"==d.type||"ellipse"==d.type||"r"!=c(p).charAt())&&r(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){I=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),I&&(J=I.getElementsByTagName("stop"),q(J[J.length-1],{"stop-opacity":p}));break}default:"font-size"==o&&(p=e(p,10)+"px");var K=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[K]=p,d._.dirty=1,i.setAttribute(o,p)}}y(d,f),i.style.visibility=m},x=1.2,y=function(d,f){if("text"==d.type&&(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var j,k=c(f.text).split("\n"),m=[],n=0,o=k.length;n"));var X=U.getBoundingClientRect();s.W=m.w=(X.right-X.left)/V,s.H=m.h=(X.bottom-X.top)/V,s.X=m.x,s.Y=m.y+s.H/2,("x"in i||"y"in i)&&(s.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));for(var Y=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,$=Y.length;Z<$;Z++)if(Y[Z]in i){s._.dirty=1;break}switch(m["text-anchor"]){case"start":s.textpath.style["v-text-align"]="left",s.bbx=s.W/2;break;case"end":s.textpath.style["v-text-align"]="right",s.bbx=-s.W/2;break;default:s.textpath.style["v-text-align"]="center",s.bbx=0}s.textpath.style["v-text-kern"]=!0}},C=function(b,f,g){b.attrs=b.attrs||{};var h=(b.attrs,Math.pow),i="linear",j=".5 .5";if(b.attrs.gradient=f,f=c(f).replace(a._radial_gradient,function(a,b,c){return i="radial",b&&c&&(b=d(b),c=d(c),h(b-.5,2)+h(c-.5,2)>.25&&(c=e.sqrt(.25-h(b-.5,2))*(2*(c>.5)-1)+.5),j=b+n+c),o}),f=f.split(/\s*\-\s*/),"linear"==i){var k=f.shift();if(k=-d(k),isNaN(k))return null}var l=a._parseDots(f);if(!l)return null;if(b=b.shape||b.node,l.length){b.removeChild(g),g.on=!0,g.method="none",g.color=l[0].color,g.color2=l[l.length-1].color;for(var m=[],p=0,q=l.length;p')}}catch(c){F=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},a._engine.initWin(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e=b.width,f=b.x,g=b.y;if(!c)throw new Error("VML container not found.");var h=new a._Paper,i=h.canvas=a._g.doc.createElement("div"),j=i.style;return f=f||0,g=g||0,e=e||512,d=d||342,h.width=e,h.height=d,e==+e&&(e+="px"),d==+d&&(d+="px"),h.coordsize=1e3*u+n+1e3*u,h.coordorigin="0 0",h.span=a._g.doc.createElement("span"),h.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",i.appendChild(h.span),j.cssText=a.format("top:0;left:0;display:inline-block;position:absolute;clip:rect(0 {0} {1} 0);",e,d),1==c?(a._g.doc.body.appendChild(i),j.left=f+"px",j.top=g+"px",j.position="absolute"):c.firstChild?c.insertBefore(i,c.firstChild):c.appendChild(i),h.renderfix=function(){},h},a.prototype.clear=function(){a.eve("raphael.clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]="function"==typeof this[b]?a._removedFactory(b):null;return!0};var G=a.st;for(var H in E)E[b](H)&&!G[b](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}}),function(a,b){if("function"==typeof define&&define.amd)define("raphael",["raphael.core","raphael.svg","raphael.vml"],function(a){return b(a)});else if("object"==typeof exports){var c=require("raphael.core");require("raphael.svg"),require("raphael.vml"),module.exports=b(c)}}(this,function(a){return a.ninja()}),BI.Svg=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Svg.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-svg"})},_init:function(){BI.Svg.superclass._init.apply(this,arguments),this.paper=Raphael(this.element[0]),this.element.css("overflow","hidden"),$(this.paper.canvas).width("100%").height("100%").css({left:"0",top:"0"}).appendTo(this.element),this.top=this.paper.top,this.bottom=this.paper.bottom,this.customAttributes=this.paper.customAttributes,this.ca=this.paper.ca,this.raphael=this.paper.raphael},add:function(){return this.paper.add.apply(this.paper,arguments)},path:function(){return this.paper.path.apply(this.paper,arguments)},image:function(){return this.paper.image.apply(this.paper,arguments)},rect:function(){return this.paper.rect.apply(this.paper,arguments)},circle:function(){return this.paper.circle.apply(this.paper,arguments)},ellipse:function(){return this.paper.ellipse.apply(this.paper,arguments)},text:function(){return this.paper.text.apply(this.paper,arguments)},print:function(){return this.paper.print.apply(this.paper,arguments)},setStart:function(){return this.paper.setStart.apply(this.paper,arguments)},setFinish:function(){return this.paper.setFinish.apply(this.paper,arguments)},setSize:function(){return this.paper.setSize.apply(this.paper,arguments)},setViewBox:function(){return this.paper.setViewBox.apply(this.paper,arguments)},getById:function(){return this.paper.getById.apply(this.paper,arguments)},getElementByPoint:function(){return this.paper.getElementByPoint.apply(this.paper,arguments)},getElementsByPoint:function(){return this.paper.getElementsByPoint.apply(this.paper,arguments)},getFont:function(){return this.paper.getFont.apply(this.paper,arguments)},set:function(){return this.paper.set.apply(this.paper,arguments)},remove:function(){return this.paper.remove.apply(this.paper,arguments)},clear:function(){return this.paper.clear.apply(this.paper,arguments)}}),BI.shortcut("bi.svg",BI.Svg),BI.NativeTableScrollbar=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.NativeTableScrollbar.superclass._defaultConfig.apply(this,arguments),{attributes:{tabIndex:0},contentSize:0,defaultPosition:0,position:0,size:0})},render:function(){var a=this;this.options;this.element.width(36);var b=BI.throttle(function(){a.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL,a.element.scrollTop())},150,{leading:!1});return this.element.scroll(function(){b()}),{type:"bi.default",scrolly:!0,items:[{type:"bi.layout",width:1,ref:function(b){a.inner=b}}]}},mounted:function(){this._populate()},_populate:function(){var a=this.options;if(a.size<1||a.contentSize<=a.size)return void this.setVisible(!1);this.setVisible(!0);try{this.element.scrollTop(a.position)}catch(b){}this.inner.element.height(a.contentSize)},setContentSize:function(a){this.options.contentSize=a},setPosition:function(a){this.options.position=a},setSize:function(a){this.setHeight(a),this.options.size=a},populate:function(){this._populate()}}),BI.NativeTableScrollbar.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.native_table_scrollbar",BI.NativeTableScrollbar),BI.NativeTableHorizontalScrollbar=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.NativeTableHorizontalScrollbar.superclass._defaultConfig.apply(this,arguments),{attributes:{tabIndex:0},contentSize:0,position:0,size:0})},render:function(){var a=this;this.options;this.element.height(36);var b=BI.throttle(function(){a.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL,a.element.scrollLeft())},150,{leading:!1});return this.element.scroll(function(){b()}),{type:"bi.default",scrollx:!0,items:[{type:"bi.layout",height:1,ref:function(b){a.inner=b}}]}},setContentSize:function(a){this.options.contentSize=a},setPosition:function(a){this.options.position=a},setSize:function(a){this.setWidth(a),this.options.size=a},_populate:function(){var a=this.options;if(a.size<1||a.contentSize<=a.size)return void this.setVisible(!1);this.setVisible(!0);try{this.element.scrollLeft(a.position)}catch(b){}this.inner.element.width(a.contentSize)},populate:function(){this._populate()}}),BI.NativeTableHorizontalScrollbar.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.native_table_horizontal_scrollbar",BI.NativeTableHorizontalScrollbar),BI.TableCell=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TableCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-cell",textAlign:"left",text:""})},_init:function(){BI.TableCell.superclass._init.apply(this,arguments),BI.createWidget({type:"bi.label",element:this,whiteSpace:"nowrap",textAlign:this.options.textAlign,height:this.options.height,text:this.options.text,value:this.options.value,lgap:5})}}),BI.shortcut("bi.table_cell",BI.TableCell),BI.CollectionTableCell=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionTableCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection-table-cell bi-border-right bi-border-bottom",width:0,height:0,_left:0,_top:0,cell:{}})},_init:function(){BI.CollectionTableCell.superclass._init.apply(this,arguments);var a=this.options;this.cell=BI.createWidget(BI.extend({type:"bi.label"},a.cell,{cls:(a.cell.cls||"")+" collection-table-cell-wrapper",width:a.width-(0===a._left?1:0)-1,height:a.height-(0===a._top?1:0)-1})),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.cell,left:0,right:0,top:0,bottom:0}]})},setWidth:function(a){BI.CollectionTableCell.superclass.setWidth.apply(this,arguments);var b=this.options;this.cell.setWidth(b.width-(0===b._left?1:0)-1)},setHeight:function(a){BI.CollectionTableCell.superclass.setHeight.apply(this,arguments);var b=this.options;this.cell.setHeight(b.height-(0===b._top?1:0)-1)}}),BI.shortcut("bi.collection_table_cell",BI.CollectionTableCell),BI.CollectionTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection-table",headerRowSize:25,rowSize:25,columnSize:[],isNeedFreeze:!1,freezeCols:[],isNeedMerge:!1,mergeCols:[],mergeRule:BI.emptyFn,header:[],items:[],regionColumnSize:[]})},render:function(){var a=this,b=this.options;this._width=0,this._height=0,this._scrollBarSize=BI.DOM.getScrollWidth(),this.topLeftCollection=BI.createWidget({type:"bi.collection_view",cellSizeAndPositionGetter:function(b){return a.topLeftItems[b]}}),this.topLeftCollection.on(BI.CollectionView.EVENT_SCROLL,function(b){a.bottomLeftCollection.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.topRightCollection=BI.createWidget({type:"bi.collection_view",cellSizeAndPositionGetter:function(b){return a.topRightItems[b]}}),this.topRightCollection.on(BI.CollectionView.EVENT_SCROLL,function(b){a.bottomRightCollection.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.bottomLeftCollection=BI.createWidget({type:"bi.collection_view",cellSizeAndPositionGetter:function(b){return a.bottomLeftItems[b]}}),this.bottomLeftCollection.on(BI.CollectionView.EVENT_SCROLL,function(b){a.bottomRightCollection.setScrollTop(b.scrollTop),a.topLeftCollection.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.bottomRightCollection=BI.createWidget({type:"bi.collection_view",cellSizeAndPositionGetter:function(b){return a.bottomRightItems[b]}}),this.bottomRightCollection.on(BI.CollectionView.EVENT_SCROLL,function(b){a.bottomLeftCollection.setScrollTop(b.scrollTop),a.topRightCollection.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.topLeft=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.topLeftCollection]}),this.topRight=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.topRightCollection]}),this.bottomLeft=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.bottomLeftCollection]}),this.bottomRight=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.bottomRightCollection]}),this.contextLayout=BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.topLeft,top:0,left:0},{el:this.topRight,top:0},{el:this.bottomLeft,left:0},{el:this.bottomRight}]}),this.topScrollbar=BI.createWidget({type:"bi.grid_table_scrollbar",width:BI.GridTableScrollbar.SIZE}),this.topScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL,function(b){a.bottomLeftCollection.setScrollTop(b),a.bottomRightCollection.setScrollTop(b),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.leftScrollbar=BI.createWidget({type:"bi.grid_table_horizontal_scrollbar",height:BI.GridTableScrollbar.SIZE}),this.leftScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL,function(b){a.topLeftCollection.setScrollLeft(b),a.bottomLeftCollection.setScrollLeft(b),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.rightScrollbar=BI.createWidget({type:"bi.grid_table_horizontal_scrollbar",height:BI.GridTableScrollbar.SIZE}),this.rightScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL,function(b){a.topRightCollection.setScrollLeft(b),a.bottomRightCollection.setScrollLeft(b),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.scrollBarLayout=BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.topScrollbar,right:0,top:0},{el:this.leftScrollbar,left:0},{el:this.rightScrollbar}]}),this._width=b.width-BI.GridTableScrollbar.SIZE,this._height=b.height-BI.GridTableScrollbar.SIZE},mounted:function(){var a=this.options;(a.items.length>0||a.header.length>0)&&(this._digest(),this._populate())},_getFreezeColLength:function(){return this.options.isNeedFreeze?this.options.freezeCols.length:0},_getFreezeHeaderHeight:function(){var a=this.options;return a.header.length*a.headerRowSize>=this._height?0:a.header.length*a.headerRowSize},_getActualItems:function(){var a=this.options;return a.header.length*a.headerRowSize>=this._height?a.header.concat(a.items):a.items},_populateScrollbar:function(){var a=this.options,b=this.getRegionSize(),c=0,d=0,e=0,f=[];BI.each(a.columnSize,function(b,g){a.isNeedFreeze===!0&&a.freezeCols.contains(b)?c+=g:d+=g,e+=g,0===b?f[b]=g:f[b]=f[b-1]+g}),this.topScrollbar.setContentSize(this._getActualItems().length*a.rowSize),this.topScrollbar.setSize(this._height-this._getFreezeHeaderHeight()),this.topScrollbar.setPosition(this.bottomRightCollection.getScrollTop()),this.topScrollbar.populate(),this.leftScrollbar.setContentSize(c),this.leftScrollbar.setSize(b),this.leftScrollbar.setPosition(this.bottomLeftCollection.getScrollLeft()),this.leftScrollbar.populate(),this.rightScrollbar.setContentSize(d),this.rightScrollbar.setSize(this._width-b),this.rightScrollbar.setPosition(this.bottomRightCollection.getScrollLeft()),this.rightScrollbar.populate();var g=this.scrollBarLayout.attr("items");g[0].top=this._getFreezeHeaderHeight(),g[1].top=this._height,g[2].top=this._height,g[2].left=b,this.scrollBarLayout.attr("items",g),this.scrollBarLayout.resize()},_populateTable:function(){var a=this.options,b=this.getRegionSize(),c=0,d=0,e=0,f=[];BI.each(a.columnSize,function(b,g){a.isNeedFreeze===!0&&a.freezeCols.contains(b)?c+=g:d+=g,e+=g,0===b?f[b]=g:f[b]=f[b-1]+g});var g=b,h=this._getFreezeHeaderHeight(),i=this._width-b,j=this._getFreezeHeaderHeight(),k=b,l=this._height-h,m=this._width-b,n=this._height-j,o=g+this._scrollBarSize,p=h+this._scrollBarSize,q=i+this._scrollBarSize,r=j+this._scrollBarSize,s=k+this._scrollBarSize,t=l+this._scrollBarSize,u=m+this._scrollBarSize,v=n+this._scrollBarSize,w=function(a){a.element.css({overflow:"scroll",overflowX:"scroll",overflowY:"scroll"})};this.topLeft.setWidth(g),this.topLeft.setHeight(h),this.topRight.setWidth(i),this.topRight.setHeight(j),this.bottomLeft.setWidth(k),this.bottomLeft.setHeight(l),this.bottomRight.setWidth(m),this.bottomRight.setHeight(n),this.topLeftCollection.setWidth(o),this.topLeftCollection.setHeight(p),this.topRightCollection.setWidth(q),this.topRightCollection.setHeight(r),this.bottomLeftCollection.setWidth(s),this.bottomLeftCollection.setHeight(t),this.bottomRightCollection.setWidth(u),this.bottomRightCollection.setHeight(v),w(this.topLeftCollection),w(this.topRightCollection),w(this.bottomLeftCollection),w(this.bottomRightCollection);var x=this.contextLayout.attr("items");x[1].left=b,x[2].top=this._getFreezeHeaderHeight(),x[3].left=b,x[3].top=this._getFreezeHeaderHeight(),this.contextLayout.attr("items",x),this.contextLayout.resize();var y=[],z=[],A=[],B=[],C=function(a,b,c){BI.each(a,function(a,d){var e={type:"bi.collection_table_cell",cell:b[d.row][d.col]};c.push(e)})};C(this.topLeftItems,a.header,y),C(this.topRightItems,a.header,z),C(this.bottomLeftItems,this._getActualItems(),A),C(this.bottomRightItems,this._getActualItems(),B),this.topLeftCollection._populate(y),this.topRightCollection._populate(z),this.bottomLeftCollection._populate(A),this.bottomRightCollection._populate(B)},_digest:function(){var a=this.options,b=this._getFreezeColLength();this._getFreezeHeaderHeight()<=0?(this.topLeftItems=[],this.topRightItems=[],this.bottomLeftItems=this._serialize(this._getActualItems(),0,b,a.rowSize,a.columnSize,a.mergeCols,BI.range(a.header.length)),this.bottomRightItems=this._serialize(this._getActualItems(),b,a.columnSize.length,a.rowSize,a.columnSize,a.mergeCols,BI.range(a.header.length))):(this.topLeftItems=this._serialize(a.header,0,b,a.headerRowSize,a.columnSize,a.mergeCols),this.topRightItems=this._serialize(a.header,b,a.columnSize.length,a.headerRowSize,a.columnSize,!0),this.bottomLeftItems=this._serialize(a.items,0,b,a.rowSize,a.columnSize,a.mergeCols),this.bottomRightItems=this._serialize(a.items,b,a.columnSize.length,a.rowSize,a.columnSize,a.mergeCols))},_serialize:function(a,b,c,d,e,f,g){f=f||[],g=g||[];for(var h=this.options,i=[],j={},k={},l={},m={},n=[],o=b;o-1||g===!0||g.indexOf(a)>-1)if(0===a&&e===b)r(0,b);else if(e===b&&a>0){var i=h.mergeRule(j[a][e],j[a-1][e]);i===!0?(p(a,e),l[a]=k[e]):r(a,e)}else if(0===a&&e>b){var n=h.mergeRule(j[a][e],j[a][e-1]);n===!0?(q(a,e),k[e]=l[a]):r(a,e)}else{var i=h.mergeRule(j[a][e],j[a-1][e]),n=h.mergeRule(j[a][e],j[a][e-1]);if(n&&i)continue;n&&q(a,e),i&&p(a,e),n||i||r(a,e)}else r(a,e)}),BI.map(i,function(a,b){return{x:b.x,y:b.y,row:b.item._row,col:b.item._col,width:b.item._width,height:b.item._height}})},_populate:function(){this._width<=0||this._height<=0||(this._isNeedDigest===!0&&this._digest(),this._isNeedDigest=!1,this._populateTable(),this._populateScrollbar())},getRegionSize:function(){var a=this.options,b=a.regionColumnSize[0]||0;return a.isNeedFreeze===!1||0===a.freezeCols.length?0:(b||BI.each(a.freezeCols,function(c,d){b+=a.columnSize[d]}),b)},setVerticalScroll:function(a){this.bottomLeftCollection.setScrollTop(a),this.bottomRightCollection.setScrollTop(a)},setLeftHorizontalScroll:function(a){this.topLeftCollection.setScrollLeft(a),this.bottomLeftCollection.setScrollLeft(a)},setRightHorizontalScroll:function(a){this.topRightCollection.setScrollLeft(a),this.bottomRightCollection.setScrollLeft(a)},getVerticalScroll:function(){return this.bottomRightCollection.getScrollTop()},getLeftHorizontalScroll:function(){return this.bottomLeftCollection.getScrollLeft()},getRightHorizontalScroll:function(){return this.bottomRightCollection.getScrollLeft()},setWidth:function(a){BI.CollectionTable.superclass.setWidth.apply(this,arguments),this._width=this.options.width-BI.GridTableScrollbar.SIZE},setHeight:function(a){BI.CollectionTable.superclass.setHeight.apply(this,arguments),this._height=this.options.height-BI.GridTableScrollbar.SIZE},setColumnSize:function(a){ this._isNeedDigest=!0,this.options.columnSize=a},setRegionColumnSize:function(a){this._isNeedDigest=!0,this.options.regionColumnSize=a},getColumnSize:function(){return this.options.columnSize},getRegionColumnSize:function(){return this.options.regionColumnSize},populate:function(a,b){a&&a!==this.options.items&&(this._isNeedDigest=!0,this.options.items=a,this._restore()),b&&b!==this.options.header&&(this._isNeedDigest=!0,this.options.header=b,this._restore()),this._populate()},_restore:function(){this.topLeftCollection.restore(),this.topRightCollection.restore(),this.bottomLeftCollection.restore(),this.bottomRightCollection.restore()},restore:function(){this._restore()}}),BI.shortcut("bi.collection_table",BI.CollectionTable),BI.QuickCollectionTable=BI.inherit(BI.CollectionTable,{_defaultConfig:function(){return BI.extend(BI.QuickCollectionTable.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-quick-collection-table"})},render:function(){BI.QuickCollectionTable.superclass.render.apply(this,arguments);this.options;this.topLeftCollection.setOverflowX(!1),this.topLeftCollection.setOverflowY(!1),this.topRightCollection.setOverflowX(!1),this.topRightCollection.setOverflowY(!1),this.bottomLeftCollection.setOverflowX(!1),this.bottomLeftCollection.setOverflowY(!1),this.bottomRightCollection.setOverflowX(!1),this.bottomRightCollection.setOverflowY(!1)},mounted:function(){BI.QuickCollectionTable.superclass.mounted.apply(this,arguments);var a=this;this._topLeftWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelLeft,this),BI.bind(this._shouldHandleLeftX,this),BI.bind(this._shouldHandleY,this)),this._topRightWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelRight,this),BI.bind(this._shouldHandleRightX,this),BI.bind(this._shouldHandleY,this)),this._bottomLeftWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelLeft,this),BI.bind(this._shouldHandleLeftX,this),BI.bind(this._shouldHandleY,this)),this._bottomRightWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelRight,this),BI.bind(this._shouldHandleRightX,this),BI.bind(this._shouldHandleY,this)),this.topLeftCollection.element.mousewheel(function(b){a._topLeftWheelHandler.onWheel(b.originalEvent)}),this.topRightCollection.element.mousewheel(function(b){a._topRightWheelHandler.onWheel(b.originalEvent)}),this.bottomLeftCollection.element.mousewheel(function(b){a._bottomLeftWheelHandler.onWheel(b.originalEvent)}),this.bottomRightCollection.element.mousewheel(function(b){a._bottomRightWheelHandler.onWheel(b.originalEvent)})},_shouldHandleLeftX:function(a){return a>0?this.bottomLeftCollection.getScrollLeft()0},_shouldHandleRightX:function(a){return a>0?this.bottomRightCollection.getScrollLeft()0},_shouldHandleY:function(a){return a>0?this.bottomRightCollection.getScrollTop()0},_onWheelLeft:function(a,b){var c=this,d=this.bottomLeftCollection.getScrollTop(),e=this.bottomLeftCollection.getScrollLeft();d+=b,e+=a,this.bottomLeftCollection.setScrollTop(d),this.bottomRightCollection.setScrollTop(d),this.topLeftCollection.setScrollLeft(e),this.bottomLeftCollection.setScrollLeft(e),c._populateScrollbar(),this.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)},_onWheelRight:function(a,b){var c=this,d=this.bottomRightCollection.getScrollTop(),e=this.bottomRightCollection.getScrollLeft();d+=b,e+=a,this.bottomLeftCollection.setScrollTop(d),this.bottomRightCollection.setScrollTop(d),this.topRightCollection.setScrollLeft(e),this.bottomRightCollection.setScrollLeft(e),c._populateScrollbar(),this.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)},_populateTable:function(){var a=this.options,b=this.getRegionSize(),c=0,d=0,e=0,f=[];BI.each(a.columnSize,function(b,g){a.isNeedFreeze===!0&&a.freezeCols.contains(b)?c+=g:d+=g,e+=g,0===b?f[b]=g:f[b]=f[b-1]+g});var g=b,h=this._getFreezeHeaderHeight(),i=this._width-b,j=this._getFreezeHeaderHeight(),k=b,l=this._height-h,m=this._width-b,n=this._height-j;this.topLeft.setWidth(g),this.topLeft.setHeight(h),this.topRight.setWidth(i),this.topRight.setHeight(j),this.bottomLeft.setWidth(k),this.bottomLeft.setHeight(l),this.bottomRight.setWidth(m),this.bottomRight.setHeight(n),this.topLeftCollection.setWidth(g),this.topLeftCollection.setHeight(h),this.topRightCollection.setWidth(i),this.topRightCollection.setHeight(j),this.bottomLeftCollection.setWidth(k),this.bottomLeftCollection.setHeight(l),this.bottomRightCollection.setWidth(m),this.bottomRightCollection.setHeight(n);var o=this.contextLayout.attr("items");o[1].left=b,o[2].top=this._getFreezeHeaderHeight(),o[3].left=b,o[3].top=this._getFreezeHeaderHeight(),this.contextLayout.attr("items",o),this.contextLayout.resize();var p=[],q=[],r=[],s=[],t=function(a,b,c){BI.each(a,function(a,d){var e={type:"bi.collection_table_cell",cell:b[d.row][d.col]};c.push(e)})};t(this.topLeftItems,a.header,p),t(this.topRightItems,a.header,q),t(this.bottomLeftItems,this._getActualItems(),r),t(this.bottomRightItems,this._getActualItems(),s),this.topLeftCollection.populate(p),this.topRightCollection.populate(q),this.bottomLeftCollection.populate(r),this.bottomRightCollection.populate(s)}}),BI.shortcut("bi.quick_collection_table",BI.QuickCollectionTable),BI.GridTableCell=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.GridTableCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-grid-table-cell bi-border-right bi-border-bottom",width:0,height:0,_rowIndex:0,_columnIndex:0,_left:0,_top:0,cell:{}})},_init:function(){BI.GridTableCell.superclass._init.apply(this,arguments);var a=this.options;this.cell=BI.createWidget(BI.extend({type:"bi.label"},a.cell,{cls:(a.cell.cls||"")+"grid-table-cell-wrapper",width:a.width-(0===a._columnIndex?1:0)-1,height:a.height-(0===a._rowIndex?1:0)-1})),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.cell,left:0,right:0,top:0,bottom:0}]})},setWidth:function(a){BI.GridTableCell.superclass.setWidth.apply(this,arguments);var b=this.options;this.cell.setWidth(b.width-(0===b._columnIndex?1:0)-1)},setHeight:function(a){BI.GridTableCell.superclass.setHeight.apply(this,arguments);var b=this.options;this.cell.setHeight(b.height-(0===b._rowIndex?1:0)-1)}}),BI.shortcut("bi.grid_table_cell",BI.GridTableCell),BI.GridTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.GridTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-grid-table",headerRowSize:25,rowSize:25,columnSize:[],isNeedFreeze:!1,freezeCols:[],header:[],items:[],regionColumnSize:[]})},render:function(){var a=this,b=this.options;this._width=0,this._height=0,this._scrollBarSize=BI.DOM.getScrollWidth();var c=function(){return b.rowSize},d=function(a){return b.columnSize[a]},e=function(c){return b.columnSize[c+a._getFreezeColLength()]};this.topLeftGrid=BI.createWidget({type:"bi.grid_view",rowHeightGetter:c,columnWidthGetter:d}),this.topLeftGrid.on(BI.GridView.EVENT_SCROLL,function(b){a.bottomLeftGrid.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.topRightGrid=BI.createWidget({type:"bi.grid_view",rowHeightGetter:c,columnWidthGetter:e}),this.topRightGrid.on(BI.GridView.EVENT_SCROLL,function(b){a.bottomRightGrid.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.bottomLeftGrid=BI.createWidget({type:"bi.grid_view",rowHeightGetter:c,columnWidthGetter:d}),this.bottomLeftGrid.on(BI.GridView.EVENT_SCROLL,function(b){a.bottomRightGrid.setScrollTop(b.scrollTop),a.topLeftGrid.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.bottomRightGrid=BI.createWidget({type:"bi.grid_view",rowHeightGetter:c,columnWidthGetter:e}),this.bottomRightGrid.on(BI.GridView.EVENT_SCROLL,function(b){a.bottomLeftGrid.setScrollTop(b.scrollTop),a.topRightGrid.setScrollLeft(b.scrollLeft),a._populateScrollbar(),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.topLeft=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.topLeftGrid]}),this.topRight=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.topRightGrid]}),this.bottomLeft=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.bottomLeftGrid]}),this.bottomRight=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.bottomRightGrid]}),this.contextLayout=BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.topLeft,top:0,left:0},{el:this.topRight,top:0},{el:this.bottomLeft,left:0},{el:this.bottomRight}]}),this.topScrollbar=BI.createWidget({type:"bi.grid_table_scrollbar",width:BI.GridTableScrollbar.SIZE}),this.topScrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL,function(b){a.bottomLeftGrid.setScrollTop(b),a.bottomRightGrid.setScrollTop(b),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.leftScrollbar=BI.createWidget({type:"bi.grid_table_horizontal_scrollbar",height:BI.GridTableScrollbar.SIZE}),this.leftScrollbar.on(BI.GridTableHorizontalScrollbar.EVENT_SCROLL,function(b){a.topLeftGrid.setScrollLeft(b),a.bottomLeftGrid.setScrollLeft(b),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.rightScrollbar=BI.createWidget({type:"bi.grid_table_horizontal_scrollbar",height:BI.GridTableScrollbar.SIZE}),this.rightScrollbar.on(BI.GridTableHorizontalScrollbar.EVENT_SCROLL,function(b){a.topRightGrid.setScrollLeft(b),a.bottomRightGrid.setScrollLeft(b),a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.scrollBarLayout=BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.topScrollbar,right:0,top:0},{el:this.leftScrollbar,left:0},{el:this.rightScrollbar}]}),this._width=b.width-BI.GridTableScrollbar.SIZE,this._height=b.height-BI.GridTableScrollbar.SIZE,this.header=this._getHeader(),this.items=this._getItems()},mounted:function(){var a=this.options;(a.items.length>0||a.header.length>0)&&this._populate()},_getFreezeColLength:function(){return this.options.isNeedFreeze?this.options.freezeCols.length:0},_getFreezeHeaderHeight:function(){var a=this.options;return a.header.length*a.headerRowSize>=this._height?0:a.header.length*a.headerRowSize},_getActualItems:function(){var a=this.options;return a.header.length*a.headerRowSize>=this._height?a.header.concat(a.items):a.items},_populateScrollbar:function(){var a=this.options,b=this.getRegionSize(),c=0,d=0,e=0,f=[];BI.each(a.columnSize,function(b,g){a.isNeedFreeze===!0&&a.freezeCols.contains(b)?c+=g:d+=g,e+=g,0===b?f[b]=g:f[b]=f[b-1]+g}),this.topScrollbar.setContentSize(this._getActualItems().length*a.rowSize),this.topScrollbar.setSize(this._height-this._getFreezeHeaderHeight()),this.topScrollbar.setPosition(Math.min(this.bottomLeftGrid.getScrollTop(),this.bottomRightGrid.getScrollTop())),this.topScrollbar.populate(),this.leftScrollbar.setContentSize(c),this.leftScrollbar.setSize(b),this.leftScrollbar.setPosition(this.bottomLeftGrid.getScrollLeft()),this.leftScrollbar.populate(),this.rightScrollbar.setContentSize(d),this.rightScrollbar.setSize(this._width-b),this.rightScrollbar.setPosition(this.bottomRightGrid.getScrollLeft()),this.rightScrollbar.populate();var g=this.scrollBarLayout.attr("items");g[0].top=this._getFreezeHeaderHeight(),g[1].top=this._height,g[2].top=this._height,g[2].left=b,this.scrollBarLayout.attr("items",g),this.scrollBarLayout.resize()},_getHeader:function(){var a=this.options,b=this._getFreezeColLength(),c=[],d=[];return BI.each(a.header,function(a,e){c[a]=[],d[a]=[],BI.each(e,function(e,f){var g={type:"bi.grid_table_cell",cell:f};e0?c/g:0),this.topLeftGrid.setEstimatedRowSize(a.headerRowSize),this.topRightGrid.setEstimatedColumnSize(a.columnSize.length-g>0?d/(a.columnSize.length-g):0),this.topRightGrid.setEstimatedRowSize(a.headerRowSize),this.bottomLeftGrid.setEstimatedColumnSize(g>0?c/g:0),this.bottomLeftGrid.setEstimatedRowSize(a.rowSize),this.bottomRightGrid.setEstimatedColumnSize(a.columnSize.length-g>0?d/(a.columnSize.length-g):0),this.bottomRightGrid.setEstimatedRowSize(a.rowSize);var y=this.contextLayout.attr("items");y[1].left=b,y[2].top=this._getFreezeHeaderHeight(),y[3].left=b,y[3].top=this._getFreezeHeaderHeight(),this.contextLayout.attr("items",y),this.contextLayout.resize(),this.topLeftGrid._populate(this.header[0]),this.topRightGrid._populate(this.header[1]),this.bottomLeftGrid._populate(this.items[0]),this.bottomRightGrid._populate(this.items[1])},_populate:function(){this._width<=0||this._height<=0||(this._populateTable(),this._populateScrollbar())},getRegionSize:function(){var a=this.options,b=a.regionColumnSize[0]||0;return a.isNeedFreeze===!1||0===a.freezeCols.length?0:(b||BI.each(a.freezeCols,function(c,d){b+=a.columnSize[d]}),b)},setVerticalScroll:function(a){this.bottomLeftGrid.setScrollTop(a),this.bottomRightGrid.setScrollTop(a)},setLeftHorizontalScroll:function(a){this.topLeftGrid.setScrollLeft(a),this.bottomLeftGrid.setScrollLeft(a)},setRightHorizontalScroll:function(a){this.topRightGrid.setScrollLeft(a),this.bottomRightGrid.setScrollLeft(a)},getVerticalScroll:function(){return this.bottomRightGrid.getScrollTop()},getLeftHorizontalScroll:function(){return this.bottomLeftGrid.getScrollLeft()},getRightHorizontalScroll:function(){return this.bottomRightGrid.getScrollLeft()},setWidth:function(a){BI.GridTable.superclass.setWidth.apply(this,arguments),this._width=this.options.width-BI.GridTableScrollbar.SIZE},setHeight:function(a){BI.GridTable.superclass.setHeight.apply(this,arguments),this._height=this.options.height-BI.GridTableScrollbar.SIZE},setColumnSize:function(a){this.options.columnSize=a,this._isNeedDigest=!0},setRegionColumnSize:function(a){this.options.regionColumnSize=a,this._isNeedDigest=!0},getColumnSize:function(){return this.options.columnSize},getRegionColumnSize:function(){return this.options.regionColumnSize},populate:function(a,b){a&&this.options.items!==a&&(this.options.items=a,this.items=this._getItems(),this._restore()),b&&this.options.header!==b&&(this.options.header=b,this.header=this._getHeader(),this._restore()),this._populate()},_restore:function(){this.topLeftGrid.restore(),this.topRightGrid.restore(),this.bottomLeftGrid.restore(),this.bottomRightGrid.restore()},restore:function(){this._restore()}}),BI.shortcut("bi.grid_table",BI.GridTable),BI.QuickGridTable=BI.inherit(BI.GridTable,{_defaultConfig:function(){return BI.extend(BI.QuickGridTable.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-quick-grid-table"})},render:function(){BI.QuickGridTable.superclass.render.apply(this,arguments);this.options;this.topLeftGrid.setOverflowX(!1),this.topLeftGrid.setOverflowY(!1),this.topRightGrid.setOverflowX(!1),this.topRightGrid.setOverflowY(!1),this.bottomLeftGrid.setOverflowX(!1),this.bottomLeftGrid.setOverflowY(!1),this.bottomRightGrid.setOverflowX(!1),this.bottomRightGrid.setOverflowY(!1)},mounted:function(){BI.QuickGridTable.superclass.mounted.apply(this,arguments);var a=this;this._topLeftWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelLeft,this),BI.bind(this._shouldHandleLeftX,this),BI.bind(this._shouldHandleY,this)),this._topRightWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelRight,this),BI.bind(this._shouldHandleRightX,this),BI.bind(this._shouldHandleY,this)),this._bottomLeftWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelLeft,this),BI.bind(this._shouldHandleLeftX,this),BI.bind(this._shouldHandleY,this)),this._bottomRightWheelHandler=new BI.WheelHandler(BI.bind(this._onWheelRight,this),BI.bind(this._shouldHandleRightX,this),BI.bind(this._shouldHandleY,this)),this.topLeftGrid.element.mousewheel(function(b){a._topLeftWheelHandler.onWheel(b.originalEvent)}),this.topRightGrid.element.mousewheel(function(b){a._topRightWheelHandler.onWheel(b.originalEvent)}),this.bottomLeftGrid.element.mousewheel(function(b){a._bottomLeftWheelHandler.onWheel(b.originalEvent)}),this.bottomRightGrid.element.mousewheel(function(b){a._bottomRightWheelHandler.onWheel(b.originalEvent)})},_shouldHandleLeftX:function(a){return a>0?this.bottomLeftGrid.getScrollLeft()0},_shouldHandleRightX:function(a){return a>0?this.bottomRightGrid.getScrollLeft()0},_shouldHandleY:function(a){return a>0?this.bottomRightGrid.getScrollTop()0},_onWheelLeft:function(a,b){var c=this,d=this.bottomLeftGrid.getScrollTop(),e=this.bottomLeftGrid.getScrollLeft();d+=b,e+=a,this.bottomLeftGrid.setScrollTop(d),this.bottomRightGrid.setScrollTop(d),this.topLeftGrid.setScrollLeft(e),this.bottomLeftGrid.setScrollLeft(e),c._populateScrollbar(),this.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)},_onWheelRight:function(a,b){var c=this,d=this.bottomRightGrid.getScrollTop(),e=this.bottomRightGrid.getScrollLeft();d+=b,e+=a,this.bottomLeftGrid.setScrollTop(d),this.bottomRightGrid.setScrollTop(d),this.topRightGrid.setScrollLeft(e),this.bottomRightGrid.setScrollLeft(e),c._populateScrollbar(),this.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)},_populateTable:function(){var a=this.options,b=this.getRegionSize(),c=0,d=0,e=0,f=[],g=this._getFreezeColLength();BI.each(a.columnSize,function(b,g){a.isNeedFreeze===!0&&a.freezeCols.contains(b)?c+=g:d+=g,e+=g,0===b?f[b]=g:f[b]=f[b-1]+g});var h=b,i=this._getFreezeHeaderHeight(),j=this._width-b,k=this._getFreezeHeaderHeight(),l=b,m=this._height-i,n=this._width-b,o=this._height-k;this.topLeft.setWidth(h),this.topLeft.setHeight(i),this.topRight.setWidth(j),this.topRight.setHeight(k),this.bottomLeft.setWidth(l),this.bottomLeft.setHeight(m),this.bottomRight.setWidth(n),this.bottomRight.setHeight(o),this.topLeftGrid.setWidth(h),this.topLeftGrid.setHeight(i),this.topRightGrid.setWidth(j),this.topRightGrid.setHeight(k),this.bottomLeftGrid.setWidth(l),this.bottomLeftGrid.setHeight(m),this.bottomRightGrid.setWidth(n),this.bottomRightGrid.setHeight(o),this.topLeftGrid.setEstimatedColumnSize(g>0?c/g:0),this.topLeftGrid.setEstimatedRowSize(a.headerRowSize),this.topRightGrid.setEstimatedColumnSize(a.columnSize.length-g>0?d/(a.columnSize.length-g):0),this.topRightGrid.setEstimatedRowSize(a.headerRowSize),this.bottomLeftGrid.setEstimatedColumnSize(g>0?c/g:0),this.bottomLeftGrid.setEstimatedRowSize(a.rowSize),this.bottomRightGrid.setEstimatedColumnSize(a.columnSize.length-g>0?d/(a.columnSize.length-g):0),this.bottomRightGrid.setEstimatedRowSize(a.rowSize);var p=this.contextLayout.attr("items");p[1].left=b,p[2].top=this._getFreezeHeaderHeight(),p[3].left=b,p[3].top=this._getFreezeHeaderHeight(),this.contextLayout.attr("items",p),this.contextLayout.resize();var q=[],r=[],s=[],t=[];BI.each(a.header,function(a,b){q[a]=[],r[a]=[],BI.each(b,function(b,c){var d={type:"bi.grid_table_cell",cell:c};bb&&(this.options.position=b),this._populate(),this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL,this.options.position)},_onMouseDown:function(a){if(a.target!==this.face.element[0]){var b=this._isHorizontal()?a.offsetX:a.offsetY;b/=this._getScale(),this.options.position=BI.clamp(b-.5*this._getFaceSize()/this._getScale(),0,this.options.contentSize-this.options.size),this._populate(),this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL,this.options.position)}else this._mouseMoveTracker.captureMouseMoves(a);try{this.element[0].focus()}catch(a){}},_onMouseMove:function(a,b){var c=this._isHorizontal()?a:b;c/=this._getScale(),this.options.position=BI.clamp(this.options.position+c,0,this.options.contentSize-this.options.size),this.isDragging=this._mouseMoveTracker.isDragging(),this._populate(),this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL,this.options.position)},_onMouseMoveEnd:function(a){this._mouseMoveTracker.releaseMouseMoves(),this.isDragging===!0&&(this.isDragging=!1,this._populate())},_onKeyDown:function(a){var b={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105},c=a.keyCode;if(c!==b.TAB){var d=40,e=0;if(this._isHorizontal())switch(c){case b.HOME:e=-1,d=this.options.contentSize;break;case b.LEFT:e=-1;break;case b.RIGHT:e=1;break;default:return}if(!this._isHorizontal())switch(c){case b.SPACE:e=a.shiftKey?-1:1;break;case b.HOME:e=-1,d=this.options.contentSize;break;case b.UP:e=-1;break;case b.DOWN:e=1;break;case b.PAGE_UP:e=-1,d=this.options.size;break;case b.PAGE_DOWN:e=1,d=this.options.size;break;default:return}this.options.position=BI.clamp(this.options.position+d*e,0,this.options.contentSize-this.options.size),a.preventDefault(),this._populate(),this.fireEvent(BI.GridTableScrollbar.EVENT_SCROLL,this.options.position)}},_populate:function(){var a=this.options;if(a.size<1||a.contentSize<=a.size)return void this.setVisible(!1);this.setVisible(!0);var b=a.size,c=this._isHorizontal(),d=this.focused||this.isDragging,e=this._getFaceSize(),f=a.isOpaque;this.element[f===!0?"addClass":"removeClass"]("public-scrollbar-main-opaque"),this.element[d===!0?"addClass":"removeClass"]("public-scrollbar-main-active"),this.face.element[d===!0?"addClass":"removeClass"]("public-scrollbar-face-active");var g=a.position*this._getScale()+this._const.FACE_MARGIN,h=this.contextLayout.attr("items");c?(this.setWidth(b),this.face.setWidth(e-this._const.FACE_MARGIN_2),h[0].left=g,h[0].top=0):(this.setHeight(b),this.face.setHeight(e-this._const.FACE_MARGIN_2),h[0].left=0,h[0].top=g),this.contextLayout.attr("items",h),this.contextLayout.resize()},setContentSize:function(a){this.options.contentSize=a},setPosition:function(a){this.options.position=a},setSize:function(a){this.options.size=a},populate:function(){this._populate()}}),BI.GridTableScrollbar.SIZE=10,BI.GridTableScrollbar.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.grid_table_scrollbar",BI.GridTableScrollbar),BI.GridTableHorizontalScrollbar=BI.inherit(BI.Widget,{_const:{FACE_MARGIN:4,FACE_MARGIN_2:8,FACE_SIZE_MIN:30,KEYBOARD_SCROLL_AMOUNT:40},_defaultConfig:function(){return BI.extend(BI.GridTableHorizontalScrollbar.superclass._defaultConfig.apply(this,arguments),{attributes:{tabIndex:0},contentSize:0,position:0,size:0})},_init:function(){BI.GridTableHorizontalScrollbar.superclass._init.apply(this,arguments);var a=this,b=this.options;this.scrollbar=BI.createWidget({type:"bi.grid_table_scrollbar",orientation:"horizontal",isOpaque:!0,position:b.position,contentSize:b.contentSize,size:b.size}),this.scrollbar.on(BI.GridTableScrollbar.EVENT_SCROLL,function(){a.fireEvent(BI.GridTableHorizontalScrollbar.EVENT_SCROLL,arguments)}),BI.createWidget({type:"bi.absolute",cls:"horizontal-scrollbar",element:this,width:b.size,height:BI.GridTableScrollbar.SIZE,items:[{el:{type:"bi.absolute",scrollable:!1,height:BI.GridTableScrollbar.SIZE,items:[{el:this.scrollbar,left:0,top:0}]},top:0,left:0,right:0}]})},setContentSize:function(a){this.options.contentSize=a,this.scrollbar.setContentSize(a)},setPosition:function(a){this.options.position=a,this.scrollbar.setPosition(a)},setSize:function(a){this.setWidth(a),this.options.size=a,this.scrollbar.setSize(a)},populate:function(){this.scrollbar.populate();var a=this.options;return a.size<1||a.contentSize<=a.size?void this.setVisible(!1):void this.setVisible(!0)}}),BI.GridTableHorizontalScrollbar.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.grid_table_horizontal_scrollbar",BI.GridTableHorizontalScrollbar),BI.TableHeaderCell=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TableHeaderCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-header-cell",text:""})},_init:function(){BI.TableHeaderCell.superclass._init.apply(this,arguments),BI.createWidget({type:"bi.label",element:this,textAlign:"center",height:this.options.height,text:this.options.text,value:this.options.value})}}),BI.shortcut("bi.table_header_cell",BI.TableHeaderCell),BI.Table=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Table.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table",logic:{dynamic:!1},isNeedFreeze:!1,freezeCols:[],isNeedMerge:!1,mergeCols:[],mergeRule:function(a,b){return BI.isEqual(a,b)},columnSize:[],headerRowSize:25,footerRowSize:25,rowSize:25,regionColumnSize:!1,header:[],footer:!1,items:[]})},_calculateWidth:function(a){return a&&"0"!==a?(a=BI.parseFloat(a),a<0&&(a=0),a>1.01?a:100*a+"%"):""},_calculateHeight:function(a){return a?a:""},_isRightFreeze:function(){return BI.isNotEmptyArray(this.options.freezeCols)&&0!==BI.first(this.options.freezeCols)},_createTopLeft:function(){var a=this.options,b=this._isRightFreeze();this.topLeftColGroupTds={},this.topLeftBodyTds={},this.topLeftBodyItems={};var c=this._table(),d=this._createColGroup(this.columnLeft,this.topLeftColGroupTds),e=this.topLeftBody=this._body();if(e.element.append(this._createHeaderCells(this.topLeftItems,this.columnLeft,this.mergeLeft,this.topLeftBodyTds,this.topLeftBodyItems)),BI.createWidget({type:"bi.adaptive",element:c,items:[d,e]}),b){var f=0;BI.each(a.columnSize,function(b,c){a.freezeCols.contains(b)||(f+=c)}),BI.isNumeric(f)&&f>1&&(f=BI.parseFloat(f)+a.columnSize.length-a.freezeCols.length)}return this.topLeftContainer=BI.createWidget({type:"bi.adaptive",width:this._calculateWidth(f),items:[c]})},_createTopRight:function(){var a=this.options,b=this._isRightFreeze();this.topRightColGroupTds={},this.topRightBodyTds={},this.topRightBodyItems={};var c=this._table(),d=this._createColGroup(this.columnRight,this.topRightColGroupTds),e=this.topRightBody=this._body();if(e.element.append(this._createHeaderCells(this.topRightItems,this.columnRight,this.mergeRight,this.topRightBodyTds,this.topRightBodyItems,this.columnLeft.length)),BI.createWidget({type:"bi.adaptive",element:c,items:[d,e]}),!b){var f=0;BI.each(a.columnSize,function(b,c){a.freezeCols.contains(b)||(f+=c)}),BI.isNumeric(f)&&(f=BI.parseFloat(f)+a.columnSize.length-a.freezeCols.length)}return this.topRightContainer=BI.createWidget({type:"bi.adaptive",width:f||void 0,items:[c]})},_createBottomLeft:function(){var a=this.options,b=this._isRightFreeze();this.bottomLeftColGroupTds={},this.bottomLeftBodyTds={},this.bottomLeftBodyItems={};var c=this._table(),d=this._createColGroup(this.columnLeft,this.bottomLeftColGroupTds),e=this._createBottomLeftBody();if(BI.createWidget({type:"bi.adaptive",element:c,items:[d,e]}),b){var f=0;BI.each(a.columnSize,function(b,c){a.freezeCols.contains(b)||(f+=c)}),BI.isNumeric(f)&&f>1&&(f=BI.parseFloat(f)+a.columnSize.length-a.freezeCols.length)}return this.bottomLeftContainer=BI.createWidget({type:"bi.adaptive",width:this._calculateWidth(f),items:[c]})},_createBottomLeftBody:function(){var a=this.bottomLeftBody=this._body();return a.element.append(this._createCells(this.bottomLeftItems,this.columnLeft,this.mergeLeft,this.bottomLeftBodyTds,this.bottomLeftBodyItems)),a},_createBottomRight:function(){var a=this.options,b=this._isRightFreeze();this.bottomRightColGroupTds={},this.bottomRightBodyTds={},this.bottomRightBodyItems={};var c=this._table(),d=this._createColGroup(this.columnRight,this.bottomRightColGroupTds),e=this._createBottomRightBody();if(BI.createWidget({type:"bi.adaptive",element:c,items:[d,e]}),!b){var f=0;BI.each(a.columnSize,function(b,c){a.freezeCols.contains(b)||(f+=c)}),BI.isNumeric(f)&&f>1&&(f=BI.parseFloat(f)+a.columnSize.length-a.freezeCols.length)}return this.bottomRightContainer=BI.createWidget({ -type:"bi.adaptive",width:this._calculateWidth(f),items:[c]})},_createBottomRightBody:function(){var a=this.bottomRightBody=this._body();return a.element.append(this._createCells(this.bottomRightItems,this.columnRight,this.mergeRight,this.bottomRightBodyTds,this.bottomRightBodyItems,this.columnLeft.length)),a},_createFreezeTable:function(){var a=this,b=this.options,c=this._isRightFreeze(),d=this._split(b.header);this.topLeftItems=d.left,this.topRightItems=d.right,d=this._split(b.items),this.bottomLeftItems=d.left,this.bottomRightItems=d.right,this.columnLeft=[],this.columnRight=[],BI.each(b.columnSize,function(d,e){b.freezeCols.contains(d)?a[c?"columnRight":"columnLeft"].push(e):a[c?"columnLeft":"columnRight"].push(e)}),this.mergeLeft=[],this.mergeRight=[],BI.each(b.mergeCols,function(d,e){b.freezeCols.contains(e)?a[c?"mergeRight":"mergeLeft"].push(e):a[c?"mergeLeft":"mergeRight"].push(e)});var e=this._createTopLeft(),f=this._createTopRight(),g=this._createBottomLeft(),h=this._createBottomRight();this.scrollTopLeft=BI.createWidget({type:"bi.adaptive",cls:"scroll-top-left",width:"100%",height:"100%",scrollable:!1,items:[e]}),this.scrollTopRight=BI.createWidget({type:"bi.adaptive",cls:"scroll-top-right",width:"100%",height:"100%",scrollable:!1,items:[f]}),this.scrollBottomLeft=BI.createWidget({type:"bi.adaptive",cls:"scroll-bottom-left",width:"100%",height:"100%",scrollable:c||null,scrollx:!c,items:[g]}),this.scrollBottomRight=BI.createWidget({type:"bi.adaptive",cls:"scroll-bottom-right",width:"100%",height:"100%",scrollable:!c||null,scrollx:c,items:[h]}),this.topLeft=BI.createWidget({type:"bi.adaptive",cls:"top-left",scrollable:!1,items:[this.scrollTopLeft]}),this.topRight=BI.createWidget({type:"bi.adaptive",cls:"top-right",scrollable:!1,items:[this.scrollTopRight]}),this.bottomLeft=BI.createWidget({type:"bi.adaptive",cls:"bottom-left",items:[this.scrollBottomLeft]}),this.bottomRight=BI.createWidget({type:"bi.adaptive",cls:"bottom-right",scrollable:!1,items:[this.scrollBottomRight]});var i=b.header.length*((b.headerRowSize||b.rowSize)+1)+1,j=BI.sum(b.freezeCols,function(a,c){return b.columnSize[c]>1?b.columnSize[c]+1:b.columnSize[c]});this._resize=function(){a.scrollBottomLeft.element.is(":visible")&&(a.scrollBottomLeft.element.css({"overflow-x":"auto"}),a.scrollBottomRight.element.css({"overflow-x":"auto"}),a.setColumnSize(b.columnSize),c?a.scrollBottomLeft.element.css({"overflow-y":"auto"}):a.scrollBottomRight.element.css({"overflow-y":"auto"}),(a.scrollBottomLeft.element.hasHorizonScroll()||a.scrollBottomRight.element.hasHorizonScroll())&&(a.scrollBottomLeft.element.css("overflow-x","scroll"),a.scrollBottomRight.element.css("overflow-x","scroll")),a.scrollBottomRight.element.hasVerticalScroll()?a.scrollTopRight.element.css("overflow-y","scroll"):a.scrollTopRight.element.css("overflow-y","hidden"),a.scrollBottomLeft.element.hasVerticalScroll()?a.scrollTopLeft.element.css("overflow-y","scroll"):a.scrollTopLeft.element.css("overflow-y","hidden"),a.scrollTopLeft.element[0].scrollLeft=a.scrollBottomLeft.element[0].scrollLeft,a.scrollTopRight.element[0].scrollLeft=a.scrollBottomRight.element[0].scrollLeft,a.scrollBottomLeft.element[0].scrollTop=a.scrollBottomRight.element[0].scrollTop)};var k=b.regionColumnSize;0===b.freezeCols.length?k=c?["fill",0]:[0,"fill"]:b.freezeCols.length>=b.columnSize.length&&(k=c?[0,"fill"]:["fill",0]),this.partitions=BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("table",BI.extend({},b.logic,{rows:2,columns:2,columnSize:k||(c?["fill",j]:[j,"fill"]),rowSize:[i,"fill"],items:[[{el:this.topLeft},{el:this.topRight}],[{el:this.bottomLeft},{el:this.bottomRight}]]})))),this._initFreezeScroll(),BI.nextTick(function(){a.element.is(":visible")&&(a._resize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT))}),BI.ResizeDetector.addResizeListener(this,function(){a._resize(),a.fireEvent(BI.Table.EVENT_TABLE_RESIZE)})},_initFreezeScroll:function(){function a(a,c,d){a.scroll(function(e){d.scrollTop(a.scrollTop()),c.scrollLeft(a.scrollLeft()),b.fireEvent(BI.Table.EVENT_TABLE_SCROLL)})}var b=this;this.options;a(this.scrollBottomRight.element,this.scrollTopRight.element,this.scrollBottomLeft.element)},resize:function(){this._resize&&this._resize()},_createCells:function(a,b,c,d,e,f,g){var h=this,i=this.options,j={},k={},l={},m={},n={};b=b||i.columnSize,c=c||i.mergeCols,d=d||{},e=e||{},f=f||0,g||(g=i.rowSize);var o=document.createDocumentFragment();return BI.each(a,function(a,p){function q(a,b){var c=(0|j[b].attr("height"))+g+1;j[b].attr("height",c).css("height",c);var f=(0|(j[b].attr("rowspan")||1))+1;j[b].attr("rowspan",f),j[b].__mergeRows.pushDistinct(a),d[a][b]=j[b],e[a][b]=m[b]}function r(a,c){if(b[c]){var f=0|k[a].attr("width");f>1.05&&b[c]?(f=f+b[c]+1,c===b.length-1&&f--):f+=b[c],f=h._calculateWidth(f),k[a].attr("width",f).css("width",f),l[a].element.width(f)}var g=(0|(k[a].attr("colspan")||1))+1;k[a].attr("colspan",g),k[a].__mergeCols.pushDistinct(c),d[a][c]=k[a],e[a][c]=l[a]}function s(a,c){var i=h._calculateWidth(b[c]);i>1.05&&c===b.length-1&&i--;var o=h._calculateHeight(g),q=$("").attr("height",o).attr("width",i).css({width:i,height:o,position:"relative"}).addClass(0===(1&c)?"odd-col":"even-col").addClass(0===a?"first-row":"").addClass(0===c?"first-col":"").addClass(c===p.length-1?"last-col":""),r=BI.createWidget(n[a][c],{type:"bi.table_cell",textAlign:"left",width:BI.isNumeric(i)?i:"",height:BI.isNumeric(o)?o:"",_row:a,_col:c+f});h.addWidget(r.getName(),r),r._mount(),r.element.css("position","relative"),q.append(r.element),t.append(q),j[c]=q,j[c].__mergeRows=[a],m[c]=r,k[a]=q,k[a].__mergeCols=[c],l[a]=r,d[a][c]=q,e[a][c]=r}var t=$("").addClass(0===(1&a)?"odd":"even");BI.each(p,function(b,f){if(n[a]||(n[a]={}),d[a]||(d[a]={}),e[a]||(e[a]={}),n[a][b]=f,i.isNeedMerge&&c.contains(b))if(0===a&&0===b)s(0,0);else if(0===b&&a>0){var g=i.mergeRule(n[a][b],n[a-1][b]);g===!0?(q(a,b),k[a]=j[b],l[a]=m[b]):s(a,b)}else if(0===a&&b>0){var h=i.mergeRule(n[a][b],n[a][b-1]);h===!0?(r(a,b),j[b]=k[a],m[b]=l[a]):s(a,b)}else{var g=i.mergeRule(n[a][b],n[a-1][b]),h=i.mergeRule(n[a][b],n[a][b-1]);if(h&&g)return;h&&r(a,b),g&&q(a,b),h||g||s(a,b)}else s(a,b)}),o.appendChild(t[0])}),o},_createColGroupCells:function(a,b){var c=this,d=this.options;a=a||d.columnSize,b=b||{};var e=document.createDocumentFragment();return BI.each(a,function(a,d){var f=c._calculateWidth(d),g=$("").attr("width",f).css("width",f);b[a]=g,e.appendChild(g[0])}),e},_createHeaderCells:function(a,b,c,d,e,f){var g=this.options;f||(f=0);var h=this._createCells(a,b,BI.range(g.columnSize.length),d,e,f,g.headerRowSize||g.rowSize);return h},_createFooterCells:function(a,b,c,d){var e=(this.options,this._createCells(a,b,[],c,d,0));return e},_createColGroup:function(a,b,c){this.options;return this.colgroup=this._colgroup(),this.colgroup.element.append(this._createColGroupCells(a,b,c)),this.colgroup},_createHeader:function(){var a=this.options;if(a.header!==!1)return this.header=this._header(),this.header.element.append(this._createHeaderCells(a.header,null,null,this.headerTds,this.headerItems)),this.header},_createFooter:function(a,b,c){var d=this.options;if(d.footer!==!1)return this.footer=this._footer(),this.footer.element.append(this._createFooterCells(d.footer,null,this.footerTds,this.footerItems)),this.footer},_createBody:function(){var a=this.options;return this.body=this._body(),this.body.element.append(this._createCells(a.items,null,null,this.bodyTds,this.bodyItems)),this.body},_createNormalTable:function(){var a=this,b=this.options,c=this._table();this.colgroupTds={},this.headerTds={},this.footerTds={},this.bodyTds={},this.headerItems={},this.footerItems={},this.bodyItems={};var d=this._createColGroup(null,this.colgroupTds),e=this._createHeader(),f=this._createFooter(),g=this._createBody();BI.createWidget({type:"bi.adaptive",element:c,items:[d,e,f,g]});var h=BI.sum(this.options.columnSize)||void 0;h=this._calculateWidth(h),BI.isNumeric(h)&&h>1&&(h+=b.columnSize.length),this.tableContainer=BI.createWidget({type:"bi.adaptive",width:this._calculateWidth(h),items:[c]}),this.scrollBottomRight=BI.createWidget({type:"bi.adaptive",width:"100%",height:"100%",cls:"scroll-bottom-right",scrollable:!0,items:[this.tableContainer]}),BI.createWidget({type:"bi.adaptive",cls:"bottom-right",element:this,scrollable:!1,items:[this.scrollBottomRight]}),this._initNormalScroll(),BI.nextTick(function(){a.element.is(":visible")&&a.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT)})},_initNormalScroll:function(){var a=this;this.scrollBottomRight.element.scroll(function(b){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL)})},_split:function(a){var b=this.options,c=[],d=[],e=this._isRightFreeze();return BI.each(a,function(a,f){c.push([]),d.push([]),BI.each(f,function(f,g){b.freezeCols.contains(f)?(e?d:c)[a].push(g):(e?c:d)[a].push(g)})}),{left:c,right:d}},_table:function(){return BI.createWidget({type:"bi.layout",tagName:"table",cls:"table",attribute:{cellspacing:0,cellpadding:0}})},_header:function(){return BI.createWidget({type:"bi.layout",cls:"header",tagName:"thead"})},_footer:function(){return BI.createWidget({type:"bi.layout",cls:"footer",tagName:"tfoot"})},_body:function(){return BI.createWidget({type:"bi.layout",tagName:"tbody",cls:"body"})},_colgroup:function(){return BI.createWidget({type:"bi.layout",tagName:"colgroup"})},_init:function(){BI.Table.superclass._init.apply(this,arguments),this.populate(this.options.items)},setColumnSize:function(a){var b=this,c=this.options,d=this._isRightFreeze();if(c.columnSize=a||[],c.isNeedFreeze){var e=[],f=[];BI.each(c.columnSize,function(a,b){c.freezeCols.contains(a)?d?f.push(b):e.push(b):d?e.push(b):f.push(b)});var g=0,h=1,i=2,j=3,k=function(a){var c,d,k,l;switch(a){case g:c=b.topLeftColGroupTds,d=b.topLeftBodyTds,k=b.topLeftBodyItems,l=e;break;case h:c=b.topRightColGroupTds,d=b.topRightBodyTds,k=b.topRightBodyItems,l=f;break;case i:c=b.bottomLeftColGroupTds,d=b.bottomLeftBodyTds,k=b.bottomLeftBodyItems,l=e;break;case j:c=b.bottomRightColGroupTds,d=b.bottomRightBodyTds,k=b.bottomRightBodyItems,l=f}BI.each(c,function(a,c){var e=0|c.attr("width");if(""!==l[a]&&e!==l[a]){var f=b._calculateWidth(l[a]);c.attr("width",f).css("width",f),BI.each(d,function(c,d){if(d[a])if(d[a].__mergeCols.length>1){var e=0;BI.each(l,function(b,c){d[a].__mergeCols.contains(b)&&(e+=c)}),e=b._calculateWidth(e),e>1&&(e+=d[a].__mergeCols.length-1),BI.isNumeric(e)?a==BI.size(d)-1?d[a].attr("width",e-1).css("width",e-1):d[a].attr("width",e).css("width",e):d[a].attr("width","").css("width","")}else a==BI.size(d)-1?d[a].attr("width",f-1).css("width",f-1):d[a].attr("width",f).css("width",f)}),BI.each(k,function(c,e){if(e[a])if(d[c][a].__mergeCols.length>1){var g=0;BI.each(l,function(b,e){d[c][a].__mergeCols.contains(b)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=d[c][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")})}})};k(g),k(h),k(i),k(j);var l=0,m=0;this.columnLeft=[],this.columnRight=[],BI.each(c.columnSize,function(a,e){c.freezeCols.contains(a)?(l+=e,b[d?"columnRight":"columnLeft"].push(e)):(m+=e,b[d?"columnLeft":"columnRight"].push(e))}),l=this._calculateWidth(l),m=this._calculateWidth(m),BI.isNumeric(l)&&(l=BI.parseFloat(l)+c.freezeCols.length),BI.isNumeric(m)&&(m=BI.parseFloat(m)+c.columnSize.length-c.freezeCols.length),this.topLeftContainer.element.width(d?m:l),this.bottomLeftContainer.element.width(d?m:l),this.topRightContainer.element.width(d?l:m),this.bottomRightContainer.element.width(d?l:m),this.scrollTopLeft.element[0].scrollLeft=this.scrollBottomLeft.element[0].scrollLeft,this.scrollTopRight.element[0].scrollLeft=this.scrollBottomRight.element[0].scrollLeft}else{BI.each(this.colgroupTds,function(a,d){var e=0|d.attr("width");if(""!==c.columnSize[a]&&e!==c.columnSize[a]){var f=b._calculateWidth(c.columnSize[a]);d.attr("width",f).css("width",f),BI.each(b.bodyTds,function(d,e){if(e[a])if(e[a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(b,c){e[a].__mergeCols.contains(b)&&(g+=c)}),g=b._calculateWidth(g),g>1&&(g+=e[a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f):e[a].attr("width","").css("width","")}else a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f)}),BI.each(b.headerTds,function(d,e){if(e[a])if(e[a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(b,c){e[a].__mergeCols.contains(b)&&(g+=c)}),g=b._calculateWidth(g),g>1&&(g+=e[a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f):e[a].attr("width","").css("width","")}else a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f)}),BI.each(b.footerTds,function(d,e){if(e[a])if(e[a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(b,c){e[a].__mergeCols.contains(b)&&(g+=c)}),g=b._calculateWidth(g),g>1&&(g+=e[a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f):e[a].attr("width","").css("width","")}else a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f)}),BI.each(b.bodyItems,function(d,e){if(e[a])if(b.bodyTds[d][a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(c,e){b.bodyTds[d][a].__mergeCols.contains(c)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.bodyTds[d][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")}),BI.each(b.headerItems,function(d,e){if(e[a])if(b.headerTds[d][a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(c,e){b.headerTds[d][a].__mergeCols.contains(c)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.headerTds[d][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")}),BI.each(b.footerItems,function(d,e){if(e[a])if(b.footerTds[d][a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(c,e){b.footerTds[d][a].__mergeCols.contains(c)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.footerTds[d][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")})}});var n=this._calculateWidth(BI.sum(c.columnSize));n>1.05&&(n+=c.columnSize.length),n>1.05&&this.tableContainer.element.width(n)}},getColumnSize:function(){return this.options.columnSize},getCalculateColumnSize:function(){var a=this,b=this.options,c=[];if(b.isNeedFreeze===!0){if(BI.size(this.bottomLeftBodyTds)>0||BI.size(this.bottomRightBodyTds)>0)return BI.any(this.bottomLeftBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.bottomLeftBodyTds[0],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.bottomLeftBodyTds[0])-1&&e++,c.push(e)}),BI.any(this.bottomRightBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.bottomRightBodyTds[0],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.bottomRightBodyTds[0])-1&&e++,c.push(e)}),c;BI.any(this.topLeftBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.topLeftBodyTds[BI.size(this.topLeftBodyTds)-1],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.topLeftBodyTds[BI.size(a.topLeftBodyTds)-1])-1&&e++,c.push(e)}),BI.any(this.topRightBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.topRightBodyTds[BI.size(this.topRightBodyTds)-1],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.topRightBodyTds[BI.size(a.topRightBodyTds)-1])-1&&e++,c.push(e)})}else BI.each(this.headerTds[BI.size(this.headerTds)-1],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.headerTds[BI.size(a.headerTds)-1])-1&&e++,c.push(e)});return c},setHeaderColumnSize:function(a){var b=this,c=this.options,d=this._isRightFreeze();if(c.isNeedFreeze){var e=[],f=[];BI.each(a,function(a,b){c.freezeCols.contains(a)?d?f.push(b):e.push(b):d?e.push(b):f.push(b)});var g=0,h=1,i=function(a){var c,d,i,j;switch(a){case g:c=b.topLeftColGroupTds,d=b.topLeftBodyTds,i=b.topLeftBodyItems,j=e;break;case h:c=b.topRightColGroupTds,d=b.topRightBodyTds,i=b.topRightBodyItems,j=f}BI.each(c,function(a,c){var e=0|c.attr("width");if(e!==j[a]){var f=b._calculateWidth(j[a]);c.attr("width",f).css("width",f),BI.each(d,function(c,d){if(d[a])if(d[a].__mergeCols.length>1){var e=0;BI.each(j,function(b,c){d[a].__mergeCols.contains(b)&&(e+=c)}),e=b._calculateWidth(e),e>1&&(e+=d[a].__mergeCols.length-1),BI.isNumeric(e)?a==BI.size(d)-1?d[a].attr("width",e-1).css("width",e-1):d[a].attr("width",e).css("width",e):d[a].attr("width","").css("width","")}else a==BI.size(d)-1?d[a].attr("width",f-1).css("width",f-1):d[a].attr("width",f).css("width",f)}),BI.each(i,function(c,e){if(e[a])if(d[c][a].__mergeCols.length>1){var g=0;BI.each(j,function(b,e){d[c][a].__mergeCols.contains(b)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=d[c][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")})}})};i(g),i(h);var j=0,k=0;BI.each(a,function(a,b){c.freezeCols.contains(a)?j+=b:k+=b}),j=this._calculateWidth(j),k=this._calculateWidth(k),BI.isNumeric(j)&&(j=BI.parseFloat(j)+c.freezeCols.length),BI.isNumeric(k)&&(k=BI.parseFloat(k)+a.length-c.freezeCols.length),this.topLeftContainer.element.width(d?k:j),this.topRightContainer.element.width(d?j:k),this.scrollTopLeft.element[0].scrollLeft=this.scrollBottomLeft.element[0].scrollLeft,this.scrollTopRight.element[0].scrollLeft=this.scrollBottomRight.element[0].scrollLeft}else{BI.each(this.colgroupTds,function(c,d){var e=0|d.attr("width");if(e!==a[c]){var f=b._calculateWidth(a[c]);d.attr("width",f).css("width",f),BI.each(b.headerTds,function(d,e){if(e[c])if(e[c].__mergeCols.length>1){var g=0;BI.each(a,function(a,b){e[c].__mergeCols.contains(a)&&(g+=b)}),g=b._calculateWidth(g),g>1&&(g+=e[c].__mergeCols.length-1),BI.isNumeric(g)?c==BI.size(e)-1?e[c].element.attr("width",g-1).css("width",g-1):e[c].element.attr("width",g).css("width",g):e[c].attr("width","").css("width","")}else c==BI.size(e)-1?e[c].attr("width",f-1).css("width",f-1):e[c].attr("width",f).css("width",f)}),BI.each(b.headerItems,function(d,e){if(e[c])if(b.headerTds[d][c].__mergeCols.length>1){var g=0;BI.each(a,function(a,e){b.headerTds[d][c].__mergeCols.contains(a)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.headerTds[d][c].__mergeCols.length-1),BI.isNumeric(g)?c==BI.size(e)-1?e[c].element.attr("width",g-1).css("width",g-1):e[c].element.attr("width",g).css("width",g):e[c].element.attr("width","").css("width","")}else BI.isNumeric(f)?c==BI.size(e)-1?e[c].element.attr("width",f-1).css("width",f-1):e[c].element.attr("width",f).css("width",f):e[c].element.attr("width","").css("width","")})}});var l=this._calculateWidth(BI.sum(a));l>1.05&&(l+=a.length),this.tableContainer.element.width(l)}},setRegionColumnSize:function(a){var b=this.options;b.regionColumnSize=a,0===b.freezeCols.length?b.isNeedFreeze?(this.partitions.attr("columnSize",this._isRightFreeze()?["fill",0]:[0,"fill"]),this.partitions.resize()):this.tableContainer.element.width(a[0]):b.freezeCols.length>0&&b.freezeCols.length=d?d:0;e=d?(b+=this.table.getRegionSize(),b-=this.table.getRightHorizontalScroll()):b-=this.table.getLeftHorizontalScroll(),b},_formatHeader:function(a){var b=this,c=this.options,d=[],e=function(a,d){b.resizer.setVisible(!0);var e=c.headerRowSize+b._getRegionRowSize()[1];b.resizer.setHeight(e),b._setResizerPosition(b._getResizerLeft(a)+d,(c.header.length-1)*c.headerRowSize)},f=function(a,d){b.resizer.setVisible(!1);var e=c.columnSize.slice();e[a]=d,c.columnSize=e,b.table.setColumnSize(e),b._populate(),b.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE)};return BI.each(a,function(g,h){g===a.length-1?(d[g]=[],BI.each(h,function(a,i){if(a===b._getFreezeColLength()-1||a===h.length-1)d[g][a]=i;else if(d[g][a]={type:"bi.resizable_table_cell",cell:i,suitableSize:c.minColumnSize[a],maxSize:c.maxColumnSize[a],resize:BI.bind(e,null,a),stop:BI.bind(f,null,a)},c.isNeedMerge)for(var j=g;j>0&&b._mergeRule(d[j][a],d[j-1][a]);)d[j-1][a]={type:"bi.resizable_table_cell",cell:d[j-1][a],suitableSize:c.minColumnSize[a],maxSize:c.maxColumnSize[a],resize:BI.bind(e,null,a),stop:BI.bind(f,null,a)},j--})):d.push(h)}),d},_populate:function(){var a=(this.options,this._getRegionSize());a>0?(this.regionResizerHandler.setVisible(!0), +type:"bi.adaptive",width:this._calculateWidth(f),items:[c]})},_createBottomRightBody:function(){var a=this.bottomRightBody=this._body();return a.element.append(this._createCells(this.bottomRightItems,this.columnRight,this.mergeRight,this.bottomRightBodyTds,this.bottomRightBodyItems,this.columnLeft.length)),a},_createFreezeTable:function(){var a=this,b=this.options,c=this._isRightFreeze(),d=this._split(b.header);this.topLeftItems=d.left,this.topRightItems=d.right,d=this._split(b.items),this.bottomLeftItems=d.left,this.bottomRightItems=d.right,this.columnLeft=[],this.columnRight=[],BI.each(b.columnSize,function(d,e){b.freezeCols.contains(d)?a[c?"columnRight":"columnLeft"].push(e):a[c?"columnLeft":"columnRight"].push(e)}),this.mergeLeft=[],this.mergeRight=[],BI.each(b.mergeCols,function(d,e){b.freezeCols.contains(e)?a[c?"mergeRight":"mergeLeft"].push(e):a[c?"mergeLeft":"mergeRight"].push(e)});var e=this._createTopLeft(),f=this._createTopRight(),g=this._createBottomLeft(),h=this._createBottomRight();this.scrollTopLeft=BI.createWidget({type:"bi.adaptive",cls:"scroll-top-left",width:"100%",height:"100%",scrollable:!1,items:[e]}),this.scrollTopRight=BI.createWidget({type:"bi.adaptive",cls:"scroll-top-right",width:"100%",height:"100%",scrollable:!1,items:[f]}),this.scrollBottomLeft=BI.createWidget({type:"bi.adaptive",cls:"scroll-bottom-left",width:"100%",height:"100%",scrollable:c||null,scrollx:!c,items:[g]}),this.scrollBottomRight=BI.createWidget({type:"bi.adaptive",cls:"scroll-bottom-right",width:"100%",height:"100%",scrollable:!c||null,scrollx:c,items:[h]}),this.topLeft=BI.createWidget({type:"bi.adaptive",cls:"top-left",scrollable:!1,items:[this.scrollTopLeft]}),this.topRight=BI.createWidget({type:"bi.adaptive",cls:"top-right",scrollable:!1,items:[this.scrollTopRight]}),this.bottomLeft=BI.createWidget({type:"bi.adaptive",cls:"bottom-left",items:[this.scrollBottomLeft]}),this.bottomRight=BI.createWidget({type:"bi.adaptive",cls:"bottom-right",scrollable:!1,items:[this.scrollBottomRight]});var i=b.header.length*((b.headerRowSize||b.rowSize)+1)+1,j=BI.sum(b.freezeCols,function(a,c){return b.columnSize[c]>1?b.columnSize[c]+1:b.columnSize[c]});this._resize=function(){a.scrollBottomLeft.element.is(":visible")&&(a.scrollBottomLeft.element.css({"overflow-x":"auto"}),a.scrollBottomRight.element.css({"overflow-x":"auto"}),a.setColumnSize(b.columnSize),c?a.scrollBottomLeft.element.css({"overflow-y":"auto"}):a.scrollBottomRight.element.css({"overflow-y":"auto"}),(a.scrollBottomLeft.element.hasHorizonScroll()||a.scrollBottomRight.element.hasHorizonScroll())&&(a.scrollBottomLeft.element.css("overflow-x","scroll"),a.scrollBottomRight.element.css("overflow-x","scroll")),a.scrollBottomRight.element.hasVerticalScroll()?a.scrollTopRight.element.css("overflow-y","scroll"):a.scrollTopRight.element.css("overflow-y","hidden"),a.scrollBottomLeft.element.hasVerticalScroll()?a.scrollTopLeft.element.css("overflow-y","scroll"):a.scrollTopLeft.element.css("overflow-y","hidden"),a.scrollTopLeft.element[0].scrollLeft=a.scrollBottomLeft.element[0].scrollLeft,a.scrollTopRight.element[0].scrollLeft=a.scrollBottomRight.element[0].scrollLeft,a.scrollBottomLeft.element[0].scrollTop=a.scrollBottomRight.element[0].scrollTop)};var k=b.regionColumnSize;0===b.freezeCols.length?k=c?["fill",0]:[0,"fill"]:b.freezeCols.length>=b.columnSize.length&&(k=c?[0,"fill"]:["fill",0]),this.partitions=BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("table",BI.extend({},b.logic,{rows:2,columns:2,columnSize:k||(c?["fill",j]:[j,"fill"]),rowSize:[i,"fill"],items:[[{el:this.topLeft},{el:this.topRight}],[{el:this.bottomLeft},{el:this.bottomRight}]]})))),this._initFreezeScroll(),BI.ResizeDetector.addResizeListener(this,function(){a._resize(),a.fireEvent(BI.Table.EVENT_TABLE_RESIZE)})},mounted:function(){this._resize(),this.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT)},_initFreezeScroll:function(){function a(a,c,d){a.scroll(function(e){d.scrollTop(a.scrollTop()),c.scrollLeft(a.scrollLeft()),b.fireEvent(BI.Table.EVENT_TABLE_SCROLL)})}var b=this;this.options;a(this.scrollBottomRight.element,this.scrollTopRight.element,this.scrollBottomLeft.element)},resize:function(){this._resize&&this._resize()},_createCells:function(a,b,c,d,e,f,g){var h=this,i=this.options,j={},k={},l={},m={},n={};b=b||i.columnSize,c=c||i.mergeCols,d=d||{},e=e||{},f=f||0,g||(g=i.rowSize);var o=document.createDocumentFragment();return BI.each(a,function(a,p){function q(a,b){var c=(0|j[b].attr("height"))+g+1;j[b].attr("height",c).css("height",c);var f=(0|(j[b].attr("rowspan")||1))+1;j[b].attr("rowspan",f),j[b].__mergeRows.pushDistinct(a),d[a][b]=j[b],e[a][b]=m[b]}function r(a,c){if(b[c]){var f=0|k[a].attr("width");f>1.05&&b[c]?(f=f+b[c]+1,c===b.length-1&&f--):f+=b[c],f=h._calculateWidth(f),k[a].attr("width",f).css("width",f),l[a].element.width(f)}var g=(0|(k[a].attr("colspan")||1))+1;k[a].attr("colspan",g),k[a].__mergeCols.pushDistinct(c),d[a][c]=k[a],e[a][c]=l[a]}function s(a,c){var i=h._calculateWidth(b[c]);i>1.05&&c===b.length-1&&i--;var o=h._calculateHeight(g),q=$("").attr("height",o).attr("width",i).css({width:i,height:o,position:"relative"}).addClass(0===(1&c)?"odd-col":"even-col").addClass(0===a?"first-row":"").addClass(0===c?"first-col":"").addClass(c===p.length-1?"last-col":""),r=BI.createWidget(n[a][c],{type:"bi.table_cell",textAlign:"left",width:BI.isNumeric(i)?i:"",height:BI.isNumeric(o)?o:"",_row:a,_col:c+f});h.addWidget(r.getName(),r),r._mount(),r.element.css("position","relative"),q.append(r.element),t.append(q),j[c]=q,j[c].__mergeRows=[a],m[c]=r,k[a]=q,k[a].__mergeCols=[c],l[a]=r,d[a][c]=q,e[a][c]=r}var t=$("").addClass(0===(1&a)?"odd":"even");BI.each(p,function(b,f){if(n[a]||(n[a]={}),d[a]||(d[a]={}),e[a]||(e[a]={}),n[a][b]=f,i.isNeedMerge&&c.contains(b))if(0===a&&0===b)s(0,0);else if(0===b&&a>0){var g=i.mergeRule(n[a][b],n[a-1][b]);g===!0?(q(a,b),k[a]=j[b],l[a]=m[b]):s(a,b)}else if(0===a&&b>0){var h=i.mergeRule(n[a][b],n[a][b-1]);h===!0?(r(a,b),j[b]=k[a],m[b]=l[a]):s(a,b)}else{var g=i.mergeRule(n[a][b],n[a-1][b]),h=i.mergeRule(n[a][b],n[a][b-1]);if(h&&g)return;h&&r(a,b),g&&q(a,b),h||g||s(a,b)}else s(a,b)}),o.appendChild(t[0])}),o},_createColGroupCells:function(a,b){var c=this,d=this.options;a=a||d.columnSize,b=b||{};var e=document.createDocumentFragment();return BI.each(a,function(a,d){var f=c._calculateWidth(d),g=$("").attr("width",f).css("width",f);b[a]=g,e.appendChild(g[0])}),e},_createHeaderCells:function(a,b,c,d,e,f){var g=this.options;f||(f=0);var h=this._createCells(a,b,BI.range(g.columnSize.length),d,e,f,g.headerRowSize||g.rowSize);return h},_createFooterCells:function(a,b,c,d){var e=(this.options,this._createCells(a,b,[],c,d,0));return e},_createColGroup:function(a,b,c){this.options;return this.colgroup=this._colgroup(),this.colgroup.element.append(this._createColGroupCells(a,b,c)),this.colgroup},_createHeader:function(){var a=this.options;if(a.header!==!1)return this.header=this._header(),this.header.element.append(this._createHeaderCells(a.header,null,null,this.headerTds,this.headerItems)),this.header},_createFooter:function(a,b,c){var d=this.options;if(d.footer!==!1)return this.footer=this._footer(),this.footer.element.append(this._createFooterCells(d.footer,null,this.footerTds,this.footerItems)),this.footer},_createBody:function(){var a=this.options;return this.body=this._body(),this.body.element.append(this._createCells(a.items,null,null,this.bodyTds,this.bodyItems)),this.body},_createNormalTable:function(){var a=this,b=this.options,c=this._table();this.colgroupTds={},this.headerTds={},this.footerTds={},this.bodyTds={},this.headerItems={},this.footerItems={},this.bodyItems={};var d=this._createColGroup(null,this.colgroupTds),e=this._createHeader(),f=this._createFooter(),g=this._createBody();BI.createWidget({type:"bi.adaptive",element:c,items:[d,e,f,g]});var h=BI.sum(this.options.columnSize)||void 0;h=this._calculateWidth(h),BI.isNumeric(h)&&h>1&&(h+=b.columnSize.length),this.tableContainer=BI.createWidget({type:"bi.adaptive",width:this._calculateWidth(h),items:[c]}),this.scrollBottomRight=BI.createWidget({type:"bi.adaptive",width:"100%",height:"100%",cls:"scroll-bottom-right",scrollable:!0,items:[this.tableContainer]}),BI.createWidget({type:"bi.adaptive",cls:"bottom-right",element:this,scrollable:!1,items:[this.scrollBottomRight]}),this._initNormalScroll(),BI.nextTick(function(){a.element.is(":visible")&&a.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT)})},_initNormalScroll:function(){var a=this;this.scrollBottomRight.element.scroll(function(b){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL)})},_split:function(a){var b=this.options,c=[],d=[],e=this._isRightFreeze();return BI.each(a,function(a,f){c.push([]),d.push([]),BI.each(f,function(f,g){b.freezeCols.contains(f)?(e?d:c)[a].push(g):(e?c:d)[a].push(g)})}),{left:c,right:d}},_table:function(){return BI.createWidget({type:"bi.layout",tagName:"table",cls:"table",attribute:{cellspacing:0,cellpadding:0}})},_header:function(){return BI.createWidget({type:"bi.layout",cls:"header",tagName:"thead"})},_footer:function(){return BI.createWidget({type:"bi.layout",cls:"footer",tagName:"tfoot"})},_body:function(){return BI.createWidget({type:"bi.layout",tagName:"tbody",cls:"body"})},_colgroup:function(){return BI.createWidget({type:"bi.layout",tagName:"colgroup"})},_init:function(){BI.Table.superclass._init.apply(this,arguments),this.populate(this.options.items)},setColumnSize:function(a){var b=this,c=this.options,d=this._isRightFreeze();if(c.columnSize=a||[],c.isNeedFreeze){var e=[],f=[];BI.each(c.columnSize,function(a,b){c.freezeCols.contains(a)?d?f.push(b):e.push(b):d?e.push(b):f.push(b)});var g=0,h=1,i=2,j=3,k=function(a){var c,d,k,l;switch(a){case g:c=b.topLeftColGroupTds,d=b.topLeftBodyTds,k=b.topLeftBodyItems,l=e;break;case h:c=b.topRightColGroupTds,d=b.topRightBodyTds,k=b.topRightBodyItems,l=f;break;case i:c=b.bottomLeftColGroupTds,d=b.bottomLeftBodyTds,k=b.bottomLeftBodyItems,l=e;break;case j:c=b.bottomRightColGroupTds,d=b.bottomRightBodyTds,k=b.bottomRightBodyItems,l=f}BI.each(c,function(a,c){var e=0|c.attr("width");if(""!==l[a]&&e!==l[a]){var f=b._calculateWidth(l[a]);c.attr("width",f).css("width",f),BI.each(d,function(c,d){if(d[a])if(d[a].__mergeCols.length>1){var e=0;BI.each(l,function(b,c){d[a].__mergeCols.contains(b)&&(e+=c)}),e=b._calculateWidth(e),e>1&&(e+=d[a].__mergeCols.length-1),BI.isNumeric(e)?a==BI.size(d)-1?d[a].attr("width",e-1).css("width",e-1):d[a].attr("width",e).css("width",e):d[a].attr("width","").css("width","")}else a==BI.size(d)-1?d[a].attr("width",f-1).css("width",f-1):d[a].attr("width",f).css("width",f)}),BI.each(k,function(c,e){if(e[a])if(d[c][a].__mergeCols.length>1){var g=0;BI.each(l,function(b,e){d[c][a].__mergeCols.contains(b)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=d[c][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")})}})};k(g),k(h),k(i),k(j);var l=0,m=0;this.columnLeft=[],this.columnRight=[],BI.each(c.columnSize,function(a,e){c.freezeCols.contains(a)?(l+=e,b[d?"columnRight":"columnLeft"].push(e)):(m+=e,b[d?"columnLeft":"columnRight"].push(e))}),l=this._calculateWidth(l),m=this._calculateWidth(m),BI.isNumeric(l)&&(l=BI.parseFloat(l)+c.freezeCols.length),BI.isNumeric(m)&&(m=BI.parseFloat(m)+c.columnSize.length-c.freezeCols.length),this.topLeftContainer.element.width(d?m:l),this.bottomLeftContainer.element.width(d?m:l),this.topRightContainer.element.width(d?l:m),this.bottomRightContainer.element.width(d?l:m),this.scrollTopLeft.element[0].scrollLeft=this.scrollBottomLeft.element[0].scrollLeft,this.scrollTopRight.element[0].scrollLeft=this.scrollBottomRight.element[0].scrollLeft}else{BI.each(this.colgroupTds,function(a,d){var e=0|d.attr("width");if(""!==c.columnSize[a]&&e!==c.columnSize[a]){var f=b._calculateWidth(c.columnSize[a]);d.attr("width",f).css("width",f),BI.each(b.bodyTds,function(d,e){if(e[a])if(e[a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(b,c){e[a].__mergeCols.contains(b)&&(g+=c)}),g=b._calculateWidth(g),g>1&&(g+=e[a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f):e[a].attr("width","").css("width","")}else a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f)}),BI.each(b.headerTds,function(d,e){if(e[a])if(e[a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(b,c){e[a].__mergeCols.contains(b)&&(g+=c)}),g=b._calculateWidth(g),g>1&&(g+=e[a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f):e[a].attr("width","").css("width","")}else a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f)}),BI.each(b.footerTds,function(d,e){if(e[a])if(e[a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(b,c){e[a].__mergeCols.contains(b)&&(g+=c)}),g=b._calculateWidth(g),g>1&&(g+=e[a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f):e[a].attr("width","").css("width","")}else a==BI.size(e)-1?e[a].attr("width",f-1).css("width",f-1):e[a].attr("width",f).css("width",f)}),BI.each(b.bodyItems,function(d,e){if(e[a])if(b.bodyTds[d][a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(c,e){b.bodyTds[d][a].__mergeCols.contains(c)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.bodyTds[d][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")}),BI.each(b.headerItems,function(d,e){if(e[a])if(b.headerTds[d][a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(c,e){b.headerTds[d][a].__mergeCols.contains(c)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.headerTds[d][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")}),BI.each(b.footerItems,function(d,e){if(e[a])if(b.footerTds[d][a].__mergeCols.length>1){var g=0;BI.each(c.columnSize,function(c,e){b.footerTds[d][a].__mergeCols.contains(c)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.footerTds[d][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")})}});var n=this._calculateWidth(BI.sum(c.columnSize));n>1.05&&(n+=c.columnSize.length),n>1.05&&this.tableContainer.element.width(n)}},getColumnSize:function(){return this.options.columnSize},getCalculateColumnSize:function(){var a=this,b=this.options,c=[];if(b.isNeedFreeze===!0){if(BI.size(this.bottomLeftBodyTds)>0||BI.size(this.bottomRightBodyTds)>0)return BI.any(this.bottomLeftBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.bottomLeftBodyTds[0],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.bottomLeftBodyTds[0])-1&&e++,c.push(e)}),BI.any(this.bottomRightBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.bottomRightBodyTds[0],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.bottomRightBodyTds[0])-1&&e++,c.push(e)}),c;BI.any(this.topLeftBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.topLeftBodyTds[BI.size(this.topLeftBodyTds)-1],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.topLeftBodyTds[BI.size(a.topLeftBodyTds)-1])-1&&e++,c.push(e)}),BI.any(this.topRightBodyTds,function(a,b){if(!BI.any(b,function(a,b){if(b.__mergeCols.length>1)return!0}))return BI.each(b,function(a,d){var e=d.width()/d.__mergeCols.length;a==BI.size(b)-1&&e++,c.push(e)}),!0})||BI.each(this.topRightBodyTds[BI.size(this.topRightBodyTds)-1],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.topRightBodyTds[BI.size(a.topRightBodyTds)-1])-1&&e++,c.push(e)})}else BI.each(this.headerTds[BI.size(this.headerTds)-1],function(b,d){var e=d.width()/d.__mergeCols.length;b==BI.size(a.headerTds[BI.size(a.headerTds)-1])-1&&e++,c.push(e)});return c},setHeaderColumnSize:function(a){var b=this,c=this.options,d=this._isRightFreeze();if(c.isNeedFreeze){var e=[],f=[];BI.each(a,function(a,b){c.freezeCols.contains(a)?d?f.push(b):e.push(b):d?e.push(b):f.push(b)});var g=0,h=1,i=function(a){var c,d,i,j;switch(a){case g:c=b.topLeftColGroupTds,d=b.topLeftBodyTds,i=b.topLeftBodyItems,j=e;break;case h:c=b.topRightColGroupTds,d=b.topRightBodyTds,i=b.topRightBodyItems,j=f}BI.each(c,function(a,c){var e=0|c.attr("width");if(e!==j[a]){var f=b._calculateWidth(j[a]);c.attr("width",f).css("width",f),BI.each(d,function(c,d){if(d[a])if(d[a].__mergeCols.length>1){var e=0;BI.each(j,function(b,c){d[a].__mergeCols.contains(b)&&(e+=c)}),e=b._calculateWidth(e),e>1&&(e+=d[a].__mergeCols.length-1),BI.isNumeric(e)?a==BI.size(d)-1?d[a].attr("width",e-1).css("width",e-1):d[a].attr("width",e).css("width",e):d[a].attr("width","").css("width","")}else a==BI.size(d)-1?d[a].attr("width",f-1).css("width",f-1):d[a].attr("width",f).css("width",f)}),BI.each(i,function(c,e){if(e[a])if(d[c][a].__mergeCols.length>1){var g=0;BI.each(j,function(b,e){d[c][a].__mergeCols.contains(b)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=d[c][a].__mergeCols.length-1),BI.isNumeric(g)?a==BI.size(e)-1?e[a].element.attr("width",g-1).css("width",g-1):e[a].element.attr("width",g).css("width",g):e[a].element.attr("width","").css("width","")}else BI.isNumeric(f)?a==BI.size(e)-1?e[a].element.attr("width",f-1).css("width",f-1):e[a].element.attr("width",f).css("width",f):e[a].element.attr("width","").css("width","")})}})};i(g),i(h);var j=0,k=0;BI.each(a,function(a,b){c.freezeCols.contains(a)?j+=b:k+=b}),j=this._calculateWidth(j),k=this._calculateWidth(k),BI.isNumeric(j)&&(j=BI.parseFloat(j)+c.freezeCols.length),BI.isNumeric(k)&&(k=BI.parseFloat(k)+a.length-c.freezeCols.length),this.topLeftContainer.element.width(d?k:j),this.topRightContainer.element.width(d?j:k),this.scrollTopLeft.element[0].scrollLeft=this.scrollBottomLeft.element[0].scrollLeft,this.scrollTopRight.element[0].scrollLeft=this.scrollBottomRight.element[0].scrollLeft}else{BI.each(this.colgroupTds,function(c,d){var e=0|d.attr("width");if(e!==a[c]){var f=b._calculateWidth(a[c]);d.attr("width",f).css("width",f),BI.each(b.headerTds,function(d,e){if(e[c])if(e[c].__mergeCols.length>1){var g=0;BI.each(a,function(a,b){e[c].__mergeCols.contains(a)&&(g+=b)}),g=b._calculateWidth(g),g>1&&(g+=e[c].__mergeCols.length-1),BI.isNumeric(g)?c==BI.size(e)-1?e[c].element.attr("width",g-1).css("width",g-1):e[c].element.attr("width",g).css("width",g):e[c].attr("width","").css("width","")}else c==BI.size(e)-1?e[c].attr("width",f-1).css("width",f-1):e[c].attr("width",f).css("width",f)}),BI.each(b.headerItems,function(d,e){if(e[c])if(b.headerTds[d][c].__mergeCols.length>1){var g=0;BI.each(a,function(a,e){b.headerTds[d][c].__mergeCols.contains(a)&&(g+=e)}),g=b._calculateWidth(g),g>1&&(g+=b.headerTds[d][c].__mergeCols.length-1),BI.isNumeric(g)?c==BI.size(e)-1?e[c].element.attr("width",g-1).css("width",g-1):e[c].element.attr("width",g).css("width",g):e[c].element.attr("width","").css("width","")}else BI.isNumeric(f)?c==BI.size(e)-1?e[c].element.attr("width",f-1).css("width",f-1):e[c].element.attr("width",f).css("width",f):e[c].element.attr("width","").css("width","")})}});var l=this._calculateWidth(BI.sum(a));l>1.05&&(l+=a.length),this.tableContainer.element.width(l)}},setRegionColumnSize:function(a){var b=this.options;b.regionColumnSize=a,0===b.freezeCols.length?b.isNeedFreeze?(this.partitions.attr("columnSize",this._isRightFreeze()?["fill",0]:[0,"fill"]),this.partitions.resize()):this.tableContainer.element.width(a[0]):b.freezeCols.length>0&&b.freezeCols.length=d?d:0;e=d?(b+=this.table.getRegionSize(),b-=this.table.getRightHorizontalScroll()):b-=this.table.getLeftHorizontalScroll(),b},_formatHeader:function(a){var b=this,c=this.options,d=[],e=function(a,d){b.resizer.setVisible(!0);var e=c.headerRowSize+b._getRegionRowSize()[1];b.resizer.setHeight(e),b._setResizerPosition(b._getResizerLeft(a)+d,(c.header.length-1)*c.headerRowSize)},f=function(a,d){b.resizer.setVisible(!1);var e=c.columnSize.slice();e[a]=d,c.columnSize=e,b.table.setColumnSize(e),b._populate(),b.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE)};return BI.each(a,function(g,h){g===a.length-1?(d[g]=[],BI.each(h,function(a,i){if(a===b._getFreezeColLength()-1||a===h.length-1)d[g][a]=i;else if(d[g][a]={type:"bi.resizable_table_cell",cell:i,suitableSize:c.minColumnSize[a],maxSize:c.maxColumnSize[a],resize:BI.bind(e,null,a),stop:BI.bind(f,null,a)},c.isNeedMerge)for(var j=g;j>0&&b._mergeRule(d[j][a],d[j-1][a]);)d[j-1][a]={type:"bi.resizable_table_cell",cell:d[j-1][a],suitableSize:c.minColumnSize[a],maxSize:c.maxColumnSize[a],resize:BI.bind(e,null,a),stop:BI.bind(f,null,a)},j--})):d.push(h)}),d},_populate:function(){var a=(this.options,this._getRegionSize());a>0?(this.regionResizerHandler.setVisible(!0), this._setRegionResizerHandlerPosition(a-3,0)):this.regionResizerHandler.setVisible(!1)},setWidth:function(a){BI.ResizableTable.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.ResizableTable.superclass.setHeight.apply(this,arguments),this.table.setHeight(a)},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},setColumnSize:function(a){this.options.columnSize=a,this.table.setColumnSize(a)},getColumnSize:function(){return this.table.getColumnSize()},setRegionColumnSize:function(a){this.options.regionColumnSize=a,this.table.setRegionColumnSize(a)},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(){BI.ResizableTable.superclass.attr.apply(this,arguments),this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a,b){a&&(this.options.items=a),b&&(this.options.header=b,this.options.isNeedResize&&(b=this._formatHeader(b))),this.table.populate(a,b),this._populate()}}),BI.shortcut("bi.resizable_table",BI.ResizableTable),BI.CustomTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-tree",expander:{el:{},popup:{type:"bi.custom_tree"}},items:[],itemsCreator:BI.emptyFn,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.CustomTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a){var b=this,c=this.options;a=BI.Tree.transformToTreeFormat(a);var d=[];return BI.each(a,function(a,e){if(BI.isNotEmptyArray(e.children)||e.isParent===!0){var f=BI.extend({type:"bi.expander",el:{},popup:{type:"bi.custom_tree"}},BI.deepClone(c.expander),{id:e.id,pId:e.pId,value:e.value}),g=BI.stripEL(e);BI.isWidget(g)?f.el=g:(g=BI.clone(g),delete g.children,BI.extend(f.el,g)),f.popup.expander=BI.deepClone(c.expander),f.items=f.popup.items=e.children,f.itemsCreator=f.popup.itemsCreator=function(a){if(BI.isNotNull(a.node))return c.itemsCreator.apply(b,arguments);var d=Array.prototype.slice.call(arguments,0);return d[0].node=e,c.itemsCreator.apply(b,d)},BI.isNull(f.popup.el)&&(f.popup.el=BI.deepClone(c.el)),d.push(f)}else d.push(e)}),d},initTree:function(a){var b=this,c=this.options;this.tree=BI.createWidget(c.el,{element:this,items:this._formatItems(a),itemsCreator:function(a,d){c.itemsCreator.apply(this,[a,function(a){var c=Array.prototype.slice.call(arguments,0);c[0]=b._formatItems(a),d.apply(null,c)}])}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.CustomTree.EVENT_CHANGE,c,d)})},stroke:function(a){this.populate.apply(this,arguments)},populate:function(a){var b=Array.prototype.slice.call(arguments,0);arguments.length>0&&(b[0]=this._formatItems(a)),this.tree.populate.apply(this.tree,b)},setValue:function(a){this.tree&&this.tree.setValue(a)},getValue:function(){return this.tree?this.tree.getValue():[]},getAllButtons:function(){return this.tree?this.tree.getAllButtons():[]},getAllLeaves:function(){return this.tree?this.tree.getAllLeaves():[]},getNodeById:function(a){return this.tree&&this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree&&this.tree.getNodeByValue(a)},empty:function(){this.tree.empty()}}),BI.CustomTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_tree",BI.CustomTree),function($){var settings={},roots={},caches={},_consts={className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_setting={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},_initRoot=function(a){var b=data.getRoot(a);b||(b={},data.setRoot(a,b)),b[a.data.key.children]=[],b.expandTriggerFlag=!1,b.curSelectedList=[],b.noSelection=!0,b.createdNodes=[],b.zId=0,b._ver=(new Date).getTime()},_initCache=function(a){var b=data.getCache(a);b||(b={},data.setCache(a,b)),b.nodes=[],b.doms=[]},_bindEvent=function(a){var b=a.treeObj,c=consts.event;b.bind(c.NODECREATED,function(b,c,d){tools.apply(a.callback.onNodeCreated,[b,c,d])}),b.bind(c.CLICK,function(b,c,d,e,f){tools.apply(a.callback.onClick,[c,d,e,f])}),b.bind(c.EXPAND,function(b,c,d){tools.apply(a.callback.onExpand,[b,c,d])}),b.bind(c.COLLAPSE,function(b,c,d){tools.apply(a.callback.onCollapse,[b,c,d])}),b.bind(c.ASYNC_SUCCESS,function(b,c,d,e){tools.apply(a.callback.onAsyncSuccess,[b,c,d,e])}),b.bind(c.ASYNC_ERROR,function(b,c,d,e,f,g){tools.apply(a.callback.onAsyncError,[b,c,d,e,f,g])}),b.bind(c.REMOVE,function(b,c,d){tools.apply(a.callback.onRemove,[b,c,d])}),b.bind(c.SELECTED,function(b,c,d,e){tools.apply(a.callback.onSelected,[c,d,e])}),b.bind(c.UNSELECTED,function(b,c,d,e){tools.apply(a.callback.onUnSelected,[c,d,e])})},_unbindEvent=function(a){var b=a.treeObj,c=consts.event;b.unbind(c.NODECREATED).unbind(c.CLICK).unbind(c.EXPAND).unbind(c.COLLAPSE).unbind(c.ASYNC_SUCCESS).unbind(c.ASYNC_ERROR).unbind(c.REMOVE).unbind(c.SELECTED).unbind(c.UNSELECTED)},_eventProxy=function(a){var b=a.target,c=data.getSetting(a.data.treeId),d="",e=null,f="",g="",h=null,i=null,j=null;if(tools.eqs(a.type,"mousedown")?g="mousedown":tools.eqs(a.type,"mouseup")?g="mouseup":tools.eqs(a.type,"contextmenu")?g="contextmenu":tools.eqs(a.type,"click")?tools.eqs(b.tagName,"span")&&null!==b.getAttribute("treeNode"+consts.id.SWITCH)?(d=tools.getNodeMainDom(b).id,f="switchNode"):(j=tools.getMDom(c,b,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),j&&(d=tools.getNodeMainDom(j).id,f="clickNode")):tools.eqs(a.type,"dblclick")&&(g="dblclick",j=tools.getMDom(c,b,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),j&&(d=tools.getNodeMainDom(j).id,f="switchNode")),g.length>0&&0==d.length&&(j=tools.getMDom(c,b,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),j&&(d=tools.getNodeMainDom(j).id)),d.length>0)switch(e=data.getNodeCache(c,d),f){case"switchNode":e.isParent&&(tools.eqs(a.type,"click")||tools.eqs(a.type,"dblclick")&&tools.apply(c.view.dblClickExpand,[c.treeId,e],c.view.dblClickExpand))?h=handler.onSwitchNode:f="";break;case"clickNode":h=handler.onClickNode}switch(g){case"mousedown":i=handler.onZTreeMousedown;break;case"mouseup":i=handler.onZTreeMouseup;break;case"dblclick":i=handler.onZTreeDblclick;break;case"contextmenu":i=handler.onZTreeContextmenu}var k={stop:!1,node:e,nodeEventType:f,nodeEventCallback:h,treeEventType:g,treeEventCallback:i};return k},_initNode=function(a,b,c,d,e,f,g){if(c){var h=data.getRoot(a),i=a.data.key.children;c.level=b,c.tId=a.treeId+"_"+ ++h.zId,c.parentTId=d?d.tId:null,c.open="string"==typeof c.open?tools.eqs(c.open,"true"):!!c.open,c[i]&&c[i].length>0?(c.isParent=!0,c.zAsync=!0):(c.isParent="string"==typeof c.isParent?tools.eqs(c.isParent,"true"):!!c.isParent,c.open=!(!c.isParent||a.async.enable)&&c.open,c.zAsync=!c.isParent),c.isFirstNode=e,c.isLastNode=f,c.getParentNode=function(){return data.getNodeCache(a,c.parentTId)},c.getPreNode=function(){return data.getPreNode(a,c)},c.getNextNode=function(){return data.getNextNode(a,c)},c.isAjaxing=!1,data.fixPIdKeyValue(a,c)}},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(a,b){data.getCache(a).nodes[data.getNodeCacheId(b.tId)]=b},getNodeCacheId:function(a){return a.substring(a.lastIndexOf("_")+1)},addAfterA:function(a){_init.afterA.push(a)},addBeforeA:function(a){_init.beforeA.push(a)},addInnerAfterA:function(a){_init.innerAfterA.push(a)},addInnerBeforeA:function(a){_init.innerBeforeA.push(a)},addInitBind:function(a){_init.bind.push(a)},addInitUnBind:function(a){_init.unbind.push(a)},addInitCache:function(a){_init.caches.push(a)},addInitNode:function(a){_init.nodes.push(a)},addInitProxy:function(a,b){b?_init.proxys.splice(0,0,a):_init.proxys.push(a)},addInitRoot:function(a){_init.roots.push(a)},addNodesData:function(a,b,c){var d=a.data.key.children;b[d]||(b[d]=[]),b[d].length>0&&(b[d][b[d].length-1].isLastNode=!1,view.setNodeLineIcos(a,b[d][b[d].length-1])),b.isParent=!0,b[d]=b[d].concat(c)},addSelectedNode:function(a,b){var c=data.getRoot(a);data.isSelectedNode(a,b)||c.curSelectedList.push(b)},addCreatedNode:function(a,b){if(a.callback.onNodeCreated||a.view.addDiyDom){var c=data.getRoot(a);c.createdNodes.push(b)}},addZTreeTools:function(a){_init.zTreeTools.push(a)},exSetting:function(a){$.extend(!0,_setting,a)},fixPIdKeyValue:function(a,b){a.data.simpleData.enable&&(b[a.data.simpleData.pIdKey]=b.parentTId?b.getParentNode()[a.data.simpleData.idKey]:a.data.simpleData.rootPId)},getAfterA:function(a,b,c){for(var d=0,e=_init.afterA.length;d-1&&f.push(b[g]),f=f.concat(data.getNodesByParamFuzzy(a,b[g][e],c,d));return f},getNodesByFilter:function(a,b,c,d,e){if(!b)return d?null:[];for(var f=a.data.key.children,g=d?null:[],h=0,i=b.length;h0)},clone:function(a){if(null===a)return null;var b=tools.isArray(a)?[]:{};for(var c in a)b[c]=a[c]instanceof Date?new Date(a[c].getTime()):"object"==typeof a[c]?arguments.callee(a[c]):a[c];return b},eqs:function(a,b){return a.toLowerCase()===b.toLowerCase()},isArray:function(a){return"[object Array]"===Object.prototype.toString.apply(a)},$:function(a,b,c){return b&&"string"!=typeof b&&(c=b,b=""),"string"==typeof a?$(a,c?c.treeObj.get(0).ownerDocument:null):$("#"+a.tId+b,c?c.treeObj:null)},getMDom:function(a,b,c){if(!b)return null;for(;b&&b.id!==a.treeId;){for(var d=0,e=c.length;b.tagName&&d0},uCanDo:function(a,b){return!0}},view={addNodes:function(a,b,c,d){if(!a.data.keep.leaf||!b||b.isParent)if(tools.isArray(c)||(c=[c]),a.data.simpleData.enable&&(c=data.transformTozTreeFormat(a,c)),b){var e=$$(b,consts.id.SWITCH,a),f=$$(b,consts.id.ICON,a),g=$$(b,consts.id.UL,a);b.open||(view.replaceSwitchClass(b,e,consts.folder.CLOSE),view.replaceIcoClass(b,f,consts.folder.CLOSE),b.open=!1,g.css({display:"none"})),data.addNodesData(a,b,c),view.createNodes(a,b.level+1,c,b),d||view.expandCollapseParentNode(a,b,!0)}else data.addNodesData(a,data.getRoot(a),c),view.createNodes(a,0,c,null)},appendNodes:function(a,b,c,d,e,f){if(!c)return[];for(var g=[],h=a.data.key.children,i=0,j=c.length;i0&&(p=view.appendNodes(a,b+1,k[h],k,e,f&&k.open)),f&&(view.makeDOMNodeMainBefore(g,a,k),view.makeDOMNodeLine(g,a,k),data.getBeforeA(a,k,g),view.makeDOMNodeNameBefore(g,a,k),data.getInnerBeforeA(a,k,g),view.makeDOMNodeIcon(g,a,k),data.getInnerAfterA(a,k,g),view.makeDOMNodeNameAfter(g,a,k),data.getAfterA(a,k,g),k.isParent&&k.open&&view.makeUlHtml(a,k,g,p.join("")),view.makeDOMNodeMainAfter(g,a,k),data.addCreatedNode(a,k))}return g},appendParentULDom:function(a,b){var c=[],d=$$(b,a);!d.get(0)&&b.parentTId&&(view.appendParentULDom(a,b.getParentNode()),d=$$(b,a));var e=$$(b,consts.id.UL,a);e.get(0)&&e.remove();var f=a.data.key.children,g=view.appendNodes(a,b.level+1,b[f],b,!1,!0);view.makeUlHtml(a,b,c,g.join("")),d.append(c.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l;if(node&&!node.isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;if(node){node.isAjaxing=!0;var icoObj=$$(node,consts.id.ICON,setting);icoObj.attr({style:"","class":consts.className.BUTTON+" "+consts.className.ICO_LOADING})}var tmpParam={};for(i=0,l=setting.async.autoParam.length;node&&i1&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}if(tools.isArray(setting.async.otherParam))for(i=0,l=setting.async.otherParam.length;i=0;d--)if(e=f[d],b===e||!b&&(!c||c!==e)){if($$(e,consts.id.A,a).removeClass(consts.node.CURSELECTED),b){data.removeSelectedNode(a,b),a.treeObj.trigger(consts.event.UNSELECTED,[event,a.treeId,e]);break}f.splice(d,1),a.treeObj.trigger(consts.event.UNSELECTED,[event,a.treeId,e])}},createNodeCallback:function(a){if(a.callback.onNodeCreated||a.view.addDiyDom)for(var b=data.getRoot(a);b.createdNodes.length>0;){var c=b.createdNodes.shift();tools.apply(a.view.addDiyDom,[a.treeId,c]),a.callback.onNodeCreated&&a.treeObj.trigger(consts.event.NODECREATED,[a.treeId,c])}},createNodes:function(a,b,c,d){if(c&&0!=c.length){var e=data.getRoot(a),f=a.data.key.children,g=!d||d.open||!!$$(d[f][0],a).get(0);e.createdNodes=[];var h=view.appendNodes(a,b,c,d,!0,g);if(d){var i=$$(d,consts.id.UL,a);i.get(0)&&i.append(h.join(""))}else a.treeObj.append(h.join(""));view.createNodeCallback(a)}},destroy:function(a){a&&(data.initCache(a),data.initRoot(a),event.unbindTree(a),event.unbindEvent(a),a.treeObj.empty(),delete settings[a.treeId])},expandCollapseNode:function(a,b,c,d,e){var f=data.getRoot(a),g=a.data.key.children;if(!b)return void tools.apply(e,[]);if(f.expandTriggerFlag){var h=e;e=function(){h&&h(),b.open?a.treeObj.trigger(consts.event.EXPAND,[a.treeId,b]):a.treeObj.trigger(consts.event.COLLAPSE,[a.treeId,b])},f.expandTriggerFlag=!1}if(!b.open&&b.isParent&&(!$$(b,consts.id.UL,a).get(0)||b[g]&&b[g].length>0&&!$$(b[g][0],a).get(0))&&(view.appendParentULDom(a,b),view.createNodeCallback(a)),b.open==c)return void tools.apply(e,[]);var i=$$(b,consts.id.UL,a),j=$$(b,consts.id.SWITCH,a),k=$$(b,consts.id.ICON,a);b.isParent?(b.open=!b.open,b.iconOpen&&b.iconClose&&k.attr("style",view.makeNodeIcoStyle(a,b)),b.open?(view.replaceSwitchClass(b,j,consts.folder.OPEN),view.replaceIcoClass(b,k,consts.folder.OPEN),0==d||""==a.view.expandSpeed?(i.show(),tools.apply(e,[])):b[g]&&b[g].length>0?i.slideDown(a.view.expandSpeed,e):(i.show(),tools.apply(e,[]))):(view.replaceSwitchClass(b,j,consts.folder.CLOSE),view.replaceIcoClass(b,k,consts.folder.CLOSE),0!=d&&""!=a.view.expandSpeed&&b[g]&&b[g].length>0?i.slideUp(a.view.expandSpeed,e):(i.hide(),tools.apply(e,[])))):tools.apply(e,[])},expandCollapseParentNode:function(a,b,c,d,e){if(b){if(!b.parentTId)return void view.expandCollapseNode(a,b,c,d,e);view.expandCollapseNode(a,b,c,d),b.parentTId&&view.expandCollapseParentNode(a,b.getParentNode(),c,d,e)}},expandCollapseSonNode:function(a,b,c,d,e){var f=data.getRoot(a),g=a.data.key.children,h=b?b[g]:f[g],i=!b&&d,j=data.getRoot(a).expandTriggerFlag;if(data.getRoot(a).expandTriggerFlag=!1,h)for(var k=0,l=h.length;k=0;c--)if(b===d[c])return!0;return!1},makeDOMNodeIcon:function(a,b,c){var d=data.getNodeName(b,c),e=b.view.nameIsHTML?d:d.replace(/&/g,"&").replace(//g,">");a.push("",e,"")},makeDOMNodeLine:function(a,b,c){a.push("")},makeDOMNodeMainAfter:function(a,b,c){a.push("")},makeDOMNodeMainBefore:function(a,b,c){a.push("
  • ")},makeDOMNodeNameAfter:function(a,b,c){a.push("")},makeDOMNodeNameBefore:function(a,b,c){var d=data.getNodeTitle(b,c),e=view.makeNodeUrl(b,c),f=view.makeNodeFontCss(b,c),g=[];for(var h in f)g.push(h,":",f[h],";");a.push("0?"href='"+e+"'":""," target='",view.makeNodeTarget(c),"' style='",g.join(""),"'"),tools.apply(b.view.showTitle,[b.treeId,c],b.view.showTitle)&&d&&a.push("title='",d.replace(/'/g,"'").replace(//g,">"),"'"),a.push(">")},makeNodeFontCss:function(a,b){var c=tools.apply(a.view.fontCss,[a.treeId,b],a.view.fontCss);return c&&"function"!=typeof c?c:{}},makeNodeIcoClass:function(a,b){var c=["ico"];return b.isAjaxing||(c[0]=(b.iconSkin?b.iconSkin+"_":"")+c[0],b.isParent?c.push(b.open?consts.folder.OPEN:consts.folder.CLOSE):c.push(consts.folder.DOCU)),consts.className.BUTTON+" "+c.join("_")},makeNodeIcoStyle:function(a,b){var c=[];if(!b.isAjaxing){var d=b.isParent&&b.iconOpen&&b.iconClose?b.open?b.iconOpen:b.iconClose:b.icon;d&&c.push("background:url(",d,") 0 0 no-repeat;"),0!=a.view.showIcon&&tools.apply(a.view.showIcon,[a.treeId,b],!0)||c.push("width:0px;height:0px;")}return c.join("")},makeNodeLineClass:function(a,b){var c=[];return a.view.showLine?0==b.level&&b.isFirstNode&&b.isLastNode?c.push(consts.line.ROOT):0==b.level&&b.isFirstNode?c.push(consts.line.ROOTS):b.isLastNode?c.push(consts.line.BOTTOM):c.push(consts.line.CENTER):c.push(consts.line.NOLINE),b.isParent?c.push(b.open?consts.folder.OPEN:consts.folder.CLOSE):c.push(consts.folder.DOCU),view.makeNodeLineClassEx(b)+c.join("_")},makeNodeLineClassEx:function(a){return consts.className.BUTTON+" "+consts.className.LEVEL+a.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(a){return a.target||"_blank"},makeNodeUrl:function(a,b){var c=a.data.key.url;return b[c]?b[c]:null},makeUlHtml:function(a,b,c,d){c.push("
      "),c.push(d),c.push("
    ")},makeUlLineClass:function(a,b){return a.view.showLine&&!b.isLastNode?consts.line.LINE:""},removeChildNodes:function(a,b){if(b){var c=a.data.key.children,d=b[c];if(d){for(var e=0,f=d.length;e0&&(b[c][0].isFirstNode=!0)},setLastNode:function(a,b){var c=a.data.key.children,d=b[c].length;d>0&&(b[c][d-1].isLastNode=!0)},removeNode:function(a,b){var c=data.getRoot(a),d=a.data.key.children,e=b.parentTId?b.getParentNode():c;if(b.isFirstNode=!1,b.isLastNode=!1,b.getPreNode=function(){return null},b.getNextNode=function(){return null},data.getNodeCache(a,b.tId)){$$(b,a).remove(),data.removeNodeCache(a,b),data.removeSelectedNode(a,b);for(var f=0,g=e[d].length;f0){var l=e[d][k-1];if(h=$$(l,consts.id.UL,a),i=$$(l,consts.id.SWITCH,a),j=$$(l,consts.id.ICON,a),e==c)if(1==e[d].length)view.replaceSwitchClass(l,i,consts.line.ROOT);else{var m=$$(e[d][0],consts.id.SWITCH,a);view.replaceSwitchClass(e[d][0],m,consts.line.ROOTS),view.replaceSwitchClass(l,i,consts.line.BOTTOM)}else view.replaceSwitchClass(l,i,consts.line.BOTTOM);h.removeClass(consts.line.LINE)}}else e.isParent=!1,e.open=!1,h=$$(e,consts.id.UL,a),i=$$(e,consts.id.SWITCH,a),j=$$(e,consts.id.ICON,a),view.replaceSwitchClass(e,i,consts.folder.DOCU),view.replaceIcoClass(e,j,consts.folder.DOCU),h.css("display","none")}},replaceIcoClass:function(a,b,c){if(b&&!a.isAjaxing){var d=b.attr("class");if(void 0!=d){var e=d.split("_");switch(c){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:e[e.length-1]=c}b.attr("class",e.join("_"))}}},replaceSwitchClass:function(a,b,c){if(b){var d=b.attr("class");if(void 0!=d){var e=d.split("_");switch(c){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:e[0]=view.makeNodeLineClassEx(a)+c;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:e[1]=c}b.attr("class",e.join("_")),c!==consts.folder.DOCU?b.removeAttr("disabled"):b.attr("disabled","disabled")}}},selectNode:function(a,b,c){c||view.cancelPreSelectedNode(a,null,b),$$(b,consts.id.A,a).addClass(consts.node.CURSELECTED),data.addSelectedNode(a,b),a.treeObj.trigger(consts.event.SELECTED,[event,a.treeId,b])},setNodeFontCss:function(a,b){var c=$$(b,consts.id.A,a),d=view.makeNodeFontCss(a,b);d&&c.css(d)},setNodeLineIcos:function(a,b){if(b){var c=$$(b,consts.id.SWITCH,a),d=$$(b,consts.id.UL,a),e=$$(b,consts.id.ICON,a),f=view.makeUlLineClass(a,b);0==f.length?d.removeClass(consts.line.LINE):d.addClass(f),c.attr("class",view.makeNodeLineClass(a,b)),b.isParent?c.removeAttr("disabled"):c.attr("disabled","disabled"),e.removeAttr("style"),e.attr("style",view.makeNodeIcoStyle(a,b)),e.attr("class",view.makeNodeIcoClass(a,b))}},setNodeName:function(a,b){var c=data.getNodeTitle(a,b),d=$$(b,consts.id.SPAN,a);if(d.empty(),a.view.nameIsHTML?d.html(data.getNodeName(a,b)):d.text(data.getNodeName(a,b)),tools.apply(a.view.showTitle,[a.treeId,b],a.view.showTitle)){var e=$$(b,consts.id.A,a);e.attr("title",c?c:"")}},setNodeTarget:function(a,b){var c=$$(b,consts.id.A,a);c.attr("target",view.makeNodeTarget(b))},setNodeUrl:function(a,b){var c=$$(b,consts.id.A,a),d=view.makeNodeUrl(a,b);null==d||0==d.length?c.removeAttr("href"):c.attr("href",d)},switchNode:function(a,b){if(b.open||!tools.canAsync(a,b))view.expandCollapseNode(a,b,!b.open);else if(a.async.enable){if(!view.asyncNode(a,b))return void view.expandCollapseNode(a,b,!b.open)}else b&&view.expandCollapseNode(a,b,!b.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(a){var b=data.getZTreeTools(a); return b?b:null},destroy:function(a){if(a&&a.length>0)view.destroy(data.getSetting(a));else for(var b in settings)view.destroy(settings[b])},init:function(a,b,c){var d=tools.clone(_setting);$.extend(!0,d,b),d.treeId=a.attr("id"),d.treeObj=a,d.treeObj.empty(),settings[d.treeId]=d,"undefined"==typeof document.body.style.maxHeight&&(d.view.expandSpeed=""),data.initRoot(d);var e=data.getRoot(d),f=d.data.key.children;c=c?tools.clone(tools.isArray(c)?c:[c]):[],d.data.simpleData.enable?e[f]=data.transformTozTreeFormat(d,c):e[f]=c,data.initCache(d),event.unbindTree(d),event.bindTree(d),event.unbindEvent(d),event.bindEvent(d);var g={setting:d,addNodes:function(a,b,c){function e(){view.addNodes(d,a,f,1==c)}if(!b)return null;if(a||(a=null),a&&!a.isParent&&d.data.keep.leaf)return null;var f=tools.clone(tools.isArray(b)?b:[b]);return tools.canAsync(d,a)?view.asyncNode(d,a,c,e):e(),f},cancelSelectedNode:function(a){view.cancelPreSelectedNode(d,a)},destroy:function(){view.destroy(d)},expandAll:function(a){return a=!!a,view.expandCollapseSonNode(d,null,a,!0),a},expandNode:function(a,b,c,e,f){if(!a||!a.isParent)return null;if(b!==!0&&b!==!1&&(b=!a.open),f=!!f,f&&b&&0==tools.apply(d.callback.beforeExpand,[d.treeId,a],!0))return null;if(f&&!b&&0==tools.apply(d.callback.beforeCollapse,[d.treeId,a],!0))return null;if(b&&a.parentTId&&view.expandCollapseParentNode(d,a.getParentNode(),b,!1),b===a.open&&!c)return null;if(data.getRoot(d).expandTriggerFlag=f,!tools.canAsync(d,a)&&c)view.expandCollapseSonNode(d,a,b,!0,function(){if(e!==!1)try{$$(a,d).focus().blur()}catch(b){}});else if(a.open=!b,view.switchNode(this.setting,a),e!==!1)try{$$(a,d).focus().blur()}catch(g){}return b},getNodes:function(){return data.getNodes(d)},getNodeByParam:function(a,b,c){return a?data.getNodeByParam(d,c?c[d.data.key.children]:data.getNodes(d),a,b):null},getNodeByTId:function(a){return data.getNodeCache(d,a)},getNodesByParam:function(a,b,c){return a?data.getNodesByParam(d,c?c[d.data.key.children]:data.getNodes(d),a,b):null},getNodesByParamFuzzy:function(a,b,c){return a?data.getNodesByParamFuzzy(d,c?c[d.data.key.children]:data.getNodes(d),a,b):null},getNodesByFilter:function(a,b,c,e){return b=!!b,a&&"function"==typeof a?data.getNodesByFilter(d,c?c[d.data.key.children]:data.getNodes(d),a,b,e):b?null:[]},getNodeIndex:function(a){if(!a)return null;for(var b=d.data.key.children,c=a.parentTId?a.getParentNode():data.getRoot(d),e=0,f=c[b].length;e0?view.createNodes(d,0,e[f]):d.async.enable&&d.async.url&&""!==d.async.url&&view.asyncNode(d),g}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(jQuery),function(a){var b={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},c={check:{enable:!1,autoCheckTrigger:!1,chkStyle:b.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:b.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},d=function(a){var b=v.getRoot(a);b.radioCheckedList=[]},e=function(a){},f=function(a){var b=a.treeObj,c=t.event;b.bind(c.CHECK,function(b,c,d,e){b.srcEvent=c,s.apply(a.callback.onCheck,[b,d,e])})},g=function(a){var b=a.treeObj,c=t.event;b.unbind(c.CHECK)},h=function(a){var b=a.target,c=v.getSetting(a.data.treeId),d="",e=null,f="",g="",h=null,i=null;if(s.eqs(a.type,"mouseover")?c.check.enable&&s.eqs(b.tagName,"span")&&null!==b.getAttribute("treeNode"+t.id.CHECK)&&(d=s.getNodeMainDom(b).id,f="mouseoverCheck"):s.eqs(a.type,"mouseout")?c.check.enable&&s.eqs(b.tagName,"span")&&null!==b.getAttribute("treeNode"+t.id.CHECK)&&(d=s.getNodeMainDom(b).id,f="mouseoutCheck"):s.eqs(a.type,"click")&&c.check.enable&&s.eqs(b.tagName,"span")&&null!==b.getAttribute("treeNode"+t.id.CHECK)&&(d=s.getNodeMainDom(b).id,f="checkNode"),d.length>0)switch(e=v.getNodeCache(c,d),f){case"checkNode":h=n.onCheckNode;break;case"mouseoverCheck":h=n.onMouseoverCheck;break;case"mouseoutCheck":h=n.onMouseoutCheck}var j={stop:"checkNode"===f,node:e,nodeEventType:f,nodeEventCallback:h,treeEventType:g,treeEventCallback:i};return j},i=function(a,b,c,d,e,f,g){if(c){var h=a.data.key.checked;if("string"==typeof c[h]&&(c[h]=s.eqs(c[h],"true")),c[h]=!!c[h],c.checkedOld=c[h],"string"==typeof c.nocheck&&(c.nocheck=s.eqs(c.nocheck,"true")),c.nocheck=!!c.nocheck||a.check.nocheckInherit&&d&&!!d.nocheck,"string"==typeof c.chkDisabled&&(c.chkDisabled=s.eqs(c.chkDisabled,"true")),c.chkDisabled=!!c.chkDisabled||a.check.chkDisabledInherit&&d&&!!d.chkDisabled,"string"==typeof c.halfCheck&&(c.halfCheck=s.eqs(c.halfCheck,"true")),c.halfCheck=!!c.halfCheck,c.check_Child_State=-1,c.check_Focus=!1,c.getCheckStatus=function(){return v.getCheckStatus(a,c)},a.check.chkStyle==t.radio.STYLE&&a.check.radioType==t.radio.TYPE_ALL&&c[h]){var i=v.getRoot(a);i.radioCheckedList.push(c)}}},j=function(a,b,c){a.data.key.checked;a.check.enable&&(v.makeChkFlag(a,b),c.push(""))},k=function(a,b){b.checkNode=function(a,b,c,d){var e=this.setting.data.key.checked;if(a.chkDisabled!==!0&&(b!==!0&&b!==!1&&(b=!a[e]),d=!!d,(a[e]!==b||c)&&(!d||0!=s.apply(this.setting.callback.beforeCheck,[this.setting.treeId,a],!0))&&s.uCanDo(this.setting)&&this.setting.check.enable&&a.nocheck!==!0)){a[e]=b;var f=w(a,t.id.CHECK,this.setting);(c||this.setting.check.chkStyle===t.radio.STYLE)&&u.checkNodeRelation(this.setting,a),u.setChkClass(this.setting,f,a),u.repairParentChkClassWithSelf(this.setting,a),d&&this.setting.treeObj.trigger(t.event.CHECK,[null,this.setting.treeId,a])}},b.checkAllNodes=function(a){u.repairAllChk(this.setting,!!a)},b.getCheckedNodes=function(a){var b=this.setting.data.key.children;return a=a!==!1,v.getTreeCheckedNodes(this.setting,v.getRoot(this.setting)[b],a)},b.getChangeCheckedNodes=function(){var a=this.setting.data.key.children;return v.getTreeChangeCheckedNodes(this.setting,v.getRoot(this.setting)[a])},b.setChkDisabled=function(a,b,c,d){b=!!b,c=!!c,d=!!d,u.repairSonChkDisabled(this.setting,a,b,d),u.repairParentChkDisabled(this.setting,a.getParentNode(),b,c)};var c=b.updateNode;b.updateNode=function(a,d){if(c&&c.apply(b,arguments),a&&this.setting.check.enable){var e=w(a,this.setting);if(e.get(0)&&s.uCanDo(this.setting)){var f=w(a,t.id.CHECK,this.setting);1!=d&&this.setting.check.chkStyle!==t.radio.STYLE||u.checkNodeRelation(this.setting,a),u.setChkClass(this.setting,f,a),u.repairParentChkClassWithSelf(this.setting,a)}}}},l={getRadioCheckedList:function(a){for(var b=v.getRoot(a).radioCheckedList,c=0,d=b.length;c-1&&b.check_Child_State<2:b.check_Child_State>0};return d},getTreeCheckedNodes:function(a,b,c,d){if(!b)return[];var e=a.data.key.children,f=a.data.key.checked,g=c&&a.check.chkStyle==t.radio.STYLE&&a.check.radioType==t.radio.TYPE_ALL;d=d?d:[];for(var h=0,i=b.length;h0));h++);return d},getTreeChangeCheckedNodes:function(a,b,c){if(!b)return[];var d=a.data.key.children,e=a.data.key.checked;c=c?c:[];for(var f=0,g=b.length;f0?2:0,2==i){e=2;break}0==i&&(e=0)}else if(a.check.chkStyle==t.checkbox.STYLE){if(i=h.nocheck===!0||h.chkDisabled===!0?h.check_Child_State:h.halfCheck===!0?1:h[d]?h.check_Child_State===-1||2===h.check_Child_State?2:1:h.check_Child_State>0?1:0,1===i){e=1;break}if(2===i&&e>-1&&f>0&&i!==e){e=1;break}if(2===e&&i>-1&&i<2){e=1;break}i>-1&&(e=i)}}b.check_Child_State=e}}},m={},n={onCheckNode:function(a,b){if(b.chkDisabled===!0)return!1;var c=v.getSetting(a.data.treeId),d=c.data.key.checked;if(0==s.apply(c.callback.beforeCheck,[c.treeId,b],!0))return!0;b[d]=!b[d],u.checkNodeRelation(c,b);var e=w(b,t.id.CHECK,c);return u.setChkClass(c,e,b),u.repairParentChkClassWithSelf(c,b),c.treeObj.trigger(t.event.CHECK,[a,c.treeId,b]),!0},onMouseoverCheck:function(a,b){if(b.chkDisabled===!0)return!1;var c=v.getSetting(a.data.treeId),d=w(b,t.id.CHECK,c);return b.check_Focus=!0,u.setChkClass(c,d,b),!0},onMouseoutCheck:function(a,b){if(b.chkDisabled===!0)return!1;var c=v.getSetting(a.data.treeId),d=w(b,t.id.CHECK,c);return b.check_Focus=!1,u.setChkClass(c,d,b),!0}},o={},p={checkNodeRelation:function(a,b){var c,d,e,f=a.data.key.children,g=a.data.key.checked,h=t.radio;if(a.check.chkStyle==h.STYLE){var i=v.getRadioCheckedList(a);if(b[g])if(a.check.radioType==h.TYPE_ALL){for(d=i.length-1;d>=0;d--)c=i[d],c[g]&&c!=b&&(c[g]=!1,i.splice(d,1),u.setChkClass(a,w(c,t.id.CHECK,a),c),c.parentTId!=b.parentTId&&u.repairParentChkClassWithSelf(a,c));i.push(b)}else{var j=b.parentTId?b.getParentNode():v.getRoot(a);for(d=0,e=j[f].length;d-1)&&u.setSonNodeCheckBox(a,b,!0),b[g]||b[f]&&0!=b[f].length&&!(a.check.chkboxType.N.indexOf("s")>-1)||u.setSonNodeCheckBox(a,b,!1),b[g]&&a.check.chkboxType.Y.indexOf("p")>-1&&u.setParentNodeCheckBox(a,b,!0),!b[g]&&a.check.chkboxType.N.indexOf("p")>-1&&u.setParentNodeCheckBox(a,b,!1)},makeChkClass:function(a,b){var c=a.data.key.checked,d=t.checkbox,e=t.radio,f="";f=b.chkDisabled===!0?d.DISABLED:b.halfCheck?d.PART:a.check.chkStyle==e.STYLE?b.check_Child_State<1?d.FULL:d.PART:b[c]?2===b.check_Child_State||b.check_Child_State===-1?d.FULL:d.PART:b.check_Child_State<1?d.FULL:d.PART;var g=a.check.chkStyle+"_"+(b[c]?d.TRUE:d.FALSE)+"_"+f;return g=b.check_Focus&&b.chkDisabled!==!0?g+"_"+d.FOCUS:g,t.className.BUTTON+" "+d.DEFAULT+" "+g},repairAllChk:function(a,b){if(a.check.enable&&a.check.chkStyle===t.checkbox.STYLE)for(var c=a.data.key.checked,d=a.data.key.children,e=v.getRoot(a),f=0,g=e[d].length;f0?u.repairParentChkClass(a,b[c][0]):u.repairParentChkClass(a,b)}},repairSonChkDisabled:function(a,b,c,d){if(b){var e=a.data.key.children;if(b.chkDisabled!=c&&(b.chkDisabled=c),u.repairChkClass(a,b),b[e]&&d)for(var f=0,g=b[e].length;f0){h=!1;break}h&&u.setParentNodeCheckBox(a,b.getParentNode(),c,d)}},setSonNodeCheckBox:function(a,b,c,d){if(b){var e=a.data.key.children,f=a.data.key.checked,g=w(b,t.id.CHECK,a);d||(d=b);var h=!1;if(b[e])for(var i=0,j=b[e].length;i0?c?2:0:-1)):b.check_Child_State=-1,u.setChkClass(a,g,b),a.check.autoCheckTrigger&&b!=d&&b.nocheck!==!0&&b.chkDisabled!==!0&&a.treeObj.trigger(t.event.CHECK,[null,a.treeId,b]))}}},q={tools:o,view:p,event:m,data:l};a.extend(!0,a.fn.zTree.consts,b),a.extend(!0,a.fn.zTree._z,q);var r=a.fn.zTree,s=r._z.tools,t=r.consts,u=r._z.view,v=r._z.data,w=(r._z.event,s.$);v.exSetting(c),v.addInitBind(f),v.addInitUnBind(g),v.addInitCache(e),v.addInitNode(i),v.addInitProxy(h,!0),v.addInitRoot(d),v.addBeforeA(j),v.addZTreeTools(k);var x=u.createNodes;u.createNodes=function(a,b,c,d){x&&x.apply(u,arguments),c&&u.repairParentChkClassWithSelf(a,d)};var y=u.removeNode;u.removeNode=function(a,b){var c=b.getParentNode();y&&y.apply(u,arguments),b&&c&&(u.repairChkClass(a,c),u.repairParentChkClass(a,c))};var z=u.appendNodes;u.appendNodes=function(a,b,c,d,e,f){var g="";return z&&(g=z.apply(u,arguments)),d&&v.makeChkFlag(a,d),g}}(jQuery),BI.IconChangeButton=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.IconChangeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-icon-change-button",iconClass:"",iconWidth:null,iconHeight:null,stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn})},_init:function(){BI.IconChangeButton.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button=BI.createWidget({type:"bi.icon_button",element:this,cls:b.iconClass,height:b.height,iconWidth:b.iconWidth,iconHeight:b.iconHeight,stopEvent:b.stopEvent,stopPropagation:b.stopPropagation,selected:b.selected,once:b.once,forceSelected:b.forceSelected,forceNotSelected:b.forceNotSelected,disableSelected:b.disableSelected,shadow:b.shadow,isShadowShowingOnSelected:b.isShadowShowingOnSelected,trigger:b.trigger,handler:b.handler}),this.button.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button.on(BI.IconButton.EVENT_CHANGE,function(){a.fireEvent(BI.IconChangeButton.EVENT_CHANGE,arguments)})},isSelected:function(){return this.button.isSelected()},setSelected:function(a){this.button.setSelected(a)},setIcon:function(a){var b=this.options;b.iconClass!==a&&(this.element.removeClass(b.iconClass).addClass(a),b.iconClass=a)}}),BI.IconChangeButton.EVENT_CHANGE="IconChangeButton.EVENT_CHANGE",BI.shortcut("bi.icon_change_button",BI.IconChangeButton),BI.HalfIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var a=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-half-icon-button check-half-select-icon",height:16,width:16,iconWidth:16,iconHeight:16,selected:!1})},_init:function(){BI.HalfIconButton.superclass._init.apply(this,arguments)},doClick:function(){BI.HalfIconButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.HalfIconButton.EVENT_CHANGE)}}),BI.HalfIconButton.EVENT_CHANGE="HalfIconButton.EVENT_CHANGE",BI.shortcut("bi.half_icon_button",BI.HalfIconButton),BI.TriggerIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var a=BI.TriggerIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-trigger-icon-button",extraCls:"pull-down-font"})},_init:function(){BI.TriggerIconButton.superclass._init.apply(this,arguments)},doClick:function(){BI.TriggerIconButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TriggerIconButton.EVENT_CHANGE,this)}}),BI.TriggerIconButton.EVENT_CHANGE="TriggerIconButton.EVENT_CHANGE",BI.shortcut("bi.trigger_icon_button",BI.TriggerIconButton),BI.MultiSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-item",height:25,logic:{dynamic:!1}})},_init:function(){BI.MultiSelectItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,rgap:b.rgap,text:b.text,keyword:b.keyword,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(a.isSelected())}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(b.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.checkbox],width:36},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MultiSelectItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(a){BI.MultiSelectItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(a)}}),BI.MultiSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_item",BI.MultiSelectItem),BI.SingleSelectIconTextItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-icon-text-item bi-list-item-active",iconClass:"",hgap:10,height:25})},_init:function(){BI.SingleSelectIconTextItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,cls:b.iconClass,once:b.once,selected:b.selected,height:b.height,iconHeight:b.iconHeight,iconWidth:b.iconWidth,text:b.text,keyword:b.keyword,value:b.value,py:b.py}),this.text.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},isSelected:function(){return this.text.isSelected()},setSelected:function(a){this.text.setSelected(a)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectIconTextItem.superclass.doClick.apply(this,arguments)}}),BI.shortcut("bi.single_select_icon_text_item",BI.SingleSelectIconTextItem),BI.SingleSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-item bi-list-item-active",hgap:10,height:25,textAlign:"left"})},_init:function(){BI.SingleSelectItem.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:a.textAlign,whiteSpace:"nowrap",textHeight:a.height,height:a.height,hgap:a.hgap,text:a.text,keyword:a.keyword,value:a.value,py:a.py})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments)},setSelected:function(a){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.single_select_item",BI.SingleSelectItem),BI.SingleSelectRadioItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item bi-list-item-active",logic:{dynamic:!1},hgap:10,height:25})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.radio.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(!a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,keyword:b.keyword,value:b.value,py:b.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(b.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:36},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectRadioItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected())},setSelected:function(a){BI.SingleSelectRadioItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(a)}}),BI.shortcut("bi.single_select_radio_item",BI.SingleSelectRadioItem),BI.ArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.ArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-arrow-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:25})},_init:function(){var a=this,b=this.options;BI.ArrowNode.superclass._init.apply(this,arguments),this.checkbox=BI.createWidget({type:"bi.arrow_tree_group_node_checkbox",iconWidth:13,iconHeight:13}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:25,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.ArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isOpened())},setValue:function(a){this.text.setValue(a)},setOpened:function(a){BI.ArrowNode.superclass.setOpened.apply(this,arguments),this.checkbox.setSelected(a)}}),BI.shortcut("bi.arrow_group_node",BI.ArrowNode),BI.FirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.FirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-first-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:25})},_init:function(){BI.FirstPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&(this.isSelected()?a.triggerExpand():a.triggerCollapse())});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:25,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.FirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(a){BI.FirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(a)}}),BI.shortcut("bi.first_plus_group_node",BI.FirstPlusGroupNode),BI.IconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.IconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-icon-arrow-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:25,iconHeight:13,iconWidth:13,iconCls:""})},_init:function(){BI.IconArrowNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.tree_group_node_checkbox",width:23,stopPropagation:!0});var c=BI.createWidget({type:"bi.center_adapt",cls:b.iconCls,width:23,items:[{type:"bi.icon",height:b.iconHeight,width:b.iconWidth}]});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&(this.isSelected()?a.triggerExpand():a.triggerCollapse())});var d=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),e=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:25,el:this.checkbox},{width:23,el:c},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(d,BI.extend(b.logic,{items:e}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.IconArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(a){BI.IconArrowNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(a)}}),BI.shortcut("bi.icon_arrow_node",BI.IconArrowNode),BI.LastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.LastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-last-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:25})},_init:function(){BI.LastPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&(this.isSelected()?a.triggerExpand():a.triggerCollapse())});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:25,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.LastPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(a){BI.LastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(a)}}),BI.shortcut("bi.last_plus_group_node",BI.LastPlusGroupNode),BI.MidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-mid-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:25})},_init:function(){BI.MidPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&(this.isSelected()?a.triggerExpand():a.triggerCollapse())});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:25,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MidPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(a){BI.MidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(a)}}),BI.shortcut("bi.mid_plus_group_node",BI.MidPlusGroupNode),BI.MultiLayerIconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerIconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-icon-arrow-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:25,iconHeight:13,iconWidth:13,iconCls:""})},_init:function(){BI.MultiLayerIconArrowNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.icon_arrow_node",iconCls:b.iconCls,id:b.id,pId:b.pId,open:b.open,height:b.height,iconHeight:b.iconHeight,iconWidth:b.iconWidth,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(b){a.setSelected(a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=[];BI.count(0,b.layer,function(){c.push({type:"bi.layout",width:13,height:b.height})}),c.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(b.layer,13),items:[c]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected(); },setSelected:function(a){BI.MultiLayerIconArrowNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(a)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(a){BI.MultiLayerIconArrowNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_icon_arrow_node",BI.MultiLayerIconArrowNode),BI.PlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.PlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:25})},_init:function(){BI.PlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:25,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.PlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(a){BI.PlusGroupNode.superclass.setOpened.apply(this,arguments),this.checkbox&&this.checkbox.setSelected(a)}}),BI.shortcut("bi.plus_group_node",BI.PlusGroupNode),BI.TriangleGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.TriangleGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-triangle-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:25})},_init:function(){BI.TriangleGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({iconWidth:13,iconHeight:13,type:"bi.tree_group_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py,keyword:b.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:25,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.TriangleGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isOpened())},setOpened:function(a){BI.TriangleGroupNode.superclass.setOpened.apply(this,arguments),this.checkbox.setSelected(a)},setText:function(a){BI.TriangleGroupNode.superclass.setText.apply(this,arguments),this.text.setText(a)}}),BI.shortcut("bi.triangle_group_node",BI.TriangleGroupNode),BI.FirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:25})},_init:function(){BI.FirstTreeLeafItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===b.layer?"":{width:13,el:{type:"bi.layout",cls:"base-line-conn-background",width:13,height:b.height}},{width:25,el:{type:"bi.layout",cls:"mid-line-conn-background",width:25,height:b.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.FirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(a){BI.FirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(a)}}),BI.shortcut("bi.first_tree_leaf_item",BI.FirstTreeLeafItem),BI.IconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.IconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},height:25,iconWidth:16,iconHeight:16,iconCls:""})},_init:function(){BI.IconTreeLeafItem.superclass._init.apply(this,arguments);var a=this.options,b=BI.createWidget({type:"bi.center_adapt",width:23,cls:a.iconCls,items:[{type:"bi.icon",width:a.iconWidth,height:a.iconHeight}]});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:a.height,height:a.height,hgap:a.hgap,text:a.text,value:a.value,py:a.py});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:23,el:b},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(a.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.IconTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(a){BI.IconTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.icon_tree_leaf_item",BI.IconTreeLeafItem),BI.LastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:25})},_init:function(){BI.LastTreeLeafItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===b.layer?"":{width:13,el:{type:"bi.layout",cls:"base-line-conn-background",width:13,height:b.height}},{width:25,el:{type:"bi.layout",cls:"mid-line-conn-background",width:25,height:b.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.LastTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(a){BI.LastTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.last_tree_leaf_item",BI.LastTreeLeafItem),BI.MidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:25})},_init:function(){BI.MidTreeLeafItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:b.height,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(b){b===BI.Events.CLICK&&a.setSelected(a.isSelected()),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),d=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===b.layer?"":{width:13,el:{type:"bi.layout",cls:"base-line-conn-background",width:13,height:b.height}},{width:25,el:{type:"bi.layout",cls:"mid-line-conn-background",width:25,height:b.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(c,BI.extend(b.logic,{items:d}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MidTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(a){BI.MidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(a)}}),BI.shortcut("bi.mid_tree_leaf_item",BI.MidTreeLeafItem),BI.MultiLayerIconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerIconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-icon-tree-leaf-item bi-list-item-active",layer:0,height:25,iconCls:"",iconHeight:14,iconWidth:12})},_init:function(){BI.MultiLayerIconTreeLeafItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.item=BI.createWidget({type:"bi.icon_tree_leaf_item",cls:"bi-list-item-none",iconCls:b.iconCls,id:b.id,pId:b.pId,isFront:!0,height:b.height,hgap:b.hgap,text:b.text,value:b.value,py:b.py,iconWidth:b.iconWidth,iconHeight:b.iconHeight}),this.item.on(BI.Controller.EVENT_CHANGE,function(b){b!==BI.Events.CLICK&&a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var c=[];BI.count(0,b.layer,function(){c.push({type:"bi.layout",width:13,height:b.height})}),c.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(b.layer,13),items:[c]})},doRedMark:function(){this.item.doRedMark.apply(this.item,arguments)},unRedMark:function(){this.item.unRedMark.apply(this.item,arguments)},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(a){BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(a)},getValue:function(){return this.options.value}}),BI.shortcut("bi.multilayer_icon_tree_leaf_item",BI.MultiLayerIconTreeLeafItem),BI.TreeTextLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.TreeTextLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tree-text-leaf-item bi-list-item-active",id:"",pId:"",height:25,hgap:0,lgap:0,rgap:0})},_init:function(){BI.TreeTextLeafItem.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:a.height,height:a.height,hgap:a.hgap,lgap:a.lgap,rgap:a.hgap,text:a.text,value:a.value,py:a.py}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text}]})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.tree_text_leaf_item",BI.TreeTextLeafItem),BI.Calendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.Calendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-calendar",logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:2015,month:7,day:25})},_dateCreator:function(a,b,c){var d=this.options,e={},f=new Date,g=d.min.match(/\d+/g),h=d.max.match(/\d+/g);a<(0|g[0])&&(a=0|g[0]),a>(0|h[0])&&(a=0|h[0]),f.setFullYear(a,b,c),e.ymd=[f.getFullYear(),f.getMonth(),f.getDate()];var i=Date._MD.slice(0);i[1]=Date.isLeap(e.ymd[0])?29:28,f.setFullYear(e.ymd[0],e.ymd[1],1),e.FDay=f.getDay(),e.PDay=i[0===b?11:b-1]-e.FDay+1,e.NDay=1;var j=[];return BI.each(BI.range(42),function(a){var b,c={},d=e.ymd[0],f=e.ymd[1]+1;a=e.FDay&&a=0?c%12:(12+c%12)%12;return{year:(new Date).getFullYear()+d,month:e}}}),BI.shortcut("bi.calendar",BI.Calendar),BI.YearCalendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.YearCalendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-year-calendar",behaviors:{},logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:null})},_yearCreator:function(a){var b=this.options;a=0|a;var c=BI.YearCalendar.getStartYear(a),d=[];return BI.each(BI.range(BI.YearCalendar.INTERVAL),function(a){var e={};Date.checkVoid(c+a,1,1,b.min,b.max)[0]&&(e.disabled=!0),e.text=c+a,d.push(e)}),d},_init:function(){BI.YearCalendar.superclass._init.apply(this,arguments);var a=this,b=this.options;this.currentYear=(new Date).getFullYear();var c=this._yearCreator(b.year||this.currentYear),d=c.length,e=BI.makeArray(d,""),f=[0,6,1,7,2,8,3,9,4,10,5,11];BI.each(c,function(a,b){e[a]=c[f[a]]});var g=[];g.push(e.slice(0,2)),g.push(e.slice(2,4)),g.push(e.slice(4,6)),g.push(e.slice(6,8)),g.push(e.slice(8,10)),g.push(e.slice(10,12)),g=BI.map(g,function(a,b){return BI.map(b,function(a,b){return BI.extend(b,{type:"bi.text_item",cls:"bi-list-item-active",textAlign:"center",whiteSpace:"normal",once:!1,forceSelected:!0,height:23,width:38,value:b.text,disabled:b.disabled})})}),this.years=BI.createWidget({type:"bi.button_group",behaviors:b.behaviors,items:BI.createItems(g,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({},b.logic,{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1}]}),this.years.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend({},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this.years)}))))},isFrontYear:function(){var a=this.options,b=a.year;return b=0|b,!!Date.checkVoid(BI.YearCalendar.getStartYear(b)-1,1,1,a.min,a.max)[0]},isFinalYear:function(){var a=this.options,b=(this._const,a.year);return b=0|b,!!Date.checkVoid(BI.YearCalendar.getEndYear(b)+1,1,1,a.min,a.max)[0]},setValue:function(a){this.years.setValue([a])},getValue:function(){return this.years.getValue()[0]}}),BI.extend(BI.YearCalendar,{INTERVAL:12,getStartYear:function(a){var b=(new Date).getFullYear();return a-((a-b+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(a){return BI.YearCalendar.getStartYear(a)+BI.YearCalendar.INTERVAL},getPageByYear:function(a){var b=(new Date).getFullYear();return a=BI.YearCalendar.getStartYear(a),(a-b+3)/BI.YearCalendar.INTERVAL}}),BI.shortcut("bi.year_calendar",BI.YearCalendar),BI.ComplexCanvas=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ComplexCanvas.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-complex-canvas"})},_init:function(){BI.ComplexCanvas.superclass._init.apply(this,arguments);var a=this.options;this.canvas=BI.createWidget({type:"bi.canvas",element:this,width:a.width,height:a.height})},branch:function(a,b,c,d,e,f){var g=this,h=[].slice.call(arguments);if(h.length<=5)return this.canvas.line.apply(this.canvas,arguments);var i;BI.isOdd(h.length)&&(i=BI.last(h),h=BI.initial(h)),h=[].slice.call(h,2);var j=BI.filter(h,function(a){return a%2===0}),k=BI.filter(h,function(a){return a%2!==0});i||(i={});var l=i.offset||20;if(b>d&&b>f||bd&&b>f)var m=Math.max.apply(this,k)+l;else var m=Math.min.apply(this,k)-l;var n=Math.min.apply(this,j),o=BI.indexOf(j,n),p=Math.max.apply(this,j),q=BI.indexOf(j,p);return this.canvas.line(n,k[o],n,m,p,m,p,k[q],i),BI.each(j,function(a,b){a!==q&&a!==o&&g.canvas.line(b,k[a],b,m,i)}),void this.canvas.line(a,m,a,b,i)}if(a>c&&a>e||ac&&a>e)var r=Math.max.apply(this,j)+l;else var r=Math.min.apply(this,j)-l;var s=Math.min.apply(this,k),t=BI.indexOf(k,s),u=Math.max.apply(this,k),v=BI.indexOf(k,u);return this.canvas.line(j[t],s,r,s,r,u,j[v],u,i),BI.each(k,function(a,b){a!==t&&a!==v&&g.canvas.line(j[a],b,r,b,i)}),void this.canvas.line(r,b,a,b,i)}},stroke:function(a){this.canvas.stroke(a)}}),BI.shortcut("bi.complex_canvas",BI.ComplexCanvas),BI.ArrowTreeGroupNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-arrow-tree-group-node",iconWidth:13,iconHeight:13})},_init:function(){BI.ArrowTreeGroupNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),a?this.element.removeClass("column-next-page-h-font").addClass("column-pre-page-h-font"):this.element.removeClass("column-pre-page-h-font").addClass("column-next-page-h-font")}}),BI.shortcut("bi.arrow_tree_group_node_checkbox",BI.ArrowTreeGroupNodeCheckbox),BI.CheckingMarkNode=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.CheckingMarkNode.superclass._defaultConfig.apply(this,arguments),{extraCls:"check-mark-font",iconWidth:13,iconHeight:13})},_init:function(){BI.CheckingMarkNode.superclass._init.apply(this,arguments),this.setSelected(this.options.selected)},setSelected:function(a){BI.CheckingMarkNode.superclass.setSelected.apply(this,arguments),a===!0?this.element.addClass("check-mark-font"):this.element.removeClass("check-mark-font")}}),BI.shortcut("bi.checking_mark_node",BI.CheckingMarkNode),BI.FirstTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type2",iconWidth:25,iconHeight:25})},_init:function(){BI.FirstTreeNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),a===!0?this.element.addClass("tree-expand-icon-type2"):this.element.removeClass("tree-expand-icon-type2")}}),BI.shortcut("bi.first_tree_node_checkbox",BI.FirstTreeNodeCheckbox),BI.LastTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type4",iconWidth:25,iconHeight:25})},_init:function(){BI.LastTreeNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),a===!0?this.element.addClass("tree-expand-icon-type3"):this.element.removeClass("tree-expand-icon-type3")}}),BI.shortcut("bi.last_tree_node_checkbox",BI.LastTreeNodeCheckbox),BI.MidTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type3",iconWidth:25,iconHeight:25})},_init:function(){BI.MidTreeNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),a===!0?this.element.addClass("tree-expand-icon-type3"):this.element.removeClass("tree-expand-icon-type3")}}),BI.shortcut("bi.mid_tree_node_checkbox",BI.MidTreeNodeCheckbox),BI.TreeGroupNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.TreeGroupNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-node-triangle-collapse-font",iconWidth:13,iconHeight:13})},_init:function(){BI.TreeGroupNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.TreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),a?this.element.removeClass("tree-node-triangle-collapse-font").addClass("tree-node-triangle-expand-font"):this.element.removeClass("tree-node-triangle-expand-font").addClass("tree-node-triangle-collapse-font")}}),BI.shortcut("bi.tree_group_node_checkbox",BI.TreeGroupNodeCheckbox),BI.TreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type1",iconWidth:25,iconHeight:25})},_init:function(){BI.TreeNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.TreeNodeCheckbox.superclass.setSelected.apply(this,arguments),a?this.element.addClass("tree-expand-icon-type1"):this.element.removeClass("tree-expand-icon-type1")}}),BI.shortcut("bi.tree_node_checkbox",BI.TreeNodeCheckbox);try{!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.Clipboard=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g0&&void 0!==arguments[0]?arguments[0]:{};this.action=a.action,this.emitter=a.emitter,this.target=a.target,this.text=a.text,this.trigger=a.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var a=this,b="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return a.removeFake()},this.fakeHandler=document.body.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[b?"right":"left"]="-9999px";var c=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=c+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=(0,e["default"])(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(document.body.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,e["default"])(this.target),this.copyText()}},{key:"copyText",value:function(){var a=void 0;try{a=document.execCommand(this.action)}catch(b){a=!1}this.handleResult(a)}},{key:"handleResult",value:function(a){this.emitter.emit(a?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=a,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(a){if(void 0!==a){if(!a||"object"!==("undefined"==typeof a?"undefined":f(a))||1!==a.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&a.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); diff --git a/src/base/table/table.js b/src/base/table/table.js index ed638eb05..5bb32c99f 100644 --- a/src/base/table/table.js +++ b/src/base/table/table.js @@ -349,18 +349,17 @@ BI.Table = BI.inherit(BI.Widget, { })))); this._initFreezeScroll(); - BI.nextTick(function () { - if (self.element.is(":visible")) { - self._resize(); - self.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); - } - }); BI.ResizeDetector.addResizeListener(this, function () { self._resize(); self.fireEvent(BI.Table.EVENT_TABLE_RESIZE); }); }, + mounted: function () { + this._resize(); + this.fireEvent(BI.Table.EVENT_TABLE_AFTER_INIT); + }, + _initFreezeScroll: function () { var self = this, o = this.options; scroll(this.scrollBottomRight.element, this.scrollTopRight.element, this.scrollBottomLeft.element);