X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-bootstrap.js;h=9316e297ec367d2e4d1404b8f24d720278f9c4e1;hp=f736c07bdcdc5722b8f06d44764e974202033854;hb=0b69a11b1055a6d3a3fd0719bdd58b5a235de0e4;hpb=d05a7956f82d8538e1505a765e1e112b520ea7a6 diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index f736c07bdc..9316e297ec 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1,5 +1,5 @@ // Roo/bootstrap/version.js -Roo.bootstrap.version=(function(){var A=3;Roo.each(document.styleSheets[0],function(s){if(s.href.match(/css-bootstrap4/)){A=4;}});return A;})(); +Roo.bootstrap.version=(function(){var A=3;Roo.each(document.styleSheets,function(s){if(s.href&&s.href.match(/css-bootstrap4/)){A=4;}});return A;})(); // Roo/bootstrap/Component.js Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){Roo.bootstrap.Component.superclass.constructor.call(this,A);this.addEvents({"childrenrendered":true});};Roo.extend(Roo.bootstrap.Component,Roo.BoxComponent,{allowDomMove:false,cls:false,style:false,autoCreate:false,tooltip:null,initEvents:function(){} ,xattr:false,parentId:false,can_build_overlaid:true,container_method:false,dataId:false,name:false,parent:function(){return Roo.ComponentMgr.get(this.parentId)},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(this.el){if(this.el.attr('xtype')){this.el.attr('xtypex',this.el.attr('xtype')); @@ -13,8 +13,8 @@ var D=(typeof(A['flexy:if'])!='undefined')||(typeof(A['flexy:foreach'])!='undefi var G=F?F.child('>*[xtype]'):false;if(G){}if(G&&G.attr('xtype').split('.').pop()==cn.xtype){cn.el=G;}else{Roo.debug&&Roo.log("MISSING "+cn.xtype+" on child of "+(this.el?this.el.attr('xbuilderid'):'no parent'));Roo.debug&&Roo.log(F);Roo.debug&&Roo.log(G); Roo.debug&&Roo.log(cn);}}if(E&&D&&!cn.el&&cn.can_build_overlaid){Roo.debug&&Roo.log('skipping render');Roo.debug&&Roo.log(A);if(!cn.el){Roo.debug&&Roo.log('skipping all children');skip_children=true;}}else{cn.render&&cn.render(this[B](true));}}var H=[];if(!A.items||!A.items.length){cn.items=H; return cn;}var I=A.items;delete A.items;if(!skip_children){for(var i=0;i-1){A.cls+=' alert alert-'+this.alert;}if(this.html.length){A.html=this.html;}if(this.fa){var C='';if(this.fasize>1){C=' fa-'+this.fasize+'x'; -}A.html=''+(A.html||'');}if(this.icon){A.html=''+(A.html||'');}return A;}}); +,Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;['xs','sm','md','lg'].map(function(D){if(B[D+'off']!==false){A.cls+=' col-'+D+'-offset-'+B[D+'off'];}if(B[D]===false){return;}if(!B[D]){A.cls+=' hidden-'+D+' hidden'+D+'-down'; +;return;}A.cls+=' col-'+D+'-'+B[D]+(D=='xs'?(' col-'+B[D]):'');});if(this.hidden){A.cls+=' hidden';}if(this.alert&&["success","info","warning","danger"].indexOf(this.alert)>-1){A.cls+=' alert alert-'+this.alert;}if(this.html.length){A.html=this.html;}if(this.fa){var C=''; +if(this.fasize>1){C=' fa-'+this.fasize+'x';}A.html=''+(A.html||'');}if(this.icon){A.html=''+(A.html||'');}return A;}}); // Roo/bootstrap/Container.js Roo.bootstrap.Container=function(A){Roo.bootstrap.Container.superclass.constructor.call(this,A);this.addEvents({"expand":true,"collapse":true,"click":true});};Roo.extend(Roo.bootstrap.Container,Roo.bootstrap.Component,{jumbotron:false,well:'',panel:'',header:'',footer:'',sticky:'',tag:false,alert:false,fa:false,icon:false,expandable:false,rheader:'',expanded:true,clickable:false,getChildContainer:function(){if(!this.el){return false; }if(this.panel.length){return this.el.select('.panel-body',true).first();}return this.el;},getAutoCreate:function(){var A={tag:this.tag||'div',html:'',cls:''};if(this.jumbotron){A.cls='jumbotron';}if(this.sticky.length){var bd=Roo.get(document.body);if(!bd.hasClass('bootstrap-sticky')){bd.addClass('bootstrap-sticky'); @@ -91,18 +91,18 @@ this.triggerEl.on(Roo.isTouch?'touchstart':'mouseup',this.onTriggerPress,this);i }this.el.on('click',this.onClick,this);this.el.on("mouseover",this.onMouseOver,this);this.el.on("mouseout",this.onMouseOut,this);},findTargetItem:function(e){var t=e.getTarget(".dropdown-menu-item",this.el,true);if(!t){return false;}if(t&&t.id){return this.menuitems.get(t.id); }return false;},onTouch:function(e){Roo.log("menu.onTouch");this.onClick(e);},onClick:function(e){Roo.log("menu.onClick");var t=this.findTargetItem(e);if(!t||t.isContainer){return;}Roo.log(e);Roo.log('pass click event');t.onClick(e);this.fireEvent("click",this,t,e); var A=this;if(!t.href.length||t.href=='#'){(function(){A.hide();}).defer(100);}},onMouseOver:function(e){var t=this.findTargetItem(e);this.fireEvent("mouseover",this,e,t);},isVisible:function(){return !this.hidden;},onMouseOut:function(e){var t=this.findTargetItem(e); -this.fireEvent("mouseout",this,e,t);},show:function(el,A,B){this.parentMenu=B;if(!this.el){this.render();}this.fireEvent("beforeshow",this);this.showAt(this.el.getAlignToXY(el,A||this.defaultAlign),B,false);},showAt:function(xy,A,_e){this.parentMenu=A;if(!this.el){this.render(); -}if(_e!==false){this.fireEvent("beforeshow",this);}this.hideMenuItems();this.hidden=false;this.triggerEl.addClass('open');this.el.addClass('show');if(this.el.getWidth()+xy[0]>=Roo.lib.Dom.getViewWidth()){xy[0]=xy[0]-this.el.getWidth()+this.triggerEl.getWidth(); +this.fireEvent("mouseout",this,e,t);},show:function(el,A,B){if(false===this.fireEvent("beforeshow",this)){Roo.log("show canceled");return;}this.parentMenu=B;if(!this.el){this.render();}this.showAt(this.el.getAlignToXY(el,A||this.defaultAlign),B,false);},showAt:function(xy,A,_e){this.parentMenu=A; +if(!this.el){this.render();}if(_e!==false){this.fireEvent("beforeshow",this);}this.hideMenuItems();this.hidden=false;this.triggerEl.addClass('open');this.el.addClass('show');if(this.el.getWidth()+xy[0]>=Roo.lib.Dom.getViewWidth()){xy[0]=xy[0]-this.el.getWidth()+this.triggerEl.getWidth(); }if(this.el.getHeight()+xy[1]>=Roo.lib.Dom.getViewHeight()){xy[1]=xy[1]-this.el.getHeight()-this.triggerEl.getHeight();}if(this.el.getStyle('top')!='auto'&&this.el.getStyle('top').slice(-1)!="%"){this.el.setXY(xy);}this.focus();this.fireEvent("show",this); -},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus();}},hide:function(A){this.hideMenuItems();if(this.el&&this.isVisible()){this.fireEvent("beforehide",this);if(this.activeItem){this.activeItem.deactivate(); +},focus:function(){return;if(!this.hidden){this.doFocus.defer(50,this);}},doFocus:function(){if(!this.hidden){this.focusEl.focus();}},hide:function(A){if(false===this.fireEvent("beforehide",this)){Roo.log("hide canceled");return;}this.hideMenuItems();if(this.el&&this.isVisible()){if(this.activeItem){this.activeItem.deactivate(); this.activeItem=null;}this.triggerEl.removeClass('open');;this.el.removeClass('show');this.hidden=true;this.fireEvent("hide",this);}if(A===true&&this.parentMenu){this.parentMenu.hide(true);}},onTriggerClick:function(e){Roo.log('trigger click');var A=e.getTarget(); Roo.log(A.nodeName.toLowerCase());if(A.nodeName.toLowerCase()==='i'){e.preventDefault();}},onTriggerPress:function(e){Roo.log('trigger press');var A=Roo.get(e.getTarget());if(A.findParent('.dropdown-menu')||A.findParent('.treeview-menu')){Roo.log('is treeview or dropdown?'); -return;}if(e.getTarget().nodeName.toLowerCase()!=='i'&&this.isLink){return;}if(this.isVisible()){Roo.log('hide');this.hide();}else{Roo.log('show');this.show(this.triggerEl,false,false);}if(this.stopEvent||e.getTarget().nodeName.toLowerCase()==='i'){e.stopEvent(); +return;}if(e.getTarget().nodeName.toLowerCase()!=='i'&&this.isLink){return;}if(this.isVisible()){Roo.log('hide');this.hide();}else{Roo.log('show');this.show(this.triggerEl,'?',false);}if(this.stopEvent||e.getTarget().nodeName.toLowerCase()==='i'){e.stopEvent(); }},hideMenuItems:function(){Roo.log("hide Menu Items");if(!this.el){return;}this.el.select('.open',true).each(function(aa){aa.removeClass('open');});},addxtypeChild:function(A,B){var C=Roo.bootstrap.Menu.superclass.addxtypeChild.call(this,A,B);this.menuitems.add(C); return C;},getEl:function(){Roo.log(this.el);return this.el;},clear:function(){this.getEl().dom.innerHTML='';this.menuitems.clear();}}); // Roo/bootstrap/MenuItem.js -Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.MenuItem,Roo.bootstrap.Component,{href:false,html:false,preventDefault:false,isContainer:false,active:false,fa:false,getAutoCreate:function(){if(this.isContainer){return {tag:'li',cls:'dropdown-menu-item dropdown-item'} -;}var A={tag:'span',html:'Link'};var B={tag:'a',href:'#',cn:[]};if(this.fa!==false){B.cn.push({tag:'i',cls:'fa fa-'+this.fa});}B.cn.push(A);var C={tag:'li',cls:'dropdown-menu-item dropdown-item',cn:[B]};if(this.parent().type=='treeview'){C.cls='treeview-menu'; +Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.MenuItem,Roo.bootstrap.Component,{href:false,html:false,preventDefault:false,isContainer:false,active:false,fa:false,getAutoCreate:function(){if(this.isContainer){return {tag:'li',cls:'dropdown-menu-item '} +;}var A={tag:'span',html:'Link'};var B={tag:'a',cls:'dropdown-item',href:'#',cn:[]};if(this.fa!==false){B.cn.push({tag:'i',cls:'fa fa-'+this.fa});}B.cn.push(A);var C={tag:'li',cls:'dropdown-menu-item',cn:[B]};if(this.parent().type=='treeview'){C.cls='treeview-menu'; }if(this.active){C.cls+=' active';}B.href=this.href||C.cn[0].href;A.html=this.html||C.cn[0].html;return C;},initEvents:function(){if(this.parent().type=='treeview'){this.el.select('a').on('click',this.onClick,this);}if(this.menu){this.menu.parentType=this.xtype; this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}},onClick:function(e){Roo.log('item on click ');if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);},getEl:function(){return this.el;}}); // Roo/bootstrap/MenuSeparator.js @@ -112,27 +112,28 @@ Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call( if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex); }this.dialogEl=this.el.select('.modal-dialog',true).first();this.bodyEl=this.el.select('.modal-body',true).first();this.closeEl=this.el.select('.modal-header .close',true).first();this.headerEl=this.el.select('.modal-header',true).first();this.titleEl=this.el.select('.modal-title',true).first(); this.footerEl=this.el.select('.modal-footer',true).first();this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);if(this.buttons.length){Roo.each(this.buttons,function(bb){var b=Roo.apply({},bb);b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button'; -if(typeof(b.listeners)=='undefined'){b.listeners={click:this.onButtonClick.createDelegate(this)};}var E=Roo.factory(b);E.render(this.el.select('.modal-footer div').first());},this);}var C=[];if(typeof(this.items)!='undefined'){var D=this.items;delete this.items; -for(var i=0;i
'+''+'
 
