From ec0707894cc9fd59540566d1a9b75ff473407232 Mon Sep 17 00:00:00 2001 From: iapyang Date: Tue, 21 Jun 2022 14:39:09 +0800 Subject: [PATCH 1/8] =?UTF-8?q?chore:=20=E5=8E=BB=E6=8E=89ie6-8=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/image.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/less/image.less b/src/less/image.less index bd2bcfabc..34be5fe1d 100644 --- a/src/less/image.less +++ b/src/less/image.less @@ -333,7 +333,7 @@ @font-face { font-family: "@{name}"; src: url('@{fontUrl}iconfont.eot'); - src: url('@{fontUrl}iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ + src: url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ } } From f0fd06cc838b448d56fa109174950e7ac6109be7 Mon Sep 17 00:00:00 2001 From: treecat Date: Tue, 21 Jun 2022 15:51:26 +0800 Subject: [PATCH 2/8] =?UTF-8?q?DESIGN-4069=20feat:=20button=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20setIcon=20=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/button/demo.button.js | 15 +++++++++++++++ src/base/single/button/buttons/button.js | 11 +++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 400559566..056564c9f 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -376,6 +376,21 @@ Demo.Button = BI.inherit(BI.Widget, { plain: true, disabled: true } + }, { + el: { + type: "bi.button", + iconCls: "plus-font", + text: "点我,更改图标", + handler() { + this.i = this.i === undefined ? 0 : ++this.i; + const arr = ["text-background-font", "check-mark-ha-font", "close-font", "search-font", "date-change-h-font"]; + if(this.i >= arr.length) { + this.i = 0; + } + this.setIcon(arr[this.i]); + }, + height: 24 + } }]; // BI.each(items, function (i, item) { // item.el.handler = function () { diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 78e910f7c..0ba1468b4 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -77,8 +77,8 @@ } if (BI.isKey(o.iconCls)) { this.icon = BI.createWidget({ - type: "bi.icon_label", - cls: o.iconCls, + type: "bi.icon_change_button", + iconCls: o.iconCls, width: this._const.iconWidth, height: lineHeight, lineHeight: lineHeight @@ -195,6 +195,13 @@ } }, + setIcon: function (iconCls) { + if (this.icon) { + this.options.iconCls = iconCls; + this.icon.setIcon(iconCls); + } + }, + doRedMark: function () { this.text.doRedMark.apply(this.text, arguments); }, From 0e4efcc66f94279b659fbae7cb4ad5b95a98c00c Mon Sep 17 00:00:00 2001 From: treecat Date: Tue, 21 Jun 2022 16:37:35 +0800 Subject: [PATCH 3/8] =?UTF-8?q?DESIGN-4069=20fix:=20button=20=E7=9A=84=20s?= =?UTF-8?q?etIcon=20=E4=B8=8D=E4=BD=BF=E7=94=A8=20IconChangeButton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/button/buttons/button.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 0ba1468b4..39a116c77 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -77,8 +77,8 @@ } if (BI.isKey(o.iconCls)) { this.icon = BI.createWidget({ - type: "bi.icon_change_button", - iconCls: o.iconCls, + type: "bi.icon_label", + cls: o.iconCls, width: this._const.iconWidth, height: lineHeight, lineHeight: lineHeight @@ -195,10 +195,11 @@ } }, - setIcon: function (iconCls) { - if (this.icon) { - this.options.iconCls = iconCls; - this.icon.setIcon(iconCls); + setIcon: function (cls) { + var o = this.options; + if(this.icon && o.iconCls !== cls) { + this.icon.element.removeClass(o.iconCls).addClass(cls); + o.iconCls = cls; } }, From 06c3a20ae76d4691e27209ed4ec1e84c21f9ca43 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 21 Jun 2022 17:24:03 +0800 Subject: [PATCH 4/8] auto upgrade version to 2.0.20220621172357 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84cbf8cc1..bc8f9b2ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220621140421", + "version": "2.0.20220621172357", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From cd6a6ffdfc45b38ce331b038960e60c8e2f3b135 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 22 Jun 2022 10:55:34 +0800 Subject: [PATCH 5/8] auto upgrade version to 2.0.20220622105522 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc8f9b2ca..e0d4de584 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220621172357", + "version": "2.0.20220622105522", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 88ae40c65ea41674f980938af1edb400ac0a7fe4 Mon Sep 17 00:00:00 2001 From: data Date: Wed, 22 Jun 2022 11:05:12 +0800 Subject: [PATCH 6/8] auto upgrade version to 2.0.20220622110506 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e0d4de584..3693c9e1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220622105522", + "version": "2.0.20220622110506", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", From 02142972cfa45e45053af3a2e68c654b59b95716 Mon Sep 17 00:00:00 2001 From: treecat Date: Thu, 23 Jun 2022 14:07:18 +0800 Subject: [PATCH 7/8] =?UTF-8?q?REPORT-74080=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE=E6=A0=87=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=B1=85=E4=B8=AD=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BA=86=E6=92=91?= =?UTF-8?q?=E5=BC=80=E7=9A=84=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/base/button/demo.button.js | 11 +++++++++++ src/base/single/button/buttons/button.js | 24 ++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index 056564c9f..110431afb 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -256,6 +256,17 @@ Demo.Button = BI.inherit(BI.Widget, { iconGap: 24, iconPosition: "top" } + },{ + el: { + type: "bi.button", + text: "自动撑开高度", + iconCls: "close-font", + textHeight: 32, + iconGap: 24, + vgap: 16, + hgap: 100, + iconPosition: "top" + } }, { el: { type: "bi.button", diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 39a116c77..d7f875b8f 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -14,20 +14,29 @@ BI.Button = BI.inherit(BI.BasicButton, { _const: { - iconWidth: 16 + iconWidth: 18 }, _defaultConfig: function (props) { var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); + var adaptiveHeight = 0; + if (isVertical(props.iconPosition)) { + // 图标高度和文字高度默认相等 + adaptiveHeight += (props.textHeight || 16) * 2; + adaptiveHeight += props.iconGap || 4; + var tGap = props.tgap || props.vgap || 2; + var bGap = props.bgap || props.vgap || 2; + adaptiveHeight += (tGap + bGap); + } + return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-button" + ((BI.isIE() && BI.isIE9Below()) ? " hack" : ""), attributes: { tabIndex: 1 }, minWidth: (props.block === true || props.clear === true) ? 0 : 80, - // 44 = 垂直间距 6 + 边框 2 + 图标 16 + 图标和文字间隔 8 + 文字 12 - height: isVertical(props.iconPosition) ? 44 + ((props.iconGap || 8) - 8) : 24, + height: isVertical(props.iconPosition) ? adaptiveHeight : 24, shadow: props.clear !== true, isShadowShowingOnSelected: true, readonly: true, @@ -49,7 +58,7 @@ bgap: 0, lgap: 0, rgap: 0, - iconGap: 8, + iconGap: 4, iconPosition: "left" }); }, @@ -81,7 +90,10 @@ cls: o.iconCls, width: this._const.iconWidth, height: lineHeight, - lineHeight: lineHeight + lineHeight: lineHeight, + // 不设置,自定义按钮无法居中 + iconWidth: o.iconWidth, + iconHeight: o.iconHeight }); this.text = BI.createWidget({ type: "bi.label", @@ -197,7 +209,7 @@ setIcon: function (cls) { var o = this.options; - if(this.icon && o.iconCls !== cls) { + if (this.icon && o.iconCls !== cls) { this.icon.element.removeClass(o.iconCls).addClass(cls); o.iconCls = cls; } From 49669e51978f60923088edeea78d0414b5fcbe4f Mon Sep 17 00:00:00 2001 From: data Date: Thu, 23 Jun 2022 15:45:56 +0800 Subject: [PATCH 8/8] auto upgrade version to 2.0.20220623154535 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3693c9e1e..b80b3cd54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220622110506", + "version": "2.0.20220623154535", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts",