From fb48a50ed75f56440203852cd015ab3b24c2df5d Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 27 Nov 2020 13:19:25 +0800 Subject: [PATCH] fix docs --- Roo/bootstrap/Button.js | 1 + docs/json/roodata.json | 24 ++++++++++++------- docs/src/Roo_bootstrap_Button.js.html | 31 ++++++++++++++---------- docs/symbols/Roo.bootstrap.Button.json | 12 ++++++---- roojs-bootstrap-debug.js | 33 +++++++++++++++----------- roojs-bootstrap.js | 8 +++---- 6 files changed, 66 insertions(+), 43 deletions(-) diff --git a/Roo/bootstrap/Button.js b/Roo/bootstrap/Button.js index a022a20341..7179f940e9 100644 --- a/Roo/bootstrap/Button.js +++ b/Roo/bootstrap/Button.js @@ -415,6 +415,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { }); +// fixme - should include btn-outline-* Roo.bootstrap.Button.weightClass = [ "btn-default", diff --git a/docs/json/roodata.json b/docs/json/roodata.json index 0bce7e0098..3e12feccb3 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -17823,7 +17823,7 @@ { "name" : "badge_weight", "type" : "String", - "desc" : ") default (same as button)", + "desc" : "k) default (same as button)", "memberOf" : "", "optvals" : [ "default", @@ -17833,7 +17833,9 @@ "info", "warning", "danger", - "link" + "link", + "light", + "dark" ] }, { @@ -18042,7 +18044,7 @@ { "name" : "weight", "type" : "String", - "desc" : ") default", + "desc" : "k) default", "memberOf" : "", "optvals" : [ "default", @@ -18052,7 +18054,9 @@ "info", "warning", "danger", - "link" + "link", + "light", + "dark" ] }, { @@ -21391,7 +21395,7 @@ { "name" : "badge_weight", "type" : "String", - "desc" : ") default (same as button)", + "desc" : "k) default (same as button)", "memberOf" : "Roo.bootstrap.Button", "optvals" : [ "default", @@ -21401,7 +21405,9 @@ "info", "warning", "danger", - "link" + "link", + "light", + "dark" ] }, { @@ -21622,7 +21628,7 @@ { "name" : "weight", "type" : "String", - "desc" : ") default", + "desc" : "k) default", "memberOf" : "Roo.bootstrap.Button", "optvals" : [ "default", @@ -21632,7 +21638,9 @@ "info", "warning", "danger", - "link" + "link", + "light", + "dark" ] }, { diff --git a/docs/src/Roo_bootstrap_Button.js.html b/docs/src/Roo_bootstrap_Button.js.html index 746ac682c6..36ce09ff8d 100644 --- a/docs/src/Roo_bootstrap_Button.js.html +++ b/docs/src/Roo_bootstrap_Button.js.html @@ -10,8 +10,8 @@ * @extends Roo.bootstrap.Component * Bootstrap Button class * @cfg {String} html The button content - * @cfg {String} weight (default|primary|secondary|success|info|warning|danger|link ) default - * @cfg {String} badge_weight (default|primary|secondary|success|info|warning|danger|link ) default (same as button) + * @cfg {String} weight (default|primary|secondary|success|info|warning|danger|link|light|dark) default + * @cfg {String} badge_weight (default|primary|secondary|success|info|warning|danger|link|light|dark) default (same as button) * @cfg {Boolean} outline default false (except for weight=default which emulates old behaveiour with an outline) * @cfg {String} size (lg|sm|xs) * @cfg {String} tag (a|input|submit) @@ -39,14 +39,7 @@ Roo.bootstrap.Button = function(config){ Roo.bootstrap.Button.superclass.constructor.call(this, config); - this.weightClass = ["btn-default btn-outline-secondary", - "btn-primary", - "btn-success", - "btn-info", - "btn-warning", - "btn-danger", - "btn-link" - ], + this.addEvents({ // raw events /** @@ -410,7 +403,7 @@ setWeight : function(str) { - this.el.removeClass(this.weightClass); + this.el.removeClass(Roo.bootstrap.Button.weightClass ); this.weight = str; var outline = this.outline ? 'outline-' : ''; if (str == 'default') { @@ -422,5 +415,17 @@ }); - - \ No newline at end of file +Roo.bootstrap.Button.weightClass = [ + + "btn-default", + "btn-outline-secondary", + "btn-secondary", + "btn-primary", + "btn-success", + "btn-info", + "btn-warning", + "btn-danger", + "btn-link", + 'btn-light', + 'btn-dark' +]; \ No newline at end of file diff --git a/docs/symbols/Roo.bootstrap.Button.json b/docs/symbols/Roo.bootstrap.Button.json index c866f4759d..a8ccf2aeda 100644 --- a/docs/symbols/Roo.bootstrap.Button.json +++ b/docs/symbols/Roo.bootstrap.Button.json @@ -79,7 +79,7 @@ { "name" : "weight", "type" : "String", - "desc" : ") default", + "desc" : "k) default", "memberOf" : "Roo.bootstrap.Button", "optvals" : [ "default", @@ -89,7 +89,9 @@ "info", "warning", "danger", - "link" + "link", + "light", + "dark" ] }, { @@ -213,7 +215,7 @@ { "name" : "badge_weight", "type" : "String", - "desc" : ") default (same as button)", + "desc" : "k) default (same as button)", "memberOf" : "Roo.bootstrap.Button", "optvals" : [ "default", @@ -223,7 +225,9 @@ "info", "warning", "danger", - "link" + "link", + "light", + "dark" ] }, { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 5231918360..1fffa4cef7 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -961,8 +961,8 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, { * @extends Roo.bootstrap.Component * Bootstrap Button class * @cfg {String} html The button content - * @cfg {String} weight (default|primary|secondary|success|info|warning|danger|link ) default - * @cfg {String} badge_weight (default|primary|secondary|success|info|warning|danger|link ) default (same as button) + * @cfg {String} weight (default|primary|secondary|success|info|warning|danger|link|light|dark) default + * @cfg {String} badge_weight (default|primary|secondary|success|info|warning|danger|link|light|dark) default (same as button) * @cfg {Boolean} outline default false (except for weight=default which emulates old behaveiour with an outline) * @cfg {String} size (lg|sm|xs) * @cfg {String} tag (a|input|submit) @@ -990,14 +990,7 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, { Roo.bootstrap.Button = function(config){ Roo.bootstrap.Button.superclass.constructor.call(this, config); - this.weightClass = ["btn-default btn-outline-secondary", - "btn-primary", - "btn-success", - "btn-info", - "btn-warning", - "btn-danger", - "btn-link" - ], + this.addEvents({ // raw events /** @@ -1094,8 +1087,8 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { return cfg; } + - if (this.theme==='default') { cfg.cls = 'btn roo-button'; @@ -1361,7 +1354,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { setWeight : function(str) { - this.el.removeClass(this.weightClass); + this.el.removeClass(Roo.bootstrap.Button.weightClass ); this.weight = str; var outline = this.outline ? 'outline-' : ''; if (str == 'default') { @@ -1373,8 +1366,20 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, { }); - - /* +Roo.bootstrap.Button.weightClass = [ + + "btn-default", + "btn-outline-secondary", + "btn-secondary", + "btn-primary", + "btn-success", + "btn-info", + "btn-warning", + "btn-danger", + "btn-link", + 'btn-light', + 'btn-dark' +];/* * - LGPL * * column diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 6b61075a1d..d032f66073 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -41,8 +41,7 @@ Roo.bootstrap.ButtonGroup=function(A){Roo.bootstrap.ButtonGroup.superclass.const ;A.html=this.html||A.html;if(this.toolbar){A={cls:'btn-toolbar',html:null};return A;}if(['vertical','justified'].indexOf(this.align)!==-1){A.cls='btn-group-'+this.align;if(this.align=='justified'){console.log(this.items);}}if(['lg','sm','xs'].indexOf(this.size)!==-1){A.cls+=' btn-group-'+this.size; }if(this.direction=='up'){A.cls+=' dropup';}return A;},addItem:function(A){var cn=new Roo.bootstrap.Button(A);cn.parentId=this.id;cn.onRender(this.el,null);return cn;}}); // Roo/bootstrap/Button.js -Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.weightClass=["btn-default btn-outline-secondary","btn-primary","btn-success","btn-info","btn-warning","btn-danger","btn-link"],this.addEvents({"click":true,"toggle":true} -);};Roo.extend(Roo.bootstrap.Button,Roo.bootstrap.Component,{html:false,active:false,weight:'',badge_weight:'',outline:false,size:'',tag:'button',href:'',disabled:false,isClose:false,glyphicon:'',fa:'',badge:'',theme:'default',inverse:false,toggle:false,ontext:'ON',offtext:'OFF',defaulton:true,preventDefault:true,removeClass:false,name:false,target:false,pressed:null,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:''} +Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.addEvents({"click":true,"toggle":true});};Roo.extend(Roo.bootstrap.Button,Roo.bootstrap.Component,{html:false,active:false,weight:'',badge_weight:'',outline:false,size:'',tag:'button',href:'',disabled:false,isClose:false,glyphicon:'',fa:'',badge:'',theme:'default',inverse:false,toggle:false,ontext:'ON',offtext:'OFF',defaulton:true,preventDefault:true,removeClass:false,name:false,target:false,pressed:null,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:''} ;if(['a','button','input','submit'].indexOf(this.tag)<0){throw "Invalid value for tag: "+this.tag+". must be a, button, input or submit.";this.tag='button';}else{A.tag=this.tag;}A.html=''+(this.html||A.html)+'';if(this.toggle==true){A={tag:'div',cls:'slider-frame roo-button',cn:[{tag:'span','data-on-text':'ON','data-off-text':'OFF',cls:'slider-button',html:this.offtext} ]};if(['default','secondary','primary','success','info','warning','danger','link'].indexOf(this.weight)>-1){A.cls+=' '+this.weight;}return A;}if(this.isClose){A.cls+=' close';A["aria-hidden"]=true;A.html="×";return A;}if(this.theme==='default'){A.cls='btn roo-button'; this.weight=this.weight.length?this.weight:'default';if(['default','primary','secondary','success','info','warning','danger','link'].indexOf(this.weight)>-1){var B=this.outline||this.weight=='default'?'outline-':'';var C=this.weight=='default'?'secondary':this.weight; @@ -56,8 +55,9 @@ bw=bw=='default'?'secondary':bw;A.cn=[D,{tag:'span',cls:'badge badge-'+bw,html:t ,this.menu));}if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);}else{this.el.select('.roo-button').on('click',this.onClick,this);}if(this.removeClass){this.el.on('click',this.onClick,this);}this.el.enableDisplayMode();},onClick:function(e){if(this.disabled){return; }Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}if(this.pressed===true||this.pressed===false){this.toggleActive(e);}this.fireEvent('click',this,e);},enable:function(){this.disabled=false;this.el.removeClass('disabled');},disable:function(){this.disabled=true; this.el.addClass('disabled');},setActive:function(v){this.el[v?'addClass':'removeClass']('active');this.pressed=v;},toggleActive:function(e){this.setActive(!this.pressed);this.fireEvent('toggle',this,e,!this.pressed);},isActive:function(){return this.el.hasClass('active'); -},setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;},getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},setWeight:function(A){this.el.removeClass(this.weightClass);this.weight=A;var B=this.outline?'outline-':''; -if(A=='default'){this.el.addClass('btn-default btn-outline-secondary');return;}this.el.addClass('btn-'+B+A);}}); +},setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;},getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},setWeight:function(A){this.el.removeClass(Roo.bootstrap.Button.weightClass);this.weight=A; +var B=this.outline?'outline-':'';if(A=='default'){this.el.addClass('btn-default btn-outline-secondary');return;}this.el.addClass('btn-'+B+A);}});Roo.bootstrap.Button.weightClass=["btn-default","btn-outline-secondary","btn-secondary","btn-primary","btn-success","btn-info","btn-warning","btn-danger","btn-link",'btn-light','btn-dark']; + // Roo/bootstrap/Column.js Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Column,Roo.bootstrap.Component,{xs:false,sm:false,md:false,lg:false,xsoff:false,smoff:false,mdoff:false,lgoff:false,html:'',offset:0,alert:false,fa:false,icon:false,hidden:false,fasize:1,getAutoCreate:function(){var A=Roo.apply({} ,Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;var C=['xs','sm','md','lg'];C.map(function(E,ix){if(B[E+'off']!==false){A.cls+=' col-'+E+'-offset-'+B[E+'off'];}if(B[E]===false){return;}if(!B[E]){A.cls+=' hidden-'+E+' hidden-'+E+'-down'; -- 2.39.2