'} @@ -143,55 +144,61 @@ E.dom.style.overflowY='auto'+(Roo.isIE?'':' !important');}else{E.dom.style.heigh }return this;},updateProgress:function(Q,R){if(R){this.updateText(R);}if(pp){pp.setWidth(Math.floor(Q*I.dom.firstChild.offsetWidth));pp.setHeight(Math.floor(I.dom.firstChild.offsetHeight));}return this;},isVisible:function(){return A&&A.isVisible();},hide:function(){if(this.isVisible()){A.hide(); }},show:function(Q){if(this.isVisible()){this.hide();Roo.log("[Roo.Messagebox] Show called while message displayed:");Roo.log("Old Dialog Message:"+F.innerHTML);Roo.log("New Dialog Message:"+Q.msg)}var d=this.getDialog();B=Q;d.setTitle(B.title||" "); d.closeEl.setDisplayed(B.closable!==false);K=G;B.prompt=B.prompt||(B.multiline?true:false);if(B.prompt){if(B.multiline){G.hide();H.show();H.setHeight(typeof B.multiline=="number"?B.multiline:this.defaultTextHeight);K=H;}else{G.show();H.hide();}}else{G.hide(); -H.hide();}I.setDisplayed(B.progress===true);this.updateProgress(0);K.dom.value=B.value||"";if(B.prompt){A.setDefaultButton(K);}else{var bs=B.buttons;var db=null;if(bs&&bs.ok){db=J["ok"];}else if(bs&&bs.yes){db=J["yes"];}A.setDefaultButton(db);}L=O(B.buttons); -this.updateText(B.msg);if(B.cls){d.el.addClass(B.cls);}d.proxyDrag=B.proxyDrag===true;d.modal=B.modal!==false;d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el.dom);d.animateTarget=null;d.show(Q.animEl);}return this;},progress:function(Q,R){this.show({title:Q,msg:R,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,modal:true} -);return this;},alert:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.OK,fn:fn,closable:false,scope:S,modal:true});return this;},wait:function(Q,R){this.show({title:R,msg:Q,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true} -);D=Roo.TaskMgr.start({run:function(i){Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);},interval:1000});return this;},confirm:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.YESNO,fn:fn,scope:S,modal:true});return this;},prompt:function(Q,R,fn,S,T){this.show({title:Q,msg:R,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:S,prompt:true,multiline:T,modal:true} -);return this;},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}(); -Roo.MessageBox=Roo.MessageBox||Roo.bootstrap.MessageBox;Roo.Msg=Roo.Msg||Roo.MessageBox; +H.hide();}I.setDisplayed(B.progress===true);if(B.progress){d.animate=false;}this.updateProgress(0);K.dom.value=B.value||"";if(B.prompt){A.setDefaultButton(K);}else{var bs=B.buttons;var db=null;if(bs&&bs.ok){db=J["ok"];}else if(bs&&bs.yes){db=J["yes"];}A.setDefaultButton(db); +}L=O(B.buttons);this.updateText(B.msg);if(B.cls){d.el.addClass(B.cls);}d.proxyDrag=B.proxyDrag===true;d.modal=B.modal!==false;d.mask=B.modal!==false?C:false;if(!d.isVisible()){document.body.appendChild(A.el.dom);d.animateTarget=null;d.show(Q.animEl);}return this; +},progress:function(Q,R){this.show({title:Q,msg:R,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,modal:true});return this;},alert:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.OK,fn:fn,closable:false,scope:S,modal:true} +);return this;},wait:function(Q,R){this.show({title:R,msg:Q,buttons:false,closable:false,progress:true,modal:true,width:300,wait:true});D=Roo.TaskMgr.start({run:function(i){Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);},interval:1000});return this; +},confirm:function(Q,R,fn,S){this.show({title:Q,msg:R,buttons:this.YESNO,fn:fn,scope:S,modal:true});return this;},prompt:function(Q,R,fn,S,T){this.show({title:Q,msg:R,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:S,prompt:true,multiline:T,modal:true});return this; +},OK:{ok:true},YESNO:{yes:true,no:true},OKCANCEL:{ok:true,cancel:true},YESNOCANCEL:{yes:true,no:true,cancel:true},defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}};}();Roo.MessageBox=Roo.MessageBox||Roo.bootstrap.MessageBox; +Roo.Msg=Roo.Msg||Roo.MessageBox; // Roo/bootstrap/Navbar.js Roo.bootstrap.Navbar=function(A){Roo.bootstrap.Navbar.superclass.constructor.call(this,A);this.addEvents({"beforetoggle":true});};Roo.extend(Roo.bootstrap.Navbar,Roo.bootstrap.Component,{navItems:false,loadMask:false,getAutoCreate:function(){throw {message:"nav bar is now a abstract base class - use NavSimplebar / NavHeaderbar / NavSidebar etc..."} -;},initEvents:function(){this.el.select('.navbar-toggle',true).on('click',function(){if(this.fireEvent('beforetoggle',this)!==false){var ce=this.el.select('.navbar-collapse',true).first();ce.toggleClass('in');if(ce.hasClass('collapse')){ce.removeClass('collapse'); -ce.addClass('show');var h=ce.getHeight();Roo.log(h);ce.removeClass('show');ce.addClass('collapsing');ce.setHeight(0);(function(){Roo.log('done transition');ce.removeClass('collapsing');ce.addClass('show');ce.removeClass('collapse');ce.dom.style.height=''; -}).defer(500);ce.setHeight(h);}else{ce.addClass('collapsing');ce.removeClass('show');(function(){ce.removeClass('collapsing');ce.addClass('collapse');}).defer(200);}}},this);var A={tag:"div",cls:"x-dlg-mask"};this.maskEl=Roo.DomHelper.append(this.el,A,true); -var B=this.el.getSize();this.maskEl.setSize(B.width,B.height);this.maskEl.enableDisplayMode("block");this.maskEl.hide();if(this.loadMask){this.maskEl.show();}},getChildContainer:function(){if(this.el.select('.collapse').getCount()){return this.el.select('.collapse',true).first(); -}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide();}}); +;},initEvents:function(){this.el.select('.navbar-toggle',true).on('click',this.onToggle,this);var A={tag:"div",cls:"x-dlg-mask"};this.maskEl=Roo.DomHelper.append(this.el,A,true);var B=this.el.getSize();this.maskEl.setSize(B.width,B.height);this.maskEl.enableDisplayMode("block"); +this.maskEl.hide();if(this.loadMask){this.maskEl.show();}},getChildContainer:function(){if(this.el&&this.el.select('.collapse').getCount()){return this.el.select('.collapse',true).first();}return this.el;},mask:function(){this.maskEl.show();},unmask:function(){this.maskEl.hide(); +},onToggle:function(){if(this.fireEvent('beforetoggle',this)===false){return;}var ce=this.el.select('.navbar-collapse',true).first();if(!ce.hasClass('show')){this.expand();}else{this.collapse();}},expand:function(){var ce=this.el.select('.navbar-collapse',true).first(); +if(ce.hasClass('collapsing')){return;}ce.dom.style.height='';ce.addClass('in');ce.removeClass('collapse');ce.addClass('show');var h=ce.getHeight();Roo.log(h);ce.removeClass('show');ce.addClass('collapsing');ce.setHeight(0);ce.on('transitionend',function(){ce.removeClass('collapsing'); +ce.addClass('show');ce.removeClass('collapse');ce.dom.style.height='';},this,{single:true});ce.setHeight(h);ce.dom.scrollTop=0;},collapse:function(){var ce=this.el.select('.navbar-collapse',true).first();if(ce.hasClass('collapsing')||ce.hasClass('collapse')){return; +}ce.removeClass('in');ce.setHeight(ce.getHeight());ce.removeClass('show');ce.addClass('collapsing');ce.on('transitionend',function(){ce.dom.style.height='';ce.removeClass('collapsing');ce.addClass('collapse');},this,{single:true});ce.setHeight(0);}}); // Roo/bootstrap/NavSimplebar.js -Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSimplebar,Roo.bootstrap.Navbar,{inverse:false,type:false,arrangement:'',align:false,weight:'light',main:false,tag:false,getAutoCreate:function(){var A={tag:this.tag||'div',cls:'navbar navbar-expand-lg'} -;if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;A.cn=[{cls:'nav',tag:'ul'}];this.type=this.type||'nav';if(['tabs','pills'].indexOf(this.type)!==-1){A.cn[0].cls+=' nav-'+this.type} -else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!==-1){A.cn[0].cls+=' nav-'+this.arrangement;}if(this.align==='right'){A.cn[0].cls+=' navbar-right';}if(this.inverse){A.cls+=' navbar-inverse'; -}return A;}}); +Roo.bootstrap.NavSimplebar=function(A){Roo.bootstrap.NavSimplebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSimplebar,Roo.bootstrap.Navbar,{inverse:false,type:false,arrangement:'',align:false,weight:'light',main:false,tag:false,getAutoCreate:function(){var A={tag:this.tag||'div',cls:'navbar roo-navbar-simple'} +;if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(this.inverse){A.cls+=' navbar-inverse';}if(Roo.bootstrap.version==4&&this.xtype=='NavSimplebar'){return A; +}A.cn=[{cls:'nav nav-'+this.xtype,tag:'ul'}];this.type=this.type||'nav';if(['tabs','pills'].indexOf(this.type)!=-1){A.cn[0].cls+=' nav-'+this.type}else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cn[0].cls+=' navbar-nav'}if(['stacked','justified'].indexOf(this.arrangement)!=-1){A.cn[0].cls+=' nav-'+this.arrangement; +}if(this.align==='right'){A.cn[0].cls+=' navbar-right';}return A;}}); // Roo/bootstrap/NavHeaderbar.js Roo.bootstrap.NavHeaderbar=function(A){Roo.bootstrap.NavHeaderbar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavHeaderbar,Roo.bootstrap.NavSimplebar,{position:'',brand:'',brand_href:false,srButton:true,autohide:false,desktopCenter:false,getAutoCreate:function(){var A={tag:this.nav||'nav',cls:'navbar navbar-expand-md',role:'navigation',cn:[]} ;var cn=A.cn;if(this.desktopCenter){cn.push({cls:'container',cn:[]});cn=cn[0].cn;}if(this.srButton){var B={tag:'button',type:'button',cls:'navbar-toggle navbar-toggler','data-toggle':'collapse',cn:[{tag:'span',cls:'sr-only',html:'Toggle navigation'},{tag:'span',cls:'icon-bar navbar-toggler-icon'} -,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:'collapse navbar-collapse',cn:[]});A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default'; -if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position;A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]} -);}if(this.main){A.cls+=' main-nav';}return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this); +,{tag:'span',cls:'icon-bar'},{tag:'span',cls:'icon-bar'}]};cn.push(Roo.bootstrap.version==4?B:{tag:'div',cls:'navbar-header',cn:[B]});}cn.push({tag:'div',cls:Roo.bootstrap.version==4?'nav flex-row roo-navbar-collapse':'collapse navbar-collapse roo-navbar-collapse',cn:[]} +);A.cls+=this.inverse?' navbar-inverse navbar-dark bg-dark':' navbar-default';if(['light','white'].indexOf(this.weight)>-1){A.cls+=['light','white'].indexOf(this.weight)>-1?' navbar-light':' navbar-dark';}A.cls+=' bg-'+this.weight;if(['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1){A.cls+=' navbar-'+this.position+' '+this.position; +A.tag=this.tag||(this.position=='fixed-bottom'?'footer':'header');}if(this.brand!==''){var cp=Roo.bootstrap.version==4?cn:cn[0].cn;cp.unshift({tag:'a',href:this.brand_href?this.brand_href:'#',cls:'navbar-brand',cn:[this.brand]});}if(this.main){A.cls+=' main-nav'; +}return A;},getHeaderChildContainer:function(){if(this.srButton&&this.el.select('.navbar-header').getCount()){return this.el.select('.navbar-header',true).first();}return this.getChildContainer();},initEvents:function(){Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this); if(this.autohide){var A=0;var ft=this.el;Roo.get(document).on('scroll',function(e){var ns=Roo.get(document).getScroll().top;var os=A;A=ns;if(ns>os){ft.removeClass('slideDown');ft.addClass('slideUp');return;}ft.removeClass('slideUp');ft.addClass('slideDown'); },this);}}}); // Roo/bootstrap/NavSidebar.js Roo.bootstrap.NavSidebar=function(A){Roo.bootstrap.NavSidebar.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.NavSidebar,Roo.bootstrap.Navbar,{sidebar:true,getAutoCreate:function(){return {tag:'div',cls:'sidebar sidebar-nav'};}}); // Roo/bootstrap/NavGroup.js Roo.bootstrap.NavGroup=function(A){Roo.bootstrap.NavGroup.superclass.constructor.call(this,A);this.navItems=[];Roo.bootstrap.NavGroup.register(this);this.addEvents({'changed':true});};Roo.extend(Roo.bootstrap.NavGroup,Roo.bootstrap.Component,{align:'',inverse:false,form:false,type:'nav',navId:'',navItems:false,getAutoCreate:function(){var A=Roo.apply({} -,Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(['tabs','pills'].indexOf(this.type)!==-1){A.cls+=' nav-'+this.type}else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cls+=' navbar-nav'}if(this.parent()&&this.parent().sidebar){A={tag:'ul',cls:'dashboard-menu sidebar-menu'} -;return A;}if(this.form===true){A={tag:'form',cls:'navbar-form'};if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' mr-auto';}if(this.inverse){A.cls+=' navbar-inverse'; +,Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));A={tag:'ul',cls:'nav'};if(Roo.bootstrap.version==4){if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type;}else{if(this.parent()&&this.parent().xtype!='NavHeaderbar'){A.cls+=' navbar-nav'; +}}}else{if(['tabs','pills'].indexOf(this.type)!=-1){A.cls+=' nav-'+this.type}else{if(this.type!=='nav'){Roo.log('nav type must be nav/tabs/pills')}A.cls+=' navbar-nav'}}if(this.parent()&&this.parent().sidebar){A={tag:'ul',cls:'dashboard-menu sidebar-menu'} +;return A;}if(this.form===true){A={tag:'form',cls:'navbar-form form-inline'};if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' navbar-left';}}if(this.align==='right'){A.cls+=' navbar-right ml-md-auto';}else{A.cls+=' mr-auto';}if(this.inverse){A.cls+=' navbar-inverse'; }return A;},setActiveItem:function(A){var B=false;Roo.each(this.navItems,function(v){if(v==A){return;}if(v.isActive()){v.setActive(false,true);B=v;}});A.setActive(true,true);this.fireEvent('changed',this,A,B);},getActive:function(){var A=false;Roo.each(this.navItems,function(v){if(v.isActive()){A=v; -}});return A;},indexOfNav:function(){var A=false;Roo.each(this.navItems,function(v,i){if(v.isActive()){A=i;}});return A;},addItem:function(A){var cn=new Roo.bootstrap.NavItem(A);this.register(cn);cn.parentId=this.id;cn.onRender(this.el,null);return cn;},register:function(A){this.navItems.push(A); -A.navId=this.navId;},clearAll:function(){this.navItems=[];this.el.dom.innerHTML='';},getNavItem:function(A){var B=false;Roo.each(this.navItems,function(e){if(e.tabId==A){B=e;return false;}return true;});return B;},setActiveNext:function(){var i=this.indexOfNav(this.getActive()); -if(i>this.navItems.length){return;}this.setActiveItem(this.navItems[i+1]);},setActivePrev:function(){var i=this.indexOfNav(this.getActive());if(i<1){return;}this.setActiveItem(this.navItems[i-1]);},clearWasActive:function(A){Roo.each(this.navItems,function(e){if(e.tabId!=A.tabId&&e.was_active){e.was_active=false; -return false;}return true;});},getWasActive:function(){var r=false;Roo.each(this.navItems,function(e){if(e.was_active){r=e;return false;}return true;});return r;}});Roo.apply(Roo.bootstrap.NavGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false; -}return this.groups[A];}}); +}});return A;},indexOfNav:function(){var A=false;Roo.each(this.navItems,function(v,i){if(v.isActive()){A=i;}});return A;},addItem:function(A){if(this.form&&Roo.bootstrap.version==4){A.tag='div';}var cn=new Roo.bootstrap.NavItem(A);this.register(cn);cn.parentId=this.id; +cn.onRender(this.el,null);return cn;},register:function(A){this.navItems.push(A);A.navId=this.navId;},clearAll:function(){this.navItems=[];this.el.dom.innerHTML='';},getNavItem:function(A){var B=false;Roo.each(this.navItems,function(e){if(e.tabId==A){B=e; +return false;}return true;});return B;},setActiveNext:function(){var i=this.indexOfNav(this.getActive());if(i>this.navItems.length){return;}this.setActiveItem(this.navItems[i+1]);},setActivePrev:function(){var i=this.indexOfNav(this.getActive());if(i<1){return; +}this.setActiveItem(this.navItems[i-1]);},clearWasActive:function(A){Roo.each(this.navItems,function(e){if(e.tabId!=A.tabId&&e.was_active){e.was_active=false;return false;}return true;});},getWasActive:function(){var r=false;Roo.each(this.navItems,function(e){if(e.was_active){r=e; +return false;}return true;});return r;}});Roo.apply(Roo.bootstrap.NavGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}}); // Roo/bootstrap/NavItem.js -Roo.bootstrap.NavItem=function(A){Roo.bootstrap.NavItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true,'scrollto':true});};Roo.extend(Roo.bootstrap.NavItem,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,fa:false,glyphicon:false,active:false,preventDefault:false,tabId:false,tagtype:'a',disabled:false,animateRef:false,was_active:false,getAutoCreate:function(){var A={tag:'li',cls:'nav-item'} -;if(this.active){A.cls=typeof(A.cls)=='undefined'?'active':A.cls+' active';}if(this.disabled){A.cls+=' disabled';}if(this.href||this.html||this.glyphicon||this.icon||this.fa){A.cn=[{tag:this.tagtype,href:this.href||"#",html:this.html||''}];if(this.tagtype=='a'){A.cn[0].cls='nav-link'; -}if(this.icon){A.cn[0].html=' '+A.cn[0].html+''}if(this.fa){A.cn[0].html=' '+A.cn[0].html+''}if(this.glyphicon){A.cn[0].html=' '+A.cn[0].html; -}if(this.menu){A.cn[0].html+=" ";}if(this.badge!==''){A.cn[0].html+=' '+this.badge+'';}}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype; -this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.select('a',true).on('click',this.onClick,this);if(this.tagtype=='span'){this.el.select('span',true).on('click',this.onClick,this);}this.parent().register(this);},onClick:function(e){if(e.getTarget('.dropdown-menu-item')){return; -}if(this.preventDefault||this.href=='#'){Roo.log("NavItem - prevent Default?");e.preventDefault();}if(this.disabled){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(tg&&tg.transition){Roo.log("waiting for the transitionend");return;}if(this.fireEvent('click',this,e)===false){return; -};if(this.tagtype=='span'){return;}var A=this.el.select('a',true).first();if(A&&this.animateRef&&this.href.indexOf('#')>-1){if(A.dom.href.split("#")[0]!=document.location.toString().split("#")[0]){return;}Roo.log("NavItem - prevent Default?");e.preventDefault(); -this.scrollToElement(e);}var p=this.parent();if(['tabs','pills'].indexOf(p.type)!==-1){if(typeof(p.setActiveItem)!=='undefined'){p.setActiveItem(this);}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.navbar-collapse',true).removeClass('in'); -}},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.NavGroup.get(this.navId);if(nv){nv.clearWasActive(this);}}this.active=A;if(!A){this.el.removeClass('active');}else if(!this.el.hasClass('active')){this.el.addClass('active'); -}if(B){this.fireEvent('changed',this,A);}if(!this.navId||!this.tabId||!A||C){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(!tg){return;}var D=tg.getPanelByName(this.tabId);if(!D){return;}if(false==tg.showPanel(D)){var nv=Roo.bootstrap.NavGroup.get(this.navId); +Roo.bootstrap.NavItem=function(A){Roo.bootstrap.NavItem.superclass.constructor.call(this,A);this.addEvents({"click":true,'changed':true,'scrollto':true});};Roo.extend(Roo.bootstrap.NavItem,Roo.bootstrap.Component,{href:false,html:'',badge:'',icon:false,fa:false,glyphicon:false,active:false,preventDefault:false,tabId:false,tagtype:'a',tag:'li',disabled:false,animateRef:false,was_active:false,button_weight:'',button_outline:false,navLink:false,getAutoCreate:function(){var A={tag:this.tag,cls:'nav-item'} +;if(this.active){A.cls=typeof(A.cls)=='undefined'?'active':A.cls+' active';}if(this.disabled){A.cls+=' disabled';}if(this.button_weight.length){A.tag=this.href?'a':'button';A.html=this.html||'';A.cls+=' btn btn'+(this.button_outline?'-outline':'')+'-'+this.button_weight; +if(this.href){A.href=this.href;}if(this.fa){A.html=' '+this.html+'';}if(this.badge!==''){A.html+=' '+this.badge+'';}return A;}if(this.href||this.html||this.glyphicon||this.icon||this.fa){A.cn=[{tag:this.tagtype,href:this.href||"#",html:this.html||''} +];if(this.tagtype=='a'){A.cn[0].cls='nav-link';}if(this.icon){A.cn[0].html=' '+A.cn[0].html+'';}if(this.fa){A.cn[0].html=' '+A.cn[0].html+'';}if(this.glyphicon){A.cn[0].html=' '+A.cn[0].html; +}if(this.menu){A.cn[0].html+=" ";}if(this.badge!==''){A.cn[0].html+=' '+this.badge+'';}}return A;},onRender:function(ct,A){if(Roo.bootstrap.version==4&&ct.dom.type!='ul'){this.tag='div'; +}var B=Roo.bootstrap.NavItem.superclass.onRender.call(this,ct,A);this.navLink=this.el.select('.nav-link',true).first();return B;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;this.menu.triggerEl=this.el;this.menu=this.addxtype(Roo.apply({} +,this.menu));}this.el.select('a',true).on('click',this.onClick,this);if(this.tagtype=='span'){this.el.select('span',true).on('click',this.onClick,this);}this.parent().register(this);},onClick:function(e){if(e.getTarget('.dropdown-menu-item')){return;}if(this.preventDefault||this.href=='#'){Roo.log("NavItem - prevent Default?"); +e.preventDefault();}if(this.disabled){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(tg&&tg.transition){Roo.log("waiting for the transitionend");return;}if(this.fireEvent('click',this,e)===false){return;};if(this.tagtype=='span'){return;}var A=this.el.select('a',true).first(); +if(A&&this.animateRef&&this.href.indexOf('#')>-1){if(A.dom.href.split("#")[0]!=document.location.toString().split("#")[0]){return;}Roo.log("NavItem - prevent Default?");e.preventDefault();this.scrollToElement(e);}var p=this.parent();if(['tabs','pills'].indexOf(p.type)!==-1){if(typeof(p.setActiveItem)!=='undefined'){p.setActiveItem(this); +}}if(p.parentType=='NavHeaderbar'&&!this.menu){p.parent().el.select('.roo-navbar-collapse',true).removeClass('in');}},isActive:function(){return this.active},setActive:function(A,B,C){if(this.active&&!A&&this.navId){this.was_active=true;var nv=Roo.bootstrap.NavGroup.get(this.navId); +if(nv){nv.clearWasActive(this);}}this.active=A;if(!A){this.el.removeClass('active');this.navLink?this.navLink.removeClass('active'):false;}else if(!this.el.hasClass('active')){this.el.addClass('active');if(Roo.bootstrap.version==4&&this.navLink){this.navLink.addClass('active'); +}}if(B){this.fireEvent('changed',this,A);}if(!this.navId||!this.tabId||!A||C){return;}var tg=Roo.bootstrap.TabGroup.get(this.navId);if(!tg){return;}var D=tg.getPanelByName(this.tabId);if(!D){return;}if(false==tg.showPanel(D)){var nv=Roo.bootstrap.NavGroup.get(this.navId); if(nv){var E=nv.getWasActive();if(E){E.setActive(true,false,true);}}}},setDisabled:function(A){this.disabled=A;if(!A){this.el.removeClass('disabled');}else if(!this.el.hasClass('disabled')){this.el.addClass('disabled');}},tooltipEl:function(){return this.el.select(''+this.tagtype+'',true).first(); },scrollToElement:function(e){var c=document.body;if(Roo.isFirefox||Roo.isIE||Roo.isIE11){c=document.documentElement;}var A=Roo.get(c).select('a[name='+this.href.split('#')[1]+']',true).first();if(!A){return;}var o=A.calcOffsetsTo(c);var B={target:A,value:o[1]} ;this.fireEvent('scrollto',this,B,e);Roo.get(c).scrollTo('top',B.value,true);return;}}); @@ -201,7 +208,7 @@ Roo.bootstrap.NavSidebarItem=function(A){Roo.bootstrap.NavSidebarItem.superclass }if(this.open){A.cls+=' open x-open';}if(this.glyphicon||this.icon){var c=this.glyphicon?('glyphicon glyphicon-'+this.glyphicon):this.icon;a.cn.push({tag:'i',cls:c});}if(!this.buttonView){var B={tag:'span',html:this.html||''};a.cn.push(B);}if(this.badge!==''){a.cn.push({tag:'span',cls:'badge pull-right badge-'+this.badgeWeight,html:this.badge} );}if(this.menu){if(this.showArrow){a.cn.push({tag:'i',cls:'glyphicon glyphicon-chevron-down pull-right'});}a.cls+=' dropdown-toggle treeview';}return A;},initEvents:function(){if(typeof(this.menu)!='undefined'){this.menu.parentType=this.xtype;this.menu.triggerEl=this.el; this.menu=this.addxtype(Roo.apply({},this.menu));}this.el.on('click',this.onClick,this);if(this.badge!==''){this.badgeEl=this.el.select('.badge',true).first().setVisibilityMode(Roo.Element.DISPLAY);}},onClick:function(e){if(this.disabled){e.preventDefault(); -return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this);},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);},setDisabled:function(A){if(this.disabled==A){return;}this.disabled=A;if(A){this.el.addClass('disabled'); +return;}if(this.preventDefault){e.preventDefault();}this.fireEvent('click',this,e);},disable:function(){this.setDisabled(true);},enable:function(){this.setDisabled(false);},setDisabled:function(A){if(this.disabled==A){return;}this.disabled=A;if(A){this.el.addClass('disabled'); return;}this.el.removeClass('disabled');return;},setActive:function(A){if(this.active==A){return;}this.active=A;if(A){this.el.addClass('active');return;}this.el.removeClass('active');return;},isActive:function(){return this.active;},setBadge:function(A){if(!this.badgeEl){return; }this.badgeEl.dom.innerHTML=A;}}); // Roo/bootstrap/Row.js @@ -266,30 +273,30 @@ var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==fal if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;var D=this.getRowIndex(B);if(this.cellSelection){this.fireEvent('celldblclick',this,A,D,C,e);}if(this.rowSelection){this.fireEvent('rowdblclick',this,B,D,e);}},sort:function(e,el){var A=Roo.get(el); if(!A.hasClass('sortable')){return;}var B=A.attr('sort');var C='ASC';if(A.select('i',true).first().hasClass('glyphicon-arrow-up')){C='DESC';}this.store.sortInfo={field:B,direction:C};if(this.footer){Roo.log("calling footer first");this.footer.onClick('first'); }else{this.store.load({params:{start:0}});}},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;this.totalWidth=0;for(var i=0,B=cm.getColumnCount();i';}if(typeof(C.mdHeader)!='undefined'){hh+=''; +;var hh='';if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls='sortable';c.html=''+c.html;}if(typeof(C.lgHeader)!='undefined'){hh+='';}if(typeof(C.mdHeader)!='undefined'){hh+=''; }if(typeof(C.smHeader)!='undefined'){hh+='';}if(typeof(C.xsHeader)!='undefined'){hh+='';}if(hh.length){c.html=hh;}if(typeof(C.tooltip)!='undefined'){c.tooltip=C.tooltip; }if(typeof(C.colspan)!='undefined'){c.colspan=C.colspan;}if(typeof(C.hidden)!='undefined'&&C.hidden){c.style+=' display:none;';}if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';'; }if(typeof(C.width)!='undefined'){c.style+=' width:'+C.width+'px;';this.totalWidth+=C.width;}else{this.totalWidth+=100;}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}['xs','sm','md','lg'].map(function(D){if(typeof(C[D])=='undefined'){return; -}if(!C[D]){c.cls+=' hidden-'+D;return;}c.cls+=' col-'+D+'-'+C[D];});A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()} -]}]};return A;},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['glyphicon-arrow-up','glyphicon-arrow-down']);if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['glyphicon-arrow-up']); -}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['glyphicon-arrow-down']);}}});var B=this.mainBody;if(ds.getCount()>0){ds.data.each(function(d,E){var F=this.renderRow(cm,ds,E); -B.createChild(F);var G=this;if(F.cellObjects.length){Roo.each(F.cellObjects,function(r){G.renderCellObject(r);})}},this);}var C=this.el.select('tfoot',true).first();if(this.footerShow&&this.auto_hide_footer&&this.mainFoot){this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide(); -var D=this.ds.getTotalCount();if(this.footer.pageSize tr',true).elements; -if(typeof(D[B])!='undefined'){bt.removeChild(D[B].dom);}if(C!==true){this.fireEvent("rowremoved",this,B,A);}},onAdd:function(ds,A,B){var bt=this.mainBody.dom;for(var i=0;i tr',true).elements; -return (typeof(B[A])=='undefined')?false:B[A];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[];for(var i=0,D=cm.getColumnCount();i tr',true).elements;if(typeof(C[A])=='undefined'){return;}C[A].dom.style.display=B?'':'none';},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel; -},renderCellObject:function(r){var A=this;r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id;var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B); -})}},getRowIndex:function(A){var B=-1;Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return;}B=C;});return B;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first(); -var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first();var cw=A.getWidth();if(C){C.setSize(A.getWidth(),A.getHeight()-((B?B.getHeight():0)+(D?D.getHeight():0)));var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E; -}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tr',true).setWidth(cw);return;},onBodyScroll:function(){if(this.mainHead){this.mainHead.setStyle({'position':'relative','left':(-1*this.mainBody.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.mainBody.dom.scrollHeight; -var B=Math.ceil(this.mainBody.getScroll().top);var C=this.mainBody.getHeight();if(A-C==B){var D=this.ds.getTotalCount();if(this.footer.cursor+this.footer.pageSize0){ds.data.each(function(d,E){var F=this.renderRow(cm,ds,E);B.createChild(F);var G=this;if(F.cellObjects.length){Roo.each(F.cellObjects,function(r){G.renderCellObject(r);})}},this);}var C=this.el.select('tfoot',true).first(); +if(this.footerShow&&this.auto_hide_footer&&this.mainFoot){this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide();var D=this.ds.getTotalCount();if(this.footer.pageSize tr',true).elements;if(typeof(D[B])!='undefined'){bt.removeChild(D[B].dom);}if(C!==true){this.fireEvent("rowremoved",this,B,A);}},onAdd:function(ds,A,B){var bt=this.mainBody.dom;for(var i=0;i tr',true).elements;return (typeof(B[A])=='undefined')?false:B[A];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[]; +for(var i=0,D=cm.getColumnCount();i tr',true).elements;if(typeof(C[A])=='undefined'){return; +}C[A].dom.style.display=B?'':'none';},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel;},renderCellObject:function(r){var A=this;r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id; +var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B);})}},getRowIndex:function(A){var B=-1;Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return; +}B=C;});return B;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first(); +var cw=A.getWidth();if(C){C.setSize(A.getWidth(),A.getHeight()-((B?B.getHeight():0)+(D?D.getHeight():0)));var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tr',true).setWidth(cw);return;},onBodyScroll:function(){if(this.mainHead){this.mainHead.setStyle({'position':'relative','left':(-1*this.mainBody.dom.scrollLeft)+'px'} +);}if(this.lazyLoad){var A=this.mainBody.dom.scrollHeight;var B=Math.ceil(this.mainBody.getScroll().top);var C=this.mainBody.getHeight();if(A-C==B){var D=this.ds.getTotalCount();if(this.footer.cursor+this.footer.pageSize12){H.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){H.cls+=' col-lg-'+this.labellg;I.cls+=' col-lg-'+(12-this.labellg); }if(this.labelmd>0){H.cls+=' col-md-'+this.labelmd;I.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){H.cls+=' col-sm-'+this.labelsm;I.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){H.cls+=' col-xs-'+this.labelxs;I.cls+=' col-xs-'+(12-this.labelxs); }}else if(this.fieldLabel.length){B.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{tag:'label',html:this.fieldLabel},E];if(this.indicatorpos=='right'){B.cn=[{tag:'label',html:this.fieldLabel} -,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},E];}}else{B.cn=[E];};if(this.parentType==='Navbar'&&this.parent().bar){B.cls+=' navbar-form';}if(this.parentType==='NavGroup'){B.cls+=' navbar-form'; +,{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},E];}}else{B.cn=[E];};if(this.parentType==='Navbar'&&this.parent().bar){B.cls+=' navbar-form';}if(this.parentType==='NavGroup'&&!(Roo.bootstrap.version==4&&this.parent().form)){B.cls+=' navbar-form'; B.tag='li';}return B;},inputEl:function(){return this.el.select('input.form-control',true).first();},tooltipEl:function(){return this.inputEl();},indicatorEl:function(){if(Roo.bootstrap.version==4){return false;}var A=this.el.select('i.roo-required-indicator',true).first(); if(!A){return false;}return A;},setDisabled:function(v){var i=this.inputEl().dom;if(!v){i.removeAttribute('disabled');return;}i.setAttribute('disabled','true');},initEvents:function(){this.inputEl().on("keydown",this.fireKey,this);this.inputEl().on("focus",this.onFocus,this); this.inputEl().on("blur",this.onBlur,this);this.inputEl().relayEvent('keyup',this);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}this.originalValue=this.getValue();if(this.validationEvent=='keyup'){this.validationTask=new Roo.util.DelayedTask(this.validate,this); @@ -392,13 +399,14 @@ if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireE },selectText:function(A,B){var v=this.getRawValue();if(v.length>0){A=A===undefined?0:A;B=B===undefined?v.length:B;var d=this.inputEl().dom;if(d.setSelectionRange){d.setSelectionRange(A,B);}else if(d.createTextRange){var C=d.createTextRange();C.moveStart("character",A); C.moveEnd("character",v.length-B);C.select();}}},setValue:function(v){this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v);this.validate();}},preFocus:function(){if(this.selectOnFocus){this.inputEl().dom.select();}},filterKeys:function(e){var k=e.getKey(); if(!Roo.isIE&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return;}var c=e.getCharCode(),cc=String.fromCharCode(c);if(Roo.isIE&&(e.isSpecialKey()||!cc)){return;}if(!this.maskRe.test(cc)){e.stopEvent();}},clearInvalid:function(){if(!this.el||this.preventMark){return; -}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass); +}this.el.removeClass([this.invalidClass,'is-invalid']);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass); }}if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]); -var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible'); -}if(this.disabled){return;}if(this.allowBlank&&!this.getRawValue().length){return;}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first(); -if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return; -}this.el.removeClass([this.invalidClass,this.validClass]);var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled){return; -}if(this.allowBlank&&!this.getRawValue().length){return;}if(this.indicator){this.indicator.removeClass(this.indicatorpos=='right'?'hidden':'invisible');this.indicator.addClass('visible');}this.el.addClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first(); +this.inputEl().removeClass(['is-valid','is-invalid']);var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.indicator){this.indicator.removeClass('visible'); +this.indicator.addClass(this.indicatorpos=='right'?'hidden':'invisible');}if(this.disabled){return;}if(this.allowBlank&&!this.getRawValue().length){return;}if(Roo.bootstrap.version==3){this.el.addClass(this.validClass);}else{this.inputEl().addClass('is-valid'); +}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]); +this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);this.inputEl().removeClass(['is-valid','is-invalid']); +var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled){return;}if(this.allowBlank&&!this.getRawValue().length){return; +}if(this.indicator){this.indicator.removeClass(this.indicatorpos=='right'?'hidden':'invisible');this.indicator.addClass('visible');}if(Roo.bootstrap.version==3){this.el.addClass(this.invalidClass);}else{this.inputEl().addClass('is-invalid');}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first(); if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);if(this.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]); }}}this.fireEvent('invalid',this,A);},SafariOnKeyDown:function(A){if(this.inputEl().dom.type!='password'){return;}var B=false;if(this.inputEl().dom.selectionEnd>0){B=(this.inputEl().dom.selectionEnd-this.inputEl().dom.selectionStart-this.getValue().length==0)?true:false; }if(((A.getKey()==8||A.getKey()==46)&&this.getValue().length==1)){A.preventDefault();this.setValue('');return;}if(B&&A.getCharCode()>31&&!A.ctrlKey){A.preventDefault();var cc=String.fromCharCode(A.getCharCode());this.setValue(A.shiftKey?cc:cc.toLowerCase()); @@ -415,24 +423,24 @@ var id=Roo.id();var B={};if(this.inputType!='hidden'){B.cls='form-group'}var C={ ,{cls:"",cn:[E]}];if(this.labelWidth>12){B.cn[0].style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){B.cn[0].cls+=' col-lg-'+this.labellg;B.cn[1].cls+=' col-lg-'+(12-this.labellg); }if(this.labelmd>0){B.cn[0].cls+=' col-md-'+this.labelmd;B.cn[1].cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){B.cn[0].cls+=' col-sm-'+this.labelsm;B.cn[1].cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){B.cn[0].cls+=' col-xs-'+this.labelxs; B.cn[1].cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){B.cn=[{tag:'label',html:this.fieldLabel},E];}else{B.cn=[E];}if(this.disabled){C.disabled=true;}return B;},inputEl:function(){return this.el.select('textarea.form-control',true).first(); -},clearInvalid:function(){if(!this.el||this.preventMark){return;}var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();if(A&&B){B.remove();}this.el.removeClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var C=this.el.select('.form-control-feedback',true).first(); -if(C){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var A=this.el.select('.form-control-feedback',true).first(); -if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}var B=this.el.select('label',true).first();var C=this.el.select('i.fa-star',true).first(); -if(B&&C){C.remove();}this.el.addClass(this.validClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]); -this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);var B=this.el.select('.form-control-feedback',true).first(); -if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}var C=this.el.select('label',true).first();var D=this.el.select('i.fa-star',true).first(); -if(!this.getValue().length&&C&&!D){this.el.createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'},C,true);}this.el.addClass(this.invalidClass);if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first(); -if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);if(this.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]); -}}}this.fireEvent('invalid',this,A);}}); +},clearInvalid:function(){if(!this.el||this.preventMark){return;}var A=this.el.select('label',true).first();var B=this.el.select('i.fa-star',true).first();if(A&&B){B.remove();}this.el.removeClass(this.validClass);this.inputEl().removeClass('is-invalid');if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var C=this.el.select('.form-control-feedback',true).first(); +if(C){this.el.select('.form-control-feedback',true).first().removeClass(this.invalidFeedbackClass);}}this.fireEvent('valid',this);},markValid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass,this.validClass]);this.inputEl().removeClass(['is-valid','is-invalid']); +var A=this.el.select('.form-control-feedback',true).first();if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);}if(this.disabled||this.allowBlank){return;}var B=this.el.select('label',true).first(); +var C=this.el.select('i.fa-star',true).first();if(B&&C){C.remove();}if(Roo.bootstrap.version==3){this.el.addClass(this.validClass);}else{this.inputEl().addClass('is-valid');}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank&&(this.getValue().length||this.forceFeedback)){var A=this.el.select('.form-control-feedback',true).first(); +if(A){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]);this.el.select('.form-control-feedback',true).first().addClass([this.validFeedbackClass]);}}this.fireEvent('valid',this);},markInvalid:function(A){if(!this.el||this.preventMark){return; +}this.el.removeClass([this.invalidClass,this.validClass]);this.inputEl().removeClass(['is-valid','is-invalid']);var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]); +}if(this.disabled||this.allowBlank){return;}var C=this.el.select('label',true).first();var D=this.el.select('i.fa-star',true).first();if(!this.getValue().length&&C&&!D){this.el.createChild({tag:'i',cls:'text-danger fa fa-lg fa-star',tooltip:'This field is required',style:'margin-right:5px;'} +,C,true);}if(Roo.bootstrap.version==3){this.el.addClass(this.invalidClass);}else{this.inputEl().addClass('is-invalid');}if(this.hasFeedback&&this.inputType!='hidden'&&!this.allowBlank){var B=this.el.select('.form-control-feedback',true).first();if(B){this.el.select('.form-control-feedback',true).first().removeClass([this.invalidFeedbackClass,this.validFeedbackClass]); +if(this.getValue().length||this.forceFeedback){this.el.select('.form-control-feedback',true).first().addClass([this.invalidFeedbackClass]);}}}this.fireEvent('invalid',this,A);}}); // Roo/bootstrap/TriggerField.js Roo.bootstrap.TriggerField=function(A){this.mimicing=false;Roo.bootstrap.TriggerField.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.TriggerField,Roo.bootstrap.Input,{hideTrigger:false,removable:false,autoSize:Roo.emptyFn,monitorTab:true,deferHeight:true,actionMode:'wrap',caret:false,getAutoCreate:function(){var A=this.labelAlign||this.parentLabelAlign(); var id=Roo.id();var B={cls:'form-group'};var C={tag:'input',id:id,type:this.inputType,cls:'form-control',autocomplete:'new-password',placeholder:this.placeholder||''};if(this.name){C.name=this.name;}if(this.size){C.cls+=' input-'+this.size;}if(this.disabled){C.disabled=true; }var D=C;if(this.hasFeedback&&!this.allowBlank){var E={tag:'span',cls:'glyphicon form-control-feedback'};if(this.removable&&!this.editable&&!this.tickable){D={cls:'has-feedback',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'},E]};}else{D={cls:'has-feedback',cn:[D,E]} ;}}else{if(this.removable&&!this.editable&&!this.tickable){D={cls:'roo-removable',cn:[D,{tag:'button',html:'x',cls:'roo-combo-removable-btn close'}]};}}if(this.before||this.after){D={cls:'input-group',cn:[]};if(this.before){D.cn.push({tag:'span',cls:'input-group-addon input-group-prepend input-group-text',html:this.before} );}D.cn.push(C);if(this.hasFeedback&&!this.allowBlank){D.cls+=' has-feedback';D.cn.push(E);}if(this.after){D.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text',html:this.after});}};var F=D;if(this.multiple){F={tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[D]} -]};}var G={cls:'roo-select2-container input-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},F]};if(!this.multiple&&this.showToggleBtn){var H={tag:'span',cls:'caret'};if(this.caret!=false){H={tag:'i',cls:'fa fa-'+this.caret};}G.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[H,{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'} +]};}var G={cls:'roo-select2-container input-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},F]};if(!this.multiple&&this.showToggleBtn){var H={tag:'span',cls:'caret'};if(this.caret!=false){H={tag:'i',cls:'fa fa-'+this.caret};}G.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[Roo.bootstrap.version==3?H:'',{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'} ]}]})}if(this.multiple){G.cls+=' roo-select2-container-multi';}var I={tag:'i',cls:'roo-required-indicator '+(this.indicatorpos=='right'?'right':'left')+'-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'};if(Roo.bootstrap.version==4){I={tag:'i',style:'display:none'} -;}if(A==='left'&&this.fieldLabel.length){B.cls+=' roo-form-group-label-left row';B.cn=[I,{tag:'label','for':id,cls:'control-label',html:this.fieldLabel},{cls:"",cn:[G]}];var J=B.cn[1];var K=B.cn[2];if(this.indicatorpos=='right'){B.cn=[{tag:'label','for':id,cls:'control-label',cn:[{tag:'span',html:this.fieldLabel} +;}if(A==='left'&&this.fieldLabel.length){B.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');B.cn=[I,{tag:'label','for':id,cls:'control-label',html:this.fieldLabel},{cls:"",cn:[G]}];var J=B.cn[1];var K=B.cn[2];if(this.indicatorpos=='right'){B.cn=[{tag:'label','for':id,cls:'control-label',cn:[{tag:'span',html:this.fieldLabel} ,I]},{cls:"",cn:[G]}];J=B.cn[0];K=B.cn[1];}if(this.labelWidth>12){J.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){J.cls+=' col-lg-'+this.labellg;K.cls+=' col-lg-'+(12-this.labellg); }if(this.labelmd>0){J.cls+=' col-md-'+this.labelmd;K.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){J.cls+=' col-sm-'+this.labelsm;K.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){J.cls+=' col-xs-'+this.labelxs;K.cls+=' col-xs-'+(12-this.labelxs); }}else if(this.fieldLabel.length){B.cn=[I,{tag:'label',html:this.fieldLabel},G];if(this.indicatorpos=='right'){B.cn=[{tag:'label',cn:[{tag:'span',html:this.fieldLabel},I]},G];}}else{B=G}var L=this;['xs','sm','md','lg'].map(function(M){if(L[M]){B.cls+=' col-'+M+'-'+L[M]; @@ -471,21 +479,21 @@ for(var i=0,B=A.length;iv2?1:(v1v2?1:(v112){L.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth; -}if(this.labellg>0){L.cls+=' col-lg-'+this.labellg;M.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){L.cls+=' col-md-'+this.labelmd;M.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){L.cls+=' col-sm-'+this.labelsm;M.cls+=' col-sm-'+(12-this.labelsm); -}if(this.labelxs>0){L.cls+=' col-xs-'+this.labelxs;M.cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){A.cn=[K,{tag:'label',html:this.fieldLabel},I];if(this.indicatorpos=='right'){A.cn=[{tag:'label',html:this.fieldLabel},K,I];}}else{A=I} -var N=this;['xs','sm','md','lg'].map(function(O){if(N[O]){A.cls+=' col-'+O+'-'+N[O];}});return A;},_initEventsCalled:false,initEvents:function(){if(this._initEventsCalled){return;}this._initEventsCalled=true;if(!this.store){throw "can not find store for combo"; +;if(Roo.bootstrap.version==4){K={tag:'i',style:'display:none'};}if(B==='left'&&this.fieldLabel.length){A.cls+=' roo-form-group-label-left'+(Roo.bootstrap.version==4?' row':'');A.cn=[K,{tag:'label','for':id,cls:'control-label col-form-label',html:this.fieldLabel} +,{cls:"",cn:[I]}];var L=A.cn[1];var M=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel},K]},{cls:"",cn:[I]}];L=A.cn[0];M=A.cn[1];}if(this.labelWidth>12){L.style="width: "+this.labelWidth+'px'; +}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){L.cls+=' col-lg-'+this.labellg;M.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){L.cls+=' col-md-'+this.labelmd;M.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){L.cls+=' col-sm-'+this.labelsm; +M.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){L.cls+=' col-xs-'+this.labelxs;M.cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){A.cn=[K,{tag:'label',html:this.fieldLabel},I];if(this.indicatorpos=='right'){A.cn=[{tag:'label',html:this.fieldLabel} +,K,I];}}else{A=I}var N=this;['xs','sm','md','lg'].map(function(O){if(N[O]){A.cls+=' col-'+O+'-'+N[O];}});return A;},_initEventsCalled:false,initEvents:function(){if(this._initEventsCalled){return;}this._initEventsCalled=true;if(!this.store){throw "can not find store for combo"; }this.indicator=this.indicatorEl();this.store=Roo.factory(this.store,Roo.data);this.store.parent=this;if(Roo.XComponent.build_from_html){var e=this.el.dom,k=0;while(e){e=e.previousSibling;++k;}this.el.remove();this.el=false;this.rendered=false;this.render(this.parent().getChildContainer(true),k); }if(Roo.isIOS&&this.useNativeIOS){this.initIOSView();return;}if(Roo.isTouch&&this.mobileTouchView){this.initTouchView();return;}if(this.tickable){this.initTickableEvents();return;}Roo.bootstrap.ComboBox.superclass.initEvents.call(this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first(); this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}var A='x-combo-list';var B=this;(function(){var lw=B.listWidth||Math.max(B.inputEl().getWidth(),B.minListWidth); @@ -615,10 +623,9 @@ this.lastItem=Roo.apply([],this.item);if(A&&A.name=='cancel'){this.tickItems=Roo ;if(this.name){B.name=this.name;}if(this.size){B.cls+=' input-'+this.size;}if(this.disabled){B.disabled=true;}var C={cls:'',cn:[B]};if(this.before){C.cls+=' input-group';C.cn.unshift({tag:'span',cls:'input-group-addon input-group-prepend input-group-text',html:this.before} );}if(this.removable&&!this.multiple){C.cls+=' roo-removable';C.cn.push({tag:'button',html:'x',cls:'roo-combo-removable-btn close'});}if(this.hasFeedback&&!this.allowBlank){C.cls+=' has-feedback';C.cn.push({tag:'span',cls:'glyphicon form-control-feedback'} );}if(this.after){C.cls+=(this.before)?'':' input-group';C.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text',html:this.after});}var D=C;if(this.multiple){D={tag:'ul',cls:'roo-select2-choices',cn:[{tag:'li',cls:'roo-select2-search-field',cn:[C]} -]};}var E={cls:'roo-select2-container input-group roo-touchview-combobox ',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};if(!this.multiple&&this.showToggleBtn){var F={tag:'span',cls:'caret'};if(this.caret!=false){F={tag:'i',cls:'fa fa-'+this.caret} -;}E.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[F,{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'}]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.labelAlign||this.parentLabelAlign(); -if(G==='left'&&this.fieldLabel.length){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{tag:'label',cls:'control-label col-form-label',html:this.fieldLabel},{cls:'',cn:[E]}];var H=A.cn[1]; -var I=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel},{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} +]};}var E={cls:'roo-select2-container input-group roo-touchview-combobox ',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},D]};if(!this.multiple&&this.showToggleBtn){var F={cls:'caret'};if(this.caret!=false){F={tag:'i',cls:'fa fa-'+this.caret};}E.cn.push({tag:'span',cls:'input-group-addon input-group-append input-group-text btn dropdown-toggle',cn:[Roo.bootstrap.version==3?F:'',{tag:'span',cls:'combobox-clear',cn:[{tag:'i',cls:'icon-remove'} +]}]})}if(this.multiple){E.cls+=' roo-select2-container-multi';}var G=this.labelAlign||this.parentLabelAlign();if(G==='left'&&this.fieldLabel.length){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} +,{tag:'label',cls:'control-label col-form-label',html:this.fieldLabel},{cls:'',cn:[E]}];var H=A.cn[1];var I=A.cn[2];if(this.indicatorpos=='right'){A.cn=[{tag:'label','for':id,cls:'control-label col-form-label',cn:[{tag:'span',html:this.fieldLabel},{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} ]},{cls:"",cn:[E]}];H=A.cn[0];I=A.cn[1];}if(this.labelWidth>12){H.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){H.cls+=' col-lg-'+this.labellg;I.cls+=' col-lg-'+(12-this.labellg); }if(this.labelmd>0){H.cls+=' col-md-'+this.labelmd;I.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){H.cls+=' col-sm-'+this.labelsm;I.cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){H.cls+=' col-xs-'+this.labelxs;I.cls+=' col-xs-'+(12-this.labelxs); }}else if(this.fieldLabel.length){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{tag:'label',cls:'control-label',html:this.fieldLabel},{cls:'',cn:[E]}];if(this.indicatorpos=='right'){A.cn=[{tag:'label',cls:'control-label',html:this.fieldLabel,cn:[{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} @@ -749,17 +756,18 @@ Roo.bootstrap.TabGroup=function(A){Roo.bootstrap.TabGroup.superclass.constructor ]}]});}}return A;},initEvents:function(){if(this.autoslide){var A=this;this.slideFn=window.setInterval(function(){A.showPanelNext();},this.timer);}if(this.showarrow){this.el.select('.carousel-prev',true).first().on('click',this.showPanelPrev,this);this.el.select('.carousel-next',true).first().on('click',this.showPanelNext,this); }},getChildContainer:function(){return this.carousel?this.el.select('.carousel-inner',true).first():this.el;},register:function(A){this.tabs.push(A);A.navId=this.navId;this.addBullet();},getActivePanel:function(){var r=false;Roo.each(this.tabs,function(t){if(t.active){r=t; return false;}return null;});return r;},getPanelByName:function(n){var r=false;Roo.each(this.tabs,function(t){if(t.tabId==n){r=t;return false;}return null;});return r;},indexOfPanel:function(p){var r=false;Roo.each(this.tabs,function(t,i){if(t.tabId==p.tabId){r=i; -return false;}return null;});return r;},showPanel:function(A){if(this.transition||typeof(A)=='undefined'){Roo.log("waiting for the transitionend");return;}if(typeof(A)=='number'){A=this.tabs[A];}if(typeof(A)=='string'){A=this.getPanelByName(A);}var B=this.getActivePanel(); +return false;}return null;});return r;},showPanel:function(A){if(this.transition||typeof(A)=='undefined'){Roo.log("waiting for the transitionend");return false;}if(typeof(A)=='number'){A=this.tabs[A];}if(typeof(A)=='string'){A=this.getPanelByName(A);}var B=this.getActivePanel(); if(!A||!B){Roo.log('pan or acitve pan is undefined');return false;}if(A.tabId==this.getActivePanel().tabId){return true;}if(false===B.fireEvent('beforedeactivate')){return false;}if(this.bullets>0&&!Roo.isTouch){this.setActiveBullet(this.indexOfPanel(A)); -}if(this.carousel&&typeof(Roo.get(document.body).dom.style.transition)!='undefined'){this.transition=true;var C=this.indexOfPanel(A)>this.indexOfPanel(B)?'next':'prev';var lr=C=='next'?'left':'right';A.el.addClass(C);A.el.dom.offsetWidth;B.el.addClass(lr); -A.el.addClass(lr);var D=this;B.el.on('transitionend',function(){Roo.log("trans end?");A.el.removeClass([lr,C]);A.setActive(true);B.el.removeClass([lr]);B.setActive(false);D.transition=false;},this,{single:true});return true;}B.setActive(false);A.setActive(true); -return true;},showPanelNext:function(){var i=this.indexOfPanel(this.getActivePanel());if(i>=this.tabs.length-1&&!this.autoslide){return;}if(i>=this.tabs.length-1&&this.autoslide){i=-1;}this.showPanel(this.tabs[i+1]);},showPanelPrev:function(){var i=this.indexOfPanel(this.getActivePanel()); -if(i<1&&!this.autoslide){return;}if(i<1&&this.autoslide){i=this.tabs.length;}this.showPanel(this.tabs[i-1]);},addBullet:function(){if(!this.bullets||Roo.isTouch){return;}var A=this.el.select('.carousel-bullets',true).first();var i=this.el.select('.carousel-bullets .bullet',true).getCount(); -var B=A.createChild({cls:'bullet bullet-'+i},A.dom.lastChild);var C=this;B.on('click',(function(e,el,o,ii,t){e.preventDefault();this.showPanel(ii);if(this.autoslide&&this.slideFn){clearInterval(this.slideFn);this.slideFn=window.setInterval(function(){C.showPanelNext(); -},this.timer);}}).createDelegate(this,[i,B],true));},setActiveBullet:function(i){if(Roo.isTouch){return;}Roo.each(this.el.select('.bullet',true).elements,function(el){el.removeClass('selected');});var A=this.el.select('.bullet-'+i,true).first();if(!A){return; -}A.addClass('selected');}});Roo.apply(Roo.bootstrap.TabGroup,{groups:{},register:function(A){this.groups[A.navId]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){this.register(new Roo.bootstrap.TabGroup({navId:A}));}return this.groups[A];}}); +}if(this.carousel&&typeof(Roo.get(document.body).dom.style.transition)!='undefined'){this.transition=true;var C=this.indexOfPanel(A)>this.indexOfPanel(B)?'next':'prev';var lr=C=='next'?'left':'right';A.el.addClass(C);A.el.addClass('carousel-item-'+C);A.el.dom.offsetWidth; +B.el.addClass(lr);A.el.addClass(lr);B.el.addClass('carousel-item-'+lr);A.el.addClass('carousel-item-'+lr);var D=this;B.el.on('transitionend',function(){Roo.log("trans end?");A.el.removeClass([lr,C,'carousel-item-'+lr,'carousel-item-'+C]);A.setActive(true); +B.el.removeClass([lr,'carousel-item-'+lr]);B.setActive(false);D.transition=false;},this,{single:true});return true;}B.setActive(false);A.setActive(true);return true;},showPanelNext:function(){var i=this.indexOfPanel(this.getActivePanel());if(i>=this.tabs.length-1&&!this.autoslide){return; +}if(i>=this.tabs.length-1&&this.autoslide){i=-1;}this.showPanel(this.tabs[i+1]);},showPanelPrev:function(){var i=this.indexOfPanel(this.getActivePanel());if(i<1&&!this.autoslide){return;}if(i<1&&this.autoslide){i=this.tabs.length;}this.showPanel(this.tabs[i-1]); +},addBullet:function(){if(!this.bullets||Roo.isTouch){return;}var A=this.el.select('.carousel-bullets',true).first();var i=this.el.select('.carousel-bullets .bullet',true).getCount();var B=A.createChild({cls:'bullet bullet-'+i},A.dom.lastChild);var C=this; +B.on('click',(function(e,el,o,ii,t){e.preventDefault();this.showPanel(ii);if(this.autoslide&&this.slideFn){clearInterval(this.slideFn);this.slideFn=window.setInterval(function(){C.showPanelNext();},this.timer);}}).createDelegate(this,[i,B],true));},setActiveBullet:function(i){if(Roo.isTouch){return; +}Roo.each(this.el.select('.bullet',true).elements,function(el){el.removeClass('selected');});var A=this.el.select('.bullet-'+i,true).first();if(!A){return;}A.addClass('selected');}});Roo.apply(Roo.bootstrap.TabGroup,{groups:{},register:function(A){this.groups[A.navId]=A; +},get:function(A){if(typeof(this.groups[A])=='undefined'){this.register(new Roo.bootstrap.TabGroup({navId:A}));}return this.groups[A];}}); // Roo/bootstrap/TabPanel.js -Roo.bootstrap.TabPanel=function(A){Roo.bootstrap.TabPanel.superclass.constructor.call(this,A);this.addEvents({'changed':true,'beforedeactivate':true});this.tabId=this.tabId||Roo.id();};Roo.extend(Roo.bootstrap.TabPanel,Roo.bootstrap.Component,{active:false,html:false,tabId:false,navId:false,href:'',getAutoCreate:function(){var A={tag:'div',cls:'tab-pane item'+((this.href.length)?' clickable ':''),html:this.html||''} +Roo.bootstrap.TabPanel=function(A){Roo.bootstrap.TabPanel.superclass.constructor.call(this,A);this.addEvents({'changed':true,'beforedeactivate':true});this.tabId=this.tabId||Roo.id();};Roo.extend(Roo.bootstrap.TabPanel,Roo.bootstrap.Component,{active:false,html:false,tabId:false,navId:false,href:'',getAutoCreate:function(){var A={tag:'div',cls:'carousel-item tab-pane item'+((this.href.length)?' clickable ':''),html:this.html||''} ;if(this.active){A.cls+=' active';}if(this.tabId){A.tabId=this.tabId;}return A;},initEvents:function(){var p=this.parent();this.navId=this.navId||p.navId;if(typeof(this.navId)!='undefined'){var tg=Roo.bootstrap.TabGroup.get(this.navId);tg.register(this);var i=tg.tabs.length-1; if(this.active&&tg.bullets>0&&i12){B.cn[0].style="width: "+this.labelWidth+'px'; -}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){B.cn[0].cls+=' col-lg-'+this.labellg;B.cn[1].cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){B.cn[0].cls+=' col-md-'+this.labelmd;B.cn[1].cls+=' col-md-'+(12-this.labelmd); -}if(this.labelsm>0){B.cn[0].cls+=' col-sm-'+this.labelsm;B.cn[1].cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){B.cn[0].cls+=' col-xs-'+this.labelxs;B.cn[1].cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){B.cn=[{tag:this.boxLabel?'span':'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel} -,F];}else{B.cn=[F];}if(this.boxLabel){var G={tag:'label',cls:'box-label',html:this.boxLabel};if(this.tooltip){G.tooltip=this.tooltip;}B.cn.push(G);}if(this.inputType!='radio'){B.cn.push(D);}return B;},inputEl:function(){return this.el.select('input.roo-'+this.inputType,true).first(); -},hiddenEl:function(){return this.el.select('input.roo-hidden-value',true).first();},labelEl:function(){return this.el.select('label.control-label',true).first();},label:function(){return this.labelEl();},boxLabelEl:function(){return this.el.select('label.box-label',true).first(); -},initEvents:function(){this.inputEl().on('click',this.onClick,this);if(this.boxLabel){this.el.select('label.box-label',true).first().on('click',this.onClick,this);}this.startValue=this.getValue();if(this.groupId){Roo.bootstrap.CheckBox.register(this);}},onClick:function(e){if(this.fireEvent('click',this,e)!==false){this.setChecked(!this.checked); -}},setChecked:function(A,B){this.startValue=this.getValue();if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;});this.inputEl().dom.checked=true;this.inputEl().dom.value=this.inputValue; -if(B!==true){this.fireEvent('check',this,true);}this.validate();return;}this.checked=A;this.inputEl().dom.checked=A;this.hiddenEl().dom.value=A?this.inputValue:this.valueOff;if(B!==true){this.fireEvent('check',this,A);}this.validate();},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue(); -}return this.hiddenEl().dom.value;},getGroupValue:function(){if(typeof(this.el.up('form').child('input[name='+this.name+']:checked',true))=='undefined'){return '';}return this.el.up('form').child('input[name='+this.name+']:checked',true).value;},setValue:function(v,A){if(this.inputType=='radio'){this.setGroupValue(v,A); -return;}this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A);this.validate();},setGroupValue:function(v,A){this.startValue=this.getValue();Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false; -if(e.dom.value==v){e.dom.checked=true;}});if(A!==true){this.fireEvent('check',this,true);}this.validate();return;},validate:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.disabled||(this.inputType=='radio'&&this.validateRadio())||(this.inputType=='checkbox'&&this.validateCheckbox())){this.markValid(); -return true;}this.markInvalid();return false;},validateRadio:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.allowBlank){return true;}var A=false;Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){if(!e.dom.checked){return; +}if(this.after){F.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}}var G=false;if(this.boxLabel){G={tag:'label',cls:'box-label',html:this.boxLabel};if(this.tooltip){G.tooltip=this.tooltip;}}if(A==='left'&&this.fieldLabel.length){B.cn=[{tag:'label','for':id,cls:'control-label',html:this.fieldLabel} +,{cls:"",cn:[F]}];if(G){B.cn[1].cn.push(G);}if(this.labelWidth>12){B.cn[0].style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth;}if(this.labellg>0){B.cn[0].cls+=' col-lg-'+this.labellg;B.cn[1].cls+=' col-lg-'+(12-this.labellg); +}if(this.labelmd>0){B.cn[0].cls+=' col-md-'+this.labelmd;B.cn[1].cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){B.cn[0].cls+=' col-sm-'+this.labelsm;B.cn[1].cls+=' col-sm-'+(12-this.labelsm);}if(this.labelxs>0){B.cn[0].cls+=' col-xs-'+this.labelxs; +B.cn[1].cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){B.cn=[{tag:this.boxLabel?'span':'label','for':id,cls:'control-label box-input-label',html:this.fieldLabel},F];if(G){B.cn.push(G);}}else{B.cn=[F];if(G){B.cn.push(G);}}if(this.inputType!='radio'){B.cn.push(D); +}return B;},inputEl:function(){return this.el.select('input.roo-'+this.inputType,true).first();},hiddenEl:function(){return this.el.select('input.roo-hidden-value',true).first();},labelEl:function(){return this.el.select('label.control-label',true).first(); +},label:function(){return this.labelEl();},boxLabelEl:function(){return this.el.select('label.box-label',true).first();},initEvents:function(){this.inputEl().on('click',this.onClick,this);if(this.boxLabel){this.el.select('label.box-label',true).first().on('click',this.onClick,this); +}this.startValue=this.getValue();if(this.groupId){Roo.bootstrap.CheckBox.register(this);}},onClick:function(e){if(this.fireEvent('click',this,e)!==false){this.setChecked(!this.checked);}},setChecked:function(A,B){this.startValue=this.getValue();if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false; +});this.inputEl().dom.checked=true;this.inputEl().dom.value=this.inputValue;if(B!==true){this.fireEvent('check',this,true);}this.validate();return;}this.checked=A;this.inputEl().dom.checked=A;this.hiddenEl().dom.value=A?this.inputValue:this.valueOff;if(B!==true){this.fireEvent('check',this,A); +}this.validate();},getValue:function(){if(this.inputType=='radio'){return this.getGroupValue();}return this.hiddenEl().dom.value;},getGroupValue:function(){if(typeof(this.el.up('form').child('input[name='+this.name+']:checked',true))=='undefined'){return ''; +}return this.el.up('form').child('input[name='+this.name+']:checked',true).value;},setValue:function(v,A){if(this.inputType=='radio'){this.setGroupValue(v,A);return;}this.setChecked(((typeof(v)=='undefined')?this.checked:(String(v)===String(this.inputValue))),A); +this.validate();},setGroupValue:function(v,A){this.startValue=this.getValue();Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.dom.checked=false;if(e.dom.value==v){e.dom.checked=true;}});if(A!==true){this.fireEvent('check',this,true); +}this.validate();return;},validate:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.disabled||(this.inputType=='radio'&&this.validateRadio())||(this.inputType=='checkbox'&&this.validateCheckbox())){this.markValid();return true; +}this.markInvalid();return false;},validateRadio:function(){if(this.getVisibilityEl().hasClass('hidden')){return true;}if(this.allowBlank){return true;}var A=false;Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){if(!e.dom.checked){return; }A=true;return false;});return A;},validateCheckbox:function(){if(!this.groupId){return (this.getValue()==this.inputValue||this.allowBlank)?true:false;}var A=Roo.bootstrap.CheckBox.get(this.groupId);if(!A){return false;}var r=false;for(var i in A){if(A[i].el.isVisible(true)){r=false; break;}r=true;}for(var i in A){if(r){break;}r=(A[i].getValue()==A[i].inputValue)?true:false;}return r;},markValid:function(){var A=this;this.fireEvent('valid',this);var B=Roo.bootstrap.FieldLabel.get(this.name+'-group');if(this.groupId){B=Roo.bootstrap.FieldLabel.get(this.groupId+'-group'); -}if(B){B.markValid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.findParent('.form-group',false,true).removeClass([A.invalidClass,A.validClass]);e.findParent('.form-group',false,true).addClass(A.validClass); -});return;}if(!this.groupId){this.el.findParent('.form-group',false,true).removeClass([this.invalidClass,this.validClass]);this.el.findParent('.form-group',false,true).addClass(this.validClass);return;}var C=Roo.bootstrap.CheckBox.get(this.groupId);if(!C){return; -}for(var i in C){C[i].el.findParent('.form-group',false,true).removeClass([this.invalidClass,this.validClass]);C[i].el.findParent('.form-group',false,true).addClass(this.validClass);}},markInvalid:function(A){if(this.allowBlank){return;}var B=this;this.fireEvent('invalid',this,A); -var C=Roo.bootstrap.FieldLabel.get(this.name+'-group');if(this.groupId){C=Roo.bootstrap.FieldLabel.get(this.groupId+'-group');}if(C){C.markInvalid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){e.findParent('.form-group',false,true).removeClass([B.invalidClass,B.validClass]); -e.findParent('.form-group',false,true).addClass(B.invalidClass);});return;}if(!this.groupId){this.el.findParent('.form-group',false,true).removeClass([this.invalidClass,this.validClass]);this.el.findParent('.form-group',false,true).addClass(this.invalidClass); -return;}var D=Roo.bootstrap.CheckBox.get(this.groupId);if(!D){return;}for(var i in D){D[i].el.findParent('.form-group',false,true).removeClass([this.invalidClass,this.validClass]);D[i].el.findParent('.form-group',false,true).addClass(this.invalidClass);}} -,clearInvalid:function(){Roo.bootstrap.Input.prototype.clearInvalid.call(this);var A=Roo.bootstrap.FieldLabel.get(this.name+'-group');if(A&&A.iconEl){A.iconEl.removeClass(A.validClass);A.iconEl.removeClass(A.invalidClass);}},disable:function(){if(this.inputType!='radio'){Roo.bootstrap.CheckBox.superclass.disable.call(this); +}if(B){B.markValid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){var fg=e.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([A.invalidClass,A.validClass]); +fg.addClass(A.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}});return;}if(!this.groupId){var fg=this.el.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([this.invalidClass,this.validClass]); +fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}return;}var C=Roo.bootstrap.CheckBox.get(this.groupId);if(!C){return;}for(var i in C){var fg=C[i].el.findParent('.form-group',false,true);if(Roo.bootstrap.version==3){fg.removeClass([this.invalidClass,this.validClass]); +fg.addClass(this.validClass);}else{fg.removeClass(['is-valid','is-invalid']);fg.addClass('is-valid');}}},markInvalid:function(A){if(this.allowBlank){return;}var B=this;this.fireEvent('invalid',this,A);var C=Roo.bootstrap.FieldLabel.get(this.name+'-group'); +if(this.groupId){C=Roo.bootstrap.FieldLabel.get(this.groupId+'-group');}if(C){C.markInvalid();}if(this.inputType=='radio'){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){var fg=e.findParent('.form-group',false,true); +if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}});return;}if(!this.groupId){var fg=this.el.findParent('.form-group',false,true); +if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}return;}var D=Roo.bootstrap.CheckBox.get(this.groupId);if(!D){return;}for(var i in D){var fg=D[i].el.findParent('.form-group',false,true); +if(Roo.bootstrap.version==3){fg.removeClass([B.invalidClass,B.validClass]);fg.addClass(B.invalidClass);}else{fg.removeClass(['is-invalid','is-valid']);fg.addClass('is-invalid');}}},clearInvalid:function(){Roo.bootstrap.Input.prototype.clearInvalid.call(this); +var A=Roo.bootstrap.FieldLabel.get(this.name+'-group');if(A&&A.iconEl){A.iconEl.removeClass([A.validClass,A.invalidClass]);A.iconEl.removeClass(['is-invalid','is-valid']);}},disable:function(){if(this.inputType!='radio'){Roo.bootstrap.CheckBox.superclass.disable.call(this); return;}var A=this;if(this.rendered){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){A.getActionEl().addClass(this.disabledClass);e.dom.disabled=true;});}this.disabled=true;this.fireEvent("disable",this);return this; },enable:function(){if(this.inputType!='radio'){Roo.bootstrap.CheckBox.superclass.enable.call(this);return;}var A=this;if(this.rendered){Roo.each(this.el.up('form').select('input[name='+this.name+']',true).elements,function(e){A.getActionEl().removeClass(this.disabledClass); e.dom.disabled=false;});}this.disabled=false;this.fireEvent("enable",this);return this;},setBoxLabel:function(v){this.boxLabel=v;if(this.rendered){this.el.select('label.box-label',true).first().dom.innerHTML=(v===null||v===undefined?'':v);}}});Roo.apply(Roo.bootstrap.CheckBox,{groups:{} @@ -927,45 +938,47 @@ this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden hide');if(Roo }if(typeof h=='number'){this.iframe.style.height=h+'px';if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(h-(this.iframePad*2))+'px';}}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide']); }else{Roo.get(this.iframe).removeClass(['x-hidden','hide']);this.deferFocus();}},cleanHtml:function(A){A=String(A);if(A.length>5){if(Roo.isSafari){A=A.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,'');}}if(A==' '){A='';}return A; },syncValue:function(){if(this.initialized){var bd=(this.doc.body||this.doc.documentElement);var A=bd.innerHTML;if(Roo.isSafari){var bs=bd.getAttribute('style');var m=bs?bs.match(/text-align:(.*?);/i):false;if(m&&m[1]){A='
'+A+'
'; -}}A=this.cleanHtml(A);A=A.replace(/([\x80-\uffff])/g,function(a,b){var cc=b.charCodeAt();if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return b;}return "&#"+cc+";"});if(this.owner.fireEvent('beforesync',this,A)!==false){this.el.dom.value=A; -this.owner.fireEvent('sync',this,A);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement);d.innerHTML=v;this.cleanUpPaste();this.el.dom.value=d.innerHTML; -this.owner.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe;if(Roo.isIE){this.doc=A.contentWindow.document; -this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow);}},initEditor:function(){this.assignDocWin(); -this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);A.bgProperties='fixed';Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this} +}}A=this.cleanHtml(A);A=A.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g,function(B){var cc=B.charCodeAt();if(B.length==2){var C=B.charCodeAt(0)-0xD800;var D=B.charCodeAt(1)-0xDC00;cc=(C*0x400)+D+0x10000;}else if((cc>=0x4E00&&cc<0xA000)||(cc>=0x3400&&cc<0x4E00)||(cc>=0xf900&&cc<0xfb00)){return B; +}return "&#"+cc+";";});if(this.owner.fireEvent('beforesync',this,A)!==false){this.el.dom.value=A;this.owner.fireEvent('sync',this,A);}}},pushValue:function(){if(this.initialized){var v=this.el.dom.value.trim();if(this.owner.fireEvent('beforepush',this,v)!==false){var d=(this.doc.body||this.doc.documentElement); +d.innerHTML=v;this.cleanUpPaste();this.el.dom.value=d.innerHTML;this.owner.fireEvent('push',this,v);}}},deferFocus:function(){this.focus.defer(10,this);},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus();}else{this.el.focus();}},assignDocWin:function(){var A=this.iframe; +if(Roo.isIE){this.doc=A.contentWindow.document;this.win=A.contentWindow;}else{if(!Roo.get(this.frameId)&&!A.contentDocument){return;}this.doc=(A.contentDocument||Roo.get(this.frameId).dom.document);this.win=(A.contentWindow||Roo.get(this.frameId).dom.contentWindow); +}},initEditor:function(){this.assignDocWin();this.doc.designMode="on";this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var A=(this.doc.body||this.doc.documentElement);A.bgProperties='fixed';Roo.EventManager.on(this.doc,{'mouseup':this.onEditorEvent,'dblclick':this.onEditorEvent,'click':this.onEditorEvent,'keyup':this.onEditorEvent,buffer:100,scope:this} );if(Roo.isGecko){Roo.EventManager.on(this.doc,'keypress',this.mozKeyPress,this);}if(Roo.isIE||Roo.isSafari||Roo.isOpera){Roo.EventManager.on(this.doc,'keydown',this.fixKeys,this);}this.initialized=true;this.owner.fireEvent('initialize',this);this.pushValue(); },onDestroy:function(){if(this.rendered){}},onFirstFocus:function(){this.assignDocWin();this.activated=true;if(Roo.isGecko){this.win.focus();var s=this.win.getSelection();if(!s.focusNode||s.focusNode.nodeType!=3){var r=s.getRangeAt(0);r.selectNodeContents((this.doc.body||this.doc.documentElement)); r.collapse(true);this.deferFocus();}try{this.execCmd('useCSS',true);this.execCmd('styleWithCSS',false);}catch(e){}}this.owner.fireEvent('activate',this);},adjustFont:function(A){var B=A.cmd=='increasefontsize'?1:-1;var v=parseInt(this.doc.queryCommandValue('FontSize')||3,10); if(Roo.isSafari){var sm={10:1,13:2,16:3,18:4,24:5,32:6,48:7};v=(v<10)?10:v;v=(v>48)?48:v;v=typeof(sm[v])=='undefined'?1:sm[v];}v=Math.max(1,v+B);this.execCmd('FontSize',v);},onEditorEvent:function(e){this.owner.fireEvent('editorevent',this,e);this.syncValue(); -},insertTag:function(tg){if(tg.toLowerCase()=='span'||tg.toLowerCase()=='code'){range=this.createRange(this.getSelection());var A=this.doc.createElement(tg.toLowerCase());A.appendChild(range.extractContents());range.insertNode(A);return;}this.execCmd("formatblock",tg); -},insertText:function(A){var B=this.createRange();B.deleteContents();B.insertNode(this.doc.createTextNode(A));},relayCmd:function(A,B){this.win.focus();this.execCmd(A,B);this.owner.fireEvent('editorevent',this);this.owner.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B); -this.syncValue();},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isGecko||Roo.isOpera||Roo.isSafari){this.win.focus();var B,C;var D=this.win;if(D.getSelection&&D.getSelection().getRangeAt){B=D.getSelection().getRangeAt(0);C=typeof(A)=='string'?B.createContextualFragment(A):A; -B.insertNode(C);}else if(D.document.selection&&D.document.selection.createRange){var E=typeof(A)=='string'?A:A.outerHTML;D.document.selection.createRange().pasteHTML(E);}else{var E=typeof(A)=='string'?A:A.outerHTML;this.execCmd('InsertHTML',E);}this.syncValue(); -this.deferFocus();}},mozKeyPress:function(e){if(e.ctrlKey){var c=e.getCharCode(),A;if(c>0){c=String.fromCharCode(c).toLowerCase();switch(c){case 'b':A='bold';break;case 'i':A='italic';break;case 'u':A='underline';break;case 'v':this.cleanUpPaste.defer(100,this); -return;}if(A){this.win.focus();this.execCmd(A);this.deferFocus();e.preventDefault();}}}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    '); -this.deferFocus();}return;}if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var A=r.parentElement();if(!A||A.tagName.toLowerCase()!='li'){e.stopEvent();r.pasteHTML('
');r.collapse(false);r.select();}}}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this); -return;}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    ');this.deferFocus();}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this); -return;}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();return;}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}}(),getAllAncestors:function(){var p=this.getSelectedNode(); -var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;}a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin();return Roo.isIE?this.doc.selection:this.win.getSelection(); -},getSelectedNode:function(){var A=this.createRange(this.getSelection()).cloneRange();if(Roo.isIE){var B=A.parentElement();while(true){var C=A.duplicate();C.moveToElementText(B);if(C.inRange(A)){break;}if((B.nodeType!=1)||(B.tagName.toLowerCase()=='body')){break; -}B=B.parentElement;}return B;}var ac=A.commonAncestorContainer;if(ac.nodeType==3){ac=ac.parentNode;}var ar=ac.childNodes;var D=[];var E=[];var F=false;for(var i=0;i0)){E.push(ar[i]);continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue;}F=true;}if(!D.length&&E.length){D=E;}if(F||!D.length||(D.length>1)){return false; -}return D[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();}catch(e){return this.doc.createRange();}}else{return this.doc.createRange();}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection(); -var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B); -}var D=A.cloneRange();D.collapse(true);var E=A.cloneRange();E.collapse(false);var F=C.cloneRange();F.collapse(true);var G=C.cloneRange();G.collapse(false);return D.compareBoundaryPoints(Range.START_TO_START,G)==-1&&E.compareBoundaryPoints(Range.START_TO_START,F)==1; +},insertTag:function(tg){if(tg.toLowerCase()=='span'||tg.toLowerCase()=='code'||tg.toLowerCase()=='sup'||tg.toLowerCase()=='sub'){range=this.createRange(this.getSelection());var A=this.doc.createElement(tg.toLowerCase());A.appendChild(range.extractContents()); +range.insertNode(A);return;}this.execCmd("formatblock",tg);},insertText:function(A){var B=this.createRange();B.deleteContents();B.insertNode(this.doc.createTextNode(A));},relayCmd:function(A,B){this.win.focus();this.execCmd(A,B);this.owner.fireEvent('editorevent',this); +this.owner.deferFocus();},execCmd:function(A,B){this.doc.execCommand(A,false,B===undefined?null:B);this.syncValue();},insertAtCursor:function(A){if(!this.activated){return;}if(Roo.isGecko||Roo.isOpera||Roo.isSafari){this.win.focus();var B,C;var D=this.win; +if(D.getSelection&&D.getSelection().getRangeAt){B=D.getSelection().getRangeAt(0);C=typeof(A)=='string'?B.createContextualFragment(A):A;B.insertNode(C);}else if(D.document.selection&&D.document.selection.createRange){var E=typeof(A)=='string'?A:A.outerHTML; +D.document.selection.createRange().pasteHTML(E);}else{var E=typeof(A)=='string'?A:A.outerHTML;this.execCmd('InsertHTML',E);}this.syncValue();this.deferFocus();}},mozKeyPress:function(e){if(e.ctrlKey){var c=e.getCharCode(),A;if(c>0){c=String.fromCharCode(c).toLowerCase(); +switch(c){case 'b':A='bold';break;case 'i':A='italic';break;case 'u':A='underline';break;case 'v':this.cleanUpPaste.defer(100,this);return;}if(A){this.win.focus();this.execCmd(A);this.deferFocus();e.preventDefault();}}}},fixKeys:function(){if(Roo.isIE){return function(e){var k=e.getKey(),r; +if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML('    ');this.deferFocus();}return;}if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var A=r.parentElement();if(!A||A.tagName.toLowerCase()!='li'){e.stopEvent(); +r.pasteHTML('
');r.collapse(false);r.select();}}}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}else if(Roo.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd('InsertHTML','    '); +this.deferFocus();}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this);return;}};}else if(Roo.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd('InsertText','\t');this.deferFocus();return;}if(String.fromCharCode(k).toLowerCase()=='v'){this.cleanUpPaste.defer(100,this); +return;}};}}(),getAllAncestors:function(){var p=this.getSelectedNode();var a=[];if(!p){a.push(p);p=this.getParentElement();}while(p&&(p.nodeType==1)&&(p.tagName.toLowerCase()!='body')){a.push(p);p=p.parentNode;}a.push(this.doc.body);return a;},lastSel:false,lastSelNode:false,getSelection:function(){this.assignDocWin(); +return Roo.isIE?this.doc.selection:this.win.getSelection();},getSelectedNode:function(){var A=this.createRange(this.getSelection()).cloneRange();if(Roo.isIE){var B=A.parentElement();while(true){var C=A.duplicate();C.moveToElementText(B);if(C.inRange(A)){break; +}if((B.nodeType!=1)||(B.tagName.toLowerCase()=='body')){break;}B=B.parentElement;}return B;}var ac=A.commonAncestorContainer;if(ac.nodeType==3){ac=ac.parentNode;}var ar=ac.childNodes;var D=[];var E=[];var F=false;for(var i=0;i0)){E.push(ar[i]);continue;}if(!this.rangeIntersectsNode(A,ar[i])||(this.rangeCompareNode(A,ar[i])==0)){continue; +}F=true;}if(!D.length&&E.length){D=E;}if(F||!D.length||(D.length>1)){return false;}return D[0];},createRange:function(A){if(typeof A!="undefined"){try{return A.getRangeAt?A.getRangeAt(0):A.createRange();}catch(e){return this.doc.createRange();}}else{return this.doc.createRange(); +}},getParentElement:function(){this.assignDocWin();var A=Roo.isIE?this.doc.selection:this.win.getSelection();var B=this.createRange(A);try{var p=B.commonAncestorContainer;while(p.nodeType==3){p=p.parentNode;}return p;}catch(e){return null;}},rangeIntersectsNode:function(A,B){var C=B.ownerDocument.createRange(); +try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}var D=A.cloneRange();D.collapse(true);var E=A.cloneRange();E.collapse(false);var F=C.cloneRange();F.collapse(true);var G=C.cloneRange();G.collapse(false);return D.compareBoundaryPoints(Range.START_TO_START,G)==-1&&E.compareBoundaryPoints(Range.START_TO_START,F)==1; },rangeCompareNode:function(A,B){var C=B.ownerDocument.createRange();try{C.selectNode(B);}catch(e){C.selectNodeContents(B);}A.collapse(true);C.collapse(true);var ss=A.compareBoundaryPoints(Range.START_TO_START,C);var ee=A.compareBoundaryPoints(Range.END_TO_END,C); var D=ss==1;var E=ee==-1;if(D&&E){return 0;}if(!D&&E){return 1;}if(D&&!E){return 2;}return 3;},cleanUpPaste:function(){Roo.log('cleanuppaste');this.cleanUpChildren(this.doc.body);var A=this.cleanWordChars(this.doc.body.innerHTML);if(A!=this.doc.body.innerHTML){this.doc.body.innerHTML=A; }},cleanWordChars:function(A){var he=Roo.HtmlEditorCore;var B=A;Roo.each(he.swapCodes,function(sw){var C=new RegExp("\\u"+sw[0].toString(16),"g");B=B.replace(C,sw[1]);});return B;},cleanUpChildren:function(n){if(!n.childNodes.length){return;}for(var i=n.childNodes.length-1; i>-1;i--){this.cleanUpChild(n.childNodes[i]);}},cleanUpChild:function(A){var ed=this;if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return;}var B=A.tagName.toLowerCase();if(this.black.indexOf(B)>-1&&this.clearUp){A.parentNode.removeChild(A); -return;}var C=Roo.HtmlEditorCore.remove.indexOf(A.tagName.toLowerCase())>-1;if(C){this.cleanUpChildren(A);while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A);}A.parentNode.removeChild(A);return;}if(!A.attributes||!A.attributes.length){this.cleanUpChildren(A); -return;}function cleanAttr(n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)||v.match(/^ftp:/)){return;}if(v.match(/^#/)){return;}A.removeAttribute(n);}var D=this.cwhite;var E=this.cblack;function cleanStyle(n,v){if(v.match(/expression/)){A.removeAttribute(n); -return;}var F=v.split(/;/);var G=[];Roo.each(F,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,'');if(!p.length){return true;}var l=p.split(':').shift().replace(/\s+/g,'');l=l.replace(/^\s+/g,'').replace(/\s+$/g,'');if(D.length&&E.indexOf(l)>-1){return true; -}if(D.length&&D.indexOf(l)<0){return true;}G.push(p);return true;});if(G.length){A.setAttribute(n,G.join(';'));}else{A.removeAttribute(n);}}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name); -continue;}if(Roo.HtmlEditorCore.ablack.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.aclean.indexOf(a.name.toLowerCase())>-1){cleanAttr(a.name,a.value);continue;}if(a.name=='style'){cleanStyle(a.name,a.value); -continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.className='';}if(a.value.match(/^body$/)){A.className='';}continue;}}this.cleanUpChildren(A);},cleanWord:function(A){if(!A){this.cleanWord(this.doc.body);return;}if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A); -return;}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn); -A.parentNode.insertBefore(cn,A);}A.parentNode.removeChild(A);this.iterateChildren(A,this.cleanWord);return;}if(A.className.length){var cn=A.className.split(/\W+/);var B=[];Roo.each(cn,function(E){if(E.match(/Mso[a-zA-Z]+/)){return;}B.push(E);});A.className=B.length?B.join(' '):''; -if(!B.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var C=A.getAttribute("style").split(";");var D=[];Roo.each(C,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return; -}D.push(s);});A.setAttribute("style",D.length?D.join(';'):'');if(!D.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanWord);},iterateChildren:function(A,fn){if(!A.childNodes.length){return;}for(var i=A.childNodes.length-1;i>-1;i--){fn.call(this,A.childNodes[i])} +return;}var C=Roo.HtmlEditorCore.remove.indexOf(A.tagName.toLowerCase())>-1;if((!A.attributes||!A.attributes.length)&&B=='span'){C=true;}if(C){this.cleanUpChildren(A);while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn);A.parentNode.insertBefore(cn,A); +}A.parentNode.removeChild(A);return;}if(!A.attributes||!A.attributes.length){this.cleanUpChildren(A);return;}function cleanAttr(n,v){if(v.match(/^\./)||v.match(/^\//)){return;}if(v.match(/^(http|https):\/\//)||v.match(/^mailto:/)||v.match(/^ftp:/)){return; +}if(v.match(/^#/)){return;}A.removeAttribute(n);}var D=this.cwhite;var E=this.cblack;function cleanStyle(n,v){if(v.match(/expression/)){A.removeAttribute(n);return;}var F=v.split(/;/);var G=[];Roo.each(F,function(p){p=p.replace(/^\s+/g,'').replace(/\s+$/g,''); +if(!p.length){return true;}var l=p.split(':').shift().replace(/\s+/g,'');l=l.replace(/^\s+/g,'').replace(/\s+$/g,'');if(D.length&&E.indexOf(l)>-1){return true;}if(D.length&&D.indexOf(l)<0){return true;}G.push(p);return true;});if(G.length){A.setAttribute(n,G.join(';')); +}else{A.removeAttribute(n);}}for(var i=A.attributes.length-1;i>-1;i--){var a=A.attributes[i];if(a.name.toLowerCase().substr(0,2)=='on'){A.removeAttribute(a.name);continue;}if(Roo.HtmlEditorCore.ablack.indexOf(a.name.toLowerCase())>-1){A.removeAttribute(a.name); +continue;}if(Roo.HtmlEditorCore.aclean.indexOf(a.name.toLowerCase())>-1){cleanAttr(a.name,a.value);continue;}if(a.name=='style'){cleanStyle(a.name,a.value);continue;}if(a.name=='class'){if(a.value.match(/^Mso/)){A.removeAttribute('class');}if(a.value.match(/^body$/)){A.removeAttribute('class'); +}continue;}}this.cleanUpChildren(A);},cleanWord:function(A){if(!A){this.cleanWord(this.doc.body);return;}if(A.nodeName=='SPAN'&&!A.hasAttributes()&&A.childNodes.length==1&&A.firstChild.nodeName=="#text"){var B=A.firstChild;A.removeChild(B);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A); +}A.parentNode.insertBefore(B,A);if(A.getAttribute('lang')!='zh-CN'){A.parentNode.insertBefore(A.ownerDocument.createTextNode(" "),A);}A.parentNode.removeChild(A);}if(A.nodeName=="#text"){return;}if(A.nodeName=="#comment"){A.parentNode.removeChild(A);return; +}if(A.tagName.toLowerCase().match(/^(style|script|applet|embed|noframes|noscript)$/)){A.parentNode.removeChild(A);return;}if(A.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)){while(A.childNodes.length){var cn=A.childNodes[0];A.removeChild(cn); +A.parentNode.insertBefore(cn,A);this.cleanWord(cn);}A.parentNode.removeChild(A);return;}if(A.className.length){var cn=A.className.split(/\W+/);var C=[];Roo.each(cn,function(F){if(F.match(/Mso[a-zA-Z]+/)){return;}C.push(F);});A.className=C.length?C.join(' '):''; +if(!C.length){A.removeAttribute("class");}}if(A.hasAttribute("lang")){A.removeAttribute("lang");}if(A.hasAttribute("style")){var D=A.getAttribute("style").split(";");var E=[];Roo.each(D,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^(mso-|line|font|background|margin|padding|color)/)){return; +}E.push(s);});A.setAttribute("style",E.length?E.join(';'):'');if(!E.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanWord);},iterateChildren:function(A,fn){if(!A.childNodes.length){return;}for(var i=A.childNodes.length-1;i>-1;i--){fn.call(this,A.childNodes[i])} },cleanTableWidths:function(A){if(!A){this.cleanTableWidths(this.doc.body);return;}if(A.nodeName=="#text"||A.nodeName=="#comment"){return;}Roo.log(A.tagName);if(!A.tagName.toLowerCase().match(/^(table|td|tr)$/)){this.iterateChildren(A,this.cleanTableWidths); return;}if(A.hasAttribute('width')){A.removeAttribute('width');}if(A.hasAttribute("style")){var B=A.getAttribute("style").split(";");var C=[];Roo.each(B,function(s){if(!s.match(/:/)){return;}var kv=s.split(":");if(kv[0].match(/^\s*(width|min-width)\s*$/)){return; }C.push(s);});A.setAttribute("style",C.length?C.join(';'):'');if(!C.length){A.removeAttribute('style');}}this.iterateChildren(A,this.cleanTableWidths);},domToHTML:function(A,B,C){B=B||0;C=C||false;if(!A){return this.domToHTML(this.doc.body);}var j;var D=false; @@ -999,8 +1012,8 @@ for(var i=0;i'+f+'',tagname:f,listeners:{click:function(){C.insertTag(this.tagname); +Roo.log(this.el);this.el.dom.style.marginBottom='0';var B=this;var C=this.editorcore;var D=this.editor;var E=[];var F=function(id,G,H,I,J){var K=H?'toggle':'click';var a={size:'sm',xtype:'Button',xns:Roo.bootstrap,fa:id,cmd:id||G,enableToggle:H!==false,html:J||'',pressed:H?false:null,listeners:{} +};a.listeners[H?'toggle':'click']=function(){I?I.call(B,this):B.onBtnClick.call(B,G||id);};E.push(a);return a;};var style={xtype:'Button',size:'sm',xns:Roo.bootstrap,fa:'font',menu:{xtype:'Menu',xns:Roo.bootstrap,items:[]}};Roo.each(this.formats,function(f){style.menu.items.push({xtype:'MenuItem',xns:Roo.bootstrap,html:'<'+f+' style="margin:2px">'+f+'',tagname:f,listeners:{click:function(){C.insertTag(this.tagname); D.focus();}}});});E.push(style);F('bold',false,true);F('italic',false,true);F('align-left','justifyleft',true);F('align-center','justifycenter',true);F('align-right','justifyright',true);F('link',false,false,function(G){var H=prompt(this.createLinkText,this.defaultLinkValue); if(H&&H!='http:/'+'/'){this.editorcore.relayCmd('createlink',H);}}),F('list','insertunorderedlist',true);F('pencil',false,true,function(G){Roo.log(this);this.toggleSourceEdit(G.pressed);});if(this.editor.btns.length>0){for(var i=0;i0){B[0].cls+=' col-xs-'+this.labelxs;B[1].cls+=' col-xs-'+(12-this.labelxs);}}}var C={tag:'div',cls:'row clearfix',cn:B};return C;},initEvents:function(){this.managerEl=this.el.select('.roo-document-manager',true).first();this.managerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block'; this.selectorEl=this.el.select('.roo-document-manager-selector',true).first();this.selectorEl.hide();if(this.multiple){this.selectorEl.attr('multiple','multiple');}this.selectorEl.on('change',this.onFileSelected,this);this.uploader=this.el.select('.roo-document-manager-uploader',true).first(); this.uploader.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.uploader.on('click',this.onUploaderClick,this);this.renderProgressDialog();var A=this;window.addEventListener("resize",function(){A.refresh();});this.fireEvent('initial',this); -},renderProgressDialog:function(){var A=this;this.progressDialog=new Roo.bootstrap.Modal({cls:'roo-document-manager-progress-dialog',allow_close:false,title:'',buttons:[{name:'cancel',weight:'danger',html:'Cancel'}],listeners:{btnclick:function(){A.uploadCancel(); +},renderProgressDialog:function(){var A=this;this.progressDialog=new Roo.bootstrap.Modal({cls:'roo-document-manager-progress-dialog',allow_close:false,animate:false,title:'',buttons:[{name:'cancel',weight:'danger',html:'Cancel'}],listeners:{btnclick:function(){A.uploadCancel(); this.hide();}}});this.progressDialog.render(Roo.get(document.body));this.progress=new Roo.bootstrap.Progress({cls:'roo-document-manager-progress',active:true,striped:true});this.progress.render(this.progressDialog.getChildContainer());this.progressBar=new Roo.bootstrap.ProgressBar({cls:'roo-document-manager-progress-bar',aria_valuenow:0,aria_valuemin:0,aria_valuemax:12,panel:'success'} );this.progressBar.render(this.progress.getChildContainer());},onUploaderClick:function(e){e.preventDefault();if(this.fireEvent('beforeselectfile',this)!=false){this.selectorEl.dom.click();}},onFileSelected:function(e){e.preventDefault();if(typeof(this.selectorEl.dom.files)=='undefined'||!this.selectorEl.dom.files.length){return; }Roo.each(this.selectorEl.dom.files,function(A){if(this.fireEvent('inspect',this,A)!=false){this.files.push(A);}},this);this.queue();},queue:function(){this.selectorEl.dom.value='';if(!this.files||!this.files.length){return;}if(this.boxes>0&&this.files.length>this.boxes){this.files=this.files.slice(0,this.boxes); @@ -1298,10 +1311,10 @@ Roo.bootstrap.FieldLabel=function(A){Roo.bootstrap.Element.superclass.constructo if(!this.allowBlank){A="visible";}var B={tag:this.tag,cls:'roo-bootstrap-field-label '+this.cls,for:this.target,cn:[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star '+A,tooltip:this.iconTooltip},{tag:'span',html:this.html}]} ;if(this.indicatorpos=='right'){var B={tag:this.tag,cls:'roo-bootstrap-field-label '+this.cls,for:this.target,cn:[{tag:'span',html:this.html},{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star '+A,tooltip:this.iconTooltip}]} ;}return B;},initEvents:function(){Roo.bootstrap.Element.superclass.initEvents.call(this);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}Roo.bootstrap.FieldLabel.register(this); -},indicatorEl:function(){var A=this.el.select('i.roo-required-indicator',true).first();if(!A){return false;}return A;},markValid:function(){if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}this.el.removeClass(this.invalidClass); -this.el.addClass(this.validClass);this.fireEvent('valid',this);},markInvalid:function(A){if(this.indicator){this.indicator.removeClass('invisible');this.indicator.addClass('visible');}this.el.removeClass(this.validClass);this.el.addClass(this.invalidClass); -this.fireEvent('invalid',this,A);}});Roo.apply(Roo.bootstrap.FieldLabel,{groups:{},register:function(A){if(this.groups.hasOwnProperty(A.target)){return;}this.groups[A.target]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A]; -}}); +},indicatorEl:function(){var A=this.el.select('i.roo-required-indicator',true).first();if(!A){return false;}return A;},markValid:function(){if(this.indicator){this.indicator.removeClass('visible');this.indicator.addClass('invisible');}if(Roo.bootstrap.version==3){this.el.removeClass(this.invalidClass); +this.el.addClass(this.validClass);}else{this.el.removeClass('is-invalid');this.el.addClass('is-valid');}this.fireEvent('valid',this);},markInvalid:function(A){if(this.indicator){this.indicator.removeClass('invisible');this.indicator.addClass('visible');}if(Roo.bootstrap.version==3){this.el.removeClass(this.validClass); +this.el.addClass(this.invalidClass);}else{this.el.removeClass('is-valid');this.el.addClass('is-invalid');}this.fireEvent('invalid',this,A);}});Roo.apply(Roo.bootstrap.FieldLabel,{groups:{},register:function(A){if(this.groups.hasOwnProperty(A.target)){return; +}this.groups[A.target]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false;}return this.groups[A];}}); // Roo/bootstrap/DateSplitField.js Roo.bootstrap.DateSplitField=function(A){Roo.bootstrap.DateSplitField.superclass.constructor.call(this,A);this.addEvents({"years":true,"days":true,invalid:true,valid:true});};Roo.extend(Roo.bootstrap.DateSplitField,Roo.bootstrap.Component,{fieldLabel:'',labelAlign:'top',labelWidth:3,dayAllowBlank:false,monthAllowBlank:false,yearAllowBlank:false,dayPlaceholder:'',monthPlaceholder:'',yearPlaceholder:'',dayFormat:'d',monthFormat:'m',yearFormat:'Y',isFormField:true,labellg:0,labelmd:0,labelsm:0,labelxs:0,getAutoCreate:function(){var A={tag:'div',cls:'row roo-date-split-field-group',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field roo-date-split-field-group-value',name:this.name} ]};var B='col-md-12';var C='col-md-4';if(this.fieldLabel){var D={tag:'div',cls:'column roo-date-split-field-label col-md-'+((this.labelAlign=='top')?'12':this.labelWidth),cn:[{tag:'label',html:this.fieldLabel}]};if(this.labelAlign=='left'){if(this.labelWidth>12){D.style="width: "+this.labelWidth+'px'; @@ -1439,16 +1452,17 @@ this.prevIndicator.show();if(this.indicator==1){this.prevIndicator.hide();}this. this.fireEvent('click',this);},prev:function(e){e.preventDefault();this.indicator=Math.max(1,this.indicator-1);this.update();},next:function(e){e.preventDefault();this.indicator=Math.min(this.files.length,this.indicator+1);this.update();}}); // Roo/bootstrap/RadioSet.js Roo.bootstrap.RadioSet=function(A){Roo.bootstrap.RadioSet.superclass.constructor.call(this,A);this.radioes=[];Roo.bootstrap.RadioSet.register(this);this.addEvents({check:true,click:true});};Roo.extend(Roo.bootstrap.RadioSet,Roo.bootstrap.Input,{radioes:false,inline:true,weight:'',indicatorpos:'left',getAutoCreate:function(){var A={tag:'label',cls:'roo-radio-set-label',cn:[{tag:'span',html:this.fieldLabel} -]};if(this.indicatorpos=='left'){A.cn.unshift({tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'});}else{A.cn.push({tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} -);}var B={tag:'div',cls:'roo-radio-set-items'};var C=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;if(C==='left'&&this.fieldLabel.length){B={cls:"roo-radio-set-right",cn:[B]};if(this.labelWidth>12){A.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth; +]};if(Roo.bootstrap.version==3){if(this.indicatorpos=='left'){A.cn.unshift({tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'});}else{A.cn.push({tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'} +);}}var B={tag:'div',cls:'roo-radio-set-items'};var C=(!this.labelAlign)?this.parentLabelAlign():this.labelAlign;if(C==='left'&&this.fieldLabel.length){B={cls:"roo-radio-set-right",cn:[B]};if(this.labelWidth>12){A.style="width: "+this.labelWidth+'px';}if(this.labelWidth<13&&this.labelmd==0){this.labelmd=this.labelWidth; }if(this.labellg>0){A.cls+=' col-lg-'+this.labellg;B.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){A.cls+=' col-md-'+this.labelmd;B.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){A.cls+=' col-sm-'+this.labelsm;B.cls+=' col-sm-'+(12-this.labelsm); }if(this.labelxs>0){A.cls+=' col-xs-'+this.labelxs;B.cls+=' col-xs-'+(12-this.labelxs);}}var D={tag:'div',cls:'roo-radio-set',cn:[{tag:'input',cls:'roo-radio-set-input',type:'hidden',name:this.name,value:this.value?this.value:''},A,B]};if(this.weight.length){D.cls+=' roo-radio-'+this.weight; }if(this.inline){D.cls+=' roo-radio-set-inline';}var E=this;['xs','sm','md','lg'].map(function(F){if(E[F]){D.cls+=' col-'+F+'-'+E[F];}});return D;},initEvents:function(){this.labelEl=this.el.select('.roo-radio-set-label',true).first();this.labelEl.setVisibilityMode(Roo.Element.DISPLAY); if(!this.fieldLabel.length){this.labelEl.hide();}this.itemsEl=this.el.select('.roo-radio-set-items',true).first();this.itemsEl.setVisibilityMode(Roo.Element.DISPLAY);this.indicator=this.indicatorEl();if(this.indicator){this.indicator.addClass('invisible'); }this.originalValue=this.getValue();},inputEl:function(){return this.el.select('.roo-radio-set-input',true).first();},getChildContainer:function(){return this.itemsEl;},register:function(A){this.radioes.push(A);},validate:function(){if(this.getVisibilityEl().hasClass('hidden')){return true; -}var A=false;Roo.each(this.radioes,function(i){if(!i.checked){return;}A=true;return false;});if(this.allowBlank){return true;}if(this.disabled||A){this.markValid();return true;}this.markInvalid();return false;},markValid:function(){if(this.labelEl.isVisible(true)){this.indicatorEl().removeClass('visible'); -this.indicatorEl().addClass('invisible');}this.el.removeClass([this.invalidClass,this.validClass]);this.el.addClass(this.validClass);this.fireEvent('valid',this);},markInvalid:function(A){if(this.allowBlank||this.disabled){return;}if(this.labelEl.isVisible(true)){this.indicatorEl().removeClass('invisible'); -this.indicatorEl().addClass('visible');}this.el.removeClass([this.invalidClass,this.validClass]);this.el.addClass(this.invalidClass);this.fireEvent('invalid',this,A);},setValue:function(v,A){if(this.value===v){return;}this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v); +}var A=false;Roo.each(this.radioes,function(i){if(!i.checked){return;}A=true;return false;});if(this.allowBlank){return true;}if(this.disabled||A){this.markValid();return true;}this.markInvalid();return false;},markValid:function(){if(this.labelEl.isVisible(true)&&this.indicatorEl()){this.indicatorEl().removeClass('visible'); +this.indicatorEl().addClass('invisible');}if(Roo.bootstrap.version==3){this.el.removeClass([this.invalidClass,this.validClass]);this.el.addClass(this.validClass);}else{this.el.removeClass(['is-invalid','is-valid']);this.el.addClass(['is-valid']);}this.fireEvent('valid',this); +},markInvalid:function(A){if(this.allowBlank||this.disabled){return;}if(this.labelEl.isVisible(true)&&this.indicatorEl()){this.indicatorEl().removeClass('invisible');this.indicatorEl().addClass('visible');}if(Roo.bootstrap.version==3){this.el.removeClass([this.invalidClass,this.validClass]); +this.el.addClass(this.invalidClass);}else{this.el.removeClass(['is-invalid','is-valid']);this.el.addClass(['is-invalid']);}this.fireEvent('invalid',this,A);},setValue:function(v,A){if(this.value===v){return;}this.value=v;if(this.rendered){this.inputEl().dom.value=(v===null||v===undefined?'':v); }Roo.each(this.radioes,function(i){i.checked=false;i.el.removeClass('checked');});Roo.each(this.radioes,function(i){if(i.value===v||i.value.toString()===v.toString()){i.checked=true;i.el.addClass('checked');if(A!==true){this.fireEvent('check',this,i);}return false; }},this);this.validate();},clearInvalid:function(){if(!this.el||this.preventMark){return;}this.el.removeClass([this.invalidClass]);this.fireEvent('valid',this);}});Roo.apply(Roo.bootstrap.RadioSet,{groups:{},register:function(A){this.groups[A.name]=A;},get:function(A){if(typeof(this.groups[A])=='undefined'){return false; }return this.groups[A];}}); @@ -1484,16 +1498,17 @@ this.layout();},onRegionCollapsed:function(A){this.fireEvent("regioncollapsed",A }}}); // Roo/bootstrap/layout/Border.js Roo.bootstrap.layout.Border=function(A){A=A||{};Roo.bootstrap.layout.Border.superclass.constructor.call(this,A);Roo.each(Roo.bootstrap.layout.Border.regions,function(B){if(A[B]){A[B].region=B;this.addRegion(A[B]);}},this);};Roo.bootstrap.layout.Border.regions=["north","south","east","west","center"]; -Roo.extend(Roo.bootstrap.layout.Border,Roo.bootstrap.layout.Manager,{addRegion:function(A){if(!this.regions[A.region]){var r=this.factory(A);this.bindRegion(r);}return this.regions[A.region];},bindRegion:function(r){this.regions[r.config.region]=r;r.on("visibilitychange",this.layout,this); -r.on("paneladded",this.layout,this);r.on("panelremoved",this.layout,this);r.on("invalidated",this.layout,this);r.on("resized",this.onRegionResized,this);r.on("collapsed",this.onRegionCollapsed,this);r.on("expanded",this.onRegionExpanded,this);},layout:function(){if(this.updating){return; -}Roo.each(Roo.bootstrap.layout.Border.regions,function(N){if(this.regions[N]&&!this.regions[N].bodyEl){this.regions[N].onRender(this.el)}},this);var A=this.getViewSize();var w=A.width;var h=A.height;var B=w;var C=h;var D=0;var E=0;var rs=this.regions;var F=rs["north"]; -var G=rs["south"];var H=rs["west"];var I=rs["east"];var J=rs["center"];if(F&&F.isVisible()){var b=F.getBox();var m=F.getMargins();b.width=w-(m.left+m.right);b.x=m.left;b.y=m.top;D=b.height+b.y+m.bottom;C-=D;F.updateBox(this.safeBox(b));}if(G&&G.isVisible()){var b=G.getBox(); -var m=G.getMargins();b.width=w-(m.left+m.right);b.x=m.left;var K=(b.height+m.top+m.bottom);b.y=h-K+m.top;C-=K;G.updateBox(this.safeBox(b));}if(H&&H.isVisible()){var b=H.getBox();var m=H.getMargins();b.height=C-(m.top+m.bottom);b.x=m.left;b.y=D+m.top;var L=(b.width+m.left+m.right); -E+=L;B-=L;H.updateBox(this.safeBox(b));}if(I&&I.isVisible()){var b=I.getBox();var m=I.getMargins();b.height=C-(m.top+m.bottom);var L=(b.width+m.left+m.right);b.x=w-L+m.left;b.y=D+m.top;B-=L;I.updateBox(this.safeBox(b));}if(J){var m=J.getMargins();var M={x:E+m.left,y:D+m.top,width:B-(m.left+m.right),height:C-(m.top+m.bottom)} -;J.updateBox(this.safeBox(M));}this.el.repaint();this.fireEvent("layout",this);},safeBox:function(A){A.width=Math.max(0,A.width);A.height=Math.max(0,A.height);return A;},add:function(A,B){A=A.toLowerCase();return this.regions[A].add(B);},remove:function(A,B){A=A.toLowerCase(); -return this.regions[A].remove(B);},findPanel:function(A){var rs=this.regions;for(var B in rs){if(typeof rs[B]!="function"){var p=rs[B].getPanel(A);if(p){return p;}}}return null;},showPanel:function(A){var rs=this.regions;for(var B in rs){var r=rs[B];if(typeof r!="function"){if(r.hasPanel(A)){return r.showPanel(A); -}}}return null;},addxtype:function(A){var B=false;if(typeof(A.region)=='undefined'){Roo.log("Failed to add Panel, region was not set");Roo.log(A);return false;}var C=A.region;delete A.region;var D=[];if(A.items){D=A.items;delete A.items;}var nb=false;switch(A.xtype){case 'Content':case 'Scroll':case 'View':A.autoCreate=true; -B=new A.xns[A.xtype](A);this.add(C,B);break;case 'Nest':var E=A.layout;E.el=this.el.createChild();E.items=E.items||[];delete A.layout;D=E.items;if(C=='center'&&this.active&&this.getRegion('center').panels.length<1){A.background=false;}A.layout=new Roo.bootstrap.layout.Border(E); +Roo.extend(Roo.bootstrap.layout.Border,Roo.bootstrap.layout.Manager,{parent:false,addRegion:function(A){if(!this.regions[A.region]){var r=this.factory(A);this.bindRegion(r);}return this.regions[A.region];},bindRegion:function(r){this.regions[r.config.region]=r; +r.on("visibilitychange",this.layout,this);r.on("paneladded",this.layout,this);r.on("panelremoved",this.layout,this);r.on("invalidated",this.layout,this);r.on("resized",this.onRegionResized,this);r.on("collapsed",this.onRegionCollapsed,this);r.on("expanded",this.onRegionExpanded,this); +},layout:function(){if(this.updating){return;}Roo.each(Roo.bootstrap.layout.Border.regions,function(N){if(this.regions[N]&&!this.regions[N].bodyEl){this.regions[N].onRender(this.el)}},this);var A=this.getViewSize();var w=A.width;var h=A.height;var B=w;var C=h; +var D=0;var E=0;var rs=this.regions;var F=rs["north"];var G=rs["south"];var H=rs["west"];var I=rs["east"];var J=rs["center"];if(F&&F.isVisible()){var b=F.getBox();var m=F.getMargins();b.width=w-(m.left+m.right);b.x=m.left;b.y=m.top;D=b.height+b.y+m.bottom; +C-=D;F.updateBox(this.safeBox(b));}if(G&&G.isVisible()){var b=G.getBox();var m=G.getMargins();b.width=w-(m.left+m.right);b.x=m.left;var K=(b.height+m.top+m.bottom);b.y=h-K+m.top;C-=K;G.updateBox(this.safeBox(b));}if(H&&H.isVisible()){var b=H.getBox();var m=H.getMargins(); +b.height=C-(m.top+m.bottom);b.x=m.left;b.y=D+m.top;var L=(b.width+m.left+m.right);E+=L;B-=L;H.updateBox(this.safeBox(b));}if(I&&I.isVisible()){var b=I.getBox();var m=I.getMargins();b.height=C-(m.top+m.bottom);var L=(b.width+m.left+m.right);b.x=w-L+m.left; +b.y=D+m.top;B-=L;I.updateBox(this.safeBox(b));}if(J){var m=J.getMargins();var M={x:E+m.left,y:D+m.top,width:B-(m.left+m.right),height:C-(m.top+m.bottom)};J.updateBox(this.safeBox(M));}this.el.repaint();this.fireEvent("layout",this);},safeBox:function(A){A.width=Math.max(0,A.width); +A.height=Math.max(0,A.height);return A;},add:function(A,B){A=A.toLowerCase();return this.regions[A].add(B);},remove:function(A,B){A=A.toLowerCase();return this.regions[A].remove(B);},findPanel:function(A){var rs=this.regions;for(var B in rs){if(typeof rs[B]!="function"){var p=rs[B].getPanel(A); +if(p){return p;}}}return null;},showPanel:function(A){var rs=this.regions;for(var B in rs){var r=rs[B];if(typeof r!="function"){if(r.hasPanel(A)){return r.showPanel(A);}}}return null;},addxtype:function(A){var B=false;if(typeof(A.region)=='undefined'){Roo.log("Failed to add Panel, region was not set"); +Roo.log(A);return false;}var C=A.region;delete A.region;var D=[];if(A.items){D=A.items;delete A.items;}var nb=false;if(C=='center'){Roo.log("Center: "+A.title);}switch(A.xtype){case 'Content':case 'Scroll':case 'View':A.autoCreate=A.autoCreate||true;B=new A.xns[A.xtype](A); +this.add(C,B);break;case 'Nest':var E=A.layout;E.el=this.el.createChild();E.items=E.items||[];delete A.layout;D=E.items;if(C=='center'&&this.active&&this.getRegion('center').panels.length<1){A.background=false;}A.layout=new Roo.bootstrap.layout.Border(E); B=new A.xns[A.xtype](A);this.add(C,B);nb={};break;case 'Grid':if(C=='center'&&this.active){A.background=false;}B=new A.xns[A.xtype](A);this.add(C,B);break;case 'Border':B=this;break;default:Roo.log(A);throw "Can not add '"+A.xtype+"' to Border";return null; }this.beginUpdate();var C='';var F={};Roo.each(D,function(i){C=nb&&i.region?i.region:false;var G=B.addxtype(i);if(C){nb[C]=nb[C]==undefined?0:nb[C]+1;if(!i.background){F[C]=nb[C];}}});this.endUpdate();if(nb){for(var r in F){C=this.getRegion(r);if(C){C.showPanel(F[r]); }}}return B;},factory:function(A){var B=Roo.bootstrap.layout.Border.regions;var C=A.region;A.mgr=this;var r=Roo.bootstrap.layout;Roo.log(C);switch(C){case "north":return new r.North(A);case "south":return new r.South(A);case "east":return new r.East(A);case "west":return new r.West(A); @@ -1512,18 +1527,18 @@ if(!A.background){this.setActivePanel(A);if(this.config.initialSize&&this.panels },getPosition:function(){return this.position;}}); // Roo/bootstrap/layout/Region.js Roo.bootstrap.layout.Region=function(A){this.applyConfig(A);var B=A.mgr;var C=A.region;A.skipConfig=true;Roo.bootstrap.layout.Region.superclass.constructor.call(this,A);if(B.el){this.onRender(B.el);}this.visible=true;this.collapsed=false;this.unrendered_panels=[]; -};Roo.extend(Roo.bootstrap.layout.Region,Roo.bootstrap.layout.Basic,{position:'',unrendered_panels:null,createBody:function(){this.bodyEl=this.el.createChild({tag:"div",cls:"roo-layout-panel-body tab-content"});},onRender:function(A,B){var dh=Roo.DomHelper; +};Roo.extend(Roo.bootstrap.layout.Region,Roo.bootstrap.layout.Basic,{position:'',unrendered_panels:null,tabPosition:false,mgr:false,createBody:function(){this.bodyEl=this.el.createChild({tag:"div",cls:"roo-layout-panel-body tab-content"});},onRender:function(A,B){var dh=Roo.DomHelper; this.el=dh.append(A.dom,{tag:"div",cls:(this.config.cls||'')+" roo-layout-region roo-layout-panel roo-layout-panel-"+this.position},true);this.titleEl=dh.append(this.el.dom,{tag:"div",unselectable:"on",cls:"roo-unselectable roo-layout-panel-hd breadcrumb roo-layout-title-"+this.position,children:[{tag:"span",cls:"roo-unselectable roo-layout-panel-hd-text",unselectable:"on",html:" "} ,{tag:"div",cls:"roo-unselectable roo-layout-panel-hd-tools",unselectable:"on"}]},true);this.titleEl.enableDisplayMode();this.titleTextEl=this.titleEl.dom.firstChild;this.tools=Roo.get(this.titleEl.dom.childNodes[1],true);this.createBody(this.config);if(this.config.hideWhenEmpty){this.hide(); this.on("paneladded",this.validateVisibility,this);this.on("panelremoved",this.validateVisibility,this);}if(this.autoScroll){this.bodyEl.setStyle("overflow","auto");}else{this.bodyEl.setStyle("overflow",this.config.overflow||'hidden');}if((!this.config.titlebar&&!this.config.title)||this.config.titlebar===false){this.titleEl.hide(); }else{this.titleEl.show();if(this.config.title){this.titleTextEl.innerHTML=this.config.title;}}if(this.config.collapsed){this.collapse(true);}if(this.config.hidden){this.hide();}if(this.unrendered_panels&&this.unrendered_panels.length){for(var i=0;i0){this.el.setHeight(h);h=this.titleEl&&this.titleEl.isDisplayed()?h-(this.titleEl.getHeight()||0):h; +i++){this.add(this.unrendered_panels[i]);}this.unrendered_panels=null;}},applyConfig:function(c){this.margins=c.margins||this.margins||{top:0,left:0,right:0,bottom:0};this.tabPosition=['top','bottom','west'].indexOf(c.tabPosition)>-1?c.tabPosition:"top";this.autoScroll=c.autoScroll||false; +this.duration=c.duration||.30;this.slideDuration=c.slideDuration||.45;this.config=c;},isVisible:function(){return this.visible;},getBox:function(){var b;b=this.el.getBox(false,true);return b;},getMargins:function(){return this.margins;},updateBox:function(A){if(!this.bodyEl){return; +}this.box=A;if(!this.collapsed){this.el.dom.style.left=A.x+"px";this.el.dom.style.top=A.y+"px";this.updateBody(A.width,A.height);}else{this.collapsedEl.dom.style.left=A.x+"px";this.collapsedEl.dom.style.top=A.y+"px";this.collapsedEl.setSize(A.width,A.height); +}if(this.tabs){this.tabs.autoSizeTabs();}},updateBody:function(w,h){if(w!==null){this.el.setWidth(w);w-=this.el.getBorderWidth("rl");if(this.config.adjustments){w+=this.config.adjustments[0];}}if(h!==null&&h>0){this.el.setHeight(h);h=this.titleEl&&this.titleEl.isDisplayed()?h-(this.titleEl.getHeight()||0):h; h-=this.el.getBorderWidth("tb");if(this.config.adjustments){h+=this.config.adjustments[1];}this.bodyEl.setHeight(h);if(this.tabs){h=this.tabs.syncHeight(h);}}if(this.panelSize){w=w!==null?w:this.panelSize.width;h=h!==null?h:this.panelSize.height;}if(this.activePanel){var el=this.activePanel.getEl(); w=w!==null?w:el.getWidth();h=h!==null?h:el.getHeight();this.panelSize={width:w,height:h};this.activePanel.setSize(w,h);}if(Roo.isIE&&this.tabs){this.tabs.el.repaint();}},getEl:function(){return this.el;},hide:function(){this.el.dom.style.left="-2000px";this.el.hide(); -this.visible=false;this.fireEvent("visibilitychange",this,false);},show:function(){this.el.show();this.visible=true;this.fireEvent("visibilitychange",this,true);},animateCollapse:function(){},animateExpand:function(){},initTabs:function(){var ts=new Roo.bootstrap.panel.Tabs({el:this.bodyEl.dom,tabPosition:this.bottomTabs?'bottom':'top',disableTooltips:this.config.disableTabTips,toolbar:this.config.toolbar} +this.visible=false;this.fireEvent("visibilitychange",this,false);},show:function(){this.el.show();this.visible=true;this.fireEvent("visibilitychange",this,true);},animateCollapse:function(){},animateExpand:function(){},initTabs:function(){var ts=new Roo.bootstrap.panel.Tabs({el:this.bodyEl.dom,region:this,tabPosition:this.tabPosition?this.tabPosition:'top',disableTooltips:this.config.disableTabTips,toolbar:this.config.toolbar} );if(this.config.hideTabs){ts.stripWrap.setDisplayed(false);}this.tabs=ts;ts.resizeTabs=this.config.resizeTabs===true;ts.minTabWidth=this.config.minTabWidth||40;ts.maxTabWidth=this.config.maxTabWidth||250;ts.preferredTabWidth=this.config.preferredTabWidth||150; ts.monitorResize=false;ts.bodyEl.addClass('roo-layout-tabs-body');this.panels.each(this.initPanelAsTab,this);},initPanelAsTab:function(A){var ti=this.tabs.addTab(A.getEl().id,A.getTitle(),null,this.config.closeOnTab&&A.isClosable(),A.tpl);if(A.tabTip!==undefined){ti.setTooltip(A.tabTip); }ti.on("activate",function(){this.setActivePanel(A);},this);if(this.config.closeOnTab){ti.on("beforeclose",function(t,e){e.cancel=true;this.remove(A);},this);}A.tabItem=ti;return ti;},updatePanelTitle:function(A,B){if(this.activePanel==A){this.updateTitle(B); @@ -1563,19 +1578,27 @@ break;case "north":return [0,0];break;case "south":return [0,0];break;}},getExpa break;case "north":return [0,-(cm.top+cm.bottom+c.getHeight())];break;case "south":return [0,cm.top+cm.bottom+c.getHeight()];break;}}}); // Roo/bootstrap/layout/Center.js Roo.bootstrap.layout.Center=function(A){A.region="center";Roo.bootstrap.layout.Region.call(this,A);this.visible=true;this.minWidth=A.minWidth||20;this.minHeight=A.minHeight||20;};Roo.extend(Roo.bootstrap.layout.Center,Roo.bootstrap.layout.Region,{hide:function(){} -,show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}});Roo.bootstrap.layout.North=function(A){A.region='north';A.cursor='n-resize';Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.TOP; -this.split.orientation=Roo.bootstrap.SplitBar.VERTICAL;this.split.el.addClass("roo-layout-split-v");}var B=A.initialSize||A.height;if(typeof B!="undefined"){this.el.setHeight(B);}};Roo.extend(Roo.bootstrap.layout.North,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox(); +,show:function(){},getMinWidth:function(){return this.minWidth;},getMinHeight:function(){return this.minHeight;}}); +// Roo/bootstrap/layout/North.js +Roo.bootstrap.layout.North=function(A){A.region='north';A.cursor='n-resize';Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.TOP;this.split.orientation=Roo.bootstrap.SplitBar.VERTICAL;this.split.el.addClass("roo-layout-split-v"); +}var B=A.initialSize||A.height;if(typeof B!="undefined"){this.el.setHeight(B);}};Roo.extend(Roo.bootstrap.layout.North,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox(); }var A=this.el.getBox();if(this.split){A.height+=this.split.el.getHeight();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){A.height-=this.split.el.getHeight();this.split.el.setLeft(A.x);this.split.el.setTop(A.y+A.height);this.split.el.setWidth(A.width); -}if(this.collapsed){this.updateBody(A.width,null);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}});Roo.bootstrap.layout.South=function(A){A.region='south';A.cursor='s-resize';Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.BOTTOM; -this.split.orientation=Roo.bootstrap.SplitBar.VERTICAL;this.split.el.addClass("roo-layout-split-v");}var B=A.initialSize||A.height;if(typeof B!="undefined"){this.el.setHeight(B);}};Roo.extend(Roo.bootstrap.layout.South,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox(); +}if(this.collapsed){this.updateBody(A.width,null);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}}); +// Roo/bootstrap/layout/South.js +Roo.bootstrap.layout.South=function(A){A.region='south';A.cursor='s-resize';Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.BOTTOM;this.split.orientation=Roo.bootstrap.SplitBar.VERTICAL;this.split.el.addClass("roo-layout-split-v"); +}var B=A.initialSize||A.height;if(typeof B!="undefined"){this.el.setHeight(B);}};Roo.extend(Roo.bootstrap.layout.South,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.VERTICAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox(); }var A=this.el.getBox();if(this.split){var sh=this.split.el.getHeight();A.height+=sh;A.y-=sh;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sh=this.split.el.getHeight();A.height-=sh;A.y+=sh;this.split.el.setLeft(A.x);this.split.el.setTop(A.y-sh); -this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}});Roo.bootstrap.layout.East=function(A){A.region="east";A.cursor="e-resize";Roo.bootstrap.layout.Split.call(this,A); -if(this.split){this.split.placement=Roo.bootstrap.SplitBar.RIGHT;this.split.orientation=Roo.bootstrap.SplitBar.HORIZONTAL;this.split.el.addClass("roo-layout-split-h");}var B=A.initialSize||A.width;if(typeof B!="undefined"){this.el.setWidth(B);}};Roo.extend(Roo.bootstrap.layout.East,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox(); +this.split.el.setWidth(A.width);}if(this.collapsed){this.updateBody(A.width,null);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}}); +// Roo/bootstrap/layout/East.js +Roo.bootstrap.layout.East=function(A){A.region="east";A.cursor="e-resize";Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.RIGHT;this.split.orientation=Roo.bootstrap.SplitBar.HORIZONTAL;this.split.el.addClass("roo-layout-split-h"); +}var B=A.initialSize||A.width;if(typeof B!="undefined"){this.el.setWidth(B);}};Roo.extend(Roo.bootstrap.layout.East,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.HORIZONTAL,getBox:function(){if(this.collapsed){return this.collapsedEl.getBox(); }var A=this.el.getBox();if(this.split){var sw=this.split.el.getWidth();A.width+=sw;A.x-=sw;}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();A.width-=sw;this.split.el.setLeft(A.x);this.split.el.setTop(A.y);this.split.el.setHeight(A.height); -A.x+=sw;}if(this.collapsed){this.updateBody(null,A.height);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}});Roo.bootstrap.layout.West=function(A){A.region="west";A.cursor="w-resize";Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.LEFT; -this.split.orientation=Roo.bootstrap.SplitBar.HORIZONTAL;this.split.el.addClass("roo-layout-split-h");}};Roo.extend(Roo.bootstrap.layout.West,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.HORIZONTAL,onRender:function(A,B){Roo.bootstrap.layout.West.superclass.onRender.call(this,A,B); -var C=this.config.initialSize||this.config.width;if(typeof C!="undefined"){this.el.setWidth(C);}},getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){A.width+=this.split.el.getWidth();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth(); -A.width-=sw;this.split.el.setLeft(A.x+A.width);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);}if(this.collapsed){this.updateBody(null,A.height);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}}); +A.x+=sw;}if(this.collapsed){this.updateBody(null,A.height);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}}); +// Roo/bootstrap/layout/West.js +Roo.bootstrap.layout.West=function(A){A.region="west";A.cursor="w-resize";Roo.bootstrap.layout.Split.call(this,A);if(this.split){this.split.placement=Roo.bootstrap.SplitBar.LEFT;this.split.orientation=Roo.bootstrap.SplitBar.HORIZONTAL;this.split.el.addClass("roo-layout-split-h"); +}};Roo.extend(Roo.bootstrap.layout.West,Roo.bootstrap.layout.Split,{orientation:Roo.bootstrap.SplitBar.HORIZONTAL,onRender:function(A,B){Roo.bootstrap.layout.West.superclass.onRender.call(this,A,B);var C=this.config.initialSize||this.config.width;if(typeof C!="undefined"){this.el.setWidth(C); +}},getBox:function(){if(this.collapsed){return this.collapsedEl.getBox();}var A=this.el.getBox();if(this.split){A.width+=this.split.el.getWidth();}return A;},updateBox:function(A){if(this.split&&!this.collapsed){var sw=this.split.el.getWidth();A.width-=sw; +this.split.el.setLeft(A.x+A.width);this.split.el.setTop(A.y);this.split.el.setHeight(A.height);}if(this.collapsed){this.updateBody(null,A.height);}Roo.bootstrap.layout.Region.prototype.updateBox.call(this,A);}}); // Roo/bootstrap/panel/panel-ns.js Roo.namespace("Roo.bootstrap.panel"); // Roo/bootstrap/panel/Content.js @@ -1605,42 +1628,47 @@ if(A.background){this.on('activate',function(gp){if(!gp.grid.rendered){gp.grid.r },getGrid:function(){return this.grid;},setSize:function(A,B){if(!this.ignoreResize(A,B)){var C=this.grid;var D=this.adjustForComponents(A,B);var E=C.getGridEl();E.setSize(D.width,D.height);C.autoSize();}},beforeSlide:function(){this.grid.getView().scroller.clip(); },afterSlide:function(){this.grid.getView().scroller.unclip();},destroy:function(){this.grid.destroy();delete this.grid;Roo.bootstrap.panel.Grid.superclass.destroy.call(this);}}); // Roo/bootstrap/panel/Nest.js -Roo.bootstrap.panel.Nest=function(A){A.el=A.layout.getEl();Roo.bootstrap.panel.Nest.superclass.constructor.call(this,A);A.layout.monitorWindowResize=false;this.layout=A.layout;this.layout.getEl().addClass("roo-layout-nested-layout");};Roo.extend(Roo.bootstrap.panel.Nest,Roo.bootstrap.panel.Content,{setSize:function(A,B){if(!this.ignoreResize(A,B)){var C=this.adjustForComponents(A,B); -var el=this.layout.getEl();if(C.height<1){el.setWidth(C.width);}else{el.setSize(C.width,C.height);}var D=el.dom.offsetWidth;this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(A){this.active=A; -this.setActiveClass(A);if(!A){this.fireEvent("deactivate",this);return;}this.fireEvent("activate",this);if(!this.layout){return;}var B=false;for(var r in this.layout.regions){B=this.layout.getRegion(r);if(B.getActivePanel()){B.setActivePanel(B.getActivePanel()); -continue;}if(!B.panels.length){continue;}B.showPanel(B.getPanel(0));}},getLayout:function(){return this.layout;},addxtype:function(A){return this.layout.addxtype(A);}}); +Roo.bootstrap.panel.Nest=function(A){A.el=A.layout.getEl();Roo.bootstrap.panel.Nest.superclass.constructor.call(this,A);A.layout.monitorWindowResize=false;this.layout=A.layout;this.layout.getEl().addClass("roo-layout-nested-layout");this.layout.parent=this; +};Roo.extend(Roo.bootstrap.panel.Nest,Roo.bootstrap.panel.Content,{setSize:function(A,B){if(!this.ignoreResize(A,B)){var C=this.adjustForComponents(A,B);var el=this.layout.getEl();if(C.height<1){el.setWidth(C.width);}else{el.setSize(C.width,C.height);}var D=el.dom.offsetWidth; +this.layout.layout();if(Roo.isIE&&!this.initialized){this.initialized=true;this.layout.layout();}}},setActiveState:function(A){this.active=A;this.setActiveClass(A);if(!A){this.fireEvent("deactivate",this);return;}this.fireEvent("activate",this);if(!this.layout){return; +}var B=false;for(var r in this.layout.regions){B=this.layout.getRegion(r);if(B.getActivePanel()){B.setActivePanel(B.getActivePanel());continue;}if(!B.panels.length){continue;}B.showPanel(B.getPanel(0));}},getLayout:function(){return this.layout;},addxtype:function(A){return this.layout.addxtype(A); +}}); // Roo/bootstrap/panel/Tabs.js Roo.bootstrap.panel.Tabs=function(A){this.el=Roo.get(A.el);delete A.el;if(A){if(typeof A=="boolean"){this.tabPosition=A?"bottom":"top";}else{Roo.apply(this,A);}}if(this.tabPosition=="bottom"){this.bodyEl=Roo.get(this.createBody(this.el.dom));this.el.addClass("roo-tabs-bottom"); -}this.stripWrap=Roo.get(this.createStrip(this.el.dom),true);this.stripEl=Roo.get(this.createStripList(this.stripWrap.dom),true);this.stripBody=Roo.get(this.stripWrap.dom.firstChild.firstChild,true);if(Roo.isIE){Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden"); +}if(this.tabPosition=="west"){var B=this.region;while(B){if(!B.mgr.parent){break;}B=B.mgr.parent.region;}Roo.log("got nest?");Roo.log(B);if(B.mgr.getRegion('west')){var C=B.mgr.getRegion('west').bodyEl.dom;this.stripWrap=Roo.get(this.createStrip(C),true); +this.stripEl=Roo.get(this.createStripList(this.stripWrap.dom),true);this.stripEl.setVisibilityMode(Roo.Element.DISPLAY);this.stripBody=Roo.get(this.stripWrap.dom.firstChild.firstChild,true);}}else{this.stripWrap=Roo.get(this.createStrip(this.el.dom),true); +this.stripEl=Roo.get(this.createStripList(this.stripWrap.dom),true);this.stripEl.setVisibilityMode(Roo.Element.DISPLAY);this.stripBody=Roo.get(this.stripWrap.dom.firstChild.firstChild,true);}if(Roo.isIE){Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x","hidden"); }if(this.tabPosition!="bottom"){this.bodyEl=Roo.get(this.createBody(this.el.dom));this.el.addClass("roo-tabs-top");}this.items=[];this.bodyEl.setStyle("position","relative");this.active=null;this.activateDelegate=this.activate.createDelegate(this);this.addEvents({"tabchange":true,"beforetabchange":true} -);Roo.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;if(this.toolbar){alert("no toolbar support yet");this.toolbar=false;}Roo.bootstrap.panel.Tabs.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.panel.Tabs,Roo.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,toolbar:false,addTab:function(id,A,B,C,D){var E=new Roo.bootstrap.panel.TabItem({panel:this,id:id,text:A,closable:C,tpl:D} +);Roo.EventManager.onWindowResize(this.onResize,this);this.cpad=this.el.getPadding("lr");this.hiddenCount=0;if(this.toolbar){alert("no toolbar support yet");this.toolbar=false;}Roo.bootstrap.panel.Tabs.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.panel.Tabs,Roo.util.Observable,{tabPosition:"top",currentTabWidth:0,minTabWidth:40,maxTabWidth:250,preferredTabWidth:175,resizeTabs:false,monitorResize:true,toolbar:false,region:false,disableTooltips:true,addTab:function(id,A,B,C,D){var E=new Roo.bootstrap.panel.TabItem({panel:this,id:id,text:A,closable:C,tpl:D} );this.addTabItem(E);if(B){E.setContent(B);}return E;},getTab:function(id){return this.items[id];},hideTab:function(id){var t=this.items[id];if(!t.isHidden()){t.setHidden(true);this.hiddenCount++;this.autoSizeTabs();}},unhideTab:function(id){var t=this.items[id]; -if(t.isHidden()){t.setHidden(false);this.hiddenCount--;this.autoSizeTabs();}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);},removeTab:function(id){var A=this.items;var B=A[id];if(!B){return;}var C=A.indexOf(B);if(this.active==B&&A.length>1){var D=this.getNextAvailable(C); +if(t.isHidden()){t.setHidden(false);this.hiddenCount--;this.autoSizeTabs();}},addTabItem:function(A){this.items[A.id]=A;this.items.push(A);this.autoSizeTabs();},removeTab:function(id){var A=this.items;var B=A[id];if(!B){return;}var C=A.indexOf(B);if(this.active==B&&A.length>1){var D=this.getNextAvailable(C); if(D){D.activate();}}this.stripEl.dom.removeChild(B.pnode.dom);if(B.bodyEl.dom.parentNode==this.bodyEl.dom){this.bodyEl.dom.removeChild(B.bodyEl.dom);}A.splice(C,1);delete this.items[B.id];B.fireEvent("close",B);B.purgeListeners();this.autoSizeTabs();},getNextAvailable:function(A){var B=this.items; var C=A;while(C=0){var D=B[--C];if(D&&!D.isHidden()){return D;}}return null;},disableTab:function(id){var A=this.items[id];if(A&&this.active!=A){A.disable();}},enableTab:function(id){var A=this.items[id]; A.enable();},activate:function(id){var A=this.items[id];if(!A){return null;}if(A==this.active||A.disabled){return A;}var e={};this.fireEvent("beforetabchange",this,e,A);if(e.cancel!==true&&!A.disabled){if(this.active){this.active.hide();}this.active=this.items[id]; this.active.show();this.fireEvent("tabchange",this,this.active);}return A;},getActiveTab:function(){return this.active;},syncHeight:function(A){var B=(A||this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");var bm=this.bodyEl.getMargins(); var C=B-(this.stripWrap.getHeight()||0)-(bm.top+bm.bottom);this.bodyEl.setHeight(C);return C;},onResize:function(){if(this.monitorResize){this.autoSizeTabs();}},beginUpdate:function(){this.updating=true;},endUpdate:function(){this.updating=false;this.autoSizeTabs(); -},autoSizeTabs:function(){var A=this.items.length;var B=A-this.hiddenCount;if(!this.resizeTabs||A<1||B<1||this.updating){return;}var w=Math.max(this.el.getWidth()-this.cpad,10);var C=Math.floor(w/B);var b=this.stripBody;if(b.getWidth()>w){var D=this.items; -this.setTabWidth(Math.max(C,this.minTabWidth)-2);if(C'+'{text}'); +},autoSizeTabs:function(){var A=this.items.length;var B=A-this.hiddenCount;if(B<2){this.stripEl.hide();}else{this.stripEl.show();}if(!this.resizeTabs||A<1||B<1||this.updating){return;}var w=Math.max(this.el.getWidth()-this.cpad,10);var C=Math.floor(w/B);var b=this.stripBody; +if(b.getWidth()>w){var D=this.items;this.setTabWidth(Math.max(C,this.minTabWidth)-2);if(C{text}'):(''+'{text}')); }switch(typeof(E)){case 'object':break;case 'string':E=new Roo.Template(E);break;default:break;}var el=E.overwrite(td,{"text":B});var F=el.getElementsByTagName("span")[0];return {"el":el,"inner":F};}}); // Roo/bootstrap/panel/TabItem.js Roo.bootstrap.panel.TabItem=function(A){this.tabPanel=A.panel;this.id=A.id;this.disabled=false;this.text=A.text;this.loaded=false;this.closable=A.closable;this.bodyEl=Roo.get(this.tabPanel.createItemBody(this.tabPanel.bodyEl.dom,A.id));this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY); -this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");var B=this.tabPanel.createStripElements(this.tabPanel.stripEl.dom,A.text,A.closable,A.tpl);this.el=Roo.get(B.el);this.inner=Roo.get(B.inner,true);this.textEl=Roo.get(this.el.dom.firstChild,true); -this.pnode=Roo.get(B.el.parentNode,true);this.el.on("click",this.onTabClick,this);if(A.closable){var c=Roo.get(B.close,true);c.dom.title=this.closeText;c.addClassOnOver("close-over");c.on("click",this.closeClick,this);}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true} -);this.hidden=false;Roo.bootstrap.panel.TabItem.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.panel.TabItem,Roo.util.Observable,{purgeListeners:function(){Roo.util.Observable.prototype.purgeListeners.call(this);this.el.removeAllListeners(); -},show:function(){this.pnode.addClass("active");this.showAction();if(Roo.isOpera){this.tabPanel.stripWrap.repaint();}this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this;},hide:function(){this.pnode.removeClass("active"); -this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px");},showAction:function(){this.bodyEl.setStyle("position","relative"); -this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title');}else{this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault(); -this.tabPanel.activate(this.id);},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},setHidden:function(A){this.hidden=A;this.pnode.setStyle("display",A?"none":"");},isHidden:function(){return this.hidden;},getText:function(){return this.text; -},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true;this.pnode.addClass("disabled");}},enable:function(){this.disabled=false; -this.pnode.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate);}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]); -this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.bodyEl.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));}},refresh:function(){if(this.refreshDelegate){this.loaded=false; -this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id);}},closeText:"Close this tab"}); +this.bodyEl.setStyle("display","block");this.bodyEl.setStyle("zoom","1");var B=this.tabPanel.createStripElements(this.tabPanel.stripEl.dom,A.text,A.closable,A.tpl);this.el=Roo.get(B.el);this.inner=Roo.get(B.inner,true);this.textEl=Roo.bootstrap.version==4?this.el:Roo.get(this.el.dom.firstChild,true); +this.pnode=this.linode=Roo.get(B.el.parentNode,true);this.status_node=Roo.bootstrap.version==4?this.el:this.linode;this.el.on("click",this.onTabClick,this);if(A.closable){var c=Roo.get(B.close,true);c.dom.title=this.closeText;c.addClassOnOver("close-over"); +c.on("click",this.closeClick,this);}this.addEvents({"activate":true,"beforeclose":true,"close":true,"deactivate":true});this.hidden=false;Roo.bootstrap.panel.TabItem.superclass.constructor.call(this);};Roo.extend(Roo.bootstrap.panel.TabItem,Roo.util.Observable,{purgeListeners:function(){Roo.util.Observable.prototype.purgeListeners.call(this); +this.el.removeAllListeners();},show:function(){this.status_node.addClass("active");this.showAction();if(Roo.isOpera){this.tabPanel.stripWrap.repaint();}this.fireEvent("activate",this.tabPanel,this);},isActive:function(){return this.tabPanel.getActiveTab()==this; +},hide:function(){this.status_node.removeClass("active");this.hideAction();this.fireEvent("deactivate",this.tabPanel,this);},hideAction:function(){this.bodyEl.hide();this.bodyEl.setStyle("position","absolute");this.bodyEl.setLeft("-20000px");this.bodyEl.setTop("-20000px"); +},showAction:function(){this.bodyEl.setStyle("position","relative");this.bodyEl.setTop("");this.bodyEl.setLeft("");this.bodyEl.show();},setTooltip:function(A){if(Roo.QuickTips&&Roo.QuickTips.isEnabled()){this.textEl.dom.qtip=A;this.textEl.dom.removeAttribute('title'); +}else{this.textEl.dom.title=A;}},onTabClick:function(e){e.preventDefault();this.tabPanel.activate(this.id);},onTabMouseDown:function(e){e.preventDefault();this.tabPanel.activate(this.id);},setHidden:function(A){this.hidden=A;this.linode.setStyle("display",A?"none":""); +},isHidden:function(){return this.hidden;},getText:function(){return this.text;},setText:function(A){this.text=A;this.textEl.update(A);this.setTooltip(A);},activate:function(){this.tabPanel.activate(this.id);},disable:function(){if(this.tabPanel.active!=this){this.disabled=true; +this.status_node.addClass("disabled");}},enable:function(){this.disabled=false;this.status_node.removeClass("disabled");},setContent:function(A,B){this.bodyEl.update(A,B);},getUpdateManager:function(){return this.bodyEl.getUpdateManager();},setUrl:function(A,B,C){if(this.refreshDelegate){this.un('activate',this.refreshDelegate); +}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.bodyEl.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.bodyEl.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this)); +}},refresh:function(){if(this.refreshDelegate){this.loaded=false;this.refreshDelegate();}},_setLoaded:function(){this.loaded=true;},closeClick:function(e){var o={};e.stopEvent();this.fireEvent("beforeclose",this,o);if(o.cancel!==true){this.tabPanel.removeTab(this.id); +}},closeText:"Close this tab"}); // Roo/bootstrap/PhoneInputData.js Roo.bootstrap.PhoneInputData=function(){var d=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1246"],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1876"],["Japan (日本)","jp","81"],["Jersey","je","44",3],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (OÊ»zbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1]]; return d;} @@ -1705,3 +1733,33 @@ return false;}return true;},validate:function(){if(this.disabled||this.allowBlan },beforeBlur:function(){if(!this.castInt){return;}var v=this.parseValue(this.getRawValue());if(v||v==0){this.setValue(v);}},onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate(); }var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},inputEl:function(){return this.el.select('.roo-money-amount-input',true).first();},currencyEl:function(){return this.el.select('.roo-money-currency-input',true).first(); },hiddenEl:function(){return this.el.select('input.hidden-number-input',true).first();}}); +// Roo/bootstrap/BezierSignature.js +Roo.bootstrap.BezierSignature=function(A){Roo.bootstrap.BezierSignature.superclass.constructor.call(this,A);this.addEvents({"resize":true});};Roo.extend(Roo.bootstrap.BezierSignature,Roo.bootstrap.Component,{curve_data:[],is_empty:true,mouse_btn_down:true,canvas_height:'200px',dot_size:false,min_width:0.5,max_width:2.5,throttle:16,min_distance:5,bg_color:'rgba(0, 0, 0, 0)',dot_color:'black',velocity_filter_weight:0.7,onBegin:false,onEnd:false,getAutoCreate:function(){var A='roo-signature column'; +if(this.cls){A+=' '+this.cls;}var B=['lg','md','sm','xs'];for(var i=0;i0){var C=B.getImageData(0,0,A.width,A.height);}A.width=0;var D=window.getComputedStyle?getComputedStyle(this.el.dom,null):this.el.dom.currentStyle; +var E=parseInt(D.paddingLeft)||0;var F=parseInt(D.paddingRight)||0;A.width=this.el.dom.clientWidth-E-F;if(C){B.putImageData(C,0,0);}},_handleMouseDown:function(e){if(e.browserEvent.which===1){this.mouse_btn_down=true;this.strokeBegin(e);}},_handleMouseMove:function(e){if(this.mouse_btn_down){this.strokeMoveUpdate(e); +}},_handleMouseUp:function(e){if(e.browserEvent.which===1&&this.mouse_btn_down){this.mouse_btn_down=false;this.strokeEnd(e);}},_handleTouchStart:function(e){e.preventDefault();if(e.browserEvent.targetTouches.length===1){this.strokeBegin(e);}},_handleTouchMove:function(e){e.preventDefault(); +this.strokeMoveUpdate(e);},_handleTouchEnd:function(e){var A=e.target===this.canvasEl().dom;if(A){e.preventDefault();this.strokeEnd(e);}},reset:function(){this._lastPoints=[];this._lastVelocity=0;this._lastWidth=(this.min_width+this.max_width)/2;this.canvasElCtx().fillStyle=this.dot_color; +},strokeMoveUpdate:function(e){this.strokeUpdate(e);if(this.throttle){this.throttleStroke(this.strokeUpdate,this.throttle);}else{this.strokeUpdate(e);}},strokeBegin:function(e){var A={color:this.dot_color,points:[]};if(typeof this.onBegin==='function'){this.onBegin(e); +}this.curve_data.push(A);this.reset();this.strokeUpdate(e);},strokeUpdate:function(e){var A=this.canvasEl().dom.getBoundingClientRect();var B=new this.Point(e.xy[0]-A.left,e.xy[1]-A.top,new Date().getTime());var C=this.curve_data[this.curve_data.length-1]; +var D=C.points;var E=D.length>0&&D[D.length-1];var F=E?B.distanceTo(E)<=this.min_distance:false;var G=C.color;if(!E||!(E&&F)){var H=this.addPoint(B);if(!E){this.drawDot({color:G,point:B});}else if(H){this.drawCurve({color:G,curve:H});}D.push({time:B.time,x:B.x,y:B.y} +);}},strokeEnd:function(e){this.strokeUpdate(e);if(typeof this.onEnd==='function'){this.onEnd(e);}},addPoint:function(A){var B=this._lastPoints;B.push(A);if(B.length>2){if(B.length===3){B.unshift(B[0]);}var C=this.calculateCurveWidths(B[1],B[2]);var D=this.Bezier.fromPoints(B,C,this); +B.shift();return D;}return null;},calculateCurveWidths:function(A,B){var C=this.velocity_filter_weight*B.velocityFrom(A)+(1-this.velocity_filter_weight)*this._lastVelocity;var D=Math.max(this.max_width/(C+1),this.min_width);var E={end:D,start:this._lastWidth} +;this._lastVelocity=C;this._lastWidth=D;return E;},drawDot:function(_a){var A=_a.color,B=_a.point;var C=this.canvasElCtx();var D=typeof this.dot_size==='function'?this.dot_size():this.dot_size;C.beginPath();this.drawCurveSegment(B.x,B.y,D);C.closePath();C.fillStyle=A; +C.fill();},drawCurve:function(_a){var A=_a.color,B=_a.curve;var C=this.canvasElCtx();var D=B.endWidth-B.startWidth;var E=Math.floor(B.length())*2;C.beginPath();C.fillStyle=A;for(var i=0;i0){var C=cx-px;var D=cy-py;B+=Math.sqrt(C*C+D*D);}px=cx;py=cy;}return B;};Bezier.prototype.point=function(t,A,c1,c2,B){return (A*(1.0-t)*(1.0-t)*(1.0-t))+(3.0*c1*(1.0-t)*(1.0-t)*t)+(3.0*c2*(1.0-t)*t*t)+(B*t*t*t);};return Bezier;}()),throttleStroke:function(fn,A){if(A===void 0){A=250; +}var B=0;var C=null;var D;var E;var F;var G=function(){B=Date.now();C=null;D=fn.apply(E,F);if(!C){E=null;F=[];}};return function H(){var I=[];for(var _i=0;_iA){if(C){clearTimeout(C); +C=null;}B=J;D=fn.apply(E,F);if(!C){E=null;F=[];}}else if(!C){C=window.setTimeout(G,K);}return D;};}});