fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.5 MiB

/*! fineui 2019-12-31 13:52:53 */
5 years ago
function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}!function(e){function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var r={};o.m=e,o.c=r,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var e=Object.create(null);if(o.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var r in n)o.d(e,r,function(t){return n[t]}.bind(null,r));return e},o.n=function(t){var n=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=70)}([function(e,t,n){(function(t){var n=function(t){return t&&t.Math==Math&&t};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(74))},function(t,n,e){var r=e(0),o=e(20),i=e(41),u=e(53),c=r.Symbol,f=o("wks");t.exports=function(t){return f[t]||(f[t]=u&&c[t]||(u?c:i)("Symbol."+t))}},function(t,n,e){var s=e(0),l=e(24).f,p=e(6),v=e(11),d=e(40),h=e(77),y=e(51);t.exports=function(t,n){var e,r,o,i,u,c=t.target,f=t.global,a=t.stat;if(e=f?s:a?s[c]||d(c,{}):(s[c]||{}).prototype)for(r in n){if(i=n[r],o=t.noTargetGet?(u=l(e,r))&&u.value:e[r],!y(f?r:c+(a?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;h(i,o)}(t.sham||o&&o.sham)&&p(i,"sham",!0),v(e,r,i,t)}}},function(t,n,e){var r=e(7);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},function(t,n,e){var r=e(4);t.exports=!r(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,e){var r=e(5),o=e(9),i=e(19);t.exports=r?function(t,n,e){return o.f(t,n,i(1,e))}:function(t,n,e){return t[n]=e,t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){var e={}.hasOwnProperty;t.exports=function(t,n){return e.call(t,n)}},function(t,n,e){var r=e(5),o=e(47),i=e(3),u=e(38),c=Object.defineProperty;n.f=r?c:function(t,n,e){if(i(t),n=u(n,!0),i(e),o)try{return c(t,n,e)}catch(r){}if("get"in e||"set"in e)throw TypeError("Accessors not supported");return"value"in e&&(t[n]=e.value),t}},function(t,n,e){t.exports=e(0)},function(t,n,e){var c=e(0),r=e(20),f=e(6),a=e(8),s=e(40),o=e(48),i=e(16),u=i.get,l=i.enforce,p=String(o).split("toString");r("inspectSource",function(t){return o.call(t)}),(t.exports=function(t,n,e,r){var o=!!r&&!!r.unsafe,i=!!r&&!!r.enumerable,u=!!r&&!!r.noTargetGet;"function"==typeof e&&("string"!=typeof n||a(e,"name")||f(e,"name",n),l(e).source=p.join("string"==typeof n?n:"")),t!==c?(o?!u&&t[n]&&(i=!0):delete t[n],i?t[n]=e:f(t,n,e)):i?t[n]=e:s(n,e)})(Function.prototype,"toString",function(){return"function"==typeof this&&u(this).source||o.call(this)})},function(t,n){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,n,e){var r=e(37),o=e(25);t.exports=function(t){return r(o(t))}},function(t,n){t.exports=!1},function(t,n,e){var r,o,i,u=e(76),c=e(0),f=e(7),a=e(6),s=e(8),l=e(26),p=e(27),v=c.WeakMap;if(u){var d=new v,h=d.get,y=d.has,g=d.set;r=function(t,n){return g.call(d,t,n),n},o=function(t){return h.call(d,t)||{}},i=function(t){return y.call(d,t)}}else{var x=l("state");p[x]=!0,r=function(t,n){return a(t,x,n),n},o=function(t){return s(t,x)?t[x]:{}},i=function(t){return s(t,x)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor
S||(r=function(){var t,n;for(m&&(t=g.domain)&&t.exit();o;){n=o.fn,o=o.next;try{n()}catch(e){throw o?u():i=void 0,e}}i=void 0,t&&t.enter()},u=m?function(){g.nextTick(r)}:y&&!/(iphone|ipod|ipad).*applewebkit/i.test(h)?(c=!0,f=document.createTextNode(""),new y(r).observe(f,{characterData:!0}),function(){f.data=c=!c}):x&&x.resolve?(a=x.resolve(void 0),s=a.then,function(){s.call(a,r)}):function(){d.call(l,r)}),t.exports=S||function(t){var n={fn:t,next:void 0};i&&(i.next=n),o||(o=n,u()),i=n}},function(t,n,e){var r=e(0);t.exports=function(t,n){var e=r.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}},function(t,n,e){"use strict";var r=e(2),o=e(15),i=e(64),u=e(17),c=e(65),f=e(67),a=e(11);r({target:"Promise",proto:!0,real:!0},{"finally":function(n){var e=c(this,u("Promise")),t="function"==typeof n;return this.then(t?function(t){return f(e,n()).then(function(){return t})}:n,t?function(t){return f(e,n()).then(function(){throw t})}:n)}}),o||"function"!=typeof i||i.prototype["finally"]||a(i.prototype,"finally",u("Promise").prototype["finally"])},function(t,n,e){"use strict";var r=e(2),o=e(5),i=e(32),u=e(63),c=e(21),f=e(9),a=e(19),s=e(34),l=e(6),p=e(3),v=e(16),d=v.set,h=v.getterFor("AggregateError"),y=function(t,n){var e=this;if(!(e instanceof y))return new y(t,n);u&&(e=u(new Error(n),i(e)));var r=[];return s(t,r.push,r),o?d(e,{errors:r,type:"AggregateError"}):e.errors=r,void 0!==n&&l(e,"message",String(n)),e};y.prototype=c(Error.prototype,{constructor:a(5,y),message:a(5,""),name:a(5,"AggregateError"),toString:a(5,function(){var t=p(this).name;t=void 0===t?"AggregateError":String(t);var n=this.message;return t+": "+(n=void 0===n?"":String(n))})}),o&&f.f(y.prototype,"errors",{get:function(){return h(this).errors},configurable:!0}),r({global:!0},{AggregateError:y})},function(t,n,e){e(68)},function(t,n,e){"use strict";var r=e(2),o=e(23),i=e(35);r({target:"Promise",stat:!0},{"try":function(t){var n=o.f(this),e=i(t);return(e.error?n.reject:n.resolve)(e.value),n.promise}})},function(t,n,e){"use strict";var r=e(2),l=e(13),p=e(17),o=e(23),i=e(35),v=e(34),d="No one promise resolved";r({target:"Promise",stat:!0},{any:function(t){var f=this,n=o.f(f),a=n.resolve,s=n.reject,e=i(function(){var r=l(f.resolve),o=[],i=0,u=1,c=!1;v(t,function(t){var n=i++,e=!1;o.push(void 0),u++,r.call(f,t).then(function(t){e||c||(c=!0,a(t))},function(t){e||c||(e=!0,o[n]=t,--u||s(new(p("AggregateError"))(o,d)))})}),--u||s(new(p("AggregateError"))(o,d))});return e.error&&s(e.value),n.promise}})},function(t,n,e){t.exports=e(135)},function(t,n,e){e(136);var r=e(33);t.exports=r("String","replace")},function(t,n,e){"use strict";var r=e(137),w=e(3),p=e(18),P=e(28),E=e(29),i=e(25),A=e(139),T=e(140),L=Math.max,M=Math.min,v=Math.floor,d=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g;r("replace",2,function(o,S,O){function j(i,u,c,f,a,t){var s=c+i.length,l=f.length,n=h;return void 0!==a&&(a=p(a),n=d),S.call(t,n,function(t,n){var e;switch(n.charAt(0)){case"$":return"$";case"&":return i;case"`":return u.slice(0,c);case"'":return u.slice(s);case"<":e=a[n.slice(1,-1)];break;default:var r=+n;if(0==r)return t;if(l<r){var o=v(r/10);return 0===o?t:o<=l?void 0===f[o-1]?n.charAt(1):f[o-1]+n.charAt(1):t}e=f[r-1]}return void 0===e?"":e})}return[function(t,n){var e=i(this),r=void 0==t?void 0:t[o];return void 0!==r?r.call(t,e,n):S.call(String(e),t,n)},function(t,n){var e=O(S,t,this,n);if(e.done)return e.value;var r=w(t),o=String(this),i="function"==typeof n;i||(n=String(n));var u=r.global;if(u){var c=r.unicode;r.lastIndex=0}for(var f=[];;){var a=T(r,o);if(null===a)break;if(f.push(a),!u)break;""===String(a[0])&&(r.lastIndex=A(o,P(r.lastIndex),c))}for(var s,l="",p=0,v=0;v<f.length;v++){a=f[v];for(var d=String(a[0]),h=L(M(E(a.index),o.length),0),y=[],g=1;g<a.length;g++)y.push(void 0===(s=a[g])?s:String(s));var x=a.groups;if(i){var m=[d].concat(y,h,o);void 0!==x&&m.push(x);var b=String(n.apply(void 0,m))}else b=j(d,o,h,y,x,n);p<=h&&(l+=o.slice(p,h)+b,p=h+d.length)}return l+o.slice(p)}]})},function(t,n,e){"use strict";var l=e(6),p=e(11),v=e(4),d=e(1),h=e(69),y=d("species"),g=
var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:isPlainObject(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=toPlainObject(objValue):(!isObject(objValue)||srcIndex&&isFunction(objValue))&&(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack["delete"](srcValue)),assignMergeValue(object,key,newValue)}function baseOrderBy(collection,iteratees,orders){var index=-1;iteratees=arrayMap(iteratees.length?iteratees:[identity],baseUnary(baseIteratee));var result=baseMap(collection,function(value,key,collection){var criteria=arrayMap(iteratees,function(iteratee){return iteratee(value)});return{criteria:criteria,index:++index,value:value}});return baseSortBy(result,function(object,other){return compareMultiple(object,other,orders)})}function basePick(object,paths){return basePickBy(object,paths,function(value,path){return hasIn(object,path)})}function basePickBy(object,paths,predicate){for(var index=-1,length=paths.length,result={};++index<length;){var path=paths[index],value=baseGet(object,path);predicate(value,path)&&baseSet(result,castPath(path,object),value)}return result}function basePropertyDeep(path){return function(object){return baseGet(object,path)}}function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1))}function baseRange(start,end,step,fromRight){for(var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);length--;)result[fromRight?length:++index]=start,start+=step;return result}function baseRest(func,start){return setToString(overRest(func,start,identity),func+"")}function baseSet(object,path,value,customizer){if(!isObject(object))return object;path=castPath(path,object);for(var index=-1,length=path.length,lastIndex=length-1,nested=object;null!=nested&&++index<length;){var key=toKey(path[index]),newValue=value;if(index!=lastIndex){var objValue=nested[key];newValue=customizer?customizer(objValue,key,nested):undefined,newValue===undefined&&(newValue=isObject(objValue)?objValue:isIndex(path[index+1])?[]:{})}assignValue(nested,key,newValue),nested=nested[key]}return object}function baseSlice(array,start,end){var index=-1,length=array.length;start<0&&(start=-start>length?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index<length;)result[index]=array[index+start];return result}function baseSome(collection,predicate){var result;return baseEach(collection,function(value,index,collection){return result=predicate(value,index,collection),!result}),!!result}function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(comparator)isCommon=!1,includes=arrayIncludesWith;else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=comparator||0!==value?value:0,isCommon&&computed===computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}function baseUnset(object,path){return path=castP
var result=lodash(value);return result.__chain__=!0,result}function tap(value,interceptor){return interceptor(value),value}function thru(value,interceptor){return interceptor(value)}function wrapperChain(){return chain(this)}function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)}function wrapperNext(){this.__values__===undefined&&(this.__values__=toArray(this.value()));var done=this.__index__>=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{done:done,value:value}}function wrapperToIterator(){return this}function wrapperPlant(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result}function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),wrapped=wrapped.reverse(),wrapped.__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,baseIteratee(predicate,3))}function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,baseIteratee(iteratee,3))}function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,baseIteratee(iteratee,3))}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee,4),accumulator,initAccum,baseEach)}function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(baseIteratee(predicate,3)))}function size(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length}function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=undefined),result}}function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();return shouldInvoke(time)?trailingEdge(time):void(timerId=setTimeout(timerExpired,remainingWait(time)))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function cancel(){timerId!==undefined&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined}functi
lodash.max=max,lodash.min=min,lodash.noConflict=noConflict,lodash.noop=noop,lodash.random=random,lodash.reduce=reduce,lodash.result=result,lodash.size=size,lodash.some=some,lodash.trim=trim,lodash.uniqueId=uniqueId,lodash.each=forEach,lodash.first=head,mixin(lodash,function(){var source={};return baseForOwn(lodash,function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)}),source}(),{chain:!1}),lodash.VERSION=VERSION,arrayEach(["drop","take"],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}}),arrayEach(["filter","map","takeWhile"],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}}),arrayEach(["head","last"],function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}}),arrayEach(["initial","tail"],function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}}),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest(function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map(function(value){return baseInvoke(value,path,args)})}),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(end=toInteger(end),result=end<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH)},baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})}),arrayEach(["pop","push","shift","sort","splice","unshift"],function(methodName){var func=arrayProto[methodName],chainName
},getText:function(){},setText:function(text){},getValue:function(){},setValue:function(value){},isEnabled:function(){return!this.options.disabled},isVisible:function(){return!this.options.invisible},disable:function(){this.setEnable(!1)},enable:function(){this.setEnable(!0)},valid:function(){this.setValid(!0)},invalid:function(){this.setValid(!1)},invisible:function(){this.setVisible(!1)},visible:function(){this.setVisible(!0)},__d:function(){this.beforeDestroy&&this.beforeDestroy(),BI.each(this._children,function(i,widget){widget&&widget._unMount&&widget._unMount()}),this._children={},this._parent=null,this._isMounted=!1,this.destroyed&&this.destroyed()},_unMount:function(){this.__d(),this.fireEvent(BI.Events.UNMOUNT),this.purgeListeners()},isolate:function(){this._parent&&this._parent.removeWidget(this),BI.DOM.hang([this])},empty:function(){BI.each(this._children,function(i,widget){widget&&widget._unMount&&widget._unMount()}),this._children={},this.element.empty()},_destroy:function(){this.__d(),this.element.destroy(),this.purgeListeners()},destroy:function(){this.__d(),this.element.destroy(),this.fireEvent(BI.Events.DESTROY),this._purgeRef(),this.purgeListeners()}}),BI.Widget.registerRenderEngine=function(engine){BI.Widget._renderEngine=engine},BI.Widget.registerRenderEngine({createElement:function(widget){if(BI.isWidget(widget)){var o=widget.options;return o.element?BI.$(o.element):BI.$(document.createElement(o.tagName))}return BI.$(widget)},createFragment:function(){return document.createDocumentFragment()}}),BI.mount=function(widget,container,predicate,hydrate){if(hydrate===!0){widget.element.data("__widgets",[widget]);var res=widget._mount(!0,!1,!1,function(w){BI.each(w._children,function(i,child){var ws=child.element.data("__widgets");ws||(ws=[]),ws.push(child),child.element.data("__widgets",ws)}),predicate&&predicate.apply(this,arguments)}),c=BI.Widget._renderEngine.createElement;BI.DOM.patchProps(widget.element,c(c(container).children()[0]));var triggerLifeHook=function(w){w.beforeMount&&w.beforeMount(),w.mounted&&w.mounted(),BI.each(w._children,function(i,child){triggerLifeHook(child)})};return triggerLifeHook(widget),res}return container&&BI.Widget._renderEngine.createElement(container).append(widget.element),widget._mount(!0,!1,!1,predicate)}}(),function(){var kv={};BI.shortcut=BI.component=function(xtype,cls){null!=kv[xtype]&&_global.console&&console.error("shortcut:["+xtype+"] has been registed"),kv[xtype]=cls};var createWidget=function(config){var cls=kv[config.type],widget=new cls;return widget._initProps(config),widget._init(),widget._initRef(),widget};BI.createWidget=function(item,options,context){BI.init();var el,w;if(item||(item={}),BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.isEmpty(item)&&BI.isEmpty(options))return BI.createWidget({type:"bi.layout"});if(BI.isWidget(item))return item;if(item.type||options.type)return el=BI.extend({},options,item),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(item.el&&(item.el.type||options.type))return el=BI.extend({},options,item.el),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(BI.isWidget(item.el))return item.el;throw new Error("无法根据item创建组件")},BI.createElement=function(){var widget=BI.createWidget.apply(this,arguments);return widget.element}}(),!function(){BI.CRYPT_TYPE=BI.CRYPT_TYPE||{},BI.CRYPT_TYPE.AES="aes";var CryptoJS=CryptoJS||function(Math,undefined){var C={},C_lib=C.lib={},Base=C_lib.Base=function(){function F(){}return{extend:function(overrides){F.prototype=this;var subtype=new F;return overrides&&subtype.mixIn(overrides),subtype.hasOwnProperty("init")||(subtype.init=function(){subtype.$super.init.apply(th
5 years ago
offset=datum.offset+datum.size;for(var stop=start;offset<maxOffset&&stop<this._cellCount-1;)stop++,offset+=this.getSizeAndPositionOfCell(stop).size;return{start:start,stop:stop}},resetCell:function(index){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,index-1)},_binarySearch:function(high,low,offset){for(var middle,currentOffset;low<=high;){if(middle=low+Math.floor((high-low)/2),currentOffset=this.getSizeAndPositionOfCell(middle).offset,currentOffset===offset)return middle;currentOffset<offset?low=middle+1:currentOffset>offset&&(high=middle-1)}if(low>0)return low-1},_exponentialSearch:function(index,offset){for(var interval=1;index<this._cellCount&&this.getSizeAndPositionOfCell(index).offset<offset;)index+=interval,interval*=2;return this._binarySearch(Math.min(index,this._cellCount-1),Math.floor(index/2),offset)},_findNearestCell:function(offset){if(!isNaN(offset)){offset=Math.max(0,offset);var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell(),lastMeasuredIndex=Math.max(0,this._lastMeasuredIndex);return lastMeasuredCellSizeAndPosition.offset>=offset?this._binarySearch(lastMeasuredIndex,0,offset):this._exponentialSearch(lastMeasuredIndex,offset)}}},BI.ScalingCellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize,maxScrollSize){this._cellSizeAndPositionManager=new BI.CellSizeAndPositionManager(cellCount,cellSizeGetter,estimatedCellSize),this._maxScrollSize=maxScrollSize||1e7},BI.ScalingCellSizeAndPositionManager.prototype={constructor:BI.ScalingCellSizeAndPositionManager,configure:function(){this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager,arguments)},getCellCount:function(){return this._cellSizeAndPositionManager.getCellCount()},getEstimatedCellSize:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()},getLastMeasuredIndex:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()},getOffsetAdjustment:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize(),offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(safeTotalSize-totalSize))},getSizeAndPositionOfCell:function(index){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index)},getSizeAndPositionOfLastMeasuredCell:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()},getTotalSize:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){currentOffset=this._safeOffsetToOffset(containerSize,currentOffset);var offset=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(align,containerSize,currentOffset,targetIndex);return this._offsetToSafeOffset(containerSize,offset)},getVisibleCellRange:function(containerSize,offset){return offset=this._safeOffsetToOffset(containerSize,offset),this._cellSizeAndPositionManager.getVisibleCellRange(containerSize,offset)},resetCell:function(index){this._cellSizeAndPositionManager.resetCell(index)},_getOffsetPercentage:function(containerSize,offset,totalSize){return totalSize<=containerSize?0:offset/(totalSize-containerSize)},_offsetToSafeOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,totalSize);return Math.round(offsetPercentage*(safeTotalSize-containerSize))},_safeOffsetToOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(totalSize-containerSize))}},!function(){var _ChineseFirstPY="YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYY
this._animationFrameID&&this._didMouseMove(),this._onMoveEnd()}}}(),!function(){function normalizeWheel(event){var sX=0,sY=0,pX=0,pY=0;return"detail"in event&&(sY=event.detail),"wheelDelta"in event&&(sY=-event.wheelDelta/120),"wheelDeltaY"in event&&(sY=-event.wheelDeltaY/120),"wheelDeltaX"in event&&(sX=-event.wheelDeltaX/120),"axis"in event&&event.axis===event.HORIZONTAL_AXIS&&(sX=sY,sY=0),pX=sX*PIXEL_STEP,pY=sY*PIXEL_STEP,"deltaY"in event&&(pY=event.deltaY),"deltaX"in event&&(pX=event.deltaX),(pX||pY)&&event.deltaMode&&(1===event.deltaMode?(pX*=LINE_HEIGHT,pY*=LINE_HEIGHT):(pX*=PAGE_HEIGHT,pY*=PAGE_HEIGHT)),pX&&!sX&&(sX=pX<1?-1:1),pY&&!sY&&(sY=pY<1?-1:1),{spinX:sX,spinY:sY,pixelX:pX,pixelY:pY}}var PIXEL_STEP=10,LINE_HEIGHT=40,PAGE_HEIGHT=800,requestAnimationFrame=_global.requestAnimationFrame||_global.webkitRequestAnimationFrame||_global.mozRequestAnimationFrame||_global.oRequestAnimationFrame||_global.msRequestAnimationFrame||_global.setTimeout;BI.WheelHandler=function(onWheel,handleScrollX,handleScrollY,stopPropagation){this._animationFrameID=null,this._deltaX=0,this._deltaY=0,this._didWheel=BI.bind(this._didWheel,this),"function"!=typeof handleScrollX&&(handleScrollX=handleScrollX?function(){return!0}:function(){return!1}),"function"!=typeof handleScrollY&&(handleScrollY=handleScrollY?function(){return!0}:function(){return!1}),"function"!=typeof stopPropagation&&(stopPropagation=stopPropagation?function(){return!0}:function(){return!1}),this._handleScrollX=handleScrollX,this._handleScrollY=handleScrollY,this._stopPropagation=stopPropagation,this._onWheelCallback=onWheel,this.onWheel=BI.bind(this.onWheel,this)},BI.WheelHandler.prototype={constructor:BI.WheelHandler,onWheel:function(event){var normalizedEvent=normalizeWheel(event),deltaX=this._deltaX+normalizedEvent.pixelX,deltaY=this._deltaY+normalizedEvent.pixelY,handleScrollX=this._handleScrollX(deltaX,deltaY),handleScrollY=this._handleScrollY(deltaY,deltaX);if(handleScrollX||handleScrollY){this._deltaX+=handleScrollX?normalizedEvent.pixelX:0,this._deltaY+=handleScrollY?normalizedEvent.pixelY:0,event.preventDefault?event.preventDefault():event.returnValue=!1;var changed;0===this._deltaX&&0===this._deltaY||(this._stopPropagation()&&(event.stopPropagation?event.stopPropagation():event.cancelBubble=!0),changed=!0),changed===!0&&null===this._animationFrameID&&(this._animationFrameID=requestAnimationFrame(this._didWheel))}},_didWheel:function(){this._animationFrameID=null,this._onWheelCallback(this._deltaX,this._deltaY),this._deltaX=0,this._deltaY=0}}}(),function(){function defaultComparator(a,b){return a<b}BI.Heap=function(items,comparator){this._items=items||[],this._size=this._items.length,this._comparator=comparator||defaultComparator,this._heapify()},BI.Heap.prototype={constructor:BI.Heap,empty:function(){return 0===this._size},pop:function(){if(0!==this._size){var elt=this._items[0],lastElt=this._items.pop();return this._size--,this._size>0&&(this._items[0]=lastElt,this._sinkDown(0)),elt}},push:function(item){this._items[this._size++]=item,this._bubbleUp(this._size-1)},size:function(){return this._size},peek:function(){if(0!==this._size)return this._items[0]},_heapify:function(){for(var index=Math.floor((this._size+1)/2);index>=0;index--)this._sinkDown(index)},_bubbleUp:function(index){for(var elt=this._items[index];index>0;){var parentIndex=Math.floor((index+1)/2)-1,parentElt=this._items[parentIndex];if(this._comparator(parentElt,elt))return;this._items[parentIndex]=elt,this._items[index]=parentElt,index=parentIndex}},_sinkDown:function(index){for(var elt=this._items[index];;){var leftChildIndex=2*(index+1)-1,rightChildIndex=2*(index+1),swapIndex=-1;if(leftChildIndex<this._size){var leftChild=this._items[leftChildIndex];this._comparator(leftChild,elt)&&(swapIndex=leftChildIndex)}if(rightChildIndex<this._size){var rightChild=this._items[rightChildIndex];this._comparator(rightChild,elt)&&(swapIndex===-1||this._comparator(rightChild,this._items[swapIndex]))&&(swapIndex=rightChildIndex)}if(swapIndex===-1)return;this._items[index]=this._items[swapIndex],this._items[sw
}):removeIndex=nameOrWidget,removeIndex&&this._removeItemAt(0|removeIndex)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(items){var self=this,o=this.options;return items=items||[],this._isMounted?void this.update({items:items}):(this.options.items=items,void this.stroke(items))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout),BI.Plugin=BI.Plugin||{},!function(){var _WidgetsPlugin={},_ObjectPlugin={},_ConfigPlugin={},_GlobalWidgetConfigFn,_GlobalObjectConfigFn;BI.extend(BI.Plugin,{getWidget:function(type,options){_GlobalWidgetConfigFn&&_GlobalWidgetConfigFn(type,options);var res;if(_ConfigPlugin[type])for(var i=_ConfigPlugin[type].length-1;i>=0;i--)(res=_ConfigPlugin[type][i](options))&&(options=res);if(_WidgetsPlugin[type])for(var i=_WidgetsPlugin[type].length-1;i>=0;i--)if(res=_WidgetsPlugin[type][i](options))return res;return options},config:function(widgetConfigFn,objectConfigFn){_GlobalWidgetConfigFn=widgetConfigFn,_GlobalObjectConfigFn=objectConfigFn},configWidget:function(type,fn){_ConfigPlugin[type]||(_ConfigPlugin[type]=[]),_ConfigPlugin[type].push(fn)},registerWidget:function(type,fn){_WidgetsPlugin[type]||(_WidgetsPlugin[type]=[]),_WidgetsPlugin[type].length>0&&console.log("组件已经注册过了!"),_WidgetsPlugin[type].push(fn)},relieveWidget:function(type){delete _WidgetsPlugin[type]},getObject:function(type,object){if(_GlobalObjectConfigFn&&_GlobalObjectConfigFn(type,object),_ObjectPlugin[type])for(var res,i=0,len=_ObjectPlugin[type].length;i<len;i++)(res=_ObjectPlugin[type][i](object))&&(object=res);return res||object},registerObject:function(type,fn){_ObjectPlugin[type]||(_ObjectPlugin[type]=[]),_ObjectPlugin[type].length>0&&console.log("对象已经注册过了!"),_ObjectPlugin[type].push(fn)},relieveObject:function(type){delete _ObjectPlugin[type]}})}(),BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){},actionBack:function(tar,src,callback){}}),BI.ActionFactory={createAction:function(key,options){var action;switch(key){case"show":action=BI.ShowAction}return new action(options)}},BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){tar=tar||this.options.tar,tar.setVisible(!0),callback&&callback()},actionBack:function(tar,src,callback){tar=tar||this.options.tar,tar.setVisible(!1),callback&&callback()}}),function(){function isEmpty(value){var result=""===value||null===value||void 0===value;return result}function isInvalidDate(date){return"Invalid Date"==date||"NaN"==date}function _eFormat(text,fmt){function eFormat(num,format){var neg=num<0?(num*=-1,"-"):"",magnitudeNeg="",funcName=num>0&&num<1?"floor":"ceil",magnitude=Math[funcName](Math.log(num)/Math.log(10));if(!isFinite(magnitude))return format.replace(/#/gi,"").replace(/\.e/gi,"E");num/=Math.pow(10,magnitude),num>0&&num<1&&(num*=10,magnitude-=1);var integerLen=getInteger(magnitude,format);integerLen>1&&(magnitude-=integerLen-1,num*=Math.pow(10,integerLen-1)),magnitude<0&&(magnitudeNeg="-",magnitude*=-1);var precision=getPrecision(format),isValueCarry=isValueCarried(num);return num*=Math.pow(10,precision),num=Math.round(num),isValueCarry&&(num/=10,magnitude+="-"===magnitudeNeg?-1:1),num/=Math.pow(10,precision),num=num.toFixed(precision),magnitude=formatExponential(format,magnitude,magnitudeNeg),neg+num+"E"+magnitude}function formatExponential(format,num,magnitudeNeg){if(num+="",!/e/gi.test(format))return num;for(format=format.split(/e/gi)[1];num.length<format.length;)num="0"+num;for(var isAllZero=!0,i=0,len=num.length;i<len;i++)isAllZero&&(isAllZero="0"===num.charAt(i));return m
ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",MOUNT:"_MOUNT",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}}),_.extend(BI,{pushArray:function(sArray,array){for(var i=0;i<array.length;i++)sArray.push(array[i])},pushDistinct:function(sArray,obj){BI.contains(sArray,obj)||sArray.push(obj)},pushDistinctArray:function(sArray,array){for(var i=0,len=array.length;i<len;i++)BI.pushDistinct(sArray,array[i])}}),BI.prepares.push(function(){BI.Date=BI.Date||{},BI.Date._DN=[BI.i18nText("BI-Basic_Sunday"),BI.i18nText("BI-Basic_Monday"),BI.i18nText("BI-Basic_Tuesday"),BI.i18nText("BI-Basic_Wednesday"),BI.i18nText("BI-Basic_Thursday"),BI.i18nText("BI-Basic_Friday"),BI.i18nText("BI-Basic_Saturday"),BI.i18nText("BI-Basic_Sunday")],BI.Date._SDN=[BI.i18nText("BI-Basic_Simple_Sunday"),BI.i18nText("BI-Basic_Simple_Monday"),BI.i18nText("BI-Basic_Simple_Tuesday"),BI.i18nText("BI-Basic_Simple_Wednesday"),BI.i18nText("BI-Basic_Simple_Thursday"),BI.i18nText("BI-Basic_Simple_Friday"),BI.i18nText("BI-Basic_Simple_Saturday"),BI.i18nText("BI-Basic_Simple_Sunday")],BI.Date._FD=1,BI.Date._MN=[BI.i18nText("BI-Basic_January"),BI.i18nText("BI-Basic_February"),BI.i18nText("BI-Basic_March"),BI.i18nText("BI-Basic_April"),BI.i18nText("BI-Basic_May"),BI.i18nText("BI-Basic_June"),BI.i18nText("BI-Basic_July"),BI.i18nText("BI-Basic_August"),BI.i18nText("BI-Basic_September"),BI.i18nText("BI-Basic_October"),BI.i18nText("BI-Basic_November"),BI.i18nText("BI-Basic_December")],BI.Date._SMN=[0,1,2,3,4,5,6,7,8,9,10,11],BI.Date._QN=["",BI.i18nText("BI-Quarter_1"),BI.i18nText("BI-Quarter_2"),BI.i18nText("BI-Quarter_3"),BI.i18nText("BI-Quarter_4")],BI.Date._MD=[31,28,31,30,31,30,31,31,30,31,30,31],BI.Date._OFFSET=[0,-1,-2,-3,-4,-5,-6]}),BI.Date=BI.Date||{},BI.Date.SECOND=1e3,BI.Date.MINUTE=60*BI.Date.SECOND,BI.Date.HOUR=60*BI.Date.MINUTE,BI.Date.DAY=24*BI.Date.HOUR,BI.Date.WEEK=7*BI.Date.DAY,_.extend(BI,{getTimezone:function(date){return date.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getMonthDays:function(date,month){var year=date.getFullYear();return"undefined"==typeof month&&(month=date.getMonth()),0!=year%4||0==year%100&&0!=year%400||1!=month?BI.Date._MD[month]:29},getLastDateOfMonth:function(date){return BI.getDate(date.getFullYear(),date.getMonth(),BI.getMonthDays(date))},getDayOfYear:function(date){var now=BI.getDate(date.getFullYear(),date.getMonth(),date.getDate(),0,0,0),then=BI.getDate(date.getFullYear(),0,0,0,0,0),time=now-then;return Math.floor(time/BI.Date.DAY)},getWeekNumber:function(date){var d=BI.getDate(date.getFullYear(),date.getMonth(),date.getDate(),0,0,0),week=d.getDay(),startOfWeek=BI.StartOfWeek%7,middleDay=(startOfWeek+3)%7;middleDay=middleDay||7;var offsetWeekStartCount=week<startOfWeek?7+week-startOfWeek:week-
};BI.ResizeDetector={addResizeListener:function(widget,fn){return addResizeListener(widget.element[0],fn),function(){removeResizeListener(widget.element[0],fn)}},removeResizeListener:function(widget,fn){removeResizeListener(widget.element[0],fn)}}}(),!function(){BI.DOM={},BI.extend(BI.DOM,{ready:function(fn){BI.Widget._renderEngine.createElement(document).ready(fn)}}),BI.extend(BI.DOM,{patchProps:function(fromElement,toElement){var elemData=BI.jQuery._data(fromElement[0]),events=elemData.events;BI.each(events,function(eventKey,event){BI.each(event,function(i,handler){toElement.on(eventKey+(handler.namespace?"."+handler.namespace:""),handler)})});var fromChildren=fromElement.children(),toChildren=toElement.children();if(fromChildren.length!==toChildren.length)throw new Error("不匹配");BI.each(fromChildren,function(i,child){BI.DOM.patchProps(BI.jQuery(child),BI.jQuery(toChildren[i]))}),BI.each(fromElement.data("__widgets"),function(i,widget){widget.element=toElement})},hang:function(doms){if(!BI.isEmpty(doms)){var frag=BI.Widget._renderEngine.createFragment();return BI.each(doms,function(i,dom){dom instanceof BI.Widget&&(dom=dom.element),dom instanceof BI.$&&dom[0]&&frag.appendChild(dom[0])}),frag}},isExist:function(obj){return BI.Widget._renderEngine.createElement("body").find(obj.element).length>0},preloadImages:function(srcArray,onload){function complete(){count++,count>=srcArray.length&&onload()}var count=0,images=[];BI.each(srcArray,function(i,src){images[i]=new Image,images[i].src=src,images[i].onload=function(){complete()},images[i].onerror=function(){complete()}})},getTextSizeWidth:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var width=span.width();return span.remove(),width},getTextSizeHeight:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("<span></span>").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var height=span.height();return span.remove(),height},getScrollWidth:function(){if(BI.isNull(this._scrollWidth)||0===this._scrollWidth){var ul=BI.Widget._renderEngine.createElement("<div>").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo("body");this._scrollWidth=ul[0].offsetWidth-ul[0].clientWidth,ul.destroy()}return this._scrollWidth},getImage:function(param,fillStyle,backgroundColor){var canvas=document.createElement("canvas"),ratio=2;BI.Widget._renderEngine.createElement("body").append(canvas);var ctx=canvas.getContext("2d");ctx.font="12px Georgia";var w=ctx.measureText(param).width+4;canvas.width=w*ratio,canvas.height=16*ratio,ctx.font=12*ratio+"px Georgia",ctx.fillStyle=fillStyle||"#3685f2",ctx.textBaseline="middle",ctx.fillText(param,2*ratio,9*ratio),BI.Widget._renderEngine.createElement(canvas).destroy();var backColor=backgroundColor||"rgba(54, 133, 242, 0.1)";return{width:w,height:16,src:canvas.toDataURL("image/png"),style:"background-color: "+backColor+";vertical-align: middle; margin: 0 1px; width:"+w+"px;height: 16px; max-width:"+w+"px;max-height: 16px; min-width:"+w+"px;min-height: 16px",param:param}}}),BI.extend(BI.DOM,{isColor:function(color){return color&&(this.isRGBColor(color)||this.isHexColor(color))},isRGBColor:function(color){return!!color&&"rgb"===color.substr(0,3)},isHexColor:function(color){return!!color&&("#"===color[0]&&7===color.length)},isDarkColor:function(hex){if(!hex||!this.isHexColor(hex))return!1;var rgb=this.rgb2json(this.hex2rgb(hex)),grayLevel=Math.round(.299*rgb.r+.587*rgb.g+.114*rgb.b);return grayLevel<192},getContrastColor:function(color){return color&&this.isColor(color)?this.isDarkColor(color)?"#ffffff":"#1a1a1a":""},rgb2hex:function(rgbColour){if(!rgbColour||"rgb"!=rgbColour.substr(0,3))return"";var rgbValues=rgbColour.match(/\d+(\.\d+)?/g),red=BI.parseInt(rgbValues[0]),green=BI.parseInt(rgbValues[1]),blue=BI.parseInt(rgbValues[2]),hexColour="#"+this.in
if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response){var conv2,current,conv,tmp,converters={},i=0,dataTypes=s.dataTypes.slice(),prev=dataTypes[0];if(s.dataFilter&&(response=s.dataFilter(response,s.dataType)),dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(;current=dataTypes[++i];)if("*"!==current){if("*"!==prev&&prev!==current){if(conv=converters[prev+" "+current]||converters["* "+current],!conv)for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){conv===!0?conv=converters[conv2]:converters[conv2]!==!0&&(current=tmp[0],dataTypes.splice(i--,0,current));break}if(conv!==!0)if(conv&&s["throws"])response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}prev=current}return{state:"success",data:response}}function createStandardXHR(){try{return new window.XMLHttpRequest}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function createFxNow(){return setTimeout(function(){fxNow=undefined}),fxNow=jQuery.now()}function createTweens(animation,props){jQuery.each(props,function(prop,value){for(var collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;index<length;index++)if(collection[index].call(animation,prop,value))return})}function Animation(elem,properties,options){var result,stopped,index=0,length=animationPrefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),tick=function(){if(stopped)return!1;for(var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;index<length;index++)animation.tweens[index].run(percent);return deferred.notifyWith(elem,[animation,percent,remaining]),percent<1&&length?remaining:(deferred.resolveWith(elem,[animation]),!1)},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(!0,{specialEasing:{}},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);return animation.tweens.push(tween),tween},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped)return this;for(stopped=!0;index<length;index++)animation.tweens[index].run(1);return gotoEnd?deferred.resolveWith(elem,[animation,gotoEnd]):deferred.rejectWith(elem,[animation,gotoEnd]),this}}),props=animation.props;for(propFilter(props,animation.opts.specialEasing);index<length;index++)if(result=animationPrefilters[index].call(animation,elem,props,animation.opts))return result;return createTweens(animation,props),jQuery.isFunction(animation.opts.start)&&animation.opts.start.call(elem,animation),jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue})),animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always)}function propFilter(props,specialEasing){var value,name,index,easing,hooks;for(index in props)if(name=jQuery.camelCase(index),easing=specialEasing[name],value=props[index],jQuery.isArray(value)&&(easing=value[1],value=props[index]=value[0]),index!==name&&(props[name]=value,delete props[index]),hooks=jQuery.cssHooks[name],hooks&&"expand"in hooks){value=hooks.expand(v
return!1},val:function(value){var ret,hooks,isFunction,elem=this[0];{if(arguments.length)return isFunction=jQuery.isFunction(value),this.each(function(i){var val,self=jQuery(this);1===this.nodeType&&(val=isFunction?value.call(this,i,self.val()):value,null==val?val="":"number"==typeof val?val+="":jQuery.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&hooks.set(this,val,"value")!==undefined||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text}},select:{get:function(elem){for(var value,option,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;i<max;i++)if(option=options[i],(option.selected||i===index)&&(jQuery.support.optDisabled?!option.disabled:null===option.getAttribute("disabled"))&&(!option.parentNode.disabled||!jQuery.nodeName(option.parentNode,"optgroup"))){if(value=jQuery(option).val(),one)return value;values.push(value)}return values},set:function(elem,value){var values=jQuery.makeArray(value);return jQuery(elem).find("option").each(function(){this.selected=jQuery.inArray(jQuery(this).val(),values)>=0}),values.length||(elem.selectedIndex=-1),values}}},attr:function(elem,name,value){var hooks,notxml,ret,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return typeof elem.getAttribute===core_strundefined?jQuery.prop(elem,name,value):(notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=name.toLowerCase(),hooks=jQuery.attrHooks[name]||(rboolean.test(name)?boolHook:nodeHook)),value===undefined?hooks&&notxml&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(typeof elem.getAttribute!==core_strundefined&&(ret=elem.getAttribute(name)),null==ret?undefined:ret):null!==value?hooks&&notxml&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem.setAttribute(name,value+""),value):void jQuery.removeAttr(elem,name))},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)propName=jQuery.propFix[name]||name,rboolean.test(name)?!getSetAttribute&&ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]=elem[propName]=!1:elem[propName]=!1:jQuery.attr(elem,name,""),elem.removeAttribute(getSetAttribute?name:propName)},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&"radio"===value&&jQuery.nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),value!==undefined?hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var attributeNode=elem.getAttributeNode("tabindex");return attributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}}}}),boolHook={get:function(elem,name){var prop=jQuery.prop(elem,name),attr="boolean"==typeof prop&&elem.getAttribute(name),detail="boolean"==typeof prop?getSetInput&&getSetAttr
if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,slice.call(seed,0)),results;break}}return compile(selector,match)(seed,context,documentIsXML,results,rsibling.test(selector)),results}function setFilters(){}var i,cachedruns,Expr,getText,isXML,compile,hasDuplicate,outermostContext,setDocument,document,docElem,documentIsXML,rbuggyQSA,rbuggyMatches,matches,contains,sortOrder,expando="sizzle"+-new Date,preferredDoc=window.document,support={},dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),strundefined=typeof undefined,MAX_NEGATIVE=1<<31,arr=[],pop=arr.pop,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){for(var i=0,len=this.length;i<len;i++)if(this[i]===elem)return i;return-1},whitespace="[\\x20\\t\\r\\n\\f]",characterEncoding="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",identifier=characterEncoding.replace("w","w#"),operators="([*^$|!~]?=)",attributes="\\["+whitespace+"*("+characterEncoding+")"+whitespace+"*(?:"+operators+whitespace+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+identifier+")|)|)"+whitespace+"*\\]",pseudos=":("+characterEncoding+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+attributes.replace(3,8)+")*)|.*)\\)|)",rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([\\x20\\t\\r\\n\\f>+~])"+whitespace+"*"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),NAME:new RegExp("^\\[name=['\"]?("+characterEncoding+")['\"]?\\]"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rsibling=/[\x20\t\r\n\f]*[+~]/,rnative=/^[^{]+\{\s*\[native code/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,rattributeQuotes=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,runescape=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,funescape=function(_,escaped){var high="0x"+escaped-65536;return high!==high?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)};try{slice.call(preferredDoc.documentElement.childNodes,0)[0].nodeType}catch(e){slice=function(i){for(var elem,results=[];elem=this[i++];)results.push(elem);return results}}isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=doc.documentElement,documentIsXML=isXML(doc),support.tagNameNoComments=assert(function(div){return div.appendChild(doc.createComment("")),!div.getElementsByTagName("*").length}),support.attributes=assert(function(div){div.innerHTML="<select></select>";var type=typeof div.lastChild.getAttribute("multiple");return"boolean"!==type&&"string"!==type}),support.getByClassName=assert(function(div){return div.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!(!div.getElementsByClassName||!div.getElementsByClassName("e").length)&&(div.lastChild.className="e",2===div.getElementsByClassName("e").length)}),support.getByName=assert(function(div){div.id=expando+0,div.innerHTML="<a name='"+expando+"'></a><div name='"+expando+"'></div>",docElem.insertBefore(div,docElem.firstChild);var pass=doc.getElementsByName&&doc.getElementsByName(expando).length===2+doc.getElementsByName(expando+0).length
core_deletedIds.push(id))}}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];jQuery.fn.extend({css:function(name,value){return jQuery.access(this,function(elem,name,value){var len,styles,map={},i=0;if(jQuery.isArray(name)){for(styles=getStyles(elem),len=name.length;i<len;i++)map[name[i]]=jQuery.css(elem,name[i],!1,styles);return map}return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name)},name,value,arguments.length>1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){var bool="boolean"==typeof state;return this.each(function(){(bool?state:isHidden(this))?jQuery(this).show():jQuery(this).hide()})}}),jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;if(name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],value===undefined)return hooks&&"get"in hooks&&(ret=hooks.get(elem,!1,extra))!==undefined?ret:style[name];if(type=typeof value,"string"===type&&(ret=rrelNum.exec(value))&&(value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name)),type="number"),!(null==value||"number"===type&&isNaN(value)||("number"!==type||jQuery.cssNumber[origName]||(value+="px"),jQuery.support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&(value=hooks.set(elem,value,extra))===undefined)))try{style[name]=value}catch(e){}}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),val===undefined&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),extra===!0||jQuery.isNumeric(num)?num||0:val):val},swap:function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret}}),window.getComputedStyle?(getStyles=function(elem){return window.getComputedStyle(elem,null)},curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;return computed&&(""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),rnumnonpx.test(ret)&&rmargin.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),ret}):document.documentElement.currentStyle&&(getStyles=function(elem){return elem.currentStyle},curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;return null==ret&&style&&style[name]&&(ret=style[name]),rnumnonpx.test(ret)&&!rposition
destroy:function(){this.remove(),BI.isIE()===!0&&(this[0].outerHTML="")},__textKeywordMarked__:function(text,keyword,py){if(!BI.isKey(keyword)||(text+"").length>100)return this.html(BI.htmlEncode(text));keyword+="",keyword=BI.toUpperCase(keyword);var textLeft=(text||"")+"";for(py=(py||BI.makeFirstPY(text,{splitChar:""}))+"",py=BI.toUpperCase(py),this.empty();py.length>0&&textLeft.length>0;){var tidx=BI.toUpperCase(textLeft).indexOf(keyword),pidx=py.indexOf(keyword);if(pidx>=0&&(pidx=(pidx-Math.floor(pidx/(textLeft.length+1)))%textLeft.length),tidx>=0&&(pidx>tidx||pidx===-1))this.append(BI.htmlEncode(textLeft.substr(0,tidx))),this.append(BI.$("<span>").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(tidx,keyword.length)))),textLeft=textLeft.substr(tidx+keyword.length),BI.isNotEmptyString(py)&&(py=BI.map(py.split(""),function(idx,ps){return ps.slice(tidx+keyword.length)}).join(""));else{if(!(pidx>=0)){this.append(BI.htmlEncode(textLeft));break}this.append(BI.htmlEncode(textLeft.substr(0,pidx))),this.append(BI.$("<span>").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(pidx,keyword.length)))),BI.isNotEmptyString(py)&&(py=BI.map(py.split(""),function(idx,ps){return ps.slice(pidx+keyword.length)}).join("")),textLeft=textLeft.substr(pidx+keyword.length)}}return this},getDomHeight:function(parent){var clone=BI.$(this).clone();clone.appendTo(BI.$(parent||"body"));var height=clone.height();return clone.remove(),height},hasVerticalScroll:function(){return this.height()>0&&this[0].clientWidth<this[0].offsetWidth},hasHorizonScroll:function(){return this.width()>0&&this[0].clientHeight<this[0].offsetHeight},getStyle:function(name){var node=this[0],computedStyle=void 0;if(_global.getComputedStyle&&(computedStyle=_global.getComputedStyle(node,null)))return computedStyle.getPropertyValue(BI.hyphenate(name));if(document.defaultView&&document.defaultView.getComputedStyle){if(computedStyle=document.defaultView.getComputedStyle(node,null))return computedStyle.getPropertyValue(BI.hyphenate(name));if("display"===name)return"none"}return node.currentStyle?"float"===name?node.currentStyle.cssFloat||node.currentStyle.styleFloat:node.currentStyle[BI.camelize(name)]:node.style&&node.style[BI.camelize(name)]},__isMouseInBounds__:function(e){var offset2Body=this.get(0).getBoundingClientRect?this.get(0).getBoundingClientRect():this.offset(),width=offset2Body.width||this.outerWidth(),height=offset2Body.height||this.outerHeight();return!(e.pageX<Math.floor(offset2Body.left)||e.pageX>offset2Body.left+width||e.pageY<Math.floor(offset2Body.top)||e.pageY>offset2Body.top+height)},__hasZIndexMask__:function(zindex){return zindex&&null!=this.zIndexMask[zindex]},__buildZIndexMask__:function(zindex,domArray){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var mask=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:domArray});return mask.element.css({"z-index":zindex}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:mask,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(mask),zindex&&(this.zIndexMask[zindex]=mask),mask.element},__releaseZIndexMask__:function(zindex){if(zindex&&this.zIndexMask[zindex])return BI.remove(this.indexMask,this.zIndexMask[zindex]),void this.zIndexMask[zindex].destroy();this.indexMask=this.indexMask||[];var indexMask=this.indexMask.pop();indexMask&&indexMask.destroy()}})),_.extend(BI,{$import:function(){function loadReady(src,must){var $scripts=BI.$("head script, body script");BI.$.each($scripts,function(i,item){item.src.indexOf(src)!=-1&&(_LOADED[src]=!0)});var $links=BI.$("head link");BI.$.each($links,function(i,item){item.href.indexOf(src)!=-1&&must&&(_LOADED[src]=!1,BI.$(item).remove())})}var _LOADED={};return function(src,ext,must){if(loadReady(src,must),_LOADED[src]!==!0)if("css"===ext){var link=document.createElement("link");link.rel="stylesheet",link.type="text/css",link.href=src;var head=document.getElementsByTagName("head")[0];head.appendChild(link),_LOADED[src]=!0}else BI.$.ajax({url:src,dataType:"script",async:!1,cache
this._mount()}}),BI.shortcut("bi.flex_scrollable_horizontal",BI.FlexWrapperHorizontalLayout),BI.FlexWrapperVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_vertical_adapt",BI.FlexWrapperVerticalCenter),BI.shortcut("bi.flex_scrollable_vertical_center_adapt",BI.FlexWrapperVerticalCenter),BI.FlexWrapperVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:null,scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("<div>").addClass("flex-scrollable-vertical-layout-wrapper h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_vertical",BI.FlexWrapperVerticalLayout),BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&(w.element.css({left:item.left}),left+=item.left),BI.isNotNull(item.right)&&(w.element.css({right:item.right}),right+=item.right),BI.isNotNull(item.top)&&(w.element.css({top:item.top}),top+=item.top),BI.isNotNull(item.bottom)&&(w.element.css({bottom:item.bottom}),bottom+=item.bottom),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({left:left}),right+=o.hgap,w.element.css({right:right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({top:top}),bottom+=o.vgap,w.element.css({bottom:bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({left:left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({right:right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({top:top})),BI.is
hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{height:100,el:{type:"bi.button",text:"button1"}},{height:"fill",el:{type:"bi.button",text:"button2"}},{height:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.VTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",left:(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",right:+(item.hgap||0)+(item.rgap||0)+o.hgap+o.rgap+"px"})});var top={},bottom={};top[0]=0,bottom[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(top[i])&&(top[i]=top[i-1]+items[i-1].height+(items[i-1].tgap||0)+2*(items[i-1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({top:100*top[i]+"%",height:100*item.height+"%"}):w.element.css({top:top[i]+(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(bottom[i])&&(bottom[i]=bottom[i+1]+items[i+1].height+(items[i+1].bgap||0)+2*(items[i+1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({bottom:100*bottom[i]+"%",height:100*item.height+"%"}):w.element.css({bottom:bottom[i]+(item.vgap||0)+(item.bgap||0)+o.vgap+o.bgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0})},update:function(){},populate:function(items){BI.VTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vtape",BI.VTapeLayout),BI.TdLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TdLayout.superclass.props.apply(this,arguments),{baseCls:"bi-td-layout",columnSize:[200,200,200],hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TdLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("<table>").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var o=this.options,tr=BI.createWidget({type:"bi.default",tagName:"tr"}),i=0;i<arr.length;i++){var w=BI.createWidget(arr[i]);w.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),arr[i].lgap&&w.element.css({"margin-left":arr[i].lgap+"px"}),arr[i].rgap&&w.element.css({"margin-right":arr[i].rgap+"px"}),arr[i].tgap&&w.element.css({"margin-top":arr[i].tgap+"px"}),arr[i].bgap&&w.element.css({"margin-bottom":arr[i].bgap+"px"}),first(w,this.rows++,i);var td=BI.createWidget({type:"bi.default",attributes:{width:o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i]},tagName:"td",items:[w]});td.element.css({position:"relative","vertical-align":"middle",margin:"0",padding:"0",border:"none"}),tr.addItem(td)}return this.addWidget(this.getName()+idx,tr),tr},appendFra
"axis"in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS&&(deltaX=deltaY*-1,deltaY=0),delta=0===deltaY?deltaX:deltaY,"deltaY"in orgEvent&&(deltaY=orgEvent.deltaY*-1,delta=deltaY),"deltaX"in orgEvent&&(deltaX=orgEvent.deltaX,0===deltaY&&(delta=deltaX*-1)),0!==deltaY||0!==deltaX){if(1===orgEvent.deltaMode){var lineHeight=40;delta*=lineHeight,deltaY*=lineHeight,deltaX*=lineHeight}else if(2===orgEvent.deltaMode){var pageHeight=800;delta*=pageHeight,deltaY*=pageHeight,deltaX*=pageHeight}if(absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX)),(!lowestDelta||absDelta<lowestDelta)&&(lowestDelta=absDelta,shouldAdjustOldDeltas(orgEvent,absDelta)&&(lowestDelta/=40)),shouldAdjustOldDeltas(orgEvent,absDelta)&&(delta/=40,deltaX/=40,deltaY/=40),delta=Math[delta>=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120===0}var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})}),BI.Pane=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pane.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-pane",tipText:BI.i18nText("BI-No_Selected_Item"),overlap:!0,onLoaded:BI.emptyFn})},_assertTip:function(){var o=this.options;this._tipText||(this._tipText=BI.createWidget({type:"bi.label",cls:"bi-tips",text:o.tipText,height:25}),BI.createWidget({type:"bi.absolute_center_adapt",element:this,items:[this._tipText]}))},loading:function(){var self=this,o=this.options,isIE=BI.isIE(),loadingAnimation=BI.createWidget({type:"bi.horizontal",cls:"bi-loading-widget"+(isIE?" wave-loading hack":""),height:30,width:30,hgap:5,vgap:2.5,items:isIE?[]:[{type:"bi.layout",cls:"animate-rect rect1",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect2",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect3",height:25,width:3}]});this.setTipVisible(!1),o.overlap===!0?(BI.Layers.has(this.getName())||BI.createWidget({type:"bi.absolute_center_adapt",cls:"loading-container",items:[{el:loadingAnimation}],element:BI.Layers.make(this.getName(),this)}),BI.Layers.show(self.getName())):BI.isNull(this._loading)&&(this._loading=loadingAnimation,this._loading.element.css("zIndex",1),BI.createWidget({type:"bi.absolute_center_adapt",element:this,cls:"loading-container",items:[{el:this._loading,left:0,right:0,top:0}]})),this.element.addClass("loading-status")},loaded:function(){var self=this,o=this.options;BI.Layers.remove(self.getName()),this._loading&&this._loading.destroy(),this._loading&&(this._load
if(BI.isNotEmptyArray(node.children)||checkState.half===!1)return void this._buildTree(map,path);var storeValues=BI.deepClone(this.options.paras.selectedValues),treeNode=this._getTree(storeValues,path);this._addTreeNode(map,parent,this._getNodeValue(node),treeNode)}},_getTree:function(map,values){var cur=map;return BI.any(values,function(i,value){return null==cur[value]||void(cur=cur[value])}),cur},_addTreeNode:function(map,values,key,value){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]}),cur[key]=value},_buildTree:function(map,values){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]})},_getSelectedValues:function(){function track(nodes){BI.each(nodes,function(i,node){var checkState=node.getCheckStatus();if(checkState.checked===!0||checkState.half===!0)if(checkState.half===!0)self._getHalfSelectedValues(hashMap,node);else{var parentValues=node.parentValues||self._getParentValues(node),values=parentValues.concat([self._getNodeValue(node)]);self._buildTree(hashMap,values)}})}var self=this,hashMap={},rootNoots=this.nodes.getNodes();return track(rootNoots),hashMap},_dealWidthNodes:function(nodes){var self=this,o=this.options,ns=BI.Tree.arrayFormat(nodes);return BI.each(ns,function(i,n){n.title=n.title||n.text||n.value,n.isParent=n.isParent||n.parent,BI.isKey(o.paras.keyword)?n.text=BI.$("<div>").__textKeywordMarked__(n.text,o.paras.keyword,n.py).html():n.text=BI.htmlEncode(n.text+"")}),nodes},_loadMore:function(){var self=this,o=this.options;this.tip.setLoading();var op=BI.extend({},o.paras,{times:++this.times});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes))}})},_initTree:function(setting){var self=this,o=this.options;self.fireEvent(BI.Events.INIT),this.times=1;var tree=this.tree;tree.empty(),this.loading(),this.tip.setVisible(!1);var callback=function(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))},op=BI.extend({},o.paras,{times:1});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes)),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),1===op.times&&self.fireEvent(BI.Events.AFTERINIT)}})},initTree:function(nodes,setting){var setting=setting||{async:{enable:!1},check:{enable:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0},callback:{}};this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},start:function(){this._stop=!1},stop:function(){this._stop=!0},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._createTree(),this.start(),this._initTree(setting)},populate:function(){this.stroke.apply(this,arguments)},hasChecked:function(){var treeObj=this.nodes;return treeObj.getCheckedNodes(!0).length>0},checkAll:function(checked){function setNode(children){BI.each(children,function(i,child){child.halfCheck=!1,setNode(child.children)})}this.nodes&&(BI.each(this.nodes.getNodes(),function(i,node){node.halfCheck=!1,setNode(node.children)}),this.nodes.checkAllNodes(checked))},expandAll:function(flag){this.nodes&&this.nodes.expandAll(flag)},setValue:function(value,param){this.checkAll(!1),this.updateValue(value,param),this.refresh()},setSelectedValue:function(value){this.options.paras.selectedValues=BI.deepClone(value||{})},updateValue:function(values,param){if(this.nodes){param||(param="value");var treeObj=this.nodes;BI.each(values,function(v,op){var nodes=treeObj.getNodesByParam(param,v,null);BI.each(nodes,function(j,node){BI.extend(node,{checked:!0},op),treeObj.updateNode(node)})})}},refresh:function(){this.nodes&&this.nodes.refresh()},getValue:function(){return this.nodes?this._getSelectedValues():null},destroyed:function(){this.stop(),this.nodes&&th
this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(e){this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.visible(),this.adjustWidth(e),this.adjustHeight(e),this.element.addClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),BI.Widget._renderEngine.createElement(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(e){var o=this.options;if(this.popupView&&o.isNeedAdjustWidth===!0){this.resetListWidth("");var width=this.popupView.element.outerWidth(),maxW=this.element.outerWidth()||o.width;width>maxW+80?maxW+=80:width>maxW&&(maxW=width),this.resetListWidth(maxW<100?100:maxW)}},adjustHeight:function(e){var o=this.options,p={};if(this.popupView){var isVisible=this.popupView.isVisible();this.popupView.visible();var combo=BI.isNotNull(e)?{element:{offset:function(){return{left:e.pageX,top:e.pageY}},bounds:function(){return{x:e.offsetX,y:e.offsetY,width:0,height:24}},outerWidth:function(){return 0},outerHeight:function(){return 24}}}:this.combo;switch(o.direction){case"bottom":case"bottom,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","right","left"],o.offsetStyle);break;case"top":case"top,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","right","left"],o.offsetStyle);break;case"left":case"left,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","bottom","top"],o.offsetStyle);break;case"right":case"right,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","bottom","top"],o.offsetStyle);break;case"top,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","left","right"],o.offsetStyle);break;case"bottom,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","left","right"],o.offsetStyle);break;case"left,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","top","bottom"],o.offsetStyle);break;case"right,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","top","bottom"],o.offsetStyle);break;case"right,innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerRight","innerLeft","bottom","top"],o.offsetStyle);break;case"right,innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerLeft","innerRight","bottom","top"],o.offsetStyle);break;case"innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerRight","innerLeft","right","left","bottom","top"],o.offsetStyle);break;case"innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerLeft","innerRight","left","right","bottom","top"],o.offsetStyle);break;case"top,custom":case"custom,top":p=BI.DOM.getTopAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":p=BI.DOM.get
self.switcher.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.switcher.isEnabled()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initSwitcher:function(){this.switcher=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;this._created||(this.popupView=BI.createWidget(o.popup,{type:"bi.button_group",element:o.adapter&&BI.Maskers.create(this.getName(),o.adapter,BI.extend({container:this},o.masker)),cls:"switcher-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_CHANGE,value,obj)}),o.direction===BI.Direction.Custom||o.adapter||BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._created=!0,BI.nextTick(function(){self.fireEvent(BI.Switcher.EVENT_AFTER_INIT)}))},_hideView:function(){this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW);var self=this,o=this.options;o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),BI.nextTick(function(){o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),self.element.removeClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW)})},_popupView:function(){var self=this,o=this.options;this._assertPopupView(),this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW),o.adapter?BI.Maskers.show(this.getName()):self.popupView.setVisible(!0),BI.nextTick(function(name){o.adapter?BI.Maskers.show(name):self.popupView.setVisible(!0),self.element.addClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW)},this.getName())},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.switcher.populate.apply(this.switcher,arguments)},_setEnable:function(arg){BI.Switcher.superclass._setEnable.apply(this,arguments),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.switcher.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},isViewVisible:function(){return this.isEnabled()&&this.switcher.isEnabled()&&(this.options.adapter?BI.Maskers.isVisible(this.getName()):this.popupView&&this.popupView.isVisible())},isExpanded:function(){return this.isViewVisible()},showView:function(){this.isEnabled()&&this.switcher.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.switcher.attr("id")===id?this.switcher:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.switcher.getValue()===value?this.switcher:this.popupView&&this.popupView.getNodeByValue(value)},empty:function(){this.popupView&&this.popupView.empty()},destroy:function(){BI.Switcher.superclass.destroy.apply(this,arguments)}}),BI.Switcher.EVENT_EXPAND="EVENT_EXPAND",BI.Switcher.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Switcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Switcher.EVENT_CHANGE="EVENT_CHANGE",BI.Switcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Switcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Switcher.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Switcher.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Switcher.EVENT_AFTER_HIDEVIEW="EVENT_AFTER
},populate:function(items){items&&this.options.items!==items&&this.restore(),this._populate(items)},destroyed:function(){this.restore()}}),BI.shortcut("bi.list_view",BI.ListView),BI.VirtualList=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-virtual-list",overscanHeight:100,blockSize:10,scrollTop:0,items:[]}},init:function(){var self=this;this.renderedIndex=-1,this.cache={}},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.layout",ref:function(){self.topBlank=this}},{type:"bi.vertical",scrolly:!1,ref:function(){self.container=this}},{type:"bi.layout",ref:function(){self.bottomBlank=this}}],element:this}},mounted:function(){var self=this,o=this.options;this._populate(),this.element.scroll(function(e){o.scrollTop=self.element.scrollTop(),self._calculateBlocksToRender()}),BI.ResizeDetector.addResizeListener(this,function(){self._calculateBlocksToRender()})},_renderMoreIf:function(){for(var self=this,o=this.options,height=this.element.height(),minContentHeight=o.scrollTop+height+o.overscanHeight,index=this.cache[this.renderedIndex]&&this.cache[this.renderedIndex].index+o.blockSize||0,cnt=this.renderedIndex+1,lastHeight,getElementHeight=function(){return self.container.element.height()+self.topBlank.element.height()+self.bottomBlank.element.height()};(lastHeight=getElementHeight())<minContentHeight&&index<o.items.length;){var items=o.items.slice(index,index+o.blockSize);this.container.addItems(items,this);var addedHeight=getElementHeight()-lastHeight;this.cache[cnt]={index:index,scrollTop:lastHeight,height:addedHeight},this.tree.set(cnt,addedHeight),this.renderedIndex=cnt,cnt++,index+=o.blockSize}},_calculateBlocksToRender:function(){var o=this.options;this._renderMoreIf();for(var height=this.element.height(),minContentHeightFrom=o.scrollTop-o.overscanHeight,minContentHeightTo=o.scrollTop+height+o.overscanHeight,start=this.tree.greatestLowerBound(minContentHeightFrom),end=this.tree.leastUpperBound(minContentHeightTo),needDestroyed=[],i=0;i<start;i++){var index=this.cache[i].index;if(!this.cache[i].destroyed){for(var j=index;j<index+o.blockSize&&j<o.items.length;j++)needDestroyed.push(this.container._children[j]),this.container._children[j]=null;this.cache[i].destroyed=!0}}for(var i=end+1;i<=this.renderedIndex;i++){var index=this.cache[i].index;if(!this.cache[i].destroyed){for(var j=index;j<index+o.blockSize&&j<o.items.length;j++)needDestroyed.push(this.container._children[j]),this.container._children[j]=null;this.cache[i].destroyed=!0}}for(var firstFragment=BI.Widget._renderEngine.createFragment(),lastFragment=BI.Widget._renderEngine.createFragment(),currentFragment=firstFragment,i=start<0?0:start;i<=end&&i<=this.renderedIndex;i++){var index=this.cache[i].index;if(this.cache[i].destroyed||(currentFragment=lastFragment),this.cache[i].destroyed===!0){for(var j=index;j<index+o.blockSize&&j<o.items.length;j++){var w=this.container._addElement(j,BI.extend({root:!0},BI.stripEL(o.items[j])),this);currentFragment.appendChild(w.element[0])}this.cache[i].destroyed=!1}}this.container.element.prepend(firstFragment),this.container.element.append(lastFragment),this.topBlank.setHeight(this.cache[start<0?0:start].scrollTop);var lastCache=this.cache[Math.min(end,this.renderedIndex)];this.bottomBlank.setHeight(this.tree.sumTo(this.renderedIndex)-lastCache.scrollTop-lastCache.height),BI.each(needDestroyed,function(i,child){child&&child._destroy()})},_populate:function(items){var o=this.options;items&&this.options.items!==items&&(this.options.items=items),this.tree=BI.PrefixIntervalTree.empty(Math.ceil(o.items.length/o.blockSize)),this._calculateBlocksToRender(),this.element.scrollTop(o.scrollTop)},_clearChildren:function(){BI.each(this.container._children,function(i,cell){cell&&cell._destroy()}),this.container._children={},this.container.attr("items",[])},restore:function(){this.renderedIndex=-1,this._clearChildren(),this.cache={},this.options.scrollTop=0,this.topBlank.setHeight(0),this.bottomBlank.setHeight(0)},populate:function(items){items&&this.options.items!==items&&this.restore(),this._p
return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_node",BI.IconTextIconNode),BI.IconTextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.IconTextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_node",BI.IconTextNode),BI.TextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconNode.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.TextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_node",BI.TextIconNode),BI.TextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-node",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextNode.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})}
level:"error"}),self.fireEvent(BI.File.EVENT_ERROR,{errorType:1,file:item})):wrap.files.unshift(item)}wrap.files.length>0&&self.fireEvent(BI.File.EVENT_CHANGE,{files:wrap.files}),input.value="",wrap.dom.input.parentNode.replaceChild(input,wrap.dom.input),wrap.dom.input=input,event.add(wrap.dom.input,"change",arguments.callee)}),wrap},_wrap:function(){var self=this,o=this.options,input=this.element[0];return o.multiple===!0&&this.element.attr("multiple","multiple"),input.value="",this._events({dom:{input:input,disabled:!1},name:input.name,maxSize:o.maxSize?o.maxSize>>0:-1,files:[],clean:function(){this.files=[]},upload:function(handler){if(handler)for(var key in handler)this[key]=handler[key];return sendFiles(this,this.maxSize),this},hide:function(){this.dom.disabled&&(this.dom.disabled=!1,this.dom.input.removeAttribute("disabled"))},show:function(total,current,totalProp,currentProp){this.dom.disabled||(this.dom.disabled=!0,this.dom.input.setAttribute("disabled","disabled"))}})},select:function(){this.wrap&&BI.Widget._renderEngine.createElement(this.wrap.dom.input).click()},upload:function(handler){this.wrap&&this.wrap.upload(handler)},getValue:function(){return this.wrap?this.wrap.attach_array:[]},reset:function(){this.wrap&&(this.wrap.attach_array=[],this.wrap.attach_names=[],this.wrap.attachNum=0)},_setEnable:function(enable){BI.File.superclass._setEnable.apply(this,arguments),enable===!0?this.element.attr("disabled","disabled"):this.element.removeAttr("disabled")}}),BI.File.EVENT_CHANGE="EVENT_CHANGE",BI.File.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.File.EVENT_ERROR="EVENT_ERROR",BI.File.EVENT_PROGRESS="EVENT_PROGRESS",BI.File.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.file",BI.File)}(_global.document||{}),BI.Input=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Input.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-input display-block overflow-dot",tagName:"input",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1})},_init:function(){BI.Input.superclass._init.apply(this,arguments);var self=this,ctrlKey=!1,keyCode=null,inputEventValid=!1,_keydown=BI.debounce(function(keyCode){self.onKeyDown(keyCode,ctrlKey),self._keydown_=!1},300),_clk=BI.debounce(BI.bind(this._click,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});this._focusDebounce=BI.debounce(BI.bind(this._focus,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this._blurDebounce=BI.debounce(BI.bind(this._blur,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this.element.keydown(function(e){inputEventValid=!1,ctrlKey=e.ctrlKey||e.metaKey,keyCode=e.keyCode,self.fireEvent(BI.Input.EVENT_QUICK_DOWN,arguments)}).keyup(function(e){keyCode=null,inputEventValid&&e.keyCode===BI.KeyCode.ENTER||(self._keydown_=!0,_keydown(e.keyCode))}).on("input propertychange",function(e){var originalEvent=e.originalEvent;(BI.isNull(originalEvent.propertyName)||"value"===originalEvent.propertyName)&&(inputEventValid=!0,self._keydown_=!0,_keydown(keyCode),keyCode=null)}).click(function(e){e.stopPropagation(),_clk()}).mousedown(function(e){self.element.val(self.element.val())}).focus(function(e){self._focusDebounce()}).focusout(function(e){self._blurDebounce()}),(BI.isKey(this.options.value)||BI.isEmptyString(this.options.value))&&this.setValue(this.options.value)},_focus:function(){this.element.addClass("bi-input-focus"),this._checkValidationOnValueChange(),this._isEditing=!0,""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this.fireEvent(BI.Input.EVENT_FOCUS)},_blur:function(){function blur(){if(self.isValid()||self.options.quitChecker.apply(self,[BI.trim(self.getValue())])===!1||(self.element.val(self._lastValidValue?self._lastValidValue:""),self._checkValidationOnValueChange(),self._defaultState()),self.element.removeClass("bi-input-focus"),self._isEditing=!1,self._start=!1,self.isValid()){var lastValidValue=self._lastValidValue;self._lastValidValue=self.getValue(),self.fireEvent(BI.Controller.EV
isFirst?_init.proxys.splice(0,0,initProxy):_init.proxys.push(initProxy)},addInitRoot:function(initRoot){_init.roots.push(initRoot)},addNodesData:function(setting,parentNode,nodes){var childKey=setting.data.key.children;parentNode[childKey]||(parentNode[childKey]=[]),parentNode[childKey].length>0&&(parentNode[childKey][parentNode[childKey].length-1].isLastNode=!1,view.setNodeLineIcos(setting,parentNode[childKey][parentNode[childKey].length-1])),parentNode.isParent=!0,parentNode[childKey]=parentNode[childKey].concat(nodes)},addSelectedNode:function(setting,node){var root=data.getRoot(setting);data.isSelectedNode(setting,node)||root.curSelectedList.push(node)},addCreatedNode:function(setting,node){if(setting.callback.onNodeCreated||setting.view.addDiyDom){var root=data.getRoot(setting);root.createdNodes.push(node)}},addZTreeTools:function(zTreeTools){_init.zTreeTools.push(zTreeTools)},exSetting:function(s){$.extend(!0,_setting,s)},fixPIdKeyValue:function(setting,node){setting.data.simpleData.enable&&(node[setting.data.simpleData.pIdKey]=node.parentTId?node.getParentNode()[setting.data.simpleData.idKey]:setting.data.simpleData.rootPId)},getAfterA:function(setting,node,array){for(var i=0,j=_init.afterA.length;i<j;i++)_init.afterA[i].apply(this,arguments)},getBeforeA:function(setting,node,array){for(var i=0,j=_init.beforeA.length;i<j;i++)_init.beforeA[i].apply(this,arguments)},getInnerAfterA:function(setting,node,array){for(var i=0,j=_init.innerAfterA.length;i<j;i++)_init.innerAfterA[i].apply(this,arguments)},getInnerBeforeA:function(setting,node,array){for(var i=0,j=_init.innerBeforeA.length;i<j;i++)_init.innerBeforeA[i].apply(this,arguments)},getCache:function(setting){return caches[setting.treeId]},getNextNode:function(setting,node){if(!node)return null;for(var childKey=setting.data.key.children,p=node.parentTId?node.getParentNode():data.getRoot(setting),i=0,l=p[childKey].length-1;i<=l;i++)if(p[childKey][i]===node)return i==l?null:p[childKey][i+1];return null},getNodeByParam:function(setting,nodes,key,value){if(!nodes||!key)return null;for(var childKey=setting.data.key.children,i=0,l=nodes.length;i<l;i++){if(nodes[i][key]==value)return nodes[i];var tmp=data.getNodeByParam(setting,nodes[i][childKey],key,value);if(tmp)return tmp}return null},getNodeCache:function(setting,tId){if(!tId)return null;var n=caches[setting.treeId].nodes[data.getNodeCacheId(tId)];return n?n:null},getNodeName:function(setting,node){var nameKey=setting.data.key.name;return""+node[nameKey]},getNodeTitle:function(setting,node){var t=""===setting.data.key.title?setting.data.key.name:setting.data.key.title;return""+node[t]},getNodes:function(setting){return data.getRoot(setting)[setting.data.key.children]},getNodesByParam:function(setting,nodes,key,value){if(!nodes||!key)return[];for(var childKey=setting.data.key.children,result=[],i=0,l=nodes.length;i<l;i++)nodes[i][key]==value&&result.push(nodes[i]),result=result.concat(data.getNodesByParam(setting,nodes[i][childKey],key,value));return result},getNodesByParamFuzzy:function(setting,nodes,key,value){if(!nodes||!key)return[];var childKey=setting.data.key.children,result=[];value=value.toLowerCase();for(var i=0,l=nodes.length;i<l;i++)"string"==typeof nodes[i][key]&&nodes[i][key].toLowerCase().indexOf(value)>-1&&result.push(nodes[i]),result=result.concat(data.getNodesByParamFuzzy(setting,nodes[i][childKey],key,value));return result},getNodesByFilter:function(setting,nodes,filter,isSingle,invokeParam){if(!nodes)return isSingle?null:[];for(var childKey=setting.data.key.children,result=isSingle?null:[],i=0,l=nodes.length;i<l;i++){if(tools.apply(filter,[nodes[i],invokeParam],!1)){if(isSingle)return nodes[i];result.push(nodes[i])}var tmpResult=data.getNodesByFilter(setting,nodes[i][childKey],filter,isSingle,invokeParam);if(isSingle&&tmpResult)return tmpResult;result=isSingle?tmpResult:result.concat(tmpResult)}return result},getPreNode:function(setting,node){if(!node)return null;for(var childKey=setting.data.key.children,p=node.parentTId?node.getParentNode():data.getRoot(setting),i=0,l=p[childKey].length;i<l;i++)i
if(callbackFlag&&!expandFlag&&0==tools.apply(setting.callback.beforeCollapse,[setting.treeId,node],!0))return null;if(expandFlag&&node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,!1),expandFlag===node.open&&!sonSign)return null;if(data.getRoot(setting).expandTriggerFlag=callbackFlag,!tools.canAsync(setting,node)&&sonSign)view.expandCollapseSonNode(setting,node,expandFlag,!0,function(){if(focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}});else if(node.open=!expandFlag,view.switchNode(this.setting,node),focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}return expandFlag},getNodes:function(){return data.getNodes(setting)},getNodeByParam:function(key,value,parentNode){return key?data.getNodeByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodeByTId:function(tId){return data.getNodeCache(setting,tId)},getNodesByParam:function(key,value,parentNode){return key?data.getNodesByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByParamFuzzy:function(key,value,parentNode){return key?data.getNodesByParamFuzzy(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByFilter:function(filter,isSingle,parentNode,invokeParam){return isSingle=!!isSingle,filter&&"function"==typeof filter?data.getNodesByFilter(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),filter,isSingle,invokeParam):isSingle?null:[]},getNodeIndex:function(node){if(!node)return null;for(var childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():data.getRoot(setting),i=0,l=parentNode[childKey].length;i<l;i++)if(parentNode[childKey][i]==node)return i;return-1},getSelectedNodes:function(){for(var r=[],list=data.getRoot(setting).curSelectedList,i=0,l=list.length;i<l;i++)r.push(list[i]);return r},isSelectedNode:function(node){return data.isSelectedNode(setting,node)},reAsyncChildNodes:function(parentNode,reloadType,isSilent){if(this.setting.async.enable){var isRoot=!parentNode;if(isRoot&&(parentNode=data.getRoot(setting)),"refresh"==reloadType){for(var childKey=this.setting.data.key.children,i=0,l=parentNode[childKey]?parentNode[childKey].length:0;i<l;i++)data.removeNodeCache(setting,parentNode[childKey][i]);if(data.removeSelectedNode(setting),parentNode[childKey]=[],isRoot)this.setting.treeObj.empty();else{var ulObj=$$(parentNode,consts.id.UL,setting);ulObj.empty()}}view.asyncNode(this.setting,isRoot?null:parentNode,!!isSilent)}},refresh:function(){this.setting.treeObj.empty();var root=data.getRoot(setting),nodes=root[setting.data.key.children];data.initRoot(setting),root[setting.data.key.children]=nodes,data.initCache(setting),view.createNodes(setting,0,root[setting.data.key.children])},removeChildNodes:function(node){if(!node)return null;var childKey=setting.data.key.children,nodes=node[childKey];return view.removeChildNodes(setting,node),nodes?nodes:null},removeNode:function(node,callbackFlag){node&&(callbackFlag=!!callbackFlag,callbackFlag&&0==tools.apply(setting.callback.beforeRemove,[setting.treeId,node],!0)||(view.removeNode(setting,node),callbackFlag&&this.setting.treeObj.trigger(consts.event.REMOVE,[setting.treeId,node])))},selectNode:function(node,addFlag){if(node&&tools.uCanDo(setting)){if(addFlag=setting.view.selectedMulti&&addFlag,node.parentTId)view.expandCollapseParentNode(setting,node.getParentNode(),!0,!1,function(){try{$$(node,setting).focus().blur()}catch(e){}});else try{$$(node,setting).focus().blur()}catch(e){}view.selectNode(setting,node,addFlag)}},transformTozTreeNodes:function(simpleNodes){return data.transformTozTreeFormat(setting,simpleNodes)},transformToArray:function(nodes){return data.transformToArrayFormat(setting,nodes)},updateNode:function(node,checkTypeFlag){if(node){var nObj=$$(node,setting);nObj.get(0)&&tools.uCanDo(setting)&&(view.setNodeName(setting,node),view.setNodeTarget(setting,node),view.setNodeUrl(setting,node),view.setNodeLineIcos(setting,node),view.setNode
}}),BI.shortcut("bi.first_plus_group_node",BI.FirstPlusGroupNode),BI.IconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-arrow-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24,iconHeight:12,iconWidth:12,iconCls:""})},_init:function(){BI.IconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox",width:24,stopPropagation:!0});var icon=BI.createWidget({type:"bi.icon_label",width:24,cls:o.iconCls,iconWidth:o.iconWidth,iconHeight:o.iconHeight});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},{width:16,el:icon},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,rgap:5}))))},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(v){BI.IconArrowNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.icon_arrow_node",BI.IconArrowNode),BI.LastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.LastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-last-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.LastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=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:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},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(v){BI.LastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.last_plus_group_node",BI.LastPlusGroupNode),BI.MidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-mid-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.MidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=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:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.
},width:o.width-2,height:o.height-2},o.el),popup:{el:BI.extend({type:"bi.color_chooser_popup",ref:function(_ref){self.colorPicker=_ref},listeners:[{eventName:BI.ColorChooserPopup.EVENT_VALUE_CHANGE,action:function(){fn(),self._isRGBColor(self.colorPicker.getValue())||self.combo.hideView()}},{eventName:BI.ColorChooserPopup.EVENT_CHANGE,action:function(){fn(),self.combo.hideView()}}]},o.popup),width:230},value:o.value});var fn=function(){var color=self.colorPicker.getValue();self.trigger.setValue(color)};this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.ColorChooser.EVENT_CHANGE,arguments)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.ColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser",BI.ColorChooser),BI.ColorChooserPopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-color-chooser-popup",width:230,height:145,simple:!1},render:function(){var self=this,o=this.options;this.colorEditor=BI.createWidget(o.editor,{type:o.simple?"bi.simple_color_picker_editor":"bi.color_picker_editor",value:o.value,cls:"bi-header-background bi-border-bottom",height:30}),this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue()),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,arguments)}),this.storeColors=BI.createWidget({type:"bi.color_picker",cls:"bi-border-bottom bi-border-right",items:[this._digestStoreColors(this._getStoreColors())],width:210,height:24,value:o.value}),this.storeColors.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.colorPicker=BI.createWidget({type:"bi.color_picker",width:210,height:50,value:o.value}),this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.customColorChooser=BI.createWidget({type:"bi.custom_color_chooser",editor:o.editor});var panel=BI.createWidget({type:"bi.popup_panel",buttons:[BI.i18nText("BI-Basic_Cancel"),BI.i18nText("BI-Basic_Save")],title:BI.i18nText("BI-Custom_Color"),el:this.customColorChooser,stopPropagation:!1,bgap:-1,rgap:1,lgap:1,minWidth:227});return this.more=BI.createWidget({type:"bi.combo",cls:"bi-border-top",container:null,direction:"right,top",isNeedAdjustHeight:!1,el:{type:"bi.text_item",cls:"color-chooser-popup-more bi-list-item",textAlign:"center",height:24,textLgap:10,text:BI.i18nText("BI-Basic_More")+"..."},popup:panel}),this.more.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self.customColorChooser.setValue(self.getValue())}),panel.on(BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.more.hideView();break;case 1:self.setValue(self.customColorChooser.getValue()),self._dealStoreColors(),self.more.hideView(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}}),{type:"bi.absolute",items:[{el:{type:"bi.vtape",items:[this.colorEditor,{el:{type:"bi.absolute",items:[{el:this.storeColors,left:10,right:10,top:5}]},height:29},{el:{type:"bi.absolute",items:[{el:this.colorPicker,left:10,right:10,top:5,bottom:5}]},height:60},{el:this.more,height:24}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"disable-mask",invisible:!o.disabled,ref:function(){self.mask=this}},left:0,right:0,top:0,bottom:0}]}},mounted:function(){var self=this,o=this.options;BI.isNotNull(o.value)&&this.setValue(o.value)},_setEnable:function(enable){BI.ColorChooserPopup.superclass._setEnable.apply(this,arguments),this.mask.setVisible(!enable)},_dealStoreColors:function(){var color=this.getValue(),colors=this._getStoreColors(),que=new BI.Queue(8);que.fromArray(colors),que.remove(color),que.unshift(color);var array=que.toArray();BI.Cache.set
self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE,v)}},buttonOpt)});return{type:"bi.bubble_bar_popup_view",minWidth:o.minWidth,maxWidth:o.maxWidth,minHeight:o.minHeight,ref:function(){self.popup=this},el:{type:"bi.label",text:o.text,whiteSpace:"normal",textAlign:"left",ref:function(){self.text=this}},buttons:buttons}},populate:function(v){this.text.setText(v||this.options.text)}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CLICK_TOOLBAR_BUTTON",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 self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:o.items,height:o.height,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,value:o.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){self.popup.setValue(this.getValue()),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.editorIconCheckCombo.hideView(),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(v){this.editorIconCheckCombo.setValue(v)},getValue:function(){return this.trigger.getValue()},populate:function(items){this.options.items=items,this.editorIconCheckCombo.populate(items)}}),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:24,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 self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.icon_combo_trigger",iconCls:o.iconCls,title:o.title,items:o.items,width:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,value:o.value}),this.popup=BI.createWidget(o.popup,{type:"bi.icon_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.iconCombo.hideView(),self.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:o.direction,trigger:o.trigger,container:o.container,adjustLength:o.adjustLength,adjustXOffset:o.adjustXOffset,adjustYOffset:o.adjustYOffset,offsetStyle:o.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.iconCombo.populate(items)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shor
},_showHint:function(){this.editor.invisible(),this.text.visible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},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(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setTextStyle:function(style){this.text.setStyle(style)},setValue:function(k){var o=this.options;this.editor.setValue(k),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),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_CHANGE_CONFIRM="EVENT_CHANGE_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.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.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 self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:"left",height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.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(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(
return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(data){var selectAll=data.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(selectAll),this.list[selectAll?"setNotSelectedValue":"setValue"](data.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(items){this.toolbar.setVisible(!BI.isEmptyArray(items)),this.toolbar.setEnable(this.isEnabled()&&!BI.isEmptyArray(items)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(enable){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(enable)},resetHeight:function(h){var toolHeight=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(h-toolHeight):this.list.element.css({"max-height":h-toolHeight+"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(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),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 self=this,o=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var all=o.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:o.el,itemsCreator:function(options,populate){populate(self._getNextItems(options))},hasNext:function(option){return option.count<all}}),this.loader.on(BI.Loader.EVENT_CHANGE,function(obj){self.fireEvent(BI.LazyLoader.EVENT_CHANGE,obj)})},_getNextItems:function(options){var self=this,o=this.options,lastNum=o.items.length-this._const.PAGE*(options.times-1),lastItems=BI.takeRight(o.items,lastNum),nextItems=BI.take(lastItems,this._const.PAGE);return nextItems},populate:function(items){this.loader.populate(items)},addItems:function(items){this.loader.addItems(items)},empty:function(){this.loader.empty()},setNotSelectedValue:function(){this.loader.setNotSelectedValue.apply(this.loader,arguments)},getNotSelectedValue:function(){return this.loader.getNotSelectedValue()},setValue:function(){this.loader.setValue.apply(this.loader,arguments)},getValue:function(){return this.loader.getValue.apply(this.loader,arguments)},getAllButtons:function(){return this.loader.getAllButtons()},getAllLeaves:function(){return this.loader.getAllLeaves()},getSelectedButtons:function(){return this.loader.getSelectedButtons()},getNotSelectedButtons:function(){return this.loader.getNotSelectedButtons()},getIndexByValue:function(value){return this.loader.getIndexByValue(value)},getNodeById:function(id){return this.loader.getNodeById(id)},getNodeByValue:function(value){return this.loader.getNodeByValue(value)}}),BI.LazyLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.lazy_loader",BI.LazyLoader),BI.ListLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ListLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-list-load
}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.ListDisplayTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListDisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-list-display-tree"})},_init:function(){BI.ListDisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}function getFont(treeId,node){return node.isLeaf?{}:{color:"#999999"}}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1,fontCss:getFont},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.ListDisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.ListDisplayTree.superclass.destroy.apply(this,arguments)}}),BI.ListDisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_display_tree",BI.ListDisplayTree),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 self=this,o=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(op,callback){var fn=function(items){callback({items:items}),self.structure.initTree(BI.Tree.transformToTreeFormat(items))};BI.isNotNull(o.items)?fn(o.items):o.itemsCreator(op,fn)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(o.items)&&this.populate(),BI.isNotNull(o.value)&&this.setValue(o.value)},populate:function(items,keyword){items&&(this.options.items=items),this.tree.stroke({keyword:keyword})},_digest:function(v){v||(v=[]);var self=this,map={},selected=[];return BI.each(v,function(i,val){var node=self.structure.search(val,"value");if(node){var p=node;for(p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++);p&&p.getChildrenLength()<=map[p.value];)selected.push(p.value),p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++)}}),BI.makeObject(v.concat(selected))},setValue:function(v){this.tree.setValue(this._digest(v))},_getValue:function(){var self=this,result=[],val=this.tree.getValue(),track=function(nodes){BI.each(nodes,function(key,node){BI.isEmpty(node)?result.push(key):track(node)})};return track(val),result},empty:function(){this.tree.empty()},getValue:function(){var self=this,result=[],val=this._getValue();return BI.each(val,function(i,key){var target=self.structure.search(key,"value");target&&self.structure._traverse(target,function(node){node.isLeaf()&&result.push(node.value)})}),result}}),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 conf=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.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 self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,title:function(){return se
});break;case BI.DynamicDatePane.Dynamic:self.dynamicPane.setValue({year:0})}self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateCombo.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},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},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border bi-border-radius",width:200,height:24,minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var self=this,opts=this.options,date=BI.getDate();this.storeValue=BI.isNotNull(opts.value)?opts.value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:opts.minDate,max:opts.maxDate,value:opts.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value}),self.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){self.storeValue=self.popup.getValue(),self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var triggerBtn=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24});triggerBtn.on(BI.IconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()||self.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:triggerBtn,top:0,right:0}]}]})},setValue:function(v){this.storeValue=v,this.popup.setValue(v),this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.
value:BI.DynamicDateCard.OFFSET.CURRENT},{text:BI.i18nText("BI-Basic_Week_Begin"),value:BI.DynamicDateCard.OFFSET.BEGIN},{text:BI.i18nText("BI-Basic_Week_End"),value:BI.DynamicDateCard.OFFSET.END}]}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{},this.position=v.position||BI.DynamicDateCard.OFFSET.CURRENT;var values=[],valuesItems=[];BI.isNotNull(v.year)&&(values.push(BI.DynamicDateCard.TYPE.YEAR),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))),BI.isNotNull(v.quarter)&&(values.push(BI.DynamicDateCard.TYPE.QUARTER),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))),BI.isNotNull(v.month)&&(values.push(BI.DynamicDateCard.TYPE.MONTH),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))),BI.isNotNull(v.week)&&(values.push(BI.DynamicDateCard.TYPE.WEEK),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,v.week))),BI.isNotNull(v.day)&&(values.push(BI.DynamicDateCard.TYPE.DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,v.day))),BI.isNotNull(v.workDay)&&(values.push(BI.DynamicDateCard.TYPE.WORK_DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,v.workDay))),this.checkgroup.setValue(values),this.workDayBox.setSelected(BI.isNotNull(v.workDay)),this.resultPane.populate(this._getParamJson(valuesItems,v.position))},getValue:function(){var self=this,valueMap={},selectValues=this.checkgroup.getValue(),buttons=this.resultPane.getAllButtons();if(0!==selectValues.length&&BI.each(buttons,function(idx,button){var value=button.getValue();switch(value.dateType){case BI.DynamicDateCard.TYPE.YEAR:valueMap.year=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.QUARTER:valueMap.quarter=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.MONTH:valueMap.month=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.WEEK:valueMap.week=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.DAY:valueMap.day=0===value.offset?-value.value:value.value}BI.isNull(value.dateType)&&(valueMap.position=self.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var value=buttons[0].getValue();valueMap.workDay=0===value.offset?-value.value:value.value}return valueMap}}),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},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,destroyWhenHide:!0,el:{type:"bi.dynamic_date_trigger",min:opts.minDate,max:opts.maxDate,format:opts.format,allowEdit:opts.allowEdit,watermark:opts.watermark,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_BLUR,a
switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,ref:function(){self.ymd=this}},{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this}},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self.timeSelect.setValue(),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._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 date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setMinDate:function(minDate){this.options.min!==minDate&&(this.options.min=minDate,this.ymd.setMinDate(minDate))},setMaxDate:function(maxDate){this.options.max!==maxDate&&(this.options.max=maxDate,this.ymd.setMaxDate(maxDate))},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var type=this.dateTab.getSelect();return{type:type,value:type===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"},render:function(){var self=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){self.hour=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<24},errorText:function(v){return BI.isNumeric(v)?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 value=this.getValue();self._checkHour(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(value)}}],width:60,height:24}},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.minute=this},validationChecker:function(v){return BI.isNaturalNumber(v)&
top:40}):this.labelTwo.element.css({top:0}):labelOneLeft-labelTwoLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_checkLabelPosition:function(oldValueOne,oldValueTwo,valueOne,valueTwo,isLeft){if(oldValueOne=BI.parseFloat(oldValueOne),oldValueTwo=BI.parseFloat(oldValueTwo),valueOne=BI.parseFloat(valueOne),valueTwo=BI.parseFloat(valueTwo),oldValueOne<=oldValueTwo&&valueOne>valueTwo||oldValueOne>=oldValueTwo&&valueOne<valueTwo){var isSliderOneLeft=BI.parseFloat(this.sliderOne.element[0].style.left)<BI.parseFloat(this.sliderTwo.element[0].style.left);this._resetLabelPosition(!isSliderOneLeft)}},_resetLabelPosition:function(needReverse){this.labelOne.element.css({left:needReverse?"100%":"0%"}),this.labelTwo.element.css({left:needReverse?"0%":"100%"})},_setSliderOnePosition:function(percent){this.sliderOne.element.css({left:percent+"%"})},_setSliderTwoPosition:function(percent){this.sliderTwo.element.css({left:percent+"%"})},_setBlueTrackLeft:function(percent){this.blueTrack.element.css({left:percent+"%"})},_setBlueTrackWidth:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setBlueTrack:function(){var percentOne=this._getPercentByValue(this.labelOne.getValue()),percentTwo=this._getPercentByValue(this.labelTwo.getValue());percentOne<=percentTwo?(this._setBlueTrackLeft(percentOne),this._setBlueTrackWidth(percentTwo-percentOne)):(this._setBlueTrackLeft(percentTwo),this._setBlueTrackWidth(percentOne-percentTwo))},_setAllPosition:function(one,two){this._setSliderOnePosition(one),this._setSliderTwoPosition(two),this._setBlueTrack()},_setVisible:function(visible){this.sliderOne.setVisible(visible),this.sliderTwo.setVisible(visible),this.labelOne.setVisible(visible),this.labelTwo.setVisible(visible)},_setErrorText:function(){var errorText=BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max);this.labelOne.setErrorText(errorText),this.labelTwo.setErrorText(errorText)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var sub=this.calculation.accurateSubtraction(this.max,this.min),mul=this.calculation.accurateMultiplication(sub,percent),div=this.calculation.accurateDivisionTenExponent(mul,2);if(this.precision<0){var value=BI.parseFloat(this.calculation.accurateAddition(div,this.min)),reduceValue=Math.round(this.calculation.accurateDivisionTenExponent(value,-this.precision));return this.calculation.accurateMultiplication(reduceValue,Math.pow(10,-this.precision))}return BI.parseFloat(this.calculation.accurateAddition(div,this.min).toFixed(this.precision))},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setDraggableEnable:function(enable){this.sliderOne.setEnable(enable),this.sliderTwo.setEnable(enable)},_getPrecision:function(){var sub=this.calculation.accurateSubtraction(this.max,this.min),pre=sub.toPrecision(4),eIndex=pre.indexOf("e"),arr=[];if(eIndex>-1){arr=pre.split("e");var decimalPartLength=BI.size(arr[0].split(".")[1]),sciencePartLength=BI.parseInt(arr[1].substring(1));return decimalPartLength-sciencePartLength}return arr=pre.split("."),arr.length>1?arr[1].length:0},_assertValue:function(value){return value<=this.min?this.min:value>=this.max?this.max:value},_setEnable:function(b){BI.IntervalSlider.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(v){var minNumber=BI.parseFloat(v.min),maxNumber=BI.parseFloat(v.max);!isNaN(minNumber)&&!isNaN(maxNumber)&&maxNumber>=minNumber&&(this.min=minNumber,this.max=maxNumber,this.valueOne=minNumber,this.valueTwo=maxNumber,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),maxNumber===minNumber&&this._setDraggableEnable(!1)},setValue:function(v){var o=this.options,valueOne=BI.parseFloat(v.min),valueTwo=BI.parseFloat(v.m
},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData(items)},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSelectTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_select_tree_trigger",BI.MultiLayerSelectTreeTrigger),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=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:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){
width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_plus_group_node",BI.MultiLayerSingleTreePlusGroupNode),BI.MultiLayerSingleTreeFirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.first_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},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.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_first_tree_leaf_item",BI.MultiLayerSingleTreeFirstTreeLeafItem),BI.MultiLayerSingleTreeLastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.last_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o
self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!
baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_search_insert_pane",BI.MultiSelectSearchInsertPane),BI.MultiSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-loader",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=BI.deepClone(opts.value),this.button_group=BI.createWidget({type:"bi.select_list",toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:self.storeValue.value})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:{dynamic:!1},height:24,selected:this.isAllSelected(),cls:"bi-list-item-active",iconWrapperWidth:36})},isAllSelected:function(){return this.button_group.isAllSelected()},_filterValues:function(src){var o=this.options,keyword=o.keywor
keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_no_bar_list",BI.MultiSelectInsertNoBarList),BI.MultiSelectList=BI.inherit(BI.Widget,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyw
BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeListCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self.trigger.stopEditing(),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:[]}),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||[],this.combo.setValue({value:v||[]}),this.numberCounter.setValue({value:v||[]})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeListCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeListCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeListCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeListCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeListCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeListCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_list_combo",BI.MultiTreeListCombo),BI.MultiTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-popup",maxWidth:"auto",minWidth:140,maxHeight:400,onLoaded:BI.emptyFn,el:{type:"bi.async_tree"}})},_init:function(){BI.MultiTreePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,v=opts.value;this.selectedValues={},this.tree=BI.createWidget(opts.el,{type:"bi.async
},setValue:function(v){return this.editor.setValue(v)}}),BI.NumberIntervalSingleEidtor.EVENT_FOCUS="EVENT_FOCUS",BI.NumberIntervalSingleEidtor.EVENT_BLUR="EVENT_BLUR",BI.NumberIntervalSingleEidtor.EVENT_ERROR="EVENT_ERROR",BI.NumberIntervalSingleEidtor.EVENT_VALID="EVENT_VALID",BI.NumberIntervalSingleEidtor.EVENT_CHANGE="EVENT_CHANGE",BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.NumberIntervalSingleEidtor.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.number_interval_single_editor",BI.NumberIntervalSingleEidtor),BI.SearchMultiTextValueCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SearchMultiTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo bi-search-multi-text-value-combo",height:24,items:[]})},_init:function(){BI.SearchMultiTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self._updateAllValue(),self._checkError(),self.trigger.getSearcher().setState(self.storeValue),self.trigger.getCounter().setButtonChecked(self.storeValue)};this.storeValue=BI.deepClone(o.value||{}),this._updateAllValue(),this._assertValue(this.storeValue),this._checkError(),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.search_multi_select_trigger",text:o.text,height:o.height,masker:{offset:{left:0,top:0,right:0,bottom:25}},allValueGetter:function(){return self.allValue},valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){self._itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},value:this.storeValue,warningTitle:o.warningTitle}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self._populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){this.getCounter().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.search_multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:BI.bind(self._itemsCreator,this),valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getCounter().adjustView(),self.
this.expander.setValue([])):(this.trigger.setSelected(!1),this.expander.setValue(v))},getValue:function(){return this.trigger.isSelected()?[this.trigger.getValue()]:this.expander.getValue()},populate:function(items){this.expander.populate(items)}}),BI.shortcut("bi.select_tree_expander",BI.SelectTreeExpander),BI.SelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};node.id=node.id||BI.UUID(),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.select_tree_first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_init:function(){BI.SelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{type:"bi.select_tree_expander",isDefaultInit:!0},items:this._formatItems(BI.Tree.transformToTreeFormat(o.items),0),value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SelectTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(items)))}}),BI.SelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_level_tree",BI.SelectTreePopup),BI.SingleSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-loader",allowNoSelect:!1,itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword||""),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",cls:"bi-list-item-active",logic:{
}}),BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SingleSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SingleSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectTrigger.EVENT_START="EVENT_START",BI.SingleSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SingleSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.SingleSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.single_select_trigger",BI.SingleSelectTrigger),BI.SingleSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value;var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue)};this.adapter=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:o.allowNoSelect,cls:"popup-single-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.SingleSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,value:o.value,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();self.storeValue=keyword,self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue()):(self.adapter.setValue(self.storeValue),assertShowValue())})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:24,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeV
}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE)})},populate:function(items){this.combo.populate(items)},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.SingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.single_tree_combo",BI.SingleTreeCombo),BI.SingleTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_init:function(){BI.SingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{isDefaultInit:!0},items:o.items,value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SingleTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SingleTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(items)}}),BI.SingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_level_tree",BI.SingleTreePopup),BI.SingleTreeTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-trigger",height:24,text:"",items:[],value:""})},_init:function(){BI.SingleTreeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,text:o.text,items:o.items,height:o.height,value:o.value})},_checkTitle:function(){var self=this,val=this.getValue();BI.any(this.options.items,function(i,item){if(BI.contains(val,item.value))return self.trigger.setTitle(item.text||item.value),!0})},setValue:function(v){v=BI.isArray(v)?v:[v],this.options.value=v,this.trigger.setValue(v),this._checkTitle()},getValue:function(){return this.options.value||[]},populate:function(items){BI.SingleTreeTrigger.superclass.populate.apply(this,arguments),this.trigger.populate(items)}}),BI.shortcut("bi.single_tree_trigger",BI.SingleTreeTrigger),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:24,attributes:{tabIndex:0}})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._createValueMap();var value;BI.isNotNull(o.value)&&(value=this._digest(o.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",cls:"text-value-down-list-trigger",height:o.height,items:o.items,text:o.text,value:value}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:o.height,el:this.trigger,value:BI.isNull(value)?[]:[value],items:BI.deepClone(o.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){var currentVal=self.combo.getValue()[0].value;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){var currentVal=self.combo.getValue()[0].childValue;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))})},_createValueMap:function(){var self=this;this.valueMap={},BI.each(BI.flatte
BI.shortcut("bi.dynamic_year_combo",BI.DynamicYearCombo),BI.extend(BI.DynamicYearCombo,{Static:1,Dynamic:2}),BI.DynamicYearPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",textHeight:c.buttonHeight-1,cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Current_Year"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Fen"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear()}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_popup",BI.DynamicYearPopup),BI.DynamicYearTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.DynamicYearTrigger.
props:{baseCls:"bi-static-year-quarter-card",behaviors:{}},_createQuarter:function(){var items=[{text:BI.Date._QN[1],value:1},{text:BI.Date._QN[2],value:2},{text:BI.Date._QN[3],value:3},{text:BI.Date._QN[4],value:4}];return BI.map(items,function(j,item){return BI.extend(item,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:24})})},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.year_picker",ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self.setValue({year:value,quarter:self.selectedQuarter})}}]},{type:"bi.button_group",behaviors:o.behaviors,ref:function(){self.quarter=this},items:this._createQuarter(),layouts:[{type:"bi.vertical",vgap:10}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedQuarter=this.getValue()[0],self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE)}}]}]}},getValue:function(){return{year:this.selectedYear,quarter:this.selectedQuarter}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.quarter=obj.quarter||0,0===newObj.quarter||0===newObj.year||BI.checkDateVoid(newObj.year,newObj.quarter,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedQuarter="",this.yearPicker.setValue(year),this.quarter.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedQuarter=BI.parseInt(newObj.quarter),this.yearPicker.setValue(this.selectedYear),this.quarter.setValue(this.selectedQuarter)}}),BI.StaticYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_quarter_card",BI.StaticYearQuarterCard),BI.DynamicYearQuarterCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-quarter-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,self.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_quarter_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_quarter_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearQuarterPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),quarter:BI.getQuarter(date)}}),sel
var name=values[values.length-1],p=values.slice(0,values.length-1),pNode=this._getNode(selectedValues,p);if(null!=pNode&&pNode[name])for(delete pNode[name];p.length>0&&BI.isEmpty(pNode);)name=p[p.length-1],p=p.slice(0,p.length-1),pNode=this._getNode(selectedValues,p),null!=pNode&&delete pNode[name]},_buildTree:function(jo,values){var t=jo;BI.each(values,function(i,v){BI.has(t,v)||(t[v]={}),t=t[v]})},_isMatch:function(parentValues,value,keyword){var o=this.options,node=this._getTreeNode(parentValues,value);if(!node)return!1;var find=BI.Func.getSearchResult([node.text||node.value],keyword);if(o.allowSearchValue&&node.value){var valueFind=BI.Func.getSearchResult([node.value],keyword);return valueFind.find.length>0||valueFind.match.length>0||find.find.length>0||find.match.length>0}return find.find.length>0||find.match.length>0},_getTreeNode:function(parentValues,v){var self=this,findParentNode,index=0;return this.tree.traverse(function(node){if(!self.tree.isRoot(node))return!(index>parentValues.length)&&(index===parentValues.length&&node.value===v?(findParentNode=node,!1):node.value!==parentValues[index]||void index++)}),findParentNode},_getChildren:function(parentValues){if(parentValues.length>0)var value=BI.last(parentValues),parent=this._getTreeNode(parentValues.slice(0,parentValues.length-1),value);else var parent=this.tree.getRoot();return parent.getChildren()},_getAllChildren:function(parentValues){var children=this._getChildren(parentValues),nodes=[].concat(children);BI.each(nodes,function(idx,node){node.parentValues=parentValues});for(var queue=BI.map(children,function(idx,node){return{parentValues:parentValues,value:node.value}});BI.isNotEmptyArray(queue);){var node=queue.shift(),pValues=node.parentValues.concat(node.value),childNodes=this._getChildren(pValues);BI.each(childNodes,function(idx,node){node.parentValues=pValues}),queue=queue.concat(childNodes),nodes=nodes.concat(childNodes)}return nodes},_getChildCount:function(parentValues){return this._getChildren(parentValues).length}}),BI.AbstractListTreeValueChooser=BI.inherit(BI.AbstractTreeValueChooser,{_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){BI.each(selected,function(idx,path){BI.each(path,function(id,value){var nodeValue=value,node=self._getTreeNode(path.slice(0,id),nodeValue);BI.isNull(node)?createOneJson({id:BI.UUID(),text:nodeValue,value:nodeValue,isLeaf:!0},BI.UUID()):(BI.has(result,node.id)||createOneJson(node,node.parent&&node.parent.id),result[node.id].isLeaf!==!0&&(result[node.id].isLeaf=id===path.length-1))})})}function createOneJson(node,pId){result[node.id]={id:node.id,pId:pId,text:node.text,value:node.value,open:!0,isLeaf:node.isLeaf}}var self=this,result={},selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:BI.values(result)}))},_reqInitTreeNode:function(op,callback){function search(){var children=self._getChildren([]),start=children.length;if(""!==lastSearchValue){for(var j=0,len=start;j<len;j++)if(children[j].value===lastSearchValue){start=j+1;break}}else start=0;for(var output=[],i=start,len=children.length;i<len;i++){if(output.length<self._const.perPage)var find=nodeSearch(1,[],children[i].value,result);else if(output.length===self._const.perPage)var find=nodeSearch(1,[],children[i].value,[]);if(find[0]===!0&&output.push(children[i].value),output.length>self._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,result){if(self._isMatch(parentValues,current,keyword)){var checked=isSelected(current);return createOneJson(parentValues,current,!1,checked,!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1;return BI.eac
p.__cacheStore||p.store):void 0}function createStore(){var needPop=!1;if(_global.Fix&&this._store){var store=findStore(this.options.context||this.options.element);store&&(pushTarget(store),needPop=!0),this.store=this._store(),this.store&&(this.store._widget=this),needPop&&popTarget(),needPop=!1,pushTarget(this.store),this.store instanceof Fix.Model?this.model=this.store.model:this.model=this.store,needPop=!0}return needPop}var target=null,targetStack=[],context=null,contextStack=[],oldWatch=Fix.watch;Fix.watch=function(model,expOrFn,cb,options){return BI.isPlainObject(cb)&&(options=cb,cb=cb.handler),"string"==typeof cb&&(cb=model[cb]),oldWatch.call(this,model,expOrFn,function(){options&&options.store&&pushTarget(options.store);var res=cb.apply(this,arguments);return options&&options.store&&popTarget(),res},options)};var _create=BI.createWidget;BI.createWidget=function(item,options,context){var pushed=!1;BI.isWidget(options)?(pushContext(options),pushed=!0):null!=context&&(pushContext(context),pushed=!0);var result=_create.apply(this,arguments);return pushed&&popContext(),result},_.each(["populate","addItems","prependItems"],function(name){var old=BI.Loader.prototype[name];BI.Loader.prototype[name]=function(){pushContext(this);var result=old.apply(this,arguments);return popContext(),result}}),BI.Widget.prototype._initRender=function(){this.beforeInit?(this.__asking=!0,this.beforeInit(BI.bind(function(){this.model&&this.model.$vm&&this.model.$vm.$digest(),this._render()},this)),this.__asking===!0&&(this.__async=!0)):this._render()};var _init=BI.Widget.prototype._init;BI.Widget.prototype._init=function(){var self=this,needPop=createStore.call(this);_init.apply(this,arguments),needPop&&popTarget()};var _render=BI.Widget.prototype._render;BI.Widget.prototype._render=function(){var needPop=!1;_global.Fix&&this._store&&(needPop=!0,pushTarget(this.store),initWatch(this,this.watch)),_render.apply(this,arguments),needPop&&popTarget()};var unMount=BI.Widget.prototype.__d;BI.Widget.prototype.__d=function(){unMount.apply(this,arguments),this.store&&BI.isFunction(this.store.destroy)&&this.store.destroy(),BI.each(this._watchers,function(i,unwatches){unwatches=BI.isArray(unwatches)?unwatches:[unwatches],BI.each(unwatches,function(j,unwatch){unwatch()})}),this._watchers&&(this._watchers=[]),this.store&&(this.store._parent&&(this.store._parent=null),this.store._widget&&(this.store._widget=null),this.store=null),delete this.__cacheStore},_.each(["_mount"],function(name){var old=BI.Widget.prototype[name];old&&(BI.Widget.prototype[name]=function(){this.store&&pushTarget(this.store);try{var res=old.apply(this,arguments)}catch(e){console.error(e)}return this.store&&popTarget(),res})});var additionFunc=function(){BI.nextTick(function(){Fix&&Fix.refreshAll&&Fix.refreshAll()})};if($(document).ajaxComplete(additionFunc),BI.history){var navigate=BI.history.navigate;BI.history.navigate=function(){navigate.apply(this,arguments),BI.defer(function(){additionFunc()},200)};var back=window.history.back;window.history.back=function(){back.apply(this,arguments),BI.defer(function(){additionFunc()},200)}}if(BI.Router){var execute=BI.Router.prototype.execute;BI.Router.prototype.execute=function(){execute.apply(this,arguments),additionFunc()}}_.each(["each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition","keys","allKeys","values","pairs","invert","mapObject","findKey","pick","omit","tap"],function(name){var old=BI[name];BI[name]=function(obj,fn,context){return"function"==typeof fn?old(obj,function(key,value){if(!(key in Fix.$$skipArray))return fn.apply(this,arguments)},context):old.apply(this,arguments)}}),BI.isEmpty=function(ob){return BI.isPlainObject(ob)&&ob.__ob__?0===BI.keys(ob).length:_.isEmpty(ob)},BI.keys=function(ob){for(var keys=_.keys(ob),nKeys=[],i=0;i<keys.length;i++)keys[i]in Fix.$$skipArray||nKeys.push(keys[i]);return nKeys},BI.values=function(ob){for(var keys=BI.keys(obj),length=keys.length,values=[],i=0;i<length;i++)values[i]=obj[keys[i]];return val
!function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=141)}({141:function(e,t,r){e.exports=r(142)},142:function(e,t,r){"use strict";var n=function o(e){return e&&e.__esModule?e:{"default":e}}(r(143));BI.extend(BI,n["default"])},143:function(e,t,r){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=void 0;var n={Decorators:function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{"default":e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var u=n?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(r,o,u):r[o]=e[o]}r["default"]=e,t&&t.set(e,r);return r}(r(144))};t["default"]=n},144:function(e,t,r){"use strict";function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){e.prototype=Object.create(t.prototype),function i(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],u=Object.getOwnPropertyDescriptor(t,o);u&&u.configurable&&e[o]===undefined&&Object.defineProperty(e,o,u)}return e}(e.prototype.constructor=e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.shortcut=function o(){return function(e){BI.shortcut(e.xtype,e)}},t.model=function f(){return function(e){BI.model(e.xtype,e)}},t.store=function l(r){var n=1<arguments.length&&arguments[1]!==undefined?arguments[1]:{};return function(e){return function(e){function t(){return e.apply(this,arguments)||this}return c(t,e),t.prototype._store=function(){var e=n.props?n.props.apply(this):undefined;return BI.Models.getModel(r.xtype,e)},t}(e)}},t.Model=void 0;var n=function(o){function e(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return i(u(e=o.call.apply(o,[this].concat(r))||this),"model",void 0),i(u(e),"store",void 0),i(u(e),"context",void 0),i(u(e),"actions",void 0),i(u(e),"childContext",void 0),i(u(e),"TYPE",void 0),i(u(e),"computed",void 0),e}return c(e,o),e.prototype.state=function(){return{}},e}(Fix.Model);t.Model=n}});