From 24852af9a5a2dd2ad26c93ba35e2eb92cfcdf123 Mon Sep 17 00:00:00 2001 From: windy Date: Mon, 1 Aug 2022 17:16:51 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20down=5Fli?= =?UTF-8?q?st=5Fitem=E7=9A=84iconCls=E5=AF=B9=E5=BA=94=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/downlist/item.downlistgroup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widget/downlist/item.downlistgroup.js b/src/widget/downlist/item.downlistgroup.js index 31492b78b..e142a72b7 100644 --- a/src/widget/downlist/item.downlistgroup.js +++ b/src/widget/downlist/item.downlistgroup.js @@ -29,6 +29,8 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { cls: o.iconCls1, width: 36, height: o.height, + iconHeight: o.iconHeight, + iconWidth: 36, disableSelected: true, selected: this._digest(o.value) }); From b6541eb9221112daf29af64256727486d0ce4a25 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 1 Aug 2022 17:18:25 +0800 Subject: [PATCH 2/4] =?UTF-8?q?KERNEL-11286=20&&=20REPORT-77087=20fix:=20?= =?UTF-8?q?=E3=80=90=E6=96=B0=E5=BC=95=E6=93=8E=E6=96=B0=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E3=80=91=E5=85=81=E8=AE=B8=E7=9B=B4=E6=8E=A5=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E4=B8=8B=E6=8B=89=E6=A0=91=E5=B1=95=E5=BC=80=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E7=82=B9=E5=87=BB=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=94=B6=E8=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multilayerselecttree.combo.less | 15 ++++ .../multilayerselecttree.combo.js | 86 +++++++++++++------ .../multilayerselecttree.trigger.js | 11 +-- 3 files changed, 77 insertions(+), 35 deletions(-) diff --git a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less index d1c5771dc..ecb2dbf58 100644 --- a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less +++ b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less @@ -1,7 +1,22 @@ @import "../../index.less"; +@val: transform .3s ease; .bi-multilayer-select-tree-combo { + // 此combo的trigger_button是absolute上去的,与bi-combo在同一层级,独立写一下 + & .bi-combo.bi-combo-popup + .bi-trigger-icon-button { + & .x-icon { + .rotate(180deg); + .transition(@val); + } + } + + &:hover { + &.bi-border, &.bi-border-bottom { + border-color: @color-bi-border-hover-combo; + } + } + &.status-error { &.bi-border, &.bi-border-bottom { border-color: @border-color-negative; diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index 5b2b4bc48..98acb74b0 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -10,6 +10,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { isDefaultInit: false, height: 24, text: "", + defaultText: "", itemsCreator: BI.emptyFn, items: [], value: "", @@ -31,14 +32,47 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; - return (o.itemsCreator === BI.emptyFn) ? this._getSyncConfig() : this._getAsyncConfig(); + var cls = (o.simple ? "bi-border-bottom " : "bi-border bi-border-radius ") + (BI.isKey(o.status) ? ("status-" + o.status) : ""); + + var baseConfig = this._getBaseConfig(); + + if (o.allowEdit) { + return { + type: "bi.absolute", + cls, + items: [ + { + el: BI.extend(baseConfig, this._getSearchConfig()), + top: 0, bottom: 0, right: 0, left: 0 + }, { + el: self._getTriggerIconButton(), + top: 0, bottom: 0, right: 0, + }, + ] + }; + } + + return BI.extend(baseConfig, { + el: { + type: "bi.single_tree_trigger", + ref: function (_ref) { + self.textTrigger = _ref; + }, + text: o.text, + defaultText: o.defaultText, + height: o.height, + items: o.items, + value: o.value, + tipType: o.tipType, + warningTitle: o.warningTitle, + } + }, { cls }); }, _getBaseConfig: function () { var self = this, o = this.options; return { type: "bi.combo", - cls: (o.simple ? "bi-border-bottom " : "bi-border bi-border-radius ") + (BI.isKey(o.status) ? ("status-" + o.status) : ""), container: o.container, destroyWhenHide: o.destroyWhenHide, adjustLength: 2, @@ -105,6 +139,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { // height: o.height - (o.simple ? 1 : 2), height: o.height, text: o.text, + defaultText: o.defaultText, value: o.value, tipType: o.tipType, warningTitle: o.warningTitle, @@ -153,7 +188,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { // IE11下,popover(position: fixed)下放置下拉控件(position: fixed), 滚动的时候会异常卡顿 // 通过container参数将popup放置于popover之外解决此问题, 其他下拉控件由于元素少或者有分页,所以 // 卡顿不明显, 先在此做尝试, 并在FineUI特殊处理待解决文档中标记跟踪 - return !(o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0); + return (o.container && self.trigger.getSearcher().isSearching() && self.trigger.getSearcher().getView().element.find(e.target).length > 0) ? false : self.triggerBtn?.element.find(e.target).length === 0; }, listeners: [{ @@ -170,28 +205,29 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { }; }, - _getSyncConfig: function () { - var o = this.options, self = this; - var baseConfig = this._getBaseConfig(); - return BI.extend(baseConfig, o.allowEdit ? this._getSearchConfig() : { - el: { - type: "bi.single_tree_trigger", - ref: function (_ref) { - self.textTrigger = _ref; - }, - text: o.text, - height: o.height, - items: o.items, - value: o.value, - tipType: o.tipType, - warningTitle: o.warningTitle, - } - }); - }, - - _getAsyncConfig: function () { - var config = this._getBaseConfig(); - return BI.extend(config, this._getSearchConfig()); + _getTriggerIconButton: function () { + var self = this, o = this.options; + return { + type: "bi.trigger_icon_button", + cls: "trigger-icon-button", + ref: function (_ref) { + self.triggerBtn = _ref; + }, + width: o.height, + height: o.height, + listeners: [ + { + eventName: BI.TriggerIconButton.EVENT_CHANGE, + action: function () { + if (self.combo.isViewVisible()) { + self.combo.hideView(); + } else { + self.combo.showView(); + } + } + } + ] + }; }, setValue: function (v) { diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index 11789b5ac..3d9614544 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -102,17 +102,8 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }] }, width: "fill", - }, { - el: { - type: "bi.trigger_icon_button", - cls: "trigger-icon-button", - ref: function (_ref) { - self.triggerBtn = _ref; + rgap: 24 }, - width: 24, - }, - width: 24, - } ] }; }, From abe1b1989be5d8576bbbefa34b3c4c21d0a1b8f5 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 1 Aug 2022 18:20:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?KERNEL-11422=20feat:=20=E7=BB=99=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E9=83=BD=E6=B7=BB=E5=8A=A0valueFormatter?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multilayerselecttree.combo.js | 4 +++- .../multilayerselecttree.trigger.js | 16 ++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/widget/multilayerselecttree/multilayerselecttree.combo.js b/src/widget/multilayerselecttree/multilayerselecttree.combo.js index b0371bd59..519b45f76 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.combo.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.combo.js @@ -36,6 +36,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { var baseConfig = this._getBaseConfig(); + if (o.allowEdit) { return { type: "bi.absolute", @@ -65,6 +66,7 @@ BI.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, { value: o.value, tipType: o.tipType, warningTitle: o.warningTitle, + valueFormatter: o.valueFormatter, } }, { cls }); }, @@ -287,4 +289,4 @@ BI.MultiLayerSelectTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiLayerSelectTreeCombo.EVENT_STOP = "EVENT_STOP"; BI.MultiLayerSelectTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.MultiLayerSelectTreeCombo.EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; -BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo); \ No newline at end of file +BI.shortcut("bi.multilayer_select_tree_combo", BI.MultiLayerSelectTreeCombo); diff --git a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js index 3d9614544..f59ab6251 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.trigger.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.trigger.js @@ -19,7 +19,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { if (o.itemsCreator === BI.emptyFn) { this._initData(); } - + return { type: "bi.horizontal_fill", items: [ @@ -103,7 +103,7 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { }, width: "fill", rgap: 24 - }, + }, ] }; }, @@ -181,15 +181,11 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, { return o.valueFormatter(v); } - if (o.itemsCreator === BI.emptyFn) { - var result = BI.find(o.items, function (i, item) { - return item.value === v; - }); - - return BI.isNotNull(result) ? result.text : o.text; - } + var result = BI.find(o.items, function (i, item) { + return item.value === v; + }); - return v; + return BI.isNotNull(result) ? result.text : (o.text ?? v); }, _getShowText: function () { From 002343976de549f06fa88cbfa28bb8eb995b3412 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 2 Aug 2022 09:54:23 +0800 Subject: [PATCH 4/4] auto upgrade version to 2.0.20220802095411 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ef2db899a..bece05fab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220801175612", + "version": "2.0.20220802095411", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",