From e9acf803b5870641f06e296c00b6290c6eae20f1 Mon Sep 17 00:00:00 2001 From: Alan Date: Thu, 29 Dec 2022 15:21:44 +0800 Subject: [PATCH] support closeClick - and messagebox will trigger close now --- docs/json/roodata.json | 19 +++++++++++ docs/src/Roo_HtmlEditorCore.js.html | 1 + docs/src/Roo_bootstrap_Modal.js.html | 8 ++++- docs/src/Roo_bootstrap_Table.js.html | 33 ++++++++++++++++--- docs/src/Roo_bootstrap_form_TimeField.js.html | 6 ++-- docs/symbols/Roo.bootstrap.Table.json | 11 +++++++ .../symbols/Roo.bootstrap.form.TimeField.json | 24 +++++++++----- roojs-bootstrap-debug.js | 8 ++++- roojs-bootstrap.js | 11 ++++--- 9 files changed, 100 insertions(+), 21 deletions(-) diff --git a/docs/json/roodata.json b/docs/json/roodata.json index bcbe5e3a28..915b14de6e 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -107613,6 +107613,17 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "footerRow", + "type" : "Boolean", + "desc" : "e) generate tfoot with columns of values, default fal", + "memberOf" : "", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, { "name" : "footerShow", "type" : "Boolean", @@ -158601,6 +158612,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "minuteStep", + "type" : "Number", + "desc" : "the minutes goes up/down by a fixed number, default 1", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, { "name" : "name", "type" : "String", diff --git a/docs/src/Roo_HtmlEditorCore.js.html b/docs/src/Roo_HtmlEditorCore.js.html index ca2459ed8f..0a30e57f6e 100644 --- a/docs/src/Roo_HtmlEditorCore.js.html +++ b/docs/src/Roo_HtmlEditorCore.js.html @@ -700,6 +700,7 @@ e.preventDefault(); + this.owner.fireEvent('paste', this); return false; // default behaveiour should be our local cleanup paste? (optional?) // for simple editor - we want to hammer the paste and get rid of everything... - so over-rideable.. diff --git a/docs/src/Roo_bootstrap_Modal.js.html b/docs/src/Roo_bootstrap_Modal.js.html index e59aee6922..3c1e5d8e3f 100644 --- a/docs/src/Roo_bootstrap_Modal.js.html +++ b/docs/src/Roo_bootstrap_Modal.js.html @@ -295,10 +295,16 @@ : this.el.select('.modal-footer div',true).first(); }, + + closeClick : function() + { + this.hide(); + }, + initEvents : function() { if (this.allow_close) { - this.closeEl.on('click', this.hide, this); + this.closeEl.on('click', this.closeClick, this); } Roo.EventManager.onWindowResize(this.resize, this, true); if (this.editableTitle) { diff --git a/docs/src/Roo_bootstrap_Table.js.html b/docs/src/Roo_bootstrap_Table.js.html index e25ab4d9a1..b09cb786f5 100644 --- a/docs/src/Roo_bootstrap_Table.js.html +++ b/docs/src/Roo_bootstrap_Table.js.html @@ -80,6 +80,7 @@ Currently the Table uses multiple headers to try and handle XL / Medium etc... * also adds table-responsive (see bootstrap docs for details) * @cfg {Boolean} loadMask (true|false) default false * @cfg {Boolean} footerShow (true|false) generate tfoot, default true + * @cfg {Boolean} footerRow (true|false) generate tfoot with columns of values, default false * @cfg {Boolean} headerShow (true|false) generate thead, default true * @cfg {Boolean} rowSelection (true|false) default false * @cfg {Boolean} cellSelection (true|false) default false @@ -264,6 +265,7 @@ Currently the Table uses multiple headers to try and handle XL / Medium etc... store : false, loadMask : false, footerShow : true, + footerRow : false, headerShow : true, enableColumnResize: true, disableAutoSize: false, @@ -339,9 +341,10 @@ Currently the Table uses multiple headers to try and handle XL / Medium etc... cfg.cn.push(this.renderBody()); - if(this.footerShow){ + if(this.footerShow || this.footerRow){ cfg.cn.push(this.renderFooter()); } + // where does this come from? //cfg.cls+= ' TableGrid'; } @@ -902,8 +905,6 @@ Currently the Table uses multiple headers to try and handle XL / Medium etc... return footer; }, - - onLoad : function() { // Roo.log('ds onload'); @@ -950,7 +951,7 @@ Currently the Table uses multiple headers to try and handle XL / Medium etc... var tfoot = this.el.select('tfoot', true).first(); - if(this.footerShow && this.auto_hide_footer && this.mainFoot){ + if(this.footerShow && !this.footerRow && this.auto_hide_footer && this.mainFoot){ this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide(); @@ -961,6 +962,30 @@ Currently the Table uses multiple headers to try and handle XL / Medium etc... } } + if(!this.footerShow && this.footerRow) { + + var tr = { + tag : 'tr', + cn : [] + }; + + for(var i = 0, len = cm.getColumnCount(); i < len; i++){ + var footer = typeof(cm.config[i].footer) == "function" ? cm.config[i].footer(ds, cm.config[i]) : cm.config[i].footer; + var td = { + tag: 'td', + cls : ' x-fcol-' + i, + html: footer + }; + + tr.cn.push(td); + + } + + tfoot.dom.innerHTML = ''; + + tfoot.createChild(tr); + } + Roo.each(this.el.select('tbody td', true).elements, function(e){ e.on('mouseover', _this.onMouseover, _this); }); diff --git a/docs/src/Roo_bootstrap_form_TimeField.js.html b/docs/src/Roo_bootstrap_form_TimeField.js.html index d037a406b3..a77240dc63 100644 --- a/docs/src/Roo_bootstrap_form_TimeField.js.html +++ b/docs/src/Roo_bootstrap_form_TimeField.js.html @@ -9,6 +9,7 @@ * @class Roo.bootstrap.form.TimeField * @extends Roo.bootstrap.form.Input * Bootstrap DateField class + * @cfg {Number} minuteStep the minutes goes up/down by a fixed number, default 1 * * * @constructor @@ -51,6 +52,7 @@ * valid according to {@link Date#parseDate} (defaults to 'H:i'). */ format : "H:i", + minuteStep : 1, getAutoCreate : function() { @@ -431,14 +433,14 @@ onIncrementMinutes: function() { Roo.log('onIncrementMinutes'); - this.time = this.time.add(Date.MINUTE, 1); + this.time = this.time.add(Date.MINUTE, this.minuteStep); this.update(); }, onDecrementMinutes: function() { Roo.log('onDecrementMinutes'); - this.time = this.time.add(Date.MINUTE, -1); + this.time = this.time.add(Date.MINUTE, -1 * this.minuteStep); this.update(); }, diff --git a/docs/symbols/Roo.bootstrap.Table.json b/docs/symbols/Roo.bootstrap.Table.json index 6c6dffa55a..deac588f43 100644 --- a/docs/symbols/Roo.bootstrap.Table.json +++ b/docs/symbols/Roo.bootstrap.Table.json @@ -122,6 +122,17 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "footerRow", + "type" : "Boolean", + "desc" : "e) generate tfoot with columns of values, default fal", + "memberOf" : "", + "isOptional" : false, + "optvals" : [ + "true", + "false" + ] + }, { "name" : "tooltip", "type" : "string", diff --git a/docs/symbols/Roo.bootstrap.form.TimeField.json b/docs/symbols/Roo.bootstrap.form.TimeField.json index 960895f8fa..450403c9b4 100644 --- a/docs/symbols/Roo.bootstrap.form.TimeField.json +++ b/docs/symbols/Roo.bootstrap.form.TimeField.json @@ -95,6 +95,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "minuteStep", + "type" : "Number", + "desc" : "the minutes goes up/down by a fixed number, default 1", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, { "name" : "xattr", "type" : "Object", @@ -284,14 +292,6 @@ "right" ] }, - { - "name" : "focusClass", - "type" : "String", - "desc" : "The CSS class to use when the field receives focus (defaults to \"x-form-focus\")", - "memberOf" : "Roo.bootstrap.form.Input", - "isOptional" : false, - "optvals" : [] - }, { "name" : "size", "type" : "string", @@ -308,6 +308,14 @@ "isOptional" : false, "optvals" : [] }, + { + "name" : "focusClass", + "type" : "String", + "desc" : "The CSS class to use when the field receives focus (defaults to \"x-form-focus\")", + "memberOf" : "Roo.bootstrap.form.Input", + "isOptional" : false, + "optvals" : [] + }, { "name" : "labelxs", "type" : "Number", diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index bc875c646e..7cf3d99d19 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -4545,10 +4545,16 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { : this.el.select('.modal-footer div',true).first(); }, + + closeClick : function() + { + this.hide(); + }, + initEvents : function() { if (this.allow_close) { - this.closeEl.on('click', this.hide, this); + this.closeEl.on('click', this.closeClick, this); } Roo.EventManager.onWindowResize(this.resize, this, true); if (this.editableTitle) { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index dafa2401d2..eb917d048b 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -201,11 +201,12 @@ i-1){this.toggleHeaderInput(false)}},this);this.headerEditEl.on('blur',function(e){this.toggleHeaderInput(false)},this);}},resize:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true)); -if(this.fitwindow){this.dialogEl.setStyle({'max-width':'100%'});this.setSize(this.width||Roo.lib.Dom.getViewportWidth(true)-30,this.height||Roo.lib.Dom.getViewportHeight(true));return;}if(this.max_width!==0){var w=Math.min(this.max_width,Roo.lib.Dom.getViewportWidth(true)-30); -if(this.height){this.setSize(w,this.height);return;}if(this.max_height){this.setSize(w,Math.min(this.max_height,Roo.lib.Dom.getViewportHeight(true)-60));return;}if(!this.fit_content){this.setSize(w,Roo.lib.Dom.getViewportHeight(true)-60);return;}this.setSize(w,Math.min(60+this.headerEl.getHeight()+this.footerEl.getHeight()+this.getChildHeight(this.bodyEl.dom.childNodes),Roo.lib.Dom.getViewportHeight(true)-60)); -}},setSize:function(w,h){if(!w&&!h){return;}this.resizeTo(w,h);(function(){this.items.forEach(function(e){e.layout?e.layout():false;});}).defer(100,this);},show:function(){if(!this.rendered){this.render();}this.toggleHeaderInput(false);this.el.removeClass('hideing'); +},closeClick:function(){this.hide();},initEvents:function(){if(this.allow_close){this.closeEl.on('click',this.closeClick,this);}Roo.EventManager.onWindowResize(this.resize,this,true);if(this.editableTitle){this.headerEditEl=this.headerEl.select('.form-control',true).first(); +this.headerEl.on('click',function(){this.toggleHeaderInput(true)},this);this.headerEditEl.on('keyup',function(e){if([e.RETURN,e.TAB,e.ESC].indexOf(e.keyCode)>-1){this.toggleHeaderInput(false)}},this);this.headerEditEl.on('blur',function(e){this.toggleHeaderInput(false)} +,this);}},resize:function(){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));if(this.fitwindow){this.dialogEl.setStyle({'max-width':'100%'});this.setSize(this.width||Roo.lib.Dom.getViewportWidth(true)-30,this.height||Roo.lib.Dom.getViewportHeight(true)); +return;}if(this.max_width!==0){var w=Math.min(this.max_width,Roo.lib.Dom.getViewportWidth(true)-30);if(this.height){this.setSize(w,this.height);return;}if(this.max_height){this.setSize(w,Math.min(this.max_height,Roo.lib.Dom.getViewportHeight(true)-60));return; +}if(!this.fit_content){this.setSize(w,Roo.lib.Dom.getViewportHeight(true)-60);return;}this.setSize(w,Math.min(60+this.headerEl.getHeight()+this.footerEl.getHeight()+this.getChildHeight(this.bodyEl.dom.childNodes),Roo.lib.Dom.getViewportHeight(true)-60));} +},setSize:function(w,h){if(!w&&!h){return;}this.resizeTo(w,h);(function(){this.items.forEach(function(e){e.layout?e.layout():false;});}).defer(100,this);},show:function(){if(!this.rendered){this.render();}this.toggleHeaderInput(false);this.el.removeClass('hideing'); this.el.dom.style.display='block';Roo.get(document.body).addClass('modal-open');if(this.animate){(function(){this.el.addClass('show');this.el.addClass('in');}).defer(50,this);}else{this.el.addClass('show');this.el.addClass('in');}Roo.get(document.body).addClass("x-body-masked"); this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.setStyle('z-index',Roo.bootstrap.Modal.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');this.resize();this.fireEvent('show',this);this.el.setStyle('z-index',Roo.bootstrap.Modal.zIndex++); (function(){this.items.forEach(function(e){e.layout?e.layout():false;});}).defer(100,this);},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.maskEl.removeClass('show');this.maskEl.dom.style.display='';Roo.get(document.body).removeClass("x-body-masked"); -- 2.39.2