From 93b5d6fb3734f4ec16e975adc7fc0dced84d2155 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 5 Jun 2018 13:40:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E5=81=87=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/_fineui.min.js | 10 +++++----- dist/bundle.js | 10 +++++----- dist/bundle.min.js | 8 ++++---- dist/case.js | 6 +++--- dist/fineui.js | 10 +++++----- dist/fineui.min.js | 10 +++++----- dist/widget.js | 4 ++-- .../combo/icontextvaluecombo/combo.icontextvalue.js | 2 +- src/case/trigger/trigger.icon.text.select.js | 4 ++-- src/widget/dynamicdate/dynamicdate.caculate.js | 4 ++-- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/dist/_fineui.min.js b/dist/_fineui.min.js index 9bef9c9fd..d9e689ed8 100644 --- a/dist/_fineui.min.js +++ b/dist/_fineui.min.js @@ -31,14 +31,14 @@ BI.each(a.columnSize,function(b,g){a.isNeedFreeze===!0&&a.freezeCols.contains(b) 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",iconCls:"",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.iconCls,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.iconCls!==a&&(this.element.removeClass(b.iconCls).addClass(a),b.iconCls=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",iconCls:"",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.iconCls,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",logic:{dynamic:!1},hgap:10,height:25})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var a=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:a.height,height:a.height,hgap:a.hgap,text:a.text,keyword:a.keyword,value:a.value,py:a.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},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_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())},setText:function(a){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(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,keyword:b.keyword}),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.arrow_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,keyword:b.keyword}),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,keyword:b.keyword}),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.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var a=this;return{type:"bi.absolute",ref:function(){a.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(a){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=a?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch),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,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,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,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,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,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,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:8,day:25})},_dateCreator:function(a,b,c){var d=this.options,e={},f=BI.getDate(),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]=BI.isLeapYear(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:BI.getDate().getFullYear()+d,month:e+1}}}),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={};BI.checkDateVoid(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=BI.getDate().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,!!BI.checkDateVoid(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,!!BI.checkDateVoid(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=BI.getDate().getFullYear();return a-((a-b+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(a){return BI.YearCalendar.getStartYear(a)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(a){var b=BI.getDate().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-group-node-checkbox"})},_init:function(){BI.ArrowTreeGroupNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),a?this.element.removeClass("pull-right-font").addClass("pull-down-font"):this.element.removeClass("pull-down-font").addClass("pull-right-font")}}),BI.shortcut("bi.arrow_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"})},_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.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');if("cut"===this.action&&(a.hasAttribute("readonly")||a.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=a}},get:function(){return this._target}}]),a}();a.exports=h})},{select:5}],8:[function(b,c,d){!function(e,f){if("function"==typeof a&&a.amd)a(["module","./clipboard-action","tiny-emitter","good-listener"],f);else if("undefined"!=typeof d)f(c,b("./clipboard-action"),b("tiny-emitter"),b("good-listener"));else{var g={exports:{}};f(g,e.clipboardAction,e.tinyEmitter,e.goodListener),e.clipboard=g.exports}}(this,function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function i(a,b){var c="data-clipboard-"+a;if(b.hasAttribute(c))return b.getAttribute(c)}var j=e(b),k=e(c),l=e(d),m=function(){function a(a,b){for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof a.action?a.action:this.defaultAction,this.target="function"==typeof a.target?a.target:this.defaultTarget,this.text="function"==typeof a.text?a.text:this.defaultText}},{key:"listenClick",value:function(a){var b=this;this.listener=(0,l["default"])(a,"click",function(a){return b.onClick(a)})}},{key:"onClick",value:function(a){var b=a.delegateTarget||a.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new j["default"]({action:this.action(b),target:this.target(b),text:this.text(b),trigger:b,emitter:this})}},{key:"defaultAction",value:function(a){return i("action",a)}},{key:"defaultTarget",value:function(a){var b=i("target",a);if(b)return document.querySelector(b)}},{key:"defaultText",value:function(a){return i("text",a)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],b="string"==typeof a?[a]:a,c=!!document.queryCommandSupported;return b.forEach(function(a){c=c&&!!document.queryCommandSupported(a)}),c}}]),b}(k["default"]);a.exports=n})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)})}catch(e){!function(a){a.fn.zclip=function(b){if("object"==typeof b&&!b.length){var c=a.extend({path:"ZeroClipboard.swf",copy:null,beforeCopy:null,afterCopy:null,clickAfter:!0,setHandCursor:!0,setCSSEffects:!0},b);return this.each(function(){var b=a(this);if(b.is(":visible")&&("string"==typeof c.copy||a.isFunction(c.copy))){ZeroClipboard.setMoviePath(c.path);var d=new ZeroClipboard.Client;a.isFunction(c.copy)&&b.bind("zClip_copy",c.copy),a.isFunction(c.beforeCopy)&&b.bind("zClip_beforeCopy",c.beforeCopy),a.isFunction(c.afterCopy)&&b.bind("zClip_afterCopy",c.afterCopy),d.setHandCursor(c.setHandCursor),d.setCSSEffects(c.setCSSEffects),d.addEventListener("mouseOver",function(a){b.trigger("mouseenter")}),d.addEventListener("mouseOut",function(a){b.trigger("mouseleave")}),d.addEventListener("mouseDown",function(e){b.trigger("mousedown"),a.isFunction(c.copy)?d.setText(b.triggerHandler("zClip_copy")):d.setText(c.copy),a.isFunction(c.beforeCopy)&&b.trigger("zClip_beforeCopy")}),d.addEventListener("complete",function(d,e){a.isFunction(c.afterCopy)?b.trigger("zClip_afterCopy"):(e.length>500&&(e=e.substr(0,500)+"...\n\n("+(e.length-500)+" characters not shown)"),b.removeClass("hover"),alert("Copied text to clipboard:\n\n "+e)),c.clickAfter&&b.trigger("click")}),d.glue(b[0],b.parent()[0]),a(window).bind("load resize",function(){d.reposition()})}})}if("string"==typeof b)return this.each(function(){var c=a(this);b=b.toLowerCase();var d=c.data("zclipId"),e=a("#"+d+".zclip");"remove"==b?(e.remove(),c.removeClass("active hover")):"hide"==b?(e.hide(),c.removeClass("active hover")):"show"==b&&e.show()})}}(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){return"string"==typeof a&&(a=document.getElementById(a)),a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a),this.className+=" "+a},a.removeClass=function(a){for(var b=this.className.split(/\s+/),c=-1,d=0;d-1&&(b.splice(c,1),this.className=b.join(" ")),this},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){var d=this.clients[a];d&&d.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a,b){var c={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};return a&&a!=b&&(c.left+=a.offsetLeft,c.top+=a.offsetTop),c},Client:function(a){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),a&&this.glue(a)}};ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,glue:function(a,b,c){this.domElement=ZeroClipboard.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex,10)+1),"string"==typeof b?b=ZeroClipboard.$(b):"undefined"==typeof b&&(b=document.getElementsByTagName("body")[0]);var e=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div"),this.div.className="zclip",this.div.id="zclip-"+this.movieId,$(this.domElement).data("zclipId","zclip-"+this.movieId);var f=this.div.style;if(f.position="absolute",f.left=""+e.left+"px",f.top=""+e.top+"px",f.width=""+e.width+"px",f.height=""+e.height+"px",f.zIndex=d,"object"==typeof c)for(addedStyle in c)f[addedStyle]=c[addedStyle];b.appendChild(this.div),this.div.innerHTML=this.getHTML(e.width,e.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+=''}else c+='';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null,this.div=null}},reposition:function(a){if(a&&(this.domElement=ZeroClipboard.$(a),this.domElement||this.hide()),this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.top+"px"}},setText:function(a){this.clipText=a,this.ready&&this.movie.setText(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=[]),this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a,this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){switch(a=a.toString().toLowerCase().replace(/^on/,"")){case"load":if(this.movie=document.getElementById(this.movieId),!this.movie){var c=this;return void setTimeout(function(){c.receiveEvent("load",null)},1)}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;return setTimeout(function(){c.receiveEvent("load",null)},100),void(this.ready=!0)}this.ready=!0;try{this.movie.setText(this.clipText)}catch(d){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(d){}break;case"mouseover":this.domElement&&this.cssEffects&&(this.domElement.addClass("hover"),this.recoverActive&&this.domElement.addClass("active"));break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0),this.domElement.removeClass("hover"));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var e=0,f=this.handlers[a].length;e=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!1,value:255,width:32,height:20});BI.each(d,function(b,d){d.on(BI.TextEditor.EVENT_CHANGE,function(){a._checkEditors(),c(a.storeValue.r)&&c(a.storeValue.g)&&c(a.storeValue.b)&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("")):a.setValue(a.lastColor||"#ffffff"),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("transparent")):("transparent"===a.lastColor&&(a.lastColor=""),a.setValue(a.lastColor||"#ffffff")),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,width:"fill"},{el:b[0],lgap:10,width:16},{el:this.R,width:32},{el:b[1],lgap:10,width:16},{el:this.G,width:32},{el:b[2],lgap:10,width:16},{el:this.B,width:32},{el:{type:"bi.center_adapt",items:[this.none]},width:18},{el:{type:"bi.center_adapt",items:[this.transparent]},width:18}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(a){""===a?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===a?this.colorShow.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":a}).removeClass("auto-color-background").removeClass("trans-color-background")},setValue:function(a){if("transparent"===a)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});a?this.none.setSelected(!1):(a="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(a);var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.storeValue={r:BI.isNull(b.r)?"":b.r,g:BI.isNull(b.r)?"":b.g,b:BI.isNull(b.r)?"":b.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="ColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:20})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var a=this;this.options;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card",height:20});var b=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:10,height:20})),c=function(a){return BI.isNumeric(a)&&(0|a)>=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:32,height:20});BI.each(d,function(b,c){c.on(BI.TextEditor.EVENT_CHANGE,function(){a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,lgap:5,rgap:5},{el:b[0],lgap:10,width:16},{el:this.R,width:36},{el:b[1],lgap:10,width:16},{el:this.G,width:36},{el:b[2],lgap:10,width:16},{el:this.B,width:36,rgap:10}]})},setValue:function(a){this.colorShow.element.css({"background-color":a});var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.R.setValue(BI.isNull(b.r)?"":b.r),this.G.setValue(BI.isNull(b.g)?"":b.g),this.B.setValue(BI.isNull(b.b)?"":b.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="SimpleColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-farbtastic",width:195,height:195})},_init:function(){BI.Farbtastic.superclass._init.apply(this,arguments)},mounted:function(){var a=this;this.farbtastic=$.farbtastic(this.element,function(b){a.fireEvent(BI.Farbtastic.EVENT_CHANGE,a.getValue(),a)})},setValue:function(a){this.farbtastic.setColor(a)},getValue:function(){return this.farbtastic.color}}),BI.Farbtastic.EVENT_CHANGE="Farbtastic.EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),jQuery.fn.farbtastic=function(a){return $.farbtastic(this,a),this},jQuery.farbtastic=function(a,b){var a=$(a).get(0);return a.farbtastic||(a.farbtastic=new jQuery._farbtastic(a,b))},jQuery._farbtastic=function(a,b){var c=this;$(a).html('
    ');var d=$(".farbtastic",a);c.wheel=$(".wheel",a).get(0),c.radius=84,c.square=100,c.width=194,navigator.appVersion.match(/MSIE [0-6]\./)&&$("*",d).each(function(){if("none"!=this.currentStyle.backgroundImage){var a=this.currentStyle.backgroundImage;a=this.currentStyle.backgroundImage.substring(5,a.length-2),$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+a+"')"})}}),c.linkTo=function(a){return"object"==typeof c.callback&&$(c.callback).unbind("keyup",c.updateValue),c.color=null,"function"==typeof a?c.callback=a:"object"!=typeof a&&"string"!=typeof a||(c.callback=$(a),c.callback.bind("keyup",c.updateValue),c.callback.get(0).value&&c.setColor(c.callback.get(0).value)),this},c.updateValue=function(a){this.value&&this.value!=c.color&&c.setColor(this.value)},c.setColor=function(a){var b=c.unpack(a);return c.color!=a&&b&&(c.color=a,c.rgb=b,c.hsl=c.RGBToHSL(c.rgb),c.updateDisplay()),this},c.setHSL=function(a){return c.hsl=a,c.rgb=c.HSLToRGB(a),c.color=c.pack(c.rgb),c.updateDisplay(),this},c.widgetCoords=function(a){var b,d,e=a.target||a.srcElement,f=c.wheel;if("undefined"!=typeof a.offsetX){for(var g={x:a.offsetX,y:a.offsetY},h=e;h;)h.mouseX=g.x,h.mouseY=g.y,g.x+=h.offsetLeft,g.y+=h.offsetTop,h=h.offsetParent;for(var h=f,i={x:0,y:0};h;){if("undefined"!=typeof h.mouseX){b=h.mouseX-i.x,d=h.mouseY-i.y;break}i.x+=h.offsetLeft,i.y+=h.offsetTop,h=h.offsetParent}for(h=e;h;)h.mouseX=void 0,h.mouseY=void 0,h=h.offsetParent}else{var g=c.absolutePosition(f);b=(a.pageX||0*(a.clientX+$("html").get(0).scrollLeft))-g.x,d=(a.pageY||0*(a.clientY+$("html").get(0).scrollTop))-g.y}return{x:b-c.width/2,y:d-c.width/2}},c.click=function(a){var b=c.widgetCoords(a);return c.circleDrag=2*Math.max(Math.abs(b.x),Math.abs(b.y))>c.square,c.mousemove(a),!1},c.mousemove=function(a){var b=c.widgetCoords(a);if(c.circleDrag){var d=Math.atan2(b.x,-b.y)/6.28;d<0&&(d+=1),c.setHSL([d,c.hsl[1],c.hsl[2]])}else{var e=Math.max(0,Math.min(1,-(b.x/c.square)+.5)),f=Math.max(0,Math.min(1,-(b.y/c.square)+.5));c.setHSL([c.hsl[0],e,f])}return!1},c.updateDisplay=function(){var a=6.28*c.hsl[0];$(".h-marker",d).css({left:Math.round(Math.sin(a)*c.radius+c.width/2)+"px",top:Math.round(-Math.cos(a)*c.radius+c.width/2)+"px"}),$(".sl-marker",d).css({left:Math.round(c.square*(.5-c.hsl[1])+c.width/2)+"px",top:Math.round(c.square*(.5-c.hsl[2])+c.width/2)+"px"}),$(".color",d).css("backgroundColor",c.pack(c.HSLToRGB([c.hsl[0],1,.5]))),"object"==typeof c.callback?($(c.callback).css({backgroundColor:c.color,color:c.hsl[2]>.5?"#000":"#fff"}),$(c.callback).each(function(){this.value&&this.value!=c.color&&(this.value=c.color)})):"function"==typeof c.callback&&c.callback.call(c,c.color)},c.absolutePosition=function(a){var b={x:a.offsetLeft,y:a.offsetTop};if(a.offsetParent){var d=c.absolutePosition(a.offsetParent);b.x+=d.x,b.y+=d.y}return b},c.pack=function(a){var b=Math.round(255*a[0]),c=Math.round(255*a[1]),d=Math.round(255*a[2]);return"#"+(b<16?"0":"")+b.toString(16)+(c<16?"0":"")+c.toString(16)+(d<16?"0":"")+d.toString(16)},c.unpack=function(a){return 7==a.length?[parseInt("0x"+a.substring(1,3))/255,parseInt("0x"+a.substring(3,5))/255,parseInt("0x"+a.substring(5,7))/255]:4==a.length?[parseInt("0x"+a.substring(1,2))/15,parseInt("0x"+a.substring(2,3))/15,parseInt("0x"+a.substring(3,4))/15]:void 0},c.HSLToRGB=function(a){var b,c,d=a[0],e=a[1],f=a[2];return c=f<=.5?f*(e+1):f+e-f*e,b=2*f-c,[this.hueToRGB(b,c,d+.33333),this.hueToRGB(b,c,d),this.hueToRGB(b,c,d-.33333)]},c.hueToRGB=function(a,b,c){return c=c<0?c+1:c>1?c-1:c,6*c<1?a+(b-a)*c*6:2*c<1?b:3*c<2?a+(b-a)*(.66666-c)*6:a},c.RGBToHSL=function(a){var b,c,d,e,f,g,h=a[0],i=a[1],j=a[2];return b=Math.min(h,Math.min(i,j)),c=Math.max(h,Math.max(i,j)),d=c-b,g=(b+c)/2,f=0,g>0&&g<1&&(f=d/(g<.5?2*g:2-2*g)),e=0,d>0&&(c==h&&c!=i&&(e+=(i-j)/d),c==i&&c!=j&&(e+=2+(j-h)/d),c==j&&c!=h&&(e+=4+(h-i)/d),e/=6),[e,f,g]},$("*",d).click(c.click),c.setColor("#000000"),b&&c.linkTo(b)},BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:b.trigger,toggle:b.toggle,direction:b.direction,isDefaultInit:b.isDefaultInit,destroyWhenHide:b.destroyWhenHide,isNeedAdjustHeight:b.isNeedAdjustHeight,isNeedAdjustWidth:b.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:b.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:b.hideChecker,offsetStyle:b.offsetStyle,el:b.el,popup:BI.extend({type:"bi.bubble_popup_view"},b.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){a.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){a.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){a._showTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){a._hideTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(a){var b={},c={},d=this.options.adjustLength,e=this.element.offset(),f=e.left,g=e.left+this.element.outerWidth(),h=e.top,i=e.top+this.element.outerHeight();switch(a){case"left":b={top:h,height:this.element.outerHeight(),left:f-d-this._const.TRIANGLE_LENGTH},c={width:this._const.TRIANGLE_LENGTH};break;case"right":b={top:h,height:this.element.outerHeight(),left:g+d},c={width:this._const.TRIANGLE_LENGTH};break;case"top":b={left:f,width:this.element.outerWidth(),top:h-d-this._const.TRIANGLE_LENGTH},c={height:this._const.TRIANGLE_LENGTH};break;case"bottom":b={left:f,width:this.element.outerWidth(),top:i+d},c={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(c,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+a+" bi-high-light-border"}]}),b.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var a=this.combo.getPopupPosition();switch(a.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:a.baseCls+" bi-bubble-popup-view"})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)},showLine:function(a){var b={},c={};switch(a){case"left":b={top:0,bottom:0,left:-1},c={width:3};break;case"right":b={top:0,bottom:0,right:-1},c={width:3};break;case"top":b={left:0,right:0,top:-1},c={height:3};break;case"bottom":b={left:0,right:0,bottom:-1},c={height:3}}this.line=BI.createWidget(c,{type:"bi.layout",cls:"bubble-popup-line bi-high-light-background"}),b.el=this.line,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},hideLine:function(){this.line&&this.line.destroy()}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:BI.i18nText("BI-Basic_Cancel"),level:"ignore"},{value:BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this,c=[];return BI.each(a.buttons,function(a,d){BI.isWidget(d)?c.push(d):c.push(BI.extend({type:"bi.button",height:30,handler:function(a){b.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,a)}},d))}),BI.createWidget({type:"bi.right_vertical_adapt",height:40,hgap:10,bgap:10,items:c})}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:{baseCls:"bi-text-bubble-bar-popup-view",text:"",width:250},render:function(){var a=this,b=this.options;return{type:"bi.bubble_bar_popup_view",ref:function(){a.popup=this},el:{type:"bi.vertical",items:[{type:"bi.label",text:b.text,whiteSpace:"normal",textAlign:"left",ref:function(){a.text=this}}],hgap:10,tgap:25,bgap:10},buttons:[{type:"bi.button",value:BI.i18nText("BI-Basic_Cancel"),level:"ignore",height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!1)}},{type:"bi.button",value:BI.i18nText("BI-Basic_Sure"),height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!0)}}]}},populate:function(a){this.text.setText(a||this.options.text)},showLine:function(a){this.popup.showLine(a)},hideLine:function(){this.popup.hideLine()}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:b.items,height:b.height,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText,value:b.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){a.popup.setValue(this.getValue()),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.editorIconCheckCombo.hideView(),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.editorIconCheckCombo.setValue(a)},getValue:function(){return this.trigger.getValue()},populate:function(a){this.options.items=a,this.editorIconCheckCombo.populate(a)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:28,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.icon_combo_trigger",iconCls:b.iconCls,title:b.title,items:b.items,width:b.width,height:b.height,iconWidth:b.iconWidth,iconHeight:b.iconHeight,value:b.value}),this.popup=BI.createWidget(b.popup,{type:"bi.icon_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.iconCombo.hideView(),a.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:b.direction,trigger:b.trigger,container:b.container,adjustLength:b.adjustLength,adjustXOffset:b.adjustXOffset,adjustYOffset:b.adjustYOffset,offsetStyle:b.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:b.maxWidth,maxHeight:b.maxHeight,minWidth:b.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.iconCombo.populate(a)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:28,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var a=this.options,b="";BI.isKey(a.value)&&(b=this._digest(a.value,a.items)),this.button=BI.createWidget(a.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:b,disableSelected:!0,width:a.isShowDown?a.width-12:a.width,height:a.height,iconWidth:a.iconWidth,iconHeight:a.iconHeight,selected:BI.isNotEmptyString(b)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font",width:12,height:8,selected:BI.isNotEmptyString(b)}),this.down.setVisible(a.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:0,bottom:0}]})},_digest:function(a,b){var c="";return a=BI.isArray(a)?a[0]:a,BI.any(b,function(b,d){if(a===d.value)return c=d.iconCls,!0}),c},populate:function(a){var b=this.options;this.options.items=a||[],this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(a){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var b=this.options,c=this._digest(a,this.options.items);a=BI.isArray(a)?a[0]:a,BI.isNotEmptyString(c)?(this.button.setIcon(c),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-icon-text-value-combo",height:30,iconHeight:null,iconWidth:null,value:""})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",items:b.items,height:b.height,text:b.text,defaultIconCls:b.defaultIconCls,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:b.items,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup"})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30,iconHeight:a.iconHeight,iconWidth:a.iconWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE, -layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var b=this.options;a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:30,text:"",items:[],tipType:"",warningTitle:""},render:function(){var a=this,b=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",adjustLength:2,toggle:!1,ref:function(){a.combo=this},el:{type:"bi.search_text_value_trigger",ref:function(){a.trigger=this},items:b.items,height:b.height-2,text:b.text,value:b.value,tipType:b.tipType,warningTitle:b.warningTitle,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:b.value,items:b.items,ref:function(){a.popup=this,a.trigger.getSearcher().setAdapter(a.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},maxHeight:302},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(b){return 0===a.triggerBtn.element.find(b.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){a.triggerBtn=this},width:b.height,height:b.height,handler:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var a=this.options;BI.isKey(a.value)&&this._checkError(a.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},populate:function(a){this.combo.populate(a)},setValue:function(a){this.combo.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var a=this,b=this.options;return{type:"bi.vertical",items:[{type:"bi.button_group",ref:function(){a.popup=this},items:BI.createItems(b.items,{type:"bi.single_select_item",textAlign:b.textAlign,height:30}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,c,d)}}]}]}},populate:function(a,b,c){var d=BI.concat(a,b);BI.SearchTextValueComboPopup.superclass.populate.apply(this,d),d=BI.createItems(d,{type:"bi.single_select_item",height:30}),this.popup.populate(d,c)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{baseCls:"bi-search-text-value-trigger bi-border",height:30},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){a.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){a.editor=this},text:this._digest(b.value,b.items),value:b.value,height:b.height},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(a,c){var d=a.keyword,e=BI.Func.getSearchResult(b.items,d),f=e.match,g=e.find;c(g,f)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){a.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:30},width:30}]}},_setState:function(a){this.editor.setState(a)},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(a){this.options.items=a},setValue:function(a){this._setState(this._digest(a,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.StaticCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-static-combo",height:24,text:"",el:{},items:[],chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.StaticCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",cls:"bi-border",items:b.items,height:b.height,text:b.text,readonly:!0}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",textAlign:b.textAlign,chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.StaticCombo.EVENT_CHANGE,arguments)}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}})},populate:function(a){this.combo.populate(a)},setValue:function(a){this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.StaticCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_combo",BI.StaticCombo),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:""})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCheckCombo.hideView(),a.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setTitle:function(a){this.trigger.setTitle(a)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},setWarningTitle:function(a){this.trigger.setWarningTitle(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCheckCombo.populate(a)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.SmallTextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:""})},_init:function(){BI.SmallTextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextIconCheckCombo.hideView(),a.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.SmallTextIconCheckCombo.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextIconCheckCombo.populate(a)}}),BI.SmallTextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_check_combo",BI.SmallTextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(a.items),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_formatItems:function(a){return BI.map(a,function(a,b){return BI.extend({type:"bi.icon_text_item",cls:"item-check-font bi-list-item",height:30},b)})},populate:function(a){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(a))},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:30,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:""})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,value:b.value,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this._checkError(b.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextValueCombo.hideView(),a.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextValueCombo.populate(a)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_item",textAlign:a.textAlign,height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:30})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this._createValueMap();var c;BI.isNotNull(b.value)&&(c=this._digest(b.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",height:b.height,items:b.items,text:b.text,value:c}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:b.height,el:this.trigger,value:BI.isNull(c)?[]:[c],items:BI.deepClone(b.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){a.setValue(a.combo.getValue()[0].value),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){a.setValue(a.combo.getValue()[0].childValue),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)})},_createValueMap:function(){var a=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(b,c){BI.has(c,"el")?BI.each(c.children,function(b,d){a.valueMap[d.value]={value:c.el.value,childValue:d.value}}):a.valueMap[c.value]={value:c.value}})},_digest:function(a){return this.valueMap[a]},setValue:function(a){a=this._digest(a),this.combo.setValue([a]),this.trigger.setValue(a)},getValue:function(){var a=this.combo.getValue()[0];return[a.childValue||a.value]},populate:function(a){this.options.items=BI.flatten(a),this.combo.populate(a),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:a.height,items:this._formatItemArray(a.items),text:a.text,value:BI.isNull(a.value)?"":a.value.childValue||a.value.value})},_formatItemArray:function(){var a=BI.flatten(BI.deepClone(this.options.items)),b=[];return BI.each(a,function(a,c){BI.has(c,"el")?(BI.each(c.children,function(a,b){b.text=c.el.text+"("+b.text+")"}),b=BI.concat(b,c.children)):b.push(c)}),b},setValue:function(a){this.trigger.setValue(a.childValue||a.value)},populate:function(a){this.trigger.populate(this._formatItemArray(a))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker,value:b.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(b.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:b.textAlign,height:b.height,hgap:4}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText(),this.text.doRedMark(b.keyword)},_checkText:function(){var a=this.options;""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setTextStyle:function(a){this.text.setStyle(a)},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignInitialEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignInitialEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-initial-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",value:"",text:"",height:24})},_init:function(){BI.SignInitialEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignInitialEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignInitialEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignInitialEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignInitialEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignInitialEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignInitialEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignInitialEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignInitialEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignInitialEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark");else{var b=this.editor.getValue();b=BI.isEmpty(b)||b==a.text?a.text:b+"("+a.text+")",this.text.setValue(b),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue(); -},setValue:function(a){var b=this.options;this.editor.setValue(a.value),b.text=a.text||b.text,this._checkText()},getValue:function(){return{value:this.editor.getValue(),text:this.options.text}},getState:function(){return this.text.getValue()},setState:function(a){var b=this.options;this._showHint(),a=BI.isEmpty(a)||a==b.text?b.text:a+"("+b.text+")",this.text.setValue(a)}}),BI.SignInitialEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignInitialEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignInitialEditor.EVENT_BLUR="EVENT_BLUR",BI.SignInitialEditor.EVENT_CLICK="EVENT_CLICK",BI.SignInitialEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignInitialEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignInitialEditor.EVENT_START="EVENT_START",BI.SignInitialEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignInitialEditor.EVENT_STOP="EVENT_STOP",BI.SignInitialEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignInitialEditor.EVENT_VALID="EVENT_VALID",BI.SignInitialEditor.EVENT_ERROR="EVENT_ERROR",BI.SignInitialEditor.EVENT_ENTER="EVENT_ENTER",BI.SignInitialEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignInitialEditor.EVENT_SPACE="EVENT_SPACE",BI.SignInitialEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_initial_editor",BI.SignInitialEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.StateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.setTitle(""),this.text.element.addClass("state-editor-infinite-text"))):BI.isString(a)?(this.text.setText(a),this.text.setTitle(a),void this.text.element.removeClass("state-editor-infinite-text")):void(BI.isArray(a)&&(BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):1===a.length?(this.text.setText(a[0]),this.text.setTitle(a[0]),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text"))))}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text"))):void(BI.isArray(a)&&1!==a.length?BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(a),this.text.setTitle(a),this.text.element.removeClass("state-editor-infinite-text")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor),BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this;if(0!==a.buttons.length){var c=[];return BI.each(a.buttons,function(a,b){c.push({text:b,value:a})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-border-top",height:30,items:BI.createItems(c,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(a,c){b.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,a,c)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var a=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var a=this,b=this.options,c=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return c.on(BI.IconButton.EVENT_CHANGE,function(){a.setVisible(!1),a.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-background bi-border",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:b.title,height:25,lgap:10}},{el:c,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var a=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget(b.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:b.items,itemsCreator:function(c,d){1===c.times&&(a.empty(),BI.nextTick(function(){a.loading()})),b.itemsCreator(c,function(){d.apply(a,arguments),1===c.times&&BI.nextTick(function(){a.loaded()})})},hasNext:b.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.ListPane.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,vgap:b.vgap,hgap:b.hgap},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(a){this.options.items=a.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(a){this.options.items=this.options.items.concat(a),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(a){a=a||[],BI.removeAt(this.options.items,a),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(a){var b=this;this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");b.populate.apply(b,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(a){return this.button_group.getIndexByValue(a)},getNodeById:function(a){return this.button_group.getNodeById(a)},getNodeByValue:function(a){return this.button_group.getNodeByValue(a)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var a=this,b=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:b.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:b.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Panel.EVENT_CHANGE,b,c)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(a){this.text.setValue(a)}}),BI.Panel.EVENT_CHANGE="Panel.EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var a=this,b=this.options;return[{type:"bi.label",text:b.text,height:b.height,value:b.value,hgap:b.hgap,ref:function(){a.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:3,ref:function(){a.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(a){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),a?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-border-bottom",items:[],height:29},render:function(){var a=this,b=this.options;return{type:"bi.button_group",items:BI.createItems(b.items,{type:"bi.linear_segment_button",height:b.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){a.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.buttonGroup=this}}},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar"},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.toolbar=BI.createWidget(b.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.allSelected=this.isSelected(),b===BI.Events.CLICK&&(a.setAllSelected(a.allSelected),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(b.el,{type:"bi.list_pane",items:b.items,itemsCreator:function(c,d){1===c.times&&a.toolbar.setVisible(!1),b.itemsCreator(c,function(b){d.apply(a,arguments),1===c.times&&(a.toolbar.setVisible(b&&b.length>0),a.toolbar.setEnable(b&&b.length>0)),a._checkAllSelected()})},onLoaded:b.onLoaded,hasNext:b.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){b===BI.Events.CLICK&&(a._checkAllSelected(),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(b.direction),BI.extend({scrolly:!0},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(b.direction,this.toolbar,this.list)})))),b.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(b.value)&&this.setValue(b.value)},_checkAllSelected:function(){var a=this.list.getValue().length,b=this.getAllLeaves().length-a,c=this.list.hasNext(),d=this.toolbar.isSelected(),e=a>0&&(b>0||!d&&c);e=e||b>0&&c&&d,this.toolbar.setHalfSelected(e),!e&&this.toolbar.setSelected(a>0&&b<=0&&(!c||d))},setAllSelected:function(a){BI.each(this.getAllButtons(),function(b,c){(c.setSelected||c.setAllSelected).apply(c,[a])}),this.allSelected=!!a,this.toolbar.setSelected(a),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(a){this.toolbar.setVisible(a)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(a){this.list.prependItems.apply(this.list,arguments)},addItems:function(a){this.list.addItems.apply(this.list,arguments)},setValue:function(a){var b=a.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(b),this.list[b?"setNotSelectedValue":"setValue"](a.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(a){this.toolbar.setVisible(!BI.isEmptyArray(a)),this.toolbar.setEnable(!BI.isEmptyArray(a)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(a){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(a)},resetHeight:function(a){var b=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(a-b):this.list.element.css({"max-height":a-b+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(a){return this.list.getIndexByValue(a)},getNodeById:function(a){return this.list.getNodeById(a)},getNodeByValue:function(a){return this.list.getNodeByValue(a)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var a=this,b=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var c=b.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:b.el,itemsCreator:function(b,c){c(a._getNextItems(b))},hasNext:function(a){return a.count=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!1,value:255,width:32,height:20});BI.each(d,function(b,d){d.on(BI.TextEditor.EVENT_CHANGE,function(){a._checkEditors(),c(a.storeValue.r)&&c(a.storeValue.g)&&c(a.storeValue.b)&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("")):a.setValue(a.lastColor||"#ffffff"),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("transparent")):("transparent"===a.lastColor&&(a.lastColor=""),a.setValue(a.lastColor||"#ffffff")),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,width:"fill"},{el:b[0],lgap:10,width:16},{el:this.R,width:32},{el:b[1],lgap:10,width:16},{el:this.G,width:32},{el:b[2],lgap:10,width:16},{el:this.B,width:32},{el:{type:"bi.center_adapt",items:[this.none]},width:18},{el:{type:"bi.center_adapt",items:[this.transparent]},width:18}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(a){""===a?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===a?this.colorShow.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":a}).removeClass("auto-color-background").removeClass("trans-color-background")},setValue:function(a){if("transparent"===a)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});a?this.none.setSelected(!1):(a="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(a);var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.storeValue={r:BI.isNull(b.r)?"":b.r,g:BI.isNull(b.r)?"":b.g,b:BI.isNull(b.r)?"":b.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="ColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:20})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var a=this;this.options;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card",height:20});var b=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:10,height:20})),c=function(a){return BI.isNumeric(a)&&(0|a)>=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:32,height:20});BI.each(d,function(b,c){c.on(BI.TextEditor.EVENT_CHANGE,function(){a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,lgap:5,rgap:5},{el:b[0],lgap:10,width:16},{el:this.R,width:36},{el:b[1],lgap:10,width:16},{el:this.G,width:36},{el:b[2],lgap:10,width:16},{el:this.B,width:36,rgap:10}]})},setValue:function(a){this.colorShow.element.css({"background-color":a});var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.R.setValue(BI.isNull(b.r)?"":b.r),this.G.setValue(BI.isNull(b.g)?"":b.g),this.B.setValue(BI.isNull(b.b)?"":b.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="SimpleColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-farbtastic",width:195,height:195})},_init:function(){BI.Farbtastic.superclass._init.apply(this,arguments)},mounted:function(){var a=this;this.farbtastic=$.farbtastic(this.element,function(b){a.fireEvent(BI.Farbtastic.EVENT_CHANGE,a.getValue(),a)})},setValue:function(a){this.farbtastic.setColor(a)},getValue:function(){return this.farbtastic.color}}),BI.Farbtastic.EVENT_CHANGE="Farbtastic.EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),jQuery.fn.farbtastic=function(a){return $.farbtastic(this,a),this},jQuery.farbtastic=function(a,b){var a=$(a).get(0);return a.farbtastic||(a.farbtastic=new jQuery._farbtastic(a,b))},jQuery._farbtastic=function(a,b){var c=this;$(a).html('
    ');var d=$(".farbtastic",a);c.wheel=$(".wheel",a).get(0),c.radius=84,c.square=100,c.width=194,navigator.appVersion.match(/MSIE [0-6]\./)&&$("*",d).each(function(){if("none"!=this.currentStyle.backgroundImage){var a=this.currentStyle.backgroundImage;a=this.currentStyle.backgroundImage.substring(5,a.length-2),$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+a+"')"})}}),c.linkTo=function(a){return"object"==typeof c.callback&&$(c.callback).unbind("keyup",c.updateValue),c.color=null,"function"==typeof a?c.callback=a:"object"!=typeof a&&"string"!=typeof a||(c.callback=$(a),c.callback.bind("keyup",c.updateValue),c.callback.get(0).value&&c.setColor(c.callback.get(0).value)),this},c.updateValue=function(a){this.value&&this.value!=c.color&&c.setColor(this.value)},c.setColor=function(a){var b=c.unpack(a);return c.color!=a&&b&&(c.color=a,c.rgb=b,c.hsl=c.RGBToHSL(c.rgb),c.updateDisplay()),this},c.setHSL=function(a){return c.hsl=a,c.rgb=c.HSLToRGB(a),c.color=c.pack(c.rgb),c.updateDisplay(),this},c.widgetCoords=function(a){var b,d,e=a.target||a.srcElement,f=c.wheel;if("undefined"!=typeof a.offsetX){for(var g={x:a.offsetX,y:a.offsetY},h=e;h;)h.mouseX=g.x,h.mouseY=g.y,g.x+=h.offsetLeft,g.y+=h.offsetTop,h=h.offsetParent;for(var h=f,i={x:0,y:0};h;){if("undefined"!=typeof h.mouseX){b=h.mouseX-i.x,d=h.mouseY-i.y;break}i.x+=h.offsetLeft,i.y+=h.offsetTop,h=h.offsetParent}for(h=e;h;)h.mouseX=void 0,h.mouseY=void 0,h=h.offsetParent}else{var g=c.absolutePosition(f);b=(a.pageX||0*(a.clientX+$("html").get(0).scrollLeft))-g.x,d=(a.pageY||0*(a.clientY+$("html").get(0).scrollTop))-g.y}return{x:b-c.width/2,y:d-c.width/2}},c.click=function(a){var b=c.widgetCoords(a);return c.circleDrag=2*Math.max(Math.abs(b.x),Math.abs(b.y))>c.square,c.mousemove(a),!1},c.mousemove=function(a){var b=c.widgetCoords(a);if(c.circleDrag){var d=Math.atan2(b.x,-b.y)/6.28;d<0&&(d+=1),c.setHSL([d,c.hsl[1],c.hsl[2]])}else{var e=Math.max(0,Math.min(1,-(b.x/c.square)+.5)),f=Math.max(0,Math.min(1,-(b.y/c.square)+.5));c.setHSL([c.hsl[0],e,f])}return!1},c.updateDisplay=function(){var a=6.28*c.hsl[0];$(".h-marker",d).css({left:Math.round(Math.sin(a)*c.radius+c.width/2)+"px",top:Math.round(-Math.cos(a)*c.radius+c.width/2)+"px"}),$(".sl-marker",d).css({left:Math.round(c.square*(.5-c.hsl[1])+c.width/2)+"px",top:Math.round(c.square*(.5-c.hsl[2])+c.width/2)+"px"}),$(".color",d).css("backgroundColor",c.pack(c.HSLToRGB([c.hsl[0],1,.5]))),"object"==typeof c.callback?($(c.callback).css({backgroundColor:c.color,color:c.hsl[2]>.5?"#000":"#fff"}),$(c.callback).each(function(){this.value&&this.value!=c.color&&(this.value=c.color)})):"function"==typeof c.callback&&c.callback.call(c,c.color)},c.absolutePosition=function(a){var b={x:a.offsetLeft,y:a.offsetTop};if(a.offsetParent){var d=c.absolutePosition(a.offsetParent);b.x+=d.x,b.y+=d.y}return b},c.pack=function(a){var b=Math.round(255*a[0]),c=Math.round(255*a[1]),d=Math.round(255*a[2]);return"#"+(b<16?"0":"")+b.toString(16)+(c<16?"0":"")+c.toString(16)+(d<16?"0":"")+d.toString(16)},c.unpack=function(a){return 7==a.length?[parseInt("0x"+a.substring(1,3))/255,parseInt("0x"+a.substring(3,5))/255,parseInt("0x"+a.substring(5,7))/255]:4==a.length?[parseInt("0x"+a.substring(1,2))/15,parseInt("0x"+a.substring(2,3))/15,parseInt("0x"+a.substring(3,4))/15]:void 0},c.HSLToRGB=function(a){var b,c,d=a[0],e=a[1],f=a[2];return c=f<=.5?f*(e+1):f+e-f*e,b=2*f-c,[this.hueToRGB(b,c,d+.33333),this.hueToRGB(b,c,d),this.hueToRGB(b,c,d-.33333)]},c.hueToRGB=function(a,b,c){return c=c<0?c+1:c>1?c-1:c,6*c<1?a+(b-a)*c*6:2*c<1?b:3*c<2?a+(b-a)*(.66666-c)*6:a},c.RGBToHSL=function(a){var b,c,d,e,f,g,h=a[0],i=a[1],j=a[2];return b=Math.min(h,Math.min(i,j)),c=Math.max(h,Math.max(i,j)),d=c-b,g=(b+c)/2,f=0,g>0&&g<1&&(f=d/(g<.5?2*g:2-2*g)),e=0,d>0&&(c==h&&c!=i&&(e+=(i-j)/d),c==i&&c!=j&&(e+=2+(j-h)/d),c==j&&c!=h&&(e+=4+(h-i)/d),e/=6),[e,f,g]},$("*",d).click(c.click),c.setColor("#000000"),b&&c.linkTo(b)},BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:b.trigger,toggle:b.toggle,direction:b.direction,isDefaultInit:b.isDefaultInit,destroyWhenHide:b.destroyWhenHide,isNeedAdjustHeight:b.isNeedAdjustHeight,isNeedAdjustWidth:b.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:b.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:b.hideChecker,offsetStyle:b.offsetStyle,el:b.el,popup:BI.extend({type:"bi.bubble_popup_view"},b.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){a.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){a.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){a._showTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){a._hideTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(a){var b={},c={},d=this.options.adjustLength,e=this.element.offset(),f=e.left,g=e.left+this.element.outerWidth(),h=e.top,i=e.top+this.element.outerHeight();switch(a){case"left":b={top:h,height:this.element.outerHeight(),left:f-d-this._const.TRIANGLE_LENGTH},c={width:this._const.TRIANGLE_LENGTH};break;case"right":b={top:h,height:this.element.outerHeight(),left:g+d},c={width:this._const.TRIANGLE_LENGTH};break;case"top":b={left:f,width:this.element.outerWidth(),top:h-d-this._const.TRIANGLE_LENGTH},c={height:this._const.TRIANGLE_LENGTH};break;case"bottom":b={left:f,width:this.element.outerWidth(),top:i+d},c={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(c,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+a+" bi-high-light-border"}]}),b.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var a=this.combo.getPopupPosition();switch(a.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:a.baseCls+" bi-bubble-popup-view"})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)},showLine:function(a){var b={},c={};switch(a){case"left":b={top:0,bottom:0,left:-1},c={width:3};break;case"right":b={top:0,bottom:0,right:-1},c={width:3};break;case"top":b={left:0,right:0,top:-1},c={height:3};break;case"bottom":b={left:0,right:0,bottom:-1},c={height:3}}this.line=BI.createWidget(c,{type:"bi.layout",cls:"bubble-popup-line bi-high-light-background"}),b.el=this.line,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},hideLine:function(){this.line&&this.line.destroy()}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:BI.i18nText("BI-Basic_Cancel"),level:"ignore"},{value:BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this,c=[];return BI.each(a.buttons,function(a,d){BI.isWidget(d)?c.push(d):c.push(BI.extend({type:"bi.button",height:30,handler:function(a){b.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,a)}},d))}),BI.createWidget({type:"bi.right_vertical_adapt",height:40,hgap:10,bgap:10,items:c})}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:{baseCls:"bi-text-bubble-bar-popup-view",text:"",width:250},render:function(){var a=this,b=this.options;return{type:"bi.bubble_bar_popup_view",ref:function(){a.popup=this},el:{type:"bi.vertical",items:[{type:"bi.label",text:b.text,whiteSpace:"normal",textAlign:"left",ref:function(){a.text=this}}],hgap:10,tgap:25,bgap:10},buttons:[{type:"bi.button",value:BI.i18nText("BI-Basic_Cancel"),level:"ignore",height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!1)}},{type:"bi.button",value:BI.i18nText("BI-Basic_Sure"),height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!0)}}]}},populate:function(a){this.text.setText(a||this.options.text)},showLine:function(a){this.popup.showLine(a)},hideLine:function(){this.popup.hideLine()}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:b.items,height:b.height,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText,value:b.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){a.popup.setValue(this.getValue()),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.editorIconCheckCombo.hideView(),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.editorIconCheckCombo.setValue(a)},getValue:function(){return this.trigger.getValue()},populate:function(a){this.options.items=a,this.editorIconCheckCombo.populate(a)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:28,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.icon_combo_trigger",iconCls:b.iconCls,title:b.title,items:b.items,width:b.width,height:b.height,iconWidth:b.iconWidth,iconHeight:b.iconHeight,value:b.value}),this.popup=BI.createWidget(b.popup,{type:"bi.icon_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.iconCombo.hideView(),a.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:b.direction,trigger:b.trigger,container:b.container,adjustLength:b.adjustLength,adjustXOffset:b.adjustXOffset,adjustYOffset:b.adjustYOffset,offsetStyle:b.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:b.maxWidth,maxHeight:b.maxHeight,minWidth:b.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.iconCombo.populate(a)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:28,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var a=this.options,b="";BI.isKey(a.value)&&(b=this._digest(a.value,a.items)),this.button=BI.createWidget(a.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:b,disableSelected:!0,width:a.isShowDown?a.width-12:a.width,height:a.height,iconWidth:a.iconWidth,iconHeight:a.iconHeight,selected:BI.isNotEmptyString(b)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font",width:12,height:8,selected:BI.isNotEmptyString(b)}),this.down.setVisible(a.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:0,bottom:0}]})},_digest:function(a,b){var c="";return a=BI.isArray(a)?a[0]:a,BI.any(b,function(b,d){if(a===d.value)return c=d.iconCls,!0}),c},populate:function(a){var b=this.options;this.options.items=a||[],this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(a){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var b=this.options,c=this._digest(a,this.options.items);a=BI.isArray(a)?a[0]:a,BI.isNotEmptyString(c)?(this.button.setIcon(c),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-icon-text-value-combo",height:30,iconHeight:null,iconWidth:null,value:""})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",items:b.items,height:b.height,text:b.text,iconCls:b.iconCls,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:b.items,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup"})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30,iconHeight:a.iconHeight,iconWidth:a.iconWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical" +}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var b=this.options;a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:30,text:"",items:[],tipType:"",warningTitle:""},render:function(){var a=this,b=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",adjustLength:2,toggle:!1,ref:function(){a.combo=this},el:{type:"bi.search_text_value_trigger",ref:function(){a.trigger=this},items:b.items,height:b.height-2,text:b.text,value:b.value,tipType:b.tipType,warningTitle:b.warningTitle,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:b.value,items:b.items,ref:function(){a.popup=this,a.trigger.getSearcher().setAdapter(a.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},maxHeight:302},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(b){return 0===a.triggerBtn.element.find(b.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){a.triggerBtn=this},width:b.height,height:b.height,handler:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var a=this.options;BI.isKey(a.value)&&this._checkError(a.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},populate:function(a){this.combo.populate(a)},setValue:function(a){this.combo.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var a=this,b=this.options;return{type:"bi.vertical",items:[{type:"bi.button_group",ref:function(){a.popup=this},items:BI.createItems(b.items,{type:"bi.single_select_item",textAlign:b.textAlign,height:30}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,c,d)}}]}]}},populate:function(a,b,c){var d=BI.concat(a,b);BI.SearchTextValueComboPopup.superclass.populate.apply(this,d),d=BI.createItems(d,{type:"bi.single_select_item",height:30}),this.popup.populate(d,c)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{baseCls:"bi-search-text-value-trigger bi-border",height:30},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){a.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){a.editor=this},text:this._digest(b.value,b.items),value:b.value,height:b.height},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(a,c){var d=a.keyword,e=BI.Func.getSearchResult(b.items,d),f=e.match,g=e.find;c(g,f)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){a.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:30},width:30}]}},_setState:function(a){this.editor.setState(a)},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(a){this.options.items=a},setValue:function(a){this._setState(this._digest(a,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.StaticCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-static-combo",height:24,text:"",el:{},items:[],chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.StaticCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",cls:"bi-border",items:b.items,height:b.height,text:b.text,readonly:!0}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",textAlign:b.textAlign,chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.StaticCombo.EVENT_CHANGE,arguments)}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}})},populate:function(a){this.combo.populate(a)},setValue:function(a){this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.StaticCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_combo",BI.StaticCombo),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:""})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCheckCombo.hideView(),a.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setTitle:function(a){this.trigger.setTitle(a)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},setWarningTitle:function(a){this.trigger.setWarningTitle(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCheckCombo.populate(a)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.SmallTextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:""})},_init:function(){BI.SmallTextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextIconCheckCombo.hideView(),a.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.SmallTextIconCheckCombo.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextIconCheckCombo.populate(a)}}),BI.SmallTextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_check_combo",BI.SmallTextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(a.items),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_formatItems:function(a){return BI.map(a,function(a,b){return BI.extend({type:"bi.icon_text_item",cls:"item-check-font bi-list-item",height:30},b)})},populate:function(a){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(a))},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:30,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:""})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,value:b.value,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this._checkError(b.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextValueCombo.hideView(),a.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextValueCombo.populate(a)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_item",textAlign:a.textAlign,height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:30})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this._createValueMap();var c;BI.isNotNull(b.value)&&(c=this._digest(b.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",height:b.height,items:b.items,text:b.text,value:c}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:b.height,el:this.trigger,value:BI.isNull(c)?[]:[c],items:BI.deepClone(b.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){a.setValue(a.combo.getValue()[0].value),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){a.setValue(a.combo.getValue()[0].childValue),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)})},_createValueMap:function(){var a=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(b,c){BI.has(c,"el")?BI.each(c.children,function(b,d){a.valueMap[d.value]={value:c.el.value,childValue:d.value}}):a.valueMap[c.value]={value:c.value}})},_digest:function(a){return this.valueMap[a]},setValue:function(a){a=this._digest(a),this.combo.setValue([a]),this.trigger.setValue(a)},getValue:function(){var a=this.combo.getValue()[0];return[a.childValue||a.value]},populate:function(a){this.options.items=BI.flatten(a),this.combo.populate(a),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:a.height,items:this._formatItemArray(a.items),text:a.text,value:BI.isNull(a.value)?"":a.value.childValue||a.value.value})},_formatItemArray:function(){var a=BI.flatten(BI.deepClone(this.options.items)),b=[];return BI.each(a,function(a,c){BI.has(c,"el")?(BI.each(c.children,function(a,b){b.text=c.el.text+"("+b.text+")"}),b=BI.concat(b,c.children)):b.push(c)}),b},setValue:function(a){this.trigger.setValue(a.childValue||a.value)},populate:function(a){this.trigger.populate(this._formatItemArray(a))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker,value:b.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(b.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:b.textAlign,height:b.height,hgap:4}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText(),this.text.doRedMark(b.keyword)},_checkText:function(){var a=this.options;""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setTextStyle:function(a){this.text.setStyle(a)},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignInitialEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignInitialEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-initial-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",value:"",text:"",height:24})},_init:function(){BI.SignInitialEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignInitialEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignInitialEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignInitialEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignInitialEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignInitialEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignInitialEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignInitialEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignInitialEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignInitialEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark");else{var b=this.editor.getValue();b=BI.isEmpty(b)||b==a.text?a.text:b+"("+a.text+")",this.text.setValue(b),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){ +var b=this.options;this.editor.setValue(a.value),b.text=a.text||b.text,this._checkText()},getValue:function(){return{value:this.editor.getValue(),text:this.options.text}},getState:function(){return this.text.getValue()},setState:function(a){var b=this.options;this._showHint(),a=BI.isEmpty(a)||a==b.text?b.text:a+"("+b.text+")",this.text.setValue(a)}}),BI.SignInitialEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignInitialEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignInitialEditor.EVENT_BLUR="EVENT_BLUR",BI.SignInitialEditor.EVENT_CLICK="EVENT_CLICK",BI.SignInitialEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignInitialEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignInitialEditor.EVENT_START="EVENT_START",BI.SignInitialEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignInitialEditor.EVENT_STOP="EVENT_STOP",BI.SignInitialEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignInitialEditor.EVENT_VALID="EVENT_VALID",BI.SignInitialEditor.EVENT_ERROR="EVENT_ERROR",BI.SignInitialEditor.EVENT_ENTER="EVENT_ENTER",BI.SignInitialEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignInitialEditor.EVENT_SPACE="EVENT_SPACE",BI.SignInitialEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_initial_editor",BI.SignInitialEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.StateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.setTitle(""),this.text.element.addClass("state-editor-infinite-text"))):BI.isString(a)?(this.text.setText(a),this.text.setTitle(a),void this.text.element.removeClass("state-editor-infinite-text")):void(BI.isArray(a)&&(BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):1===a.length?(this.text.setText(a[0]),this.text.setTitle(a[0]),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text"))))}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text"))):void(BI.isArray(a)&&1!==a.length?BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(a),this.text.setTitle(a),this.text.element.removeClass("state-editor-infinite-text")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor),BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this;if(0!==a.buttons.length){var c=[];return BI.each(a.buttons,function(a,b){c.push({text:b,value:a})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-border-top",height:30,items:BI.createItems(c,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(a,c){b.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,a,c)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var a=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var a=this,b=this.options,c=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return c.on(BI.IconButton.EVENT_CHANGE,function(){a.setVisible(!1),a.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-background bi-border",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:b.title,height:25,lgap:10}},{el:c,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var a=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget(b.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:b.items,itemsCreator:function(c,d){1===c.times&&(a.empty(),BI.nextTick(function(){a.loading()})),b.itemsCreator(c,function(){d.apply(a,arguments),1===c.times&&BI.nextTick(function(){a.loaded()})})},hasNext:b.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.ListPane.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,vgap:b.vgap,hgap:b.hgap},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(a){this.options.items=a.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(a){this.options.items=this.options.items.concat(a),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(a){a=a||[],BI.removeAt(this.options.items,a),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(a){var b=this;this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");b.populate.apply(b,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(a){return this.button_group.getIndexByValue(a)},getNodeById:function(a){return this.button_group.getNodeById(a)},getNodeByValue:function(a){return this.button_group.getNodeByValue(a)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var a=this,b=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:b.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:b.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Panel.EVENT_CHANGE,b,c)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(a){this.text.setValue(a)}}),BI.Panel.EVENT_CHANGE="Panel.EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var a=this,b=this.options;return[{type:"bi.label",text:b.text,height:b.height,value:b.value,hgap:b.hgap,ref:function(){a.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:3,ref:function(){a.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(a){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),a?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-border-bottom",items:[],height:29},render:function(){var a=this,b=this.options;return{type:"bi.button_group",items:BI.createItems(b.items,{type:"bi.linear_segment_button",height:b.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){a.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.buttonGroup=this}}},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar"},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.toolbar=BI.createWidget(b.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.allSelected=this.isSelected(),b===BI.Events.CLICK&&(a.setAllSelected(a.allSelected),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(b.el,{type:"bi.list_pane",items:b.items,itemsCreator:function(c,d){1===c.times&&a.toolbar.setVisible(!1),b.itemsCreator(c,function(b){d.apply(a,arguments),1===c.times&&(a.toolbar.setVisible(b&&b.length>0),a.toolbar.setEnable(b&&b.length>0)),a._checkAllSelected()})},onLoaded:b.onLoaded,hasNext:b.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){b===BI.Events.CLICK&&(a._checkAllSelected(),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(b.direction),BI.extend({scrolly:!0},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(b.direction,this.toolbar,this.list)})))),b.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(b.value)&&this.setValue(b.value)},_checkAllSelected:function(){var a=this.list.getValue().length,b=this.getAllLeaves().length-a,c=this.list.hasNext(),d=this.toolbar.isSelected(),e=a>0&&(b>0||!d&&c);e=e||b>0&&c&&d,this.toolbar.setHalfSelected(e),!e&&this.toolbar.setSelected(a>0&&b<=0&&(!c||d))},setAllSelected:function(a){BI.each(this.getAllButtons(),function(b,c){(c.setSelected||c.setAllSelected).apply(c,[a])}),this.allSelected=!!a,this.toolbar.setSelected(a),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(a){this.toolbar.setVisible(a)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(a){this.list.prependItems.apply(this.list,arguments)},addItems:function(a){this.list.addItems.apply(this.list,arguments)},setValue:function(a){var b=a.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(b),this.list[b?"setNotSelectedValue":"setValue"](a.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(a){this.toolbar.setVisible(!BI.isEmptyArray(a)),this.toolbar.setEnable(!BI.isEmptyArray(a)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(a){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(a)},resetHeight:function(a){var b=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(a-b):this.list.element.css({"max-height":a-b+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(a){return this.list.getIndexByValue(a)},getNodeById:function(a){return this.list.getNodeById(a)},getNodeByValue:function(a){return this.list.getNodeByValue(a)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var a=this,b=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var c=b.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:b.el,itemsCreator:function(b,c){c(a._getNextItems(b))},hasNext:function(a){return a.count=1)},setValue:function(a){this.pager.setValue(a)},setVPage:function(a){this.pager.setValue(a)},setCount:function(a){this.rowCount.setText(a),this.rowCount.setTitle(a)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(a){this.editor.setVisible(a),this.allPages.setVisible(a),this.pager.setVisible(a)},populate:function(){this.pager.populate()}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager),BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:30,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var a=this.options;a.vertical,a.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:5,right:74},{el:this.vlabel,top:5,right:111},{el:this.hpager,top:5,right:-9},{el:this.hlabel,top:5,right:28}]})},_createVPager:function(){var a=this,b=this.options,c=b.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:20,value:c.curr,title:c.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:76,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24,vgap:1}],invisible:!0,dynamicShow:!1,pages:c.pages,curr:c.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-prev column-pre-page-h-font"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-next column-next-page-h-font"},hasPrev:c.hasPrev,hasNext:c.hasNext,firstPage:c.firstPage,lastPage:c.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){a.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){a.vlabel.setValue(this.getCurrentPage()),a.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var a=this,b=this.options,c=b.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:20,value:c.curr,title:c.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:76,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24,vgap:1}],invisible:!0,dynamicShow:!1,pages:c.pages,curr:c.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-prev row-pre-page-h-font"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-next row-next-page-h-font"},hasPrev:c.hasPrev,hasNext:c.hasNext,firstPage:c.firstPage,lastPage:c.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){a.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){a.hlabel.setValue(this.getCurrentPage()),a.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(a){this.vpager.setValue(a),this.vlabel.setValue(a),this.vlabel.setTitle(a)},setHPage:function(a){this.hpager.setValue(a),this.hlabel.setValue(a),this.hlabel.setTitle(a)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(a){this.hpager.setVisible(a),this.hlabel.setVisible(a)},setVPagerVisible:function(a){this.vpager.setVisible(a),this.vlabel.setVisible(a)},populate:function(){this.vpager.populate(),this.hpager.populate();var a=!1,b=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),b=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),a=!0):this.setVPagerVisible(!1),this.setVisible(b||a);var c=[74,111,-9,28],d=this.layout.attr("items");a===!0&&b===!0?(d[0].right=c[0],d[1].right=c[1],d[2].right=c[2],d[3].right=c[3]):a===!0?(d[0].right=c[2],d[1].right=c[3]):b===!0&&(d[2].right=c[2],d[3].right=c[3]),this.layout.attr("items",d),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager),BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var a=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){a._lock=!1},300),this._populate()},_populate:function(){var a=this,b=this.options,c=[],d={};this.empty();var e=BI.result(b,"pages"),f=BI.result(this,"currPage"),g=BI.result(b,"groups"),h=BI.result(b,"first"),i=BI.result(b,"last"),j=BI.result(b,"prev"),k=BI.result(b,"next");e===!1?(g=0,h=!1,i=!1):g>e&&(g=e),d.index=Math.ceil((f+(g>1&&g!==e?1:0))/(0===g?1:g)),(!b.dynamicShow&&!b.dynamicShowPrevNext||f>1)&&j!==!1&&(BI.isKey(j)?c.push({text:j,value:"prev",disabled:e===!1?b.hasPrev(f)===!1:!(f>1&&j!==!1)}):c.push(BI.extend({disabled:e===!1?b.hasPrev(f)===!1:!(f>1&&j!==!1)},j))),(!b.dynamicShow&&!b.dynamicShowFirstLast||d.index>1&&0!==g)&&h&&(c.push({text:h,value:"first",disabled:!(d.index>1&&0!==g)}),d.index>1&&0!==g&&c.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),d.poor=Math.floor((g-1)/2),d.start=d.index>1?f-d.poor:1,d.end=d.index>1?function(){var a=f+(g-d.poor-1);return a>e?e:a}():g,d.end-d.start1&&0!==g&&e>g&&d.endg&&d.endg&&d.endg&&d.end1},hasNext:function(a){a||(a=1);var b=this.options,c=this.options.pages;return c===!1?b.hasNext(a):ac?c:(d=BI.result(b,"firstPage"),ab.pages?b.pages:a,this.currPage=a;this._populate()},getValue:function(){var a=this.button_group.getValue()[0];switch(a){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return a}},attr:function(a,b){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===a&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager),BI.RichEditorAction=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.RichEditorAction.superclass._defaultConfig.apply(this,arguments),{width:20,height:20,command:"",used:!0})},_init:function(){BI.RichEditorAction.superclass._init.apply(this,arguments);var a=this,b=this.options;b.editor.on(BI.NicEditor.EVENT_SELECTED,function(c){b.used===!0&&(a.setEnable(!0),a.checkNodes(c.target),a.key(c))}),b.editor.on(BI.NicEditor.EVENT_BLUR,function(){a.setEnable(!1)}),b.editor.on(BI.NicEditor.EVENT_KEYDOWN,BI.bind(this.keydown,this)),b.used===!1&&this.setEnable(!1)},checkNodes:function(a){if(!a)return!1;var b=a;do if(this.options.tags&&this.options.tags.contains(b.nodeName))return this.activate(),!0;while(b=b.parentNode&&b.className&&b.className.indexOf("bi-nic-editor")>=-1);for(b=a;3==b.nodeType;)b=b.parentNode;if(this.options.css)for(var c in this.options.css){if(null==this.options.css[c])return this.activate($(b).css(c)),!0;if($(b).css(c)==this.options.css[c])return this.activate(),!0}return this.deactivate(),!1},start:function(){},key:function(){},keydown:function(){},hideIf:function(a){},activate:function(){},deactivate:function(){},doCommand:function(a){this.options.command&&this.options.editor.nicCommand(this.options.command,a)}}),BI.RichEditorParamAction=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this,arguments),{paramFormatter:function(a){return a}})},_init:function(){BI.RichEditorParamAction.superclass._init.apply(this,arguments)},addParam:function(a){var b=this.options,c=(b.editor.instance,new Image),d=BI.DOM.getImage(b.paramFormatter(a));c.src=d.src,c.alt=a,c.style=d.style,$(c).addClass("rich-editor-param"),this.options.editor.insertHTML($("
    ").append(c).html())}}),BI.RichEditorTextToolbar=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-text-toolbar bi-background",buttons:[{type:"bi.rich_editor_font_chooser"},{type:"bi.rich_editor_size_chooser"},{type:"bi.rich_editor_bold_button"},{type:"bi.rich_editor_italic_button"},{type:"bi.rich_editor_underline_button"},{type:"bi.rich_editor_color_chooser"},{type:"bi.rich_editor_background_color_chooser"},{type:"bi.rich_editor_align_left_button"},{type:"bi.rich_editor_align_center_button"},{type:"bi.rich_editor_align_right_button"},{type:"bi.rich_editor_param_button"}],height:28})},_init:function(){BI.RichEditorTextToolbar.superclass._init.apply(this,arguments);var a=this.options,b=BI.createWidgets(BI.map(a.buttons,function(b,c){return BI.extend(c,{editor:a.editor})}));this.element.mousedown(function(a){BI.each(b,function(b,c){c.hideIf(a)})}),BI.createWidget({type:"bi.left",element:this,items:b,hgap:3,vgap:3})},mounted:function(){var a=this;BI.isIE9Below()&&(this.element.mousedown(function(){a._noSelect(a.element[0])}),this._noSelect(this.element[0]))},_noSelect:function(a){a.setAttribute&&"input"!=a.nodeName.toLowerCase()&&"textarea"!=a.nodeName.toLowerCase()&&a.setAttribute("unselectable","on");for(var b=0;b0?a.getRangeAt(0):a.createRange()},selRng:function(a,b){window.getSelection?(b.removeAllRanges(),b.addRange(a)):a.select()},selElm:function(){var a=this.getRng();if(a){if(a.startContainer){var b=a.startContainer;if(1==a.cloneContents().childNodes.length)for(var c=0;c0&&this.colorchooser.hideView()},deactivate:function(){}}),BI.shortcut("bi.rich_editor_background_color_chooser",BI.RichEditorBackgroundColorChooser),BI.RichEditorColorChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this,arguments),{width:20,height:20,command:"foreColor",css:{color:null}})},_init:function(){BI.RichEditorColorChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.colorchooser=BI.createWidget({type:"bi.color_chooser",element:this,width:b.width,height:b.height,el:{type:"bi.rich_editor_color_chooser_trigger",title:BI.i18nText("BI-Font_Colour"),cls:"text-toolbar-button"}}),this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE,function(){a.doCommand(this.getValue())})},hideIf:function(a){!this.colorchooser.element.find(a.target).length>0&&this.colorchooser.hideView()},activate:function(a){this.colorchooser.setValue(BI.DOM.rgb2hex(a))},deactivate:function(){this.colorchooser.setValue("")}}),BI.shortcut("bi.rich_editor_color_chooser",BI.RichEditorColorChooser),BI.RichEditorFontChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorFontChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-font-chooser bi-border bi-card",command:"FontName",width:50,height:20})},_init:function(){BI.RichEditorSizeChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",readonly:!0,height:b.height,triggerWidth:16,text:BI.i18nText("BI-Font_Family")}),this.combo=BI.createWidget({type:"bi.combo",element:this,el:this.trigger,adjustLength:1,popup:{minWidth:70,el:{type:"bi.button_group",items:BI.createItems([{value:"Microsoft YaHei",text:BI.i18nText("BI-Microsoft_YaHei")},{value:"PingFangSC-Light !important",text:BI.i18nText("BI-Apple_Light")},{value:"arial",text:"Arial"},{value:"Verdana",text:"Verdana"}],{type:"bi.single_select_item"}),layouts:[{type:"bi.vertical"}]}}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){var b=this.getValue()[0];a.doCommand(b),this.hideView(),this.setValue([])})},hideIf:function(a){!this.combo.element.find(a.target).length>0&&this.combo.hideView()}}),BI.shortcut("bi.rich_editor_font_chooser",BI.RichEditorFontChooser),BI.RichEditorSizeChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-size-chooser bi-border bi-card",command:"FontSize",width:50,height:20})},_items:[{value:1,text:"1(8pt)"},{value:2,text:"2(10pt)"},{value:3,text:"3(12pt)"},{value:4,text:"4(14pt)"},{value:5,text:"5(18pt)"},{value:6,text:"6(24pt)"}],_init:function(){BI.RichEditorSizeChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",readonly:!0,height:b.height,triggerWidth:16,text:BI.i18nText("BI-Font_Size")}),this.combo=BI.createWidget({type:"bi.combo",element:this,el:this.trigger,adjustLength:1,popup:{maxWidth:70,minWidth:70,el:{type:"bi.button_group",items:BI.createItems(this._items,{type:"bi.single_select_item"}),layouts:[{type:"bi.vertical"}]}}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){var b=this.getValue()[0];a.doCommand(b),this.hideView(),this.setValue([])})},hideIf:function(a){!this.combo.element.find(a.target).length>0&&this.combo.hideView()}}),BI.shortcut("bi.rich_editor_size_chooser",BI.RichEditorSizeChooser),BI.RichEditor=BI.inherit(BI.Widget,{props:{baseCls:"bi-rich-editor bi-textarea",toolbar:{},readOnly:!1},render:function(){var a=this,b=this.options,c={type:"bi.nic_editor",width:b.width,height:b.height,readOnly:b.readOnly,ref:function(){a.editor=this},listeners:[{eventName:BI.NicEditor.EVENT_BLUR,action:function(){a.fireEvent(BI.RichEditor.EVENT_CONFIRM)}},{eventName:BI.NicEditor.EVENT_FOCUS,action:function(){b.readOnly||a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.RichEditor.EVENT_FOCUS)}}]};return b.readOnly?c:(this.editor=BI.createWidget(c),{type:"bi.combo",toggle:!1,trigger:"click",direction:"top,right",isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,adjustLength:1,ref:function(){a.combo=this},el:this.editor,popup:{el:BI.extend({type:"bi.rich_editor_text_toolbar",editor:this.editor},b.toolbar),height:30,stopPropagation:!0,stopEvent:!0},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.fireEvent(BI.RichEditor.EVENT_AFTER_HIDEVIEW)}}]})},mounted:function(){var a=this.options;BI.isNull(a.value)&&this.editor.setValue(a.value)},focus:function(){this.editor.focus()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()}}),BI.RichEditor.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.RichEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.RichEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.rich_editor",BI.RichEditor),BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-segment-button bi-list-item-active",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,height:a.height-2,whiteSpace:a.whiteSpace,text:a.text,value:a.value,hgap:a.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(a){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(a)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton),BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var a=this,b=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:b.value,items:BI.createItems(b.items,{type:"bi.segment_button",height:b.height-2,whiteSpace:b.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Segment.EVENT_CHANGE,b,c)})},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment),BI.AdaptiveTable=BI.inherit(BI.Widget,{_const:{perColumnSize:100},_defaultConfig:function(){return BI.extend(BI.AdaptiveTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-adaptive-table",el:{type:"bi.resizable_table"},isNeedResize:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!1,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.AdaptiveTable.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._digest();this.table=BI.createWidget(b.el,{type:"bi.resizable_table",element:this,width:b.width,height:b.height,isNeedResize:b.isNeedResize,isResizeAdapt:!1,isNeedFreeze:b.isNeedFreeze,freezeCols:c.freezeCols,isNeedMerge:b.isNeedMerge,mergeCols:b.mergeCols,mergeRule:b.mergeRule,columnSize:c.columnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:c.regionColumnSize,header:b.header,items:b.items,crossHeader:b.crossHeader,crossItems:b.crossItems}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),a._populate(),a.table.populate(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.columnSize=this.getColumnSize(),a._populate(),a.table.populate(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_getFreezeColLength:function(){var a=this.options;return a.isNeedFreeze===!0?BI.clamp(a.freezeCols.length,0,a.columnSize.length):0},_digest:function(){var a=this.options,b=a.columnSize.slice(),c=a.regionColumnSize.slice(),d=a.freezeCols.slice(),e=a.regionColumnSize[0],f=this._getFreezeColLength();if(!e||e>a.width-10||e<10){var g=BI.sum(b,function(a,b){return a=b.length&&(d=[]),BI.isNumber(b[0])||(b=a.minColumnSize.slice());var h=0,i=0;return BI.each(b,function(a,b){a0&&(b[f-1]=BI.clamp(e-(h-b[f-1]),a.minColumnSize[f-1]||10,a.maxColumnSize[f-1]||Number.MAX_VALUE)),b.length>0&&(b[b.length-1]=BI.clamp(a.width-BI.GridTableScrollbar.SIZE-e-(i-h-b[b.length-1]),a.minColumnSize[b.length-1]||10,a.maxColumnSize[b.length-1]||Number.MAX_VALUE)),c[0]=e,{freezeCols:d,columnSize:b,regionColumnSize:c}},_populate:function(){var a=this.options,b=this._digest();a.regionColumnSize=b.regionColumnSize,a.columnSize=b.columnSize,this.table.setColumnSize(b.columnSize),this.table.setRegionColumnSize(b.regionColumnSize),this.table.attr("freezeCols",b.freezeCols)},setWidth:function(a){BI.AdaptiveTable.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.AdaptiveTable.superclass.setHeight.apply(this,arguments),this.table.setHeight(a)},setColumnSize:function(a){this.options.columnSize=a},getColumnSize:function(){return this.table.getColumnSize()},setRegionColumnSize:function(a){this.options.regionColumnSize=a},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(a,b){var c=BI.AdaptiveTable.superclass.attr.apply(this,arguments);return"freezeCols"===a?c:this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a){this.options;this._populate(),this.table.populate.apply(this.table,arguments)},destroy:function(){this.table.destroy(),BI.AdaptiveTable.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.adaptive_table",BI.AdaptiveTable),BI.DynamicSummaryLayerTreeTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DynamicSummaryLayerTreeTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-dynamic-summary-layer-tree-table",el:{type:"bi.resizable_table"},isNeedResize:!0,isResizeAdapt:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,footerRowSize:25,rowSize:25,regionColumnSize:[],rowHeaderCreator:null,headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],footer:!1,items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_createHeader:function(a){var b=this.options,c=b.header||[],d=b.crossHeader||[],e=BI.TableTree.formatCrossItems(b.crossItems,a,b.headerCellStyleGetter),f=[];BI.each(e,function(a,b){var c=[d[a]];f.push(c.concat(b||[]))});var g=BI.isFunction(b.rowHeaderCreator)?b.rowHeaderCreator():b.rowHeaderCreator;if(c&&c.length>0){var h=this._formatColumns(c),i=this._getHDeep();i<=0?h.unshift(g||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter}):h[0]=g||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter},f.push(h)}return f},_formatItems:function(a,b,c){function d(a,b){a.type||(a.type="bi.layer_tree_table_cell"),a.layer=b;var c=[a];c=c.concat(a.values||[]),c.length>0&&f.push(c),BI.isNotEmptyArray(a.children)&&BI.each(a.children,function(a,c){d(c,b+1)})}var e=this.options,f=[];return BI.each(a,function(a,b){if(BI.each(b.children,function(a,b){d(b,0)}),BI.isArray(b.values)){var c=[{type:"bi.table_style_cell",text:BI.i18nText("BI-Summary_Values"),styleGetter:function(){return e.summaryCellStyleGetter(!0)}}].concat(b.values);f.push(c)}}),BI.DynamicSummaryTreeTable.formatSummaryItems(f,b,e.crossItems,1)},_formatColumns:function(a,b){return BI.isNotEmptyArray(a)?(b=b||this._getHDeep(),a.slice(Math.max(0,b-1))):a},_formatFreezeCols:function(){return this.options.freezeCols.length>0?[0]:[]},_formatColumnSize:function(a,b){if(a.length<=0)return[];var c=[0];return b=b||this._getHDeep(),BI.each(a,function(a,d){return a1)for(var c=0;c1)&&BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e1?g+=a.values.length:g++}var f=[],g=0;if(BI.each(c,function(a,b){e(b)}),f.length>0){var h=[],i=[];BI.each(b,function(a,b){var c=b.slice();BI.removeAt(c,f),h.push(c)}),BI.each(a,function(a,b){var c=b.slice();BI.removeAt(c,f),i.push(c)}),b=h,a=i}return{items:a,header:b,deletedCols:f}}}),BI.shortcut("bi.dynamic_summary_tree_table",BI.DynamicSummaryTreeTable),BI.LayerTreeTableCell=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LayerTreeTableCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-layer-tree-table-cell",layer:0,text:""})},_init:function(){BI.LayerTreeTableCell.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget({type:"bi.label",element:this.element,textAlign:"left",whiteSpace:"nowrap",height:a.height,text:a.text,value:a.value,lgap:5+30*a.layer,rgap:5})}}),BI.shortcut("bi.layer_tree_table_cell",BI.LayerTreeTableCell),BI.LayerTreeTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LayerTreeTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-layer-tree-table",el:{type:"bi.resizable_table"},isNeedResize:!1,isResizeAdapt:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],rowHeaderCreator:null,headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_createHeader:function(a){var b=this.options,c=b.header||[],d=b.crossHeader||[],e=BI.TableTree.formatCrossItems(b.crossItems,a,b.headerCellStyleGetter),f=[];if(BI.each(e,function(a,b){var c=[d[a]];f.push(c.concat(b||[]))}),c&&c.length>0){var g=this._formatColumns(c),h=this._getHDeep();h<=0?g.unshift(b.rowHeaderCreator||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter}):g[0]=b.rowHeaderCreator||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter},f.push(g)}return f},_formatItems:function(a){function b(a,c){a.type||(a.type="bi.layer_tree_table_cell"),a.layer=c;var e=[a];e=e.concat(a.values||[]),e.length>0&&d.push(e),BI.isNotEmptyArray(a.children)&&BI.each(a.children,function(a,d){b(d,c+1)})}var c=this.options,d=[];return BI.each(a,function(a,e){if(BI.each(e.children,function(a,c){b(c,0)}),BI.isArray(e.values)){var f=[{type:"bi.table_style_cell",text:BI.i18nText("BI-Summary_Values"),styleGetter:function(){return c.summaryCellStyleGetter(!0)}}].concat(e.values);d.push(f)}}),d},_formatColumns:function(a,b){return BI.isNotEmptyArray(a)?(b=b||this._getHDeep(),a.slice(Math.max(0,b-1))):a},_formatFreezeCols:function(){return this.options.freezeCols.length>0?[0]:[]},_formatColumnSize:function(a,b){if(a.length<=0)return[];var c=[0];return b=b||this._getHDeep(),BI.each(a,function(a,d){return a0&&(c=BI.makeArray(b,a[0]/b)),c.concat(a.slice(1))},setRegionColumnSize:function(a){this.options.regionColumnSize=a,this.table.setRegionColumnSize(a)},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(a,b){var c=this;if(BI.isObject(a))return void BI.each(a,function(a,b){c.attr(a,b)});switch(BI.LayerTreeTable.superclass.attr.apply(this,arguments),a){case"columnSize":case"minColumnSize":case"maxColumnSize":case"freezeCols":case"mergeCols":return}this.table.attr.apply(this.table,[a,b])},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;e.items=a||[],b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.setColumnSize(f.columnSize),this.table.attr("freezeCols",f.freezeCols),this.table.attr("minColumnSize",f.minColumnSize),this.table.attr("maxColumnSize",f.maxColumnSize),this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.LayerTreeTable.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.layer_tree_table",BI.LayerTreeTable),BI.TableStyleCell=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TableStyleCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-style-cell",styleGetter:BI.emptyFn})},_init:function(){BI.TableStyleCell.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,height:a.height,textAlign:"left",forceCenter:!0,hgap:5,text:a.text}),this._digestStyle()},_digestStyle:function(){var a=this.options,b=a.styleGetter();b&&this.text.element.css(b)},setText:function(a){this.text.setText(a)},populate:function(){this._digestStyle()}}),BI.shortcut("bi.table_style_cell",BI.TableStyleCell),BI.TableTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TableTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-tree",el:{type:"bi.resizable_table"},isNeedResize:!0,isResizeAdapt:!0,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_init:function(){BI.TableTree.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._digest();this.table=BI.createWidget(b.el,{type:"bi.resizable_table",element:this,width:b.width,height:b.height,isNeedResize:b.isNeedResize,isResizeAdapt:b.isResizeAdapt,isNeedFreeze:b.isNeedFreeze,freezeCols:b.freezeCols,isNeedMerge:b.isNeedMerge,mergeCols:b.mergeCols,mergeRule:b.mergeRule,columnSize:b.columnSize, -minColumnSize:b.minColumnSize,maxColumnSize:b.maxColumnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:b.regionColumnSize,header:c.header,items:c.items}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_digest:function(){var a=this.options,b=this._getHDeep(),c=this._getVDeep(),d=BI.TableTree.formatHeader(a.header,a.crossHeader,a.crossItems,b,c,a.headerCellStyleGetter),e=BI.TableTree.formatItems(a.items,b,!1,a.summaryCellStyleGetter);return{header:d,items:e}},setWidth:function(a){BI.TableTree.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.TableTree.superclass.setHeight.apply(this,arguments),this.table.setHeight(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()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(){BI.TableTree.superclass.attr.apply(this,arguments),this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;a&&(e.items=a||[]),b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.TableTree.superclass.destroy.apply(this,arguments)}}),BI.extend(BI.TableTree,{formatHeader:function(a,b,c,d,e,f){for(var g=BI.TableTree.formatCrossItems(c,e,f),h=[],i=0;i0&&h.push(a),h},formatItems:function(a,b,c,d){function e(a,g){var h;if(BI.isArray(g.children)){if(BI.each(g.children,function(b,c){var d;a!=-1?(d=a.slice(),d.push(g)):d=[],e(d,c)}),a!=-1?(h=a.slice(),h.push(g)):h=[],BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e0},halfSelected:!1})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var a=this,b=this.options,c=b.selected===!0,d=!b.selected&&b.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){a.setSelected(a.isSelected())},selected:c,invisible:d}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){a.setSelected(!0)},invisible:c||!d}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.text=BI.createWidget({type:"bi.label",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({type:"bi.htape",element:this,items:[{width:36,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(a){this.checkbox.setSelected(!!a)},beforeClick:function(){var a=this.isHalfSelected(),b=this.isSelected();a===!0?this.setSelected(!0):this.setSelected(!b)},setSelected:function(a){this.checkbox.setSelected(a),this.setHalfSelected(!1)},setHalfSelected:function(a){this.halfSelected=!!a,a===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(a){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var b=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(b),!b&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE)}}),BI.MultiSelectBar.EVENT_CHANGE="MultiSelectBar.EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.BranchRelation=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-relation-tree",items:[],centerOffset:0,direction:BI.Direction.Bottom,align:BI.VerticalAlign.Top})},_init:function(){BI.BranchRelation.superclass._init.apply(this,arguments),this.populate(this.options.items)},_stratification:function(){var a=[];return this.tree.recursion(function(b,c){b.leaf=b.isLeaf(),a[c.length-1]||(a[c.length-1]=[]),a[c.length-1].push(b)}),a},_calculateLeaves:function(){function a(b){var c=0;return b.isLeaf()?1:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),b.set("leaves",c),c)}var b=0;return b=a(this.tree.getRoot())},_translate:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,g);var k=g.parent.getChildIndex(g.id);g.parent.removeChildByIndex(k),g.parent.addChild(h,k),h.addChild(g),b[d].push(h),e[f]=h}else b[d].push(g)})}),b},_fill:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,h),g.addChild(h)}b[d].push(g)})}),b},_adjust:function(a){for(;;){var b=!1;if(BI.backEach(a,function(a,c){BI.each(c,function(a,c){if(!c.isNew){var d=!0;if(BI.any(c.getChildren(),function(a,b){if(!b.isNew)return d=!1,!0}),!c.isLeaf()&&d===!0){var e=[];BI.each(c.getChildren(),function(a,b){e=e.concat(b.getChildren())}),c.removeAllChilds(),BI.each(e,function(a,b){c.addChild(b)});var f=new BI.Node(BI.UUID());f.isNew=!0;var g=c.parent.getChildIndex(c.id);c.parent.removeChildByIndex(g),c.parent.addChild(f,g),f.addChild(c),b=!0}}})}),b===!1)break;a=this._stratification()}return a},_calculateWidth:function(){function a(b){var c=0;return b.isLeaf()?b.width:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),c)}function b(a){var c=0;return a.isLeaf()?a.height:(BI.each(a.getChildren(),function(a,d){c+=b(d)}),c)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_isVertical:function(){var a=this.options;return a.direction===BI.Direction.Top||a.direction===BI.Direction.Bottom},_calculateHeight:function(){function a(b){var c=0;return BI.each(b.getChildren(),function(b,d){c=Math.max(c,a(d))}),c+(b.height||0)}function b(a){var c=0;return BI.each(a.getChildren(),function(a,d){c=Math.max(c,b(d))}),c+(a.width||0)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_calculateXY:function(a){var b=(this.options,this._calculateWidth()),c=this._calculateHeight(),d=a.length,e=this._calculateLeaves(),f={},g=c/d;return BI.each(a,function(a,c){var d=[];BI.each(c,function(a,b){d[a]=(b.get("leaves")||1)/e}),BI.each(c,function(c,e){var h=BI.sum(d.slice(0,c)),i=h*b+d[c]*b/2,j=a*g+g/2;f[e.id]={x:i,y:j}})}),f},_stroke:function(a,b){var c=this._calculateHeight(),d=a.length,e=c/d,f=this,g=this.options;switch(g.direction){case BI.Direction.Top:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+h.x+","+(h.y+g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y+g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Bottom:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+h.x+","+(h.y-g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y-g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Left:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+(h.y+g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y+g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Right:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+(h.y-g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y-g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})})}},_createBranches:function(a){var b=this.options;b.direction!==BI.Direction.Bottom&&b.direction!==BI.Direction.Right||(a=a.reverse());var c=this._calculateXY(a);this._stroke(a,c)},_isNeedAdjust:function(){var a=this.options;return a.direction===BI.Direction.Top&&a.align===BI.VerticalAlign.Bottom||a.direction===BI.Direction.Bottom&&a.align===BI.VerticalAlign.Top||a.direction===BI.Direction.Left&&a.align===BI.HorizontalAlign.Right||a.direction===BI.Direction.Right&&a.align===BI.HorizontalAlign.Left},setValue:function(a){},getValue:function(){},populate:function(a){var b=this.options;b.items=a||[],this.empty(),a=BI.Tree.transformToTreeFormat(b.items),this.tree=new BI.Tree,this.tree.initTree(a),this.svg=BI.createWidget({type:"bi.svg"});var c=this._stratification();if(this._isNeedAdjust()){var d=this._translate(c);d=this._adjust(d),this._createBranches(d)}else{var d=this._fill(c);this._createBranches(d)}var e=BI.createWidget({type:"bi.layout",width:this._isVertical()?this._calculateWidth():this._calculateHeight(),height:this._isVertical()?this._calculateHeight():this._calculateWidth()});BI.createWidget({type:"bi.absolute",element:e,items:[{el:this.svg,top:0,left:0,right:0,bottom:0}]}),a=this._isVertical()?[{type:"bi.handstand_branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.horizontal_adapt",verticalAlign:b.align}]},items:a}]:[{type:"bi.branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.vertical"},{type:b.align===BI.HorizontalAlign.Left?"bi.left":"bi.right"}]},items:a}],BI.createWidget({type:"bi.adaptive",element:e,items:a}),BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[e]})}}),BI.BranchRelation.EVENT_CHANGE="BranchRelation.EVENT_CHANGE",BI.shortcut("bi.branch_relation",BI.BranchRelation),BI.HandStandBranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-expander",direction:BI.Direction.Top,logic:{dynamic:!0},el:{type:"bi.label"},popup:{}})},_init:function(){BI.HandStandBranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,{type:"bi.center_adapt",items:[this.expander]},this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.HandStandBranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_expander",BI.HandStandBranchExpander),BI.BranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-expander",direction:BI.Direction.Left,logic:{dynamic:!0},el:{},popup:{}})},_init:function(){BI.BranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,this.expander,this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el,{type:"bi.label",width:30,height:"100%"}),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.BranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_expander",BI.BranchExpander),BI.HandStandBranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.HandStandBranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.handstand_branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.horizontal_adapt"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.HandStandBranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_tree",BI.HandStandBranchTree),BI.BranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.BranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.BranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.BranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_tree",BI.BranchTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function a(a,b){return!1}var b={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:a}};return b},_dealWidthNodes:function(a){a=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(a,function(a,b){null==b.text&&b.count>0&&(b.text=b.value+"("+BI.i18nText("BI-Basic_Altogether")+b.count+BI.i18nText("BI-Basic_Count")+")")}),a},initTree:function(a,b){var b=b||this._configSetting();this.nodes=$.fn.zTree.init(this.tree.element,b,a)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={layer:b};if(BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.first_plus_group_node";break;case a.length-1:f.type="bi.last_plus_group_node";break;default:f.type="bi.mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.last_tree_leaf_item";break;default:f.type="bi.mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){BI.isKey(b.id)||(b.id=BI.UUID())})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},c.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),value:c.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},c.el)}),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.LevelTree.EVENT_CHANGE,c,d)})},stroke:function(a){this.tree.stroke.apply(this.tree,arguments)},populate:function(a,b){a=this._formatItems(BI.Tree.transformToTreeFormat(a),0),this.tree.populate(a,b)},setValue:function(a){this.tree.setValue(a)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var a=this,b=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(c,d){var e=function(b){d({items:b}),a.structure.initTree(BI.Tree.transformToTreeFormat(b))};BI.isNotNull(b.items)?e(b.items):b.itemsCreator(c,e)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(b.items)&&this.populate(),BI.isNotNull(b.value)&&this.setValue(b.value)},populate:function(a,b){a&&(this.options.items=a),this.tree.stroke({keyword:b})},_digest:function(a){a||(a=[]);var b=this,c={},d=[];return BI.each(a,function(a,e){var f=b.structure.search(e,"value");if(f){var g=f;for(g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++);g&&g.getChildrenLength()<=c[g.value];)d.push(g.value),g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++)}}),BI.makeObject(a.concat(d))},setValue:function(a){this.tree.setValue(this._digest(a))},_getValue:function(){var a=[],b=this.tree.getValue(),c=function(b){BI.each(b,function(b,d){BI.isEmpty(d)?a.push(b):c(d)})};return c(b),a},empty:function(){this.tree.empty()},getValue:function(){var a=this,b=[],c=this._getValue();return BI.each(c,function(c,d){var e=a.structure.search(d,"value");e&&a.structure._traverse(e,function(a){a.isLeaf()&&b.push(a.value)})}),b}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options;this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:b.triggerWidth||b.height},width:b.triggerWidth||b.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(a){this.editor.setValue(a)},setText:function(a){this.editor.setState(a)}}),BI.EditorTrigger.EVENT_CHANGE="BI.EditorTrigger.EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-trigger",el:{},height:24})},_init:function(){var a=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(a.el,{type:"bi.trigger_icon_button",element:this,width:a.width,height:a.height})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(b){a.wrapper=b},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon "+b.iconCls,ref:function(b){a.icon=b},iconHeight:b.iconHeight,iconWidth:b.iconWidth,disableSelected:!0},width:BI.isEmptyString(b.iconCls)?0:b.triggerWidth||b.height},{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setValue:function(a){this.text.setValue(a)},setIcon:function(a){var b=this.options;this.icon.setIcon(a);var c=this.wrapper.attr("items")[0];BI.isNull(a)||BI.isEmptyString(a)?0!==c.width&&(c.width=0,this.wrapper.resize()):c.width!==(b.triggerWidth||b.height)&&(c.width=b.triggerWidth||b.height,this.wrapper.resize())},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,defaultIconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digist(a.value,a.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:b.text,iconCls:b.iconCls,height:a.height,iconHeight:a.iconHeight,iconWidth:a.iconWidth})},_digist:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d,e=BI.Tree.transformToArrayFormat(b);return BI.any(e,function(b,c){if(BI.deepContains(a,c.value))return d={text:c.text||c.value,iconCls:c.iconCls},!0}),BI.isNotNull(d)?{text:d.text,iconCls:d.iconCls}:{text:c.text,iconCls:c.defaultIconCls}},setValue:function(a){var b=this._digist(a,this.options.items);this.trigger.setText(b.text),this.trigger.setIcon(b.iconCls)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,title:function(){return a.text.getText()},hgap:c.hgap,readonly:b.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:a.height,readonly:a.readonly,text:this._digest(a.value,a.items)})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},setValue:function(a){this.trigger.setText(this._digest(a,this.options.items))},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digest(a.text,a.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:a.height-2,text:b.text,cls:b.cls})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?{cls:"",text:d.join(",")}:{cls:"bi-water-mark",text:c.text}},setValue:function(a){var b=this._digest(a,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(b.cls),this.trigger.setText(b.text)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:a.height,text:a.text,hgap:b.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:a.triggerWidth||a.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:a.triggerWidth||a.height}]})},setValue:function(a){this.text.setValue(a)},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.SequenceTableTreeNumber=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-sequence-table-tree-number",isNeedFreeze:!1,startSequence:1,scrollTop:0,headerRowSize:25,rowSize:25,sequenceHeaderCreator:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.SequenceTableTreeNumber.superclass._init.apply(this,arguments);this.options;this.vCurr=1,this.hCurr=1,this.tasks=[],this.renderedCells=[],this.renderedKeys=[],this.container=BI.createWidget({type:"bi.absolute",width:60,scrollable:!1}),this.scrollContainer=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.container]}),this.headerContainer=BI.createWidget({type:"bi.absolute",cls:"bi-border",width:58,scrollable:!1}),this.layout=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.headerContainer,height:this._getHeaderHeight()-2},{el:{type:"bi.layout"},height:2},{el:this.scrollContainer}]}),this.start=this.options.startSequence,this.cache={},this._nextState(),this._populate()},_getNextSequence:function(a){function b(a){c.cache[a.text||a.value]||(c.cache[a.text||a.value]=e),e++}var c=this,d=this.start,e=this.start;return BI.each(a,function(a,f){BI.isNotEmptyArray(f.children)&&BI.each(f.children,function(a,f){0===a&&c.cache[f.text||f.value]&&(d=e=c.cache[f.text||f.value]), +minColumnSize:b.minColumnSize,maxColumnSize:b.maxColumnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:b.regionColumnSize,header:c.header,items:c.items}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_digest:function(){var a=this.options,b=this._getHDeep(),c=this._getVDeep(),d=BI.TableTree.formatHeader(a.header,a.crossHeader,a.crossItems,b,c,a.headerCellStyleGetter),e=BI.TableTree.formatItems(a.items,b,!1,a.summaryCellStyleGetter);return{header:d,items:e}},setWidth:function(a){BI.TableTree.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.TableTree.superclass.setHeight.apply(this,arguments),this.table.setHeight(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()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(){BI.TableTree.superclass.attr.apply(this,arguments),this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;a&&(e.items=a||[]),b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.TableTree.superclass.destroy.apply(this,arguments)}}),BI.extend(BI.TableTree,{formatHeader:function(a,b,c,d,e,f){for(var g=BI.TableTree.formatCrossItems(c,e,f),h=[],i=0;i0&&h.push(a),h},formatItems:function(a,b,c,d){function e(a,g){var h;if(BI.isArray(g.children)){if(BI.each(g.children,function(b,c){var d;a!=-1?(d=a.slice(),d.push(g)):d=[],e(d,c)}),a!=-1?(h=a.slice(),h.push(g)):h=[],BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e0},halfSelected:!1})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var a=this,b=this.options,c=b.selected===!0,d=!b.selected&&b.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){a.setSelected(a.isSelected())},selected:c,invisible:d}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){a.setSelected(!0)},invisible:c||!d}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.text=BI.createWidget({type:"bi.label",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({type:"bi.htape",element:this,items:[{width:36,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(a){this.checkbox.setSelected(!!a)},beforeClick:function(){var a=this.isHalfSelected(),b=this.isSelected();a===!0?this.setSelected(!0):this.setSelected(!b)},setSelected:function(a){this.checkbox.setSelected(a),this.setHalfSelected(!1)},setHalfSelected:function(a){this.halfSelected=!!a,a===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(a){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var b=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(b),!b&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE)}}),BI.MultiSelectBar.EVENT_CHANGE="MultiSelectBar.EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.BranchRelation=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-relation-tree",items:[],centerOffset:0,direction:BI.Direction.Bottom,align:BI.VerticalAlign.Top})},_init:function(){BI.BranchRelation.superclass._init.apply(this,arguments),this.populate(this.options.items)},_stratification:function(){var a=[];return this.tree.recursion(function(b,c){b.leaf=b.isLeaf(),a[c.length-1]||(a[c.length-1]=[]),a[c.length-1].push(b)}),a},_calculateLeaves:function(){function a(b){var c=0;return b.isLeaf()?1:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),b.set("leaves",c),c)}var b=0;return b=a(this.tree.getRoot())},_translate:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,g);var k=g.parent.getChildIndex(g.id);g.parent.removeChildByIndex(k),g.parent.addChild(h,k),h.addChild(g),b[d].push(h),e[f]=h}else b[d].push(g)})}),b},_fill:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,h),g.addChild(h)}b[d].push(g)})}),b},_adjust:function(a){for(;;){var b=!1;if(BI.backEach(a,function(a,c){BI.each(c,function(a,c){if(!c.isNew){var d=!0;if(BI.any(c.getChildren(),function(a,b){if(!b.isNew)return d=!1,!0}),!c.isLeaf()&&d===!0){var e=[];BI.each(c.getChildren(),function(a,b){e=e.concat(b.getChildren())}),c.removeAllChilds(),BI.each(e,function(a,b){c.addChild(b)});var f=new BI.Node(BI.UUID());f.isNew=!0;var g=c.parent.getChildIndex(c.id);c.parent.removeChildByIndex(g),c.parent.addChild(f,g),f.addChild(c),b=!0}}})}),b===!1)break;a=this._stratification()}return a},_calculateWidth:function(){function a(b){var c=0;return b.isLeaf()?b.width:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),c)}function b(a){var c=0;return a.isLeaf()?a.height:(BI.each(a.getChildren(),function(a,d){c+=b(d)}),c)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_isVertical:function(){var a=this.options;return a.direction===BI.Direction.Top||a.direction===BI.Direction.Bottom},_calculateHeight:function(){function a(b){var c=0;return BI.each(b.getChildren(),function(b,d){c=Math.max(c,a(d))}),c+(b.height||0)}function b(a){var c=0;return BI.each(a.getChildren(),function(a,d){c=Math.max(c,b(d))}),c+(a.width||0)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_calculateXY:function(a){var b=(this.options,this._calculateWidth()),c=this._calculateHeight(),d=a.length,e=this._calculateLeaves(),f={},g=c/d;return BI.each(a,function(a,c){var d=[];BI.each(c,function(a,b){d[a]=(b.get("leaves")||1)/e}),BI.each(c,function(c,e){var h=BI.sum(d.slice(0,c)),i=h*b+d[c]*b/2,j=a*g+g/2;f[e.id]={x:i,y:j}})}),f},_stroke:function(a,b){var c=this._calculateHeight(),d=a.length,e=c/d,f=this,g=this.options;switch(g.direction){case BI.Direction.Top:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+h.x+","+(h.y+g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y+g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Bottom:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+h.x+","+(h.y-g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y-g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Left:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+(h.y+g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y+g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Right:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+(h.y-g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y-g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})})}},_createBranches:function(a){var b=this.options;b.direction!==BI.Direction.Bottom&&b.direction!==BI.Direction.Right||(a=a.reverse());var c=this._calculateXY(a);this._stroke(a,c)},_isNeedAdjust:function(){var a=this.options;return a.direction===BI.Direction.Top&&a.align===BI.VerticalAlign.Bottom||a.direction===BI.Direction.Bottom&&a.align===BI.VerticalAlign.Top||a.direction===BI.Direction.Left&&a.align===BI.HorizontalAlign.Right||a.direction===BI.Direction.Right&&a.align===BI.HorizontalAlign.Left},setValue:function(a){},getValue:function(){},populate:function(a){var b=this.options;b.items=a||[],this.empty(),a=BI.Tree.transformToTreeFormat(b.items),this.tree=new BI.Tree,this.tree.initTree(a),this.svg=BI.createWidget({type:"bi.svg"});var c=this._stratification();if(this._isNeedAdjust()){var d=this._translate(c);d=this._adjust(d),this._createBranches(d)}else{var d=this._fill(c);this._createBranches(d)}var e=BI.createWidget({type:"bi.layout",width:this._isVertical()?this._calculateWidth():this._calculateHeight(),height:this._isVertical()?this._calculateHeight():this._calculateWidth()});BI.createWidget({type:"bi.absolute",element:e,items:[{el:this.svg,top:0,left:0,right:0,bottom:0}]}),a=this._isVertical()?[{type:"bi.handstand_branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.horizontal_adapt",verticalAlign:b.align}]},items:a}]:[{type:"bi.branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.vertical"},{type:b.align===BI.HorizontalAlign.Left?"bi.left":"bi.right"}]},items:a}],BI.createWidget({type:"bi.adaptive",element:e,items:a}),BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[e]})}}),BI.BranchRelation.EVENT_CHANGE="BranchRelation.EVENT_CHANGE",BI.shortcut("bi.branch_relation",BI.BranchRelation),BI.HandStandBranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-expander",direction:BI.Direction.Top,logic:{dynamic:!0},el:{type:"bi.label"},popup:{}})},_init:function(){BI.HandStandBranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,{type:"bi.center_adapt",items:[this.expander]},this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.HandStandBranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_expander",BI.HandStandBranchExpander),BI.BranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-expander",direction:BI.Direction.Left,logic:{dynamic:!0},el:{},popup:{}})},_init:function(){BI.BranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,this.expander,this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el,{type:"bi.label",width:30,height:"100%"}),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.BranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_expander",BI.BranchExpander),BI.HandStandBranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.HandStandBranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.handstand_branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.horizontal_adapt"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.HandStandBranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_tree",BI.HandStandBranchTree),BI.BranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.BranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.BranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.BranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_tree",BI.BranchTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function a(a,b){return!1}var b={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:a}};return b},_dealWidthNodes:function(a){a=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(a,function(a,b){null==b.text&&b.count>0&&(b.text=b.value+"("+BI.i18nText("BI-Basic_Altogether")+b.count+BI.i18nText("BI-Basic_Count")+")")}),a},initTree:function(a,b){var b=b||this._configSetting();this.nodes=$.fn.zTree.init(this.tree.element,b,a)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={layer:b};if(BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.first_plus_group_node";break;case a.length-1:f.type="bi.last_plus_group_node";break;default:f.type="bi.mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.last_tree_leaf_item";break;default:f.type="bi.mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){BI.isKey(b.id)||(b.id=BI.UUID())})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},c.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),value:c.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},c.el)}),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.LevelTree.EVENT_CHANGE,c,d)})},stroke:function(a){this.tree.stroke.apply(this.tree,arguments)},populate:function(a,b){a=this._formatItems(BI.Tree.transformToTreeFormat(a),0),this.tree.populate(a,b)},setValue:function(a){this.tree.setValue(a)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var a=this,b=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(c,d){var e=function(b){d({items:b}),a.structure.initTree(BI.Tree.transformToTreeFormat(b))};BI.isNotNull(b.items)?e(b.items):b.itemsCreator(c,e)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(b.items)&&this.populate(),BI.isNotNull(b.value)&&this.setValue(b.value)},populate:function(a,b){a&&(this.options.items=a),this.tree.stroke({keyword:b})},_digest:function(a){a||(a=[]);var b=this,c={},d=[];return BI.each(a,function(a,e){var f=b.structure.search(e,"value");if(f){var g=f;for(g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++);g&&g.getChildrenLength()<=c[g.value];)d.push(g.value),g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++)}}),BI.makeObject(a.concat(d))},setValue:function(a){this.tree.setValue(this._digest(a))},_getValue:function(){var a=[],b=this.tree.getValue(),c=function(b){BI.each(b,function(b,d){BI.isEmpty(d)?a.push(b):c(d)})};return c(b),a},empty:function(){this.tree.empty()},getValue:function(){var a=this,b=[],c=this._getValue();return BI.each(c,function(c,d){var e=a.structure.search(d,"value");e&&a.structure._traverse(e,function(a){a.isLeaf()&&b.push(a.value)})}),b}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options;this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:b.triggerWidth||b.height},width:b.triggerWidth||b.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(a){this.editor.setValue(a)},setText:function(a){this.editor.setState(a)}}),BI.EditorTrigger.EVENT_CHANGE="BI.EditorTrigger.EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-trigger",el:{},height:24})},_init:function(){var a=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(a.el,{type:"bi.trigger_icon_button",element:this,width:a.width,height:a.height})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(b){a.wrapper=b},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon "+b.iconCls,ref:function(b){a.icon=b},iconHeight:b.iconHeight,iconWidth:b.iconWidth,disableSelected:!0},width:BI.isEmptyString(b.iconCls)?0:b.triggerWidth||b.height},{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setValue:function(a){this.text.setValue(a)},setIcon:function(a){var b=this.options;this.icon.setIcon(a);var c=this.wrapper.attr("items")[0];BI.isNull(a)||BI.isEmptyString(a)?0!==c.width&&(c.width=0,this.wrapper.resize()):c.width!==(b.triggerWidth||b.height)&&(c.width=b.triggerWidth||b.height,this.wrapper.resize())},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digist(a.value,a.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:b.text,iconCls:b.iconCls,height:a.height,iconHeight:a.iconHeight,iconWidth:a.iconWidth})},_digist:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d,e=BI.Tree.transformToArrayFormat(b);return BI.any(e,function(b,c){if(BI.deepContains(a,c.value))return d={text:c.text||c.value,iconCls:c.iconCls},!0}),BI.isNotNull(d)?{text:d.text,iconCls:d.iconCls}:{text:c.text,iconCls:c.iconCls}},setValue:function(a){var b=this._digist(a,this.options.items);this.trigger.setText(b.text),this.trigger.setIcon(b.iconCls)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,title:function(){return a.text.getText()},hgap:c.hgap,readonly:b.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:a.height,readonly:a.readonly,text:this._digest(a.value,a.items)})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},setValue:function(a){this.trigger.setText(this._digest(a,this.options.items))},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digest(a.text,a.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:a.height-2,text:b.text,cls:b.cls})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?{cls:"",text:d.join(",")}:{cls:"bi-water-mark",text:c.text}},setValue:function(a){var b=this._digest(a,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(b.cls),this.trigger.setText(b.text)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:a.height,text:a.text,hgap:b.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:a.triggerWidth||a.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:a.triggerWidth||a.height}]})},setValue:function(a){this.text.setValue(a)},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.SequenceTableTreeNumber=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-sequence-table-tree-number",isNeedFreeze:!1,startSequence:1,scrollTop:0,headerRowSize:25,rowSize:25,sequenceHeaderCreator:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.SequenceTableTreeNumber.superclass._init.apply(this,arguments);this.options;this.vCurr=1,this.hCurr=1,this.tasks=[],this.renderedCells=[],this.renderedKeys=[],this.container=BI.createWidget({type:"bi.absolute",width:60,scrollable:!1}),this.scrollContainer=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.container]}),this.headerContainer=BI.createWidget({type:"bi.absolute",cls:"bi-border",width:58,scrollable:!1}),this.layout=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.headerContainer,height:this._getHeaderHeight()-2},{el:{type:"bi.layout"},height:2},{el:this.scrollContainer}]}),this.start=this.options.startSequence,this.cache={},this._nextState(),this._populate()},_getNextSequence:function(a){function b(a){c.cache[a.text||a.value]||(c.cache[a.text||a.value]=e),e++}var c=this,d=this.start,e=this.start;return BI.each(a,function(a,f){BI.isNotEmptyArray(f.children)&&BI.each(f.children,function(a,f){0===a&&c.cache[f.text||f.value]&&(d=e=c.cache[f.text||f.value]), b(f)})}),this.start=e,d},_getStart:function(a){var b=this,c=this.start;return BI.some(a,function(a,d){if(BI.isNotEmptyArray(d.children))return BI.some(d.children,function(a,d){if(0===a&&b.cache[d.text||d.value])return c=b.cache[d.text||d.value],!0})}),c},_formatNumber:function(a){function b(a){var c=0;return BI.isNotEmptyArray(a.children)?(BI.each(a.children,function(a,d){c+=b(d)}),BI.isNotEmptyArray(a.values)&&c++):c++,c}var c=this.options,d=[],e=this._getStart(a),f=0,g=0;return BI.each(a,function(a,h){BI.isArray(h.children)&&(BI.each(h.children,function(a,h){var i=b(h);d.push({text:e++,start:f,top:g,cnt:i,index:a,height:i*c.rowSize}),f+=i,g+=i*c.rowSize}),BI.isNotEmptyArray(h.values)&&(d.push({text:BI.i18nText("BI-Summary_Values"),start:f++,top:g,cnt:1,isSummary:!0,height:c.rowSize}),g+=c.rowSize))}),d},_layout:function(){var a=this.options,b=this._getHeaderHeight()-2,c=this.layout.attr("items");a.isNeedFreeze===!1?(c[0].height=0,c[1].height=0):a.isNeedFreeze===!0&&(c[0].height=b,c[1].height=2),this.layout.attr("items",c),this.layout.resize();try{this.scrollContainer.element.scrollTop(a.scrollTop)}catch(d){}},_getHeaderHeight:function(){var a=this.options;return a.headerRowSize*(a.crossHeader.length+(a.header.length>0?1:0))},_nextState:function(){var a=this.options;this._getNextSequence(a.items)},_prevState:function(){var a,b=this.options;BI.some(b.items,function(b,c){if(BI.isNotEmptyArray(c.children))return BI.some(c.children,function(b,c){return a=c,!0})}),a&&BI.isNotEmptyObject(this.cache)?this.start=this.cache[a.text||a.value]:this.start=1,this._nextState()},_getMaxScrollTop:function(a){var b=0;return BI.each(a,function(a,c){b+=c.cnt}),Math.max(0,b*this.options.rowSize-(this.options.height-this._getHeaderHeight())+BI.DOM.getScrollWidth())},_createHeader:function(){var a=this.options;BI.createWidget({type:"bi.absolute",element:this.headerContainer,items:[{el:a.sequenceHeaderCreator()||{type:"bi.table_style_cell",cls:"sequence-table-title-cell",height:this._getHeaderHeight()-2,styleGetter:a.headerCellStyleGetter,text:BI.i18nText("BI-Number_Index")},left:0,top:0,right:0,bottom:0}]})},_calculateChildrenToRender:function(){var a=this,b=this.options,c=[],d=[],e=this._formatNumber(b.items),f=BI.PrefixIntervalTree.uniform(e.length,0);BI.each(e,function(a,b){f.set(a,b.height)});for(var g=BI.clamp(b.scrollTop,0,this._getMaxScrollTop(e)),h=f.greatestLowerBound(g),i=-(g-(h>0?f.sumTo(h-1):0)),j=i,k=b.height-this._getHeaderHeight();j-1)e[f].height!==a.renderedCells[g]._height&&(a.renderedCells[g]._height=e[f].height,a.renderedCells[g].el.setHeight(e[f].height)),e[f].top!==a.renderedCells[g].top&&(a.renderedCells[g].top=e[f].top,a.renderedCells[g].el.element.css("top",e[f].top+"px")),c.push(a.renderedCells[g]);else{var h=BI.createWidget(BI.extend({type:"bi.table_style_cell",cls:"sequence-table-number-cell bi-border-left bi-border-right bi-border-bottom",width:60,styleGetter:e[f].isSummary===!0?function(){return b.summaryCellStyleGetter(!0)}:function(a){return function(){return b.sequenceCellStyleGetter(a)}}(e[f].index)},e[f]));c.push({el:h,left:0,top:e[f].top,_height:e[f].height})}});var l={},m={},n=[];BI.each(d,function(b,c){BI.deepContains(a.renderedKeys,c)?l[b]=c:m[b]=c}),BI.each(this.renderedKeys,function(a,b){BI.deepContains(l,b)||BI.deepContains(m,b)||n.push(a)}),BI.each(n,function(b,c){a.renderedCells[c].el.destroy()});var o=[];BI.each(m,function(a){o.push(c[a])}),BI.createWidget({type:"bi.absolute",element:this.container,items:o}),this.renderedCells=c,this.renderedKeys=d,this.container.setHeight(f.sumUntil(e.length))},_restore:function(){BI.each(this.renderedCells,function(a,b){b.el.destroy()}),this.renderedCells=[],this.renderedKeys=[]},_populate:function(){var a=this;BI.each(this.tasks,function(b,c){c.apply(a)}),this.tasks=[],this.headerContainer.empty(),this._createHeader(),this._layout(),this._calculateChildrenToRender()},setVerticalScroll:function(a){if(this.options.scrollTop!==a){this.options.scrollTop=a;try{this.scrollContainer.element.scrollTop(a)}catch(b){}}},getVerticalScroll:function(){return this.options.scrollTop},setVPage:function(a){a<=1?(this.cache={},this.start=this.options.startSequence,this._restore(),this.tasks.push(this._nextState)):a===this.vCurr+1?this.tasks.push(this._nextState):a===this.vCurr-1&&this.tasks.push(this._prevState),this.vCurr=a},setHPage:function(a){a!==this.hCurr&&this.tasks.push(this._prevState),this.hCurr=a},restore:function(){this._restore()},populate:function(a,b,c,d){var e=this.options;a&&a!==this.options.items&&(e.items=a,this._restore(),this.tasks.push(this._prevState)),b&&b!==this.options.header&&(e.header=b),c&&c!==this.options.crossItems&&(e.crossItems=c),d&&d!==this.options.crossHeader&&(e.crossHeader=d),this._populate()}}),BI.shortcut("bi.sequence_table_tree_number",BI.SequenceTableTreeNumber),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:25})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var a=this;this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup"}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:25})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:b.behaviors,min:b.min,max:b.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.doBehavior()})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-picker bi-background",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===a._month?a.setValue({year:a.year.getValue()-1,month:12}):a.setValue({year:a.year.getValue(),month:a.month.getValue()-1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===a._month?a.setValue({year:a.year.getValue()+1,month:1}):a.setValue({year:a.year.getValue(),month:a.month.getValue()+1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo"}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{type:"bi.horizontal",width:100,items:[this.year,this.month]}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var a=this.options,b=!(1===this._month&&this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(12===this._month&&this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a.year,this._month=a.month,this.year.setValue(a.year),this.month.setValue(a.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-year-picker bi-background",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()-1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()+1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,behaviors:b.behaviors,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue(a.year.getValue()),a.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[this.year]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a,this.year.setValue(a),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=b.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(a.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){a.selectedTime=a.datePicker.getValue(),a.selectedTime.day=1,a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)})},setValue:function(a){this.datePicker.setValue(a),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(a){var b=this.options,c=this._year,d=BI.createWidget({type:"bi.year_calendar",behaviors:b.behaviors,min:b.min,max:b.max,logic:{dynamic:!0},year:c+12*a});return d.setValue(this._year),d},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var c=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1}),d=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-border-top",height:25,items:[c,d]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(a.selectedYear);var b=this.getSelectedCard();c.setEnable(!b.isFrontYear()),d.setEnable(!b.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedYear=this.getValue(),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.fireEvent(BI.YearPopup.EVENT_CHANGE,a.selectedYear)}),BI.isKey(b.value)&&this.setValue(b.value)},getValue:function(){return this.selectedYear},setValue:function(a){var b=this.options;a=BI.parseInt(a),BI.checkDateVoid(a,1,1,b.min,b.max)[0]?(a=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue("")):(this.selectedYear=a,this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue(a))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:25,iconWidth:16,iconHeight:13},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:25})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:a.text,value:a.value,height:b.height}),this.icon=BI.createWidget({type:"bi.icon",width:b.iconWidth,height:b.iconHeight}),BI.createWidget({type:"bi.center_adapt",element:this,items:[{type:"bi.center_adapt",width:50,height:b.height,items:[this.text,this.icon]}]})},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()},setText:function(a){this.text.setText(a)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=b.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var b=a.datePicker.getValue(),c=BI.getDate(b.year,b.month-1,1).getMonthDays(),d=a.selectedTime.day||0;d>c&&(d=c),a.selectedTime={year:b.year,month:b.month},0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){this._setDatePicker(a),this._setCalendar(a)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDatePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDatePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateCombo.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border",width:200,height:24})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options,c=BI.getDate();this.storeValue=BI.isNotNull(b.value)?b.value:{year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate(),hour:c.getHours(),minute:c.getMinutes(),second:c.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),a.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){a.storeValue=a.popup.getValue(),a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var d=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font bi-border-right",width:24,height:24});d.on(BI.TriggerIconButton.EVENT_CHANGE,function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:d,top:0,left:0}]}]})},setValue:function(a){this.storeValue=a,this.popup.setValue(a),this.trigger.setValue(a)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max}),a.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateSelect=BI.createWidget({type:"bi.vertical_adapt",cls:"bi-border-top",items:[{type:"bi.label",text:BI.i18nText("BI-Basic_Time"),width:45},{type:"bi.date_time_select",max:23,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.hour=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.minute=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.second=b}}]}),this.setValue(b.value),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:this.dateSelect,height:50},{el:this.dateButton,height:30}]})},setValue:function(a){var b,c=a;BI.isNull(c)?(b=BI.getDate(),this.dateCombo.setValue({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}),this.hour.setValue(b.getHours()),this.minute.setValue(b.getMinutes()),this.second.setValue(b.getSeconds())):(this.dateCombo.setValue({year:c.year,month:c.month,day:c.day}),this.hour.setValue(c.hour),this.minute.setValue(c.minute),this.second.setValue(c.second))},getValue:function(){return{year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day,hour:this.hour.getValue(),minute:this.minute.getValue(),second:this.second.getValue()}}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeSelect=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimeSelect.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-select bi-border",max:23,min:0})},_init:function(){BI.DateTimeSelect.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",value:this._alertInEditorValue(b.min),allowBlank:!1,errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Please_Input_Natural_Number"):BI.i18nText("BI-Numerical_Interval_Input_Data")},validationChecker:function(a){return BI.isNaturalNumber(a)}}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){a._finetuning(0),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",cls:"column-pre-page-h-font top-button bi-border-left bi-border-bottom"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",cls:"column-next-page-h-font bottom-button bi-border-left"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(-1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this._finetuning(0),BI.createWidget({type:"bi.htape",element:this,items:[this.editor,{el:{type:"bi.grid",columns:1,rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:30}]})},_alertOutEditorValue:function(a){return a>this.options.max&&(a=this.options.min),athis.options.max&&(a=this.options.min),ac&&(d=c),a.selectedTime=BI.extend(a.selectedTime,{year:b.year,month:b.month,day:d}),0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,items:[this.calendar,{el:{type:"bi.dynamic_date_time_select",ref:function(){a.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.fireEvent("EVENT_CHANGE")}}]},height:40}]}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=BI.extend({},this.timeSelect.getValue(),a)},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(), -this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){a=a||{},this._setDatePicker(a),this._setCalendar(a),this.timeSelect.setValue({hour:a.hour,minute:a.minute,second:a.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDateTimePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateTimePane.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:a.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:a.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(a){this.downlistgroup.setValue(a)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:25,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,height:b.height,text:b.text,value:b.value,logic:b.logic,selected:b.selected,disabled:b.disabled,iconHeight:b.iconHeight,iconWidth:b.iconWidth,textHgap:b.textHgap,textVgap:b.textVgap,textLgap:b.textLgap,textRgap:b.textRgap,father:b.father,bubble:b.bubble}),this.text.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.IconTextItem.EVENT_CHANGE,function(){a.fireEvent(BI.DownListItem.EVENT_CHANGE)})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},isSelected:function(){return this.text.isSelected()},setSelected:function(a){this.text.setSelected(a)},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var a=this.options,b=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:a.text,value:a.value,height:a.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:a.iconCls1,width:25,forceNotSelected:!0,selected:this._digest(a.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:a.iconCls2,width:25,forceNotSelected:!0});var c=BI.createWidget({type:"bi.layout",width:25});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,c)})))),this.element.hover(function(){b.isEnabled()&&b.hover()},function(){b.isEnabled()&&b.dishover()})},_digest:function(a){var b=this.options;return a=BI.isArray(a)?a:[a],BI.any(a,function(a,c){return BI.contains(b.childValues,c)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(a){this.icon1.setSelected(this._digest(a))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var a=this,b=this.options,c=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])?(d=a.childValueMap[b],a.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,d,a.fatherValueMap[b])):a.fireEvent(BI.DownListPopup.EVENT_CHANGE,d,c),!a.singleValues.contains(d)){var e=a.getValue(),f=[];BI.each(e,function(a,b){b.value!=d&&f.push(b)}),a.setValue(f)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createChildren:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},maxHeight:378},c.el.childValues=[],BI.each(c.children,function(a,d){var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value)})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a0?1:0}},setValue:function(a){a=a||{},this.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT;var b=[],c=[];BI.isNotNull(a.year)&&(b.push(BI.DynamicDateCard.TYPE.YEAR),c.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,a.year))),BI.isNotNull(a.quarter)&&(b.push(BI.DynamicDateCard.TYPE.QUARTER),c.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,a.quarter))),BI.isNotNull(a.month)&&(b.push(BI.DynamicDateCard.TYPE.MONTH),c.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,a.month))),BI.isNotNull(a.week)&&(b.push(BI.DynamicDateCard.TYPE.WEEK),c.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,a.week))),BI.isNotNull(a.day)&&(b.push(BI.DynamicDateCard.TYPE.DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,a.day))),BI.isNotNull(a.workDay)&&(b.push(BI.DynamicDateCard.TYPE.WORK_DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,a.workDay))),this.checkgroup.setValue(b),this.workDayBox.setSelected(BI.isNotNull(a.workDay)),this.resultPane.populate(this._getParamJson(c,a.position))},getValue:function(){var a=this,b={},c=this.checkgroup.getValue(),d=this.resultPane.getAllButtons();if(0!==c.length&&BI.each(d,function(c,d){var e=d.getValue();switch(e.dateType){case BI.DynamicDateCard.TYPE.YEAR:b.year=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.QUARTER:b.quarter=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.MONTH:b.month=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.WEEK:b.week=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.DAY:b.day=0===e.offset?-e.value:e.value}BI.isNull(e.dateType)&&(b.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var e=d[0].getValue();b.workDay=0===e.offset?-e.value:e.value}return b}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(a){return BI.isNaturalNumber(a)},value:b.value,ref:function(){a.editor=this},errorText:function(a){return BI.isEmptyString(a)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Positive_Integer")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:b.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){a.offsetCombo=this},value:b.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var a="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:a=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:a=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:a=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:a=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:a=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:a=BI.i18nText("BI-Basic_Work_Day")}return a},setValue:function(a){a=a||{},a.value=a.value||0,a.offset=a.offset||0,this.editor.setValue(a.value),this.offsetCombo.setValue(a.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){a.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6, +this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){a=a||{},this._setDatePicker(a),this._setCalendar(a),this.timeSelect.setValue({hour:a.hour,minute:a.minute,second:a.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDateTimePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateTimePane.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:a.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:a.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(a){this.downlistgroup.setValue(a)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:25,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,height:b.height,text:b.text,value:b.value,logic:b.logic,selected:b.selected,disabled:b.disabled,iconHeight:b.iconHeight,iconWidth:b.iconWidth,textHgap:b.textHgap,textVgap:b.textVgap,textLgap:b.textLgap,textRgap:b.textRgap,father:b.father,bubble:b.bubble}),this.text.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.IconTextItem.EVENT_CHANGE,function(){a.fireEvent(BI.DownListItem.EVENT_CHANGE)})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},isSelected:function(){return this.text.isSelected()},setSelected:function(a){this.text.setSelected(a)},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var a=this.options,b=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:a.text,value:a.value,height:a.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:a.iconCls1,width:25,forceNotSelected:!0,selected:this._digest(a.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:a.iconCls2,width:25,forceNotSelected:!0});var c=BI.createWidget({type:"bi.layout",width:25});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,c)})))),this.element.hover(function(){b.isEnabled()&&b.hover()},function(){b.isEnabled()&&b.dishover()})},_digest:function(a){var b=this.options;return a=BI.isArray(a)?a:[a],BI.any(a,function(a,c){return BI.contains(b.childValues,c)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(a){this.icon1.setSelected(this._digest(a))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var a=this,b=this.options,c=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])?(d=a.childValueMap[b],a.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,d,a.fatherValueMap[b])):a.fireEvent(BI.DownListPopup.EVENT_CHANGE,d,c),!a.singleValues.contains(d)){var e=a.getValue(),f=[];BI.each(e,function(a,b){b.value!=d&&f.push(b)}),a.setValue(f)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createChildren:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},maxHeight:378},c.el.childValues=[],BI.each(c.children,function(a,d){var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value)})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a0?1:0}},setValue:function(a){a=a||{},this.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT;var b=[],c=[];BI.isNotNull(a.year)&&(b.push(BI.DynamicDateCard.TYPE.YEAR),c.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,a.year))),BI.isNotNull(a.quarter)&&(b.push(BI.DynamicDateCard.TYPE.QUARTER),c.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,a.quarter))),BI.isNotNull(a.month)&&(b.push(BI.DynamicDateCard.TYPE.MONTH),c.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,a.month))),BI.isNotNull(a.week)&&(b.push(BI.DynamicDateCard.TYPE.WEEK),c.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,a.week))),BI.isNotNull(a.day)&&(b.push(BI.DynamicDateCard.TYPE.DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,a.day))),BI.isNotNull(a.workDay)&&(b.push(BI.DynamicDateCard.TYPE.WORK_DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,a.workDay))),this.checkgroup.setValue(b),this.workDayBox.setSelected(BI.isNotNull(a.workDay)),this.resultPane.populate(this._getParamJson(c,a.position))},getValue:function(){var a=this,b={},c=this.checkgroup.getValue(),d=this.resultPane.getAllButtons();if(0!==c.length&&BI.each(d,function(c,d){var e=d.getValue();switch(e.dateType){case BI.DynamicDateCard.TYPE.YEAR:b.year=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.QUARTER:b.quarter=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.MONTH:b.month=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.WEEK:b.week=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.DAY:b.day=0===e.offset?-e.value:e.value}BI.isNull(e.dateType)&&(b.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var e=d[0].getValue();b.workDay=0===e.offset?-e.value:e.value}return b}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(a){return BI.isNaturalNumber(a)},value:b.value,ref:function(){a.editor=this},errorText:function(a){return BI.isEmptyString(a)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Positive_Integer")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:b.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){a.offsetCombo=this},value:b.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var a="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:a=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:a=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:a=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:a=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:a=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:a=BI.i18nText("BI-Basic_Work_Day")}return a},setValue:function(a){a=a||{},a.value=a.value||0,a.offset=a.offset||0,this.editor.setValue(a.value),this.offsetCombo.setValue(a.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){a.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6, yearFullMonthLength:7},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(b){var c=b.match(/\d+/g);return a._autoAppend(b,c),a._dateCheck(b)&&BI.checkDateLegal(b)&&a._checkVoid({year:0|c[0],month:0|c[1],day:0|c[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){return a.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")},title:function(){var b=a.storeValue||{},c=b.type||BI.DynamicDateCombo.Static,d=b.value;switch(c){case BI.DynamicDateCombo.Dynamic:var e=a._getText(d),f=BI.getDate();f=BI.DynamicDateHelper.getCalculation(d);var g=f.print("%Y-%x-%e");return BI.isEmptyString(e)?g:e+":"+g;case BI.DynamicDateCombo.Static:default:return BI.isNull(d)||BI.isNull(d.day)?"":BI.getDate(d.year,d.month-1,d.day).print("%Y-%X-%d")}}}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();if(BI.isNotNull(b)&&a.editor.setState(b),BI.isNotEmptyString(b)){var c=b.split("-");a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|c[0],month:0|c[1],day:0|c[2]}}}a.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){a.editor.isValid()&&a.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:30}]}),this.setValue(b.value)},_dateCheck:function(a){return BI.parseDateTime(a,"%Y-%x-%d").print("%Y-%x-%d")===a||BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d")===a||BI.parseDateTime(a,"%Y-%x-%e").print("%Y-%x-%e")===a||BI.parseDateTime(a,"%Y-%X-%e").print("%Y-%X-%e")===a},_checkVoid:function(a){return!BI.checkDateVoid(a.year,a.month,a.day,this.options.min,this.options.max)[0]},_autoAppend:function(a,b){if(BI.isNotNull(b)&&BI.checkDateLegal(a))switch(a.length){case this._const.yearLength:this._yearCheck(a)&&this.editor.setValue(a+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var c=a.split("-")[1];(BI.isNotNull(c)&&2===c.length||this._monthCheck(a))&&this.editor.setValue(a+"-")}},_yearCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d");return BI.parseDateTime(a,"%Y").print("%Y")===a&&b>=this.options.min&&b<=this.options.max},_monthCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d"),c=b.print("%Y-%X-%d");return b.getMonth()>0&&(BI.parseDateTime(a,"%Y-%X").print("%Y-%X")===a||BI.parseDateTime(a,"%Y-%x").print("%Y-%x")===a)&&c>=this.options.min&&c<=this.options.max},_setInnerValue:function(a){var b=a.print("%Y-%x-%e");this.editor.setState(b),this.editor.setValue(b)},_getText:function(a){function b(a,b){switch(b){case BI.DynamicDateCard.OFFSET.BEGIN:return a+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return a+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var c="",d="";return BI.isNotNull(a.year)&&(0!==BI.parseInt(a.year)&&(c+=Math.abs(a.year)+BI.i18nText("BI-Basic_Year")+(a.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Year"),a.position)),BI.isNotNull(a.quarter)&&(0!==BI.parseInt(a.quarter)&&(c+=Math.abs(a.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(a.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Single_Quarter"),a.position)),BI.isNotNull(a.month)&&(0!==BI.parseInt(a.month)&&(c+=Math.abs(a.month)+BI.i18nText("BI-Basic_Month")+(a.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Month"),a.position)),BI.isNotNull(a.week)&&(0!==BI.parseInt(a.week)&&(c+=Math.abs(a.week)+BI.i18nText("BI-Basic_Week")+(a.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Week"),a.position)),BI.isNotNull(a.day)&&(0!==BI.parseInt(a.day)&&(c+=Math.abs(a.day)+BI.i18nText("BI-Basic_Day")+(a.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=1===BI.size(a)?b(BI.i18nText("BI-Basic_Month"),a.position):""),BI.isNotNull(a.workDay)&&0!==BI.parseInt(a.workDay)&&(c+=Math.abs(a.workDay)+BI.i18nText("BI-Basic_Work_Day")+(a.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),c+d},setValue:function(a){var b,c,d=BI.getDate();switch(this.storeValue=a,BI.isNotNull(a)&&(b=a.type||BI.DynamicDateCombo.Static,c=a.value||a),b){case BI.DynamicDateCombo.Dynamic:var e=this._getText(c);d=BI.DynamicDateHelper.getCalculation(c),this._setInnerValue(d,e);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(c)||BI.isNull(c.day))this.editor.setState(""),this.editor.setValue("");else{var f=BI.getDate(c.year,c.month-1,c.day).print("%Y-%X-%d");this.editor.setState(f),this.editor.setValue(f)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger),BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),hour:0,minute:0,second:0}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2}),BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,ref:function(){a.ymd=this}},{el:{type:"bi.dynamic_date_time_select",ref:function(){a.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){}}]},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a.timeSelect.setValue(),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.timeSelect.setValue({hour:c.hour,minute:c.minute,second:c.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var a=this.dateTab.getSelect();return{type:a,value:a===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup),BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select bi-border-top"},render:function(){var a=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){a.hour=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<24},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkHour(b),this.setValue(a._formatValueToDoubleDigit(b)),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var b=a._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(b)}}],width:60,height:24},lgap:14},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){a.minute=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<60},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkMinute(b),this.setValue(a._formatValueToDoubleDigit(b),BI.DynamicDateTimeSelect.MINUTE),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var b=a._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(b)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){a.second=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<60},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkSecond(b),this.setValue(a._formatValueToDoubleDigit(b)),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(a){a=a||{},this._checkHour(a.hour),this._checkMinute(a.minute),this._checkSecond(a.second)},_checkHour:function(a){this.hour.setDownEnable(BI.parseInt(a)>0),this.hour.setUpEnable(BI.parseInt(a)<23)},_checkMinute:function(a){this.minute.setDownEnable(BI.parseInt(a)>0),this.minute.setUpEnable(BI.parseInt(a)<59)},_checkSecond:function(a){this.second.setDownEnable(BI.parseInt(a)>0),this.second.setUpEnable(BI.parseInt(a)<59)},_autoSwitch:function(a,b){var c=0,d=a;switch(b){case BI.DynamicDateTimeSelect.HOUR:c=2;break;case BI.DynamicDateTimeSelect.MINUTE:c=5}return 1===a.length&&BI.parseInt(a)>c&&(d="0"+d),2===d.length&&(b===BI.DynamicDateTimeSelect.HOUR?this.minute.focus():this.second.focus()),d},_formatValueToDoubleDigit:function(a){(BI.isNull(a)||BI.isEmptyString(a))&&(a=0);var b=BI.parseInt(a);return b<10&&(b="0"+b),b},_assertValue:function(a){return a=a||{},a.hour=this._formatValueToDoubleDigit(a.hour)||"00",a.minute=this._formatValueToDoubleDigit(a.minute)||"00",a.second=this._formatValueToDoubleDigit(a.second)||"00",a},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(a){a=this._assertValue(a),this.hour.setValue(a.hour),this.minute.setValue(a.minute),this.second.setValue(a.second),this._checkBorder(a)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2}),BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(b){var c=b.match(/\d+/g);return a._autoAppend(b,c),a._dateCheck(b)&&BI.checkDateLegal(b)&&a._checkVoid({year:0|c[0],month:0|c[1],day:0|c[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){return a.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")},title:function(){var b=a.storeValue||{},c=b.type||BI.DynamicDateCombo.Static,d=b.value;switch(c){case BI.DynamicDateCombo.Dynamic:var e=a._getText(d),f=BI.DynamicDateHelper.getCalculation(d),g=f.print("%Y-%x-%e %H:%M:%S");return BI.isEmptyString(e)?g:e+":"+g;case BI.DynamicDateCombo.Static:default:return BI.isNull(d)||BI.isNull(d.day)?"":BI.getDate(d.year,d.month-1,d.day,d.hour||0,d.minute||0,d.second||0).print("%Y-%X-%d %H:%M:%S")}}}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();if(BI.isNotNull(b)&&a.editor.setState(b),BI.isNotEmptyString(b)){var c=b.split(/-|\s|:/);a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|c[0],month:0|c[1],day:0|c[2],hour:0|c[3],minute:0|c[4],second:0|c[5]}}}a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:30}]}),this.setValue(b.value)},_dateCheck:function(a){return BI.parseDateTime(a,"%Y-%x-%d %H:%M:%S").print("%Y-%x-%d %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%X-%d %H:%M:%S").print("%Y-%X-%d %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%x-%e %H:%M:%S").print("%Y-%x-%e %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%X-%e %H:%M:%S").print("%Y-%X-%e %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%x-%d").print("%Y-%x-%d")===a||BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d")===a||BI.parseDateTime(a,"%Y-%x-%e").print("%Y-%x-%e")===a||BI.parseDateTime(a,"%Y-%X-%e").print("%Y-%X-%e")===a},_checkVoid:function(a){return!BI.checkDateVoid(a.year,a.month,a.day,this.options.min,this.options.max)[0]},_autoAppend:function(a,b){if(BI.isNotNull(b)&&BI.checkDateLegal(a))switch(a.length){case this._const.yearLength:this._yearCheck(a)&&this.editor.setValue(a+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var c=a.split("-")[1];(BI.isNotNull(c)&&2===c.length||this._monthCheck(a))&&this.editor.setValue(a+"-")}},_yearCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d");return BI.parseDateTime(a,"%Y").print("%Y")===a&&b>=this.options.min&&b<=this.options.max},_monthCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d"),c=b.print("%Y-%X-%d");return b.getMonth()>0&&(BI.parseDateTime(a,"%Y-%X").print("%Y-%X")===a||BI.parseDateTime(a,"%Y-%x").print("%Y-%x")===a)&&c>=this.options.min&&c<=this.options.max},_setInnerValue:function(a){var b=a.print("%Y-%x-%e %H:%M:%S");this.editor.setState(b),this.editor.setValue(b)},_getText:function(a){function b(a,b){switch(b){case BI.DynamicDateCard.OFFSET.BEGIN:return a+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return a+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var c="",d="";return BI.isNotNull(a.year)&&(0!==BI.parseInt(a.year)&&(c+=Math.abs(a.year)+BI.i18nText("BI-Basic_Year")+(a.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Year"),a.position)),BI.isNotNull(a.quarter)&&(0!==BI.parseInt(a.quarter)&&(c+=Math.abs(a.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(a.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Single_Quarter"),a.position)),BI.isNotNull(a.month)&&(0!==BI.parseInt(a.month)&&(c+=Math.abs(a.month)+BI.i18nText("BI-Basic_Month")+(a.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Month"),a.position)),BI.isNotNull(a.week)&&(0!==BI.parseInt(a.week)&&(c+=Math.abs(a.week)+BI.i18nText("BI-Basic_Week")+(a.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Week"),a.position)),BI.isNotNull(a.day)&&(0!==BI.parseInt(a.day)&&(c+=Math.abs(a.day)+BI.i18nText("BI-Basic_Day")+(a.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=1===BI.size(a)?b(BI.i18nText("BI-Basic_Month"),a.position):""),BI.isNotNull(a.workDay)&&0!==BI.parseInt(a.workDay)&&(c+=Math.abs(a.workDay)+BI.i18nText("BI-Basic_Work_Day")+(a.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),c+d},setValue:function(a){var b,c,d=BI.getDate();switch(this.storeValue=a,BI.isNotNull(a)&&(b=a.type||BI.DynamicDateCombo.Static,c=a.value||a),b){case BI.DynamicDateCombo.Dynamic:var e=this._getText(c);d=BI.DynamicDateHelper.getCalculation(c),this._setInnerValue(d,e);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(c)||BI.isNull(c.day))this.editor.setState(""),this.editor.setValue("");else{var f=BI.getDate(c.year,c.month-1,c.day,c.hour||0,c.minute||0,c.second||0).print("%Y-%X-%d %H:%M:%S");this.editor.setState(f),this.editor.setValue(f)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger),BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-search-editor bi-border",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.center_adapt",cls:"search-font",items:[{el:{type:"bi.icon"}}]},width:25},{el:a.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SearchEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},getKeywords:function(){var a=this.editor.getValue(),b=a.match(/[\S]+/g);return BI.isEndWithBlank(a)?b.concat([" "]):b},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor),BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var a=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-small-search-editor",height:24})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor),BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-text-editor bi-border",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;BI.isNumber(b.height)&&this.element.css({height:b.height-2}),BI.isNumber(b.width)&&this.element.css({width:b.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:b.height-2,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,title:b.title,tipType:b.tipType,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.TextEditor.EVENT_FOCUS); }),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(b){a.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(b){a.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(b){a.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor),BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var a=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-small-text-editor",height:25})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor),BI.FileManagerButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-button_group",items:[]})},_init:function(){BI.FileManagerButtonGroup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget({type:"bi.button_tree",element:this,chooseType:BI.Selection.Multi,items:this._formatItems(b.items),layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_formatItems:function(a){this.options;return BI.each(a,function(a,b){b.children&&b.children.length>0?b.type="bi.file_manager_folder_item":b.type="bi.file_manager_file_item"}),a},setValue:function(a){this.button_group.setValue(a)},getValue:function(){return this.button_group.getValue()},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getAllButtons:function(){return this.button_group.getAllButtons()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},populate:function(a){this.button_group.populate(this._formatItems(a))}}),BI.FileManagerButtonGroup.EVENT_CHANGE="FileManagerButtonGroup.EVENT_CHANGE",BI.shortcut("bi.file_manager_button_group",BI.FileManagerButtonGroup),BI.FileManager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager",el:{},items:[]})},_init:function(){BI.FileManager.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=new BI.Tree;var c=BI.Tree.transformToTreeFormat(b.items);this.tree.initTree(c),this.selectedValues=[],this.nav=BI.createWidget({type:"bi.file_manager_nav",items:BI.deepClone(c)}),this.nav.on(BI.FileManagerNav.EVENT_CHANGE,function(b,c){if("-1"==b)a.populate({children:a.tree.toJSON()});else{var d=a.tree.search(c.attr("id"));a.populate(BI.extend({id:d.id},d.get("data"),{children:a.tree.toJSON(d)}))}a.setValue(a.selectedValues)}),this.list=BI.createWidget(b.el,{type:"bi.file_manager_list",items:c}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){if(b===BI.Events.CHANGE){var e=a.tree.search(d.attr("id"));a.populate(BI.extend({id:e.id},e.get("data"),{children:a.tree.toJSON(e)}))}else if(b===BI.Events.CLICK){var f=[];if(d instanceof BI.MultiSelectBar){var g=a.list.getValue();c=g.type===BI.Selection.All,f=BI.concat(g.assist,g.value)}else f=d.getAllLeaves();BI.each(f,function(b,d){c===!0?a.selectedValues.pushDistinct(d):a.selectedValues.remove(d)})}a.setValue(a.selectedValues)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.list,left:0,right:0,top:0,bottom:10},{el:this.nav,left:40,right:100,top:0}]})},setValue:function(a){this.selectedValues=a||[],this.list.setValue(this.selectedValues)},getValue:function(){var a=this.list.getValue(),b=a.type===BI.Selection.All?a.assist:a.value;return b.pushDistinctArray(this.selectedValues),b},_populate:function(a){this.list.populate(a)},getSelectedValue:function(){return this.nav.getValue()[0]},getSelectedId:function(){return this.nav.getId()[0]},populate:function(a){var b=BI.deepClone(a);this._populate(a.children),this.nav.populate(b)}}),BI.FileManager.EVENT_CHANGE="FileManager.EVENT_CHANGE",BI.shortcut("bi.file_manager",BI.FileManager),BI.FileManagerFileItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.FileManagerFileItem.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-file-item bi-list-item bi-border-bottom",height:30})},_init:function(){BI.FileManagerFileItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checked=BI.createWidget({type:"bi.multi_select_bar",text:"",width:36,height:b.height}),this.checked.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.checked,width:36},{el:{type:"bi.icon_button",cls:"create-by-me-file-font"},width:20},{el:{type:"bi.label",textAlign:"left",height:b.height,text:b.text,value:b.value}}]})},getAllLeaves:function(){return[this.options.value]},isSelected:function(){return this.checked.isSelected()},setSelected:function(a){this.checked.setSelected(a)}}),BI.FileManagerFileItem.EVENT_CHANGE="FileManagerFileItem.EVENT_CHANGE",BI.shortcut("bi.file_manager_file_item",BI.FileManagerFileItem),BI.FileManagerFolderItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.FileManagerFolderItem.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-folder-item bi-list-item bi-border-bottom",height:30})},_init:function(){BI.FileManagerFolderItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checked=BI.createWidget({type:"bi.multi_select_bar",text:"",width:36,height:b.height}),this.checked.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button=BI.createWidget({type:"bi.text_button",textAlign:"left",height:b.height,text:b.text,value:b.value}),this.button.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,b.value,a)}),this.tree=new BI.Tree,this.tree.initTree([{id:b.id,children:b.children}]),this.selectValue=[],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.checked,width:36},{el:{type:"bi.icon_button",cls:"create-by-me-folder-font"},width:20},{el:this.button}]})},setAllSelected:function(a){this.checked.setSelected(a),this.selectValue=[]},setHalfSelected:function(a){this.checked.setHalfSelected(a),a||(this.selectValue=[])},setValue:function(a){var b=(this.options,!1),c=[];this.tree.traverse(function(d){d.isLeaf()&&(BI.contains(a,d.get("data").value)?c.push(d.get("data").value):b=!0)}),this.setAllSelected(c.length>0&&!b),this.setHalfSelected(c.length>0&&b),this.checked.isHalfSelected()&&(this.selectValue=c)},getAllButtons:function(){return[this]},getAllLeaves:function(){var a=(this.options,[]);return this.tree.traverse(function(b){b.isLeaf()&&a.push(b.get("data").value)}),a},getNotSelectedValue:function(){var a=this,b=(this.options,[]),c=this.checked.isSelected();if(c===!0)return b;var d=this.checked.isHalfSelected();return this.tree.traverse(function(c){if(c.isLeaf()){var e=c.get("data").value;d===!0?BI.contains(a.selectValue,c.get("data").value)||b.push(e):b.push(e)}}),b},getValue:function(){var a=[];return this.checked.isSelected()?(this.tree.traverse(function(b){b.isLeaf()&&a.push(b.get("data").value)}),a):this.checked.isHalfSelected()?this.selectValue:[]}}),BI.FileManagerFolderItem.EVENT_CHANGE="FileManagerFolderItem.EVENT_CHANGE",BI.shortcut("bi.file_manager_folder_item",BI.FileManagerFolderItem),BI.FileManagerList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-list",el:{},items:[]})},_init:function(){BI.FileManagerList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.list=BI.createWidget({type:"bi.select_list",element:this,items:b.items,toolbar:{type:"bi.multi_select_bar",height:40,text:""},el:{type:"bi.list_pane",el:BI.isWidget(b.el)?b.el:BI.extend({type:"bi.file_manager_button_group"},b.el)}}),this.list.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(a){this.list.setValue({value:a})},getValue:function(){return this.list.getValue()},populate:function(a){this.list.populate(a),this.list.setToolBarVisible(!0)}}),BI.FileManagerList.EVENT_CHANGE="FileManagerList.EVENT_CHANGE",BI.shortcut("bi.file_manager_list",BI.FileManagerList),BI.FileManagerNavButton=BI.inherit(BI.Widget,{_const:{normal_color:"#ffffff",select_color:"#eff1f4"},_defaultConfig:function(){return BI.extend(BI.FileManagerNavButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-nav-button",selected:!1,height:40})},_init:function(){BI.FileManagerNavButton.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.button=BI.createWidget({type:"bi.text_button",cls:"file-manager-nav-button-text bi-card",once:!0,selected:b.selected,text:b.text,title:b.text,value:b.value,height:b.height,lgap:20,rgap:10}),this.button.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var d=BI.createWidget({type:"bi.svg",cls:"file-manager-nav-button-triangle",width:15,height:b.height}),e=d.path("M0,0L15,20L0,40").attr({stroke:c.select_color,fill:b.selected?c.select_color:c.normal_color});this.button.on(BI.TextButton.EVENT_CHANGE,function(){this.isSelected()?e.attr("fill",c.select_color):e.attr("fill",c.normal_color)}),BI.createWidget({type:"bi.default",element:this,items:[this.button]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:d,right:-15,top:0,bottom:0}]})},isSelected:function(){return this.button.isSelected()},setValue:function(a){this.button.setValue(a)},getValue:function(){return this.button.getValue()},populate:function(a){}}),BI.FileManagerNavButton.EVENT_CHANGE="FileManagerNavButton.EVENT_CHANGE",BI.shortcut("bi.file_manager_nav_button",BI.FileManagerNavButton),BI.FileManagerNav=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerNav.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-nav bi-border-left",height:40,items:[]})},_init:function(){BI.FileManagerNav.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=new BI.Tree,this.refreshTreeData(b.items),this.tree.getRoot().set("data",{text:BI.i18nText("BI-Created_By_Me"),value:BI.FileManagerNav.ROOT_CREATE_BY_ME,id:BI.FileManagerNav.ROOT_CREATE_BY_ME}),this.button_group=BI.createWidget({type:"bi.button_group",element:this,items:[{type:"bi.file_manager_nav_button",text:BI.i18nText("BI-Created_By_Me"),selected:!0,id:BI.FileManagerNav.ROOT_CREATE_BY_ME,value:BI.FileManagerNav.ROOT_CREATE_BY_ME}],layouts:[{type:"bi.horizontal"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.FileManagerNav.EVENT_CHANGE,arguments)})},_getAllParents:function(a){var b,c=[];for(b=a?this.tree.search(a):this.tree.getRoot();b.parent;)c.push(b),b=b.parent;return c.push(b),c.reverse()},_formatNodes:function(a){var b=[];return BI.each(a,function(a,c){b.push(BI.extend({type:"bi.file_manager_nav_button",id:c.id},c.get("data")))}),BI.last(b).selected=!0,b},getValue:function(){return this.button_group.getValue()},getId:function(){var a=[];return BI.each(this.button_group.getSelectedButtons(),function(b,c){a.push(c.attr("id"))}),a},refreshTreeData:function(a){this.tree.initTree(BI.Tree.transformToTreeFormat(a)),this.tree.getRoot().set("data",{text:BI.i18nText("BI-Created_By_Me"),value:BI.FileManagerNav.ROOT_CREATE_BY_ME,id:BI.FileManagerNav.ROOT_CREATE_BY_ME})},populate:function(a){var b=BI.isNull(a)?[this.tree.getRoot()]:this._getAllParents(a.id);this.button_group.populate(this._formatNodes(b))}}),BI.extend(BI.FileManagerNav,{ROOT_CREATE_BY_ME:"-1"}),BI.FileManagerNav.EVENT_CHANGE="FileManagerNav.EVENT_CHANGE",BI.shortcut("bi.file_manager_nav",BI.FileManagerNav),BI.AbstractFilterItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-item bi-border-right bi-border-bottom"},isSelectedCondition:function(){return this.emptyItem&&this.emptyItem.isVisible()},setSelectedCondition:function(a){a&&(this.emptyItem||(this.emptyItem=BI.createWidget({type:"bi.absolute",height:40,cls:"filter-item-empty-item bi-border-top",items:[{el:{type:"bi.center_adapt",cls:"empty-filter-item-leaf"}}],hgap:10,vgap:5}),BI.createWidget({type:"bi.vertical",element:this,items:[this.emptyItem],scrolly:!1}))),this.emptyItem&&this.emptyItem.setVisible(a)}}),BI.extend(BI.AbstractFilterItem,{FILTER_OPERATION_FORMULA:1,FILTER_OPERATION_CONDITION:2,FILTER_OPERATION_CONDITION_AND:3,FILTER_OPERATION_CONDITION_OR:4,FILTER_OPERATION_FORMULA_AND:5,FILTER_OPERATION_FORMULA_OR:6}),!function(){var a=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-expander",el:{},popup:{}},render:function(){var a=this,b=this.options;return{type:"bi.filter_expander",el:b.el,popup:b.popup,id:b.id,value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}],ref:function(b){a.expander=b}}},populate:function(){this.expander.populate.apply(this.expander,arguments)},getValue:function(){var a=this.expander.getValue();return{filterType:a.type,filterValue:a.value,id:a.id}}});BI.shortcut("bi.and.or.filter.expander",a)}(),!function(){var a=BI.inherit(BI.AbstractFilterItem,{_constant:{EXPANDER_WIDTH:20},props:{baseCls:"bi-filter-item bi-filter-expander",el:{},popup:{}},render:function(){var a=this,b=this.options,c=b.el.value,d="";return d=c===BI.Filter.FILTER_TYPE.AND?BI.i18nText("BI-Basic_And"):BI.i18nText("BI-Basic_Or"),{type:"bi.horizontal_adapt",cls:"filter-item-empty-item",verticalAlign:BI.VerticalAlign.Middle,items:[{type:"bi.text_button",cls:"condition-and-or",text:d,value:c,id:b.id,width:this._constant.EXPANDER_WIDTH,height:"100%",ref:function(b){a.expander=b},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,"",a)}}]},BI.extend(b.popup,{ref:function(b){a.conditionsView=b},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})]}},getValue:function(){return{type:this.expander.getValue(),value:this.conditionsView.getValue(),id:this.options.id}},populate:function(){this.conditionsView.populate.apply(this.conditionsView,arguments)}});BI.shortcut("bi.filter_expander",a)}(),BI.Filter=BI.inherit(BI.Widget,{constants:{FIELD_TYPE_NUMBER:1,FIELD_TYPE_STRING:0,FIELD_TYPE_DATE:2},props:{baseCls:"bi-filter",expander:{},items:[],el:{},itemCreator:BI.empty},render:function(){var a=this,b=this.options;return BI.extend({type:"bi.filter_operation",expander:b.expander,listeners:[{eventName:"EVENT_OPERATION",action:function(b){switch(b){case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_CONDITION);break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_CONDITION,1);break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_FORMULA);break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_FORMULA,1)}}},{eventName:"BI.FilterOperation.EVENT_DESTROY_ITEM",action:function(b){a._removeCondition(b)}}],ref:function(b){a.filter=b}},b.el)},mounted:function(){this.tree=new BI.Tree,this.tree.initTree(this.options.items),this._populate(this.tree.toJSONWithNode())},_createEmptyNode:function(a){var b=new BI.Node(BI.UUID());return b.set("data",{value:a}),b},_insertAndOrCondition:function(a,b,c){var d=["AND","OR"];c||(c=0);var e=this.tree.search(a);if(BI.isNotNull(e)){var f=e.get("data"),g=e.getParent(),h=g.getChildIndex(e.id),i=g.get("data")||{},j=this._createEmptyNode(b);if(f.value===BI.Filter.FILTER_TYPE[d[c]])return void this.tree.addNode(e,j);if(f.value===BI.Filter.FILTER_TYPE[d[1-c]]&&i.value===BI.Filter.FILTER_TYPE[d[c]])return void g.addChild(j,h+1);if(f.value===BI.Filter.FILTER_TYPE[d[1-c]]&&i.value!==BI.Filter.FILTER_TYPE[d[c]]||i.value===BI.Filter.FILTER_TYPE[d[1-c]]||i.value!==BI.Filter.FILTER_TYPE.AND&&i.value!==BI.Filter.FILTER_TYPE.OR){var k=new BI.Node(BI.UUID());return k.set("data",{value:BI.Filter.FILTER_TYPE[d[c]],children:[e.get("data"),j.get("data")]}),g.removeChildByIndex(h),g.addChild(k,h),k.addChild(e),void k.addChild(j)}g.addChild(j,h+1)}},_removeCondition:function(a){var b=this.tree.search(a);if(BI.isNotNull(b)){var c=b.getParent();if(c.removeChild(a),c.getChildrenLength()<=1){var d=c.getParent();if(BI.isNotNull(d)){var e=d.getChildIndex(c.id);d.removeChildByIndex(e),1===c.getChildrenLength()&&d.addChild(c.getFirstChild(),e)}}this._populate(this.tree.toJSONWithNode()),this.fireEvent("EVENT_CHANGE")}},_addAndOrCondition:function(a,b){var c=["AND","OR"];b||(b=0);var d=this.filter.getCurrentSelectItem();if(BI.isNotNull(d)){var e=d.attr("id");this._insertAndOrCondition(e,a,b)}else{var f=this._createEmptyNode(a),g=this.tree.getRoot(),h=g.getLastChild();if(BI.isNotNull(h)){var i=h.get("data");if(i.value===BI.Filter.FILTER_TYPE[c[b]])this.tree.addNode(h,f);else{var j=new BI.Node(BI.UUID());j.set("data",{value:BI.Filter.FILTER_TYPE[c[b]],children:[h.get("data"),f.get("data")]}),g.removeChild(h.id),this.tree.addNode(j),this.tree.addNode(j,h),this.tree.addNode(j,f)}}else this.tree.addNode(f)}this._populate(this.tree.toJSONWithNode()),this.fireEvent("EVENT_CHANGE")},_populate:function(a){this.filter.defaultState();var b=this.options;b.items=a,BI.Tree.traversal(a,function(a,c){b.itemCreator(c)}),this.filter.populate.apply(this.filter,[a])},populate:function(a){this.tree.initTree(a),this._populate(this.tree.toJSONWithNode())},getValue:function(){return this.filter.getValue()}}),BI.shortcut("bi.filter",BI.Filter),BI.Filter.FILTER_TYPE={},BI.Filter.FILTER_TYPE.FORMULA=33,BI.Filter.FILTER_TYPE.AND=34,BI.Filter.FILTER_TYPE.OR=35,BI.Filter.FILTER_TYPE.EMPTY_FORMULA=36,BI.Filter.FILTER_TYPE.EMPTY_CONDITION=37,!function(){var a=BI.inherit(BI.ButtonTree,{props:{baseCls:"bi-button-map"},_createBtns:function(a){var b=this.options,c=BI.createWidgets(BI.createItems(a,{type:"bi.text_button",once:0===b.chooseType})),d=BI.map(a,function(a,b){if(b=BI.stripEL(b),!b.id&&!b.value)throw new Error("item must have 'id' or 'value' as its property");return b.id||b.value});return BI.zipObject(d,c)},setValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(a.contains(b)?c.setSelected&&c.setSelected(!0):c.setSelected&&c.setSelected(!1)):void c.setValue(a)})},setNotSelectedValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(a.contains(b)?c.setSelected&&c.setSelected(!1):c.setSelected&&c.setSelected(!0)):void c.setNotSelectedValue(a)})},populate:function(a){var b=this,c=[].slice.call(arguments),d=new BI.LinkHashMap,e=function(a){return a.id||a.value};this.buttons||(this.buttons={});var f=[];BI.each(a,function(a,d){if(d=BI.stripEL(d),b.buttons[e(d)]){var g=b.buttons[e(d)];c[0]=d.items,c[2]=d,g.populate&&g.populate.apply(g,c)}else f.push(d)}),c[0]=f;var g=this._btnsCreator.apply(this,c),h=[];BI.each(a,function(a,c){c=BI.stripEL(c);var f=b.buttons[e(c)]||g[e(c)];d.add(e(c),f),h.push(f)}),this.buttons=d.map,BI.DOM.hang(this.buttons),this.element.empty();var i=this._packageItems(a,this._packageBtns(h));BI.createWidget(BI.extend({element:this},this._packageLayout(i)))},getIndexByValue:function(){throw new Error("Can not use getIndexByValue")}});BI.shortcut("bi.filter_list",a)}(),!function(){var a=0,b=1,c=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(c.superclass._defaultConfig.apply(this,arguments),{constants:{FORMULA_COMBO:[{text:BI.i18nText("BI-Conf_Formula_And"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND},{text:BI.i18nText("BI-Conf_Formula_Or"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR}],CONDITION_COMBO:[{text:BI.i18nText("BI-Conf_Condition_And"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND},{text:BI.i18nText("BI-Conf_Condition_Or"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR}]}})},props:{baseCls:"bi-filter-operation",expander:{},items:[],selections:[BI.AbstractFilterItem.FILTER_OPERATION_CONDITION,BI.AbstractFilterItem.FILTER_OPERATION_FORMULA],itemsCreator:BI.emptyFn},render:function(){var c=this,d=this.options;return this.currentSelected=null,{type:"bi.vtape",items:[{el:{type:"bi.tab",showIndex:a,cardCreator:BI.bind(this._createTabs,this),ref:function(a){c.buttonComboTab=a}},height:40},{el:{type:"bi.absolute",scrollable:!0,items:[{el:{type:"bi.left",items:[{type:"bi.filter_pane",expander:d.expander,items:d.items,itemsCreator:d.itemsCreator,listeners:[{eventName:"EVENT_CHANGE",action:function(d,e,f){d===BI.Events.CLICK&&(BI.isNotNull(c.currentSelected)&&c.currentSelected===f?f.setSelectedCondition(!f.isSelectedCondition()):(BI.isNotNull(c.currentSelected)&&c.currentSelected.setSelectedCondition(!1),c.currentSelected=f,f.setSelectedCondition(!0)),c.currentSelected.isSelectedCondition()?c.buttonComboTab.setSelect(b):c.buttonComboTab.setSelect(a)),d===BI.Events.DESTROY&&(c.currentSelected===f&&(c.currentSelected=null,c.buttonComboTab.setSelect(a)),c.fireEvent("BI.FilterOperation.EVENT_DESTROY_ITEM",e,f))}}],ref:function(a){c.filter=a}}]},top:0,right:2,bottom:0,left:0}]}}]}},_createTabs:function(c){var d=this;switch(c){case a:return{type:"bi.button_group",items:BI.createItems(d._createButtons(),{type:"bi.icon_text_item",height:30,width:100}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,layouts:[{type:"bi.left",vgap:5}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(a,b){BI.isEmptyArray(d.filter.getValue())&&d.filter.element.addClass("bi-border-top bi-border-left"),d.fireEvent("EVENT_OPERATION",b.getValue()),d.defaultState()}}]};case b:return{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,items:d._buildOperationButton(),layouts:[{type:"bi.left",vgap:5}]}}},_createButtons:function(){var a=[];return BI.each(this.options.selections,function(b,c){switch(c){case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:a.push({text:BI.i18nText("BI-Conf_Add_Formula"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA,cls:"operation-trigger filter-formula-font"});break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:a.push({text:BI.i18nText("BI-Conf_Add_Condition"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION,cls:"operation-trigger filter-condition-font"})}}),a},_buildOperationButton:function(){var a=this,b=[];return BI.each(this.options.selections,function(c,d){var e="",f="",g=[];switch(d){case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:e=BI.i18nText("BI-Conf_Add_Formula"),f="filter-formula-font",g=a.options.constants.FORMULA_COMBO;break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:default:e=BI.i18nText("BI-Conf_Add_Condition"),f="filter-condition-font",g=a.options.constants.CONDITION_COMBO}var h=BI.createWidget({type:"bi.icon_text_icon_item",iconCls1:"operation-trigger "+f,iconCls2:"pull-down-font",text:e,height:30,width:100});b.push({type:"bi.combo",el:h,popup:{el:{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_NONE,items:BI.createItems(g,{type:"bi.single_select_item",height:25}),layouts:[{type:"bi.vertical"}]}},listeners:[{eventName:BI.Combo.EVENT_CHANGE,action:function(b,c){switch(BI.isEmptyArray(a.filter.getValue())&&a.filter.element.addClass("bi-border-top bi-border-left"),b){case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND:case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR:h.setText(BI.i18nText("BI-Conf_Add_Condition"));break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND:case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR:h.setText(BI.i18nText("BI-Conf_Add_Formula"));break;default:h.setText()}a.fireEvent("EVENT_OPERATION",c.getValue()),a.defaultState(),this.hideView()}}]})}),b},defaultState:function(){BI.isNotNull(this.currentSelected)&&this.currentSelected.setSelectedCondition(!1),this.buttonComboTab.setSelect(a)},getCurrentSelectItem:function(){if(BI.isNotNull(this.currentSelected)&&this.currentSelected.isSelectedCondition())return this.currentSelected},populate:function(a){this.filter.populate.apply(this.filter,arguments)},getValue:function(){return this.filter.getValue()}});BI.shortcut("bi.filter_operation",c)}(),!function(){var a=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-pane",expander:{},items:[],itemsCreator:BI.emptyFn},render:function(){var a=this,b=this.options;return{type:"bi.custom_tree",cls:BI.isNotEmptyArray(b.items)?"bi-border-top bi-border-left":"",expander:BI.extend({type:"bi.filter_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:{type:"bi.filter_list",chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,layouts:[{type:"bi.vertical",scrolly:!1}]},items:b.items,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent("EVENT_CHANGE",arguments)}}],ref:function(b){a.tree=b}}},populate:function(a){BI.isNotEmptyArray(a)?this.element.addClass("bi-border-top bi-border-left"):this.element.removeClass("bi-border-top bi-border-left"),this.tree.populate.apply(this.tree,arguments)},getValue:function(){return this.tree.getValue()}});BI.shortcut("bi.filter_pane",a)}(),BI.IntervalSlider=BI.inherit(BI.Widget,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var a=this,b=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,errorText:"",allowBlank:!1,width:b.EDITOR_WIDTH,validationChecker:function(b){return a._checkValidation(b)}}),this.labelOne.element.hover(function(){a.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){a.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var b=BI.parseFloat(this.getValue());a.valueOne=b;var c=a._getPercentByValue(b),d=BI.parseFloat(c.toFixed(1));a._setLabelOnePosition(d),a._setSliderOnePosition(d),a._setBlueTrack(),a.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",errorText:"",text:this.options.unit,allowBlank:!1,width:b.EDITOR_WIDTH,validationChecker:function(b){return a._checkValidation(b)}}),this.labelTwo.element.hover(function(){a.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){a.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var b=BI.parseFloat(this.getValue());a.valueTwo=b;var c=a._getPercentByValue(b),d=BI.parseFloat(c.toFixed(1));a._setLabelTwoPosition(d),a._setSliderTwoPosition(d),a._setBlueTrack(),a.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:b.TRACK_HEIGHT}]}],hgap:7,height:b.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(a,b){var c=this.options,d=100*a/this._getGrayTrackLength(),e=BI.parseFloat(d.toFixed(1)),f=this._getValueByPercent(e);f=this._assertValue(f),f=c.digit===!1?f:f.toFixed(c.digit),b?(this._setLabelOnePosition(e),this._setSliderOnePosition(e),this.labelOne.setValue(f),this.valueOne=f):(this._setLabelTwoPosition(e),this._setSliderTwoPosition(e),this.labelTwo.setValue(f),this.valueTwo=f),this._setBlueTrack()},_rePosBySizeAfterStop:function(a,b){var c=100*a/this._getGrayTrackLength(),d=BI.parseFloat(c.toFixed(1));b?this._setSliderOnePosition(d):this._setSliderTwoPosition(d)},_draggable:function(a,b){function c(a){return BI.clamp(a,0,d._getGrayTrackLength())}var d=this,e=(this.options,!1),f=0,g=0,h=0,i=new BI.MouseMoveTracker(function(j){i.isDragging()&&(e=!0,g+=j,f=c(h+g),a.element.addClass("dragging"),d._rePosBySizeAfterMove(f,b))},function(){e===!0&&(f=c(f),d._rePosBySizeAfterStop(f,b),f=0,g=0,h=f,e=!1),a.element.removeClass("dragging"),i.releaseMouseMoves(),d.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);a.element.on("mousedown",function(b){a.isEnabled()&&(h=this.offsetLeft,c(h),i.captureMouseMoves(b))})},_createLabelWrapper:function(){var a=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:a.EDITOR_R_GAP,height:70},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var a=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%" }]}],hgap:a.SLIDER_WIDTH_HALF,height:a.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(a){var b=this.options,c=!1,d=(a+"").split(".")[1];return BI.isEmptyString(d)||BI.isNumeric(a)&&!(BI.isNull(a)||athis.max)&&(b.digit===!1?c=!0:(d=d||"",c=d.length===b.digit)),c},_checkOverlap:function(){var a=this.labelOne.element[0].offsetLeft,b=this.labelTwo.element[0].offsetLeft;a<=b?b-a<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):a-b<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_setLabelOnePosition:function(a){this.labelOne.element.css({left:a+"%"}),this._checkOverlap()},_setLabelTwoPosition:function(a){this.labelTwo.element.css({left:a+"%"}),this._checkOverlap()},_setSliderOnePosition:function(a){this.sliderOne.element.css({left:a+"%"})},_setSliderTwoPosition:function(a){this.sliderTwo.element.css({left:a+"%"})},_setBlueTrackLeft:function(a){this.blueTrack.element.css({left:a+"%"})},_setBlueTrackWidth:function(a){this.blueTrack.element.css({width:a+"%"})},_setBlueTrack:function(){var a=this._getPercentByValue(this.labelOne.getValue()),b=this._getPercentByValue(this.labelTwo.getValue());a<=b?(this._setBlueTrackLeft(a),this._setBlueTrackWidth(b-a)):(this._setBlueTrackLeft(b),this._setBlueTrackWidth(a-b))},_setAllPosition:function(a,b){this._setSliderOnePosition(a),this._setLabelOnePosition(a),this._setSliderTwoPosition(b),this._setLabelTwoPosition(b),this._setBlueTrack()},_setVisible:function(a){this.sliderOne.setVisible(a),this.sliderTwo.setVisible(a),this.labelOne.setVisible(a),this.labelTwo.setVisible(a)},_setErrorText:function(){var a=BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max);this.labelOne.setErrorText(a),this.labelTwo.setErrorText(a)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(a){var b=this.calculation.accurateSubtraction(this.max,this.min),c=this.calculation.accurateMultiplication(b,a),d=this.calculation.accurateDivisionTenExponent(c,2);if(this.precision<0){var e=BI.parseFloat(this.calculation.accurateAddition(d,this.min)),f=Math.round(this.calculation.accurateDivisionTenExponent(e,-this.precision));return this.calculation.accurateMultiplication(f,Math.pow(10,-this.precision))}return BI.parseFloat(this.calculation.accurateAddition(d,this.min).toFixed(this.precision))},_getPercentByValue:function(a){return 100*(a-this.min)/(this.max-this.min)},_setDraggableEnable:function(a){this.sliderOne.setEnable(a),this.sliderTwo.setEnable(a)},_getPrecision:function(){var a=this.calculation.accurateSubtraction(this.max,this.min),b=a.toPrecision(4),c=b.indexOf("e"),d=[];if(c>-1){d=b.split("e");var e=BI.size(d[0].split(".")[1]),f=BI.parseInt(d[1].substring(1));return e-f}return d=b.split("."),d.length>1?d[1].length:0},_assertValue:function(a){return a<=this.min?this.min:a>=this.max?this.max:a},_setEnable:function(a){BI.IntervalSlider.superclass._setEnable.apply(this,[a]),this.blueTrack&&this.blueTrack.setVisible(!!a)},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(a){var b=BI.parseFloat(a.min),c=BI.parseFloat(a.max);!isNaN(b)&&!isNaN(c)&&c>=b&&(this.min=b,this.max=c,this.valueOne=b,this.valueTwo=c,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),c===b&&this._setDraggableEnable(!1)},setValue:function(a){var b=this.options,c=BI.parseFloat(a.min),d=BI.parseFloat(a.max);c=b.digit===!1?c:c.toFixed(b.digit),d=b.digit===!1?d:d.toFixed(b.digit),isNaN(c)||isNaN(d)||(this._checkValidation(c)&&(this.valueOne=c),this._checkValidation(d)&&(this.valueTwo=d),cthis.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(this.valueOne),this.labelTwo.setValue(this.valueTwo),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider),BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(a){for(var b="1",c=0;c0)var d=b;else{var d=a;c=0-c}for(var e=0;e=b.numDecimal.length?a.numDecimal.length:b.numDecimal.length}function d(a,b){for(var c=b-a.length,d=0;d=BI.parseInt(f.numDecimal))var i=(BI.parseInt(e.numDecimal)-BI.parseInt(f.numDecimal)).toString(),j=d(i,h);else{g--;var k=this._getMagnitude(h),i=(k+BI.parseInt(e.numDecimal)-BI.parseInt(f.numDecimal)).toString(),j=d(i,h)}var l=g+"."+j;return BI.parseFloat(l)},_accurateAddition:function(a,b){function c(a,b){for(var c=b-a.length,d=0;db)var e=d.numInteger.slice(0,d.numInteger.length-b),f=d.numInteger.slice(-b);else var e="0",f=c(d.numInteger,b);var g=e+"."+f+d.numDecimal;return BI.parseFloat(g)},accurateSubtraction:function(a,b){return a>=0&&b>=0?a>=b?this._accurateSubtraction(a,b):-this._accurateSubtraction(b,a):a>=0&&b<0?this._accurateAddition(a,-b):a<0&&b>=0?-this._accurateAddition(-a,b):a<0&&b<0?a>=b?this._accurateSubtraction(-b,-a):this._accurateSubtraction(-a,-b):void 0},accurateAddition:function(a,b){return a>=0&&b>=0?this._accurateAddition(a,b):a>=0&&b<0?this.accurateSubtraction(a,-b):a<0&&b>=0?this.accurateSubtraction(b,-a):a<0&&b<0?-this._accurateAddition(-a,-b):void 0},accurateMultiplication:function(a,b){return a>=0&&b>=0?this._accurateMultiplication(a,b):a>=0&&b<0?-this._accurateMultiplication(a,-b):a<0&&b>=0?-this._accurateMultiplication(-a,b):a<0&&b<0?this._accurateMultiplication(-a,-b):void 0},accurateDivisionTenExponent:function(a,b){return a>=0?this._accurateDivisionTenExponent(a,b):-this._accurateDivisionTenExponent(-a,b)}}),BI.MonthCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",behaviors:{},height:25})},_init:function(){BI.MonthCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.month_trigger",value:b.value}),this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM,function(b){a.combo.isViewVisible()||(this.getKey()&&this.getKey()!==a.storeValue?a.setValue(this.getValue()):this.getKey()||a.setValue(),a.fireEvent(BI.MonthCombo.EVENT_CONFIRM))}),this.trigger.on(BI.MonthTrigger.EVENT_FOCUS,function(){a.storeValue=this.getKey()}),this.trigger.on(BI.MonthTrigger.EVENT_START,function(){a.combo.hideView()}),this.trigger.on(BI.MonthTrigger.EVENT_STOP,function(){a.combo.isViewVisible()||a.combo.showView()}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:b.behaviors,value:b.value}),this.popup.on(BI.MonthPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MonthCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,el:this.popup}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW)})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return BI.isNull(this.popup)?this.options.value||"":this.popup.getValue()||""}}),BI.MonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.month_combo",BI.MonthCombo),BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var a=this,b=this.options,c=[1,7,2,8,3,9,4,10,5,11,6,12],d=[];d.push(c.slice(0,2)),d.push(c.slice(2,4)),d.push(c.slice(4,6)),d.push(c.slice(6,8)),d.push(c.slice(8,10)),d.push(c.slice(10,12)),d=BI.map(d,function(a,b){return BI.map(b,function(a,b){return{type:"bi.text_item",cls:"bi-list-item-active",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:b,text:b}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:b.behaviors,items:BI.createItems(d,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:b.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(b){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(a){a=BI.parseInt(a),this.month.setValue([a])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup),BI.MonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.MonthTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-month-trigger bi-border",height:24})},_init:function(){BI.MonthTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(a){return""===a||BI.isPositiveInteger(a)&&a>=1&&a<=12},quitChecker:function(a){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,errorText:BI.i18nText("BI-Month_Trigger_Error_Text")}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.MonthTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.MonthTrigger.EVENT_CHANGE)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();BI.isNotNull(b)&&(a.editor.setValue(b),a.editor.setTitle(b)),a.fireEvent(BI.MonthTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){a.editor.isValid()&&a.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.MonthTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.MonthTrigger.EVENT_STOP)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),baseCls:"bi-trigger-month-text",width:b.height},width:b.height},{el:{type:"bi.trigger_icon_button",width:b.height},width:b.height}]}),this.setValue(b.value)},setValue:function(a){return BI.isNotNull(a)?(this.editor.setState(a+1),this.editor.setValue(a+1),void this.editor.setTitle(a+1)):(this.editor.setState(""),this.editor.setValue(""),void this.editor.setTitle(""))},getKey:function(){return 0|this.editor.getValue()},getValue:function(){return this.editor.getValue()-1}}),BI.MonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.MonthTrigger.EVENT_START="EVENT_START",BI.MonthTrigger.EVENT_STOP="EVENT_STOP",BI.MonthTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_trigger",BI.MonthTrigger),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo),BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var a=this,b=this.options,c=this._createPopupItems(b.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])){d=a.childValueMap[b];var e=a.fatherValueMap[b],f=(e+"").split("_");a.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,d,f.length>1?f:e)}else a.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,d,c);if(!a.singleValues.contains(d)){var g=a.getValue(),h=[];BI.each(g,function(a,b){b.value!=d&&h.push(b)}),a.setValue(h)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createPopupItems:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}},c.el.childValues=[],BI.each(c.children,function(a,d){d=d.el?BI.extend(d.el,{children:d.children}):d;var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value),BI.isNotEmptyArray(d.children)&&(d.type="bi.down_list_group_item",b._createChildren(d),d.height=b.constants.height,d.iconCls2=b.constants.nextIcon,c.el.childValues=BI.concat(c.el.childValues,d.childValues))})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_createChildren:function(a){var b=this;a.childValues=[],BI.each(a.children,function(c,d){var e=BI.deepClone(a.value),f=BI.deepClone(d.value);d.type="bi.down_list_item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),a.childValues.push(d.value)})},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a1?g:f}else e.value=d;b.push(e)}),b}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup),BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer_select_tree-combo",isDefaultInit:!1,height:30,text:"",items:[],value:""})},_init:function(){BI.MultiLayerSelectTreeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:b.text,height:b.height,items:b.items,value:b.value}),this.popup=BI.createWidget({type:"bi.multilayer_select_tree_popup",isDefaultInit:b.isDefaultInit,items:b.items,value:b.value}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.MultiLayerSelectTreePopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)})},setValue:function(a){a=BI.isArray(a)?a:[a],this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.combo.populate(a)}}),BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo),BI.MultiLayerSelectLevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,value:""})},_init:function(){BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={};if(e.layer=b,BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.multilayer_select_tree_first_plus_group_node";break;case a.length-1:f.type="bi.multilayer_select_tree_last_plus_group_node";break;default:f.type="bi.multilayer_select_tree_mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.multilayer_single_tree_last_tree_leaf_item";break;default:f.type="bi.multilayer_single_tree_mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){b.id=b.id||BI.UUID()})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-inline",expander:{type:"bi.select_tree_expander",isDefaultInit:c.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),itemsCreator:c.itemsCreator,value:c.value,el:{type:"bi.button_tree",chooseType:BI.Selection.Single,layouts:[{type:"bi.vertical"}]}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:!0,items:[this.tree]})},populate:function(a){this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(a),0))},setValue:function(a){this.tree.setValue(a)},getValue:function(){return BI.uniq(this.tree.getValue())},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree),BI.MultiLayerSelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:b.isDefaultInit,items:b.items,value:b.value,itemsCreator:b.itemsCreator}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){a.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(a){a=BI.isArray(a)?a:[a],this.tree.setValue(a)},populate:function(a){BI.MultiLayerSelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(a)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:b.id,pId:b.pId,open:b.open,height:b.height,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",cls:"base-line-conn-background",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.MultiLayerSelectTreeFirstPlusGroupNode.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.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode),BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:b.id,pId:b.pId,open:b.open,height:b.height,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",cls:"base-line-conn-background",width:13,height:b.height})}),c.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(b.layer,13),items:[c]})},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.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(a)},doClick:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(a){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_select_tree_last_plus_group_node",BI.MultiLayerSelectTreeLastPlusGroupNode),BI.MultiLayerSelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_mid_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:b.id,pId:b.pId,open:b.open,height:b.height,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",cls:"base-line-conn-background",width:13,height:b.height})}),c.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(b.layer,13),items:[c]})},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.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(a)},doClick:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(a){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node",BI.MultiLayerSelectTreeMidPlusGroupNode),BI.MultiLayerSingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-singletree-combo",isDefaultInit:!1,height:30,text:"",itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSingleTreeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:b.text,height:b.height,items:b.items,value:b.value}),this.popup=BI.createWidget({type:"bi.multilayer_single_tree_popup",isDefaultInit:b.isDefaultInit,itemsCreator:b.itemsCreator,items:b.items,value:b.value}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.MultiLayerSingleTreePopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)})},setValue:function(a){a=BI.isArray(a)?a:[a],this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue(); diff --git a/dist/bundle.js b/dist/bundle.js index 310328207..09dcab563 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -78407,7 +78407,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { items: o.items, height: o.height, text: o.text, - defaultIconCls: o.defaultIconCls, + iconCls: o.iconCls, value: o.value, iconHeight: o.iconHeight, iconWidth: o.iconWidth @@ -87332,7 +87332,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { height: 24, iconHeight: null, iconWidth: null, - defaultIconCls: "" + iconCls: "" }); }, @@ -87375,7 +87375,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { } else { return { text: o.text, - iconCls: o.defaultIconCls + iconCls: o.iconCls }; } }, @@ -90402,11 +90402,11 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** } if (BI.isNotNull(obj.workDay)) { // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 - if(BI.isNotNull(Date.holidays)) { + if(BI.isNotNull(BI.holidays)) { var count = Math.abs(obj.workDay); for (var i = 0; i < count; i++) { date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); - if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + if(BI.isNotNull(BI.holidays[date.print("%Y-%X-%d")])) { i--; } } diff --git a/dist/bundle.min.js b/dist/bundle.min.js index cfecae711..5913d54a6 100644 --- a/dist/bundle.min.js +++ b/dist/bundle.min.js @@ -32,13 +32,13 @@ for(c=0,d=b.length;c0?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",iconCls:"",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.iconCls,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.iconCls!==a&&(this.element.removeClass(b.iconCls).addClass(a),b.iconCls=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",iconCls:"",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.iconCls,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",logic:{dynamic:!1},hgap:10,height:25})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var a=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:a.height,height:a.height,hgap:a.hgap,text:a.text,keyword:a.keyword,value:a.value,py:a.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},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_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())},setText:function(a){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(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,keyword:b.keyword}),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.arrow_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,keyword:b.keyword}),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,keyword:b.keyword}),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.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var a=this;return{type:"bi.absolute",ref:function(){a.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(a){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=a?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch),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,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,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,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,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,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,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:8,day:25})},_dateCreator:function(a,b,c){var d=this.options,e={},f=BI.getDate(),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]=BI.isLeapYear(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:BI.getDate().getFullYear()+d,month:e+1}}}),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={};BI.checkDateVoid(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=BI.getDate().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,!!BI.checkDateVoid(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,!!BI.checkDateVoid(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=BI.getDate().getFullYear();return a-((a-b+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(a){return BI.YearCalendar.getStartYear(a)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(a){var b=BI.getDate().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-group-node-checkbox"})},_init:function(){BI.ArrowTreeGroupNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),a?this.element.removeClass("pull-right-font").addClass("pull-down-font"):this.element.removeClass("pull-down-font").addClass("pull-right-font")}}),BI.shortcut("bi.arrow_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"})},_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.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');if("cut"===this.action&&(a.hasAttribute("readonly")||a.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=a}},get:function(){return this._target}}]),a}();a.exports=h})},{select:5}],8:[function(b,c,d){!function(e,f){if("function"==typeof a&&a.amd)a(["module","./clipboard-action","tiny-emitter","good-listener"],f);else if("undefined"!=typeof d)f(c,b("./clipboard-action"),b("tiny-emitter"),b("good-listener"));else{var g={exports:{}};f(g,e.clipboardAction,e.tinyEmitter,e.goodListener),e.clipboard=g.exports}}(this,function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function i(a,b){var c="data-clipboard-"+a;if(b.hasAttribute(c))return b.getAttribute(c)}var j=e(b),k=e(c),l=e(d),m=function(){function a(a,b){for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof a.action?a.action:this.defaultAction,this.target="function"==typeof a.target?a.target:this.defaultTarget,this.text="function"==typeof a.text?a.text:this.defaultText}},{key:"listenClick",value:function(a){var b=this;this.listener=(0,l["default"])(a,"click",function(a){return b.onClick(a)})}},{key:"onClick",value:function(a){var b=a.delegateTarget||a.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new j["default"]({action:this.action(b),target:this.target(b),text:this.text(b),trigger:b,emitter:this})}},{key:"defaultAction",value:function(a){return i("action",a)}},{key:"defaultTarget",value:function(a){var b=i("target",a);if(b)return document.querySelector(b)}},{key:"defaultText",value:function(a){return i("text",a)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],b="string"==typeof a?[a]:a,c=!!document.queryCommandSupported;return b.forEach(function(a){c=c&&!!document.queryCommandSupported(a)}),c}}]),b}(k["default"]);a.exports=n})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)})}catch(e){!function(a){a.fn.zclip=function(b){if("object"==typeof b&&!b.length){var c=a.extend({path:"ZeroClipboard.swf",copy:null,beforeCopy:null,afterCopy:null,clickAfter:!0,setHandCursor:!0,setCSSEffects:!0},b);return this.each(function(){var b=a(this);if(b.is(":visible")&&("string"==typeof c.copy||a.isFunction(c.copy))){ZeroClipboard.setMoviePath(c.path);var d=new ZeroClipboard.Client;a.isFunction(c.copy)&&b.bind("zClip_copy",c.copy),a.isFunction(c.beforeCopy)&&b.bind("zClip_beforeCopy",c.beforeCopy),a.isFunction(c.afterCopy)&&b.bind("zClip_afterCopy",c.afterCopy),d.setHandCursor(c.setHandCursor),d.setCSSEffects(c.setCSSEffects),d.addEventListener("mouseOver",function(a){b.trigger("mouseenter")}),d.addEventListener("mouseOut",function(a){b.trigger("mouseleave")}),d.addEventListener("mouseDown",function(e){b.trigger("mousedown"),a.isFunction(c.copy)?d.setText(b.triggerHandler("zClip_copy")):d.setText(c.copy),a.isFunction(c.beforeCopy)&&b.trigger("zClip_beforeCopy")}),d.addEventListener("complete",function(d,e){a.isFunction(c.afterCopy)?b.trigger("zClip_afterCopy"):(e.length>500&&(e=e.substr(0,500)+"...\n\n("+(e.length-500)+" characters not shown)"),b.removeClass("hover"),alert("Copied text to clipboard:\n\n "+e)),c.clickAfter&&b.trigger("click")}),d.glue(b[0],b.parent()[0]),a(window).bind("load resize",function(){d.reposition()})}})}if("string"==typeof b)return this.each(function(){var c=a(this);b=b.toLowerCase();var d=c.data("zclipId"),e=a("#"+d+".zclip");"remove"==b?(e.remove(),c.removeClass("active hover")):"hide"==b?(e.hide(),c.removeClass("active hover")):"show"==b&&e.show()})}}(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){return"string"==typeof a&&(a=document.getElementById(a)),a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a),this.className+=" "+a},a.removeClass=function(a){for(var b=this.className.split(/\s+/),c=-1,d=0;d-1&&(b.splice(c,1),this.className=b.join(" ")),this},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){var d=this.clients[a];d&&d.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a,b){var c={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};return a&&a!=b&&(c.left+=a.offsetLeft,c.top+=a.offsetTop),c},Client:function(a){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),a&&this.glue(a)}};ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,glue:function(a,b,c){this.domElement=ZeroClipboard.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex,10)+1),"string"==typeof b?b=ZeroClipboard.$(b):"undefined"==typeof b&&(b=document.getElementsByTagName("body")[0]);var e=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div"),this.div.className="zclip",this.div.id="zclip-"+this.movieId,$(this.domElement).data("zclipId","zclip-"+this.movieId);var f=this.div.style;if(f.position="absolute",f.left=""+e.left+"px",f.top=""+e.top+"px",f.width=""+e.width+"px",f.height=""+e.height+"px",f.zIndex=d,"object"==typeof c)for(addedStyle in c)f[addedStyle]=c[addedStyle];b.appendChild(this.div),this.div.innerHTML=this.getHTML(e.width,e.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+=''}else c+='';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null,this.div=null}},reposition:function(a){if(a&&(this.domElement=ZeroClipboard.$(a),this.domElement||this.hide()),this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.top+"px"}},setText:function(a){this.clipText=a,this.ready&&this.movie.setText(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=[]),this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a,this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){switch(a=a.toString().toLowerCase().replace(/^on/,"")){case"load":if(this.movie=document.getElementById(this.movieId),!this.movie){var c=this;return void setTimeout(function(){c.receiveEvent("load",null)},1)}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;return setTimeout(function(){c.receiveEvent("load",null)},100),void(this.ready=!0)}this.ready=!0;try{this.movie.setText(this.clipText)}catch(d){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(d){}break;case"mouseover":this.domElement&&this.cssEffects&&(this.domElement.addClass("hover"),this.recoverActive&&this.domElement.addClass("active"));break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0),this.domElement.removeClass("hover"));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var e=0,f=this.handlers[a].length;e=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!1,value:255,width:32,height:20});BI.each(d,function(b,d){d.on(BI.TextEditor.EVENT_CHANGE,function(){a._checkEditors(),c(a.storeValue.r)&&c(a.storeValue.g)&&c(a.storeValue.b)&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("")):a.setValue(a.lastColor||"#ffffff"),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("transparent")):("transparent"===a.lastColor&&(a.lastColor=""),a.setValue(a.lastColor||"#ffffff")),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,width:"fill"},{el:b[0],lgap:10,width:16},{el:this.R,width:32},{el:b[1],lgap:10,width:16},{el:this.G,width:32},{el:b[2],lgap:10,width:16},{el:this.B,width:32},{el:{type:"bi.center_adapt",items:[this.none]},width:18},{el:{type:"bi.center_adapt",items:[this.transparent]},width:18}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(a){""===a?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===a?this.colorShow.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":a}).removeClass("auto-color-background").removeClass("trans-color-background")},setValue:function(a){if("transparent"===a)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});a?this.none.setSelected(!1):(a="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(a);var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.storeValue={r:BI.isNull(b.r)?"":b.r,g:BI.isNull(b.r)?"":b.g,b:BI.isNull(b.r)?"":b.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="ColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:20})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var a=this;this.options;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card",height:20});var b=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:10,height:20})),c=function(a){return BI.isNumeric(a)&&(0|a)>=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:32,height:20});BI.each(d,function(b,c){c.on(BI.TextEditor.EVENT_CHANGE,function(){a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,lgap:5,rgap:5},{el:b[0],lgap:10,width:16},{el:this.R,width:36},{el:b[1],lgap:10,width:16},{el:this.G,width:36},{el:b[2],lgap:10,width:16},{el:this.B,width:36,rgap:10}]})},setValue:function(a){this.colorShow.element.css({"background-color":a});var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.R.setValue(BI.isNull(b.r)?"":b.r),this.G.setValue(BI.isNull(b.g)?"":b.g),this.B.setValue(BI.isNull(b.b)?"":b.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="SimpleColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-farbtastic",width:195,height:195})},_init:function(){BI.Farbtastic.superclass._init.apply(this,arguments)},mounted:function(){var a=this;this.farbtastic=$.farbtastic(this.element,function(b){a.fireEvent(BI.Farbtastic.EVENT_CHANGE,a.getValue(),a)})},setValue:function(a){this.farbtastic.setColor(a)},getValue:function(){return this.farbtastic.color}}),BI.Farbtastic.EVENT_CHANGE="Farbtastic.EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),jQuery.fn.farbtastic=function(a){return $.farbtastic(this,a),this},jQuery.farbtastic=function(a,b){var a=$(a).get(0);return a.farbtastic||(a.farbtastic=new jQuery._farbtastic(a,b))},jQuery._farbtastic=function(a,b){var c=this;$(a).html('
    ');var d=$(".farbtastic",a);c.wheel=$(".wheel",a).get(0),c.radius=84,c.square=100,c.width=194,navigator.appVersion.match(/MSIE [0-6]\./)&&$("*",d).each(function(){if("none"!=this.currentStyle.backgroundImage){var a=this.currentStyle.backgroundImage;a=this.currentStyle.backgroundImage.substring(5,a.length-2),$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+a+"')"})}}),c.linkTo=function(a){return"object"==typeof c.callback&&$(c.callback).unbind("keyup",c.updateValue),c.color=null,"function"==typeof a?c.callback=a:"object"!=typeof a&&"string"!=typeof a||(c.callback=$(a),c.callback.bind("keyup",c.updateValue),c.callback.get(0).value&&c.setColor(c.callback.get(0).value)),this},c.updateValue=function(a){this.value&&this.value!=c.color&&c.setColor(this.value)},c.setColor=function(a){var b=c.unpack(a);return c.color!=a&&b&&(c.color=a,c.rgb=b,c.hsl=c.RGBToHSL(c.rgb),c.updateDisplay()),this},c.setHSL=function(a){return c.hsl=a,c.rgb=c.HSLToRGB(a),c.color=c.pack(c.rgb),c.updateDisplay(),this},c.widgetCoords=function(a){var b,d,e=a.target||a.srcElement,f=c.wheel;if("undefined"!=typeof a.offsetX){for(var g={x:a.offsetX,y:a.offsetY},h=e;h;)h.mouseX=g.x,h.mouseY=g.y,g.x+=h.offsetLeft,g.y+=h.offsetTop,h=h.offsetParent;for(var h=f,i={x:0,y:0};h;){if("undefined"!=typeof h.mouseX){b=h.mouseX-i.x,d=h.mouseY-i.y;break}i.x+=h.offsetLeft,i.y+=h.offsetTop,h=h.offsetParent}for(h=e;h;)h.mouseX=void 0,h.mouseY=void 0,h=h.offsetParent}else{var g=c.absolutePosition(f);b=(a.pageX||0*(a.clientX+$("html").get(0).scrollLeft))-g.x,d=(a.pageY||0*(a.clientY+$("html").get(0).scrollTop))-g.y}return{x:b-c.width/2,y:d-c.width/2}},c.click=function(a){var b=c.widgetCoords(a);return c.circleDrag=2*Math.max(Math.abs(b.x),Math.abs(b.y))>c.square,c.mousemove(a),!1},c.mousemove=function(a){var b=c.widgetCoords(a);if(c.circleDrag){var d=Math.atan2(b.x,-b.y)/6.28;d<0&&(d+=1),c.setHSL([d,c.hsl[1],c.hsl[2]])}else{var e=Math.max(0,Math.min(1,-(b.x/c.square)+.5)),f=Math.max(0,Math.min(1,-(b.y/c.square)+.5));c.setHSL([c.hsl[0],e,f])}return!1},c.updateDisplay=function(){var a=6.28*c.hsl[0];$(".h-marker",d).css({left:Math.round(Math.sin(a)*c.radius+c.width/2)+"px",top:Math.round(-Math.cos(a)*c.radius+c.width/2)+"px"}),$(".sl-marker",d).css({left:Math.round(c.square*(.5-c.hsl[1])+c.width/2)+"px",top:Math.round(c.square*(.5-c.hsl[2])+c.width/2)+"px"}),$(".color",d).css("backgroundColor",c.pack(c.HSLToRGB([c.hsl[0],1,.5]))),"object"==typeof c.callback?($(c.callback).css({backgroundColor:c.color,color:c.hsl[2]>.5?"#000":"#fff"}),$(c.callback).each(function(){this.value&&this.value!=c.color&&(this.value=c.color)})):"function"==typeof c.callback&&c.callback.call(c,c.color)},c.absolutePosition=function(a){var b={x:a.offsetLeft,y:a.offsetTop};if(a.offsetParent){var d=c.absolutePosition(a.offsetParent);b.x+=d.x,b.y+=d.y}return b},c.pack=function(a){var b=Math.round(255*a[0]),c=Math.round(255*a[1]),d=Math.round(255*a[2]);return"#"+(b<16?"0":"")+b.toString(16)+(c<16?"0":"")+c.toString(16)+(d<16?"0":"")+d.toString(16)},c.unpack=function(a){return 7==a.length?[parseInt("0x"+a.substring(1,3))/255,parseInt("0x"+a.substring(3,5))/255,parseInt("0x"+a.substring(5,7))/255]:4==a.length?[parseInt("0x"+a.substring(1,2))/15,parseInt("0x"+a.substring(2,3))/15,parseInt("0x"+a.substring(3,4))/15]:void 0},c.HSLToRGB=function(a){var b,c,d=a[0],e=a[1],f=a[2];return c=f<=.5?f*(e+1):f+e-f*e,b=2*f-c,[this.hueToRGB(b,c,d+.33333),this.hueToRGB(b,c,d),this.hueToRGB(b,c,d-.33333)]},c.hueToRGB=function(a,b,c){return c=c<0?c+1:c>1?c-1:c,6*c<1?a+(b-a)*c*6:2*c<1?b:3*c<2?a+(b-a)*(.66666-c)*6:a},c.RGBToHSL=function(a){var b,c,d,e,f,g,h=a[0],i=a[1],j=a[2];return b=Math.min(h,Math.min(i,j)),c=Math.max(h,Math.max(i,j)),d=c-b,g=(b+c)/2,f=0,g>0&&g<1&&(f=d/(g<.5?2*g:2-2*g)),e=0,d>0&&(c==h&&c!=i&&(e+=(i-j)/d),c==i&&c!=j&&(e+=2+(j-h)/d),c==j&&c!=h&&(e+=4+(h-i)/d),e/=6),[e,f,g]},$("*",d).click(c.click),c.setColor("#000000"),b&&c.linkTo(b)},BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:b.trigger,toggle:b.toggle,direction:b.direction,isDefaultInit:b.isDefaultInit,destroyWhenHide:b.destroyWhenHide,isNeedAdjustHeight:b.isNeedAdjustHeight,isNeedAdjustWidth:b.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:b.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:b.hideChecker,offsetStyle:b.offsetStyle,el:b.el,popup:BI.extend({type:"bi.bubble_popup_view"},b.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){a.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){a.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){a._showTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){a._hideTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(a){var b={},c={},d=this.options.adjustLength,e=this.element.offset(),f=e.left,g=e.left+this.element.outerWidth(),h=e.top,i=e.top+this.element.outerHeight();switch(a){case"left":b={top:h,height:this.element.outerHeight(),left:f-d-this._const.TRIANGLE_LENGTH},c={width:this._const.TRIANGLE_LENGTH};break;case"right":b={top:h,height:this.element.outerHeight(),left:g+d},c={width:this._const.TRIANGLE_LENGTH};break;case"top":b={left:f,width:this.element.outerWidth(),top:h-d-this._const.TRIANGLE_LENGTH},c={height:this._const.TRIANGLE_LENGTH};break;case"bottom":b={left:f,width:this.element.outerWidth(),top:i+d},c={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(c,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+a+" bi-high-light-border"}]}),b.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var a=this.combo.getPopupPosition();switch(a.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:a.baseCls+" bi-bubble-popup-view"})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)},showLine:function(a){var b={},c={};switch(a){case"left":b={top:0,bottom:0,left:-1},c={width:3};break;case"right":b={top:0,bottom:0,right:-1},c={width:3};break;case"top":b={left:0,right:0,top:-1},c={height:3};break;case"bottom":b={left:0,right:0,bottom:-1},c={height:3}}this.line=BI.createWidget(c,{type:"bi.layout",cls:"bubble-popup-line bi-high-light-background"}),b.el=this.line,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},hideLine:function(){this.line&&this.line.destroy()}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:BI.i18nText("BI-Basic_Cancel"),level:"ignore"},{value:BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this,c=[];return BI.each(a.buttons,function(a,d){BI.isWidget(d)?c.push(d):c.push(BI.extend({type:"bi.button",height:30,handler:function(a){b.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,a)}},d))}),BI.createWidget({type:"bi.right_vertical_adapt",height:40,hgap:10,bgap:10,items:c})}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:{baseCls:"bi-text-bubble-bar-popup-view",text:"",width:250},render:function(){var a=this,b=this.options;return{type:"bi.bubble_bar_popup_view",ref:function(){a.popup=this},el:{type:"bi.vertical",items:[{type:"bi.label",text:b.text,whiteSpace:"normal",textAlign:"left",ref:function(){a.text=this}}],hgap:10,tgap:25,bgap:10},buttons:[{type:"bi.button",value:BI.i18nText("BI-Basic_Cancel"),level:"ignore",height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!1)}},{type:"bi.button",value:BI.i18nText("BI-Basic_Sure"),height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!0)}}]}},populate:function(a){this.text.setText(a||this.options.text)},showLine:function(a){this.popup.showLine(a)},hideLine:function(){this.popup.hideLine()}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:b.items,height:b.height,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText,value:b.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){a.popup.setValue(this.getValue()),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.editorIconCheckCombo.hideView(),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.editorIconCheckCombo.setValue(a)},getValue:function(){return this.trigger.getValue()},populate:function(a){this.options.items=a,this.editorIconCheckCombo.populate(a)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:28,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.icon_combo_trigger",iconCls:b.iconCls,title:b.title,items:b.items,width:b.width,height:b.height,iconWidth:b.iconWidth,iconHeight:b.iconHeight,value:b.value}),this.popup=BI.createWidget(b.popup,{type:"bi.icon_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.iconCombo.hideView(),a.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:b.direction,trigger:b.trigger,container:b.container,adjustLength:b.adjustLength,adjustXOffset:b.adjustXOffset,adjustYOffset:b.adjustYOffset,offsetStyle:b.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:b.maxWidth,maxHeight:b.maxHeight,minWidth:b.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.iconCombo.populate(a)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments), -a===BI.Events.CLICK&&b.fireEvent(BI.IconComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:28,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var a=this.options,b="";BI.isKey(a.value)&&(b=this._digest(a.value,a.items)),this.button=BI.createWidget(a.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:b,disableSelected:!0,width:a.isShowDown?a.width-12:a.width,height:a.height,iconWidth:a.iconWidth,iconHeight:a.iconHeight,selected:BI.isNotEmptyString(b)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font",width:12,height:8,selected:BI.isNotEmptyString(b)}),this.down.setVisible(a.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:0,bottom:0}]})},_digest:function(a,b){var c="";return a=BI.isArray(a)?a[0]:a,BI.any(b,function(b,d){if(a===d.value)return c=d.iconCls,!0}),c},populate:function(a){var b=this.options;this.options.items=a||[],this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(a){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var b=this.options,c=this._digest(a,this.options.items);a=BI.isArray(a)?a[0]:a,BI.isNotEmptyString(c)?(this.button.setIcon(c),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-icon-text-value-combo",height:30,iconHeight:null,iconWidth:null,value:""})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",items:b.items,height:b.height,text:b.text,defaultIconCls:b.defaultIconCls,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:b.items,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup"})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30,iconHeight:a.iconHeight,iconWidth:a.iconWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var b=this.options;a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:30,text:"",items:[],tipType:"",warningTitle:""},render:function(){var a=this,b=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",adjustLength:2,toggle:!1,ref:function(){a.combo=this},el:{type:"bi.search_text_value_trigger",ref:function(){a.trigger=this},items:b.items,height:b.height-2,text:b.text,value:b.value,tipType:b.tipType,warningTitle:b.warningTitle,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:b.value,items:b.items,ref:function(){a.popup=this,a.trigger.getSearcher().setAdapter(a.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},maxHeight:302},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(b){return 0===a.triggerBtn.element.find(b.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){a.triggerBtn=this},width:b.height,height:b.height,handler:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var a=this.options;BI.isKey(a.value)&&this._checkError(a.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},populate:function(a){this.combo.populate(a)},setValue:function(a){this.combo.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var a=this,b=this.options;return{type:"bi.vertical",items:[{type:"bi.button_group",ref:function(){a.popup=this},items:BI.createItems(b.items,{type:"bi.single_select_item",textAlign:b.textAlign,height:30}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,c,d)}}]}]}},populate:function(a,b,c){var d=BI.concat(a,b);BI.SearchTextValueComboPopup.superclass.populate.apply(this,d),d=BI.createItems(d,{type:"bi.single_select_item",height:30}),this.popup.populate(d,c)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{baseCls:"bi-search-text-value-trigger bi-border",height:30},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){a.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){a.editor=this},text:this._digest(b.value,b.items),value:b.value,height:b.height},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(a,c){var d=a.keyword,e=BI.Func.getSearchResult(b.items,d),f=e.match,g=e.find;c(g,f)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){a.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:30},width:30}]}},_setState:function(a){this.editor.setState(a)},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(a){this.options.items=a},setValue:function(a){this._setState(this._digest(a,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.StaticCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-static-combo",height:24,text:"",el:{},items:[],chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.StaticCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",cls:"bi-border",items:b.items,height:b.height,text:b.text,readonly:!0}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",textAlign:b.textAlign,chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.StaticCombo.EVENT_CHANGE,arguments)}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}})},populate:function(a){this.combo.populate(a)},setValue:function(a){this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.StaticCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_combo",BI.StaticCombo),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:""})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCheckCombo.hideView(),a.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setTitle:function(a){this.trigger.setTitle(a)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},setWarningTitle:function(a){this.trigger.setWarningTitle(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCheckCombo.populate(a)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.SmallTextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:""})},_init:function(){BI.SmallTextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextIconCheckCombo.hideView(),a.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.SmallTextIconCheckCombo.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextIconCheckCombo.populate(a)}}),BI.SmallTextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_check_combo",BI.SmallTextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(a.items),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_formatItems:function(a){return BI.map(a,function(a,b){return BI.extend({type:"bi.icon_text_item",cls:"item-check-font bi-list-item",height:30},b)})},populate:function(a){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(a))},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:30,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:""})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,value:b.value,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this._checkError(b.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextValueCombo.hideView(),a.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextValueCombo.populate(a)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_item",textAlign:a.textAlign,height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:30})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this._createValueMap();var c;BI.isNotNull(b.value)&&(c=this._digest(b.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",height:b.height,items:b.items,text:b.text,value:c}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:b.height,el:this.trigger,value:BI.isNull(c)?[]:[c],items:BI.deepClone(b.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){a.setValue(a.combo.getValue()[0].value),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){a.setValue(a.combo.getValue()[0].childValue),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)})},_createValueMap:function(){var a=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(b,c){BI.has(c,"el")?BI.each(c.children,function(b,d){a.valueMap[d.value]={value:c.el.value,childValue:d.value}}):a.valueMap[c.value]={value:c.value}})},_digest:function(a){return this.valueMap[a]},setValue:function(a){a=this._digest(a),this.combo.setValue([a]),this.trigger.setValue(a)},getValue:function(){var a=this.combo.getValue()[0];return[a.childValue||a.value]},populate:function(a){this.options.items=BI.flatten(a),this.combo.populate(a),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:a.height,items:this._formatItemArray(a.items),text:a.text,value:BI.isNull(a.value)?"":a.value.childValue||a.value.value})},_formatItemArray:function(){var a=BI.flatten(BI.deepClone(this.options.items)),b=[];return BI.each(a,function(a,c){BI.has(c,"el")?(BI.each(c.children,function(a,b){b.text=c.el.text+"("+b.text+")"}),b=BI.concat(b,c.children)):b.push(c)}),b},setValue:function(a){this.trigger.setValue(a.childValue||a.value)},populate:function(a){this.trigger.populate(this._formatItemArray(a))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker,value:b.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(b.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:b.textAlign,height:b.height,hgap:4}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText(),this.text.doRedMark(b.keyword)},_checkText:function(){var a=this.options;""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setTextStyle:function(a){this.text.setStyle(a)},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignInitialEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignInitialEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-initial-editor", +a===BI.Events.CLICK&&b.fireEvent(BI.IconComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:28,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var a=this.options,b="";BI.isKey(a.value)&&(b=this._digest(a.value,a.items)),this.button=BI.createWidget(a.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:b,disableSelected:!0,width:a.isShowDown?a.width-12:a.width,height:a.height,iconWidth:a.iconWidth,iconHeight:a.iconHeight,selected:BI.isNotEmptyString(b)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font",width:12,height:8,selected:BI.isNotEmptyString(b)}),this.down.setVisible(a.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:0,bottom:0}]})},_digest:function(a,b){var c="";return a=BI.isArray(a)?a[0]:a,BI.any(b,function(b,d){if(a===d.value)return c=d.iconCls,!0}),c},populate:function(a){var b=this.options;this.options.items=a||[],this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(a){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var b=this.options,c=this._digest(a,this.options.items);a=BI.isArray(a)?a[0]:a,BI.isNotEmptyString(c)?(this.button.setIcon(c),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-icon-text-value-combo",height:30,iconHeight:null,iconWidth:null,value:""})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",items:b.items,height:b.height,text:b.text,iconCls:b.iconCls,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:b.items,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup"})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30,iconHeight:a.iconHeight,iconWidth:a.iconWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var b=this.options;a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:30,text:"",items:[],tipType:"",warningTitle:""},render:function(){var a=this,b=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",adjustLength:2,toggle:!1,ref:function(){a.combo=this},el:{type:"bi.search_text_value_trigger",ref:function(){a.trigger=this},items:b.items,height:b.height-2,text:b.text,value:b.value,tipType:b.tipType,warningTitle:b.warningTitle,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:b.value,items:b.items,ref:function(){a.popup=this,a.trigger.getSearcher().setAdapter(a.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},maxHeight:302},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(b){return 0===a.triggerBtn.element.find(b.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){a.triggerBtn=this},width:b.height,height:b.height,handler:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var a=this.options;BI.isKey(a.value)&&this._checkError(a.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},populate:function(a){this.combo.populate(a)},setValue:function(a){this.combo.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var a=this,b=this.options;return{type:"bi.vertical",items:[{type:"bi.button_group",ref:function(){a.popup=this},items:BI.createItems(b.items,{type:"bi.single_select_item",textAlign:b.textAlign,height:30}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,c,d)}}]}]}},populate:function(a,b,c){var d=BI.concat(a,b);BI.SearchTextValueComboPopup.superclass.populate.apply(this,d),d=BI.createItems(d,{type:"bi.single_select_item",height:30}),this.popup.populate(d,c)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{baseCls:"bi-search-text-value-trigger bi-border",height:30},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){a.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){a.editor=this},text:this._digest(b.value,b.items),value:b.value,height:b.height},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(a,c){var d=a.keyword,e=BI.Func.getSearchResult(b.items,d),f=e.match,g=e.find;c(g,f)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){a.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:30},width:30}]}},_setState:function(a){this.editor.setState(a)},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(a){this.options.items=a},setValue:function(a){this._setState(this._digest(a,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.StaticCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-static-combo",height:24,text:"",el:{},items:[],chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.StaticCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",cls:"bi-border",items:b.items,height:b.height,text:b.text,readonly:!0}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",textAlign:b.textAlign,chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.StaticCombo.EVENT_CHANGE,arguments)}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}})},populate:function(a){this.combo.populate(a)},setValue:function(a){this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.StaticCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_combo",BI.StaticCombo),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:""})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCheckCombo.hideView(),a.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setTitle:function(a){this.trigger.setTitle(a)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},setWarningTitle:function(a){this.trigger.setWarningTitle(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCheckCombo.populate(a)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.SmallTextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:""})},_init:function(){BI.SmallTextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextIconCheckCombo.hideView(),a.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.SmallTextIconCheckCombo.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextIconCheckCombo.populate(a)}}),BI.SmallTextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_check_combo",BI.SmallTextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(a.items),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_formatItems:function(a){return BI.map(a,function(a,b){return BI.extend({type:"bi.icon_text_item",cls:"item-check-font bi-list-item",height:30},b)})},populate:function(a){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(a))},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:30,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:""})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,value:b.value,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this._checkError(b.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextValueCombo.hideView(),a.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextValueCombo.populate(a)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_item",textAlign:a.textAlign,height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:30})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this._createValueMap();var c;BI.isNotNull(b.value)&&(c=this._digest(b.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",height:b.height,items:b.items,text:b.text,value:c}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:b.height,el:this.trigger,value:BI.isNull(c)?[]:[c],items:BI.deepClone(b.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){a.setValue(a.combo.getValue()[0].value),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){a.setValue(a.combo.getValue()[0].childValue),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)})},_createValueMap:function(){var a=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(b,c){BI.has(c,"el")?BI.each(c.children,function(b,d){a.valueMap[d.value]={value:c.el.value,childValue:d.value}}):a.valueMap[c.value]={value:c.value}})},_digest:function(a){return this.valueMap[a]},setValue:function(a){a=this._digest(a),this.combo.setValue([a]),this.trigger.setValue(a)},getValue:function(){var a=this.combo.getValue()[0];return[a.childValue||a.value]},populate:function(a){this.options.items=BI.flatten(a),this.combo.populate(a),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:a.height,items:this._formatItemArray(a.items),text:a.text,value:BI.isNull(a.value)?"":a.value.childValue||a.value.value})},_formatItemArray:function(){var a=BI.flatten(BI.deepClone(this.options.items)),b=[];return BI.each(a,function(a,c){BI.has(c,"el")?(BI.each(c.children,function(a,b){b.text=c.el.text+"("+b.text+")"}),b=BI.concat(b,c.children)):b.push(c)}),b},setValue:function(a){this.trigger.setValue(a.childValue||a.value)},populate:function(a){this.trigger.populate(this._formatItemArray(a))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker,value:b.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(b.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:b.textAlign,height:b.height,hgap:4}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText(),this.text.doRedMark(b.keyword)},_checkText:function(){var a=this.options;""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setTextStyle:function(a){this.text.setStyle(a)},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignInitialEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignInitialEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-initial-editor", hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",value:"",text:"",height:24})},_init:function(){BI.SignInitialEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignInitialEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignInitialEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignInitialEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignInitialEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignInitialEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignInitialEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignInitialEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignInitialEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignInitialEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark");else{var b=this.editor.getValue();b=BI.isEmpty(b)||b==a.text?a.text:b+"("+a.text+")",this.text.setValue(b),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){var b=this.options;this.editor.setValue(a.value),b.text=a.text||b.text,this._checkText()},getValue:function(){return{value:this.editor.getValue(),text:this.options.text}},getState:function(){return this.text.getValue()},setState:function(a){var b=this.options;this._showHint(),a=BI.isEmpty(a)||a==b.text?b.text:a+"("+b.text+")",this.text.setValue(a)}}),BI.SignInitialEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignInitialEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignInitialEditor.EVENT_BLUR="EVENT_BLUR",BI.SignInitialEditor.EVENT_CLICK="EVENT_CLICK",BI.SignInitialEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignInitialEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignInitialEditor.EVENT_START="EVENT_START",BI.SignInitialEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignInitialEditor.EVENT_STOP="EVENT_STOP",BI.SignInitialEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignInitialEditor.EVENT_VALID="EVENT_VALID",BI.SignInitialEditor.EVENT_ERROR="EVENT_ERROR",BI.SignInitialEditor.EVENT_ENTER="EVENT_ENTER",BI.SignInitialEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignInitialEditor.EVENT_SPACE="EVENT_SPACE",BI.SignInitialEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_initial_editor",BI.SignInitialEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.StateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.setTitle(""),this.text.element.addClass("state-editor-infinite-text"))):BI.isString(a)?(this.text.setText(a),this.text.setTitle(a),void this.text.element.removeClass("state-editor-infinite-text")):void(BI.isArray(a)&&(BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):1===a.length?(this.text.setText(a[0]),this.text.setTitle(a[0]),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text"))))}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text"))):void(BI.isArray(a)&&1!==a.length?BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(a),this.text.setTitle(a),this.text.element.removeClass("state-editor-infinite-text")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor),BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this;if(0!==a.buttons.length){var c=[];return BI.each(a.buttons,function(a,b){c.push({text:b,value:a})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-border-top",height:30,items:BI.createItems(c,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(a,c){b.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,a,c)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var a=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var a=this,b=this.options,c=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return c.on(BI.IconButton.EVENT_CHANGE,function(){a.setVisible(!1),a.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-background bi-border",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:b.title,height:25,lgap:10}},{el:c,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var a=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget(b.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:b.items,itemsCreator:function(c,d){1===c.times&&(a.empty(),BI.nextTick(function(){a.loading()})),b.itemsCreator(c,function(){d.apply(a,arguments),1===c.times&&BI.nextTick(function(){a.loaded()})})},hasNext:b.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.ListPane.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,vgap:b.vgap,hgap:b.hgap},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(a){this.options.items=a.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(a){this.options.items=this.options.items.concat(a),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(a){a=a||[],BI.removeAt(this.options.items,a),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(a){var b=this;this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");b.populate.apply(b,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(a){return this.button_group.getIndexByValue(a)},getNodeById:function(a){return this.button_group.getNodeById(a)},getNodeByValue:function(a){return this.button_group.getNodeByValue(a)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var a=this,b=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:b.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:b.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Panel.EVENT_CHANGE,b,c)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(a){this.text.setValue(a)}}),BI.Panel.EVENT_CHANGE="Panel.EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var a=this,b=this.options;return[{type:"bi.label",text:b.text,height:b.height,value:b.value,hgap:b.hgap,ref:function(){a.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:3,ref:function(){a.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(a){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),a?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-border-bottom",items:[],height:29},render:function(){var a=this,b=this.options;return{type:"bi.button_group",items:BI.createItems(b.items,{type:"bi.linear_segment_button",height:b.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){a.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.buttonGroup=this}}},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar"},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.toolbar=BI.createWidget(b.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.allSelected=this.isSelected(),b===BI.Events.CLICK&&(a.setAllSelected(a.allSelected),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(b.el,{type:"bi.list_pane",items:b.items,itemsCreator:function(c,d){1===c.times&&a.toolbar.setVisible(!1),b.itemsCreator(c,function(b){d.apply(a,arguments),1===c.times&&(a.toolbar.setVisible(b&&b.length>0),a.toolbar.setEnable(b&&b.length>0)),a._checkAllSelected()})},onLoaded:b.onLoaded,hasNext:b.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){b===BI.Events.CLICK&&(a._checkAllSelected(),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(b.direction),BI.extend({ scrolly:!0},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(b.direction,this.toolbar,this.list)})))),b.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(b.value)&&this.setValue(b.value)},_checkAllSelected:function(){var a=this.list.getValue().length,b=this.getAllLeaves().length-a,c=this.list.hasNext(),d=this.toolbar.isSelected(),e=a>0&&(b>0||!d&&c);e=e||b>0&&c&&d,this.toolbar.setHalfSelected(e),!e&&this.toolbar.setSelected(a>0&&b<=0&&(!c||d))},setAllSelected:function(a){BI.each(this.getAllButtons(),function(b,c){(c.setSelected||c.setAllSelected).apply(c,[a])}),this.allSelected=!!a,this.toolbar.setSelected(a),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(a){this.toolbar.setVisible(a)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(a){this.list.prependItems.apply(this.list,arguments)},addItems:function(a){this.list.addItems.apply(this.list,arguments)},setValue:function(a){var b=a.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(b),this.list[b?"setNotSelectedValue":"setValue"](a.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(a){this.toolbar.setVisible(!BI.isEmptyArray(a)),this.toolbar.setEnable(!BI.isEmptyArray(a)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(a){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(a)},resetHeight:function(a){var b=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(a-b):this.list.element.css({"max-height":a-b+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(a){return this.list.getIndexByValue(a)},getNodeById:function(a){return this.list.getNodeById(a)},getNodeByValue:function(a){return this.list.getNodeByValue(a)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var a=this,b=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var c=b.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:b.el,itemsCreator:function(b,c){c(a._getNextItems(b))},hasNext:function(a){return a.count=1)},setValue:function(a){this.pager.setValue(a)},setVPage:function(a){this.pager.setValue(a)},setCount:function(a){this.rowCount.setText(a),this.rowCount.setTitle(a)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(a){this.editor.setVisible(a),this.allPages.setVisible(a),this.pager.setVisible(a)},populate:function(){this.pager.populate()}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager),BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:30,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var a=this.options;a.vertical,a.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:5,right:74},{el:this.vlabel,top:5,right:111},{el:this.hpager,top:5,right:-9},{el:this.hlabel,top:5,right:28}]})},_createVPager:function(){var a=this,b=this.options,c=b.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:20,value:c.curr,title:c.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:76,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24,vgap:1}],invisible:!0,dynamicShow:!1,pages:c.pages,curr:c.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-prev column-pre-page-h-font"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-next column-next-page-h-font"},hasPrev:c.hasPrev,hasNext:c.hasNext,firstPage:c.firstPage,lastPage:c.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){a.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){a.vlabel.setValue(this.getCurrentPage()),a.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var a=this,b=this.options,c=b.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:20,value:c.curr,title:c.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:76,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24,vgap:1}],invisible:!0,dynamicShow:!1,pages:c.pages,curr:c.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-prev row-pre-page-h-font"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-next row-next-page-h-font"},hasPrev:c.hasPrev,hasNext:c.hasNext,firstPage:c.firstPage,lastPage:c.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){a.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){a.hlabel.setValue(this.getCurrentPage()),a.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(a){this.vpager.setValue(a),this.vlabel.setValue(a),this.vlabel.setTitle(a)},setHPage:function(a){this.hpager.setValue(a),this.hlabel.setValue(a),this.hlabel.setTitle(a)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(a){this.hpager.setVisible(a),this.hlabel.setVisible(a)},setVPagerVisible:function(a){this.vpager.setVisible(a),this.vlabel.setVisible(a)},populate:function(){this.vpager.populate(),this.hpager.populate();var a=!1,b=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),b=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),a=!0):this.setVPagerVisible(!1),this.setVisible(b||a);var c=[74,111,-9,28],d=this.layout.attr("items");a===!0&&b===!0?(d[0].right=c[0],d[1].right=c[1],d[2].right=c[2],d[3].right=c[3]):a===!0?(d[0].right=c[2],d[1].right=c[3]):b===!0&&(d[2].right=c[2],d[3].right=c[3]),this.layout.attr("items",d),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager),BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var a=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){a._lock=!1},300),this._populate()},_populate:function(){var a=this,b=this.options,c=[],d={};this.empty();var e=BI.result(b,"pages"),f=BI.result(this,"currPage"),g=BI.result(b,"groups"),h=BI.result(b,"first"),i=BI.result(b,"last"),j=BI.result(b,"prev"),k=BI.result(b,"next");e===!1?(g=0,h=!1,i=!1):g>e&&(g=e),d.index=Math.ceil((f+(g>1&&g!==e?1:0))/(0===g?1:g)),(!b.dynamicShow&&!b.dynamicShowPrevNext||f>1)&&j!==!1&&(BI.isKey(j)?c.push({text:j,value:"prev",disabled:e===!1?b.hasPrev(f)===!1:!(f>1&&j!==!1)}):c.push(BI.extend({disabled:e===!1?b.hasPrev(f)===!1:!(f>1&&j!==!1)},j))),(!b.dynamicShow&&!b.dynamicShowFirstLast||d.index>1&&0!==g)&&h&&(c.push({text:h,value:"first",disabled:!(d.index>1&&0!==g)}),d.index>1&&0!==g&&c.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),d.poor=Math.floor((g-1)/2),d.start=d.index>1?f-d.poor:1,d.end=d.index>1?function(){var a=f+(g-d.poor-1);return a>e?e:a}():g,d.end-d.start1&&0!==g&&e>g&&d.endg&&d.endg&&d.endg&&d.end1},hasNext:function(a){a||(a=1);var b=this.options,c=this.options.pages;return c===!1?b.hasNext(a):ac?c:(d=BI.result(b,"firstPage"),ab.pages?b.pages:a,this.currPage=a;this._populate()},getValue:function(){var a=this.button_group.getValue()[0];switch(a){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return a}},attr:function(a,b){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===a&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager),BI.RichEditorAction=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.RichEditorAction.superclass._defaultConfig.apply(this,arguments),{width:20,height:20,command:"",used:!0})},_init:function(){BI.RichEditorAction.superclass._init.apply(this,arguments);var a=this,b=this.options;b.editor.on(BI.NicEditor.EVENT_SELECTED,function(c){b.used===!0&&(a.setEnable(!0),a.checkNodes(c.target),a.key(c))}),b.editor.on(BI.NicEditor.EVENT_BLUR,function(){a.setEnable(!1)}),b.editor.on(BI.NicEditor.EVENT_KEYDOWN,BI.bind(this.keydown,this)),b.used===!1&&this.setEnable(!1)},checkNodes:function(a){if(!a)return!1;var b=a;do if(this.options.tags&&this.options.tags.contains(b.nodeName))return this.activate(),!0;while(b=b.parentNode&&b.className&&b.className.indexOf("bi-nic-editor")>=-1);for(b=a;3==b.nodeType;)b=b.parentNode;if(this.options.css)for(var c in this.options.css){if(null==this.options.css[c])return this.activate($(b).css(c)),!0;if($(b).css(c)==this.options.css[c])return this.activate(),!0}return this.deactivate(),!1},start:function(){},key:function(){},keydown:function(){},hideIf:function(a){},activate:function(){},deactivate:function(){},doCommand:function(a){this.options.command&&this.options.editor.nicCommand(this.options.command,a)}}),BI.RichEditorParamAction=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this,arguments),{paramFormatter:function(a){return a}})},_init:function(){BI.RichEditorParamAction.superclass._init.apply(this,arguments)},addParam:function(a){var b=this.options,c=(b.editor.instance,new Image),d=BI.DOM.getImage(b.paramFormatter(a));c.src=d.src,c.alt=a,c.style=d.style,$(c).addClass("rich-editor-param"),this.options.editor.insertHTML($("
    ").append(c).html())}}),BI.RichEditorTextToolbar=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-text-toolbar bi-background",buttons:[{type:"bi.rich_editor_font_chooser"},{type:"bi.rich_editor_size_chooser"},{type:"bi.rich_editor_bold_button"},{type:"bi.rich_editor_italic_button"},{type:"bi.rich_editor_underline_button"},{type:"bi.rich_editor_color_chooser"},{type:"bi.rich_editor_background_color_chooser"},{type:"bi.rich_editor_align_left_button"},{type:"bi.rich_editor_align_center_button"},{type:"bi.rich_editor_align_right_button"},{type:"bi.rich_editor_param_button"}],height:28})},_init:function(){BI.RichEditorTextToolbar.superclass._init.apply(this,arguments);var a=this.options,b=BI.createWidgets(BI.map(a.buttons,function(b,c){return BI.extend(c,{editor:a.editor})}));this.element.mousedown(function(a){BI.each(b,function(b,c){c.hideIf(a)})}),BI.createWidget({type:"bi.left",element:this,items:b,hgap:3,vgap:3})},mounted:function(){var a=this;BI.isIE9Below()&&(this.element.mousedown(function(){a._noSelect(a.element[0])}),this._noSelect(this.element[0]))},_noSelect:function(a){a.setAttribute&&"input"!=a.nodeName.toLowerCase()&&"textarea"!=a.nodeName.toLowerCase()&&a.setAttribute("unselectable","on");for(var b=0;b0?a.getRangeAt(0):a.createRange()},selRng:function(a,b){window.getSelection?(b.removeAllRanges(),b.addRange(a)):a.select()},selElm:function(){var a=this.getRng();if(a){if(a.startContainer){var b=a.startContainer;if(1==a.cloneContents().childNodes.length)for(var c=0;c0&&this.colorchooser.hideView()},deactivate:function(){}}),BI.shortcut("bi.rich_editor_background_color_chooser",BI.RichEditorBackgroundColorChooser),BI.RichEditorColorChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this,arguments),{width:20,height:20,command:"foreColor",css:{color:null}})},_init:function(){BI.RichEditorColorChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.colorchooser=BI.createWidget({type:"bi.color_chooser",element:this,width:b.width,height:b.height,el:{type:"bi.rich_editor_color_chooser_trigger",title:BI.i18nText("BI-Font_Colour"),cls:"text-toolbar-button"}}),this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE,function(){a.doCommand(this.getValue())})},hideIf:function(a){!this.colorchooser.element.find(a.target).length>0&&this.colorchooser.hideView()},activate:function(a){this.colorchooser.setValue(BI.DOM.rgb2hex(a))},deactivate:function(){this.colorchooser.setValue("")}}),BI.shortcut("bi.rich_editor_color_chooser",BI.RichEditorColorChooser),BI.RichEditorFontChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorFontChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-font-chooser bi-border bi-card",command:"FontName",width:50,height:20})},_init:function(){BI.RichEditorSizeChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",readonly:!0,height:b.height,triggerWidth:16,text:BI.i18nText("BI-Font_Family")}),this.combo=BI.createWidget({type:"bi.combo",element:this,el:this.trigger,adjustLength:1,popup:{minWidth:70,el:{type:"bi.button_group",items:BI.createItems([{value:"Microsoft YaHei",text:BI.i18nText("BI-Microsoft_YaHei")},{value:"PingFangSC-Light !important",text:BI.i18nText("BI-Apple_Light")},{value:"arial",text:"Arial"},{value:"Verdana",text:"Verdana"}],{type:"bi.single_select_item"}),layouts:[{type:"bi.vertical"}]}}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){var b=this.getValue()[0];a.doCommand(b),this.hideView(),this.setValue([])})},hideIf:function(a){!this.combo.element.find(a.target).length>0&&this.combo.hideView()}}),BI.shortcut("bi.rich_editor_font_chooser",BI.RichEditorFontChooser),BI.RichEditorSizeChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-size-chooser bi-border bi-card",command:"FontSize",width:50,height:20})},_items:[{value:1,text:"1(8pt)"},{value:2,text:"2(10pt)"},{value:3,text:"3(12pt)"},{value:4,text:"4(14pt)"},{value:5,text:"5(18pt)"},{value:6,text:"6(24pt)"}],_init:function(){BI.RichEditorSizeChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",readonly:!0,height:b.height,triggerWidth:16,text:BI.i18nText("BI-Font_Size")}),this.combo=BI.createWidget({type:"bi.combo",element:this,el:this.trigger,adjustLength:1,popup:{maxWidth:70,minWidth:70,el:{type:"bi.button_group",items:BI.createItems(this._items,{type:"bi.single_select_item"}),layouts:[{type:"bi.vertical"}]}}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){var b=this.getValue()[0];a.doCommand(b),this.hideView(),this.setValue([])})},hideIf:function(a){!this.combo.element.find(a.target).length>0&&this.combo.hideView()}}),BI.shortcut("bi.rich_editor_size_chooser",BI.RichEditorSizeChooser),BI.RichEditor=BI.inherit(BI.Widget,{props:{baseCls:"bi-rich-editor bi-textarea",toolbar:{},readOnly:!1},render:function(){var a=this,b=this.options,c={type:"bi.nic_editor",width:b.width,height:b.height,readOnly:b.readOnly,ref:function(){a.editor=this},listeners:[{eventName:BI.NicEditor.EVENT_BLUR,action:function(){a.fireEvent(BI.RichEditor.EVENT_CONFIRM)}},{eventName:BI.NicEditor.EVENT_FOCUS,action:function(){b.readOnly||a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.RichEditor.EVENT_FOCUS)}}]};return b.readOnly?c:(this.editor=BI.createWidget(c),{type:"bi.combo",toggle:!1,trigger:"click",direction:"top,right",isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,adjustLength:1,ref:function(){a.combo=this},el:this.editor,popup:{el:BI.extend({type:"bi.rich_editor_text_toolbar",editor:this.editor},b.toolbar),height:30,stopPropagation:!0,stopEvent:!0},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.fireEvent(BI.RichEditor.EVENT_AFTER_HIDEVIEW)}}]})},mounted:function(){var a=this.options;BI.isNull(a.value)&&this.editor.setValue(a.value)},focus:function(){this.editor.focus()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()}}),BI.RichEditor.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.RichEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.RichEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.rich_editor",BI.RichEditor),BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-segment-button bi-list-item-active",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,height:a.height-2,whiteSpace:a.whiteSpace,text:a.text,value:a.value,hgap:a.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(a){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(a)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton),BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var a=this,b=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:b.value,items:BI.createItems(b.items,{type:"bi.segment_button",height:b.height-2,whiteSpace:b.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Segment.EVENT_CHANGE,b,c)})},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment),BI.AdaptiveTable=BI.inherit(BI.Widget,{_const:{perColumnSize:100},_defaultConfig:function(){return BI.extend(BI.AdaptiveTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-adaptive-table",el:{type:"bi.resizable_table"},isNeedResize:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!1,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.AdaptiveTable.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._digest();this.table=BI.createWidget(b.el,{type:"bi.resizable_table",element:this,width:b.width,height:b.height,isNeedResize:b.isNeedResize,isResizeAdapt:!1,isNeedFreeze:b.isNeedFreeze,freezeCols:c.freezeCols,isNeedMerge:b.isNeedMerge,mergeCols:b.mergeCols,mergeRule:b.mergeRule,columnSize:c.columnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:c.regionColumnSize,header:b.header,items:b.items,crossHeader:b.crossHeader,crossItems:b.crossItems}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),a._populate(),a.table.populate(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.columnSize=this.getColumnSize(),a._populate(),a.table.populate(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_getFreezeColLength:function(){var a=this.options;return a.isNeedFreeze===!0?BI.clamp(a.freezeCols.length,0,a.columnSize.length):0},_digest:function(){var a=this.options,b=a.columnSize.slice(),c=a.regionColumnSize.slice(),d=a.freezeCols.slice(),e=a.regionColumnSize[0],f=this._getFreezeColLength();if(!e||e>a.width-10||e<10){var g=BI.sum(b,function(a,b){return a=b.length&&(d=[]),BI.isNumber(b[0])||(b=a.minColumnSize.slice());var h=0,i=0;return BI.each(b,function(a,b){a0&&(b[f-1]=BI.clamp(e-(h-b[f-1]),a.minColumnSize[f-1]||10,a.maxColumnSize[f-1]||Number.MAX_VALUE)),b.length>0&&(b[b.length-1]=BI.clamp(a.width-BI.GridTableScrollbar.SIZE-e-(i-h-b[b.length-1]),a.minColumnSize[b.length-1]||10,a.maxColumnSize[b.length-1]||Number.MAX_VALUE)),c[0]=e,{freezeCols:d,columnSize:b,regionColumnSize:c}},_populate:function(){var a=this.options,b=this._digest();a.regionColumnSize=b.regionColumnSize,a.columnSize=b.columnSize,this.table.setColumnSize(b.columnSize),this.table.setRegionColumnSize(b.regionColumnSize),this.table.attr("freezeCols",b.freezeCols)},setWidth:function(a){BI.AdaptiveTable.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.AdaptiveTable.superclass.setHeight.apply(this,arguments),this.table.setHeight(a)},setColumnSize:function(a){this.options.columnSize=a},getColumnSize:function(){return this.table.getColumnSize()},setRegionColumnSize:function(a){this.options.regionColumnSize=a},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(a,b){var c=BI.AdaptiveTable.superclass.attr.apply(this,arguments);return"freezeCols"===a?c:this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a){this.options;this._populate(),this.table.populate.apply(this.table,arguments)},destroy:function(){this.table.destroy(),BI.AdaptiveTable.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.adaptive_table",BI.AdaptiveTable),BI.DynamicSummaryLayerTreeTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DynamicSummaryLayerTreeTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-dynamic-summary-layer-tree-table",el:{type:"bi.resizable_table"},isNeedResize:!0,isResizeAdapt:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,footerRowSize:25,rowSize:25,regionColumnSize:[],rowHeaderCreator:null,headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],footer:!1,items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_createHeader:function(a){var b=this.options,c=b.header||[],d=b.crossHeader||[],e=BI.TableTree.formatCrossItems(b.crossItems,a,b.headerCellStyleGetter),f=[];BI.each(e,function(a,b){var c=[d[a]];f.push(c.concat(b||[]))});var g=BI.isFunction(b.rowHeaderCreator)?b.rowHeaderCreator():b.rowHeaderCreator;if(c&&c.length>0){var h=this._formatColumns(c),i=this._getHDeep();i<=0?h.unshift(g||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter}):h[0]=g||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter},f.push(h)}return f},_formatItems:function(a,b,c){function d(a,b){a.type||(a.type="bi.layer_tree_table_cell"),a.layer=b;var c=[a];c=c.concat(a.values||[]),c.length>0&&f.push(c),BI.isNotEmptyArray(a.children)&&BI.each(a.children,function(a,c){d(c,b+1)})}var e=this.options,f=[];return BI.each(a,function(a,b){if(BI.each(b.children,function(a,b){d(b,0)}),BI.isArray(b.values)){var c=[{type:"bi.table_style_cell",text:BI.i18nText("BI-Summary_Values"),styleGetter:function(){return e.summaryCellStyleGetter(!0)}}].concat(b.values);f.push(c)}}),BI.DynamicSummaryTreeTable.formatSummaryItems(f,b,e.crossItems,1)},_formatColumns:function(a,b){return BI.isNotEmptyArray(a)?(b=b||this._getHDeep(),a.slice(Math.max(0,b-1))):a},_formatFreezeCols:function(){return this.options.freezeCols.length>0?[0]:[]},_formatColumnSize:function(a,b){if(a.length<=0)return[];var c=[0];return b=b||this._getHDeep(),BI.each(a,function(a,d){return a1)for(var c=0;c1)&&BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e1?g+=a.values.length:g++}var f=[],g=0;if(BI.each(c,function(a,b){e(b)}),f.length>0){var h=[],i=[];BI.each(b,function(a,b){var c=b.slice();BI.removeAt(c,f),h.push(c)}),BI.each(a,function(a,b){var c=b.slice();BI.removeAt(c,f),i.push(c)}),b=h,a=i}return{items:a,header:b,deletedCols:f}}}),BI.shortcut("bi.dynamic_summary_tree_table",BI.DynamicSummaryTreeTable),BI.LayerTreeTableCell=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LayerTreeTableCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-layer-tree-table-cell",layer:0,text:""})},_init:function(){BI.LayerTreeTableCell.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget({type:"bi.label",element:this.element,textAlign:"left",whiteSpace:"nowrap",height:a.height,text:a.text,value:a.value,lgap:5+30*a.layer,rgap:5})}}),BI.shortcut("bi.layer_tree_table_cell",BI.LayerTreeTableCell),BI.LayerTreeTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LayerTreeTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-layer-tree-table",el:{type:"bi.resizable_table"},isNeedResize:!1,isResizeAdapt:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],rowHeaderCreator:null,headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_createHeader:function(a){var b=this.options,c=b.header||[],d=b.crossHeader||[],e=BI.TableTree.formatCrossItems(b.crossItems,a,b.headerCellStyleGetter),f=[];if(BI.each(e,function(a,b){var c=[d[a]];f.push(c.concat(b||[]))}),c&&c.length>0){var g=this._formatColumns(c),h=this._getHDeep();h<=0?g.unshift(b.rowHeaderCreator||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter}):g[0]=b.rowHeaderCreator||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter},f.push(g)}return f},_formatItems:function(a){function b(a,c){a.type||(a.type="bi.layer_tree_table_cell"),a.layer=c;var e=[a];e=e.concat(a.values||[]),e.length>0&&d.push(e),BI.isNotEmptyArray(a.children)&&BI.each(a.children,function(a,d){b(d,c+1)})}var c=this.options,d=[];return BI.each(a,function(a,e){if(BI.each(e.children,function(a,c){b(c,0)}),BI.isArray(e.values)){var f=[{type:"bi.table_style_cell",text:BI.i18nText("BI-Summary_Values"),styleGetter:function(){return c.summaryCellStyleGetter(!0)}}].concat(e.values);d.push(f)}}),d},_formatColumns:function(a,b){return BI.isNotEmptyArray(a)?(b=b||this._getHDeep(),a.slice(Math.max(0,b-1))):a},_formatFreezeCols:function(){return this.options.freezeCols.length>0?[0]:[]},_formatColumnSize:function(a,b){if(a.length<=0)return[];var c=[0];return b=b||this._getHDeep(),BI.each(a,function(a,d){return a0&&(c=BI.makeArray(b,a[0]/b)),c.concat(a.slice(1))},setRegionColumnSize:function(a){this.options.regionColumnSize=a,this.table.setRegionColumnSize(a)},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(a,b){var c=this;if(BI.isObject(a))return void BI.each(a,function(a,b){c.attr(a,b)});switch(BI.LayerTreeTable.superclass.attr.apply(this,arguments),a){case"columnSize":case"minColumnSize":case"maxColumnSize":case"freezeCols":case"mergeCols":return}this.table.attr.apply(this.table,[a,b])},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;e.items=a||[],b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.setColumnSize(f.columnSize),this.table.attr("freezeCols",f.freezeCols),this.table.attr("minColumnSize",f.minColumnSize),this.table.attr("maxColumnSize",f.maxColumnSize),this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.LayerTreeTable.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.layer_tree_table",BI.LayerTreeTable),BI.TableStyleCell=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TableStyleCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-style-cell",styleGetter:BI.emptyFn})},_init:function(){BI.TableStyleCell.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,height:a.height,textAlign:"left",forceCenter:!0,hgap:5,text:a.text}),this._digestStyle()},_digestStyle:function(){var a=this.options,b=a.styleGetter();b&&this.text.element.css(b)},setText:function(a){this.text.setText(a)},populate:function(){this._digestStyle()}}),BI.shortcut("bi.table_style_cell",BI.TableStyleCell),BI.TableTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TableTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-tree",el:{type:"bi.resizable_table"},isNeedResize:!0,isResizeAdapt:!0,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_init:function(){BI.TableTree.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._digest();this.table=BI.createWidget(b.el,{type:"bi.resizable_table",element:this,width:b.width,height:b.height,isNeedResize:b.isNeedResize,isResizeAdapt:b.isResizeAdapt,isNeedFreeze:b.isNeedFreeze,freezeCols:b.freezeCols,isNeedMerge:b.isNeedMerge,mergeCols:b.mergeCols,mergeRule:b.mergeRule,columnSize:b.columnSize,minColumnSize:b.minColumnSize,maxColumnSize:b.maxColumnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:b.regionColumnSize,header:c.header,items:c.items}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_digest:function(){var a=this.options,b=this._getHDeep(),c=this._getVDeep(),d=BI.TableTree.formatHeader(a.header,a.crossHeader,a.crossItems,b,c,a.headerCellStyleGetter),e=BI.TableTree.formatItems(a.items,b,!1,a.summaryCellStyleGetter);return{header:d,items:e}},setWidth:function(a){BI.TableTree.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.TableTree.superclass.setHeight.apply(this,arguments),this.table.setHeight(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()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(){BI.TableTree.superclass.attr.apply(this,arguments),this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;a&&(e.items=a||[]),b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.TableTree.superclass.destroy.apply(this,arguments)}}),BI.extend(BI.TableTree,{formatHeader:function(a,b,c,d,e,f){for(var g=BI.TableTree.formatCrossItems(c,e,f),h=[],i=0;i0&&h.push(a),h},formatItems:function(a,b,c,d){function e(a,g){var h;if(BI.isArray(g.children)){if(BI.each(g.children,function(b,c){var d;a!=-1?(d=a.slice(),d.push(g)):d=[],e(d,c)}),a!=-1?(h=a.slice(),h.push(g)):h=[],BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e0},halfSelected:!1})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var a=this,b=this.options,c=b.selected===!0,d=!b.selected&&b.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){a.setSelected(a.isSelected())},selected:c,invisible:d}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){a.setSelected(!0)},invisible:c||!d}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.text=BI.createWidget({type:"bi.label",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({type:"bi.htape",element:this,items:[{width:36,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(a){this.checkbox.setSelected(!!a)},beforeClick:function(){var a=this.isHalfSelected(),b=this.isSelected();a===!0?this.setSelected(!0):this.setSelected(!b)},setSelected:function(a){this.checkbox.setSelected(a),this.setHalfSelected(!1)},setHalfSelected:function(a){this.halfSelected=!!a,a===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(a){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var b=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(b),!b&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE)}}),BI.MultiSelectBar.EVENT_CHANGE="MultiSelectBar.EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.BranchRelation=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-relation-tree",items:[],centerOffset:0,direction:BI.Direction.Bottom,align:BI.VerticalAlign.Top})},_init:function(){BI.BranchRelation.superclass._init.apply(this,arguments),this.populate(this.options.items)},_stratification:function(){var a=[];return this.tree.recursion(function(b,c){b.leaf=b.isLeaf(),a[c.length-1]||(a[c.length-1]=[]),a[c.length-1].push(b)}),a},_calculateLeaves:function(){function a(b){var c=0;return b.isLeaf()?1:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),b.set("leaves",c),c)}var b=0;return b=a(this.tree.getRoot())},_translate:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,g);var k=g.parent.getChildIndex(g.id);g.parent.removeChildByIndex(k),g.parent.addChild(h,k),h.addChild(g),b[d].push(h),e[f]=h}else b[d].push(g)})}),b},_fill:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,h),g.addChild(h)}b[d].push(g)})}),b},_adjust:function(a){for(;;){var b=!1;if(BI.backEach(a,function(a,c){BI.each(c,function(a,c){if(!c.isNew){var d=!0;if(BI.any(c.getChildren(),function(a,b){if(!b.isNew)return d=!1,!0}),!c.isLeaf()&&d===!0){var e=[];BI.each(c.getChildren(),function(a,b){e=e.concat(b.getChildren())}),c.removeAllChilds(),BI.each(e,function(a,b){c.addChild(b)});var f=new BI.Node(BI.UUID());f.isNew=!0;var g=c.parent.getChildIndex(c.id);c.parent.removeChildByIndex(g),c.parent.addChild(f,g),f.addChild(c),b=!0}}})}),b===!1)break;a=this._stratification()}return a},_calculateWidth:function(){function a(b){var c=0;return b.isLeaf()?b.width:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),c)}function b(a){var c=0;return a.isLeaf()?a.height:(BI.each(a.getChildren(),function(a,d){c+=b(d)}),c)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_isVertical:function(){var a=this.options;return a.direction===BI.Direction.Top||a.direction===BI.Direction.Bottom},_calculateHeight:function(){function a(b){var c=0;return BI.each(b.getChildren(),function(b,d){c=Math.max(c,a(d))}),c+(b.height||0)}function b(a){var c=0;return BI.each(a.getChildren(),function(a,d){c=Math.max(c,b(d))}),c+(a.width||0)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_calculateXY:function(a){var b=(this.options,this._calculateWidth()),c=this._calculateHeight(),d=a.length,e=this._calculateLeaves(),f={},g=c/d;return BI.each(a,function(a,c){var d=[];BI.each(c,function(a,b){d[a]=(b.get("leaves")||1)/e}),BI.each(c,function(c,e){var h=BI.sum(d.slice(0,c)),i=h*b+d[c]*b/2,j=a*g+g/2;f[e.id]={x:i,y:j}})}),f},_stroke:function(a,b){var c=this._calculateHeight(),d=a.length,e=c/d,f=this,g=this.options;switch(g.direction){case BI.Direction.Top:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+h.x+","+(h.y+g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y+g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Bottom:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+h.x+","+(h.y-g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y-g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Left:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+(h.y+g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y+g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Right:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+(h.y-g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y-g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})})}},_createBranches:function(a){var b=this.options;b.direction!==BI.Direction.Bottom&&b.direction!==BI.Direction.Right||(a=a.reverse());var c=this._calculateXY(a);this._stroke(a,c)},_isNeedAdjust:function(){var a=this.options;return a.direction===BI.Direction.Top&&a.align===BI.VerticalAlign.Bottom||a.direction===BI.Direction.Bottom&&a.align===BI.VerticalAlign.Top||a.direction===BI.Direction.Left&&a.align===BI.HorizontalAlign.Right||a.direction===BI.Direction.Right&&a.align===BI.HorizontalAlign.Left},setValue:function(a){},getValue:function(){},populate:function(a){var b=this.options;b.items=a||[],this.empty(),a=BI.Tree.transformToTreeFormat(b.items),this.tree=new BI.Tree,this.tree.initTree(a),this.svg=BI.createWidget({type:"bi.svg"});var c=this._stratification();if(this._isNeedAdjust()){var d=this._translate(c);d=this._adjust(d),this._createBranches(d)}else{var d=this._fill(c);this._createBranches(d)}var e=BI.createWidget({type:"bi.layout",width:this._isVertical()?this._calculateWidth():this._calculateHeight(),height:this._isVertical()?this._calculateHeight():this._calculateWidth()});BI.createWidget({type:"bi.absolute",element:e,items:[{el:this.svg,top:0,left:0,right:0,bottom:0}]}),a=this._isVertical()?[{type:"bi.handstand_branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.horizontal_adapt",verticalAlign:b.align}]},items:a}]:[{type:"bi.branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.vertical"},{type:b.align===BI.HorizontalAlign.Left?"bi.left":"bi.right"}]},items:a}],BI.createWidget({type:"bi.adaptive",element:e,items:a}),BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[e]})}}),BI.BranchRelation.EVENT_CHANGE="BranchRelation.EVENT_CHANGE",BI.shortcut("bi.branch_relation",BI.BranchRelation),BI.HandStandBranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-expander",direction:BI.Direction.Top,logic:{dynamic:!0},el:{type:"bi.label"},popup:{}})},_init:function(){BI.HandStandBranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,{type:"bi.center_adapt",items:[this.expander]},this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.HandStandBranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_expander",BI.HandStandBranchExpander),BI.BranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-expander",direction:BI.Direction.Left,logic:{dynamic:!0},el:{},popup:{}})},_init:function(){BI.BranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,this.expander,this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el,{type:"bi.label",width:30,height:"100%"}),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.BranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_expander",BI.BranchExpander),BI.HandStandBranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.HandStandBranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.handstand_branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.horizontal_adapt"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.HandStandBranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_tree",BI.HandStandBranchTree),BI.BranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.BranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.BranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.BranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_tree",BI.BranchTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function a(a,b){return!1}var b={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:a}};return b},_dealWidthNodes:function(a){a=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(a,function(a,b){null==b.text&&b.count>0&&(b.text=b.value+"("+BI.i18nText("BI-Basic_Altogether")+b.count+BI.i18nText("BI-Basic_Count")+")")}),a},initTree:function(a,b){var b=b||this._configSetting();this.nodes=$.fn.zTree.init(this.tree.element,b,a)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={layer:b};if(BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.first_plus_group_node";break;case a.length-1:f.type="bi.last_plus_group_node";break;default:f.type="bi.mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.last_tree_leaf_item";break;default:f.type="bi.mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){BI.isKey(b.id)||(b.id=BI.UUID())})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},c.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),value:c.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},c.el)}),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.LevelTree.EVENT_CHANGE,c,d)})},stroke:function(a){this.tree.stroke.apply(this.tree,arguments)},populate:function(a,b){a=this._formatItems(BI.Tree.transformToTreeFormat(a),0),this.tree.populate(a,b)},setValue:function(a){this.tree.setValue(a)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var a=this,b=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(c,d){var e=function(b){d({items:b}),a.structure.initTree(BI.Tree.transformToTreeFormat(b))};BI.isNotNull(b.items)?e(b.items):b.itemsCreator(c,e)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(b.items)&&this.populate(),BI.isNotNull(b.value)&&this.setValue(b.value)},populate:function(a,b){a&&(this.options.items=a),this.tree.stroke({keyword:b})},_digest:function(a){a||(a=[]);var b=this,c={},d=[];return BI.each(a,function(a,e){var f=b.structure.search(e,"value");if(f){var g=f;for(g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++);g&&g.getChildrenLength()<=c[g.value];)d.push(g.value),g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++)}}),BI.makeObject(a.concat(d))},setValue:function(a){this.tree.setValue(this._digest(a))},_getValue:function(){var a=[],b=this.tree.getValue(),c=function(b){BI.each(b,function(b,d){BI.isEmpty(d)?a.push(b):c(d)})};return c(b),a},empty:function(){this.tree.empty()},getValue:function(){var a=this,b=[],c=this._getValue();return BI.each(c,function(c,d){var e=a.structure.search(d,"value");e&&a.structure._traverse(e,function(a){a.isLeaf()&&b.push(a.value)})}),b}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options;this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:b.triggerWidth||b.height},width:b.triggerWidth||b.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(a){this.editor.setValue(a)},setText:function(a){this.editor.setState(a)}}),BI.EditorTrigger.EVENT_CHANGE="BI.EditorTrigger.EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-trigger",el:{},height:24})},_init:function(){var a=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(a.el,{type:"bi.trigger_icon_button",element:this,width:a.width,height:a.height})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(b){a.wrapper=b},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon "+b.iconCls,ref:function(b){a.icon=b},iconHeight:b.iconHeight,iconWidth:b.iconWidth,disableSelected:!0},width:BI.isEmptyString(b.iconCls)?0:b.triggerWidth||b.height},{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setValue:function(a){this.text.setValue(a)},setIcon:function(a){var b=this.options;this.icon.setIcon(a);var c=this.wrapper.attr("items")[0];BI.isNull(a)||BI.isEmptyString(a)?0!==c.width&&(c.width=0,this.wrapper.resize()):c.width!==(b.triggerWidth||b.height)&&(c.width=b.triggerWidth||b.height,this.wrapper.resize())},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,defaultIconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digist(a.value,a.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:b.text,iconCls:b.iconCls,height:a.height,iconHeight:a.iconHeight,iconWidth:a.iconWidth})},_digist:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d,e=BI.Tree.transformToArrayFormat(b);return BI.any(e,function(b,c){if(BI.deepContains(a,c.value))return d={text:c.text||c.value,iconCls:c.iconCls},!0}),BI.isNotNull(d)?{text:d.text,iconCls:d.iconCls}:{text:c.text,iconCls:c.defaultIconCls}},setValue:function(a){var b=this._digist(a,this.options.items);this.trigger.setText(b.text),this.trigger.setIcon(b.iconCls)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,title:function(){return a.text.getText()},hgap:c.hgap,readonly:b.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setText:function(a){this.text.setText(a); -}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:a.height,readonly:a.readonly,text:this._digest(a.value,a.items)})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},setValue:function(a){this.trigger.setText(this._digest(a,this.options.items))},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digest(a.text,a.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:a.height-2,text:b.text,cls:b.cls})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?{cls:"",text:d.join(",")}:{cls:"bi-water-mark",text:c.text}},setValue:function(a){var b=this._digest(a,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(b.cls),this.trigger.setText(b.text)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:a.height,text:a.text,hgap:b.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:a.triggerWidth||a.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:a.triggerWidth||a.height}]})},setValue:function(a){this.text.setValue(a)},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.SequenceTableTreeNumber=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-sequence-table-tree-number",isNeedFreeze:!1,startSequence:1,scrollTop:0,headerRowSize:25,rowSize:25,sequenceHeaderCreator:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.SequenceTableTreeNumber.superclass._init.apply(this,arguments);this.options;this.vCurr=1,this.hCurr=1,this.tasks=[],this.renderedCells=[],this.renderedKeys=[],this.container=BI.createWidget({type:"bi.absolute",width:60,scrollable:!1}),this.scrollContainer=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.container]}),this.headerContainer=BI.createWidget({type:"bi.absolute",cls:"bi-border",width:58,scrollable:!1}),this.layout=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.headerContainer,height:this._getHeaderHeight()-2},{el:{type:"bi.layout"},height:2},{el:this.scrollContainer}]}),this.start=this.options.startSequence,this.cache={},this._nextState(),this._populate()},_getNextSequence:function(a){function b(a){c.cache[a.text||a.value]||(c.cache[a.text||a.value]=e),e++}var c=this,d=this.start,e=this.start;return BI.each(a,function(a,f){BI.isNotEmptyArray(f.children)&&BI.each(f.children,function(a,f){0===a&&c.cache[f.text||f.value]&&(d=e=c.cache[f.text||f.value]),b(f)})}),this.start=e,d},_getStart:function(a){var b=this,c=this.start;return BI.some(a,function(a,d){if(BI.isNotEmptyArray(d.children))return BI.some(d.children,function(a,d){if(0===a&&b.cache[d.text||d.value])return c=b.cache[d.text||d.value],!0})}),c},_formatNumber:function(a){function b(a){var c=0;return BI.isNotEmptyArray(a.children)?(BI.each(a.children,function(a,d){c+=b(d)}),BI.isNotEmptyArray(a.values)&&c++):c++,c}var c=this.options,d=[],e=this._getStart(a),f=0,g=0;return BI.each(a,function(a,h){BI.isArray(h.children)&&(BI.each(h.children,function(a,h){var i=b(h);d.push({text:e++,start:f,top:g,cnt:i,index:a,height:i*c.rowSize}),f+=i,g+=i*c.rowSize}),BI.isNotEmptyArray(h.values)&&(d.push({text:BI.i18nText("BI-Summary_Values"),start:f++,top:g,cnt:1,isSummary:!0,height:c.rowSize}),g+=c.rowSize))}),d},_layout:function(){var a=this.options,b=this._getHeaderHeight()-2,c=this.layout.attr("items");a.isNeedFreeze===!1?(c[0].height=0,c[1].height=0):a.isNeedFreeze===!0&&(c[0].height=b,c[1].height=2),this.layout.attr("items",c),this.layout.resize();try{this.scrollContainer.element.scrollTop(a.scrollTop)}catch(d){}},_getHeaderHeight:function(){var a=this.options;return a.headerRowSize*(a.crossHeader.length+(a.header.length>0?1:0))},_nextState:function(){var a=this.options;this._getNextSequence(a.items)},_prevState:function(){var a,b=this.options;BI.some(b.items,function(b,c){if(BI.isNotEmptyArray(c.children))return BI.some(c.children,function(b,c){return a=c,!0})}),a&&BI.isNotEmptyObject(this.cache)?this.start=this.cache[a.text||a.value]:this.start=1,this._nextState()},_getMaxScrollTop:function(a){var b=0;return BI.each(a,function(a,c){b+=c.cnt}),Math.max(0,b*this.options.rowSize-(this.options.height-this._getHeaderHeight())+BI.DOM.getScrollWidth())},_createHeader:function(){var a=this.options;BI.createWidget({type:"bi.absolute",element:this.headerContainer,items:[{el:a.sequenceHeaderCreator()||{type:"bi.table_style_cell",cls:"sequence-table-title-cell",height:this._getHeaderHeight()-2,styleGetter:a.headerCellStyleGetter,text:BI.i18nText("BI-Number_Index")},left:0,top:0,right:0,bottom:0}]})},_calculateChildrenToRender:function(){var a=this,b=this.options,c=[],d=[],e=this._formatNumber(b.items),f=BI.PrefixIntervalTree.uniform(e.length,0);BI.each(e,function(a,b){f.set(a,b.height)});for(var g=BI.clamp(b.scrollTop,0,this._getMaxScrollTop(e)),h=f.greatestLowerBound(g),i=-(g-(h>0?f.sumTo(h-1):0)),j=i,k=b.height-this._getHeaderHeight();j-1)e[f].height!==a.renderedCells[g]._height&&(a.renderedCells[g]._height=e[f].height,a.renderedCells[g].el.setHeight(e[f].height)),e[f].top!==a.renderedCells[g].top&&(a.renderedCells[g].top=e[f].top,a.renderedCells[g].el.element.css("top",e[f].top+"px")),c.push(a.renderedCells[g]);else{var h=BI.createWidget(BI.extend({type:"bi.table_style_cell",cls:"sequence-table-number-cell bi-border-left bi-border-right bi-border-bottom",width:60,styleGetter:e[f].isSummary===!0?function(){return b.summaryCellStyleGetter(!0)}:function(a){return function(){return b.sequenceCellStyleGetter(a)}}(e[f].index)},e[f]));c.push({el:h,left:0,top:e[f].top,_height:e[f].height})}});var l={},m={},n=[];BI.each(d,function(b,c){BI.deepContains(a.renderedKeys,c)?l[b]=c:m[b]=c}),BI.each(this.renderedKeys,function(a,b){BI.deepContains(l,b)||BI.deepContains(m,b)||n.push(a)}),BI.each(n,function(b,c){a.renderedCells[c].el.destroy()});var o=[];BI.each(m,function(a){o.push(c[a])}),BI.createWidget({type:"bi.absolute",element:this.container,items:o}),this.renderedCells=c,this.renderedKeys=d,this.container.setHeight(f.sumUntil(e.length))},_restore:function(){BI.each(this.renderedCells,function(a,b){b.el.destroy()}),this.renderedCells=[],this.renderedKeys=[]},_populate:function(){var a=this;BI.each(this.tasks,function(b,c){c.apply(a)}),this.tasks=[],this.headerContainer.empty(),this._createHeader(),this._layout(),this._calculateChildrenToRender()},setVerticalScroll:function(a){if(this.options.scrollTop!==a){this.options.scrollTop=a;try{this.scrollContainer.element.scrollTop(a)}catch(b){}}},getVerticalScroll:function(){return this.options.scrollTop},setVPage:function(a){a<=1?(this.cache={},this.start=this.options.startSequence,this._restore(),this.tasks.push(this._nextState)):a===this.vCurr+1?this.tasks.push(this._nextState):a===this.vCurr-1&&this.tasks.push(this._prevState),this.vCurr=a},setHPage:function(a){a!==this.hCurr&&this.tasks.push(this._prevState),this.hCurr=a},restore:function(){this._restore()},populate:function(a,b,c,d){var e=this.options;a&&a!==this.options.items&&(e.items=a,this._restore(),this.tasks.push(this._prevState)),b&&b!==this.options.header&&(e.header=b),c&&c!==this.options.crossItems&&(e.crossItems=c),d&&d!==this.options.crossHeader&&(e.crossHeader=d),this._populate()}}),BI.shortcut("bi.sequence_table_tree_number",BI.SequenceTableTreeNumber),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:25})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var a=this;this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup"}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:25})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:b.behaviors,min:b.min,max:b.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.doBehavior()})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-picker bi-background",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===a._month?a.setValue({year:a.year.getValue()-1,month:12}):a.setValue({year:a.year.getValue(),month:a.month.getValue()-1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===a._month?a.setValue({year:a.year.getValue()+1,month:1}):a.setValue({year:a.year.getValue(),month:a.month.getValue()+1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo"}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{type:"bi.horizontal",width:100,items:[this.year,this.month]}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var a=this.options,b=!(1===this._month&&this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(12===this._month&&this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a.year,this._month=a.month,this.year.setValue(a.year),this.month.setValue(a.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-year-picker bi-background",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()-1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()+1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,behaviors:b.behaviors,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue(a.year.getValue()),a.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[this.year]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a,this.year.setValue(a),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=b.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(a.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){a.selectedTime=a.datePicker.getValue(),a.selectedTime.day=1,a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)})},setValue:function(a){this.datePicker.setValue(a),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(a){var b=this.options,c=this._year,d=BI.createWidget({type:"bi.year_calendar",behaviors:b.behaviors,min:b.min,max:b.max,logic:{dynamic:!0},year:c+12*a});return d.setValue(this._year),d},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var c=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1}),d=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-border-top",height:25,items:[c,d]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(a.selectedYear);var b=this.getSelectedCard();c.setEnable(!b.isFrontYear()),d.setEnable(!b.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedYear=this.getValue(),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.fireEvent(BI.YearPopup.EVENT_CHANGE,a.selectedYear)}),BI.isKey(b.value)&&this.setValue(b.value)},getValue:function(){return this.selectedYear},setValue:function(a){var b=this.options;a=BI.parseInt(a),BI.checkDateVoid(a,1,1,b.min,b.max)[0]?(a=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue("")):(this.selectedYear=a,this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue(a))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:25,iconWidth:16,iconHeight:13},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:25})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:a.text,value:a.value,height:b.height}),this.icon=BI.createWidget({type:"bi.icon",width:b.iconWidth,height:b.iconHeight}),BI.createWidget({type:"bi.center_adapt",element:this,items:[{type:"bi.center_adapt",width:50,height:b.height,items:[this.text,this.icon]}]})},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()},setText:function(a){this.text.setText(a)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=b.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var b=a.datePicker.getValue(),c=BI.getDate(b.year,b.month-1,1).getMonthDays(),d=a.selectedTime.day||0;d>c&&(d=c),a.selectedTime={year:b.year,month:b.month},0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){this._setDatePicker(a),this._setCalendar(a)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDatePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDatePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateCombo.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border",width:200,height:24})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options,c=BI.getDate();this.storeValue=BI.isNotNull(b.value)?b.value:{year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate(),hour:c.getHours(),minute:c.getMinutes(),second:c.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),a.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){a.storeValue=a.popup.getValue(),a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var d=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font bi-border-right",width:24,height:24});d.on(BI.TriggerIconButton.EVENT_CHANGE,function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:d,top:0,left:0}]}]})},setValue:function(a){this.storeValue=a,this.popup.setValue(a),this.trigger.setValue(a)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max}),a.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateSelect=BI.createWidget({type:"bi.vertical_adapt",cls:"bi-border-top",items:[{type:"bi.label",text:BI.i18nText("BI-Basic_Time"),width:45},{type:"bi.date_time_select",max:23,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.hour=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.minute=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.second=b}}]}),this.setValue(b.value),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:this.dateSelect,height:50},{el:this.dateButton,height:30}]})},setValue:function(a){var b,c=a;BI.isNull(c)?(b=BI.getDate(),this.dateCombo.setValue({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}),this.hour.setValue(b.getHours()),this.minute.setValue(b.getMinutes()),this.second.setValue(b.getSeconds())):(this.dateCombo.setValue({year:c.year,month:c.month,day:c.day}),this.hour.setValue(c.hour),this.minute.setValue(c.minute),this.second.setValue(c.second))},getValue:function(){return{year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day,hour:this.hour.getValue(),minute:this.minute.getValue(),second:this.second.getValue()}}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeSelect=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimeSelect.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-select bi-border",max:23,min:0})},_init:function(){BI.DateTimeSelect.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",value:this._alertInEditorValue(b.min),allowBlank:!1,errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Please_Input_Natural_Number"):BI.i18nText("BI-Numerical_Interval_Input_Data")},validationChecker:function(a){return BI.isNaturalNumber(a)}}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){a._finetuning(0),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",cls:"column-pre-page-h-font top-button bi-border-left bi-border-bottom"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",cls:"column-next-page-h-font bottom-button bi-border-left"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(-1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this._finetuning(0),BI.createWidget({type:"bi.htape",element:this,items:[this.editor,{el:{type:"bi.grid",columns:1, -rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:30}]})},_alertOutEditorValue:function(a){return a>this.options.max&&(a=this.options.min),athis.options.max&&(a=this.options.min),ac&&(d=c),a.selectedTime=BI.extend(a.selectedTime,{year:b.year,month:b.month,day:d}),0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,items:[this.calendar,{el:{type:"bi.dynamic_date_time_select",ref:function(){a.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.fireEvent("EVENT_CHANGE")}}]},height:40}]}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=BI.extend({},this.timeSelect.getValue(),a)},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){a=a||{},this._setDatePicker(a),this._setCalendar(a),this.timeSelect.setValue({hour:a.hour,minute:a.minute,second:a.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDateTimePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateTimePane.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:a.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:a.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(a){this.downlistgroup.setValue(a)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:25,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,height:b.height,text:b.text,value:b.value,logic:b.logic,selected:b.selected,disabled:b.disabled,iconHeight:b.iconHeight,iconWidth:b.iconWidth,textHgap:b.textHgap,textVgap:b.textVgap,textLgap:b.textLgap,textRgap:b.textRgap,father:b.father,bubble:b.bubble}),this.text.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.IconTextItem.EVENT_CHANGE,function(){a.fireEvent(BI.DownListItem.EVENT_CHANGE)})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},isSelected:function(){return this.text.isSelected()},setSelected:function(a){this.text.setSelected(a)},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var a=this.options,b=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:a.text,value:a.value,height:a.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:a.iconCls1,width:25,forceNotSelected:!0,selected:this._digest(a.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:a.iconCls2,width:25,forceNotSelected:!0});var c=BI.createWidget({type:"bi.layout",width:25});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,c)})))),this.element.hover(function(){b.isEnabled()&&b.hover()},function(){b.isEnabled()&&b.dishover()})},_digest:function(a){var b=this.options;return a=BI.isArray(a)?a:[a],BI.any(a,function(a,c){return BI.contains(b.childValues,c)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(a){this.icon1.setSelected(this._digest(a))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var a=this,b=this.options,c=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])?(d=a.childValueMap[b],a.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,d,a.fatherValueMap[b])):a.fireEvent(BI.DownListPopup.EVENT_CHANGE,d,c),!a.singleValues.contains(d)){var e=a.getValue(),f=[];BI.each(e,function(a,b){b.value!=d&&f.push(b)}),a.setValue(f)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createChildren:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},maxHeight:378},c.el.childValues=[],BI.each(c.children,function(a,d){var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value)})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a0?1:0}},setValue:function(a){a=a||{},this.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT;var b=[],c=[];BI.isNotNull(a.year)&&(b.push(BI.DynamicDateCard.TYPE.YEAR),c.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,a.year))),BI.isNotNull(a.quarter)&&(b.push(BI.DynamicDateCard.TYPE.QUARTER),c.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,a.quarter))),BI.isNotNull(a.month)&&(b.push(BI.DynamicDateCard.TYPE.MONTH),c.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,a.month))),BI.isNotNull(a.week)&&(b.push(BI.DynamicDateCard.TYPE.WEEK),c.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,a.week))),BI.isNotNull(a.day)&&(b.push(BI.DynamicDateCard.TYPE.DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,a.day))),BI.isNotNull(a.workDay)&&(b.push(BI.DynamicDateCard.TYPE.WORK_DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,a.workDay))),this.checkgroup.setValue(b),this.workDayBox.setSelected(BI.isNotNull(a.workDay)),this.resultPane.populate(this._getParamJson(c,a.position))},getValue:function(){var a=this,b={},c=this.checkgroup.getValue(),d=this.resultPane.getAllButtons();if(0!==c.length&&BI.each(d,function(c,d){var e=d.getValue();switch(e.dateType){case BI.DynamicDateCard.TYPE.YEAR:b.year=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.QUARTER:b.quarter=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.MONTH:b.month=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.WEEK:b.week=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.DAY:b.day=0===e.offset?-e.value:e.value}BI.isNull(e.dateType)&&(b.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var e=d[0].getValue();b.workDay=0===e.offset?-e.value:e.value}return b}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(a){return BI.isNaturalNumber(a)},value:b.value,ref:function(){a.editor=this},errorText:function(a){return BI.isEmptyString(a)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Positive_Integer")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:b.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){a.offsetCombo=this},value:b.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var a="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:a=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:a=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:a=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:a=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:a=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:a=BI.i18nText("BI-Basic_Work_Day")}return a},setValue:function(a){a=a||{},a.value=a.value||0,a.offset=a.offset||0,this.editor.setValue(a.value),this.offsetCombo.setValue(a.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(), +this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},setWidth:function(a){BI.LayerTreeTable.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.LayerTreeTable.superclass.setHeight.apply(this,arguments),this.table.setHeight(a)},setColumnSize:function(a){this.options.columnSize=a},getColumnSize:function(){var a=this.table.getColumnSize(),b=this._getHDeep(),c=[];return b>0&&(c=BI.makeArray(b,a[0]/b)),c.concat(a.slice(1))},setRegionColumnSize:function(a){this.options.regionColumnSize=a,this.table.setRegionColumnSize(a)},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(a,b){var c=this;if(BI.isObject(a))return void BI.each(a,function(a,b){c.attr(a,b)});switch(BI.LayerTreeTable.superclass.attr.apply(this,arguments),a){case"columnSize":case"minColumnSize":case"maxColumnSize":case"freezeCols":case"mergeCols":return}this.table.attr.apply(this.table,[a,b])},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;e.items=a||[],b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.setColumnSize(f.columnSize),this.table.attr("freezeCols",f.freezeCols),this.table.attr("minColumnSize",f.minColumnSize),this.table.attr("maxColumnSize",f.maxColumnSize),this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.LayerTreeTable.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.layer_tree_table",BI.LayerTreeTable),BI.TableStyleCell=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TableStyleCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-style-cell",styleGetter:BI.emptyFn})},_init:function(){BI.TableStyleCell.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,height:a.height,textAlign:"left",forceCenter:!0,hgap:5,text:a.text}),this._digestStyle()},_digestStyle:function(){var a=this.options,b=a.styleGetter();b&&this.text.element.css(b)},setText:function(a){this.text.setText(a)},populate:function(){this._digestStyle()}}),BI.shortcut("bi.table_style_cell",BI.TableStyleCell),BI.TableTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TableTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-tree",el:{type:"bi.resizable_table"},isNeedResize:!0,isResizeAdapt:!0,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_init:function(){BI.TableTree.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._digest();this.table=BI.createWidget(b.el,{type:"bi.resizable_table",element:this,width:b.width,height:b.height,isNeedResize:b.isNeedResize,isResizeAdapt:b.isResizeAdapt,isNeedFreeze:b.isNeedFreeze,freezeCols:b.freezeCols,isNeedMerge:b.isNeedMerge,mergeCols:b.mergeCols,mergeRule:b.mergeRule,columnSize:b.columnSize,minColumnSize:b.minColumnSize,maxColumnSize:b.maxColumnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:b.regionColumnSize,header:c.header,items:c.items}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_digest:function(){var a=this.options,b=this._getHDeep(),c=this._getVDeep(),d=BI.TableTree.formatHeader(a.header,a.crossHeader,a.crossItems,b,c,a.headerCellStyleGetter),e=BI.TableTree.formatItems(a.items,b,!1,a.summaryCellStyleGetter);return{header:d,items:e}},setWidth:function(a){BI.TableTree.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.TableTree.superclass.setHeight.apply(this,arguments),this.table.setHeight(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()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(){BI.TableTree.superclass.attr.apply(this,arguments),this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;a&&(e.items=a||[]),b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.TableTree.superclass.destroy.apply(this,arguments)}}),BI.extend(BI.TableTree,{formatHeader:function(a,b,c,d,e,f){for(var g=BI.TableTree.formatCrossItems(c,e,f),h=[],i=0;i0&&h.push(a),h},formatItems:function(a,b,c,d){function e(a,g){var h;if(BI.isArray(g.children)){if(BI.each(g.children,function(b,c){var d;a!=-1?(d=a.slice(),d.push(g)):d=[],e(d,c)}),a!=-1?(h=a.slice(),h.push(g)):h=[],BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e0},halfSelected:!1})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var a=this,b=this.options,c=b.selected===!0,d=!b.selected&&b.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){a.setSelected(a.isSelected())},selected:c,invisible:d}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){a.setSelected(!0)},invisible:c||!d}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.text=BI.createWidget({type:"bi.label",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({type:"bi.htape",element:this,items:[{width:36,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(a){this.checkbox.setSelected(!!a)},beforeClick:function(){var a=this.isHalfSelected(),b=this.isSelected();a===!0?this.setSelected(!0):this.setSelected(!b)},setSelected:function(a){this.checkbox.setSelected(a),this.setHalfSelected(!1)},setHalfSelected:function(a){this.halfSelected=!!a,a===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(a){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var b=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(b),!b&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE)}}),BI.MultiSelectBar.EVENT_CHANGE="MultiSelectBar.EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.BranchRelation=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-relation-tree",items:[],centerOffset:0,direction:BI.Direction.Bottom,align:BI.VerticalAlign.Top})},_init:function(){BI.BranchRelation.superclass._init.apply(this,arguments),this.populate(this.options.items)},_stratification:function(){var a=[];return this.tree.recursion(function(b,c){b.leaf=b.isLeaf(),a[c.length-1]||(a[c.length-1]=[]),a[c.length-1].push(b)}),a},_calculateLeaves:function(){function a(b){var c=0;return b.isLeaf()?1:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),b.set("leaves",c),c)}var b=0;return b=a(this.tree.getRoot())},_translate:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,g);var k=g.parent.getChildIndex(g.id);g.parent.removeChildByIndex(k),g.parent.addChild(h,k),h.addChild(g),b[d].push(h),e[f]=h}else b[d].push(g)})}),b},_fill:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,h),g.addChild(h)}b[d].push(g)})}),b},_adjust:function(a){for(;;){var b=!1;if(BI.backEach(a,function(a,c){BI.each(c,function(a,c){if(!c.isNew){var d=!0;if(BI.any(c.getChildren(),function(a,b){if(!b.isNew)return d=!1,!0}),!c.isLeaf()&&d===!0){var e=[];BI.each(c.getChildren(),function(a,b){e=e.concat(b.getChildren())}),c.removeAllChilds(),BI.each(e,function(a,b){c.addChild(b)});var f=new BI.Node(BI.UUID());f.isNew=!0;var g=c.parent.getChildIndex(c.id);c.parent.removeChildByIndex(g),c.parent.addChild(f,g),f.addChild(c),b=!0}}})}),b===!1)break;a=this._stratification()}return a},_calculateWidth:function(){function a(b){var c=0;return b.isLeaf()?b.width:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),c)}function b(a){var c=0;return a.isLeaf()?a.height:(BI.each(a.getChildren(),function(a,d){c+=b(d)}),c)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_isVertical:function(){var a=this.options;return a.direction===BI.Direction.Top||a.direction===BI.Direction.Bottom},_calculateHeight:function(){function a(b){var c=0;return BI.each(b.getChildren(),function(b,d){c=Math.max(c,a(d))}),c+(b.height||0)}function b(a){var c=0;return BI.each(a.getChildren(),function(a,d){c=Math.max(c,b(d))}),c+(a.width||0)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_calculateXY:function(a){var b=(this.options,this._calculateWidth()),c=this._calculateHeight(),d=a.length,e=this._calculateLeaves(),f={},g=c/d;return BI.each(a,function(a,c){var d=[];BI.each(c,function(a,b){d[a]=(b.get("leaves")||1)/e}),BI.each(c,function(c,e){var h=BI.sum(d.slice(0,c)),i=h*b+d[c]*b/2,j=a*g+g/2;f[e.id]={x:i,y:j}})}),f},_stroke:function(a,b){var c=this._calculateHeight(),d=a.length,e=c/d,f=this,g=this.options;switch(g.direction){case BI.Direction.Top:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+h.x+","+(h.y+g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y+g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Bottom:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+h.x+","+(h.y-g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y-g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Left:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+(h.y+g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y+g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Right:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+(h.y-g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y-g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})})}},_createBranches:function(a){var b=this.options;b.direction!==BI.Direction.Bottom&&b.direction!==BI.Direction.Right||(a=a.reverse());var c=this._calculateXY(a);this._stroke(a,c)},_isNeedAdjust:function(){var a=this.options;return a.direction===BI.Direction.Top&&a.align===BI.VerticalAlign.Bottom||a.direction===BI.Direction.Bottom&&a.align===BI.VerticalAlign.Top||a.direction===BI.Direction.Left&&a.align===BI.HorizontalAlign.Right||a.direction===BI.Direction.Right&&a.align===BI.HorizontalAlign.Left},setValue:function(a){},getValue:function(){},populate:function(a){var b=this.options;b.items=a||[],this.empty(),a=BI.Tree.transformToTreeFormat(b.items),this.tree=new BI.Tree,this.tree.initTree(a),this.svg=BI.createWidget({type:"bi.svg"});var c=this._stratification();if(this._isNeedAdjust()){var d=this._translate(c);d=this._adjust(d),this._createBranches(d)}else{var d=this._fill(c);this._createBranches(d)}var e=BI.createWidget({type:"bi.layout",width:this._isVertical()?this._calculateWidth():this._calculateHeight(),height:this._isVertical()?this._calculateHeight():this._calculateWidth()});BI.createWidget({type:"bi.absolute",element:e,items:[{el:this.svg,top:0,left:0,right:0,bottom:0}]}),a=this._isVertical()?[{type:"bi.handstand_branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.horizontal_adapt",verticalAlign:b.align}]},items:a}]:[{type:"bi.branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.vertical"},{type:b.align===BI.HorizontalAlign.Left?"bi.left":"bi.right"}]},items:a}],BI.createWidget({type:"bi.adaptive",element:e,items:a}),BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[e]})}}),BI.BranchRelation.EVENT_CHANGE="BranchRelation.EVENT_CHANGE",BI.shortcut("bi.branch_relation",BI.BranchRelation),BI.HandStandBranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-expander",direction:BI.Direction.Top,logic:{dynamic:!0},el:{type:"bi.label"},popup:{}})},_init:function(){BI.HandStandBranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,{type:"bi.center_adapt",items:[this.expander]},this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.HandStandBranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_expander",BI.HandStandBranchExpander),BI.BranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-expander",direction:BI.Direction.Left,logic:{dynamic:!0},el:{},popup:{}})},_init:function(){BI.BranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,this.expander,this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el,{type:"bi.label",width:30,height:"100%"}),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.BranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_expander",BI.BranchExpander),BI.HandStandBranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.HandStandBranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.handstand_branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.horizontal_adapt"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.HandStandBranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_tree",BI.HandStandBranchTree),BI.BranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.BranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.BranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.BranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_tree",BI.BranchTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function a(a,b){return!1}var b={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:a}};return b},_dealWidthNodes:function(a){a=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(a,function(a,b){null==b.text&&b.count>0&&(b.text=b.value+"("+BI.i18nText("BI-Basic_Altogether")+b.count+BI.i18nText("BI-Basic_Count")+")")}),a},initTree:function(a,b){var b=b||this._configSetting();this.nodes=$.fn.zTree.init(this.tree.element,b,a)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={layer:b};if(BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.first_plus_group_node";break;case a.length-1:f.type="bi.last_plus_group_node";break;default:f.type="bi.mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.last_tree_leaf_item";break;default:f.type="bi.mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){BI.isKey(b.id)||(b.id=BI.UUID())})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},c.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),value:c.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},c.el)}),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.LevelTree.EVENT_CHANGE,c,d)})},stroke:function(a){this.tree.stroke.apply(this.tree,arguments)},populate:function(a,b){a=this._formatItems(BI.Tree.transformToTreeFormat(a),0),this.tree.populate(a,b)},setValue:function(a){this.tree.setValue(a)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var a=this,b=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(c,d){var e=function(b){d({items:b}),a.structure.initTree(BI.Tree.transformToTreeFormat(b))};BI.isNotNull(b.items)?e(b.items):b.itemsCreator(c,e)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(b.items)&&this.populate(),BI.isNotNull(b.value)&&this.setValue(b.value)},populate:function(a,b){a&&(this.options.items=a),this.tree.stroke({keyword:b})},_digest:function(a){a||(a=[]);var b=this,c={},d=[];return BI.each(a,function(a,e){var f=b.structure.search(e,"value");if(f){var g=f;for(g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++);g&&g.getChildrenLength()<=c[g.value];)d.push(g.value),g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++)}}),BI.makeObject(a.concat(d))},setValue:function(a){this.tree.setValue(this._digest(a))},_getValue:function(){var a=[],b=this.tree.getValue(),c=function(b){BI.each(b,function(b,d){BI.isEmpty(d)?a.push(b):c(d)})};return c(b),a},empty:function(){this.tree.empty()},getValue:function(){var a=this,b=[],c=this._getValue();return BI.each(c,function(c,d){var e=a.structure.search(d,"value");e&&a.structure._traverse(e,function(a){a.isLeaf()&&b.push(a.value)})}),b}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options;this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:b.triggerWidth||b.height},width:b.triggerWidth||b.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(a){this.editor.setValue(a)},setText:function(a){this.editor.setState(a)}}),BI.EditorTrigger.EVENT_CHANGE="BI.EditorTrigger.EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-trigger",el:{},height:24})},_init:function(){var a=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(a.el,{type:"bi.trigger_icon_button",element:this,width:a.width,height:a.height})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(b){a.wrapper=b},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon "+b.iconCls,ref:function(b){a.icon=b},iconHeight:b.iconHeight,iconWidth:b.iconWidth,disableSelected:!0},width:BI.isEmptyString(b.iconCls)?0:b.triggerWidth||b.height},{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setValue:function(a){this.text.setValue(a)},setIcon:function(a){var b=this.options;this.icon.setIcon(a);var c=this.wrapper.attr("items")[0];BI.isNull(a)||BI.isEmptyString(a)?0!==c.width&&(c.width=0,this.wrapper.resize()):c.width!==(b.triggerWidth||b.height)&&(c.width=b.triggerWidth||b.height,this.wrapper.resize())},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digist(a.value,a.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:b.text,iconCls:b.iconCls,height:a.height,iconHeight:a.iconHeight,iconWidth:a.iconWidth})},_digist:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d,e=BI.Tree.transformToArrayFormat(b);return BI.any(e,function(b,c){if(BI.deepContains(a,c.value))return d={text:c.text||c.value,iconCls:c.iconCls},!0}),BI.isNotNull(d)?{text:d.text,iconCls:d.iconCls}:{text:c.text,iconCls:c.iconCls}},setValue:function(a){var b=this._digist(a,this.options.items);this.trigger.setText(b.text),this.trigger.setIcon(b.iconCls)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,title:function(){return a.text.getText()},hgap:c.hgap,readonly:b.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setText:function(a){this.text.setText(a)} +}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:a.height,readonly:a.readonly,text:this._digest(a.value,a.items)})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},setValue:function(a){this.trigger.setText(this._digest(a,this.options.items))},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digest(a.text,a.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:a.height-2,text:b.text,cls:b.cls})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?{cls:"",text:d.join(",")}:{cls:"bi-water-mark",text:c.text}},setValue:function(a){var b=this._digest(a,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(b.cls),this.trigger.setText(b.text)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:a.height,text:a.text,hgap:b.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:a.triggerWidth||a.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:a.triggerWidth||a.height}]})},setValue:function(a){this.text.setValue(a)},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.SequenceTableTreeNumber=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-sequence-table-tree-number",isNeedFreeze:!1,startSequence:1,scrollTop:0,headerRowSize:25,rowSize:25,sequenceHeaderCreator:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.SequenceTableTreeNumber.superclass._init.apply(this,arguments);this.options;this.vCurr=1,this.hCurr=1,this.tasks=[],this.renderedCells=[],this.renderedKeys=[],this.container=BI.createWidget({type:"bi.absolute",width:60,scrollable:!1}),this.scrollContainer=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.container]}),this.headerContainer=BI.createWidget({type:"bi.absolute",cls:"bi-border",width:58,scrollable:!1}),this.layout=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.headerContainer,height:this._getHeaderHeight()-2},{el:{type:"bi.layout"},height:2},{el:this.scrollContainer}]}),this.start=this.options.startSequence,this.cache={},this._nextState(),this._populate()},_getNextSequence:function(a){function b(a){c.cache[a.text||a.value]||(c.cache[a.text||a.value]=e),e++}var c=this,d=this.start,e=this.start;return BI.each(a,function(a,f){BI.isNotEmptyArray(f.children)&&BI.each(f.children,function(a,f){0===a&&c.cache[f.text||f.value]&&(d=e=c.cache[f.text||f.value]),b(f)})}),this.start=e,d},_getStart:function(a){var b=this,c=this.start;return BI.some(a,function(a,d){if(BI.isNotEmptyArray(d.children))return BI.some(d.children,function(a,d){if(0===a&&b.cache[d.text||d.value])return c=b.cache[d.text||d.value],!0})}),c},_formatNumber:function(a){function b(a){var c=0;return BI.isNotEmptyArray(a.children)?(BI.each(a.children,function(a,d){c+=b(d)}),BI.isNotEmptyArray(a.values)&&c++):c++,c}var c=this.options,d=[],e=this._getStart(a),f=0,g=0;return BI.each(a,function(a,h){BI.isArray(h.children)&&(BI.each(h.children,function(a,h){var i=b(h);d.push({text:e++,start:f,top:g,cnt:i,index:a,height:i*c.rowSize}),f+=i,g+=i*c.rowSize}),BI.isNotEmptyArray(h.values)&&(d.push({text:BI.i18nText("BI-Summary_Values"),start:f++,top:g,cnt:1,isSummary:!0,height:c.rowSize}),g+=c.rowSize))}),d},_layout:function(){var a=this.options,b=this._getHeaderHeight()-2,c=this.layout.attr("items");a.isNeedFreeze===!1?(c[0].height=0,c[1].height=0):a.isNeedFreeze===!0&&(c[0].height=b,c[1].height=2),this.layout.attr("items",c),this.layout.resize();try{this.scrollContainer.element.scrollTop(a.scrollTop)}catch(d){}},_getHeaderHeight:function(){var a=this.options;return a.headerRowSize*(a.crossHeader.length+(a.header.length>0?1:0))},_nextState:function(){var a=this.options;this._getNextSequence(a.items)},_prevState:function(){var a,b=this.options;BI.some(b.items,function(b,c){if(BI.isNotEmptyArray(c.children))return BI.some(c.children,function(b,c){return a=c,!0})}),a&&BI.isNotEmptyObject(this.cache)?this.start=this.cache[a.text||a.value]:this.start=1,this._nextState()},_getMaxScrollTop:function(a){var b=0;return BI.each(a,function(a,c){b+=c.cnt}),Math.max(0,b*this.options.rowSize-(this.options.height-this._getHeaderHeight())+BI.DOM.getScrollWidth())},_createHeader:function(){var a=this.options;BI.createWidget({type:"bi.absolute",element:this.headerContainer,items:[{el:a.sequenceHeaderCreator()||{type:"bi.table_style_cell",cls:"sequence-table-title-cell",height:this._getHeaderHeight()-2,styleGetter:a.headerCellStyleGetter,text:BI.i18nText("BI-Number_Index")},left:0,top:0,right:0,bottom:0}]})},_calculateChildrenToRender:function(){var a=this,b=this.options,c=[],d=[],e=this._formatNumber(b.items),f=BI.PrefixIntervalTree.uniform(e.length,0);BI.each(e,function(a,b){f.set(a,b.height)});for(var g=BI.clamp(b.scrollTop,0,this._getMaxScrollTop(e)),h=f.greatestLowerBound(g),i=-(g-(h>0?f.sumTo(h-1):0)),j=i,k=b.height-this._getHeaderHeight();j-1)e[f].height!==a.renderedCells[g]._height&&(a.renderedCells[g]._height=e[f].height,a.renderedCells[g].el.setHeight(e[f].height)),e[f].top!==a.renderedCells[g].top&&(a.renderedCells[g].top=e[f].top,a.renderedCells[g].el.element.css("top",e[f].top+"px")),c.push(a.renderedCells[g]);else{var h=BI.createWidget(BI.extend({type:"bi.table_style_cell",cls:"sequence-table-number-cell bi-border-left bi-border-right bi-border-bottom",width:60,styleGetter:e[f].isSummary===!0?function(){return b.summaryCellStyleGetter(!0)}:function(a){return function(){return b.sequenceCellStyleGetter(a)}}(e[f].index)},e[f]));c.push({el:h,left:0,top:e[f].top,_height:e[f].height})}});var l={},m={},n=[];BI.each(d,function(b,c){BI.deepContains(a.renderedKeys,c)?l[b]=c:m[b]=c}),BI.each(this.renderedKeys,function(a,b){BI.deepContains(l,b)||BI.deepContains(m,b)||n.push(a)}),BI.each(n,function(b,c){a.renderedCells[c].el.destroy()});var o=[];BI.each(m,function(a){o.push(c[a])}),BI.createWidget({type:"bi.absolute",element:this.container,items:o}),this.renderedCells=c,this.renderedKeys=d,this.container.setHeight(f.sumUntil(e.length))},_restore:function(){BI.each(this.renderedCells,function(a,b){b.el.destroy()}),this.renderedCells=[],this.renderedKeys=[]},_populate:function(){var a=this;BI.each(this.tasks,function(b,c){c.apply(a)}),this.tasks=[],this.headerContainer.empty(),this._createHeader(),this._layout(),this._calculateChildrenToRender()},setVerticalScroll:function(a){if(this.options.scrollTop!==a){this.options.scrollTop=a;try{this.scrollContainer.element.scrollTop(a)}catch(b){}}},getVerticalScroll:function(){return this.options.scrollTop},setVPage:function(a){a<=1?(this.cache={},this.start=this.options.startSequence,this._restore(),this.tasks.push(this._nextState)):a===this.vCurr+1?this.tasks.push(this._nextState):a===this.vCurr-1&&this.tasks.push(this._prevState),this.vCurr=a},setHPage:function(a){a!==this.hCurr&&this.tasks.push(this._prevState),this.hCurr=a},restore:function(){this._restore()},populate:function(a,b,c,d){var e=this.options;a&&a!==this.options.items&&(e.items=a,this._restore(),this.tasks.push(this._prevState)),b&&b!==this.options.header&&(e.header=b),c&&c!==this.options.crossItems&&(e.crossItems=c),d&&d!==this.options.crossHeader&&(e.crossHeader=d),this._populate()}}),BI.shortcut("bi.sequence_table_tree_number",BI.SequenceTableTreeNumber),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:25})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var a=this;this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup"}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:25})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:b.behaviors,min:b.min,max:b.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.doBehavior()})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-picker bi-background",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===a._month?a.setValue({year:a.year.getValue()-1,month:12}):a.setValue({year:a.year.getValue(),month:a.month.getValue()-1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===a._month?a.setValue({year:a.year.getValue()+1,month:1}):a.setValue({year:a.year.getValue(),month:a.month.getValue()+1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo"}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{type:"bi.horizontal",width:100,items:[this.year,this.month]}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var a=this.options,b=!(1===this._month&&this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(12===this._month&&this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a.year,this._month=a.month,this.year.setValue(a.year),this.month.setValue(a.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-year-picker bi-background",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()-1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()+1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,behaviors:b.behaviors,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue(a.year.getValue()),a.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[this.year]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a,this.year.setValue(a),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=b.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(a.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){a.selectedTime=a.datePicker.getValue(),a.selectedTime.day=1,a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)})},setValue:function(a){this.datePicker.setValue(a),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(a){var b=this.options,c=this._year,d=BI.createWidget({type:"bi.year_calendar",behaviors:b.behaviors,min:b.min,max:b.max,logic:{dynamic:!0},year:c+12*a});return d.setValue(this._year),d},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var c=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1}),d=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-border-top",height:25,items:[c,d]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(a.selectedYear);var b=this.getSelectedCard();c.setEnable(!b.isFrontYear()),d.setEnable(!b.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedYear=this.getValue(),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.fireEvent(BI.YearPopup.EVENT_CHANGE,a.selectedYear)}),BI.isKey(b.value)&&this.setValue(b.value)},getValue:function(){return this.selectedYear},setValue:function(a){var b=this.options;a=BI.parseInt(a),BI.checkDateVoid(a,1,1,b.min,b.max)[0]?(a=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue("")):(this.selectedYear=a,this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue(a))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:25,iconWidth:16,iconHeight:13},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:25})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:a.text,value:a.value,height:b.height}),this.icon=BI.createWidget({type:"bi.icon",width:b.iconWidth,height:b.iconHeight}),BI.createWidget({type:"bi.center_adapt",element:this,items:[{type:"bi.center_adapt",width:50,height:b.height,items:[this.text,this.icon]}]})},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()},setText:function(a){this.text.setText(a)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=b.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var b=a.datePicker.getValue(),c=BI.getDate(b.year,b.month-1,1).getMonthDays(),d=a.selectedTime.day||0;d>c&&(d=c),a.selectedTime={year:b.year,month:b.month},0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){this._setDatePicker(a),this._setCalendar(a)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDatePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDatePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateCombo.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border",width:200,height:24})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options,c=BI.getDate();this.storeValue=BI.isNotNull(b.value)?b.value:{year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate(),hour:c.getHours(),minute:c.getMinutes(),second:c.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),a.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){a.storeValue=a.popup.getValue(),a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var d=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font bi-border-right",width:24,height:24});d.on(BI.TriggerIconButton.EVENT_CHANGE,function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:d,top:0,left:0}]}]})},setValue:function(a){this.storeValue=a,this.popup.setValue(a),this.trigger.setValue(a)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max}),a.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateSelect=BI.createWidget({type:"bi.vertical_adapt",cls:"bi-border-top",items:[{type:"bi.label",text:BI.i18nText("BI-Basic_Time"),width:45},{type:"bi.date_time_select",max:23,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.hour=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.minute=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.second=b}}]}),this.setValue(b.value),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:this.dateSelect,height:50},{el:this.dateButton,height:30}]})},setValue:function(a){var b,c=a;BI.isNull(c)?(b=BI.getDate(),this.dateCombo.setValue({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}),this.hour.setValue(b.getHours()),this.minute.setValue(b.getMinutes()),this.second.setValue(b.getSeconds())):(this.dateCombo.setValue({year:c.year,month:c.month,day:c.day}),this.hour.setValue(c.hour),this.minute.setValue(c.minute),this.second.setValue(c.second))},getValue:function(){return{year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day,hour:this.hour.getValue(),minute:this.minute.getValue(),second:this.second.getValue()}}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeSelect=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimeSelect.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-select bi-border",max:23,min:0})},_init:function(){BI.DateTimeSelect.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",value:this._alertInEditorValue(b.min),allowBlank:!1,errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Please_Input_Natural_Number"):BI.i18nText("BI-Numerical_Interval_Input_Data")},validationChecker:function(a){return BI.isNaturalNumber(a)}}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){a._finetuning(0),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",cls:"column-pre-page-h-font top-button bi-border-left bi-border-bottom"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",cls:"column-next-page-h-font bottom-button bi-border-left"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(-1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this._finetuning(0),BI.createWidget({type:"bi.htape",element:this,items:[this.editor,{el:{type:"bi.grid",columns:1, +rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:30}]})},_alertOutEditorValue:function(a){return a>this.options.max&&(a=this.options.min),athis.options.max&&(a=this.options.min),ac&&(d=c),a.selectedTime=BI.extend(a.selectedTime,{year:b.year,month:b.month,day:d}),0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,items:[this.calendar,{el:{type:"bi.dynamic_date_time_select",ref:function(){a.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.fireEvent("EVENT_CHANGE")}}]},height:40}]}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=BI.extend({},this.timeSelect.getValue(),a)},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){a=a||{},this._setDatePicker(a),this._setCalendar(a),this.timeSelect.setValue({hour:a.hour,minute:a.minute,second:a.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDateTimePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateTimePane.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:a.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:a.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(a){this.downlistgroup.setValue(a)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:25,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,height:b.height,text:b.text,value:b.value,logic:b.logic,selected:b.selected,disabled:b.disabled,iconHeight:b.iconHeight,iconWidth:b.iconWidth,textHgap:b.textHgap,textVgap:b.textVgap,textLgap:b.textLgap,textRgap:b.textRgap,father:b.father,bubble:b.bubble}),this.text.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.IconTextItem.EVENT_CHANGE,function(){a.fireEvent(BI.DownListItem.EVENT_CHANGE)})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},isSelected:function(){return this.text.isSelected()},setSelected:function(a){this.text.setSelected(a)},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var a=this.options,b=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:a.text,value:a.value,height:a.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:a.iconCls1,width:25,forceNotSelected:!0,selected:this._digest(a.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:a.iconCls2,width:25,forceNotSelected:!0});var c=BI.createWidget({type:"bi.layout",width:25});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,c)})))),this.element.hover(function(){b.isEnabled()&&b.hover()},function(){b.isEnabled()&&b.dishover()})},_digest:function(a){var b=this.options;return a=BI.isArray(a)?a:[a],BI.any(a,function(a,c){return BI.contains(b.childValues,c)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(a){this.icon1.setSelected(this._digest(a))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var a=this,b=this.options,c=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])?(d=a.childValueMap[b],a.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,d,a.fatherValueMap[b])):a.fireEvent(BI.DownListPopup.EVENT_CHANGE,d,c),!a.singleValues.contains(d)){var e=a.getValue(),f=[];BI.each(e,function(a,b){b.value!=d&&f.push(b)}),a.setValue(f)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createChildren:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},maxHeight:378},c.el.childValues=[],BI.each(c.children,function(a,d){var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value)})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a0?1:0}},setValue:function(a){a=a||{},this.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT;var b=[],c=[];BI.isNotNull(a.year)&&(b.push(BI.DynamicDateCard.TYPE.YEAR),c.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,a.year))),BI.isNotNull(a.quarter)&&(b.push(BI.DynamicDateCard.TYPE.QUARTER),c.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,a.quarter))),BI.isNotNull(a.month)&&(b.push(BI.DynamicDateCard.TYPE.MONTH),c.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,a.month))),BI.isNotNull(a.week)&&(b.push(BI.DynamicDateCard.TYPE.WEEK),c.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,a.week))),BI.isNotNull(a.day)&&(b.push(BI.DynamicDateCard.TYPE.DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,a.day))),BI.isNotNull(a.workDay)&&(b.push(BI.DynamicDateCard.TYPE.WORK_DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,a.workDay))),this.checkgroup.setValue(b),this.workDayBox.setSelected(BI.isNotNull(a.workDay)),this.resultPane.populate(this._getParamJson(c,a.position))},getValue:function(){var a=this,b={},c=this.checkgroup.getValue(),d=this.resultPane.getAllButtons();if(0!==c.length&&BI.each(d,function(c,d){var e=d.getValue();switch(e.dateType){case BI.DynamicDateCard.TYPE.YEAR:b.year=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.QUARTER:b.quarter=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.MONTH:b.month=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.WEEK:b.week=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.DAY:b.day=0===e.offset?-e.value:e.value}BI.isNull(e.dateType)&&(b.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var e=d[0].getValue();b.workDay=0===e.offset?-e.value:e.value}return b}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(a){return BI.isNaturalNumber(a)},value:b.value,ref:function(){a.editor=this},errorText:function(a){return BI.isEmptyString(a)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Positive_Integer")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:b.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){a.offsetCombo=this},value:b.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var a="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:a=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:a=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:a=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:a=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:a=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:a=BI.i18nText("BI-Basic_Work_Day")}return a},setValue:function(a){a=a||{},a.value=a.value||0,a.offset=a.offset||0,this.editor.setValue(a.value),this.offsetCombo.setValue(a.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(), offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){a.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(b){var c=b.match(/\d+/g);return a._autoAppend(b,c),a._dateCheck(b)&&BI.checkDateLegal(b)&&a._checkVoid({year:0|c[0],month:0|c[1],day:0|c[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){return a.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")},title:function(){var b=a.storeValue||{},c=b.type||BI.DynamicDateCombo.Static,d=b.value;switch(c){case BI.DynamicDateCombo.Dynamic:var e=a._getText(d),f=BI.getDate();f=BI.DynamicDateHelper.getCalculation(d);var g=f.print("%Y-%x-%e");return BI.isEmptyString(e)?g:e+":"+g;case BI.DynamicDateCombo.Static:default:return BI.isNull(d)||BI.isNull(d.day)?"":BI.getDate(d.year,d.month-1,d.day).print("%Y-%X-%d")}}}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();if(BI.isNotNull(b)&&a.editor.setState(b),BI.isNotEmptyString(b)){var c=b.split("-");a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|c[0],month:0|c[1],day:0|c[2]}}}a.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){a.editor.isValid()&&a.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:30}]}),this.setValue(b.value)},_dateCheck:function(a){return BI.parseDateTime(a,"%Y-%x-%d").print("%Y-%x-%d")===a||BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d")===a||BI.parseDateTime(a,"%Y-%x-%e").print("%Y-%x-%e")===a||BI.parseDateTime(a,"%Y-%X-%e").print("%Y-%X-%e")===a},_checkVoid:function(a){return!BI.checkDateVoid(a.year,a.month,a.day,this.options.min,this.options.max)[0]},_autoAppend:function(a,b){if(BI.isNotNull(b)&&BI.checkDateLegal(a))switch(a.length){case this._const.yearLength:this._yearCheck(a)&&this.editor.setValue(a+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var c=a.split("-")[1];(BI.isNotNull(c)&&2===c.length||this._monthCheck(a))&&this.editor.setValue(a+"-")}},_yearCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d");return BI.parseDateTime(a,"%Y").print("%Y")===a&&b>=this.options.min&&b<=this.options.max},_monthCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d"),c=b.print("%Y-%X-%d");return b.getMonth()>0&&(BI.parseDateTime(a,"%Y-%X").print("%Y-%X")===a||BI.parseDateTime(a,"%Y-%x").print("%Y-%x")===a)&&c>=this.options.min&&c<=this.options.max},_setInnerValue:function(a){var b=a.print("%Y-%x-%e");this.editor.setState(b),this.editor.setValue(b)},_getText:function(a){function b(a,b){switch(b){case BI.DynamicDateCard.OFFSET.BEGIN:return a+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return a+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var c="",d="";return BI.isNotNull(a.year)&&(0!==BI.parseInt(a.year)&&(c+=Math.abs(a.year)+BI.i18nText("BI-Basic_Year")+(a.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Year"),a.position)),BI.isNotNull(a.quarter)&&(0!==BI.parseInt(a.quarter)&&(c+=Math.abs(a.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(a.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Single_Quarter"),a.position)),BI.isNotNull(a.month)&&(0!==BI.parseInt(a.month)&&(c+=Math.abs(a.month)+BI.i18nText("BI-Basic_Month")+(a.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Month"),a.position)),BI.isNotNull(a.week)&&(0!==BI.parseInt(a.week)&&(c+=Math.abs(a.week)+BI.i18nText("BI-Basic_Week")+(a.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Week"),a.position)),BI.isNotNull(a.day)&&(0!==BI.parseInt(a.day)&&(c+=Math.abs(a.day)+BI.i18nText("BI-Basic_Day")+(a.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=1===BI.size(a)?b(BI.i18nText("BI-Basic_Month"),a.position):""),BI.isNotNull(a.workDay)&&0!==BI.parseInt(a.workDay)&&(c+=Math.abs(a.workDay)+BI.i18nText("BI-Basic_Work_Day")+(a.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),c+d},setValue:function(a){var b,c,d=BI.getDate();switch(this.storeValue=a,BI.isNotNull(a)&&(b=a.type||BI.DynamicDateCombo.Static,c=a.value||a),b){case BI.DynamicDateCombo.Dynamic:var e=this._getText(c);d=BI.DynamicDateHelper.getCalculation(c),this._setInnerValue(d,e);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(c)||BI.isNull(c.day))this.editor.setState(""),this.editor.setValue("");else{var f=BI.getDate(c.year,c.month-1,c.day).print("%Y-%X-%d");this.editor.setState(f),this.editor.setValue(f)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger),BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),hour:0,minute:0,second:0}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2}),BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,ref:function(){a.ymd=this}},{el:{type:"bi.dynamic_date_time_select",ref:function(){a.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){}}]},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a.timeSelect.setValue(),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.timeSelect.setValue({hour:c.hour,minute:c.minute,second:c.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var a=this.dateTab.getSelect();return{type:a,value:a===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup),BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select bi-border-top"},render:function(){var a=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){a.hour=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<24},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkHour(b),this.setValue(a._formatValueToDoubleDigit(b)),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var b=a._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(b)}}],width:60,height:24},lgap:14},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){a.minute=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<60},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkMinute(b),this.setValue(a._formatValueToDoubleDigit(b),BI.DynamicDateTimeSelect.MINUTE),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var b=a._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(b)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){a.second=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<60},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkSecond(b),this.setValue(a._formatValueToDoubleDigit(b)),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(a){a=a||{},this._checkHour(a.hour),this._checkMinute(a.minute),this._checkSecond(a.second)},_checkHour:function(a){this.hour.setDownEnable(BI.parseInt(a)>0),this.hour.setUpEnable(BI.parseInt(a)<23)},_checkMinute:function(a){this.minute.setDownEnable(BI.parseInt(a)>0),this.minute.setUpEnable(BI.parseInt(a)<59)},_checkSecond:function(a){this.second.setDownEnable(BI.parseInt(a)>0),this.second.setUpEnable(BI.parseInt(a)<59)},_autoSwitch:function(a,b){var c=0,d=a;switch(b){case BI.DynamicDateTimeSelect.HOUR:c=2;break;case BI.DynamicDateTimeSelect.MINUTE:c=5}return 1===a.length&&BI.parseInt(a)>c&&(d="0"+d),2===d.length&&(b===BI.DynamicDateTimeSelect.HOUR?this.minute.focus():this.second.focus()),d},_formatValueToDoubleDigit:function(a){(BI.isNull(a)||BI.isEmptyString(a))&&(a=0);var b=BI.parseInt(a);return b<10&&(b="0"+b),b},_assertValue:function(a){return a=a||{},a.hour=this._formatValueToDoubleDigit(a.hour)||"00",a.minute=this._formatValueToDoubleDigit(a.minute)||"00",a.second=this._formatValueToDoubleDigit(a.second)||"00",a},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(a){a=this._assertValue(a),this.hour.setValue(a.hour),this.minute.setValue(a.minute),this.second.setValue(a.second),this._checkBorder(a)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2}),BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(b){var c=b.match(/\d+/g);return a._autoAppend(b,c),a._dateCheck(b)&&BI.checkDateLegal(b)&&a._checkVoid({year:0|c[0],month:0|c[1],day:0|c[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){return a.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")},title:function(){var b=a.storeValue||{},c=b.type||BI.DynamicDateCombo.Static,d=b.value;switch(c){case BI.DynamicDateCombo.Dynamic:var e=a._getText(d),f=BI.DynamicDateHelper.getCalculation(d),g=f.print("%Y-%x-%e %H:%M:%S");return BI.isEmptyString(e)?g:e+":"+g;case BI.DynamicDateCombo.Static:default:return BI.isNull(d)||BI.isNull(d.day)?"":BI.getDate(d.year,d.month-1,d.day,d.hour||0,d.minute||0,d.second||0).print("%Y-%X-%d %H:%M:%S")}}}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();if(BI.isNotNull(b)&&a.editor.setState(b),BI.isNotEmptyString(b)){var c=b.split(/-|\s|:/);a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|c[0],month:0|c[1],day:0|c[2],hour:0|c[3],minute:0|c[4],second:0|c[5]}}}a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:30}]}),this.setValue(b.value)},_dateCheck:function(a){return BI.parseDateTime(a,"%Y-%x-%d %H:%M:%S").print("%Y-%x-%d %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%X-%d %H:%M:%S").print("%Y-%X-%d %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%x-%e %H:%M:%S").print("%Y-%x-%e %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%X-%e %H:%M:%S").print("%Y-%X-%e %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%x-%d").print("%Y-%x-%d")===a||BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d")===a||BI.parseDateTime(a,"%Y-%x-%e").print("%Y-%x-%e")===a||BI.parseDateTime(a,"%Y-%X-%e").print("%Y-%X-%e")===a},_checkVoid:function(a){return!BI.checkDateVoid(a.year,a.month,a.day,this.options.min,this.options.max)[0]},_autoAppend:function(a,b){if(BI.isNotNull(b)&&BI.checkDateLegal(a))switch(a.length){case this._const.yearLength:this._yearCheck(a)&&this.editor.setValue(a+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var c=a.split("-")[1];(BI.isNotNull(c)&&2===c.length||this._monthCheck(a))&&this.editor.setValue(a+"-")}},_yearCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d");return BI.parseDateTime(a,"%Y").print("%Y")===a&&b>=this.options.min&&b<=this.options.max},_monthCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d"),c=b.print("%Y-%X-%d");return b.getMonth()>0&&(BI.parseDateTime(a,"%Y-%X").print("%Y-%X")===a||BI.parseDateTime(a,"%Y-%x").print("%Y-%x")===a)&&c>=this.options.min&&c<=this.options.max},_setInnerValue:function(a){var b=a.print("%Y-%x-%e %H:%M:%S");this.editor.setState(b),this.editor.setValue(b)},_getText:function(a){function b(a,b){switch(b){case BI.DynamicDateCard.OFFSET.BEGIN:return a+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return a+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var c="",d="";return BI.isNotNull(a.year)&&(0!==BI.parseInt(a.year)&&(c+=Math.abs(a.year)+BI.i18nText("BI-Basic_Year")+(a.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Year"),a.position)),BI.isNotNull(a.quarter)&&(0!==BI.parseInt(a.quarter)&&(c+=Math.abs(a.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(a.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Single_Quarter"),a.position)),BI.isNotNull(a.month)&&(0!==BI.parseInt(a.month)&&(c+=Math.abs(a.month)+BI.i18nText("BI-Basic_Month")+(a.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Month"),a.position)),BI.isNotNull(a.week)&&(0!==BI.parseInt(a.week)&&(c+=Math.abs(a.week)+BI.i18nText("BI-Basic_Week")+(a.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Week"),a.position)),BI.isNotNull(a.day)&&(0!==BI.parseInt(a.day)&&(c+=Math.abs(a.day)+BI.i18nText("BI-Basic_Day")+(a.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=1===BI.size(a)?b(BI.i18nText("BI-Basic_Month"),a.position):""),BI.isNotNull(a.workDay)&&0!==BI.parseInt(a.workDay)&&(c+=Math.abs(a.workDay)+BI.i18nText("BI-Basic_Work_Day")+(a.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),c+d},setValue:function(a){var b,c,d=BI.getDate();switch(this.storeValue=a,BI.isNotNull(a)&&(b=a.type||BI.DynamicDateCombo.Static,c=a.value||a),b){case BI.DynamicDateCombo.Dynamic:var e=this._getText(c);d=BI.DynamicDateHelper.getCalculation(c),this._setInnerValue(d,e);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(c)||BI.isNull(c.day))this.editor.setState(""),this.editor.setValue("");else{var f=BI.getDate(c.year,c.month-1,c.day,c.hour||0,c.minute||0,c.second||0).print("%Y-%X-%d %H:%M:%S");this.editor.setState(f),this.editor.setValue(f)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger),BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-search-editor bi-border",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.center_adapt",cls:"search-font",items:[{el:{type:"bi.icon"}}]},width:25},{el:a.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SearchEditor.EVENT_CLICK)}), this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},getKeywords:function(){var a=this.editor.getValue(),b=a.match(/[\S]+/g);return BI.isEndWithBlank(a)?b.concat([" "]):b},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor),BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var a=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-small-search-editor",height:24})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor),BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-text-editor bi-border",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;BI.isNumber(b.height)&&this.element.css({height:b.height-2}),BI.isNumber(b.width)&&this.element.css({width:b.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:b.height-2,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,title:b.title,tipType:b.tipType,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.TextEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(b){a.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(b){a.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(b){a.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor),BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var a=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-small-text-editor",height:25})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor),BI.FileManagerButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-button_group",items:[]})},_init:function(){BI.FileManagerButtonGroup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget({type:"bi.button_tree",element:this,chooseType:BI.Selection.Multi,items:this._formatItems(b.items),layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_formatItems:function(a){this.options;return BI.each(a,function(a,b){b.children&&b.children.length>0?b.type="bi.file_manager_folder_item":b.type="bi.file_manager_file_item"}),a},setValue:function(a){this.button_group.setValue(a)},getValue:function(){return this.button_group.getValue()},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getAllButtons:function(){return this.button_group.getAllButtons()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},populate:function(a){this.button_group.populate(this._formatItems(a))}}),BI.FileManagerButtonGroup.EVENT_CHANGE="FileManagerButtonGroup.EVENT_CHANGE",BI.shortcut("bi.file_manager_button_group",BI.FileManagerButtonGroup),BI.FileManager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager",el:{},items:[]})},_init:function(){BI.FileManager.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=new BI.Tree;var c=BI.Tree.transformToTreeFormat(b.items);this.tree.initTree(c),this.selectedValues=[],this.nav=BI.createWidget({type:"bi.file_manager_nav",items:BI.deepClone(c)}),this.nav.on(BI.FileManagerNav.EVENT_CHANGE,function(b,c){if("-1"==b)a.populate({children:a.tree.toJSON()});else{var d=a.tree.search(c.attr("id"));a.populate(BI.extend({id:d.id},d.get("data"),{children:a.tree.toJSON(d)}))}a.setValue(a.selectedValues)}),this.list=BI.createWidget(b.el,{type:"bi.file_manager_list",items:c}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){if(b===BI.Events.CHANGE){var e=a.tree.search(d.attr("id"));a.populate(BI.extend({id:e.id},e.get("data"),{children:a.tree.toJSON(e)}))}else if(b===BI.Events.CLICK){var f=[];if(d instanceof BI.MultiSelectBar){var g=a.list.getValue();c=g.type===BI.Selection.All,f=BI.concat(g.assist,g.value)}else f=d.getAllLeaves();BI.each(f,function(b,d){c===!0?a.selectedValues.pushDistinct(d):a.selectedValues.remove(d)})}a.setValue(a.selectedValues)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.list,left:0,right:0,top:0,bottom:10},{el:this.nav,left:40,right:100,top:0}]})},setValue:function(a){this.selectedValues=a||[],this.list.setValue(this.selectedValues)},getValue:function(){var a=this.list.getValue(),b=a.type===BI.Selection.All?a.assist:a.value;return b.pushDistinctArray(this.selectedValues),b},_populate:function(a){this.list.populate(a)},getSelectedValue:function(){return this.nav.getValue()[0]},getSelectedId:function(){return this.nav.getId()[0]},populate:function(a){var b=BI.deepClone(a);this._populate(a.children),this.nav.populate(b)}}),BI.FileManager.EVENT_CHANGE="FileManager.EVENT_CHANGE",BI.shortcut("bi.file_manager",BI.FileManager),BI.FileManagerFileItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.FileManagerFileItem.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-file-item bi-list-item bi-border-bottom",height:30})},_init:function(){BI.FileManagerFileItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checked=BI.createWidget({type:"bi.multi_select_bar",text:"",width:36,height:b.height}),this.checked.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.checked,width:36},{el:{type:"bi.icon_button",cls:"create-by-me-file-font"},width:20},{el:{type:"bi.label",textAlign:"left",height:b.height,text:b.text,value:b.value}}]})},getAllLeaves:function(){return[this.options.value]},isSelected:function(){return this.checked.isSelected()},setSelected:function(a){this.checked.setSelected(a)}}),BI.FileManagerFileItem.EVENT_CHANGE="FileManagerFileItem.EVENT_CHANGE",BI.shortcut("bi.file_manager_file_item",BI.FileManagerFileItem),BI.FileManagerFolderItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.FileManagerFolderItem.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-folder-item bi-list-item bi-border-bottom",height:30})},_init:function(){BI.FileManagerFolderItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checked=BI.createWidget({type:"bi.multi_select_bar",text:"",width:36,height:b.height}),this.checked.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button=BI.createWidget({type:"bi.text_button",textAlign:"left",height:b.height,text:b.text,value:b.value}),this.button.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,b.value,a)}),this.tree=new BI.Tree,this.tree.initTree([{id:b.id,children:b.children}]),this.selectValue=[],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.checked,width:36},{el:{type:"bi.icon_button",cls:"create-by-me-folder-font"},width:20},{el:this.button}]})},setAllSelected:function(a){this.checked.setSelected(a),this.selectValue=[]},setHalfSelected:function(a){this.checked.setHalfSelected(a),a||(this.selectValue=[])},setValue:function(a){var b=(this.options,!1),c=[];this.tree.traverse(function(d){d.isLeaf()&&(BI.contains(a,d.get("data").value)?c.push(d.get("data").value):b=!0)}),this.setAllSelected(c.length>0&&!b),this.setHalfSelected(c.length>0&&b),this.checked.isHalfSelected()&&(this.selectValue=c)},getAllButtons:function(){return[this]},getAllLeaves:function(){var a=(this.options,[]);return this.tree.traverse(function(b){b.isLeaf()&&a.push(b.get("data").value)}),a},getNotSelectedValue:function(){var a=this,b=(this.options,[]),c=this.checked.isSelected();if(c===!0)return b;var d=this.checked.isHalfSelected();return this.tree.traverse(function(c){if(c.isLeaf()){var e=c.get("data").value;d===!0?BI.contains(a.selectValue,c.get("data").value)||b.push(e):b.push(e)}}),b},getValue:function(){var a=[];return this.checked.isSelected()?(this.tree.traverse(function(b){b.isLeaf()&&a.push(b.get("data").value)}),a):this.checked.isHalfSelected()?this.selectValue:[]}}),BI.FileManagerFolderItem.EVENT_CHANGE="FileManagerFolderItem.EVENT_CHANGE",BI.shortcut("bi.file_manager_folder_item",BI.FileManagerFolderItem),BI.FileManagerList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-list",el:{},items:[]})},_init:function(){BI.FileManagerList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.list=BI.createWidget({type:"bi.select_list",element:this,items:b.items,toolbar:{type:"bi.multi_select_bar",height:40,text:""},el:{type:"bi.list_pane",el:BI.isWidget(b.el)?b.el:BI.extend({type:"bi.file_manager_button_group"},b.el)}}),this.list.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(a){this.list.setValue({value:a})},getValue:function(){return this.list.getValue()},populate:function(a){this.list.populate(a),this.list.setToolBarVisible(!0)}}),BI.FileManagerList.EVENT_CHANGE="FileManagerList.EVENT_CHANGE",BI.shortcut("bi.file_manager_list",BI.FileManagerList),BI.FileManagerNavButton=BI.inherit(BI.Widget,{_const:{normal_color:"#ffffff",select_color:"#eff1f4"},_defaultConfig:function(){return BI.extend(BI.FileManagerNavButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-nav-button",selected:!1,height:40})},_init:function(){BI.FileManagerNavButton.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.button=BI.createWidget({type:"bi.text_button",cls:"file-manager-nav-button-text bi-card",once:!0,selected:b.selected,text:b.text,title:b.text,value:b.value,height:b.height,lgap:20,rgap:10}),this.button.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var d=BI.createWidget({type:"bi.svg",cls:"file-manager-nav-button-triangle",width:15,height:b.height}),e=d.path("M0,0L15,20L0,40").attr({stroke:c.select_color,fill:b.selected?c.select_color:c.normal_color});this.button.on(BI.TextButton.EVENT_CHANGE,function(){this.isSelected()?e.attr("fill",c.select_color):e.attr("fill",c.normal_color)}),BI.createWidget({type:"bi.default",element:this,items:[this.button]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:d,right:-15,top:0,bottom:0}]})},isSelected:function(){return this.button.isSelected()},setValue:function(a){this.button.setValue(a)},getValue:function(){return this.button.getValue()},populate:function(a){}}),BI.FileManagerNavButton.EVENT_CHANGE="FileManagerNavButton.EVENT_CHANGE",BI.shortcut("bi.file_manager_nav_button",BI.FileManagerNavButton),BI.FileManagerNav=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerNav.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-nav bi-border-left",height:40,items:[]})},_init:function(){BI.FileManagerNav.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=new BI.Tree,this.refreshTreeData(b.items),this.tree.getRoot().set("data",{text:BI.i18nText("BI-Created_By_Me"),value:BI.FileManagerNav.ROOT_CREATE_BY_ME,id:BI.FileManagerNav.ROOT_CREATE_BY_ME}),this.button_group=BI.createWidget({type:"bi.button_group",element:this,items:[{type:"bi.file_manager_nav_button",text:BI.i18nText("BI-Created_By_Me"),selected:!0,id:BI.FileManagerNav.ROOT_CREATE_BY_ME,value:BI.FileManagerNav.ROOT_CREATE_BY_ME}],layouts:[{type:"bi.horizontal"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.FileManagerNav.EVENT_CHANGE,arguments)})},_getAllParents:function(a){var b,c=[];for(b=a?this.tree.search(a):this.tree.getRoot();b.parent;)c.push(b),b=b.parent;return c.push(b),c.reverse()},_formatNodes:function(a){var b=[];return BI.each(a,function(a,c){b.push(BI.extend({type:"bi.file_manager_nav_button",id:c.id},c.get("data")))}),BI.last(b).selected=!0,b},getValue:function(){return this.button_group.getValue()},getId:function(){var a=[];return BI.each(this.button_group.getSelectedButtons(),function(b,c){a.push(c.attr("id"))}),a},refreshTreeData:function(a){this.tree.initTree(BI.Tree.transformToTreeFormat(a)),this.tree.getRoot().set("data",{text:BI.i18nText("BI-Created_By_Me"),value:BI.FileManagerNav.ROOT_CREATE_BY_ME,id:BI.FileManagerNav.ROOT_CREATE_BY_ME})},populate:function(a){var b=BI.isNull(a)?[this.tree.getRoot()]:this._getAllParents(a.id);this.button_group.populate(this._formatNodes(b))}}),BI.extend(BI.FileManagerNav,{ROOT_CREATE_BY_ME:"-1"}),BI.FileManagerNav.EVENT_CHANGE="FileManagerNav.EVENT_CHANGE",BI.shortcut("bi.file_manager_nav",BI.FileManagerNav),BI.AbstractFilterItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-item bi-border-right bi-border-bottom"},isSelectedCondition:function(){return this.emptyItem&&this.emptyItem.isVisible()},setSelectedCondition:function(a){a&&(this.emptyItem||(this.emptyItem=BI.createWidget({type:"bi.absolute",height:40,cls:"filter-item-empty-item bi-border-top",items:[{el:{type:"bi.center_adapt",cls:"empty-filter-item-leaf"}}],hgap:10,vgap:5}),BI.createWidget({type:"bi.vertical",element:this,items:[this.emptyItem],scrolly:!1}))),this.emptyItem&&this.emptyItem.setVisible(a)}}),BI.extend(BI.AbstractFilterItem,{FILTER_OPERATION_FORMULA:1,FILTER_OPERATION_CONDITION:2,FILTER_OPERATION_CONDITION_AND:3,FILTER_OPERATION_CONDITION_OR:4,FILTER_OPERATION_FORMULA_AND:5,FILTER_OPERATION_FORMULA_OR:6}),!function(){var a=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-expander",el:{},popup:{}},render:function(){var a=this,b=this.options;return{type:"bi.filter_expander",el:b.el,popup:b.popup,id:b.id,value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}],ref:function(b){a.expander=b}}},populate:function(){this.expander.populate.apply(this.expander,arguments)},getValue:function(){var a=this.expander.getValue();return{filterType:a.type,filterValue:a.value,id:a.id}}});BI.shortcut("bi.and.or.filter.expander",a)}(),!function(){var a=BI.inherit(BI.AbstractFilterItem,{_constant:{EXPANDER_WIDTH:20},props:{baseCls:"bi-filter-item bi-filter-expander",el:{},popup:{}},render:function(){var a=this,b=this.options,c=b.el.value,d="";return d=c===BI.Filter.FILTER_TYPE.AND?BI.i18nText("BI-Basic_And"):BI.i18nText("BI-Basic_Or"),{type:"bi.horizontal_adapt",cls:"filter-item-empty-item",verticalAlign:BI.VerticalAlign.Middle,items:[{type:"bi.text_button",cls:"condition-and-or",text:d,value:c,id:b.id,width:this._constant.EXPANDER_WIDTH,height:"100%",ref:function(b){a.expander=b},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,"",a)}}]},BI.extend(b.popup,{ref:function(b){a.conditionsView=b},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})]}},getValue:function(){return{type:this.expander.getValue(),value:this.conditionsView.getValue(),id:this.options.id}},populate:function(){this.conditionsView.populate.apply(this.conditionsView,arguments)}});BI.shortcut("bi.filter_expander",a)}(),BI.Filter=BI.inherit(BI.Widget,{constants:{FIELD_TYPE_NUMBER:1,FIELD_TYPE_STRING:0,FIELD_TYPE_DATE:2},props:{baseCls:"bi-filter",expander:{},items:[],el:{},itemCreator:BI.empty},render:function(){var a=this,b=this.options;return BI.extend({type:"bi.filter_operation",expander:b.expander,listeners:[{eventName:"EVENT_OPERATION",action:function(b){switch(b){case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_CONDITION);break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_CONDITION,1);break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_FORMULA);break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_FORMULA,1)}}},{eventName:"BI.FilterOperation.EVENT_DESTROY_ITEM",action:function(b){a._removeCondition(b)}}],ref:function(b){a.filter=b}},b.el)},mounted:function(){this.tree=new BI.Tree,this.tree.initTree(this.options.items),this._populate(this.tree.toJSONWithNode())},_createEmptyNode:function(a){var b=new BI.Node(BI.UUID());return b.set("data",{value:a}),b},_insertAndOrCondition:function(a,b,c){var d=["AND","OR"];c||(c=0);var e=this.tree.search(a);if(BI.isNotNull(e)){var f=e.get("data"),g=e.getParent(),h=g.getChildIndex(e.id),i=g.get("data")||{},j=this._createEmptyNode(b);if(f.value===BI.Filter.FILTER_TYPE[d[c]])return void this.tree.addNode(e,j);if(f.value===BI.Filter.FILTER_TYPE[d[1-c]]&&i.value===BI.Filter.FILTER_TYPE[d[c]])return void g.addChild(j,h+1);if(f.value===BI.Filter.FILTER_TYPE[d[1-c]]&&i.value!==BI.Filter.FILTER_TYPE[d[c]]||i.value===BI.Filter.FILTER_TYPE[d[1-c]]||i.value!==BI.Filter.FILTER_TYPE.AND&&i.value!==BI.Filter.FILTER_TYPE.OR){var k=new BI.Node(BI.UUID());return k.set("data",{value:BI.Filter.FILTER_TYPE[d[c]],children:[e.get("data"),j.get("data")]}),g.removeChildByIndex(h),g.addChild(k,h),k.addChild(e),void k.addChild(j)}g.addChild(j,h+1)}},_removeCondition:function(a){var b=this.tree.search(a);if(BI.isNotNull(b)){var c=b.getParent();if(c.removeChild(a),c.getChildrenLength()<=1){var d=c.getParent();if(BI.isNotNull(d)){var e=d.getChildIndex(c.id);d.removeChildByIndex(e),1===c.getChildrenLength()&&d.addChild(c.getFirstChild(),e)}}this._populate(this.tree.toJSONWithNode()),this.fireEvent("EVENT_CHANGE")}},_addAndOrCondition:function(a,b){var c=["AND","OR"];b||(b=0);var d=this.filter.getCurrentSelectItem();if(BI.isNotNull(d)){var e=d.attr("id");this._insertAndOrCondition(e,a,b)}else{var f=this._createEmptyNode(a),g=this.tree.getRoot(),h=g.getLastChild();if(BI.isNotNull(h)){var i=h.get("data");if(i.value===BI.Filter.FILTER_TYPE[c[b]])this.tree.addNode(h,f);else{var j=new BI.Node(BI.UUID());j.set("data",{value:BI.Filter.FILTER_TYPE[c[b]],children:[h.get("data"),f.get("data")]}),g.removeChild(h.id),this.tree.addNode(j),this.tree.addNode(j,h),this.tree.addNode(j,f)}}else this.tree.addNode(f)}this._populate(this.tree.toJSONWithNode()),this.fireEvent("EVENT_CHANGE")},_populate:function(a){this.filter.defaultState();var b=this.options;b.items=a,BI.Tree.traversal(a,function(a,c){b.itemCreator(c)}),this.filter.populate.apply(this.filter,[a])},populate:function(a){this.tree.initTree(a),this._populate(this.tree.toJSONWithNode())},getValue:function(){return this.filter.getValue()}}),BI.shortcut("bi.filter",BI.Filter),BI.Filter.FILTER_TYPE={},BI.Filter.FILTER_TYPE.FORMULA=33,BI.Filter.FILTER_TYPE.AND=34,BI.Filter.FILTER_TYPE.OR=35,BI.Filter.FILTER_TYPE.EMPTY_FORMULA=36,BI.Filter.FILTER_TYPE.EMPTY_CONDITION=37,!function(){var a=BI.inherit(BI.ButtonTree,{props:{baseCls:"bi-button-map"},_createBtns:function(a){var b=this.options,c=BI.createWidgets(BI.createItems(a,{type:"bi.text_button",once:0===b.chooseType})),d=BI.map(a,function(a,b){if(b=BI.stripEL(b),!b.id&&!b.value)throw new Error("item must have 'id' or 'value' as its property");return b.id||b.value});return BI.zipObject(d,c)},setValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(a.contains(b)?c.setSelected&&c.setSelected(!0):c.setSelected&&c.setSelected(!1)):void c.setValue(a)})},setNotSelectedValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(a.contains(b)?c.setSelected&&c.setSelected(!1):c.setSelected&&c.setSelected(!0)):void c.setNotSelectedValue(a)})},populate:function(a){var b=this,c=[].slice.call(arguments),d=new BI.LinkHashMap,e=function(a){return a.id||a.value};this.buttons||(this.buttons={});var f=[];BI.each(a,function(a,d){if(d=BI.stripEL(d),b.buttons[e(d)]){var g=b.buttons[e(d)];c[0]=d.items,c[2]=d,g.populate&&g.populate.apply(g,c)}else f.push(d)}),c[0]=f;var g=this._btnsCreator.apply(this,c),h=[];BI.each(a,function(a,c){c=BI.stripEL(c);var f=b.buttons[e(c)]||g[e(c)];d.add(e(c),f),h.push(f)}),this.buttons=d.map,BI.DOM.hang(this.buttons),this.element.empty();var i=this._packageItems(a,this._packageBtns(h));BI.createWidget(BI.extend({element:this},this._packageLayout(i)))},getIndexByValue:function(){throw new Error("Can not use getIndexByValue")}});BI.shortcut("bi.filter_list",a)}(),!function(){var a=0,b=1,c=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(c.superclass._defaultConfig.apply(this,arguments),{constants:{FORMULA_COMBO:[{text:BI.i18nText("BI-Conf_Formula_And"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND},{text:BI.i18nText("BI-Conf_Formula_Or"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR}],CONDITION_COMBO:[{text:BI.i18nText("BI-Conf_Condition_And"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND},{text:BI.i18nText("BI-Conf_Condition_Or"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR}]}})},props:{baseCls:"bi-filter-operation",expander:{},items:[],selections:[BI.AbstractFilterItem.FILTER_OPERATION_CONDITION,BI.AbstractFilterItem.FILTER_OPERATION_FORMULA],itemsCreator:BI.emptyFn},render:function(){var c=this,d=this.options;return this.currentSelected=null,{type:"bi.vtape",items:[{el:{type:"bi.tab",showIndex:a,cardCreator:BI.bind(this._createTabs,this),ref:function(a){c.buttonComboTab=a}},height:40},{el:{type:"bi.absolute",scrollable:!0,items:[{el:{type:"bi.left",items:[{type:"bi.filter_pane",expander:d.expander,items:d.items,itemsCreator:d.itemsCreator,listeners:[{eventName:"EVENT_CHANGE",action:function(d,e,f){d===BI.Events.CLICK&&(BI.isNotNull(c.currentSelected)&&c.currentSelected===f?f.setSelectedCondition(!f.isSelectedCondition()):(BI.isNotNull(c.currentSelected)&&c.currentSelected.setSelectedCondition(!1),c.currentSelected=f,f.setSelectedCondition(!0)),c.currentSelected.isSelectedCondition()?c.buttonComboTab.setSelect(b):c.buttonComboTab.setSelect(a)),d===BI.Events.DESTROY&&(c.currentSelected===f&&(c.currentSelected=null,c.buttonComboTab.setSelect(a)),c.fireEvent("BI.FilterOperation.EVENT_DESTROY_ITEM",e,f))}}],ref:function(a){c.filter=a}}]},top:0,right:2,bottom:0,left:0}]}}]}},_createTabs:function(c){var d=this;switch(c){case a:return{type:"bi.button_group",items:BI.createItems(d._createButtons(),{type:"bi.icon_text_item",height:30,width:100}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,layouts:[{type:"bi.left",vgap:5}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(a,b){BI.isEmptyArray(d.filter.getValue())&&d.filter.element.addClass("bi-border-top bi-border-left"),d.fireEvent("EVENT_OPERATION",b.getValue()),d.defaultState()}}]};case b:return{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,items:d._buildOperationButton(),layouts:[{type:"bi.left",vgap:5}]}}},_createButtons:function(){var a=[];return BI.each(this.options.selections,function(b,c){switch(c){case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:a.push({text:BI.i18nText("BI-Conf_Add_Formula"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA,cls:"operation-trigger filter-formula-font"});break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:a.push({text:BI.i18nText("BI-Conf_Add_Condition"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION,cls:"operation-trigger filter-condition-font"})}}),a},_buildOperationButton:function(){var a=this,b=[];return BI.each(this.options.selections,function(c,d){var e="",f="",g=[];switch(d){case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:e=BI.i18nText("BI-Conf_Add_Formula"),f="filter-formula-font",g=a.options.constants.FORMULA_COMBO;break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:default:e=BI.i18nText("BI-Conf_Add_Condition"),f="filter-condition-font",g=a.options.constants.CONDITION_COMBO}var h=BI.createWidget({type:"bi.icon_text_icon_item",iconCls1:"operation-trigger "+f,iconCls2:"pull-down-font",text:e,height:30,width:100});b.push({type:"bi.combo",el:h,popup:{el:{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_NONE,items:BI.createItems(g,{type:"bi.single_select_item",height:25}),layouts:[{type:"bi.vertical"}]}},listeners:[{eventName:BI.Combo.EVENT_CHANGE,action:function(b,c){switch(BI.isEmptyArray(a.filter.getValue())&&a.filter.element.addClass("bi-border-top bi-border-left"),b){case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND:case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR:h.setText(BI.i18nText("BI-Conf_Add_Condition"));break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND:case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR:h.setText(BI.i18nText("BI-Conf_Add_Formula"));break;default:h.setText()}a.fireEvent("EVENT_OPERATION",c.getValue()),a.defaultState(),this.hideView()}}]})}),b},defaultState:function(){BI.isNotNull(this.currentSelected)&&this.currentSelected.setSelectedCondition(!1),this.buttonComboTab.setSelect(a)},getCurrentSelectItem:function(){if(BI.isNotNull(this.currentSelected)&&this.currentSelected.isSelectedCondition())return this.currentSelected},populate:function(a){this.filter.populate.apply(this.filter,arguments)},getValue:function(){return this.filter.getValue()}});BI.shortcut("bi.filter_operation",c)}(),!function(){var a=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-pane",expander:{},items:[],itemsCreator:BI.emptyFn},render:function(){var a=this,b=this.options;return{type:"bi.custom_tree",cls:BI.isNotEmptyArray(b.items)?"bi-border-top bi-border-left":"",expander:BI.extend({type:"bi.filter_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:{type:"bi.filter_list",chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,layouts:[{type:"bi.vertical",scrolly:!1}]},items:b.items,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent("EVENT_CHANGE",arguments)}}],ref:function(b){a.tree=b}}},populate:function(a){BI.isNotEmptyArray(a)?this.element.addClass("bi-border-top bi-border-left"):this.element.removeClass("bi-border-top bi-border-left"), this.tree.populate.apply(this.tree,arguments)},getValue:function(){return this.tree.getValue()}});BI.shortcut("bi.filter_pane",a)}(),BI.IntervalSlider=BI.inherit(BI.Widget,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var a=this,b=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,errorText:"",allowBlank:!1,width:b.EDITOR_WIDTH,validationChecker:function(b){return a._checkValidation(b)}}),this.labelOne.element.hover(function(){a.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){a.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var b=BI.parseFloat(this.getValue());a.valueOne=b;var c=a._getPercentByValue(b),d=BI.parseFloat(c.toFixed(1));a._setLabelOnePosition(d),a._setSliderOnePosition(d),a._setBlueTrack(),a.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",errorText:"",text:this.options.unit,allowBlank:!1,width:b.EDITOR_WIDTH,validationChecker:function(b){return a._checkValidation(b)}}),this.labelTwo.element.hover(function(){a.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){a.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var b=BI.parseFloat(this.getValue());a.valueTwo=b;var c=a._getPercentByValue(b),d=BI.parseFloat(c.toFixed(1));a._setLabelTwoPosition(d),a._setSliderTwoPosition(d),a._setBlueTrack(),a.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:b.TRACK_HEIGHT}]}],hgap:7,height:b.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(a,b){var c=this.options,d=100*a/this._getGrayTrackLength(),e=BI.parseFloat(d.toFixed(1)),f=this._getValueByPercent(e);f=this._assertValue(f),f=c.digit===!1?f:f.toFixed(c.digit),b?(this._setLabelOnePosition(e),this._setSliderOnePosition(e),this.labelOne.setValue(f),this.valueOne=f):(this._setLabelTwoPosition(e),this._setSliderTwoPosition(e),this.labelTwo.setValue(f),this.valueTwo=f),this._setBlueTrack()},_rePosBySizeAfterStop:function(a,b){var c=100*a/this._getGrayTrackLength(),d=BI.parseFloat(c.toFixed(1));b?this._setSliderOnePosition(d):this._setSliderTwoPosition(d)},_draggable:function(a,b){function c(a){return BI.clamp(a,0,d._getGrayTrackLength())}var d=this,e=(this.options,!1),f=0,g=0,h=0,i=new BI.MouseMoveTracker(function(j){i.isDragging()&&(e=!0,g+=j,f=c(h+g),a.element.addClass("dragging"),d._rePosBySizeAfterMove(f,b))},function(){e===!0&&(f=c(f),d._rePosBySizeAfterStop(f,b),f=0,g=0,h=f,e=!1),a.element.removeClass("dragging"),i.releaseMouseMoves(),d.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);a.element.on("mousedown",function(b){a.isEnabled()&&(h=this.offsetLeft,c(h),i.captureMouseMoves(b))})},_createLabelWrapper:function(){var a=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:a.EDITOR_R_GAP,height:70},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var a=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%"}]}],hgap:a.SLIDER_WIDTH_HALF,height:a.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(a){var b=this.options,c=!1,d=(a+"").split(".")[1];return BI.isEmptyString(d)||BI.isNumeric(a)&&!(BI.isNull(a)||athis.max)&&(b.digit===!1?c=!0:(d=d||"",c=d.length===b.digit)),c},_checkOverlap:function(){var a=this.labelOne.element[0].offsetLeft,b=this.labelTwo.element[0].offsetLeft;a<=b?b-a<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):a-b<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_setLabelOnePosition:function(a){this.labelOne.element.css({left:a+"%"}),this._checkOverlap()},_setLabelTwoPosition:function(a){this.labelTwo.element.css({left:a+"%"}),this._checkOverlap()},_setSliderOnePosition:function(a){this.sliderOne.element.css({left:a+"%"})},_setSliderTwoPosition:function(a){this.sliderTwo.element.css({left:a+"%"})},_setBlueTrackLeft:function(a){this.blueTrack.element.css({left:a+"%"})},_setBlueTrackWidth:function(a){this.blueTrack.element.css({width:a+"%"})},_setBlueTrack:function(){var a=this._getPercentByValue(this.labelOne.getValue()),b=this._getPercentByValue(this.labelTwo.getValue());a<=b?(this._setBlueTrackLeft(a),this._setBlueTrackWidth(b-a)):(this._setBlueTrackLeft(b),this._setBlueTrackWidth(a-b))},_setAllPosition:function(a,b){this._setSliderOnePosition(a),this._setLabelOnePosition(a),this._setSliderTwoPosition(b),this._setLabelTwoPosition(b),this._setBlueTrack()},_setVisible:function(a){this.sliderOne.setVisible(a),this.sliderTwo.setVisible(a),this.labelOne.setVisible(a),this.labelTwo.setVisible(a)},_setErrorText:function(){var a=BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max);this.labelOne.setErrorText(a),this.labelTwo.setErrorText(a)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(a){var b=this.calculation.accurateSubtraction(this.max,this.min),c=this.calculation.accurateMultiplication(b,a),d=this.calculation.accurateDivisionTenExponent(c,2);if(this.precision<0){var e=BI.parseFloat(this.calculation.accurateAddition(d,this.min)),f=Math.round(this.calculation.accurateDivisionTenExponent(e,-this.precision));return this.calculation.accurateMultiplication(f,Math.pow(10,-this.precision))}return BI.parseFloat(this.calculation.accurateAddition(d,this.min).toFixed(this.precision))},_getPercentByValue:function(a){return 100*(a-this.min)/(this.max-this.min)},_setDraggableEnable:function(a){this.sliderOne.setEnable(a),this.sliderTwo.setEnable(a)},_getPrecision:function(){var a=this.calculation.accurateSubtraction(this.max,this.min),b=a.toPrecision(4),c=b.indexOf("e"),d=[];if(c>-1){d=b.split("e");var e=BI.size(d[0].split(".")[1]),f=BI.parseInt(d[1].substring(1));return e-f}return d=b.split("."),d.length>1?d[1].length:0},_assertValue:function(a){return a<=this.min?this.min:a>=this.max?this.max:a},_setEnable:function(a){BI.IntervalSlider.superclass._setEnable.apply(this,[a]),this.blueTrack&&this.blueTrack.setVisible(!!a)},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(a){var b=BI.parseFloat(a.min),c=BI.parseFloat(a.max);!isNaN(b)&&!isNaN(c)&&c>=b&&(this.min=b,this.max=c,this.valueOne=b,this.valueTwo=c,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),c===b&&this._setDraggableEnable(!1)},setValue:function(a){var b=this.options,c=BI.parseFloat(a.min),d=BI.parseFloat(a.max);c=b.digit===!1?c:c.toFixed(b.digit),d=b.digit===!1?d:d.toFixed(b.digit),isNaN(c)||isNaN(d)||(this._checkValidation(c)&&(this.valueOne=c),this._checkValidation(d)&&(this.valueTwo=d),cthis.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(this.valueOne),this.labelTwo.setValue(this.valueTwo),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider),BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(a){for(var b="1",c=0;c0)var d=b;else{var d=a;c=0-c}for(var e=0;e=b.numDecimal.length?a.numDecimal.length:b.numDecimal.length}function d(a,b){for(var c=b-a.length,d=0;d=BI.parseInt(f.numDecimal))var i=(BI.parseInt(e.numDecimal)-BI.parseInt(f.numDecimal)).toString(),j=d(i,h);else{g--;var k=this._getMagnitude(h),i=(k+BI.parseInt(e.numDecimal)-BI.parseInt(f.numDecimal)).toString(),j=d(i,h)}var l=g+"."+j;return BI.parseFloat(l)},_accurateAddition:function(a,b){function c(a,b){for(var c=b-a.length,d=0;db)var e=d.numInteger.slice(0,d.numInteger.length-b),f=d.numInteger.slice(-b);else var e="0",f=c(d.numInteger,b);var g=e+"."+f+d.numDecimal;return BI.parseFloat(g)},accurateSubtraction:function(a,b){return a>=0&&b>=0?a>=b?this._accurateSubtraction(a,b):-this._accurateSubtraction(b,a):a>=0&&b<0?this._accurateAddition(a,-b):a<0&&b>=0?-this._accurateAddition(-a,b):a<0&&b<0?a>=b?this._accurateSubtraction(-b,-a):this._accurateSubtraction(-a,-b):void 0},accurateAddition:function(a,b){return a>=0&&b>=0?this._accurateAddition(a,b):a>=0&&b<0?this.accurateSubtraction(a,-b):a<0&&b>=0?this.accurateSubtraction(b,-a):a<0&&b<0?-this._accurateAddition(-a,-b):void 0},accurateMultiplication:function(a,b){return a>=0&&b>=0?this._accurateMultiplication(a,b):a>=0&&b<0?-this._accurateMultiplication(a,-b):a<0&&b>=0?-this._accurateMultiplication(-a,b):a<0&&b<0?this._accurateMultiplication(-a,-b):void 0},accurateDivisionTenExponent:function(a,b){return a>=0?this._accurateDivisionTenExponent(a,b):-this._accurateDivisionTenExponent(-a,b)}}),BI.MonthCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",behaviors:{},height:25})},_init:function(){BI.MonthCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.month_trigger",value:b.value}),this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM,function(b){a.combo.isViewVisible()||(this.getKey()&&this.getKey()!==a.storeValue?a.setValue(this.getValue()):this.getKey()||a.setValue(),a.fireEvent(BI.MonthCombo.EVENT_CONFIRM))}),this.trigger.on(BI.MonthTrigger.EVENT_FOCUS,function(){a.storeValue=this.getKey()}),this.trigger.on(BI.MonthTrigger.EVENT_START,function(){a.combo.hideView()}),this.trigger.on(BI.MonthTrigger.EVENT_STOP,function(){a.combo.isViewVisible()||a.combo.showView()}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:b.behaviors,value:b.value}),this.popup.on(BI.MonthPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MonthCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,el:this.popup}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW)})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return BI.isNull(this.popup)?this.options.value||"":this.popup.getValue()||""}}),BI.MonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.month_combo",BI.MonthCombo),BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var a=this,b=this.options,c=[1,7,2,8,3,9,4,10,5,11,6,12],d=[];d.push(c.slice(0,2)),d.push(c.slice(2,4)),d.push(c.slice(4,6)),d.push(c.slice(6,8)),d.push(c.slice(8,10)),d.push(c.slice(10,12)),d=BI.map(d,function(a,b){return BI.map(b,function(a,b){return{type:"bi.text_item",cls:"bi-list-item-active",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:b,text:b}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:b.behaviors,items:BI.createItems(d,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:b.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(b){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(a){a=BI.parseInt(a),this.month.setValue([a])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup),BI.MonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.MonthTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-month-trigger bi-border",height:24})},_init:function(){BI.MonthTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(a){return""===a||BI.isPositiveInteger(a)&&a>=1&&a<=12},quitChecker:function(a){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,errorText:BI.i18nText("BI-Month_Trigger_Error_Text")}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.MonthTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.MonthTrigger.EVENT_CHANGE)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();BI.isNotNull(b)&&(a.editor.setValue(b),a.editor.setTitle(b)),a.fireEvent(BI.MonthTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){a.editor.isValid()&&a.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.MonthTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.MonthTrigger.EVENT_STOP)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),baseCls:"bi-trigger-month-text",width:b.height},width:b.height},{el:{type:"bi.trigger_icon_button",width:b.height},width:b.height}]}),this.setValue(b.value)},setValue:function(a){return BI.isNotNull(a)?(this.editor.setState(a+1),this.editor.setValue(a+1),void this.editor.setTitle(a+1)):(this.editor.setState(""),this.editor.setValue(""),void this.editor.setTitle(""))},getKey:function(){return 0|this.editor.getValue()},getValue:function(){return this.editor.getValue()-1}}),BI.MonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.MonthTrigger.EVENT_START="EVENT_START",BI.MonthTrigger.EVENT_STOP="EVENT_STOP",BI.MonthTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_trigger",BI.MonthTrigger),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo),BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var a=this,b=this.options,c=this._createPopupItems(b.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])){d=a.childValueMap[b];var e=a.fatherValueMap[b],f=(e+"").split("_");a.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,d,f.length>1?f:e)}else a.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,d,c);if(!a.singleValues.contains(d)){var g=a.getValue(),h=[];BI.each(g,function(a,b){b.value!=d&&h.push(b)}),a.setValue(h)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createPopupItems:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}},c.el.childValues=[],BI.each(c.children,function(a,d){d=d.el?BI.extend(d.el,{children:d.children}):d;var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value),BI.isNotEmptyArray(d.children)&&(d.type="bi.down_list_group_item",b._createChildren(d),d.height=b.constants.height,d.iconCls2=b.constants.nextIcon,c.el.childValues=BI.concat(c.el.childValues,d.childValues))})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_createChildren:function(a){var b=this;a.childValues=[],BI.each(a.children,function(c,d){var e=BI.deepClone(a.value),f=BI.deepClone(d.value);d.type="bi.down_list_item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),a.childValues.push(d.value)})},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a1?g:f}else e.value=d;b.push(e)}),b}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup),BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer_select_tree-combo",isDefaultInit:!1,height:30,text:"",items:[],value:""})},_init:function(){BI.MultiLayerSelectTreeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:b.text,height:b.height,items:b.items,value:b.value}),this.popup=BI.createWidget({type:"bi.multilayer_select_tree_popup",isDefaultInit:b.isDefaultInit,items:b.items,value:b.value}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.MultiLayerSelectTreePopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)})},setValue:function(a){a=BI.isArray(a)?a:[a],this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.combo.populate(a)}}),BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo),BI.MultiLayerSelectLevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,value:""})},_init:function(){BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={};if(e.layer=b,BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.multilayer_select_tree_first_plus_group_node";break;case a.length-1:f.type="bi.multilayer_select_tree_last_plus_group_node";break;default:f.type="bi.multilayer_select_tree_mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.multilayer_single_tree_last_tree_leaf_item";break;default:f.type="bi.multilayer_single_tree_mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){b.id=b.id||BI.UUID()})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-inline",expander:{type:"bi.select_tree_expander",isDefaultInit:c.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),itemsCreator:c.itemsCreator,value:c.value,el:{type:"bi.button_tree",chooseType:BI.Selection.Single,layouts:[{type:"bi.vertical"}]}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:!0,items:[this.tree]})},populate:function(a){this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(a),0))},setValue:function(a){this.tree.setValue(a)},getValue:function(){return BI.uniq(this.tree.getValue())},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree),BI.MultiLayerSelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:b.isDefaultInit,items:b.items,value:b.value,itemsCreator:b.itemsCreator}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){a.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(a){a=BI.isArray(a)?a:[a],this.tree.setValue(a)},populate:function(a){BI.MultiLayerSelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(a)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:b.id,pId:b.pId,open:b.open,height:b.height,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",cls:"base-line-conn-background",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.MultiLayerSelectTreeFirstPlusGroupNode.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.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode),BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node", diff --git a/dist/case.js b/dist/case.js index 204a4401e..83f63c578 100644 --- a/dist/case.js +++ b/dist/case.js @@ -5918,7 +5918,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { items: o.items, height: o.height, text: o.text, - defaultIconCls: o.defaultIconCls, + iconCls: o.iconCls, value: o.value, iconHeight: o.iconHeight, iconWidth: o.iconWidth @@ -14843,7 +14843,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { height: 24, iconHeight: null, iconWidth: null, - defaultIconCls: "" + iconCls: "" }); }, @@ -14886,7 +14886,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { } else { return { text: o.text, - iconCls: o.defaultIconCls + iconCls: o.iconCls }; } }, diff --git a/dist/fineui.js b/dist/fineui.js index ae5ecce08..3178555b6 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -78650,7 +78650,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { items: o.items, height: o.height, text: o.text, - defaultIconCls: o.defaultIconCls, + iconCls: o.iconCls, value: o.value, iconHeight: o.iconHeight, iconWidth: o.iconWidth @@ -87575,7 +87575,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { height: 24, iconHeight: null, iconWidth: null, - defaultIconCls: "" + iconCls: "" }); }, @@ -87618,7 +87618,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { } else { return { text: o.text, - iconCls: o.defaultIconCls + iconCls: o.iconCls }; } }, @@ -90645,11 +90645,11 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** } if (BI.isNotNull(obj.workDay)) { // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 - if(BI.isNotNull(Date.holidays)) { + if(BI.isNotNull(BI.holidays)) { var count = Math.abs(obj.workDay); for (var i = 0; i < count; i++) { date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); - if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + if(BI.isNotNull(BI.holidays[date.print("%Y-%X-%d")])) { i--; } } diff --git a/dist/fineui.min.js b/dist/fineui.min.js index 4eed69de8..34cd81448 100644 --- a/dist/fineui.min.js +++ b/dist/fineui.min.js @@ -31,14 +31,14 @@ BI.each(a.columnSize,function(b,g){a.isNeedFreeze===!0&&a.freezeCols.contains(b) 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",iconCls:"",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.iconCls,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.iconCls!==a&&(this.element.removeClass(b.iconCls).addClass(a),b.iconCls=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",iconCls:"",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.iconCls,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",logic:{dynamic:!1},hgap:10,height:25})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var a=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:a.height,height:a.height,hgap:a.hgap,text:a.text,keyword:a.keyword,value:a.value,py:a.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},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_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())},setText:function(a){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(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,keyword:b.keyword}),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.arrow_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,keyword:b.keyword}),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,keyword:b.keyword}),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.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var a=this;return{type:"bi.absolute",ref:function(){a.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(a){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=a?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch),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,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,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,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,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,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,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:8,day:25})},_dateCreator:function(a,b,c){var d=this.options,e={},f=BI.getDate(),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]=BI.isLeapYear(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:BI.getDate().getFullYear()+d,month:e+1}}}),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={};BI.checkDateVoid(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=BI.getDate().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,!!BI.checkDateVoid(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,!!BI.checkDateVoid(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=BI.getDate().getFullYear();return a-((a-b+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(a){return BI.YearCalendar.getStartYear(a)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(a){var b=BI.getDate().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-group-node-checkbox"})},_init:function(){BI.ArrowTreeGroupNodeCheckbox.superclass._init.apply(this,arguments)},setSelected:function(a){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),a?this.element.removeClass("pull-right-font").addClass("pull-down-font"):this.element.removeClass("pull-down-font").addClass("pull-right-font")}}),BI.shortcut("bi.arrow_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"})},_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.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');if("cut"===this.action&&(a.hasAttribute("readonly")||a.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=a}},get:function(){return this._target}}]),a}();a.exports=h})},{select:5}],8:[function(b,c,d){!function(e,f){if("function"==typeof a&&a.amd)a(["module","./clipboard-action","tiny-emitter","good-listener"],f);else if("undefined"!=typeof d)f(c,b("./clipboard-action"),b("tiny-emitter"),b("good-listener"));else{var g={exports:{}};f(g,e.clipboardAction,e.tinyEmitter,e.goodListener),e.clipboard=g.exports}}(this,function(a,b,c,d){"use strict";function e(a){return a&&a.__esModule?a:{"default":a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function i(a,b){var c="data-clipboard-"+a;if(b.hasAttribute(c))return b.getAttribute(c)}var j=e(b),k=e(c),l=e(d),m=function(){function a(a,b){for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof a.action?a.action:this.defaultAction,this.target="function"==typeof a.target?a.target:this.defaultTarget,this.text="function"==typeof a.text?a.text:this.defaultText}},{key:"listenClick",value:function(a){var b=this;this.listener=(0,l["default"])(a,"click",function(a){return b.onClick(a)})}},{key:"onClick",value:function(a){var b=a.delegateTarget||a.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new j["default"]({action:this.action(b),target:this.target(b),text:this.text(b),trigger:b,emitter:this})}},{key:"defaultAction",value:function(a){return i("action",a)}},{key:"defaultTarget",value:function(a){var b=i("target",a);if(b)return document.querySelector(b)}},{key:"defaultText",value:function(a){return i("text",a)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],b="string"==typeof a?[a]:a,c=!!document.queryCommandSupported;return b.forEach(function(a){c=c&&!!document.queryCommandSupported(a)}),c}}]),b}(k["default"]);a.exports=n})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)})}catch(e){!function(a){a.fn.zclip=function(b){if("object"==typeof b&&!b.length){var c=a.extend({path:"ZeroClipboard.swf",copy:null,beforeCopy:null,afterCopy:null,clickAfter:!0,setHandCursor:!0,setCSSEffects:!0},b);return this.each(function(){var b=a(this);if(b.is(":visible")&&("string"==typeof c.copy||a.isFunction(c.copy))){ZeroClipboard.setMoviePath(c.path);var d=new ZeroClipboard.Client;a.isFunction(c.copy)&&b.bind("zClip_copy",c.copy),a.isFunction(c.beforeCopy)&&b.bind("zClip_beforeCopy",c.beforeCopy),a.isFunction(c.afterCopy)&&b.bind("zClip_afterCopy",c.afterCopy),d.setHandCursor(c.setHandCursor),d.setCSSEffects(c.setCSSEffects),d.addEventListener("mouseOver",function(a){b.trigger("mouseenter")}),d.addEventListener("mouseOut",function(a){b.trigger("mouseleave")}),d.addEventListener("mouseDown",function(e){b.trigger("mousedown"),a.isFunction(c.copy)?d.setText(b.triggerHandler("zClip_copy")):d.setText(c.copy),a.isFunction(c.beforeCopy)&&b.trigger("zClip_beforeCopy")}),d.addEventListener("complete",function(d,e){a.isFunction(c.afterCopy)?b.trigger("zClip_afterCopy"):(e.length>500&&(e=e.substr(0,500)+"...\n\n("+(e.length-500)+" characters not shown)"),b.removeClass("hover"),alert("Copied text to clipboard:\n\n "+e)),c.clickAfter&&b.trigger("click")}),d.glue(b[0],b.parent()[0]),a(window).bind("load resize",function(){d.reposition()})}})}if("string"==typeof b)return this.each(function(){var c=a(this);b=b.toLowerCase();var d=c.data("zclipId"),e=a("#"+d+".zclip");"remove"==b?(e.remove(),c.removeClass("active hover")):"hide"==b?(e.hide(),c.removeClass("active hover")):"show"==b&&e.show()})}}(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){return"string"==typeof a&&(a=document.getElementById(a)),a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a),this.className+=" "+a},a.removeClass=function(a){for(var b=this.className.split(/\s+/),c=-1,d=0;d-1&&(b.splice(c,1),this.className=b.join(" ")),this},a.hasClass=function(a){return!!this.className.match(new RegExp("\\s*"+a+"\\s*"))}),a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,c){var d=this.clients[a];d&&d.receiveEvent(b,c)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a,b){var c={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};return a&&a!=b&&(c.left+=a.offsetLeft,c.top+=a.offsetTop),c},Client:function(a){this.handlers={},this.id=ZeroClipboard.nextId++,this.movieId="ZeroClipboardMovie_"+this.id,ZeroClipboard.register(this.id,this),a&&this.glue(a)}};ZeroClipboard.Client.prototype={id:0,ready:!1,movie:null,clipText:"",handCursorEnabled:!0,cssEffects:!0,handlers:null,glue:function(a,b,c){this.domElement=ZeroClipboard.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex,10)+1),"string"==typeof b?b=ZeroClipboard.$(b):"undefined"==typeof b&&(b=document.getElementsByTagName("body")[0]);var e=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div"),this.div.className="zclip",this.div.id="zclip-"+this.movieId,$(this.domElement).data("zclipId","zclip-"+this.movieId);var f=this.div.style;if(f.position="absolute",f.left=""+e.left+"px",f.top=""+e.top+"px",f.width=""+e.width+"px",f.height=""+e.height+"px",f.zIndex=d,"object"==typeof c)for(addedStyle in c)f[addedStyle]=c[addedStyle];b.appendChild(this.div),this.div.innerHTML=this.getHTML(e.width,e.height)},getHTML:function(a,b){var c="",d="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+=''}else c+='';return c},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide(),this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null,this.div=null}},reposition:function(a){if(a&&(this.domElement=ZeroClipboard.$(a),this.domElement||this.hide()),this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement),c=this.div.style;c.left=""+b.left+"px",c.top=""+b.top+"px"}},setText:function(a){this.clipText=a,this.ready&&this.movie.setText(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=[]),this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a,this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){switch(a=a.toString().toLowerCase().replace(/^on/,"")){case"load":if(this.movie=document.getElementById(this.movieId),!this.movie){var c=this;return void setTimeout(function(){c.receiveEvent("load",null)},1)}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;return setTimeout(function(){c.receiveEvent("load",null)},100),void(this.ready=!0)}this.ready=!0;try{this.movie.setText(this.clipText)}catch(d){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(d){}break;case"mouseover":this.domElement&&this.cssEffects&&(this.domElement.addClass("hover"),this.recoverActive&&this.domElement.addClass("active"));break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0),this.domElement.removeClass("hover"));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var e=0,f=this.handlers[a].length;e=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!1,value:255,width:32,height:20});BI.each(d,function(b,d){d.on(BI.TextEditor.EVENT_CHANGE,function(){a._checkEditors(),c(a.storeValue.r)&&c(a.storeValue.g)&&c(a.storeValue.b)&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("")):a.setValue(a.lastColor||"#ffffff"),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("transparent")):("transparent"===a.lastColor&&(a.lastColor=""),a.setValue(a.lastColor||"#ffffff")),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,width:"fill"},{el:b[0],lgap:10,width:16},{el:this.R,width:32},{el:b[1],lgap:10,width:16},{el:this.G,width:32},{el:b[2],lgap:10,width:16},{el:this.B,width:32},{el:{type:"bi.center_adapt",items:[this.none]},width:18},{el:{type:"bi.center_adapt",items:[this.transparent]},width:18}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(a){""===a?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===a?this.colorShow.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":a}).removeClass("auto-color-background").removeClass("trans-color-background")},setValue:function(a){if("transparent"===a)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});a?this.none.setSelected(!1):(a="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(a);var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.storeValue={r:BI.isNull(b.r)?"":b.r,g:BI.isNull(b.r)?"":b.g,b:BI.isNull(b.r)?"":b.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="ColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:20})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var a=this;this.options;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card",height:20});var b=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:10,height:20})),c=function(a){return BI.isNumeric(a)&&(0|a)>=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:32,height:20});BI.each(d,function(b,c){c.on(BI.TextEditor.EVENT_CHANGE,function(){a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,lgap:5,rgap:5},{el:b[0],lgap:10,width:16},{el:this.R,width:36},{el:b[1],lgap:10,width:16},{el:this.G,width:36},{el:b[2],lgap:10,width:16},{el:this.B,width:36,rgap:10}]})},setValue:function(a){this.colorShow.element.css({"background-color":a});var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.R.setValue(BI.isNull(b.r)?"":b.r),this.G.setValue(BI.isNull(b.g)?"":b.g),this.B.setValue(BI.isNull(b.b)?"":b.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="SimpleColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-farbtastic",width:195,height:195})},_init:function(){BI.Farbtastic.superclass._init.apply(this,arguments)},mounted:function(){var a=this;this.farbtastic=$.farbtastic(this.element,function(b){a.fireEvent(BI.Farbtastic.EVENT_CHANGE,a.getValue(),a)})},setValue:function(a){this.farbtastic.setColor(a)},getValue:function(){return this.farbtastic.color}}),BI.Farbtastic.EVENT_CHANGE="Farbtastic.EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),jQuery.fn.farbtastic=function(a){return $.farbtastic(this,a),this},jQuery.farbtastic=function(a,b){var a=$(a).get(0);return a.farbtastic||(a.farbtastic=new jQuery._farbtastic(a,b))},jQuery._farbtastic=function(a,b){var c=this;$(a).html('
    ');var d=$(".farbtastic",a);c.wheel=$(".wheel",a).get(0),c.radius=84,c.square=100,c.width=194,navigator.appVersion.match(/MSIE [0-6]\./)&&$("*",d).each(function(){if("none"!=this.currentStyle.backgroundImage){var a=this.currentStyle.backgroundImage;a=this.currentStyle.backgroundImage.substring(5,a.length-2),$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+a+"')"})}}),c.linkTo=function(a){return"object"==typeof c.callback&&$(c.callback).unbind("keyup",c.updateValue),c.color=null,"function"==typeof a?c.callback=a:"object"!=typeof a&&"string"!=typeof a||(c.callback=$(a),c.callback.bind("keyup",c.updateValue),c.callback.get(0).value&&c.setColor(c.callback.get(0).value)),this},c.updateValue=function(a){this.value&&this.value!=c.color&&c.setColor(this.value)},c.setColor=function(a){var b=c.unpack(a);return c.color!=a&&b&&(c.color=a,c.rgb=b,c.hsl=c.RGBToHSL(c.rgb),c.updateDisplay()),this},c.setHSL=function(a){return c.hsl=a,c.rgb=c.HSLToRGB(a),c.color=c.pack(c.rgb),c.updateDisplay(),this},c.widgetCoords=function(a){var b,d,e=a.target||a.srcElement,f=c.wheel;if("undefined"!=typeof a.offsetX){for(var g={x:a.offsetX,y:a.offsetY},h=e;h;)h.mouseX=g.x,h.mouseY=g.y,g.x+=h.offsetLeft,g.y+=h.offsetTop,h=h.offsetParent;for(var h=f,i={x:0,y:0};h;){if("undefined"!=typeof h.mouseX){b=h.mouseX-i.x,d=h.mouseY-i.y;break}i.x+=h.offsetLeft,i.y+=h.offsetTop,h=h.offsetParent}for(h=e;h;)h.mouseX=void 0,h.mouseY=void 0,h=h.offsetParent}else{var g=c.absolutePosition(f);b=(a.pageX||0*(a.clientX+$("html").get(0).scrollLeft))-g.x,d=(a.pageY||0*(a.clientY+$("html").get(0).scrollTop))-g.y}return{x:b-c.width/2,y:d-c.width/2}},c.click=function(a){var b=c.widgetCoords(a);return c.circleDrag=2*Math.max(Math.abs(b.x),Math.abs(b.y))>c.square,c.mousemove(a),!1},c.mousemove=function(a){var b=c.widgetCoords(a);if(c.circleDrag){var d=Math.atan2(b.x,-b.y)/6.28;d<0&&(d+=1),c.setHSL([d,c.hsl[1],c.hsl[2]])}else{var e=Math.max(0,Math.min(1,-(b.x/c.square)+.5)),f=Math.max(0,Math.min(1,-(b.y/c.square)+.5));c.setHSL([c.hsl[0],e,f])}return!1},c.updateDisplay=function(){var a=6.28*c.hsl[0];$(".h-marker",d).css({left:Math.round(Math.sin(a)*c.radius+c.width/2)+"px",top:Math.round(-Math.cos(a)*c.radius+c.width/2)+"px"}),$(".sl-marker",d).css({left:Math.round(c.square*(.5-c.hsl[1])+c.width/2)+"px",top:Math.round(c.square*(.5-c.hsl[2])+c.width/2)+"px"}),$(".color",d).css("backgroundColor",c.pack(c.HSLToRGB([c.hsl[0],1,.5]))),"object"==typeof c.callback?($(c.callback).css({backgroundColor:c.color,color:c.hsl[2]>.5?"#000":"#fff"}),$(c.callback).each(function(){this.value&&this.value!=c.color&&(this.value=c.color)})):"function"==typeof c.callback&&c.callback.call(c,c.color)},c.absolutePosition=function(a){var b={x:a.offsetLeft,y:a.offsetTop};if(a.offsetParent){var d=c.absolutePosition(a.offsetParent);b.x+=d.x,b.y+=d.y}return b},c.pack=function(a){var b=Math.round(255*a[0]),c=Math.round(255*a[1]),d=Math.round(255*a[2]);return"#"+(b<16?"0":"")+b.toString(16)+(c<16?"0":"")+c.toString(16)+(d<16?"0":"")+d.toString(16)},c.unpack=function(a){return 7==a.length?[parseInt("0x"+a.substring(1,3))/255,parseInt("0x"+a.substring(3,5))/255,parseInt("0x"+a.substring(5,7))/255]:4==a.length?[parseInt("0x"+a.substring(1,2))/15,parseInt("0x"+a.substring(2,3))/15,parseInt("0x"+a.substring(3,4))/15]:void 0},c.HSLToRGB=function(a){var b,c,d=a[0],e=a[1],f=a[2];return c=f<=.5?f*(e+1):f+e-f*e,b=2*f-c,[this.hueToRGB(b,c,d+.33333),this.hueToRGB(b,c,d),this.hueToRGB(b,c,d-.33333)]},c.hueToRGB=function(a,b,c){return c=c<0?c+1:c>1?c-1:c,6*c<1?a+(b-a)*c*6:2*c<1?b:3*c<2?a+(b-a)*(.66666-c)*6:a},c.RGBToHSL=function(a){var b,c,d,e,f,g,h=a[0],i=a[1],j=a[2];return b=Math.min(h,Math.min(i,j)),c=Math.max(h,Math.max(i,j)),d=c-b,g=(b+c)/2,f=0,g>0&&g<1&&(f=d/(g<.5?2*g:2-2*g)),e=0,d>0&&(c==h&&c!=i&&(e+=(i-j)/d),c==i&&c!=j&&(e+=2+(j-h)/d),c==j&&c!=h&&(e+=4+(h-i)/d),e/=6),[e,f,g]},$("*",d).click(c.click),c.setColor("#000000"),b&&c.linkTo(b)},BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:b.trigger,toggle:b.toggle,direction:b.direction,isDefaultInit:b.isDefaultInit,destroyWhenHide:b.destroyWhenHide,isNeedAdjustHeight:b.isNeedAdjustHeight,isNeedAdjustWidth:b.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:b.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:b.hideChecker,offsetStyle:b.offsetStyle,el:b.el,popup:BI.extend({type:"bi.bubble_popup_view"},b.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){a.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){a.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){a._showTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){a._hideTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(a){var b={},c={},d=this.options.adjustLength,e=this.element.offset(),f=e.left,g=e.left+this.element.outerWidth(),h=e.top,i=e.top+this.element.outerHeight();switch(a){case"left":b={top:h,height:this.element.outerHeight(),left:f-d-this._const.TRIANGLE_LENGTH},c={width:this._const.TRIANGLE_LENGTH};break;case"right":b={top:h,height:this.element.outerHeight(),left:g+d},c={width:this._const.TRIANGLE_LENGTH};break;case"top":b={left:f,width:this.element.outerWidth(),top:h-d-this._const.TRIANGLE_LENGTH},c={height:this._const.TRIANGLE_LENGTH};break;case"bottom":b={left:f,width:this.element.outerWidth(),top:i+d},c={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(c,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+a+" bi-high-light-border"}]}),b.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var a=this.combo.getPopupPosition();switch(a.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:a.baseCls+" bi-bubble-popup-view"})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)},showLine:function(a){var b={},c={};switch(a){case"left":b={top:0,bottom:0,left:-1},c={width:3};break;case"right":b={top:0,bottom:0,right:-1},c={width:3};break;case"top":b={left:0,right:0,top:-1},c={height:3};break;case"bottom":b={left:0,right:0,bottom:-1},c={height:3}}this.line=BI.createWidget(c,{type:"bi.layout",cls:"bubble-popup-line bi-high-light-background"}),b.el=this.line,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},hideLine:function(){this.line&&this.line.destroy()}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:BI.i18nText("BI-Basic_Cancel"),level:"ignore"},{value:BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this,c=[];return BI.each(a.buttons,function(a,d){BI.isWidget(d)?c.push(d):c.push(BI.extend({type:"bi.button",height:30,handler:function(a){b.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,a)}},d))}),BI.createWidget({type:"bi.right_vertical_adapt",height:40,hgap:10,bgap:10,items:c})}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:{baseCls:"bi-text-bubble-bar-popup-view",text:"",width:250},render:function(){var a=this,b=this.options;return{type:"bi.bubble_bar_popup_view",ref:function(){a.popup=this},el:{type:"bi.vertical",items:[{type:"bi.label",text:b.text,whiteSpace:"normal",textAlign:"left",ref:function(){a.text=this}}],hgap:10,tgap:25,bgap:10},buttons:[{type:"bi.button",value:BI.i18nText("BI-Basic_Cancel"),level:"ignore",height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!1)}},{type:"bi.button",value:BI.i18nText("BI-Basic_Sure"),height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!0)}}]}},populate:function(a){this.text.setText(a||this.options.text)},showLine:function(a){this.popup.showLine(a)},hideLine:function(){this.popup.hideLine()}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:b.items,height:b.height,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText,value:b.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){a.popup.setValue(this.getValue()),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.editorIconCheckCombo.hideView(),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.editorIconCheckCombo.setValue(a)},getValue:function(){return this.trigger.getValue()},populate:function(a){this.options.items=a,this.editorIconCheckCombo.populate(a)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:28,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.icon_combo_trigger",iconCls:b.iconCls,title:b.title,items:b.items,width:b.width,height:b.height,iconWidth:b.iconWidth,iconHeight:b.iconHeight,value:b.value}),this.popup=BI.createWidget(b.popup,{type:"bi.icon_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.iconCombo.hideView(),a.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:b.direction,trigger:b.trigger,container:b.container,adjustLength:b.adjustLength,adjustXOffset:b.adjustXOffset,adjustYOffset:b.adjustYOffset,offsetStyle:b.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:b.maxWidth,maxHeight:b.maxHeight,minWidth:b.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.iconCombo.populate(a)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:28,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var a=this.options,b="";BI.isKey(a.value)&&(b=this._digest(a.value,a.items)),this.button=BI.createWidget(a.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:b,disableSelected:!0,width:a.isShowDown?a.width-12:a.width,height:a.height,iconWidth:a.iconWidth,iconHeight:a.iconHeight,selected:BI.isNotEmptyString(b)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font",width:12,height:8,selected:BI.isNotEmptyString(b)}),this.down.setVisible(a.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:0,bottom:0}]})},_digest:function(a,b){var c="";return a=BI.isArray(a)?a[0]:a,BI.any(b,function(b,d){if(a===d.value)return c=d.iconCls,!0}),c},populate:function(a){var b=this.options;this.options.items=a||[],this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(a){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var b=this.options,c=this._digest(a,this.options.items);a=BI.isArray(a)?a[0]:a,BI.isNotEmptyString(c)?(this.button.setIcon(c),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-icon-text-value-combo",height:30,iconHeight:null,iconWidth:null,value:""})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",items:b.items,height:b.height,text:b.text,defaultIconCls:b.defaultIconCls,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:b.items,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup"})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30,iconHeight:a.iconHeight,iconWidth:a.iconWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE, -layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var b=this.options;a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:30,text:"",items:[],tipType:"",warningTitle:""},render:function(){var a=this,b=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",adjustLength:2,toggle:!1,ref:function(){a.combo=this},el:{type:"bi.search_text_value_trigger",ref:function(){a.trigger=this},items:b.items,height:b.height-2,text:b.text,value:b.value,tipType:b.tipType,warningTitle:b.warningTitle,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:b.value,items:b.items,ref:function(){a.popup=this,a.trigger.getSearcher().setAdapter(a.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},maxHeight:302},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(b){return 0===a.triggerBtn.element.find(b.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){a.triggerBtn=this},width:b.height,height:b.height,handler:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var a=this.options;BI.isKey(a.value)&&this._checkError(a.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},populate:function(a){this.combo.populate(a)},setValue:function(a){this.combo.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var a=this,b=this.options;return{type:"bi.vertical",items:[{type:"bi.button_group",ref:function(){a.popup=this},items:BI.createItems(b.items,{type:"bi.single_select_item",textAlign:b.textAlign,height:30}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,c,d)}}]}]}},populate:function(a,b,c){var d=BI.concat(a,b);BI.SearchTextValueComboPopup.superclass.populate.apply(this,d),d=BI.createItems(d,{type:"bi.single_select_item",height:30}),this.popup.populate(d,c)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{baseCls:"bi-search-text-value-trigger bi-border",height:30},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){a.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){a.editor=this},text:this._digest(b.value,b.items),value:b.value,height:b.height},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(a,c){var d=a.keyword,e=BI.Func.getSearchResult(b.items,d),f=e.match,g=e.find;c(g,f)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){a.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:30},width:30}]}},_setState:function(a){this.editor.setState(a)},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(a){this.options.items=a},setValue:function(a){this._setState(this._digest(a,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.StaticCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-static-combo",height:24,text:"",el:{},items:[],chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.StaticCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",cls:"bi-border",items:b.items,height:b.height,text:b.text,readonly:!0}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",textAlign:b.textAlign,chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.StaticCombo.EVENT_CHANGE,arguments)}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}})},populate:function(a){this.combo.populate(a)},setValue:function(a){this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.StaticCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_combo",BI.StaticCombo),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:""})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCheckCombo.hideView(),a.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setTitle:function(a){this.trigger.setTitle(a)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},setWarningTitle:function(a){this.trigger.setWarningTitle(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCheckCombo.populate(a)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.SmallTextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:""})},_init:function(){BI.SmallTextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextIconCheckCombo.hideView(),a.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.SmallTextIconCheckCombo.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextIconCheckCombo.populate(a)}}),BI.SmallTextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_check_combo",BI.SmallTextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(a.items),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_formatItems:function(a){return BI.map(a,function(a,b){return BI.extend({type:"bi.icon_text_item",cls:"item-check-font bi-list-item",height:30},b)})},populate:function(a){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(a))},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:30,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:""})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,value:b.value,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this._checkError(b.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextValueCombo.hideView(),a.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextValueCombo.populate(a)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_item",textAlign:a.textAlign,height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:30})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this._createValueMap();var c;BI.isNotNull(b.value)&&(c=this._digest(b.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",height:b.height,items:b.items,text:b.text,value:c}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:b.height,el:this.trigger,value:BI.isNull(c)?[]:[c],items:BI.deepClone(b.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){a.setValue(a.combo.getValue()[0].value),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){a.setValue(a.combo.getValue()[0].childValue),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)})},_createValueMap:function(){var a=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(b,c){BI.has(c,"el")?BI.each(c.children,function(b,d){a.valueMap[d.value]={value:c.el.value,childValue:d.value}}):a.valueMap[c.value]={value:c.value}})},_digest:function(a){return this.valueMap[a]},setValue:function(a){a=this._digest(a),this.combo.setValue([a]),this.trigger.setValue(a)},getValue:function(){var a=this.combo.getValue()[0];return[a.childValue||a.value]},populate:function(a){this.options.items=BI.flatten(a),this.combo.populate(a),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:a.height,items:this._formatItemArray(a.items),text:a.text,value:BI.isNull(a.value)?"":a.value.childValue||a.value.value})},_formatItemArray:function(){var a=BI.flatten(BI.deepClone(this.options.items)),b=[];return BI.each(a,function(a,c){BI.has(c,"el")?(BI.each(c.children,function(a,b){b.text=c.el.text+"("+b.text+")"}),b=BI.concat(b,c.children)):b.push(c)}),b},setValue:function(a){this.trigger.setValue(a.childValue||a.value)},populate:function(a){this.trigger.populate(this._formatItemArray(a))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker,value:b.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(b.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:b.textAlign,height:b.height,hgap:4}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText(),this.text.doRedMark(b.keyword)},_checkText:function(){var a=this.options;""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setTextStyle:function(a){this.text.setStyle(a)},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignInitialEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignInitialEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-initial-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",value:"",text:"",height:24})},_init:function(){BI.SignInitialEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignInitialEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignInitialEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignInitialEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignInitialEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignInitialEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignInitialEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignInitialEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignInitialEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignInitialEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark");else{var b=this.editor.getValue();b=BI.isEmpty(b)||b==a.text?a.text:b+"("+a.text+")",this.text.setValue(b),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue(); -},setValue:function(a){var b=this.options;this.editor.setValue(a.value),b.text=a.text||b.text,this._checkText()},getValue:function(){return{value:this.editor.getValue(),text:this.options.text}},getState:function(){return this.text.getValue()},setState:function(a){var b=this.options;this._showHint(),a=BI.isEmpty(a)||a==b.text?b.text:a+"("+b.text+")",this.text.setValue(a)}}),BI.SignInitialEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignInitialEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignInitialEditor.EVENT_BLUR="EVENT_BLUR",BI.SignInitialEditor.EVENT_CLICK="EVENT_CLICK",BI.SignInitialEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignInitialEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignInitialEditor.EVENT_START="EVENT_START",BI.SignInitialEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignInitialEditor.EVENT_STOP="EVENT_STOP",BI.SignInitialEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignInitialEditor.EVENT_VALID="EVENT_VALID",BI.SignInitialEditor.EVENT_ERROR="EVENT_ERROR",BI.SignInitialEditor.EVENT_ENTER="EVENT_ENTER",BI.SignInitialEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignInitialEditor.EVENT_SPACE="EVENT_SPACE",BI.SignInitialEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_initial_editor",BI.SignInitialEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.StateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.setTitle(""),this.text.element.addClass("state-editor-infinite-text"))):BI.isString(a)?(this.text.setText(a),this.text.setTitle(a),void this.text.element.removeClass("state-editor-infinite-text")):void(BI.isArray(a)&&(BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):1===a.length?(this.text.setText(a[0]),this.text.setTitle(a[0]),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text"))))}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text"))):void(BI.isArray(a)&&1!==a.length?BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(a),this.text.setTitle(a),this.text.element.removeClass("state-editor-infinite-text")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor),BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this;if(0!==a.buttons.length){var c=[];return BI.each(a.buttons,function(a,b){c.push({text:b,value:a})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-border-top",height:30,items:BI.createItems(c,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(a,c){b.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,a,c)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var a=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var a=this,b=this.options,c=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return c.on(BI.IconButton.EVENT_CHANGE,function(){a.setVisible(!1),a.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-background bi-border",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:b.title,height:25,lgap:10}},{el:c,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var a=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget(b.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:b.items,itemsCreator:function(c,d){1===c.times&&(a.empty(),BI.nextTick(function(){a.loading()})),b.itemsCreator(c,function(){d.apply(a,arguments),1===c.times&&BI.nextTick(function(){a.loaded()})})},hasNext:b.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.ListPane.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,vgap:b.vgap,hgap:b.hgap},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(a){this.options.items=a.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(a){this.options.items=this.options.items.concat(a),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(a){a=a||[],BI.removeAt(this.options.items,a),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(a){var b=this;this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");b.populate.apply(b,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(a){return this.button_group.getIndexByValue(a)},getNodeById:function(a){return this.button_group.getNodeById(a)},getNodeByValue:function(a){return this.button_group.getNodeByValue(a)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var a=this,b=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:b.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:b.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Panel.EVENT_CHANGE,b,c)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(a){this.text.setValue(a)}}),BI.Panel.EVENT_CHANGE="Panel.EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var a=this,b=this.options;return[{type:"bi.label",text:b.text,height:b.height,value:b.value,hgap:b.hgap,ref:function(){a.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:3,ref:function(){a.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(a){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),a?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-border-bottom",items:[],height:29},render:function(){var a=this,b=this.options;return{type:"bi.button_group",items:BI.createItems(b.items,{type:"bi.linear_segment_button",height:b.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){a.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.buttonGroup=this}}},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar"},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.toolbar=BI.createWidget(b.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.allSelected=this.isSelected(),b===BI.Events.CLICK&&(a.setAllSelected(a.allSelected),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(b.el,{type:"bi.list_pane",items:b.items,itemsCreator:function(c,d){1===c.times&&a.toolbar.setVisible(!1),b.itemsCreator(c,function(b){d.apply(a,arguments),1===c.times&&(a.toolbar.setVisible(b&&b.length>0),a.toolbar.setEnable(b&&b.length>0)),a._checkAllSelected()})},onLoaded:b.onLoaded,hasNext:b.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){b===BI.Events.CLICK&&(a._checkAllSelected(),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(b.direction),BI.extend({scrolly:!0},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(b.direction,this.toolbar,this.list)})))),b.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(b.value)&&this.setValue(b.value)},_checkAllSelected:function(){var a=this.list.getValue().length,b=this.getAllLeaves().length-a,c=this.list.hasNext(),d=this.toolbar.isSelected(),e=a>0&&(b>0||!d&&c);e=e||b>0&&c&&d,this.toolbar.setHalfSelected(e),!e&&this.toolbar.setSelected(a>0&&b<=0&&(!c||d))},setAllSelected:function(a){BI.each(this.getAllButtons(),function(b,c){(c.setSelected||c.setAllSelected).apply(c,[a])}),this.allSelected=!!a,this.toolbar.setSelected(a),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(a){this.toolbar.setVisible(a)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(a){this.list.prependItems.apply(this.list,arguments)},addItems:function(a){this.list.addItems.apply(this.list,arguments)},setValue:function(a){var b=a.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(b),this.list[b?"setNotSelectedValue":"setValue"](a.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(a){this.toolbar.setVisible(!BI.isEmptyArray(a)),this.toolbar.setEnable(!BI.isEmptyArray(a)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(a){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(a)},resetHeight:function(a){var b=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(a-b):this.list.element.css({"max-height":a-b+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(a){return this.list.getIndexByValue(a)},getNodeById:function(a){return this.list.getNodeById(a)},getNodeByValue:function(a){return this.list.getNodeByValue(a)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var a=this,b=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var c=b.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:b.el,itemsCreator:function(b,c){c(a._getNextItems(b))},hasNext:function(a){return a.count=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!1,value:255,width:32,height:20});BI.each(d,function(b,d){d.on(BI.TextEditor.EVENT_CHANGE,function(){a._checkEditors(),c(a.storeValue.r)&&c(a.storeValue.g)&&c(a.storeValue.b)&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("")):a.setValue(a.lastColor||"#ffffff"),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(a.lastColor=a.getValue(),a.setValue("transparent")):("transparent"===a.lastColor&&(a.lastColor=""),a.setValue(a.lastColor||"#ffffff")),(a.R.isValid()&&a.G.isValid()&&a.B.isValid()||a._isEmptyRGB())&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,width:"fill"},{el:b[0],lgap:10,width:16},{el:this.R,width:32},{el:b[1],lgap:10,width:16},{el:this.G,width:32},{el:b[2],lgap:10,width:16},{el:this.B,width:32},{el:{type:"bi.center_adapt",items:[this.none]},width:18},{el:{type:"bi.center_adapt",items:[this.transparent]},width:18}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(a){""===a?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===a?this.colorShow.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":a}).removeClass("auto-color-background").removeClass("trans-color-background")},setValue:function(a){if("transparent"===a)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});a?this.none.setSelected(!1):(a="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(a);var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.storeValue={r:BI.isNull(b.r)?"":b.r,g:BI.isNull(b.r)?"":b.g,b:BI.isNull(b.r)?"":b.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="ColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:20})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var a=this;this.options;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card",height:20});var b=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:10,height:20})),c=function(a){return BI.isNumeric(a)&&(0|a)>=0&&(0|a)<=255},d=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:c,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:32,height:20});BI.each(d,function(b,c){c.on(BI.TextEditor.EVENT_CHANGE,function(){a.R.isValid()&&a.G.isValid()&&a.B.isValid()&&(a.colorShow.element.css("background-color",a.getValue()),a.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=d[0],this.G=d[1],this.B=d[2],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.colorShow,lgap:5,rgap:5},{el:b[0],lgap:10,width:16},{el:this.R,width:36},{el:b[1],lgap:10,width:16},{el:this.G,width:36},{el:b[2],lgap:10,width:16},{el:this.B,width:36,rgap:10}]})},setValue:function(a){this.colorShow.element.css({"background-color":a});var b=BI.DOM.rgb2json(BI.DOM.hex2rgb(a));this.R.setValue(BI.isNull(b.r)?"":b.r),this.G.setValue(BI.isNull(b.g)?"":b.g),this.B.setValue(BI.isNull(b.b)?"":b.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="SimpleColorPickerEditor.EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Farbtastic.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-farbtastic",width:195,height:195})},_init:function(){BI.Farbtastic.superclass._init.apply(this,arguments)},mounted:function(){var a=this;this.farbtastic=$.farbtastic(this.element,function(b){a.fireEvent(BI.Farbtastic.EVENT_CHANGE,a.getValue(),a)})},setValue:function(a){this.farbtastic.setColor(a)},getValue:function(){return this.farbtastic.color}}),BI.Farbtastic.EVENT_CHANGE="Farbtastic.EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),jQuery.fn.farbtastic=function(a){return $.farbtastic(this,a),this},jQuery.farbtastic=function(a,b){var a=$(a).get(0);return a.farbtastic||(a.farbtastic=new jQuery._farbtastic(a,b))},jQuery._farbtastic=function(a,b){var c=this;$(a).html('
    ');var d=$(".farbtastic",a);c.wheel=$(".wheel",a).get(0),c.radius=84,c.square=100,c.width=194,navigator.appVersion.match(/MSIE [0-6]\./)&&$("*",d).each(function(){if("none"!=this.currentStyle.backgroundImage){var a=this.currentStyle.backgroundImage;a=this.currentStyle.backgroundImage.substring(5,a.length-2),$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+a+"')"})}}),c.linkTo=function(a){return"object"==typeof c.callback&&$(c.callback).unbind("keyup",c.updateValue),c.color=null,"function"==typeof a?c.callback=a:"object"!=typeof a&&"string"!=typeof a||(c.callback=$(a),c.callback.bind("keyup",c.updateValue),c.callback.get(0).value&&c.setColor(c.callback.get(0).value)),this},c.updateValue=function(a){this.value&&this.value!=c.color&&c.setColor(this.value)},c.setColor=function(a){var b=c.unpack(a);return c.color!=a&&b&&(c.color=a,c.rgb=b,c.hsl=c.RGBToHSL(c.rgb),c.updateDisplay()),this},c.setHSL=function(a){return c.hsl=a,c.rgb=c.HSLToRGB(a),c.color=c.pack(c.rgb),c.updateDisplay(),this},c.widgetCoords=function(a){var b,d,e=a.target||a.srcElement,f=c.wheel;if("undefined"!=typeof a.offsetX){for(var g={x:a.offsetX,y:a.offsetY},h=e;h;)h.mouseX=g.x,h.mouseY=g.y,g.x+=h.offsetLeft,g.y+=h.offsetTop,h=h.offsetParent;for(var h=f,i={x:0,y:0};h;){if("undefined"!=typeof h.mouseX){b=h.mouseX-i.x,d=h.mouseY-i.y;break}i.x+=h.offsetLeft,i.y+=h.offsetTop,h=h.offsetParent}for(h=e;h;)h.mouseX=void 0,h.mouseY=void 0,h=h.offsetParent}else{var g=c.absolutePosition(f);b=(a.pageX||0*(a.clientX+$("html").get(0).scrollLeft))-g.x,d=(a.pageY||0*(a.clientY+$("html").get(0).scrollTop))-g.y}return{x:b-c.width/2,y:d-c.width/2}},c.click=function(a){var b=c.widgetCoords(a);return c.circleDrag=2*Math.max(Math.abs(b.x),Math.abs(b.y))>c.square,c.mousemove(a),!1},c.mousemove=function(a){var b=c.widgetCoords(a);if(c.circleDrag){var d=Math.atan2(b.x,-b.y)/6.28;d<0&&(d+=1),c.setHSL([d,c.hsl[1],c.hsl[2]])}else{var e=Math.max(0,Math.min(1,-(b.x/c.square)+.5)),f=Math.max(0,Math.min(1,-(b.y/c.square)+.5));c.setHSL([c.hsl[0],e,f])}return!1},c.updateDisplay=function(){var a=6.28*c.hsl[0];$(".h-marker",d).css({left:Math.round(Math.sin(a)*c.radius+c.width/2)+"px",top:Math.round(-Math.cos(a)*c.radius+c.width/2)+"px"}),$(".sl-marker",d).css({left:Math.round(c.square*(.5-c.hsl[1])+c.width/2)+"px",top:Math.round(c.square*(.5-c.hsl[2])+c.width/2)+"px"}),$(".color",d).css("backgroundColor",c.pack(c.HSLToRGB([c.hsl[0],1,.5]))),"object"==typeof c.callback?($(c.callback).css({backgroundColor:c.color,color:c.hsl[2]>.5?"#000":"#fff"}),$(c.callback).each(function(){this.value&&this.value!=c.color&&(this.value=c.color)})):"function"==typeof c.callback&&c.callback.call(c,c.color)},c.absolutePosition=function(a){var b={x:a.offsetLeft,y:a.offsetTop};if(a.offsetParent){var d=c.absolutePosition(a.offsetParent);b.x+=d.x,b.y+=d.y}return b},c.pack=function(a){var b=Math.round(255*a[0]),c=Math.round(255*a[1]),d=Math.round(255*a[2]);return"#"+(b<16?"0":"")+b.toString(16)+(c<16?"0":"")+c.toString(16)+(d<16?"0":"")+d.toString(16)},c.unpack=function(a){return 7==a.length?[parseInt("0x"+a.substring(1,3))/255,parseInt("0x"+a.substring(3,5))/255,parseInt("0x"+a.substring(5,7))/255]:4==a.length?[parseInt("0x"+a.substring(1,2))/15,parseInt("0x"+a.substring(2,3))/15,parseInt("0x"+a.substring(3,4))/15]:void 0},c.HSLToRGB=function(a){var b,c,d=a[0],e=a[1],f=a[2];return c=f<=.5?f*(e+1):f+e-f*e,b=2*f-c,[this.hueToRGB(b,c,d+.33333),this.hueToRGB(b,c,d),this.hueToRGB(b,c,d-.33333)]},c.hueToRGB=function(a,b,c){return c=c<0?c+1:c>1?c-1:c,6*c<1?a+(b-a)*c*6:2*c<1?b:3*c<2?a+(b-a)*(.66666-c)*6:a},c.RGBToHSL=function(a){var b,c,d,e,f,g,h=a[0],i=a[1],j=a[2];return b=Math.min(h,Math.min(i,j)),c=Math.max(h,Math.max(i,j)),d=c-b,g=(b+c)/2,f=0,g>0&&g<1&&(f=d/(g<.5?2*g:2-2*g)),e=0,d>0&&(c==h&&c!=i&&(e+=(i-j)/d),c==i&&c!=j&&(e+=2+(j-h)/d),c==j&&c!=h&&(e+=4+(h-i)/d),e/=6),[e,f,g]},$("*",d).click(c.click),c.setColor("#000000"),b&&c.linkTo(b)},BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:b.trigger,toggle:b.toggle,direction:b.direction,isDefaultInit:b.isDefaultInit,destroyWhenHide:b.destroyWhenHide,isNeedAdjustHeight:b.isNeedAdjustHeight,isNeedAdjustWidth:b.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:b.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:b.hideChecker,offsetStyle:b.offsetStyle,el:b.el,popup:BI.extend({type:"bi.bubble_popup_view"},b.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){a.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){a.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){a._showTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){a._hideTriangle(),a.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){a.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(a){var b={},c={},d=this.options.adjustLength,e=this.element.offset(),f=e.left,g=e.left+this.element.outerWidth(),h=e.top,i=e.top+this.element.outerHeight();switch(a){case"left":b={top:h,height:this.element.outerHeight(),left:f-d-this._const.TRIANGLE_LENGTH},c={width:this._const.TRIANGLE_LENGTH};break;case"right":b={top:h,height:this.element.outerHeight(),left:g+d},c={width:this._const.TRIANGLE_LENGTH};break;case"top":b={left:f,width:this.element.outerWidth(),top:h-d-this._const.TRIANGLE_LENGTH},c={height:this._const.TRIANGLE_LENGTH};break;case"bottom":b={left:f,width:this.element.outerWidth(),top:i+d},c={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(c,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+a+" bi-high-light-border"}]}),b.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var a=this.combo.getPopupPosition();switch(a.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:a.baseCls+" bi-bubble-popup-view"})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)},showLine:function(a){var b={},c={};switch(a){case"left":b={top:0,bottom:0,left:-1},c={width:3};break;case"right":b={top:0,bottom:0,right:-1},c={width:3};break;case"top":b={left:0,right:0,top:-1},c={height:3};break;case"bottom":b={left:0,right:0,bottom:-1},c={height:3}}this.line=BI.createWidget(c,{type:"bi.layout",cls:"bubble-popup-line bi-high-light-background"}),b.el=this.line,BI.createWidget({type:"bi.absolute",element:this,items:[b]})},hideLine:function(){this.line&&this.line.destroy()}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:BI.i18nText("BI-Basic_Cancel"),level:"ignore"},{value:BI.i18nText(BI.i18nText("BI-Basic_Sure"))}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this,c=[];return BI.each(a.buttons,function(a,d){BI.isWidget(d)?c.push(d):c.push(BI.extend({type:"bi.button",height:30,handler:function(a){b.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,a)}},d))}),BI.createWidget({type:"bi.right_vertical_adapt",height:40,hgap:10,bgap:10,items:c})}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:{baseCls:"bi-text-bubble-bar-popup-view",text:"",width:250},render:function(){var a=this,b=this.options;return{type:"bi.bubble_bar_popup_view",ref:function(){a.popup=this},el:{type:"bi.vertical",items:[{type:"bi.label",text:b.text,whiteSpace:"normal",textAlign:"left",ref:function(){a.text=this}}],hgap:10,tgap:25,bgap:10},buttons:[{type:"bi.button",value:BI.i18nText("BI-Basic_Cancel"),level:"ignore",height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!1)}},{type:"bi.button",value:BI.i18nText("BI-Basic_Sure"),height:24,handler:function(){a.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,!0)}}]}},populate:function(a){this.text.setText(a||this.options.text)},showLine:function(a){this.popup.showLine(a)},hideLine:function(){this.popup.hideLine()}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:b.items,height:b.height,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText,value:b.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){a.popup.setValue(this.getValue()),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.editorIconCheckCombo.hideView(),a.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.editorIconCheckCombo.setValue(a)},getValue:function(){return this.trigger.getValue()},populate:function(a){this.options.items=a,this.editorIconCheckCombo.populate(a)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:28,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.icon_combo_trigger",iconCls:b.iconCls,title:b.title,items:b.items,width:b.width,height:b.height,iconWidth:b.iconWidth,iconHeight:b.iconHeight,value:b.value}),this.popup=BI.createWidget(b.popup,{type:"bi.icon_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.iconCombo.hideView(),a.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:b.direction,trigger:b.trigger,container:b.container,adjustLength:b.adjustLength,adjustXOffset:b.adjustXOffset,adjustYOffset:b.adjustYOffset,offsetStyle:b.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:b.maxWidth,maxHeight:b.maxHeight,minWidth:b.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.iconCombo.populate(a)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:28,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var a=this.options,b="";BI.isKey(a.value)&&(b=this._digest(a.value,a.items)),this.button=BI.createWidget(a.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:b,disableSelected:!0,width:a.isShowDown?a.width-12:a.width,height:a.height,iconWidth:a.iconWidth,iconHeight:a.iconHeight,selected:BI.isNotEmptyString(b)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font",width:12,height:8,selected:BI.isNotEmptyString(b)}),this.down.setVisible(a.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:0,bottom:0}]})},_digest:function(a,b){var c="";return a=BI.isArray(a)?a[0]:a,BI.any(b,function(b,d){if(a===d.value)return c=d.iconCls,!0}),c},populate:function(a){var b=this.options;this.options.items=a||[],this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(a){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var b=this.options,c=this._digest(a,this.options.items);a=BI.isArray(a)?a[0]:a,BI.isNotEmptyString(c)?(this.button.setIcon(c),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(b.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-icon-text-value-combo",height:30,iconHeight:null,iconWidth:null,value:""})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",items:b.items,height:b.height,text:b.text,iconCls:b.iconCls,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:b.items,value:b.value,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup"})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_icon_text_item",height:30,iconHeight:a.iconHeight,iconWidth:a.iconWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical" +}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var b=this.options;a=BI.createItems(a,{type:"bi.single_select_icon_text_item",height:30,iconHeight:b.iconHeight,iconWidth:b.iconWidth}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:30,text:"",items:[],tipType:"",warningTitle:""},render:function(){var a=this,b=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",adjustLength:2,toggle:!1,ref:function(){a.combo=this},el:{type:"bi.search_text_value_trigger",ref:function(){a.trigger=this},items:b.items,height:b.height-2,text:b.text,value:b.value,tipType:b.tipType,warningTitle:b.warningTitle,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:b.value,items:b.items,ref:function(){a.popup=this,a.trigger.getSearcher().setAdapter(a.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){a.setValue(this.getValue()),a.combo.hideView(),a.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},maxHeight:302},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(b){return 0===a.triggerBtn.element.find(b.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){a.triggerBtn=this},width:b.height,height:b.height,handler:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var a=this.options;BI.isKey(a.value)&&this._checkError(a.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},populate:function(a){this.combo.populate(a)},setValue:function(a){this.combo.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var a=this,b=this.options;return{type:"bi.vertical",items:[{type:"bi.button_group",ref:function(){a.popup=this},items:BI.createItems(b.items,{type:"bi.single_select_item",textAlign:b.textAlign,height:30}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,c,d)}}]}]}},populate:function(a,b,c){var d=BI.concat(a,b);BI.SearchTextValueComboPopup.superclass.populate.apply(this,d),d=BI.createItems(d,{type:"bi.single_select_item",height:30}),this.popup.populate(d,c)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{baseCls:"bi-search-text-value-trigger bi-border",height:30},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){a.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){a.editor=this},text:this._digest(b.value,b.items),value:b.value,height:b.height},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(a,c){var d=a.keyword,e=BI.Func.getSearchResult(b.items,d),f=e.match,g=e.find;c(g,f)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){a.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:30},width:30}]}},_setState:function(a){this.editor.setState(a)},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(a){this.options.items=a},setValue:function(a){this._setState(this._digest(a,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.StaticCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-static-combo",height:24,text:"",el:{},items:[],chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.StaticCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",cls:"bi-border",items:b.items,height:b.height,text:b.text,readonly:!0}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",textAlign:b.textAlign,chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.StaticCombo.EVENT_CHANGE,arguments)}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}})},populate:function(a){this.combo.populate(a)},setValue:function(a){this.popup.setValue(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]}}),BI.StaticCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_combo",BI.StaticCombo),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:""})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCheckCombo.hideView(),a.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this.setValue(b.value)},setTitle:function(a){this.trigger.setTitle(a)},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},setWarningTitle:function(a){this.trigger.setWarningTitle(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCheckCombo.populate(a)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.SmallTextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:""})},_init:function(){BI.SmallTextValueCheckCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:b.chooseType,items:b.items,value:b.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextIconCheckCombo.hideView(),a.fireEvent(BI.SmallTextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextIconCheckCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.SmallTextIconCheckCombo.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextIconCheckCombo.populate(a)}}),BI.SmallTextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_check_combo",BI.SmallTextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(a.items),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,c,d)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_formatItems:function(a){return BI.map(a,function(a,b){return BI.extend({type:"bi.icon_text_item",cls:"item-check-font bi-list-item",height:30},b)})},populate:function(a){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(a))},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:30,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:""})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",items:b.items,height:b.height,text:b.text,value:b.value}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,value:b.value,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.textIconCombo.hideView(),a.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(b.value)&&this._checkError(b.value)},_checkError:function(a){if(BI.isNotNull(a)){a=BI.isArray(a)?a:[a];var b=BI.find(this.options.items,function(b,c){return BI.contains(a,c.value)});BI.isNull(b)?this.element.removeClass("combo-error").addClass("combo-error"):this.element.removeClass("combo-error")}},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a),this._checkError(a)},getValue:function(){var a=this.popup.getValue();return BI.isNull(a)?[]:BI.isArray(a)?a:[a]},populate:function(a){this.options.items=a,this.textIconCombo.populate(a)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget(b.el,{type:"bi.small_select_text_trigger",items:b.items,height:b.height,text:b.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:b.chooseType,items:b.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.SmallTextValueCombo.hideView(),a.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.options.items=a,this.SmallTextValueCombo.populate(a)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(a.items,{type:"bi.single_select_item",textAlign:a.textAlign,height:30}),chooseType:a.chooseType,layouts:[{type:"bi.vertical"}],value:a.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},populate:function(a){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),a=BI.createItems(a,{type:"bi.single_select_item",height:30}),this.popup.populate(a)},getValue:function(){return this.popup.getValue()},setValue:function(a){this.popup.setValue(a)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:30})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this._createValueMap();var c;BI.isNotNull(b.value)&&(c=this._digest(b.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",height:b.height,items:b.items,text:b.text,value:c}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:b.height,el:this.trigger,value:BI.isNull(c)?[]:[c],items:BI.deepClone(b.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){a.setValue(a.combo.getValue()[0].value),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){a.setValue(a.combo.getValue()[0].childValue),a.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE)})},_createValueMap:function(){var a=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(b,c){BI.has(c,"el")?BI.each(c.children,function(b,d){a.valueMap[d.value]={value:c.el.value,childValue:d.value}}):a.valueMap[c.value]={value:c.value}})},_digest:function(a){return this.valueMap[a]},setValue:function(a){a=this._digest(a),this.combo.setValue([a]),this.trigger.setValue(a)},getValue:function(){var a=this.combo.getValue()[0];return[a.childValue||a.value]},populate:function(a){this.options.items=BI.flatten(a),this.combo.populate(a),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:a.height,items:this._formatItemArray(a.items),text:a.text,value:BI.isNull(a.value)?"":a.value.childValue||a.value.value})},_formatItemArray:function(){var a=BI.flatten(BI.deepClone(this.options.items)),b=[];return BI.each(a,function(a,c){BI.has(c,"el")?(BI.each(c.children,function(a,b){b.text=c.el.text+"("+b.text+")"}),b=BI.concat(b,c.children)):b.push(c)}),b},setValue:function(a){this.trigger.setValue(a.childValue||a.value)},populate:function(a){this.trigger.populate(this._formatItemArray(a))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker,value:b.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(b.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:b.textAlign,height:b.height,hgap:4}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText(),this.text.doRedMark(b.keyword)},_checkText:function(){var a=this.options;""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setTextStyle:function(a){this.text.setStyle(a)},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignInitialEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignInitialEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-initial-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",value:"",text:"",height:24})},_init:function(){BI.SignInitialEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignInitialEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignInitialEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignInitialEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignInitialEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignInitialEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignInitialEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignInitialEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignInitialEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignInitialEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignInitialEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignInitialEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark");else{var b=this.editor.getValue();b=BI.isEmpty(b)||b==a.text?a.text:b+"("+a.text+")",this.text.setValue(b),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){ +var b=this.options;this.editor.setValue(a.value),b.text=a.text||b.text,this._checkText()},getValue:function(){return{value:this.editor.getValue(),text:this.options.text}},getState:function(){return this.text.getValue()},setState:function(a){var b=this.options;this._showHint(),a=BI.isEmpty(a)||a==b.text?b.text:a+"("+b.text+")",this.text.setValue(a)}}),BI.SignInitialEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignInitialEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignInitialEditor.EVENT_BLUR="EVENT_BLUR",BI.SignInitialEditor.EVENT_CLICK="EVENT_CLICK",BI.SignInitialEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignInitialEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignInitialEditor.EVENT_START="EVENT_START",BI.SignInitialEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignInitialEditor.EVENT_STOP="EVENT_STOP",BI.SignInitialEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignInitialEditor.EVENT_VALID="EVENT_VALID",BI.SignInitialEditor.EVENT_ERROR="EVENT_ERROR",BI.SignInitialEditor.EVENT_ENTER="EVENT_ENTER",BI.SignInitialEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignInitialEditor.EVENT_SPACE="EVENT_SPACE",BI.SignInitialEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_initial_editor",BI.SignInitialEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:b.title,warningTitle:b.warningTitle,tipType:b.tipType,textAlign:"left",height:b.height,hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a._checkText(),a.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a._checkText(),a.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),a._checkText()},_checkText:function(){var a=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(a.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(a){this.text.setTitle(a)},setWarningTitle:function(a){this.text.setWarningTitle(a)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(a){this._showHint(),this.text.setValue(a)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.StateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.setTitle(""),this.text.element.addClass("state-editor-infinite-text"))):BI.isString(a)?(this.text.setText(a),this.text.setTitle(a),void this.text.element.removeClass("state-editor-infinite-text")):void(BI.isArray(a)&&(BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):1===a.length?(this.text.setText(a[0]),this.text.setTitle(a[0]),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.setTitle(""),this.text.element.removeClass("state-editor-infinite-text"))))}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"state-editor-infinite-text",textAlign:"left",height:b.height,text:BI.i18nText("BI-Basic_Unrestricted"),hgap:4,handler:function(){a._showInput(),a.editor.focus(),a.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a._showHint(),a.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(b.text)&&this.setState(b.text)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(a){return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(a)?void(a===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):a===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text"))):void(BI.isArray(a)&&1!==a.length?BI.isEmpty(a)?(this.text.setText(BI.i18nText("BI-Basic_Unrestricted")),this.text.element.addClass("state-editor-infinite-text")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("state-editor-infinite-text")):(this.text.setText(a),this.text.setTitle(a),this.text.element.removeClass("state-editor-infinite-text")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor),BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var a=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var a=this.options,b=this;if(0!==a.buttons.length){var c=[];return BI.each(a.buttons,function(a,b){c.push({text:b,value:a})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-border-top",height:30,items:BI.createItems(c,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(a,c){b.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,a,c)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var a=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var a=this,b=this.options,c=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return c.on(BI.IconButton.EVENT_CHANGE,function(){a.setVisible(!1),a.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-background bi-border",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:b.title,height:25,lgap:10}},{el:c,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var a=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget(b.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:b.items,itemsCreator:function(c,d){1===c.times&&(a.empty(),BI.nextTick(function(){a.loading()})),b.itemsCreator(c,function(){d.apply(a,arguments),1===c.times&&BI.nextTick(function(){a.loaded()})})},hasNext:b.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.ListPane.EVENT_CHANGE,c,d)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,vgap:b.vgap,hgap:b.hgap},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(a){this.options.items=a.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(a){this.options.items=this.options.items.concat(a),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(a){a=a||[],BI.removeAt(this.options.items,a),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(a){var b=this;this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");b.populate.apply(b,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(a){return this.button_group.getIndexByValue(a)},getNodeById:function(a){return this.button_group.getNodeById(a)},getNodeByValue:function(a){return this.button_group.getNodeByValue(a)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var a=this,b=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:b.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:b.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Panel.EVENT_CHANGE,b,c)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(a){this.text.setValue(a)}}),BI.Panel.EVENT_CHANGE="Panel.EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var a=this,b=this.options;return[{type:"bi.label",text:b.text,height:b.height,value:b.value,hgap:b.hgap,ref:function(){a.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:3,ref:function(){a.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(a){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),a?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-border-bottom",items:[],height:29},render:function(){var a=this,b=this.options;return{type:"bi.button_group",items:BI.createItems(b.items,{type:"bi.linear_segment_button",height:b.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){a.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.buttonGroup=this}}},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar"},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.toolbar=BI.createWidget(b.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.allSelected=this.isSelected(),b===BI.Events.CLICK&&(a.setAllSelected(a.allSelected),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(b.el,{type:"bi.list_pane",items:b.items,itemsCreator:function(c,d){1===c.times&&a.toolbar.setVisible(!1),b.itemsCreator(c,function(b){d.apply(a,arguments),1===c.times&&(a.toolbar.setVisible(b&&b.length>0),a.toolbar.setEnable(b&&b.length>0)),a._checkAllSelected()})},onLoaded:b.onLoaded,hasNext:b.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){b===BI.Events.CLICK&&(a._checkAllSelected(),a.fireEvent(BI.SelectList.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(b.direction),BI.extend({scrolly:!0},b.logic,{items:BI.LogicFactory.createLogicItemsByDirection(b.direction,this.toolbar,this.list)})))),b.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(b.value)&&this.setValue(b.value)},_checkAllSelected:function(){var a=this.list.getValue().length,b=this.getAllLeaves().length-a,c=this.list.hasNext(),d=this.toolbar.isSelected(),e=a>0&&(b>0||!d&&c);e=e||b>0&&c&&d,this.toolbar.setHalfSelected(e),!e&&this.toolbar.setSelected(a>0&&b<=0&&(!c||d))},setAllSelected:function(a){BI.each(this.getAllButtons(),function(b,c){(c.setSelected||c.setAllSelected).apply(c,[a])}),this.allSelected=!!a,this.toolbar.setSelected(a),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(a){this.toolbar.setVisible(a)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(a){this.list.prependItems.apply(this.list,arguments)},addItems:function(a){this.list.addItems.apply(this.list,arguments)},setValue:function(a){var b=a.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(b),this.list[b?"setNotSelectedValue":"setValue"](a.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(a){this.toolbar.setVisible(!BI.isEmptyArray(a)),this.toolbar.setEnable(!BI.isEmptyArray(a)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(a){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(a)},resetHeight:function(a){var b=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(a-b):this.list.element.css({"max-height":a-b+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(a){return this.list.getIndexByValue(a)},getNodeById:function(a){return this.list.getNodeById(a)},getNodeByValue:function(a){return this.list.getNodeByValue(a)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var a=this,b=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var c=b.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:b.el,itemsCreator:function(b,c){c(a._getNextItems(b))},hasNext:function(a){return a.count=1)},setValue:function(a){this.pager.setValue(a)},setVPage:function(a){this.pager.setValue(a)},setCount:function(a){this.rowCount.setText(a),this.rowCount.setTitle(a)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(a){this.editor.setVisible(a),this.allPages.setVisible(a),this.pager.setVisible(a)},populate:function(){this.pager.populate()}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager),BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:30,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var a=this.options;a.vertical,a.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:5,right:74},{el:this.vlabel,top:5,right:111},{el:this.hpager,top:5,right:-9},{el:this.hlabel,top:5,right:28}]})},_createVPager:function(){var a=this,b=this.options,c=b.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:20,value:c.curr,title:c.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:76,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24,vgap:1}],invisible:!0,dynamicShow:!1,pages:c.pages,curr:c.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-prev column-pre-page-h-font"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-next column-next-page-h-font"},hasPrev:c.hasPrev,hasNext:c.hasNext,firstPage:c.firstPage,lastPage:c.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){a.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){a.vlabel.setValue(this.getCurrentPage()),a.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var a=this,b=this.options,c=b.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:20,value:c.curr,title:c.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:76,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24,vgap:1}],invisible:!0,dynamicShow:!1,pages:c.pages,curr:c.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-prev row-pre-page-h-font"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:20,iconWidth:16,iconHeight:16,cls:"direction-pager-next row-next-page-h-font"},hasPrev:c.hasPrev,hasNext:c.hasNext,firstPage:c.firstPage,lastPage:c.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){a.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){a.hlabel.setValue(this.getCurrentPage()),a.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(a){this.vpager.setValue(a),this.vlabel.setValue(a),this.vlabel.setTitle(a)},setHPage:function(a){this.hpager.setValue(a),this.hlabel.setValue(a),this.hlabel.setTitle(a)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(a){this.hpager.setVisible(a),this.hlabel.setVisible(a)},setVPagerVisible:function(a){this.vpager.setVisible(a),this.vlabel.setVisible(a)},populate:function(){this.vpager.populate(),this.hpager.populate();var a=!1,b=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),b=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),a=!0):this.setVPagerVisible(!1),this.setVisible(b||a);var c=[74,111,-9,28],d=this.layout.attr("items");a===!0&&b===!0?(d[0].right=c[0],d[1].right=c[1],d[2].right=c[2],d[3].right=c[3]):a===!0?(d[0].right=c[2],d[1].right=c[3]):b===!0&&(d[2].right=c[2],d[3].right=c[3]),this.layout.attr("items",d),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager),BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var a=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){a._lock=!1},300),this._populate()},_populate:function(){var a=this,b=this.options,c=[],d={};this.empty();var e=BI.result(b,"pages"),f=BI.result(this,"currPage"),g=BI.result(b,"groups"),h=BI.result(b,"first"),i=BI.result(b,"last"),j=BI.result(b,"prev"),k=BI.result(b,"next");e===!1?(g=0,h=!1,i=!1):g>e&&(g=e),d.index=Math.ceil((f+(g>1&&g!==e?1:0))/(0===g?1:g)),(!b.dynamicShow&&!b.dynamicShowPrevNext||f>1)&&j!==!1&&(BI.isKey(j)?c.push({text:j,value:"prev",disabled:e===!1?b.hasPrev(f)===!1:!(f>1&&j!==!1)}):c.push(BI.extend({disabled:e===!1?b.hasPrev(f)===!1:!(f>1&&j!==!1)},j))),(!b.dynamicShow&&!b.dynamicShowFirstLast||d.index>1&&0!==g)&&h&&(c.push({text:h,value:"first",disabled:!(d.index>1&&0!==g)}),d.index>1&&0!==g&&c.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),d.poor=Math.floor((g-1)/2),d.start=d.index>1?f-d.poor:1,d.end=d.index>1?function(){var a=f+(g-d.poor-1);return a>e?e:a}():g,d.end-d.start1&&0!==g&&e>g&&d.endg&&d.endg&&d.endg&&d.end1},hasNext:function(a){a||(a=1);var b=this.options,c=this.options.pages;return c===!1?b.hasNext(a):ac?c:(d=BI.result(b,"firstPage"),ab.pages?b.pages:a,this.currPage=a;this._populate()},getValue:function(){var a=this.button_group.getValue()[0];switch(a){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return a}},attr:function(a,b){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===a&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager),BI.RichEditorAction=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.RichEditorAction.superclass._defaultConfig.apply(this,arguments),{width:20,height:20,command:"",used:!0})},_init:function(){BI.RichEditorAction.superclass._init.apply(this,arguments);var a=this,b=this.options;b.editor.on(BI.NicEditor.EVENT_SELECTED,function(c){b.used===!0&&(a.setEnable(!0),a.checkNodes(c.target),a.key(c))}),b.editor.on(BI.NicEditor.EVENT_BLUR,function(){a.setEnable(!1)}),b.editor.on(BI.NicEditor.EVENT_KEYDOWN,BI.bind(this.keydown,this)),b.used===!1&&this.setEnable(!1)},checkNodes:function(a){if(!a)return!1;var b=a;do if(this.options.tags&&this.options.tags.contains(b.nodeName))return this.activate(),!0;while(b=b.parentNode&&b.className&&b.className.indexOf("bi-nic-editor")>=-1);for(b=a;3==b.nodeType;)b=b.parentNode;if(this.options.css)for(var c in this.options.css){if(null==this.options.css[c])return this.activate($(b).css(c)),!0;if($(b).css(c)==this.options.css[c])return this.activate(),!0}return this.deactivate(),!1},start:function(){},key:function(){},keydown:function(){},hideIf:function(a){},activate:function(){},deactivate:function(){},doCommand:function(a){this.options.command&&this.options.editor.nicCommand(this.options.command,a)}}),BI.RichEditorParamAction=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorParamAction.superclass._defaultConfig.apply(this,arguments),{paramFormatter:function(a){return a}})},_init:function(){BI.RichEditorParamAction.superclass._init.apply(this,arguments)},addParam:function(a){var b=this.options,c=(b.editor.instance,new Image),d=BI.DOM.getImage(b.paramFormatter(a));c.src=d.src,c.alt=a,c.style=d.style,$(c).addClass("rich-editor-param"),this.options.editor.insertHTML($("
    ").append(c).html())}}),BI.RichEditorTextToolbar=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-text-toolbar bi-background",buttons:[{type:"bi.rich_editor_font_chooser"},{type:"bi.rich_editor_size_chooser"},{type:"bi.rich_editor_bold_button"},{type:"bi.rich_editor_italic_button"},{type:"bi.rich_editor_underline_button"},{type:"bi.rich_editor_color_chooser"},{type:"bi.rich_editor_background_color_chooser"},{type:"bi.rich_editor_align_left_button"},{type:"bi.rich_editor_align_center_button"},{type:"bi.rich_editor_align_right_button"},{type:"bi.rich_editor_param_button"}],height:28})},_init:function(){BI.RichEditorTextToolbar.superclass._init.apply(this,arguments);var a=this.options,b=BI.createWidgets(BI.map(a.buttons,function(b,c){return BI.extend(c,{editor:a.editor})}));this.element.mousedown(function(a){BI.each(b,function(b,c){c.hideIf(a)})}),BI.createWidget({type:"bi.left",element:this,items:b,hgap:3,vgap:3})},mounted:function(){var a=this;BI.isIE9Below()&&(this.element.mousedown(function(){a._noSelect(a.element[0])}),this._noSelect(this.element[0]))},_noSelect:function(a){a.setAttribute&&"input"!=a.nodeName.toLowerCase()&&"textarea"!=a.nodeName.toLowerCase()&&a.setAttribute("unselectable","on");for(var b=0;b0?a.getRangeAt(0):a.createRange()},selRng:function(a,b){window.getSelection?(b.removeAllRanges(),b.addRange(a)):a.select()},selElm:function(){var a=this.getRng();if(a){if(a.startContainer){var b=a.startContainer;if(1==a.cloneContents().childNodes.length)for(var c=0;c0&&this.colorchooser.hideView()},deactivate:function(){}}),BI.shortcut("bi.rich_editor_background_color_chooser",BI.RichEditorBackgroundColorChooser),BI.RichEditorColorChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this,arguments),{width:20,height:20,command:"foreColor",css:{color:null}})},_init:function(){BI.RichEditorColorChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.colorchooser=BI.createWidget({type:"bi.color_chooser",element:this,width:b.width,height:b.height,el:{type:"bi.rich_editor_color_chooser_trigger",title:BI.i18nText("BI-Font_Colour"),cls:"text-toolbar-button"}}),this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE,function(){a.doCommand(this.getValue())})},hideIf:function(a){!this.colorchooser.element.find(a.target).length>0&&this.colorchooser.hideView()},activate:function(a){this.colorchooser.setValue(BI.DOM.rgb2hex(a))},deactivate:function(){this.colorchooser.setValue("")}}),BI.shortcut("bi.rich_editor_color_chooser",BI.RichEditorColorChooser),BI.RichEditorFontChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorFontChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-font-chooser bi-border bi-card",command:"FontName",width:50,height:20})},_init:function(){BI.RichEditorSizeChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",readonly:!0,height:b.height,triggerWidth:16,text:BI.i18nText("BI-Font_Family")}),this.combo=BI.createWidget({type:"bi.combo",element:this,el:this.trigger,adjustLength:1,popup:{minWidth:70,el:{type:"bi.button_group",items:BI.createItems([{value:"Microsoft YaHei",text:BI.i18nText("BI-Microsoft_YaHei")},{value:"PingFangSC-Light !important",text:BI.i18nText("BI-Apple_Light")},{value:"arial",text:"Arial"},{value:"Verdana",text:"Verdana"}],{type:"bi.single_select_item"}),layouts:[{type:"bi.vertical"}]}}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){var b=this.getValue()[0];a.doCommand(b),this.hideView(),this.setValue([])})},hideIf:function(a){!this.combo.element.find(a.target).length>0&&this.combo.hideView()}}),BI.shortcut("bi.rich_editor_font_chooser",BI.RichEditorFontChooser),BI.RichEditorSizeChooser=BI.inherit(BI.RichEditorAction,{_defaultConfig:function(){return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-rich-editor-size-chooser bi-border bi-card",command:"FontSize",width:50,height:20})},_items:[{value:1,text:"1(8pt)"},{value:2,text:"2(10pt)"},{value:3,text:"3(12pt)"},{value:4,text:"4(14pt)"},{value:5,text:"5(18pt)"},{value:6,text:"6(24pt)"}],_init:function(){BI.RichEditorSizeChooser.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",readonly:!0,height:b.height,triggerWidth:16,text:BI.i18nText("BI-Font_Size")}),this.combo=BI.createWidget({type:"bi.combo",element:this,el:this.trigger,adjustLength:1,popup:{maxWidth:70,minWidth:70,el:{type:"bi.button_group",items:BI.createItems(this._items,{type:"bi.single_select_item"}),layouts:[{type:"bi.vertical"}]}}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){var b=this.getValue()[0];a.doCommand(b),this.hideView(),this.setValue([])})},hideIf:function(a){!this.combo.element.find(a.target).length>0&&this.combo.hideView()}}),BI.shortcut("bi.rich_editor_size_chooser",BI.RichEditorSizeChooser),BI.RichEditor=BI.inherit(BI.Widget,{props:{baseCls:"bi-rich-editor bi-textarea",toolbar:{},readOnly:!1},render:function(){var a=this,b=this.options,c={type:"bi.nic_editor",width:b.width,height:b.height,readOnly:b.readOnly,ref:function(){a.editor=this},listeners:[{eventName:BI.NicEditor.EVENT_BLUR,action:function(){a.fireEvent(BI.RichEditor.EVENT_CONFIRM)}},{eventName:BI.NicEditor.EVENT_FOCUS,action:function(){b.readOnly||a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.RichEditor.EVENT_FOCUS)}}]};return b.readOnly?c:(this.editor=BI.createWidget(c),{type:"bi.combo",toggle:!1,trigger:"click",direction:"top,right",isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,adjustLength:1,ref:function(){a.combo=this},el:this.editor,popup:{el:BI.extend({type:"bi.rich_editor_text_toolbar",editor:this.editor},b.toolbar),height:30,stopPropagation:!0,stopEvent:!0},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){a.fireEvent(BI.RichEditor.EVENT_AFTER_HIDEVIEW)}}]})},mounted:function(){var a=this.options;BI.isNull(a.value)&&this.editor.setValue(a.value)},focus:function(){this.editor.focus()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()}}),BI.RichEditor.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.RichEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.RichEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.rich_editor",BI.RichEditor),BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-segment-button bi-list-item-active",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,height:a.height-2,whiteSpace:a.whiteSpace,text:a.text,value:a.value,hgap:a.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(a){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(a)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton),BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var a=this,b=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:b.value,items:BI.createItems(b.items,{type:"bi.segment_button",height:b.height-2,whiteSpace:b.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.Segment.EVENT_CHANGE,b,c)})},setValue:function(a){this.buttonGroup.setValue(a)},setEnabledValue:function(a){this.buttonGroup.setEnabledValue(a)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment),BI.AdaptiveTable=BI.inherit(BI.Widget,{_const:{perColumnSize:100},_defaultConfig:function(){return BI.extend(BI.AdaptiveTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-adaptive-table",el:{type:"bi.resizable_table"},isNeedResize:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!1,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.AdaptiveTable.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._digest();this.table=BI.createWidget(b.el,{type:"bi.resizable_table",element:this,width:b.width,height:b.height,isNeedResize:b.isNeedResize,isResizeAdapt:!1,isNeedFreeze:b.isNeedFreeze,freezeCols:c.freezeCols,isNeedMerge:b.isNeedMerge,mergeCols:b.mergeCols,mergeRule:b.mergeRule,columnSize:c.columnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:c.regionColumnSize,header:b.header,items:b.items,crossHeader:b.crossHeader,crossItems:b.crossItems}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),a._populate(),a.table.populate(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.columnSize=this.getColumnSize(),a._populate(),a.table.populate(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_getFreezeColLength:function(){var a=this.options;return a.isNeedFreeze===!0?BI.clamp(a.freezeCols.length,0,a.columnSize.length):0},_digest:function(){var a=this.options,b=a.columnSize.slice(),c=a.regionColumnSize.slice(),d=a.freezeCols.slice(),e=a.regionColumnSize[0],f=this._getFreezeColLength();if(!e||e>a.width-10||e<10){var g=BI.sum(b,function(a,b){return a=b.length&&(d=[]),BI.isNumber(b[0])||(b=a.minColumnSize.slice());var h=0,i=0;return BI.each(b,function(a,b){a0&&(b[f-1]=BI.clamp(e-(h-b[f-1]),a.minColumnSize[f-1]||10,a.maxColumnSize[f-1]||Number.MAX_VALUE)),b.length>0&&(b[b.length-1]=BI.clamp(a.width-BI.GridTableScrollbar.SIZE-e-(i-h-b[b.length-1]),a.minColumnSize[b.length-1]||10,a.maxColumnSize[b.length-1]||Number.MAX_VALUE)),c[0]=e,{freezeCols:d,columnSize:b,regionColumnSize:c}},_populate:function(){var a=this.options,b=this._digest();a.regionColumnSize=b.regionColumnSize,a.columnSize=b.columnSize,this.table.setColumnSize(b.columnSize),this.table.setRegionColumnSize(b.regionColumnSize),this.table.attr("freezeCols",b.freezeCols)},setWidth:function(a){BI.AdaptiveTable.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.AdaptiveTable.superclass.setHeight.apply(this,arguments),this.table.setHeight(a)},setColumnSize:function(a){this.options.columnSize=a},getColumnSize:function(){return this.table.getColumnSize()},setRegionColumnSize:function(a){this.options.regionColumnSize=a},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(a,b){var c=BI.AdaptiveTable.superclass.attr.apply(this,arguments);return"freezeCols"===a?c:this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a){this.options;this._populate(),this.table.populate.apply(this.table,arguments)},destroy:function(){this.table.destroy(),BI.AdaptiveTable.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.adaptive_table",BI.AdaptiveTable),BI.DynamicSummaryLayerTreeTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DynamicSummaryLayerTreeTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-dynamic-summary-layer-tree-table",el:{type:"bi.resizable_table"},isNeedResize:!0,isResizeAdapt:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,footerRowSize:25,rowSize:25,regionColumnSize:[],rowHeaderCreator:null,headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],footer:!1,items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_createHeader:function(a){var b=this.options,c=b.header||[],d=b.crossHeader||[],e=BI.TableTree.formatCrossItems(b.crossItems,a,b.headerCellStyleGetter),f=[];BI.each(e,function(a,b){var c=[d[a]];f.push(c.concat(b||[]))});var g=BI.isFunction(b.rowHeaderCreator)?b.rowHeaderCreator():b.rowHeaderCreator;if(c&&c.length>0){var h=this._formatColumns(c),i=this._getHDeep();i<=0?h.unshift(g||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter}):h[0]=g||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter},f.push(h)}return f},_formatItems:function(a,b,c){function d(a,b){a.type||(a.type="bi.layer_tree_table_cell"),a.layer=b;var c=[a];c=c.concat(a.values||[]),c.length>0&&f.push(c),BI.isNotEmptyArray(a.children)&&BI.each(a.children,function(a,c){d(c,b+1)})}var e=this.options,f=[];return BI.each(a,function(a,b){if(BI.each(b.children,function(a,b){d(b,0)}),BI.isArray(b.values)){var c=[{type:"bi.table_style_cell",text:BI.i18nText("BI-Summary_Values"),styleGetter:function(){return e.summaryCellStyleGetter(!0)}}].concat(b.values);f.push(c)}}),BI.DynamicSummaryTreeTable.formatSummaryItems(f,b,e.crossItems,1)},_formatColumns:function(a,b){return BI.isNotEmptyArray(a)?(b=b||this._getHDeep(),a.slice(Math.max(0,b-1))):a},_formatFreezeCols:function(){return this.options.freezeCols.length>0?[0]:[]},_formatColumnSize:function(a,b){if(a.length<=0)return[];var c=[0];return b=b||this._getHDeep(),BI.each(a,function(a,d){return a1)for(var c=0;c1)&&BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e1?g+=a.values.length:g++}var f=[],g=0;if(BI.each(c,function(a,b){e(b)}),f.length>0){var h=[],i=[];BI.each(b,function(a,b){var c=b.slice();BI.removeAt(c,f),h.push(c)}),BI.each(a,function(a,b){var c=b.slice();BI.removeAt(c,f),i.push(c)}),b=h,a=i}return{items:a,header:b,deletedCols:f}}}),BI.shortcut("bi.dynamic_summary_tree_table",BI.DynamicSummaryTreeTable),BI.LayerTreeTableCell=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LayerTreeTableCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-layer-tree-table-cell",layer:0,text:""})},_init:function(){BI.LayerTreeTableCell.superclass._init.apply(this,arguments);var a=this.options;BI.createWidget({type:"bi.label",element:this.element,textAlign:"left",whiteSpace:"nowrap",height:a.height,text:a.text,value:a.value,lgap:5+30*a.layer,rgap:5})}}),BI.shortcut("bi.layer_tree_table_cell",BI.LayerTreeTableCell),BI.LayerTreeTable=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LayerTreeTable.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-layer-tree-table",el:{type:"bi.resizable_table"},isNeedResize:!1,isResizeAdapt:!0,isNeedFreeze:!1,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],rowHeaderCreator:null,headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_createHeader:function(a){var b=this.options,c=b.header||[],d=b.crossHeader||[],e=BI.TableTree.formatCrossItems(b.crossItems,a,b.headerCellStyleGetter),f=[];if(BI.each(e,function(a,b){var c=[d[a]];f.push(c.concat(b||[]))}),c&&c.length>0){var g=this._formatColumns(c),h=this._getHDeep();h<=0?g.unshift(b.rowHeaderCreator||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter}):g[0]=b.rowHeaderCreator||{type:"bi.table_style_cell",text:BI.i18nText("BI-Row_Header"),styleGetter:b.headerCellStyleGetter},f.push(g)}return f},_formatItems:function(a){function b(a,c){a.type||(a.type="bi.layer_tree_table_cell"),a.layer=c;var e=[a];e=e.concat(a.values||[]),e.length>0&&d.push(e),BI.isNotEmptyArray(a.children)&&BI.each(a.children,function(a,d){b(d,c+1)})}var c=this.options,d=[];return BI.each(a,function(a,e){if(BI.each(e.children,function(a,c){b(c,0)}),BI.isArray(e.values)){var f=[{type:"bi.table_style_cell",text:BI.i18nText("BI-Summary_Values"),styleGetter:function(){return c.summaryCellStyleGetter(!0)}}].concat(e.values);d.push(f)}}),d},_formatColumns:function(a,b){return BI.isNotEmptyArray(a)?(b=b||this._getHDeep(),a.slice(Math.max(0,b-1))):a},_formatFreezeCols:function(){return this.options.freezeCols.length>0?[0]:[]},_formatColumnSize:function(a,b){if(a.length<=0)return[];var c=[0];return b=b||this._getHDeep(),BI.each(a,function(a,d){return a0&&(c=BI.makeArray(b,a[0]/b)),c.concat(a.slice(1))},setRegionColumnSize:function(a){this.options.regionColumnSize=a,this.table.setRegionColumnSize(a)},getRegionColumnSize:function(){return this.table.getRegionColumnSize()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(a,b){var c=this;if(BI.isObject(a))return void BI.each(a,function(a,b){c.attr(a,b)});switch(BI.LayerTreeTable.superclass.attr.apply(this,arguments),a){case"columnSize":case"minColumnSize":case"maxColumnSize":case"freezeCols":case"mergeCols":return}this.table.attr.apply(this.table,[a,b])},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;e.items=a||[],b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.setColumnSize(f.columnSize),this.table.attr("freezeCols",f.freezeCols),this.table.attr("minColumnSize",f.minColumnSize),this.table.attr("maxColumnSize",f.maxColumnSize),this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.LayerTreeTable.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.layer_tree_table",BI.LayerTreeTable),BI.TableStyleCell=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TableStyleCell.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-style-cell",styleGetter:BI.emptyFn})},_init:function(){BI.TableStyleCell.superclass._init.apply(this,arguments);var a=this.options;this.text=BI.createWidget({type:"bi.label",element:this,height:a.height,textAlign:"left",forceCenter:!0,hgap:5,text:a.text}),this._digestStyle()},_digestStyle:function(){var a=this.options,b=a.styleGetter();b&&this.text.element.css(b)},setText:function(a){this.text.setText(a)},populate:function(){this._digestStyle()}}),BI.shortcut("bi.table_style_cell",BI.TableStyleCell),BI.TableTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TableTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-table-tree",el:{type:"bi.resizable_table"},isNeedResize:!0,isResizeAdapt:!0,freezeCols:[],isNeedMerge:!0,mergeCols:[],mergeRule:BI.emptyFn,columnSize:[],minColumnSize:[],maxColumnSize:[],headerRowSize:25,rowSize:25,regionColumnSize:[],headerCellStyleGetter:BI.emptyFn,summaryCellStyleGetter:BI.emptyFn,sequenceCellStyleGetter:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_getVDeep:function(){return this.options.crossHeader.length},_getHDeep:function(){var a=this.options;return Math.max(a.mergeCols.length,a.freezeCols.length,BI.TableTree.maxDeep(a.items)-1)},_init:function(){BI.TableTree.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._digest();this.table=BI.createWidget(b.el,{type:"bi.resizable_table",element:this,width:b.width,height:b.height,isNeedResize:b.isNeedResize,isResizeAdapt:b.isResizeAdapt,isNeedFreeze:b.isNeedFreeze,freezeCols:b.freezeCols,isNeedMerge:b.isNeedMerge,mergeCols:b.mergeCols,mergeRule:b.mergeRule,columnSize:b.columnSize, -minColumnSize:b.minColumnSize,maxColumnSize:b.maxColumnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:b.regionColumnSize,header:c.header,items:c.items}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_digest:function(){var a=this.options,b=this._getHDeep(),c=this._getVDeep(),d=BI.TableTree.formatHeader(a.header,a.crossHeader,a.crossItems,b,c,a.headerCellStyleGetter),e=BI.TableTree.formatItems(a.items,b,!1,a.summaryCellStyleGetter);return{header:d,items:e}},setWidth:function(a){BI.TableTree.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.TableTree.superclass.setHeight.apply(this,arguments),this.table.setHeight(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()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(){BI.TableTree.superclass.attr.apply(this,arguments),this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;a&&(e.items=a||[]),b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.TableTree.superclass.destroy.apply(this,arguments)}}),BI.extend(BI.TableTree,{formatHeader:function(a,b,c,d,e,f){for(var g=BI.TableTree.formatCrossItems(c,e,f),h=[],i=0;i0&&h.push(a),h},formatItems:function(a,b,c,d){function e(a,g){var h;if(BI.isArray(g.children)){if(BI.each(g.children,function(b,c){var d;a!=-1?(d=a.slice(),d.push(g)):d=[],e(d,c)}),a!=-1?(h=a.slice(),h.push(g)):h=[],BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e0},halfSelected:!1})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var a=this,b=this.options,c=b.selected===!0,d=!b.selected&&b.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){a.setSelected(a.isSelected())},selected:c,invisible:d}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){a.setSelected(!0)},invisible:c||!d}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.text=BI.createWidget({type:"bi.label",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({type:"bi.htape",element:this,items:[{width:36,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(a){this.checkbox.setSelected(!!a)},beforeClick:function(){var a=this.isHalfSelected(),b=this.isSelected();a===!0?this.setSelected(!0):this.setSelected(!b)},setSelected:function(a){this.checkbox.setSelected(a),this.setHalfSelected(!1)},setHalfSelected:function(a){this.halfSelected=!!a,a===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(a){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var b=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(b),!b&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE)}}),BI.MultiSelectBar.EVENT_CHANGE="MultiSelectBar.EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.BranchRelation=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-relation-tree",items:[],centerOffset:0,direction:BI.Direction.Bottom,align:BI.VerticalAlign.Top})},_init:function(){BI.BranchRelation.superclass._init.apply(this,arguments),this.populate(this.options.items)},_stratification:function(){var a=[];return this.tree.recursion(function(b,c){b.leaf=b.isLeaf(),a[c.length-1]||(a[c.length-1]=[]),a[c.length-1].push(b)}),a},_calculateLeaves:function(){function a(b){var c=0;return b.isLeaf()?1:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),b.set("leaves",c),c)}var b=0;return b=a(this.tree.getRoot())},_translate:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,g);var k=g.parent.getChildIndex(g.id);g.parent.removeChildByIndex(k),g.parent.addChild(h,k),h.addChild(g),b[d].push(h),e[f]=h}else b[d].push(g)})}),b},_fill:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,h),g.addChild(h)}b[d].push(g)})}),b},_adjust:function(a){for(;;){var b=!1;if(BI.backEach(a,function(a,c){BI.each(c,function(a,c){if(!c.isNew){var d=!0;if(BI.any(c.getChildren(),function(a,b){if(!b.isNew)return d=!1,!0}),!c.isLeaf()&&d===!0){var e=[];BI.each(c.getChildren(),function(a,b){e=e.concat(b.getChildren())}),c.removeAllChilds(),BI.each(e,function(a,b){c.addChild(b)});var f=new BI.Node(BI.UUID());f.isNew=!0;var g=c.parent.getChildIndex(c.id);c.parent.removeChildByIndex(g),c.parent.addChild(f,g),f.addChild(c),b=!0}}})}),b===!1)break;a=this._stratification()}return a},_calculateWidth:function(){function a(b){var c=0;return b.isLeaf()?b.width:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),c)}function b(a){var c=0;return a.isLeaf()?a.height:(BI.each(a.getChildren(),function(a,d){c+=b(d)}),c)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_isVertical:function(){var a=this.options;return a.direction===BI.Direction.Top||a.direction===BI.Direction.Bottom},_calculateHeight:function(){function a(b){var c=0;return BI.each(b.getChildren(),function(b,d){c=Math.max(c,a(d))}),c+(b.height||0)}function b(a){var c=0;return BI.each(a.getChildren(),function(a,d){c=Math.max(c,b(d))}),c+(a.width||0)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_calculateXY:function(a){var b=(this.options,this._calculateWidth()),c=this._calculateHeight(),d=a.length,e=this._calculateLeaves(),f={},g=c/d;return BI.each(a,function(a,c){var d=[];BI.each(c,function(a,b){d[a]=(b.get("leaves")||1)/e}),BI.each(c,function(c,e){var h=BI.sum(d.slice(0,c)),i=h*b+d[c]*b/2,j=a*g+g/2;f[e.id]={x:i,y:j}})}),f},_stroke:function(a,b){var c=this._calculateHeight(),d=a.length,e=c/d,f=this,g=this.options;switch(g.direction){case BI.Direction.Top:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+h.x+","+(h.y+g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y+g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Bottom:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+h.x+","+(h.y-g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y-g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Left:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+(h.y+g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y+g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Right:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+(h.y-g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y-g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})})}},_createBranches:function(a){var b=this.options;b.direction!==BI.Direction.Bottom&&b.direction!==BI.Direction.Right||(a=a.reverse());var c=this._calculateXY(a);this._stroke(a,c)},_isNeedAdjust:function(){var a=this.options;return a.direction===BI.Direction.Top&&a.align===BI.VerticalAlign.Bottom||a.direction===BI.Direction.Bottom&&a.align===BI.VerticalAlign.Top||a.direction===BI.Direction.Left&&a.align===BI.HorizontalAlign.Right||a.direction===BI.Direction.Right&&a.align===BI.HorizontalAlign.Left},setValue:function(a){},getValue:function(){},populate:function(a){var b=this.options;b.items=a||[],this.empty(),a=BI.Tree.transformToTreeFormat(b.items),this.tree=new BI.Tree,this.tree.initTree(a),this.svg=BI.createWidget({type:"bi.svg"});var c=this._stratification();if(this._isNeedAdjust()){var d=this._translate(c);d=this._adjust(d),this._createBranches(d)}else{var d=this._fill(c);this._createBranches(d)}var e=BI.createWidget({type:"bi.layout",width:this._isVertical()?this._calculateWidth():this._calculateHeight(),height:this._isVertical()?this._calculateHeight():this._calculateWidth()});BI.createWidget({type:"bi.absolute",element:e,items:[{el:this.svg,top:0,left:0,right:0,bottom:0}]}),a=this._isVertical()?[{type:"bi.handstand_branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.horizontal_adapt",verticalAlign:b.align}]},items:a}]:[{type:"bi.branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.vertical"},{type:b.align===BI.HorizontalAlign.Left?"bi.left":"bi.right"}]},items:a}],BI.createWidget({type:"bi.adaptive",element:e,items:a}),BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[e]})}}),BI.BranchRelation.EVENT_CHANGE="BranchRelation.EVENT_CHANGE",BI.shortcut("bi.branch_relation",BI.BranchRelation),BI.HandStandBranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-expander",direction:BI.Direction.Top,logic:{dynamic:!0},el:{type:"bi.label"},popup:{}})},_init:function(){BI.HandStandBranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,{type:"bi.center_adapt",items:[this.expander]},this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.HandStandBranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_expander",BI.HandStandBranchExpander),BI.BranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-expander",direction:BI.Direction.Left,logic:{dynamic:!0},el:{},popup:{}})},_init:function(){BI.BranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,this.expander,this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el,{type:"bi.label",width:30,height:"100%"}),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.BranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_expander",BI.BranchExpander),BI.HandStandBranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.HandStandBranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.handstand_branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.horizontal_adapt"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.HandStandBranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_tree",BI.HandStandBranchTree),BI.BranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.BranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.BranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.BranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_tree",BI.BranchTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function a(a,b){return!1}var b={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:a}};return b},_dealWidthNodes:function(a){a=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(a,function(a,b){null==b.text&&b.count>0&&(b.text=b.value+"("+BI.i18nText("BI-Basic_Altogether")+b.count+BI.i18nText("BI-Basic_Count")+")")}),a},initTree:function(a,b){var b=b||this._configSetting();this.nodes=$.fn.zTree.init(this.tree.element,b,a)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={layer:b};if(BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.first_plus_group_node";break;case a.length-1:f.type="bi.last_plus_group_node";break;default:f.type="bi.mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.last_tree_leaf_item";break;default:f.type="bi.mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){BI.isKey(b.id)||(b.id=BI.UUID())})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},c.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),value:c.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},c.el)}),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.LevelTree.EVENT_CHANGE,c,d)})},stroke:function(a){this.tree.stroke.apply(this.tree,arguments)},populate:function(a,b){a=this._formatItems(BI.Tree.transformToTreeFormat(a),0),this.tree.populate(a,b)},setValue:function(a){this.tree.setValue(a)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var a=this,b=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(c,d){var e=function(b){d({items:b}),a.structure.initTree(BI.Tree.transformToTreeFormat(b))};BI.isNotNull(b.items)?e(b.items):b.itemsCreator(c,e)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(b.items)&&this.populate(),BI.isNotNull(b.value)&&this.setValue(b.value)},populate:function(a,b){a&&(this.options.items=a),this.tree.stroke({keyword:b})},_digest:function(a){a||(a=[]);var b=this,c={},d=[];return BI.each(a,function(a,e){var f=b.structure.search(e,"value");if(f){var g=f;for(g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++);g&&g.getChildrenLength()<=c[g.value];)d.push(g.value),g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++)}}),BI.makeObject(a.concat(d))},setValue:function(a){this.tree.setValue(this._digest(a))},_getValue:function(){var a=[],b=this.tree.getValue(),c=function(b){BI.each(b,function(b,d){BI.isEmpty(d)?a.push(b):c(d)})};return c(b),a},empty:function(){this.tree.empty()},getValue:function(){var a=this,b=[],c=this._getValue();return BI.each(c,function(c,d){var e=a.structure.search(d,"value");e&&a.structure._traverse(e,function(a){a.isLeaf()&&b.push(a.value)})}),b}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options;this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:b.triggerWidth||b.height},width:b.triggerWidth||b.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(a){this.editor.setValue(a)},setText:function(a){this.editor.setState(a)}}),BI.EditorTrigger.EVENT_CHANGE="BI.EditorTrigger.EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-trigger",el:{},height:24})},_init:function(){var a=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(a.el,{type:"bi.trigger_icon_button",element:this,width:a.width,height:a.height})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(b){a.wrapper=b},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon "+b.iconCls,ref:function(b){a.icon=b},iconHeight:b.iconHeight,iconWidth:b.iconWidth,disableSelected:!0},width:BI.isEmptyString(b.iconCls)?0:b.triggerWidth||b.height},{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setValue:function(a){this.text.setValue(a)},setIcon:function(a){var b=this.options;this.icon.setIcon(a);var c=this.wrapper.attr("items")[0];BI.isNull(a)||BI.isEmptyString(a)?0!==c.width&&(c.width=0,this.wrapper.resize()):c.width!==(b.triggerWidth||b.height)&&(c.width=b.triggerWidth||b.height,this.wrapper.resize())},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,defaultIconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digist(a.value,a.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:b.text,iconCls:b.iconCls,height:a.height,iconHeight:a.iconHeight,iconWidth:a.iconWidth})},_digist:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d,e=BI.Tree.transformToArrayFormat(b);return BI.any(e,function(b,c){if(BI.deepContains(a,c.value))return d={text:c.text||c.value,iconCls:c.iconCls},!0}),BI.isNotNull(d)?{text:d.text,iconCls:d.iconCls}:{text:c.text,iconCls:c.defaultIconCls}},setValue:function(a){var b=this._digist(a,this.options.items);this.trigger.setText(b.text),this.trigger.setIcon(b.iconCls)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,title:function(){return a.text.getText()},hgap:c.hgap,readonly:b.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:a.height,readonly:a.readonly,text:this._digest(a.value,a.items)})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},setValue:function(a){this.trigger.setText(this._digest(a,this.options.items))},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digest(a.text,a.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:a.height-2,text:b.text,cls:b.cls})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?{cls:"",text:d.join(",")}:{cls:"bi-water-mark",text:c.text}},setValue:function(a){var b=this._digest(a,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(b.cls),this.trigger.setText(b.text)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:a.height,text:a.text,hgap:b.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:a.triggerWidth||a.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:a.triggerWidth||a.height}]})},setValue:function(a){this.text.setValue(a)},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.SequenceTableTreeNumber=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-sequence-table-tree-number",isNeedFreeze:!1,startSequence:1,scrollTop:0,headerRowSize:25,rowSize:25,sequenceHeaderCreator:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.SequenceTableTreeNumber.superclass._init.apply(this,arguments);this.options;this.vCurr=1,this.hCurr=1,this.tasks=[],this.renderedCells=[],this.renderedKeys=[],this.container=BI.createWidget({type:"bi.absolute",width:60,scrollable:!1}),this.scrollContainer=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.container]}),this.headerContainer=BI.createWidget({type:"bi.absolute",cls:"bi-border",width:58,scrollable:!1}),this.layout=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.headerContainer,height:this._getHeaderHeight()-2},{el:{type:"bi.layout"},height:2},{el:this.scrollContainer}]}),this.start=this.options.startSequence,this.cache={},this._nextState(),this._populate()},_getNextSequence:function(a){function b(a){c.cache[a.text||a.value]||(c.cache[a.text||a.value]=e),e++}var c=this,d=this.start,e=this.start;return BI.each(a,function(a,f){BI.isNotEmptyArray(f.children)&&BI.each(f.children,function(a,f){0===a&&c.cache[f.text||f.value]&&(d=e=c.cache[f.text||f.value]), +minColumnSize:b.minColumnSize,maxColumnSize:b.maxColumnSize,headerRowSize:b.headerRowSize,rowSize:b.rowSize,regionColumnSize:b.regionColumnSize,header:c.header,items:c.items}),this.table.on(BI.Table.EVENT_TABLE_SCROLL,function(){a.fireEvent(BI.Table.EVENT_TABLE_SCROLL,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_REGION_RESIZE,arguments)}),this.table.on(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,function(){b.regionColumnSize=this.getRegionColumnSize(),b.columnSize=this.getColumnSize(),a.fireEvent(BI.Table.EVENT_TABLE_AFTER_COLUMN_RESIZE,arguments)})},_digest:function(){var a=this.options,b=this._getHDeep(),c=this._getVDeep(),d=BI.TableTree.formatHeader(a.header,a.crossHeader,a.crossItems,b,c,a.headerCellStyleGetter),e=BI.TableTree.formatItems(a.items,b,!1,a.summaryCellStyleGetter);return{header:d,items:e}},setWidth:function(a){BI.TableTree.superclass.setWidth.apply(this,arguments),this.table.setWidth(a)},setHeight:function(a){BI.TableTree.superclass.setHeight.apply(this,arguments),this.table.setHeight(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()},setVerticalScroll:function(a){this.table.setVerticalScroll(a)},setLeftHorizontalScroll:function(a){this.table.setLeftHorizontalScroll(a)},setRightHorizontalScroll:function(a){this.table.setRightHorizontalScroll(a)},getVerticalScroll:function(){return this.table.getVerticalScroll()},getLeftHorizontalScroll:function(){return this.table.getLeftHorizontalScroll()},getRightHorizontalScroll:function(){return this.table.getRightHorizontalScroll()},attr:function(){BI.TableTree.superclass.attr.apply(this,arguments),this.table.attr.apply(this.table,arguments)},restore:function(){this.table.restore()},populate:function(a,b,c,d){var e=this.options;a&&(e.items=a||[]),b&&(e.header=b),c&&(e.crossItems=c),d&&(e.crossHeader=d);var f=this._digest();this.table.populate(f.items,f.header)},destroy:function(){this.table.destroy(),BI.TableTree.superclass.destroy.apply(this,arguments)}}),BI.extend(BI.TableTree,{formatHeader:function(a,b,c,d,e,f){for(var g=BI.TableTree.formatCrossItems(c,e,f),h=[],i=0;i0&&h.push(a),h},formatItems:function(a,b,c,d){function e(a,g){var h;if(BI.isArray(g.children)){if(BI.each(g.children,function(b,c){var d;a!=-1?(d=a.slice(),d.push(g)):d=[],e(d,c)}),a!=-1?(h=a.slice(),h.push(g)):h=[],BI.isNotEmptyArray(g.values)){for(var i={text:BI.i18nText("BI-Summary_Values"),type:"bi.table_style_cell",styleGetter:function(){return d(a===-1)}},j=h.length;j0)if(c)for(var k=0,l=g.values.length;k0&&f.push(h);h.length>0&&f.push(h)}}var f=[];return BI.each(a,function(a,b){e(-1,b)}),BI.each(f,function(a,c){for(var d=BI.last(c),e=c.length;e0},halfSelected:!1})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var a=this,b=this.options,c=b.selected===!0,d=!b.selected&&b.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){a.setSelected(a.isSelected())},selected:c,invisible:d}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){a.setSelected(!0)},invisible:c||!d}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,a.isSelected(),a)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){a.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,a.isSelected(),a)}),this.text=BI.createWidget({type:"bi.label",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({type:"bi.htape",element:this,items:[{width:36,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(a){this.checkbox.setSelected(!!a)},beforeClick:function(){var a=this.isHalfSelected(),b=this.isSelected();a===!0?this.setSelected(!0):this.setSelected(!b)},setSelected:function(a){this.checkbox.setSelected(a),this.setHalfSelected(!1)},setHalfSelected:function(a){this.halfSelected=!!a,a===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(a){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var b=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(b),!b&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE)}}),BI.MultiSelectBar.EVENT_CHANGE="MultiSelectBar.EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.BranchRelation=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchRelation.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-relation-tree",items:[],centerOffset:0,direction:BI.Direction.Bottom,align:BI.VerticalAlign.Top})},_init:function(){BI.BranchRelation.superclass._init.apply(this,arguments),this.populate(this.options.items)},_stratification:function(){var a=[];return this.tree.recursion(function(b,c){b.leaf=b.isLeaf(),a[c.length-1]||(a[c.length-1]=[]),a[c.length-1].push(b)}),a},_calculateLeaves:function(){function a(b){var c=0;return b.isLeaf()?1:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),b.set("leaves",c),c)}var b=0;return b=a(this.tree.getRoot())},_translate:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,g);var k=g.parent.getChildIndex(g.id);g.parent.removeChildByIndex(k),g.parent.addChild(h,k),h.addChild(g),b[d].push(h),e[f]=h}else b[d].push(g)})}),b},_fill:function(a){var b=[],c=a.length;return BI.each(a,function(d,e){b[d]||(b[d]=[]),BI.each(e,function(f,g){if(g.isLeaf()&&d0){var j=e[f-1].getLastChild();i=a[d+1].indexOf(j)+1}a[d+1].splice(i,0,h),g.addChild(h)}b[d].push(g)})}),b},_adjust:function(a){for(;;){var b=!1;if(BI.backEach(a,function(a,c){BI.each(c,function(a,c){if(!c.isNew){var d=!0;if(BI.any(c.getChildren(),function(a,b){if(!b.isNew)return d=!1,!0}),!c.isLeaf()&&d===!0){var e=[];BI.each(c.getChildren(),function(a,b){e=e.concat(b.getChildren())}),c.removeAllChilds(),BI.each(e,function(a,b){c.addChild(b)});var f=new BI.Node(BI.UUID());f.isNew=!0;var g=c.parent.getChildIndex(c.id);c.parent.removeChildByIndex(g),c.parent.addChild(f,g),f.addChild(c),b=!0}}})}),b===!1)break;a=this._stratification()}return a},_calculateWidth:function(){function a(b){var c=0;return b.isLeaf()?b.width:(BI.each(b.getChildren(),function(b,d){c+=a(d)}),c)}function b(a){var c=0;return a.isLeaf()?a.height:(BI.each(a.getChildren(),function(a,d){c+=b(d)}),c)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_isVertical:function(){var a=this.options;return a.direction===BI.Direction.Top||a.direction===BI.Direction.Bottom},_calculateHeight:function(){function a(b){var c=0;return BI.each(b.getChildren(),function(b,d){c=Math.max(c,a(d))}),c+(b.height||0)}function b(a){var c=0;return BI.each(a.getChildren(),function(a,d){c=Math.max(c,b(d))}),c+(a.width||0)}var c=(this.options,0);return c=this._isVertical()?a(this.tree.getRoot()):b(this.tree.getRoot())},_calculateXY:function(a){var b=(this.options,this._calculateWidth()),c=this._calculateHeight(),d=a.length,e=this._calculateLeaves(),f={},g=c/d;return BI.each(a,function(a,c){var d=[];BI.each(c,function(a,b){d[a]=(b.get("leaves")||1)/e}),BI.each(c,function(c,e){var h=BI.sum(d.slice(0,c)),i=h*b+d[c]*b/2,j=a*g+g/2;f[e.id]={x:i,y:j}})}),f},_stroke:function(a,b){var c=this._calculateHeight(),d=a.length,e=c/d,f=this,g=this.options;switch(g.direction){case BI.Direction.Top:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+h.x+","+(h.y+g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y+g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Bottom:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+h.x+","+(h.y-g.centerOffset)+"L"+h.x+","+i;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+e.x+","+(e.y-g.centerOffset)+"L"+e.x+","+i}),j.length>0&&(d+="M"+BI.first(j).x+","+i+"L"+BI.last(j).x+","+i),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Left:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y+e/2;d+="M"+(h.y+g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y+g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})});break;case BI.Direction.Right:BI.each(a,function(a,c){BI.each(c,function(a,c){if(c.getChildrenLength()>0&&!c.leaf){var d="",h=b[c.id],i=h.y-e/2;d+="M"+(h.y-g.centerOffset)+","+h.x+"L"+i+","+h.x;var j=[];BI.each(c.getChildren(),function(a,c){var e=j[a]=b[c.id];d+="M"+(e.y-g.centerOffset)+","+e.x+"L"+i+","+e.x}),j.length>0&&(d+="M"+i+","+BI.first(j).x+"L"+i+","+BI.last(j).x),f.svg.path(d).attr("stroke","#d4dadd")}})})}},_createBranches:function(a){var b=this.options;b.direction!==BI.Direction.Bottom&&b.direction!==BI.Direction.Right||(a=a.reverse());var c=this._calculateXY(a);this._stroke(a,c)},_isNeedAdjust:function(){var a=this.options;return a.direction===BI.Direction.Top&&a.align===BI.VerticalAlign.Bottom||a.direction===BI.Direction.Bottom&&a.align===BI.VerticalAlign.Top||a.direction===BI.Direction.Left&&a.align===BI.HorizontalAlign.Right||a.direction===BI.Direction.Right&&a.align===BI.HorizontalAlign.Left},setValue:function(a){},getValue:function(){},populate:function(a){var b=this.options;b.items=a||[],this.empty(),a=BI.Tree.transformToTreeFormat(b.items),this.tree=new BI.Tree,this.tree.initTree(a),this.svg=BI.createWidget({type:"bi.svg"});var c=this._stratification();if(this._isNeedAdjust()){var d=this._translate(c);d=this._adjust(d),this._createBranches(d)}else{var d=this._fill(c);this._createBranches(d)}var e=BI.createWidget({type:"bi.layout",width:this._isVertical()?this._calculateWidth():this._calculateHeight(),height:this._isVertical()?this._calculateHeight():this._calculateWidth()});BI.createWidget({type:"bi.absolute",element:e,items:[{el:this.svg,top:0,left:0,right:0,bottom:0}]}),a=this._isVertical()?[{type:"bi.handstand_branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.horizontal_adapt",verticalAlign:b.align}]},items:a}]:[{type:"bi.branch_tree",expander:{direction:b.direction},el:{layouts:[{type:"bi.vertical"},{type:b.align===BI.HorizontalAlign.Left?"bi.left":"bi.right"}]},items:a}],BI.createWidget({type:"bi.adaptive",element:e,items:a}),BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[e]})}}),BI.BranchRelation.EVENT_CHANGE="BranchRelation.EVENT_CHANGE",BI.shortcut("bi.branch_relation",BI.BranchRelation),BI.HandStandBranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-expander",direction:BI.Direction.Top,logic:{dynamic:!0},el:{type:"bi.label"},popup:{}})},_init:function(){BI.HandStandBranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,{type:"bi.center_adapt",items:[this.expander]},this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.HandStandBranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_expander",BI.HandStandBranchExpander),BI.BranchExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-expander",direction:BI.Direction.Left,logic:{dynamic:!0},el:{},popup:{}})},_init:function(){BI.BranchExpander.superclass._init.apply(this,arguments);var a=this.options;this._initExpander(),this._initBranchView(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(a.direction),BI.extend({},a.logic,{items:BI.LogicFactory.createLogicItemsByDirection(a.direction,this.expander,this.branchView)}))))},_initExpander:function(){var a=this,b=this.options;this.expander=BI.createWidget(b.el,{type:"bi.label",width:30,height:"100%"}),this.expander.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_initBranchView:function(){var a=this,b=this.options;this.branchView=BI.createWidget(b.popup,{}),this.branchView.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(a){this.branchView.populate.apply(this.branchView,arguments)},getValue:function(){return this.branchView.getValue()}}),BI.BranchExpander.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_expander",BI.BranchExpander),BI.HandStandBranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.HandStandBranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-handstand-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.HandStandBranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.handstand_branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.horizontal_adapt"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.HandStandBranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.HandStandBranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.handstand_branch_tree",BI.HandStandBranchTree),BI.BranchTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.BranchTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-branch-tree",expander:{},el:{},items:[]})},_init:function(){BI.BranchTree.superclass._init.apply(this,arguments);var a=this,b=this.options;this.branchTree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({type:"bi.branch_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:BI.extend({type:"bi.button_tree",chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical"}]},b.el),items:this.options.items}),this.branchTree.on(BI.CustomTree.EVENT_CHANGE,function(){a.fireEvent(BI.BranchTree.EVENT_CHANGE,arguments)}),this.branchTree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},populate:function(){this.branchTree.populate.apply(this.branchTree,arguments)},getValue:function(){return this.branchTree.getValue()}}),BI.BranchTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.branch_tree",BI.BranchTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function a(a,b){return!1}var b={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:a}};return b},_dealWidthNodes:function(a){a=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);this.options;return BI.each(a,function(a,b){null==b.text&&b.count>0&&(b.text=b.value+"("+BI.i18nText("BI-Basic_Altogether")+b.count+BI.i18nText("BI-Basic_Count")+")")}),a},initTree:function(a,b){var b=b||this._configSetting();this.nodes=$.fn.zTree.init(this.tree.element,b,a)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={layer:b};if(BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.first_plus_group_node";break;case a.length-1:f.type="bi.last_plus_group_node";break;default:f.type="bi.mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.last_tree_leaf_item";break;default:f.type="bi.mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){BI.isKey(b.id)||(b.id=BI.UUID())})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},c.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),value:c.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},c.el)}),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.LevelTree.EVENT_CHANGE,c,d)})},stroke:function(a){this.tree.stroke.apply(this.tree,arguments)},populate:function(a,b){a=this._formatItems(BI.Tree.transformToTreeFormat(a),0),this.tree.populate(a,b)},setValue:function(a){this.tree.setValue(a)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var a=this,b=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(c,d){var e=function(b){d({items:b}),a.structure.initTree(BI.Tree.transformToTreeFormat(b))};BI.isNotNull(b.items)?e(b.items):b.itemsCreator(c,e)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){a.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(b.items)&&this.populate(),BI.isNotNull(b.value)&&this.setValue(b.value)},populate:function(a,b){a&&(this.options.items=a),this.tree.stroke({keyword:b})},_digest:function(a){a||(a=[]);var b=this,c={},d=[];return BI.each(a,function(a,e){var f=b.structure.search(e,"value");if(f){var g=f;for(g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++);g&&g.getChildrenLength()<=c[g.value];)d.push(g.value),g=g.getParent(),g&&(c[g.value]||(c[g.value]=0),c[g.value]++)}}),BI.makeObject(a.concat(d))},setValue:function(a){this.tree.setValue(this._digest(a))},_getValue:function(){var a=[],b=this.tree.getValue(),c=function(b){BI.each(b,function(b,d){BI.isEmpty(d)?a.push(b):c(d)})};return c(b),a},empty:function(){this.tree.empty()},getValue:function(){var a=this,b=[],c=this._getValue();return BI.each(c,function(c,d){var e=a.structure.search(d,"value");e&&a.structure._traverse(e,function(a){a.isLeaf()&&b.push(a.value)})}),b}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options;this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,value:b.value,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:b.triggerWidth||b.height},width:b.triggerWidth||b.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(a){this.editor.setValue(a)},setText:function(a){this.editor.setState(a)}}),BI.EditorTrigger.EVENT_CHANGE="BI.EditorTrigger.EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-trigger",el:{},height:24})},_init:function(){var a=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(a.el,{type:"bi.trigger_icon_button",element:this,width:a.width,height:a.height})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(b){a.wrapper=b},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon "+b.iconCls,ref:function(b){a.icon=b},iconHeight:b.iconHeight,iconWidth:b.iconWidth,disableSelected:!0},width:BI.isEmptyString(b.iconCls)?0:b.triggerWidth||b.height},{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setValue:function(a){this.text.setValue(a)},setIcon:function(a){var b=this.options;this.icon.setIcon(a);var c=this.wrapper.attr("items")[0];BI.isNull(a)||BI.isEmptyString(a)?0!==c.width&&(c.width=0,this.wrapper.resize()):c.width!==(b.triggerWidth||b.height)&&(c.width=b.triggerWidth||b.height,this.wrapper.resize())},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digist(a.value,a.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:b.text,iconCls:b.iconCls,height:a.height,iconHeight:a.iconHeight,iconWidth:a.iconWidth})},_digist:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d,e=BI.Tree.transformToArrayFormat(b);return BI.any(e,function(b,c){if(BI.deepContains(a,c.value))return d={text:c.text||c.value,iconCls:c.iconCls},!0}),BI.isNotNull(d)?{text:d.text,iconCls:d.iconCls}:{text:c.text,iconCls:c.iconCls}},setValue:function(a){var b=this._digist(a,this.options.items);this.trigger.setText(b.text),this.trigger.setIcon(b.iconCls)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:24})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:b.height,text:b.text,title:function(){return a.text.getText()},hgap:c.hgap,readonly:b.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:b.triggerWidth||b.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:b.triggerWidth||b.height}]})},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options;this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:a.height,readonly:a.readonly,text:this._digest(a.value,a.items)})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?d.join(","):c.text},setValue:function(a){this.trigger.setText(this._digest(a,this.options.items))},populate:function(a){this.options.items=a}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._digest(a.text,a.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:a.height-2,text:b.text,cls:b.cls})},_digest:function(a,b){var c=this.options;a=BI.isArray(a)?a:[a];var d=[],e=BI.Tree.transformToArrayFormat(b);return BI.each(e,function(b,c){BI.deepContains(a,c.value)&&!d.contains(c.text||c.value)&&d.push(c.text||c.value)}),d.length>0?{cls:"",text:d.join(",")}:{cls:"bi-water-mark",text:c.text}},setValue:function(a){var b=this._digest(a,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(b.cls),this.trigger.setText(b.text)},populate:function(a){this.options.items=a}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var a=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:a.height,text:a.text,hgap:b.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:a.triggerWidth||a.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:a.triggerWidth||a.height}]})},setValue:function(a){this.text.setValue(a)},setText:function(a){this.text.setText(a)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.SequenceTableTreeNumber=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SequenceTableTreeNumber.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-sequence-table-tree-number",isNeedFreeze:!1,startSequence:1,scrollTop:0,headerRowSize:25,rowSize:25,sequenceHeaderCreator:BI.emptyFn,header:[],items:[],crossHeader:[],crossItems:[]})},_init:function(){BI.SequenceTableTreeNumber.superclass._init.apply(this,arguments);this.options;this.vCurr=1,this.hCurr=1,this.tasks=[],this.renderedCells=[],this.renderedKeys=[],this.container=BI.createWidget({type:"bi.absolute",width:60,scrollable:!1}),this.scrollContainer=BI.createWidget({type:"bi.vertical",scrollable:!1,scrolly:!1,items:[this.container]}),this.headerContainer=BI.createWidget({type:"bi.absolute",cls:"bi-border",width:58,scrollable:!1}),this.layout=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.headerContainer,height:this._getHeaderHeight()-2},{el:{type:"bi.layout"},height:2},{el:this.scrollContainer}]}),this.start=this.options.startSequence,this.cache={},this._nextState(),this._populate()},_getNextSequence:function(a){function b(a){c.cache[a.text||a.value]||(c.cache[a.text||a.value]=e),e++}var c=this,d=this.start,e=this.start;return BI.each(a,function(a,f){BI.isNotEmptyArray(f.children)&&BI.each(f.children,function(a,f){0===a&&c.cache[f.text||f.value]&&(d=e=c.cache[f.text||f.value]), b(f)})}),this.start=e,d},_getStart:function(a){var b=this,c=this.start;return BI.some(a,function(a,d){if(BI.isNotEmptyArray(d.children))return BI.some(d.children,function(a,d){if(0===a&&b.cache[d.text||d.value])return c=b.cache[d.text||d.value],!0})}),c},_formatNumber:function(a){function b(a){var c=0;return BI.isNotEmptyArray(a.children)?(BI.each(a.children,function(a,d){c+=b(d)}),BI.isNotEmptyArray(a.values)&&c++):c++,c}var c=this.options,d=[],e=this._getStart(a),f=0,g=0;return BI.each(a,function(a,h){BI.isArray(h.children)&&(BI.each(h.children,function(a,h){var i=b(h);d.push({text:e++,start:f,top:g,cnt:i,index:a,height:i*c.rowSize}),f+=i,g+=i*c.rowSize}),BI.isNotEmptyArray(h.values)&&(d.push({text:BI.i18nText("BI-Summary_Values"),start:f++,top:g,cnt:1,isSummary:!0,height:c.rowSize}),g+=c.rowSize))}),d},_layout:function(){var a=this.options,b=this._getHeaderHeight()-2,c=this.layout.attr("items");a.isNeedFreeze===!1?(c[0].height=0,c[1].height=0):a.isNeedFreeze===!0&&(c[0].height=b,c[1].height=2),this.layout.attr("items",c),this.layout.resize();try{this.scrollContainer.element.scrollTop(a.scrollTop)}catch(d){}},_getHeaderHeight:function(){var a=this.options;return a.headerRowSize*(a.crossHeader.length+(a.header.length>0?1:0))},_nextState:function(){var a=this.options;this._getNextSequence(a.items)},_prevState:function(){var a,b=this.options;BI.some(b.items,function(b,c){if(BI.isNotEmptyArray(c.children))return BI.some(c.children,function(b,c){return a=c,!0})}),a&&BI.isNotEmptyObject(this.cache)?this.start=this.cache[a.text||a.value]:this.start=1,this._nextState()},_getMaxScrollTop:function(a){var b=0;return BI.each(a,function(a,c){b+=c.cnt}),Math.max(0,b*this.options.rowSize-(this.options.height-this._getHeaderHeight())+BI.DOM.getScrollWidth())},_createHeader:function(){var a=this.options;BI.createWidget({type:"bi.absolute",element:this.headerContainer,items:[{el:a.sequenceHeaderCreator()||{type:"bi.table_style_cell",cls:"sequence-table-title-cell",height:this._getHeaderHeight()-2,styleGetter:a.headerCellStyleGetter,text:BI.i18nText("BI-Number_Index")},left:0,top:0,right:0,bottom:0}]})},_calculateChildrenToRender:function(){var a=this,b=this.options,c=[],d=[],e=this._formatNumber(b.items),f=BI.PrefixIntervalTree.uniform(e.length,0);BI.each(e,function(a,b){f.set(a,b.height)});for(var g=BI.clamp(b.scrollTop,0,this._getMaxScrollTop(e)),h=f.greatestLowerBound(g),i=-(g-(h>0?f.sumTo(h-1):0)),j=i,k=b.height-this._getHeaderHeight();j-1)e[f].height!==a.renderedCells[g]._height&&(a.renderedCells[g]._height=e[f].height,a.renderedCells[g].el.setHeight(e[f].height)),e[f].top!==a.renderedCells[g].top&&(a.renderedCells[g].top=e[f].top,a.renderedCells[g].el.element.css("top",e[f].top+"px")),c.push(a.renderedCells[g]);else{var h=BI.createWidget(BI.extend({type:"bi.table_style_cell",cls:"sequence-table-number-cell bi-border-left bi-border-right bi-border-bottom",width:60,styleGetter:e[f].isSummary===!0?function(){return b.summaryCellStyleGetter(!0)}:function(a){return function(){return b.sequenceCellStyleGetter(a)}}(e[f].index)},e[f]));c.push({el:h,left:0,top:e[f].top,_height:e[f].height})}});var l={},m={},n=[];BI.each(d,function(b,c){BI.deepContains(a.renderedKeys,c)?l[b]=c:m[b]=c}),BI.each(this.renderedKeys,function(a,b){BI.deepContains(l,b)||BI.deepContains(m,b)||n.push(a)}),BI.each(n,function(b,c){a.renderedCells[c].el.destroy()});var o=[];BI.each(m,function(a){o.push(c[a])}),BI.createWidget({type:"bi.absolute",element:this.container,items:o}),this.renderedCells=c,this.renderedKeys=d,this.container.setHeight(f.sumUntil(e.length))},_restore:function(){BI.each(this.renderedCells,function(a,b){b.el.destroy()}),this.renderedCells=[],this.renderedKeys=[]},_populate:function(){var a=this;BI.each(this.tasks,function(b,c){c.apply(a)}),this.tasks=[],this.headerContainer.empty(),this._createHeader(),this._layout(),this._calculateChildrenToRender()},setVerticalScroll:function(a){if(this.options.scrollTop!==a){this.options.scrollTop=a;try{this.scrollContainer.element.scrollTop(a)}catch(b){}}},getVerticalScroll:function(){return this.options.scrollTop},setVPage:function(a){a<=1?(this.cache={},this.start=this.options.startSequence,this._restore(),this.tasks.push(this._nextState)):a===this.vCurr+1?this.tasks.push(this._nextState):a===this.vCurr-1&&this.tasks.push(this._prevState),this.vCurr=a},setHPage:function(a){a!==this.hCurr&&this.tasks.push(this._prevState),this.hCurr=a},restore:function(){this._restore()},populate:function(a,b,c,d){var e=this.options;a&&a!==this.options.items&&(e.items=a,this._restore(),this.tasks.push(this._prevState)),b&&b!==this.options.header&&(e.header=b),c&&c!==this.options.crossItems&&(e.crossItems=c),d&&d!==this.options.crossHeader&&(e.crossHeader=d),this._populate()}}),BI.shortcut("bi.sequence_table_tree_number",BI.SequenceTableTreeNumber),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:25})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var a=this;this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup"}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.combo.hideView(),a.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:25})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:b.behaviors,min:b.min,max:b.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){a.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.doBehavior()})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-picker bi-background",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===a._month?a.setValue({year:a.year.getValue()-1,month:12}):a.setValue({year:a.year.getValue(),month:a.month.getValue()-1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===a._month?a.setValue({year:a.year.getValue()+1,month:1}):a.setValue({year:a.year.getValue(),month:a.month.getValue()+1}),a.fireEvent(BI.DatePicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo"}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){a.setValue({year:a.year.getValue(),month:a.month.getValue()}),a.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{type:"bi.horizontal",width:100,items:[this.year,this.month]}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var a=this.options,b=!(1===this._month&&this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(12===this._month&&this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a.year,this._month=a.month,this.year.setValue(a.year),this.month.setValue(a.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-year-picker bi-background",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var a=this,b=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()-1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(a.year.getValue()+1),a.fireEvent(BI.YearPicker.EVENT_CHANGE),a._checkLeftValid(),a._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:b.min,behaviors:b.behaviors,max:b.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){a.setValue(a.year.getValue()),a.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[this.year]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(b),b},_checkRightValid:function(){var a=this.options,b=!(this._year===BI.parseDateTime(a.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(b),b},setValue:function(a){this._year=a,this.year.setValue(a),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=b.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(a.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){a.selectedTime=a.datePicker.getValue(),a.selectedTime.day=1,a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)})},setValue:function(a){this.datePicker.setValue(a),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(a){var b=this.options,c=this._year,d=BI.createWidget({type:"bi.year_calendar",behaviors:b.behaviors,min:b.min,max:b.max,logic:{dynamic:!0},year:c+12*a});return d.setValue(this._year),d},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var c=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1}),d=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-border-top",height:25,items:[c,d]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(a.selectedYear);var b=this.getSelectedCard();c.setEnable(!b.isFrontYear()),d.setEnable(!b.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedYear=this.getValue(),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.fireEvent(BI.YearPopup.EVENT_CHANGE,a.selectedYear)}),BI.isKey(b.value)&&this.setValue(b.value)},getValue:function(){return this.selectedYear},setValue:function(a){var b=this.options;a=BI.parseInt(a),BI.checkDateVoid(a,1,1,b.min,b.max)[0]?(a=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue("")):(this.selectedYear=a,this.navigation.setSelect(BI.YearCalendar.getPageByYear(a)),this.navigation.setValue(a))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:25,iconWidth:16,iconHeight:13},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:25})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var a=this.options,b=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:a.text,value:a.value,height:b.height}),this.icon=BI.createWidget({type:"bi.icon",width:b.iconWidth,height:b.iconHeight}),BI.createWidget({type:"bi.center_adapt",element:this,items:[{type:"bi.center_adapt",width:50,height:b.height,items:[this.text,this.icon]}]})},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()},setText:function(a){this.text.setText(a)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var a=this,b=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=b.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",min:b.min,max:b.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var b=a.datePicker.getValue(),c=BI.getDate(b.year,b.month-1,1).getMonthDays(),d=a.selectedTime.day||0;d>c&&(d=c),a.selectedTime={year:b.year,month:b.month},0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",element:this,logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=a.calendar.getValue(),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=a},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){this._setDatePicker(a),this._setCalendar(a)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDatePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDatePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateCombo.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border",width:200,height:24})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options,c=BI.getDate();this.storeValue=BI.isNotNull(b.value)?b.value:{year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate(),hour:c.getHours(),minute:c.getMinutes(),second:c.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value}),a.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){a.storeValue=a.popup.getValue(),a.setValue(a.storeValue),a.hidePopupView(),a.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var d=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font bi-border-right",width:24,height:24});d.on(BI.TriggerIconButton.EVENT_CHANGE,function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:d,top:0,left:0}]}]})},setValue:function(a){this.storeValue=a,this.popup.setValue(a),this.trigger.setValue(a)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",forceCenter:!0,cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max}),a.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateSelect=BI.createWidget({type:"bi.vertical_adapt",cls:"bi-border-top",items:[{type:"bi.label",text:BI.i18nText("BI-Basic_Time"),width:45},{type:"bi.date_time_select",max:23,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.hour=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.minute=b}},{type:"bi.label",text:":",width:15},{type:"bi.date_time_select",max:59,min:0,width:60,height:30,listeners:[{eventName:BI.DateTimeSelect.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}}],ref:function(b){a.second=b}}]}),this.setValue(b.value),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:this.dateSelect,height:50},{el:this.dateButton,height:30}]})},setValue:function(a){var b,c=a;BI.isNull(c)?(b=BI.getDate(),this.dateCombo.setValue({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}),this.hour.setValue(b.getHours()),this.minute.setValue(b.getMinutes()),this.second.setValue(b.getSeconds())):(this.dateCombo.setValue({year:c.year,month:c.month,day:c.day}),this.hour.setValue(c.hour),this.minute.setValue(c.minute),this.second.setValue(c.second))},getValue:function(){return{year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day,hour:this.hour.getValue(),minute:this.minute.getValue(),second:this.second.getValue()}}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeSelect=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimeSelect.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-select bi-border",max:23,min:0})},_init:function(){BI.DateTimeSelect.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",value:this._alertInEditorValue(b.min),allowBlank:!1,errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Please_Input_Natural_Number"):BI.i18nText("BI-Numerical_Interval_Input_Data")},validationChecker:function(a){return BI.isNaturalNumber(a)}}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){a._finetuning(0),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",cls:"column-pre-page-h-font top-button bi-border-left bi-border-bottom"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",cls:"column-next-page-h-font bottom-button bi-border-left"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){a._finetuning(-1),a.fireEvent(BI.DateTimeSelect.EVENT_CONFIRM)}),this._finetuning(0),BI.createWidget({type:"bi.htape",element:this,items:[this.editor,{el:{type:"bi.grid",columns:1,rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:30}]})},_alertOutEditorValue:function(a){return a>this.options.max&&(a=this.options.min),athis.options.max&&(a=this.options.min),ac&&(d=c),a.selectedTime=BI.extend(a.selectedTime,{year:b.year,month:b.month,day:d}),0!==d&&(a.selectedTime.day=d),a.calendar.setSelect(BI.Calendar.getPageByDateJSON(a.selectedTime)),a.calendar.setValue(a.selectedTime),0!==d&&a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"top",logic:{dynamic:!1},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.calendar.empty(),a.setValue(a.selectedTime),a.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,items:[this.calendar,{el:{type:"bi.dynamic_date_time_select",ref:function(){a.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){a.selectedTime=BI.extend(a.calendar.getValue(),a.timeSelect.getValue()),a.fireEvent("EVENT_CHANGE")}}]},height:40}]}),this.setValue(b.selectedTime)},_createNav:function(a){var b=BI.Calendar.getDateJSONByPage(a),c=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:b.year,month:b.month,day:this.selectedTime.day});return c},_getNewCurrentDate:function(){var a=BI.getDate();return{year:a.getFullYear(),month:a.getMonth()+1}},_setCalenderValue:function(a){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(a)),this.calendar.setValue(a),this.selectedTime=BI.extend({},this.timeSelect.getValue(),a)},_setDatePicker:function(a){BI.isNull(a)||BI.isNull(a.year)||BI.isNull(a.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(a)},_setCalendar:function(a){BI.isNull(a)||BI.isNull(a.day)?(this.calendar.empty(), -this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){a=a||{},this._setDatePicker(a),this._setCalendar(a),this.timeSelect.setValue({hour:a.hour,minute:a.minute,second:a.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDateTimePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateTimePane.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:a.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:a.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(a){this.downlistgroup.setValue(a)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:25,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,height:b.height,text:b.text,value:b.value,logic:b.logic,selected:b.selected,disabled:b.disabled,iconHeight:b.iconHeight,iconWidth:b.iconWidth,textHgap:b.textHgap,textVgap:b.textVgap,textLgap:b.textLgap,textRgap:b.textRgap,father:b.father,bubble:b.bubble}),this.text.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.IconTextItem.EVENT_CHANGE,function(){a.fireEvent(BI.DownListItem.EVENT_CHANGE)})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},isSelected:function(){return this.text.isSelected()},setSelected:function(a){this.text.setSelected(a)},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var a=this.options,b=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:a.text,value:a.value,height:a.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:a.iconCls1,width:25,forceNotSelected:!0,selected:this._digest(a.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:a.iconCls2,width:25,forceNotSelected:!0});var c=BI.createWidget({type:"bi.layout",width:25});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,c)})))),this.element.hover(function(){b.isEnabled()&&b.hover()},function(){b.isEnabled()&&b.dishover()})},_digest:function(a){var b=this.options;return a=BI.isArray(a)?a:[a],BI.any(a,function(a,c){return BI.contains(b.childValues,c)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(a){this.icon1.setSelected(this._digest(a))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var a=this,b=this.options,c=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])?(d=a.childValueMap[b],a.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,d,a.fatherValueMap[b])):a.fireEvent(BI.DownListPopup.EVENT_CHANGE,d,c),!a.singleValues.contains(d)){var e=a.getValue(),f=[];BI.each(e,function(a,b){b.value!=d&&f.push(b)}),a.setValue(f)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createChildren:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},maxHeight:378},c.el.childValues=[],BI.each(c.children,function(a,d){var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value)})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a0?1:0}},setValue:function(a){a=a||{},this.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT;var b=[],c=[];BI.isNotNull(a.year)&&(b.push(BI.DynamicDateCard.TYPE.YEAR),c.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,a.year))),BI.isNotNull(a.quarter)&&(b.push(BI.DynamicDateCard.TYPE.QUARTER),c.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,a.quarter))),BI.isNotNull(a.month)&&(b.push(BI.DynamicDateCard.TYPE.MONTH),c.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,a.month))),BI.isNotNull(a.week)&&(b.push(BI.DynamicDateCard.TYPE.WEEK),c.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,a.week))),BI.isNotNull(a.day)&&(b.push(BI.DynamicDateCard.TYPE.DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,a.day))),BI.isNotNull(a.workDay)&&(b.push(BI.DynamicDateCard.TYPE.WORK_DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,a.workDay))),this.checkgroup.setValue(b),this.workDayBox.setSelected(BI.isNotNull(a.workDay)),this.resultPane.populate(this._getParamJson(c,a.position))},getValue:function(){var a=this,b={},c=this.checkgroup.getValue(),d=this.resultPane.getAllButtons();if(0!==c.length&&BI.each(d,function(c,d){var e=d.getValue();switch(e.dateType){case BI.DynamicDateCard.TYPE.YEAR:b.year=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.QUARTER:b.quarter=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.MONTH:b.month=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.WEEK:b.week=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.DAY:b.day=0===e.offset?-e.value:e.value}BI.isNull(e.dateType)&&(b.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var e=d[0].getValue();b.workDay=0===e.offset?-e.value:e.value}return b}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(a){return BI.isNaturalNumber(a)},value:b.value,ref:function(){a.editor=this},errorText:function(a){return BI.isEmptyString(a)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Positive_Integer")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:b.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){a.offsetCombo=this},value:b.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var a="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:a=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:a=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:a=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:a=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:a=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:a=BI.i18nText("BI-Basic_Work_Day")}return a},setValue:function(a){a=a||{},a.value=a.value||0,a.offset=a.offset||0,this.editor.setValue(a.value),this.offsetCombo.setValue(a.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){a.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6, +this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(a)},setValue:function(a){a=a||{},this._setDatePicker(a),this._setCalendar(a),this.timeSelect.setValue({hour:a.hour,minute:a.minute,second:a.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var a=this;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-border-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var b=this.getValue()[0];switch(a.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()});break;case BI.DynamicDateTimePane.Dynamic:a.dynamicPane.setValue({year:0})}}}],ref:function(){a.switcher=this}},height:30},{type:"bi.tab",ref:function(){a.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(b){switch(b){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._checkValue(a.getValue())&&a.fireEvent("EVENT_CHANGE")}}],ref:function(){a.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){a=a||{};var b=a.type||BI.DynamicDateTimePane.Static,c=a.value||a;switch(this.switcher.setValue(b),this.dateTab.setSelect(b),b){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(c);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(c)){var d=BI.getDate();this.ymd.setValue({year:d.getFullYear(),month:d.getMonth()+1})}else this.ymd.setValue(c)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var a=this.options,b=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:a.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:a.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(a){this.downlistgroup.setValue(a)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:25,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,height:b.height,text:b.text,value:b.value,logic:b.logic,selected:b.selected,disabled:b.disabled,iconHeight:b.iconHeight,iconWidth:b.iconWidth,textHgap:b.textHgap,textVgap:b.textVgap,textLgap:b.textLgap,textRgap:b.textRgap,father:b.father,bubble:b.bubble}),this.text.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.IconTextItem.EVENT_CHANGE,function(){a.fireEvent(BI.DownListItem.EVENT_CHANGE)})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},isSelected:function(){return this.text.isSelected()},setSelected:function(a){this.text.setSelected(a)},setValue:function(a){this.text.setValue(a)},getValue:function(){return this.text.getValue()}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var a=this.options,b=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:a.text,value:a.value,height:a.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:a.iconCls1,width:25,forceNotSelected:!0,selected:this._digest(a.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:a.iconCls2,width:25,forceNotSelected:!0});var c=BI.createWidget({type:"bi.layout",width:25});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(a.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,c)})))),this.element.hover(function(){b.isEnabled()&&b.hover()},function(){b.isEnabled()&&b.dishover()})},_digest:function(a){var b=this.options;return a=BI.isArray(a)?a:[a],BI.any(a,function(a,c){return BI.contains(b.childValues,c)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(a){this.icon1.setSelected(this._digest(a))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var a=this,b=this.options,c=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])?(d=a.childValueMap[b],a.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,d,a.fatherValueMap[b])):a.fireEvent(BI.DownListPopup.EVENT_CHANGE,d,c),!a.singleValues.contains(d)){var e=a.getValue(),f=[];BI.each(e,function(a,b){b.value!=d&&f.push(b)}),a.setValue(f)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createChildren:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},maxHeight:378},c.el.childValues=[],BI.each(c.children,function(a,d){var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value)})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a0?1:0}},setValue:function(a){a=a||{},this.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT;var b=[],c=[];BI.isNotNull(a.year)&&(b.push(BI.DynamicDateCard.TYPE.YEAR),c.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,a.year))),BI.isNotNull(a.quarter)&&(b.push(BI.DynamicDateCard.TYPE.QUARTER),c.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,a.quarter))),BI.isNotNull(a.month)&&(b.push(BI.DynamicDateCard.TYPE.MONTH),c.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,a.month))),BI.isNotNull(a.week)&&(b.push(BI.DynamicDateCard.TYPE.WEEK),c.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,a.week))),BI.isNotNull(a.day)&&(b.push(BI.DynamicDateCard.TYPE.DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,a.day))),BI.isNotNull(a.workDay)&&(b.push(BI.DynamicDateCard.TYPE.WORK_DAY),c.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,a.workDay))),this.checkgroup.setValue(b),this.workDayBox.setSelected(BI.isNotNull(a.workDay)),this.resultPane.populate(this._getParamJson(c,a.position))},getValue:function(){var a=this,b={},c=this.checkgroup.getValue(),d=this.resultPane.getAllButtons();if(0!==c.length&&BI.each(d,function(c,d){var e=d.getValue();switch(e.dateType){case BI.DynamicDateCard.TYPE.YEAR:b.year=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.QUARTER:b.quarter=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.MONTH:b.month=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.WEEK:b.week=0===e.offset?-e.value:e.value;break;case BI.DynamicDateCard.TYPE.DAY:b.day=0===e.offset?-e.value:e.value}BI.isNull(e.dateType)&&(b.position=a.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var e=d[0].getValue();b.workDay=0===e.offset?-e.value:e.value}return b}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate()}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var a=this,b=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(a){return BI.isNaturalNumber(a)},value:b.value,ref:function(){a.editor=this},errorText:function(a){return BI.isEmptyString(a)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Positive_Integer")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:b.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){a.offsetCombo=this},value:b.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var a="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:a=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:a=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:a=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:a=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:a=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:a=BI.i18nText("BI-Basic_Work_Day")}return a},setValue:function(a){a=a||{},a.value=a.value||0,a.offset=a.offset||0,this.editor.setValue(a.value),this.offsetCombo.setValue(a.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){a.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6, yearFullMonthLength:7},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(b){var c=b.match(/\d+/g);return a._autoAppend(b,c),a._dateCheck(b)&&BI.checkDateLegal(b)&&a._checkVoid({year:0|c[0],month:0|c[1],day:0|c[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){return a.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")},title:function(){var b=a.storeValue||{},c=b.type||BI.DynamicDateCombo.Static,d=b.value;switch(c){case BI.DynamicDateCombo.Dynamic:var e=a._getText(d),f=BI.getDate();f=BI.DynamicDateHelper.getCalculation(d);var g=f.print("%Y-%x-%e");return BI.isEmptyString(e)?g:e+":"+g;case BI.DynamicDateCombo.Static:default:return BI.isNull(d)||BI.isNull(d.day)?"":BI.getDate(d.year,d.month-1,d.day).print("%Y-%X-%d")}}}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();if(BI.isNotNull(b)&&a.editor.setState(b),BI.isNotEmptyString(b)){var c=b.split("-");a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|c[0],month:0|c[1],day:0|c[2]}}}a.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){a.editor.isValid()&&a.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:30}]}),this.setValue(b.value)},_dateCheck:function(a){return BI.parseDateTime(a,"%Y-%x-%d").print("%Y-%x-%d")===a||BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d")===a||BI.parseDateTime(a,"%Y-%x-%e").print("%Y-%x-%e")===a||BI.parseDateTime(a,"%Y-%X-%e").print("%Y-%X-%e")===a},_checkVoid:function(a){return!BI.checkDateVoid(a.year,a.month,a.day,this.options.min,this.options.max)[0]},_autoAppend:function(a,b){if(BI.isNotNull(b)&&BI.checkDateLegal(a))switch(a.length){case this._const.yearLength:this._yearCheck(a)&&this.editor.setValue(a+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var c=a.split("-")[1];(BI.isNotNull(c)&&2===c.length||this._monthCheck(a))&&this.editor.setValue(a+"-")}},_yearCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d");return BI.parseDateTime(a,"%Y").print("%Y")===a&&b>=this.options.min&&b<=this.options.max},_monthCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d"),c=b.print("%Y-%X-%d");return b.getMonth()>0&&(BI.parseDateTime(a,"%Y-%X").print("%Y-%X")===a||BI.parseDateTime(a,"%Y-%x").print("%Y-%x")===a)&&c>=this.options.min&&c<=this.options.max},_setInnerValue:function(a){var b=a.print("%Y-%x-%e");this.editor.setState(b),this.editor.setValue(b)},_getText:function(a){function b(a,b){switch(b){case BI.DynamicDateCard.OFFSET.BEGIN:return a+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return a+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var c="",d="";return BI.isNotNull(a.year)&&(0!==BI.parseInt(a.year)&&(c+=Math.abs(a.year)+BI.i18nText("BI-Basic_Year")+(a.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Year"),a.position)),BI.isNotNull(a.quarter)&&(0!==BI.parseInt(a.quarter)&&(c+=Math.abs(a.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(a.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Single_Quarter"),a.position)),BI.isNotNull(a.month)&&(0!==BI.parseInt(a.month)&&(c+=Math.abs(a.month)+BI.i18nText("BI-Basic_Month")+(a.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Month"),a.position)),BI.isNotNull(a.week)&&(0!==BI.parseInt(a.week)&&(c+=Math.abs(a.week)+BI.i18nText("BI-Basic_Week")+(a.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Week"),a.position)),BI.isNotNull(a.day)&&(0!==BI.parseInt(a.day)&&(c+=Math.abs(a.day)+BI.i18nText("BI-Basic_Day")+(a.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=1===BI.size(a)?b(BI.i18nText("BI-Basic_Month"),a.position):""),BI.isNotNull(a.workDay)&&0!==BI.parseInt(a.workDay)&&(c+=Math.abs(a.workDay)+BI.i18nText("BI-Basic_Work_Day")+(a.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),c+d},setValue:function(a){var b,c,d=BI.getDate();switch(this.storeValue=a,BI.isNotNull(a)&&(b=a.type||BI.DynamicDateCombo.Static,c=a.value||a),b){case BI.DynamicDateCombo.Dynamic:var e=this._getText(c);d=BI.DynamicDateHelper.getCalculation(c),this._setInnerValue(d,e);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(c)||BI.isNull(c.day))this.editor.setState(""),this.editor.setValue("");else{var f=BI.getDate(c.year,c.month-1,c.day).print("%Y-%X-%d");this.editor.setState(f),this.editor.setValue(f)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger),BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1,DATE_MIN_VALUE:"1900-01-01",DATE_MAX_VALUE:"2099-12-31"},props:{baseCls:"bi-dynamic-date-combo bi-border",height:24},render:function(){var a=this,b=this.options;this.storeTriggerValue="";var c=BI.getDate();return this.storeValue=b.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){a.changeIcon=this}},width:24},{type:"bi.absolute",items:[{el:{type:"bi.combo",ref:function(){a.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){a.combo.isViewVisible()&&a.combo.hideView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){a.combo.isViewVisible()||a.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){a.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){a.storeTriggerValue=a.trigger.getKey(),a.combo.isViewVisible()||a.combo.showView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){a.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:c.getFullYear(),month:c.getMonth()+1}},a.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){a.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){if(!a.combo.isViewVisible()){var b=a.storeTriggerValue,c=a.trigger.getKey();BI.isNotEmptyString(c)&&!BI.isEqual(c,b)?(a.storeValue=a.trigger.getValue(),a.setValue(a.trigger.getValue())):BI.isEmptyString(c)&&(a.storeValue=null,a.trigger.setValue()),a._checkDynamicValue(a.storeValue),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",min:this.constants.DATE_MIN_VALUE,max:this.constants.DATE_MAX_VALUE,value:b.value,ref:function(){a.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){a.setValue(),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var b=BI.getDate();a.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),hour:0,minute:0,second:0}}),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var b=a.popup.getValue();a._checkValue(b)&&a.setValue(b),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){a.popup.setValue(a.storeValue),a.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){a.combo.isViewVisible()?a.combo.hideView():a.combo.showView()}}]},top:0,right:0}]}],ref:function(b){a.comboWrapper=b}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(a){var b=null;switch(BI.isNotNull(a)&&(b=a.type),b){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(a){switch(a.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(a.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(a){this.storeValue=a,this.trigger.setValue(a),this._checkDynamicValue(a)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2}),BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-border-left bi-border-right bi-border-top",shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){a.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",forceCenter:!0,cls:"bi-high-light bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(b.value)},_getTabJson:function(){var a=this;return{type:"bi.tab",ref:function(){a.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-border-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(b){switch(b){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){a._setInnerValue(a.year,b)}}],ref:function(){a.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",min:a.options.min,max:a.options.max,ref:function(){a.ymd=this}},{el:{type:"bi.dynamic_date_time_select",ref:function(){a.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){}}]},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var b=a.dateTab.getSelect();switch(b){case BI.DynamicDateCombo.Static:var c=BI.DynamicDateHelper.getCalculation(a.dynamicPane.getValue());a.ymd.setValue({year:c.getFullYear(),month:c.getMonth()+1,day:c.getDate()}),a.timeSelect.setValue(),a._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:a.storeValue&&a.storeValue.type===BI.DynamicDateCombo.Dynamic?a.dynamicPane.setValue(a.storeValue.value):a.dynamicPane.setValue({year:0}),a._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var a=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());a=a.print("%Y-%x-%e"),this.textButton.setValue(a),this.textButton.setEnable(!1)}},_checkValueValid:function(a){return BI.isNull(a)||BI.isEmptyObject(a)||BI.isEmptyString(a)},setValue:function(a){this.storeValue=a;var b,c,d=this;switch(a=a||{},b=a.type||BI.DynamicDateCombo.Static,c=a.value||a,this.dateTab.setSelect(b),b){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(c),d._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(c)){var e=BI.getDate();this.ymd.setValue({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(c),this.timeSelect.setValue({hour:c.hour,minute:c.minute,second:c.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var a=this.dateTab.getSelect();return{type:a,value:a===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup),BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select bi-border-top"},render:function(){var a=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){a.hour=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<24},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkHour(b),this.setValue(a._formatValueToDoubleDigit(b)),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var b=a._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(b)}}],width:60,height:24},lgap:14},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){a.minute=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<60},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkMinute(b),this.setValue(a._formatValueToDoubleDigit(b),BI.DynamicDateTimeSelect.MINUTE),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var b=a._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(b)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){a.second=this},validationChecker:function(a){return BI.isNaturalNumber(a)&&BI.parseInt(a)<60},errorText:function(a){return BI.isNumeric(a)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var b=this.getValue();a._checkSecond(b),this.setValue(a._formatValueToDoubleDigit(b)),a.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(a){a=a||{},this._checkHour(a.hour),this._checkMinute(a.minute),this._checkSecond(a.second)},_checkHour:function(a){this.hour.setDownEnable(BI.parseInt(a)>0),this.hour.setUpEnable(BI.parseInt(a)<23)},_checkMinute:function(a){this.minute.setDownEnable(BI.parseInt(a)>0),this.minute.setUpEnable(BI.parseInt(a)<59)},_checkSecond:function(a){this.second.setDownEnable(BI.parseInt(a)>0),this.second.setUpEnable(BI.parseInt(a)<59)},_autoSwitch:function(a,b){var c=0,d=a;switch(b){case BI.DynamicDateTimeSelect.HOUR:c=2;break;case BI.DynamicDateTimeSelect.MINUTE:c=5}return 1===a.length&&BI.parseInt(a)>c&&(d="0"+d),2===d.length&&(b===BI.DynamicDateTimeSelect.HOUR?this.minute.focus():this.second.focus()),d},_formatValueToDoubleDigit:function(a){(BI.isNull(a)||BI.isEmptyString(a))&&(a=0);var b=BI.parseInt(a);return b<10&&(b="0"+b),b},_assertValue:function(a){return a=a||{},a.hour=this._formatValueToDoubleDigit(a.hour)||"00",a.minute=this._formatValueToDoubleDigit(a.minute)||"00",a.second=this._formatValueToDoubleDigit(a.second)||"00",a},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(a){a=this._assertValue(a),this.hour.setValue(a.hour),this.minute.setValue(a.minute),this.second.setValue(a.second),this._checkBorder(a)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2}),BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(b){var c=b.match(/\d+/g);return a._autoAppend(b,c),a._dateCheck(b)&&BI.checkDateLegal(b)&&a._checkVoid({year:0|c[0],month:0|c[1],day:0|c[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){return a.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")},title:function(){var b=a.storeValue||{},c=b.type||BI.DynamicDateCombo.Static,d=b.value;switch(c){case BI.DynamicDateCombo.Dynamic:var e=a._getText(d),f=BI.DynamicDateHelper.getCalculation(d),g=f.print("%Y-%x-%e %H:%M:%S");return BI.isEmptyString(e)?g:e+":"+g;case BI.DynamicDateCombo.Static:default:return BI.isNull(d)||BI.isNull(d.day)?"":BI.getDate(d.year,d.month-1,d.day,d.hour||0,d.minute||0,d.second||0).print("%Y-%X-%d %H:%M:%S")}}}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();if(BI.isNotNull(b)&&a.editor.setState(b),BI.isNotEmptyString(b)){var c=b.split(/-|\s|:/);a.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|c[0],month:0|c[1],day:0|c[2],hour:0|c[3],minute:0|c[4],second:0|c[5]}}}a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:30}]}),this.setValue(b.value)},_dateCheck:function(a){return BI.parseDateTime(a,"%Y-%x-%d %H:%M:%S").print("%Y-%x-%d %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%X-%d %H:%M:%S").print("%Y-%X-%d %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%x-%e %H:%M:%S").print("%Y-%x-%e %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%X-%e %H:%M:%S").print("%Y-%X-%e %H:%M:%S")===a||BI.parseDateTime(a,"%Y-%x-%d").print("%Y-%x-%d")===a||BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d")===a||BI.parseDateTime(a,"%Y-%x-%e").print("%Y-%x-%e")===a||BI.parseDateTime(a,"%Y-%X-%e").print("%Y-%X-%e")===a},_checkVoid:function(a){return!BI.checkDateVoid(a.year,a.month,a.day,this.options.min,this.options.max)[0]},_autoAppend:function(a,b){if(BI.isNotNull(b)&&BI.checkDateLegal(a))switch(a.length){case this._const.yearLength:this._yearCheck(a)&&this.editor.setValue(a+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var c=a.split("-")[1];(BI.isNotNull(c)&&2===c.length||this._monthCheck(a))&&this.editor.setValue(a+"-")}},_yearCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d").print("%Y-%X-%d");return BI.parseDateTime(a,"%Y").print("%Y")===a&&b>=this.options.min&&b<=this.options.max},_monthCheck:function(a){var b=BI.parseDateTime(a,"%Y-%X-%d"),c=b.print("%Y-%X-%d");return b.getMonth()>0&&(BI.parseDateTime(a,"%Y-%X").print("%Y-%X")===a||BI.parseDateTime(a,"%Y-%x").print("%Y-%x")===a)&&c>=this.options.min&&c<=this.options.max},_setInnerValue:function(a){var b=a.print("%Y-%x-%e %H:%M:%S");this.editor.setState(b),this.editor.setValue(b)},_getText:function(a){function b(a,b){switch(b){case BI.DynamicDateCard.OFFSET.BEGIN:return a+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return a+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var c="",d="";return BI.isNotNull(a.year)&&(0!==BI.parseInt(a.year)&&(c+=Math.abs(a.year)+BI.i18nText("BI-Basic_Year")+(a.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Year"),a.position)),BI.isNotNull(a.quarter)&&(0!==BI.parseInt(a.quarter)&&(c+=Math.abs(a.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(a.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Single_Quarter"),a.position)),BI.isNotNull(a.month)&&(0!==BI.parseInt(a.month)&&(c+=Math.abs(a.month)+BI.i18nText("BI-Basic_Month")+(a.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Month"),a.position)),BI.isNotNull(a.week)&&(0!==BI.parseInt(a.week)&&(c+=Math.abs(a.week)+BI.i18nText("BI-Basic_Week")+(a.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=b(BI.i18nText("BI-Basic_Week"),a.position)),BI.isNotNull(a.day)&&(0!==BI.parseInt(a.day)&&(c+=Math.abs(a.day)+BI.i18nText("BI-Basic_Day")+(a.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),d=1===BI.size(a)?b(BI.i18nText("BI-Basic_Month"),a.position):""),BI.isNotNull(a.workDay)&&0!==BI.parseInt(a.workDay)&&(c+=Math.abs(a.workDay)+BI.i18nText("BI-Basic_Work_Day")+(a.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),c+d},setValue:function(a){var b,c,d=BI.getDate();switch(this.storeValue=a,BI.isNotNull(a)&&(b=a.type||BI.DynamicDateCombo.Static,c=a.value||a),b){case BI.DynamicDateCombo.Dynamic:var e=this._getText(c);d=BI.DynamicDateHelper.getCalculation(c),this._setInnerValue(d,e);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(c)||BI.isNull(c.day))this.editor.setState(""),this.editor.setValue("");else{var f=BI.getDate(c.year,c.month-1,c.day,c.hour||0,c.minute||0,c.second||0).print("%Y-%X-%d %H:%M:%S");this.editor.setState(f),this.editor.setValue(f)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger),BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-search-editor bi-border",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;this.editor=BI.createWidget({type:"bi.editor",height:b.height,watermark:b.watermark,allowBlank:!0,errorText:b.errorText,validationChecker:b.validationChecker,quitChecker:b.quitChecker}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){a.setValue(""),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),a.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.center_adapt",cls:"search-font",items:[{el:{type:"bi.icon"}}]},width:25},{el:a.editor},{el:this.clear,width:25}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.SearchEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a._checkClear(),a.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,b)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){a.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){a.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a._checkClear(),a.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){a.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var a=this.editor.getValue().match(/[\S]+/g);return BI.isNull(a)?"":a[a.length-1]}},getKeywords:function(){var a=this.editor.getValue(),b=a.match(/[\S]+/g);return BI.isEndWithBlank(a)?b.concat([" "]):b},getLastValidValue:function(){return this.editor.getLastValidValue()},setValue:function(a){this.editor.setValue(a),BI.isKey(a)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor),BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var a=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-small-search-editor",height:24})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor),BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-text-editor bi-border",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var a=this,b=this.options;BI.isNumber(b.height)&&this.element.css({height:b.height-2}),BI.isNumber(b.width)&&this.element.css({width:b.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:b.height-2,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,value:b.value,title:b.title,tipType:b.tipType,validationChecker:b.validationChecker,quitChecker:b.quitChecker,allowBlank:b.allowBlank,watermark:b.watermark,errorText:b.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){a.fireEvent(BI.TextEditor.EVENT_FOCUS); }),this.editor.on(BI.Editor.EVENT_BLUR,function(){a.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){a.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){a.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(b){a.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(b){a.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(b){a.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){a.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){a.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(b){a.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){a.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){a.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){a.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){a.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){a.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){a.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){a.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(a){this.editor.setErrorText(a)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(a){this.editor.setValue(a)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor),BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var a=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-small-text-editor",height:25})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor),BI.FileManagerButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-button_group",items:[]})},_init:function(){BI.FileManagerButtonGroup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.button_group=BI.createWidget({type:"bi.button_tree",element:this,chooseType:BI.Selection.Multi,items:this._formatItems(b.items),layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},_formatItems:function(a){this.options;return BI.each(a,function(a,b){b.children&&b.children.length>0?b.type="bi.file_manager_folder_item":b.type="bi.file_manager_file_item"}),a},setValue:function(a){this.button_group.setValue(a)},getValue:function(){return this.button_group.getValue()},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getAllButtons:function(){return this.button_group.getAllButtons()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},populate:function(a){this.button_group.populate(this._formatItems(a))}}),BI.FileManagerButtonGroup.EVENT_CHANGE="FileManagerButtonGroup.EVENT_CHANGE",BI.shortcut("bi.file_manager_button_group",BI.FileManagerButtonGroup),BI.FileManager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager",el:{},items:[]})},_init:function(){BI.FileManager.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=new BI.Tree;var c=BI.Tree.transformToTreeFormat(b.items);this.tree.initTree(c),this.selectedValues=[],this.nav=BI.createWidget({type:"bi.file_manager_nav",items:BI.deepClone(c)}),this.nav.on(BI.FileManagerNav.EVENT_CHANGE,function(b,c){if("-1"==b)a.populate({children:a.tree.toJSON()});else{var d=a.tree.search(c.attr("id"));a.populate(BI.extend({id:d.id},d.get("data"),{children:a.tree.toJSON(d)}))}a.setValue(a.selectedValues)}),this.list=BI.createWidget(b.el,{type:"bi.file_manager_list",items:c}),this.list.on(BI.Controller.EVENT_CHANGE,function(b,c,d){if(b===BI.Events.CHANGE){var e=a.tree.search(d.attr("id"));a.populate(BI.extend({id:e.id},e.get("data"),{children:a.tree.toJSON(e)}))}else if(b===BI.Events.CLICK){var f=[];if(d instanceof BI.MultiSelectBar){var g=a.list.getValue();c=g.type===BI.Selection.All,f=BI.concat(g.assist,g.value)}else f=d.getAllLeaves();BI.each(f,function(b,d){c===!0?a.selectedValues.pushDistinct(d):a.selectedValues.remove(d)})}a.setValue(a.selectedValues)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.list,left:0,right:0,top:0,bottom:10},{el:this.nav,left:40,right:100,top:0}]})},setValue:function(a){this.selectedValues=a||[],this.list.setValue(this.selectedValues)},getValue:function(){var a=this.list.getValue(),b=a.type===BI.Selection.All?a.assist:a.value;return b.pushDistinctArray(this.selectedValues),b},_populate:function(a){this.list.populate(a)},getSelectedValue:function(){return this.nav.getValue()[0]},getSelectedId:function(){return this.nav.getId()[0]},populate:function(a){var b=BI.deepClone(a);this._populate(a.children),this.nav.populate(b)}}),BI.FileManager.EVENT_CHANGE="FileManager.EVENT_CHANGE",BI.shortcut("bi.file_manager",BI.FileManager),BI.FileManagerFileItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.FileManagerFileItem.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-file-item bi-list-item bi-border-bottom",height:30})},_init:function(){BI.FileManagerFileItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checked=BI.createWidget({type:"bi.multi_select_bar",text:"",width:36,height:b.height}),this.checked.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.checked,width:36},{el:{type:"bi.icon_button",cls:"create-by-me-file-font"},width:20},{el:{type:"bi.label",textAlign:"left",height:b.height,text:b.text,value:b.value}}]})},getAllLeaves:function(){return[this.options.value]},isSelected:function(){return this.checked.isSelected()},setSelected:function(a){this.checked.setSelected(a)}}),BI.FileManagerFileItem.EVENT_CHANGE="FileManagerFileItem.EVENT_CHANGE",BI.shortcut("bi.file_manager_file_item",BI.FileManagerFileItem),BI.FileManagerFolderItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.FileManagerFolderItem.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-folder-item bi-list-item bi-border-bottom",height:30})},_init:function(){BI.FileManagerFolderItem.superclass._init.apply(this,arguments);var a=this,b=this.options;this.checked=BI.createWidget({type:"bi.multi_select_bar",text:"",width:36,height:b.height}),this.checked.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button=BI.createWidget({type:"bi.text_button",textAlign:"left",height:b.height,text:b.text,value:b.value}),this.button.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,b.value,a)}),this.tree=new BI.Tree,this.tree.initTree([{id:b.id,children:b.children}]),this.selectValue=[],BI.createWidget({type:"bi.htape",element:this,items:[{el:this.checked,width:36},{el:{type:"bi.icon_button",cls:"create-by-me-folder-font"},width:20},{el:this.button}]})},setAllSelected:function(a){this.checked.setSelected(a),this.selectValue=[]},setHalfSelected:function(a){this.checked.setHalfSelected(a),a||(this.selectValue=[])},setValue:function(a){var b=(this.options,!1),c=[];this.tree.traverse(function(d){d.isLeaf()&&(BI.contains(a,d.get("data").value)?c.push(d.get("data").value):b=!0)}),this.setAllSelected(c.length>0&&!b),this.setHalfSelected(c.length>0&&b),this.checked.isHalfSelected()&&(this.selectValue=c)},getAllButtons:function(){return[this]},getAllLeaves:function(){var a=(this.options,[]);return this.tree.traverse(function(b){b.isLeaf()&&a.push(b.get("data").value)}),a},getNotSelectedValue:function(){var a=this,b=(this.options,[]),c=this.checked.isSelected();if(c===!0)return b;var d=this.checked.isHalfSelected();return this.tree.traverse(function(c){if(c.isLeaf()){var e=c.get("data").value;d===!0?BI.contains(a.selectValue,c.get("data").value)||b.push(e):b.push(e)}}),b},getValue:function(){var a=[];return this.checked.isSelected()?(this.tree.traverse(function(b){b.isLeaf()&&a.push(b.get("data").value)}),a):this.checked.isHalfSelected()?this.selectValue:[]}}),BI.FileManagerFolderItem.EVENT_CHANGE="FileManagerFolderItem.EVENT_CHANGE",BI.shortcut("bi.file_manager_folder_item",BI.FileManagerFolderItem),BI.FileManagerList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-list",el:{},items:[]})},_init:function(){BI.FileManagerList.superclass._init.apply(this,arguments);var a=this,b=this.options;this.list=BI.createWidget({type:"bi.select_list",element:this,items:b.items,toolbar:{type:"bi.multi_select_bar",height:40,text:""},el:{type:"bi.list_pane",el:BI.isWidget(b.el)?b.el:BI.extend({type:"bi.file_manager_button_group"},b.el)}}),this.list.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(a){this.list.setValue({value:a})},getValue:function(){return this.list.getValue()},populate:function(a){this.list.populate(a),this.list.setToolBarVisible(!0)}}),BI.FileManagerList.EVENT_CHANGE="FileManagerList.EVENT_CHANGE",BI.shortcut("bi.file_manager_list",BI.FileManagerList),BI.FileManagerNavButton=BI.inherit(BI.Widget,{_const:{normal_color:"#ffffff",select_color:"#eff1f4"},_defaultConfig:function(){return BI.extend(BI.FileManagerNavButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-nav-button",selected:!1,height:40})},_init:function(){BI.FileManagerNavButton.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.button=BI.createWidget({type:"bi.text_button",cls:"file-manager-nav-button-text bi-card",once:!0,selected:b.selected,text:b.text,title:b.text,value:b.value,height:b.height,lgap:20,rgap:10}),this.button.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=a,a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var d=BI.createWidget({type:"bi.svg",cls:"file-manager-nav-button-triangle",width:15,height:b.height}),e=d.path("M0,0L15,20L0,40").attr({stroke:c.select_color,fill:b.selected?c.select_color:c.normal_color});this.button.on(BI.TextButton.EVENT_CHANGE,function(){this.isSelected()?e.attr("fill",c.select_color):e.attr("fill",c.normal_color)}),BI.createWidget({type:"bi.default",element:this,items:[this.button]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:d,right:-15,top:0,bottom:0}]})},isSelected:function(){return this.button.isSelected()},setValue:function(a){this.button.setValue(a)},getValue:function(){return this.button.getValue()},populate:function(a){}}),BI.FileManagerNavButton.EVENT_CHANGE="FileManagerNavButton.EVENT_CHANGE",BI.shortcut("bi.file_manager_nav_button",BI.FileManagerNavButton),BI.FileManagerNav=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.FileManagerNav.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-file-manager-nav bi-border-left",height:40,items:[]})},_init:function(){BI.FileManagerNav.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=new BI.Tree,this.refreshTreeData(b.items),this.tree.getRoot().set("data",{text:BI.i18nText("BI-Created_By_Me"),value:BI.FileManagerNav.ROOT_CREATE_BY_ME,id:BI.FileManagerNav.ROOT_CREATE_BY_ME}),this.button_group=BI.createWidget({type:"bi.button_group",element:this,items:[{type:"bi.file_manager_nav_button",text:BI.i18nText("BI-Created_By_Me"),selected:!0,id:BI.FileManagerNav.ROOT_CREATE_BY_ME,value:BI.FileManagerNav.ROOT_CREATE_BY_ME}],layouts:[{type:"bi.horizontal"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(b,c){a.fireEvent(BI.FileManagerNav.EVENT_CHANGE,arguments)})},_getAllParents:function(a){var b,c=[];for(b=a?this.tree.search(a):this.tree.getRoot();b.parent;)c.push(b),b=b.parent;return c.push(b),c.reverse()},_formatNodes:function(a){var b=[];return BI.each(a,function(a,c){b.push(BI.extend({type:"bi.file_manager_nav_button",id:c.id},c.get("data")))}),BI.last(b).selected=!0,b},getValue:function(){return this.button_group.getValue()},getId:function(){var a=[];return BI.each(this.button_group.getSelectedButtons(),function(b,c){a.push(c.attr("id"))}),a},refreshTreeData:function(a){this.tree.initTree(BI.Tree.transformToTreeFormat(a)),this.tree.getRoot().set("data",{text:BI.i18nText("BI-Created_By_Me"),value:BI.FileManagerNav.ROOT_CREATE_BY_ME,id:BI.FileManagerNav.ROOT_CREATE_BY_ME})},populate:function(a){var b=BI.isNull(a)?[this.tree.getRoot()]:this._getAllParents(a.id);this.button_group.populate(this._formatNodes(b))}}),BI.extend(BI.FileManagerNav,{ROOT_CREATE_BY_ME:"-1"}),BI.FileManagerNav.EVENT_CHANGE="FileManagerNav.EVENT_CHANGE",BI.shortcut("bi.file_manager_nav",BI.FileManagerNav),BI.AbstractFilterItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-item bi-border-right bi-border-bottom"},isSelectedCondition:function(){return this.emptyItem&&this.emptyItem.isVisible()},setSelectedCondition:function(a){a&&(this.emptyItem||(this.emptyItem=BI.createWidget({type:"bi.absolute",height:40,cls:"filter-item-empty-item bi-border-top",items:[{el:{type:"bi.center_adapt",cls:"empty-filter-item-leaf"}}],hgap:10,vgap:5}),BI.createWidget({type:"bi.vertical",element:this,items:[this.emptyItem],scrolly:!1}))),this.emptyItem&&this.emptyItem.setVisible(a)}}),BI.extend(BI.AbstractFilterItem,{FILTER_OPERATION_FORMULA:1,FILTER_OPERATION_CONDITION:2,FILTER_OPERATION_CONDITION_AND:3,FILTER_OPERATION_CONDITION_OR:4,FILTER_OPERATION_FORMULA_AND:5,FILTER_OPERATION_FORMULA_OR:6}),!function(){var a=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-expander",el:{},popup:{}},render:function(){var a=this,b=this.options;return{type:"bi.filter_expander",el:b.el,popup:b.popup,id:b.id,value:b.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}],ref:function(b){a.expander=b}}},populate:function(){this.expander.populate.apply(this.expander,arguments)},getValue:function(){var a=this.expander.getValue();return{filterType:a.type,filterValue:a.value,id:a.id}}});BI.shortcut("bi.and.or.filter.expander",a)}(),!function(){var a=BI.inherit(BI.AbstractFilterItem,{_constant:{EXPANDER_WIDTH:20},props:{baseCls:"bi-filter-item bi-filter-expander",el:{},popup:{}},render:function(){var a=this,b=this.options,c=b.el.value,d="";return d=c===BI.Filter.FILTER_TYPE.AND?BI.i18nText("BI-Basic_And"):BI.i18nText("BI-Basic_Or"),{type:"bi.horizontal_adapt",cls:"filter-item-empty-item",verticalAlign:BI.VerticalAlign.Middle,items:[{type:"bi.text_button",cls:"condition-and-or",text:d,value:c,id:b.id,width:this._constant.EXPANDER_WIDTH,height:"100%",ref:function(b){a.expander=b},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,"",a)}}]},BI.extend(b.popup,{ref:function(b){a.conditionsView=b},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})]}},getValue:function(){return{type:this.expander.getValue(),value:this.conditionsView.getValue(),id:this.options.id}},populate:function(){this.conditionsView.populate.apply(this.conditionsView,arguments)}});BI.shortcut("bi.filter_expander",a)}(),BI.Filter=BI.inherit(BI.Widget,{constants:{FIELD_TYPE_NUMBER:1,FIELD_TYPE_STRING:0,FIELD_TYPE_DATE:2},props:{baseCls:"bi-filter",expander:{},items:[],el:{},itemCreator:BI.empty},render:function(){var a=this,b=this.options;return BI.extend({type:"bi.filter_operation",expander:b.expander,listeners:[{eventName:"EVENT_OPERATION",action:function(b){switch(b){case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_CONDITION);break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_CONDITION,1);break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_FORMULA);break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR:a._addAndOrCondition(BI.Filter.FILTER_TYPE.EMPTY_FORMULA,1)}}},{eventName:"BI.FilterOperation.EVENT_DESTROY_ITEM",action:function(b){a._removeCondition(b)}}],ref:function(b){a.filter=b}},b.el)},mounted:function(){this.tree=new BI.Tree,this.tree.initTree(this.options.items),this._populate(this.tree.toJSONWithNode())},_createEmptyNode:function(a){var b=new BI.Node(BI.UUID());return b.set("data",{value:a}),b},_insertAndOrCondition:function(a,b,c){var d=["AND","OR"];c||(c=0);var e=this.tree.search(a);if(BI.isNotNull(e)){var f=e.get("data"),g=e.getParent(),h=g.getChildIndex(e.id),i=g.get("data")||{},j=this._createEmptyNode(b);if(f.value===BI.Filter.FILTER_TYPE[d[c]])return void this.tree.addNode(e,j);if(f.value===BI.Filter.FILTER_TYPE[d[1-c]]&&i.value===BI.Filter.FILTER_TYPE[d[c]])return void g.addChild(j,h+1);if(f.value===BI.Filter.FILTER_TYPE[d[1-c]]&&i.value!==BI.Filter.FILTER_TYPE[d[c]]||i.value===BI.Filter.FILTER_TYPE[d[1-c]]||i.value!==BI.Filter.FILTER_TYPE.AND&&i.value!==BI.Filter.FILTER_TYPE.OR){var k=new BI.Node(BI.UUID());return k.set("data",{value:BI.Filter.FILTER_TYPE[d[c]],children:[e.get("data"),j.get("data")]}),g.removeChildByIndex(h),g.addChild(k,h),k.addChild(e),void k.addChild(j)}g.addChild(j,h+1)}},_removeCondition:function(a){var b=this.tree.search(a);if(BI.isNotNull(b)){var c=b.getParent();if(c.removeChild(a),c.getChildrenLength()<=1){var d=c.getParent();if(BI.isNotNull(d)){var e=d.getChildIndex(c.id);d.removeChildByIndex(e),1===c.getChildrenLength()&&d.addChild(c.getFirstChild(),e)}}this._populate(this.tree.toJSONWithNode()),this.fireEvent("EVENT_CHANGE")}},_addAndOrCondition:function(a,b){var c=["AND","OR"];b||(b=0);var d=this.filter.getCurrentSelectItem();if(BI.isNotNull(d)){var e=d.attr("id");this._insertAndOrCondition(e,a,b)}else{var f=this._createEmptyNode(a),g=this.tree.getRoot(),h=g.getLastChild();if(BI.isNotNull(h)){var i=h.get("data");if(i.value===BI.Filter.FILTER_TYPE[c[b]])this.tree.addNode(h,f);else{var j=new BI.Node(BI.UUID());j.set("data",{value:BI.Filter.FILTER_TYPE[c[b]],children:[h.get("data"),f.get("data")]}),g.removeChild(h.id),this.tree.addNode(j),this.tree.addNode(j,h),this.tree.addNode(j,f)}}else this.tree.addNode(f)}this._populate(this.tree.toJSONWithNode()),this.fireEvent("EVENT_CHANGE")},_populate:function(a){this.filter.defaultState();var b=this.options;b.items=a,BI.Tree.traversal(a,function(a,c){b.itemCreator(c)}),this.filter.populate.apply(this.filter,[a])},populate:function(a){this.tree.initTree(a),this._populate(this.tree.toJSONWithNode())},getValue:function(){return this.filter.getValue()}}),BI.shortcut("bi.filter",BI.Filter),BI.Filter.FILTER_TYPE={},BI.Filter.FILTER_TYPE.FORMULA=33,BI.Filter.FILTER_TYPE.AND=34,BI.Filter.FILTER_TYPE.OR=35,BI.Filter.FILTER_TYPE.EMPTY_FORMULA=36,BI.Filter.FILTER_TYPE.EMPTY_CONDITION=37,!function(){var a=BI.inherit(BI.ButtonTree,{props:{baseCls:"bi-button-map"},_createBtns:function(a){var b=this.options,c=BI.createWidgets(BI.createItems(a,{type:"bi.text_button",once:0===b.chooseType})),d=BI.map(a,function(a,b){if(b=BI.stripEL(b),!b.id&&!b.value)throw new Error("item must have 'id' or 'value' as its property");return b.id||b.value});return BI.zipObject(d,c)},setValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(a.contains(b)?c.setSelected&&c.setSelected(!0):c.setSelected&&c.setSelected(!1)):void c.setValue(a)})},setNotSelectedValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(a.contains(b)?c.setSelected&&c.setSelected(!1):c.setSelected&&c.setSelected(!0)):void c.setNotSelectedValue(a)})},populate:function(a){var b=this,c=[].slice.call(arguments),d=new BI.LinkHashMap,e=function(a){return a.id||a.value};this.buttons||(this.buttons={});var f=[];BI.each(a,function(a,d){if(d=BI.stripEL(d),b.buttons[e(d)]){var g=b.buttons[e(d)];c[0]=d.items,c[2]=d,g.populate&&g.populate.apply(g,c)}else f.push(d)}),c[0]=f;var g=this._btnsCreator.apply(this,c),h=[];BI.each(a,function(a,c){c=BI.stripEL(c);var f=b.buttons[e(c)]||g[e(c)];d.add(e(c),f),h.push(f)}),this.buttons=d.map,BI.DOM.hang(this.buttons),this.element.empty();var i=this._packageItems(a,this._packageBtns(h));BI.createWidget(BI.extend({element:this},this._packageLayout(i)))},getIndexByValue:function(){throw new Error("Can not use getIndexByValue")}});BI.shortcut("bi.filter_list",a)}(),!function(){var a=0,b=1,c=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(c.superclass._defaultConfig.apply(this,arguments),{constants:{FORMULA_COMBO:[{text:BI.i18nText("BI-Conf_Formula_And"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND},{text:BI.i18nText("BI-Conf_Formula_Or"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR}],CONDITION_COMBO:[{text:BI.i18nText("BI-Conf_Condition_And"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND},{text:BI.i18nText("BI-Conf_Condition_Or"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR}]}})},props:{baseCls:"bi-filter-operation",expander:{},items:[],selections:[BI.AbstractFilterItem.FILTER_OPERATION_CONDITION,BI.AbstractFilterItem.FILTER_OPERATION_FORMULA],itemsCreator:BI.emptyFn},render:function(){var c=this,d=this.options;return this.currentSelected=null,{type:"bi.vtape",items:[{el:{type:"bi.tab",showIndex:a,cardCreator:BI.bind(this._createTabs,this),ref:function(a){c.buttonComboTab=a}},height:40},{el:{type:"bi.absolute",scrollable:!0,items:[{el:{type:"bi.left",items:[{type:"bi.filter_pane",expander:d.expander,items:d.items,itemsCreator:d.itemsCreator,listeners:[{eventName:"EVENT_CHANGE",action:function(d,e,f){d===BI.Events.CLICK&&(BI.isNotNull(c.currentSelected)&&c.currentSelected===f?f.setSelectedCondition(!f.isSelectedCondition()):(BI.isNotNull(c.currentSelected)&&c.currentSelected.setSelectedCondition(!1),c.currentSelected=f,f.setSelectedCondition(!0)),c.currentSelected.isSelectedCondition()?c.buttonComboTab.setSelect(b):c.buttonComboTab.setSelect(a)),d===BI.Events.DESTROY&&(c.currentSelected===f&&(c.currentSelected=null,c.buttonComboTab.setSelect(a)),c.fireEvent("BI.FilterOperation.EVENT_DESTROY_ITEM",e,f))}}],ref:function(a){c.filter=a}}]},top:0,right:2,bottom:0,left:0}]}}]}},_createTabs:function(c){var d=this;switch(c){case a:return{type:"bi.button_group",items:BI.createItems(d._createButtons(),{type:"bi.icon_text_item",height:30,width:100}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,layouts:[{type:"bi.left",vgap:5}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(a,b){BI.isEmptyArray(d.filter.getValue())&&d.filter.element.addClass("bi-border-top bi-border-left"),d.fireEvent("EVENT_OPERATION",b.getValue()),d.defaultState()}}]};case b:return{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,items:d._buildOperationButton(),layouts:[{type:"bi.left",vgap:5}]}}},_createButtons:function(){var a=[];return BI.each(this.options.selections,function(b,c){switch(c){case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:a.push({text:BI.i18nText("BI-Conf_Add_Formula"),value:BI.AbstractFilterItem.FILTER_OPERATION_FORMULA,cls:"operation-trigger filter-formula-font"});break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:a.push({text:BI.i18nText("BI-Conf_Add_Condition"),value:BI.AbstractFilterItem.FILTER_OPERATION_CONDITION,cls:"operation-trigger filter-condition-font"})}}),a},_buildOperationButton:function(){var a=this,b=[];return BI.each(this.options.selections,function(c,d){var e="",f="",g=[];switch(d){case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA:e=BI.i18nText("BI-Conf_Add_Formula"),f="filter-formula-font",g=a.options.constants.FORMULA_COMBO;break;case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION:default:e=BI.i18nText("BI-Conf_Add_Condition"),f="filter-condition-font",g=a.options.constants.CONDITION_COMBO}var h=BI.createWidget({type:"bi.icon_text_icon_item",iconCls1:"operation-trigger "+f,iconCls2:"pull-down-font",text:e,height:30,width:100});b.push({type:"bi.combo",el:h,popup:{el:{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_NONE,items:BI.createItems(g,{type:"bi.single_select_item",height:25}),layouts:[{type:"bi.vertical"}]}},listeners:[{eventName:BI.Combo.EVENT_CHANGE,action:function(b,c){switch(BI.isEmptyArray(a.filter.getValue())&&a.filter.element.addClass("bi-border-top bi-border-left"),b){case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_AND:case BI.AbstractFilterItem.FILTER_OPERATION_CONDITION_OR:h.setText(BI.i18nText("BI-Conf_Add_Condition"));break;case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_AND:case BI.AbstractFilterItem.FILTER_OPERATION_FORMULA_OR:h.setText(BI.i18nText("BI-Conf_Add_Formula"));break;default:h.setText()}a.fireEvent("EVENT_OPERATION",c.getValue()),a.defaultState(),this.hideView()}}]})}),b},defaultState:function(){BI.isNotNull(this.currentSelected)&&this.currentSelected.setSelectedCondition(!1),this.buttonComboTab.setSelect(a)},getCurrentSelectItem:function(){if(BI.isNotNull(this.currentSelected)&&this.currentSelected.isSelectedCondition())return this.currentSelected},populate:function(a){this.filter.populate.apply(this.filter,arguments)},getValue:function(){return this.filter.getValue()}});BI.shortcut("bi.filter_operation",c)}(),!function(){var a=BI.inherit(BI.Widget,{props:{baseCls:"bi-filter-pane",expander:{},items:[],itemsCreator:BI.emptyFn},render:function(){var a=this,b=this.options;return{type:"bi.custom_tree",cls:BI.isNotEmptyArray(b.items)?"bi-border-top bi-border-left":"",expander:BI.extend({type:"bi.filter_expander",el:{},popup:{type:"bi.custom_tree"}},b.expander),el:{type:"bi.filter_list",chooseType:BI.ButtonGroup.CHOOSE_TYPE_DEFAULT,layouts:[{type:"bi.vertical",scrolly:!1}]},items:b.items,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){a.fireEvent("EVENT_CHANGE",arguments)}}],ref:function(b){a.tree=b}}},populate:function(a){BI.isNotEmptyArray(a)?this.element.addClass("bi-border-top bi-border-left"):this.element.removeClass("bi-border-top bi-border-left"),this.tree.populate.apply(this.tree,arguments)},getValue:function(){return this.tree.getValue()}});BI.shortcut("bi.filter_pane",a)}(),BI.IntervalSlider=BI.inherit(BI.Widget,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var a=this,b=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,errorText:"",allowBlank:!1,width:b.EDITOR_WIDTH,validationChecker:function(b){return a._checkValidation(b)}}),this.labelOne.element.hover(function(){a.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){a.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var b=BI.parseFloat(this.getValue());a.valueOne=b;var c=a._getPercentByValue(b),d=BI.parseFloat(c.toFixed(1));a._setLabelOnePosition(d),a._setSliderOnePosition(d),a._setBlueTrack(),a.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",errorText:"",text:this.options.unit,allowBlank:!1,width:b.EDITOR_WIDTH,validationChecker:function(b){return a._checkValidation(b)}}),this.labelTwo.element.hover(function(){a.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){a.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var b=BI.parseFloat(this.getValue());a.valueTwo=b;var c=a._getPercentByValue(b),d=BI.parseFloat(c.toFixed(1));a._setLabelTwoPosition(d),a._setSliderTwoPosition(d),a._setBlueTrack(),a.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:b.TRACK_HEIGHT}]}],hgap:7,height:b.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(a,b){var c=this.options,d=100*a/this._getGrayTrackLength(),e=BI.parseFloat(d.toFixed(1)),f=this._getValueByPercent(e);f=this._assertValue(f),f=c.digit===!1?f:f.toFixed(c.digit),b?(this._setLabelOnePosition(e),this._setSliderOnePosition(e),this.labelOne.setValue(f),this.valueOne=f):(this._setLabelTwoPosition(e),this._setSliderTwoPosition(e),this.labelTwo.setValue(f),this.valueTwo=f),this._setBlueTrack()},_rePosBySizeAfterStop:function(a,b){var c=100*a/this._getGrayTrackLength(),d=BI.parseFloat(c.toFixed(1));b?this._setSliderOnePosition(d):this._setSliderTwoPosition(d)},_draggable:function(a,b){function c(a){return BI.clamp(a,0,d._getGrayTrackLength())}var d=this,e=(this.options,!1),f=0,g=0,h=0,i=new BI.MouseMoveTracker(function(j){i.isDragging()&&(e=!0,g+=j,f=c(h+g),a.element.addClass("dragging"),d._rePosBySizeAfterMove(f,b))},function(){e===!0&&(f=c(f),d._rePosBySizeAfterStop(f,b),f=0,g=0,h=f,e=!1),a.element.removeClass("dragging"),i.releaseMouseMoves(),d.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);a.element.on("mousedown",function(b){a.isEnabled()&&(h=this.offsetLeft,c(h),i.captureMouseMoves(b))})},_createLabelWrapper:function(){var a=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:a.EDITOR_R_GAP,height:70},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var a=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%" }]}],hgap:a.SLIDER_WIDTH_HALF,height:a.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(a){var b=this.options,c=!1,d=(a+"").split(".")[1];return BI.isEmptyString(d)||BI.isNumeric(a)&&!(BI.isNull(a)||athis.max)&&(b.digit===!1?c=!0:(d=d||"",c=d.length===b.digit)),c},_checkOverlap:function(){var a=this.labelOne.element[0].offsetLeft,b=this.labelTwo.element[0].offsetLeft;a<=b?b-a<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):a-b<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_setLabelOnePosition:function(a){this.labelOne.element.css({left:a+"%"}),this._checkOverlap()},_setLabelTwoPosition:function(a){this.labelTwo.element.css({left:a+"%"}),this._checkOverlap()},_setSliderOnePosition:function(a){this.sliderOne.element.css({left:a+"%"})},_setSliderTwoPosition:function(a){this.sliderTwo.element.css({left:a+"%"})},_setBlueTrackLeft:function(a){this.blueTrack.element.css({left:a+"%"})},_setBlueTrackWidth:function(a){this.blueTrack.element.css({width:a+"%"})},_setBlueTrack:function(){var a=this._getPercentByValue(this.labelOne.getValue()),b=this._getPercentByValue(this.labelTwo.getValue());a<=b?(this._setBlueTrackLeft(a),this._setBlueTrackWidth(b-a)):(this._setBlueTrackLeft(b),this._setBlueTrackWidth(a-b))},_setAllPosition:function(a,b){this._setSliderOnePosition(a),this._setLabelOnePosition(a),this._setSliderTwoPosition(b),this._setLabelTwoPosition(b),this._setBlueTrack()},_setVisible:function(a){this.sliderOne.setVisible(a),this.sliderTwo.setVisible(a),this.labelOne.setVisible(a),this.labelTwo.setVisible(a)},_setErrorText:function(){var a=BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max);this.labelOne.setErrorText(a),this.labelTwo.setErrorText(a)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(a){var b=this.calculation.accurateSubtraction(this.max,this.min),c=this.calculation.accurateMultiplication(b,a),d=this.calculation.accurateDivisionTenExponent(c,2);if(this.precision<0){var e=BI.parseFloat(this.calculation.accurateAddition(d,this.min)),f=Math.round(this.calculation.accurateDivisionTenExponent(e,-this.precision));return this.calculation.accurateMultiplication(f,Math.pow(10,-this.precision))}return BI.parseFloat(this.calculation.accurateAddition(d,this.min).toFixed(this.precision))},_getPercentByValue:function(a){return 100*(a-this.min)/(this.max-this.min)},_setDraggableEnable:function(a){this.sliderOne.setEnable(a),this.sliderTwo.setEnable(a)},_getPrecision:function(){var a=this.calculation.accurateSubtraction(this.max,this.min),b=a.toPrecision(4),c=b.indexOf("e"),d=[];if(c>-1){d=b.split("e");var e=BI.size(d[0].split(".")[1]),f=BI.parseInt(d[1].substring(1));return e-f}return d=b.split("."),d.length>1?d[1].length:0},_assertValue:function(a){return a<=this.min?this.min:a>=this.max?this.max:a},_setEnable:function(a){BI.IntervalSlider.superclass._setEnable.apply(this,[a]),this.blueTrack&&this.blueTrack.setVisible(!!a)},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(a){var b=BI.parseFloat(a.min),c=BI.parseFloat(a.max);!isNaN(b)&&!isNaN(c)&&c>=b&&(this.min=b,this.max=c,this.valueOne=b,this.valueTwo=c,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),c===b&&this._setDraggableEnable(!1)},setValue:function(a){var b=this.options,c=BI.parseFloat(a.min),d=BI.parseFloat(a.max);c=b.digit===!1?c:c.toFixed(b.digit),d=b.digit===!1?d:d.toFixed(b.digit),isNaN(c)||isNaN(d)||(this._checkValidation(c)&&(this.valueOne=c),this._checkValidation(d)&&(this.valueTwo=d),cthis.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(this.valueOne),this.labelTwo.setValue(this.valueTwo),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider),BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(a){for(var b="1",c=0;c0)var d=b;else{var d=a;c=0-c}for(var e=0;e=b.numDecimal.length?a.numDecimal.length:b.numDecimal.length}function d(a,b){for(var c=b-a.length,d=0;d=BI.parseInt(f.numDecimal))var i=(BI.parseInt(e.numDecimal)-BI.parseInt(f.numDecimal)).toString(),j=d(i,h);else{g--;var k=this._getMagnitude(h),i=(k+BI.parseInt(e.numDecimal)-BI.parseInt(f.numDecimal)).toString(),j=d(i,h)}var l=g+"."+j;return BI.parseFloat(l)},_accurateAddition:function(a,b){function c(a,b){for(var c=b-a.length,d=0;db)var e=d.numInteger.slice(0,d.numInteger.length-b),f=d.numInteger.slice(-b);else var e="0",f=c(d.numInteger,b);var g=e+"."+f+d.numDecimal;return BI.parseFloat(g)},accurateSubtraction:function(a,b){return a>=0&&b>=0?a>=b?this._accurateSubtraction(a,b):-this._accurateSubtraction(b,a):a>=0&&b<0?this._accurateAddition(a,-b):a<0&&b>=0?-this._accurateAddition(-a,b):a<0&&b<0?a>=b?this._accurateSubtraction(-b,-a):this._accurateSubtraction(-a,-b):void 0},accurateAddition:function(a,b){return a>=0&&b>=0?this._accurateAddition(a,b):a>=0&&b<0?this.accurateSubtraction(a,-b):a<0&&b>=0?this.accurateSubtraction(b,-a):a<0&&b<0?-this._accurateAddition(-a,-b):void 0},accurateMultiplication:function(a,b){return a>=0&&b>=0?this._accurateMultiplication(a,b):a>=0&&b<0?-this._accurateMultiplication(a,-b):a<0&&b>=0?-this._accurateMultiplication(-a,b):a<0&&b<0?this._accurateMultiplication(-a,-b):void 0},accurateDivisionTenExponent:function(a,b){return a>=0?this._accurateDivisionTenExponent(a,b):-this._accurateDivisionTenExponent(-a,b)}}),BI.MonthCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",behaviors:{},height:25})},_init:function(){BI.MonthCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.month_trigger",value:b.value}),this.trigger.on(BI.MonthTrigger.EVENT_CONFIRM,function(b){a.combo.isViewVisible()||(this.getKey()&&this.getKey()!==a.storeValue?a.setValue(this.getValue()):this.getKey()||a.setValue(),a.fireEvent(BI.MonthCombo.EVENT_CONFIRM))}),this.trigger.on(BI.MonthTrigger.EVENT_FOCUS,function(){a.storeValue=this.getKey()}),this.trigger.on(BI.MonthTrigger.EVENT_START,function(){a.combo.hideView()}),this.trigger.on(BI.MonthTrigger.EVENT_STOP,function(){a.combo.isViewVisible()||a.combo.showView()}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:b.behaviors,value:b.value}),this.popup.on(BI.MonthPopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MonthCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,el:this.popup}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.MonthCombo.EVENT_BEFORE_POPUPVIEW)})},setValue:function(a){this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return BI.isNull(this.popup)?this.options.value||"":this.popup.getValue()||""}}),BI.MonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.MonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.month_combo",BI.MonthCombo),BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var a=this,b=this.options,c=[1,7,2,8,3,9,4,10,5,11,6,12],d=[];d.push(c.slice(0,2)),d.push(c.slice(2,4)),d.push(c.slice(4,6)),d.push(c.slice(6,8)),d.push(c.slice(8,10)),d.push(c.slice(10,12)),d=BI.map(d,function(a,b){return BI.map(b,function(a,b){return{type:"bi.text_item",cls:"bi-list-item-active",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:b,text:b}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:b.behaviors,items:BI.createItems(d,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:b.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(b){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(a){a=BI.parseInt(a),this.month.setValue([a])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup),BI.MonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.MonthTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-month-trigger bi-border",height:24})},_init:function(){BI.MonthTrigger.superclass._init.apply(this,arguments);var a=this,b=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:b.height,validationChecker:function(a){return""===a||BI.isPositiveInteger(a)&&a>=1&&a<=12},quitChecker:function(a){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,errorText:BI.i18nText("BI-Month_Trigger_Error_Text")}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){a.fireEvent(BI.MonthTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){a.fireEvent(BI.MonthTrigger.EVENT_CHANGE)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var b=a.editor.getValue();BI.isNotNull(b)&&(a.editor.setValue(b),a.editor.setTitle(b)),a.fireEvent(BI.MonthTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){a.editor.isValid()&&a.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){a.fireEvent(BI.MonthTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){a.fireEvent(BI.MonthTrigger.EVENT_STOP)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),baseCls:"bi-trigger-month-text",width:b.height},width:b.height},{el:{type:"bi.trigger_icon_button",width:b.height},width:b.height}]}),this.setValue(b.value)},setValue:function(a){return BI.isNotNull(a)?(this.editor.setState(a+1),this.editor.setValue(a+1),void this.editor.setTitle(a+1)):(this.editor.setState(""),this.editor.setValue(""),void this.editor.setTitle(""))},getKey:function(){return 0|this.editor.getValue()},getValue:function(){return this.editor.getValue()-1}}),BI.MonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.MonthTrigger.EVENT_START="EVENT_START",BI.MonthTrigger.EVENT_STOP="EVENT_STOP",BI.MonthTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_trigger",BI.MonthTrigger),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:b.items,chooseType:b.chooseType,value:b.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(b){a.fireEvent(BI.DownListCombo.EVENT_CHANGE,b),a.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(b,c){a.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,b,c),a.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:b.trigger,isNeedAdjustWidth:!1,container:b.container,adjustLength:b.adjustLength,direction:b.direction,stopPropagation:b.stopPropagation,el:BI.createWidget(b.el,{type:"bi.icon_trigger",extraCls:b.iconCls?b.iconCls:"pull-down-font",width:b.width,height:b.height}),popup:{el:this.popupview,stopPropagation:!0,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){a.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(){this.downlistcombo.showView()},populate:function(a){this.popupview.populate(a)},setValue:function(a){this.popupview.setValue(a)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo),BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var a=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var a=this,b=this.options,c=this._createPopupItems(b.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(c,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(b.value),chooseType:b.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(b,c){var d=b;if(BI.isNotNull(a.childValueMap[b])){d=a.childValueMap[b];var e=a.fatherValueMap[b],f=(e+"").split("_");a.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,d,f.length>1?f:e)}else a.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,d,c);if(!a.singleValues.contains(d)){var g=a.getValue(),h=[];BI.each(g,function(a,b){b.value!=d&&h.push(b)}),a.setValue(h)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup]})},_createPopupItems:function(a){var b=this,c=[];return BI.each(a,function(d,e){var f={type:"bi.down_list_group",items:[]};if(BI.each(e,function(a,c){BI.isNotEmptyArray(c.children)&&!BI.isEmpty(c.el)?(c.type="bi.combo_group",c.cls="down-list-group",c.trigger="hover",c.isNeedAdjustWidth=!1,c.el.title=c.el.title||c.el.text,c.el.type="bi.down_list_group_item",c.el.logic={dynamic:!0},c.el.height=b.constants.height,c.el.iconCls2=b.constants.nextIcon,c.popup={lgap:4,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}},c.el.childValues=[],BI.each(c.children,function(a,d){d=d.el?BI.extend(d.el,{children:d.children}):d;var e=BI.deepClone(c.el.value),f=BI.deepClone(d.value);b.singleValues.push(d.value),d.type="bi.down_list_item",d.extraCls=" child-down-list-item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),c.el.childValues.push(d.value),BI.isNotEmptyArray(d.children)&&(d.type="bi.down_list_group_item",b._createChildren(d),d.height=b.constants.height,d.iconCls2=b.constants.nextIcon,c.el.childValues=BI.concat(c.el.childValues,d.childValues))})):(c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0});var d={};d.el=c,f.items.push(d)}),b._isGroup(f.items)&&BI.each(f.items,function(a,c){b.singleValues.push(c.el.value)}),c.push(f),b._needSpliter(d,a.length)){var g=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",lgap:10,rgap:10});c.push(g)}}),c},_createChildren:function(a){var b=this;a.childValues=[],BI.each(a.children,function(c,d){var e=BI.deepClone(a.value),f=BI.deepClone(d.value);d.type="bi.down_list_item",d.title=d.title||d.text,d.textRgap=10,d.isNeedAdjustWidth=!1,d.logic={dynamic:!0},d.father=e,b.fatherValueMap[b._createChildValue(e,f)]=e,b.childValueMap[b._createChildValue(e,f)]=f,d.value=b._createChildValue(e,f),a.childValues.push(d.value)})},_isGroup:function(a){return a.length>1},_needSpliter:function(a,b){return a1?g:f}else e.value=d;b.push(e)}),b}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup),BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer_select_tree-combo",isDefaultInit:!1,height:30,text:"",items:[],value:""})},_init:function(){BI.MultiLayerSelectTreeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:b.text,height:b.height,items:b.items,value:b.value}),this.popup=BI.createWidget({type:"bi.multilayer_select_tree_popup",isDefaultInit:b.isDefaultInit,items:b.items,value:b.value}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.MultiLayerSelectTreePopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)})},setValue:function(a){a=BI.isArray(a)?a:[a],this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue()},populate:function(a){this.combo.populate(a)}}),BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo),BI.MultiLayerSelectLevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,value:""})},_init:function(){BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(a,b){var c=this;return BI.each(a,function(d,e){var f={};if(e.layer=b,BI.isKey(e.id)||(e.id=BI.UUID()),e.isParent===!0||BI.isNotEmptyArray(e.children)){switch(d){case 0:f.type="bi.multilayer_select_tree_first_plus_group_node";break;case a.length-1:f.type="bi.multilayer_select_tree_last_plus_group_node";break;default:f.type="bi.multilayer_select_tree_mid_plus_group_node"}BI.defaults(e,f),c._formatItems(e.children,b+1)}else{switch(d){case a.length-1:f.type="bi.multilayer_single_tree_last_tree_leaf_item";break;default:f.type="bi.multilayer_single_tree_mid_tree_leaf_item"}BI.defaults(e,f)}}),a},_assertId:function(a){BI.each(a,function(a,b){b.id=b.id||BI.UUID()})},initTree:function(a){var b=this,c=this.options;this.empty(),this._assertId(a),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-inline",expander:{type:"bi.select_tree_expander",isDefaultInit:c.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(a),0),itemsCreator:c.itemsCreator,value:c.value,el:{type:"bi.button_tree",chooseType:BI.Selection.Single,layouts:[{type:"bi.vertical"}]}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(a){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:!0,items:[this.tree]})},populate:function(a){this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(a),0))},setValue:function(a){this.tree.setValue(a)},getValue:function(){return BI.uniq(this.tree.getValue())},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(a){return this.tree.getNodeById(a)},getNodeByValue:function(a){return this.tree.getNodeByValue(a)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree),BI.MultiLayerSelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var a=this,b=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:b.isDefaultInit,items:b.items,value:b.value,itemsCreator:b.itemsCreator}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){a.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(a){a=BI.isArray(a)?a:[a],this.tree.setValue(a)},populate:function(a){BI.MultiLayerSelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(a)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:b.id,pId:b.pId,open:b.open,height:b.height,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",cls:"base-line-conn-background",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.MultiLayerSelectTreeFirstPlusGroupNode.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.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode),BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:b.id,pId:b.pId,open:b.open,height:b.height,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",cls:"base-line-conn-background",width:13,height:b.height})}),c.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(b.layer,13),items:[c]})},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.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(a)},doClick:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(a){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_select_tree_last_plus_group_node",BI.MultiLayerSelectTreeLastPlusGroupNode),BI.MultiLayerSelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var a=BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{extraCls:"bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:25})},_init:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var a=this,b=this.options;this.node=BI.createWidget({type:"bi.select_tree_mid_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:b.id,pId:b.pId,open:b.open,height:b.height,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",cls:"base-line-conn-background",width:13,height:b.height})}),c.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(b.layer,13),items:[c]})},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.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(a)},doClick:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(a){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(a)}}),BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node",BI.MultiLayerSelectTreeMidPlusGroupNode),BI.MultiLayerSingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-singletree-combo",isDefaultInit:!1,height:30,text:"",itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSingleTreeCombo.superclass._init.apply(this,arguments);var a=this,b=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:b.text,height:b.height,items:b.items,value:b.value}),this.popup=BI.createWidget({type:"bi.multilayer_single_tree_popup",isDefaultInit:b.isDefaultInit,itemsCreator:b.itemsCreator,items:b.items,value:b.value}),this.combo=BI.createWidget({type:"bi.combo",element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.MultiLayerSingleTreePopup.EVENT_CHANGE,function(){a.setValue(a.popup.getValue()),a.combo.hideView(),a.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)})},setValue:function(a){a=BI.isArray(a)?a:[a],this.trigger.setValue(a),this.popup.setValue(a)},getValue:function(){return this.popup.getValue(); diff --git a/dist/widget.js b/dist/widget.js index 306782293..9d4b1c7d7 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -2779,11 +2779,11 @@ BI.shortcut("bi.down_list_popup", BI.DownListPopup);/** } if (BI.isNotNull(obj.workDay)) { // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 - if(BI.isNotNull(Date.holidays)) { + if(BI.isNotNull(BI.holidays)) { var count = Math.abs(obj.workDay); for (var i = 0; i < count; i++) { date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); - if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + if(BI.isNotNull(BI.holidays[date.print("%Y-%X-%d")])) { i--; } } diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index 214299752..62f633a1f 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -21,7 +21,7 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { items: o.items, height: o.height, text: o.text, - defaultIconCls: o.defaultIconCls, + iconCls: o.iconCls, value: o.value, iconHeight: o.iconHeight, iconWidth: o.iconWidth diff --git a/src/case/trigger/trigger.icon.text.select.js b/src/case/trigger/trigger.icon.text.select.js index f4343f4cf..7e838298c 100644 --- a/src/case/trigger/trigger.icon.text.select.js +++ b/src/case/trigger/trigger.icon.text.select.js @@ -9,7 +9,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { height: 24, iconHeight: null, iconWidth: null, - defaultIconCls: "" + iconCls: "" }); }, @@ -52,7 +52,7 @@ BI.SelectIconTextTrigger = BI.inherit(BI.Trigger, { } else { return { text: o.text, - iconCls: o.defaultIconCls + iconCls: o.iconCls }; } }, diff --git a/src/widget/dynamicdate/dynamicdate.caculate.js b/src/widget/dynamicdate/dynamicdate.caculate.js index 75ad50dac..fabd49f1e 100644 --- a/src/widget/dynamicdate/dynamicdate.caculate.js +++ b/src/widget/dynamicdate/dynamicdate.caculate.js @@ -29,11 +29,11 @@ } if (BI.isNotNull(obj.workDay)) { // 配置了节假日就按照节假日计算工作日偏移,否则按正常的天去算 - if(BI.isNotNull(Date.holidays)) { + if(BI.isNotNull(BI.holidays)) { var count = Math.abs(obj.workDay); for (var i = 0; i < count; i++) { date = date.getOffsetDate(obj.workDay < 0 ? -1 : 1); - if(BI.isNotNull(Date.holidays[date.print("%Y-%X-%d")])) { + if(BI.isNotNull(BI.holidays[date.print("%Y-%X-%d")])) { i--; } }