From 6006d7bb5c878e2cec54dba324e49134b989816c Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 1 Dec 2022 17:14:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?KERNEL-13662=20feat:=20text=5Fvalue=5Fcombo?= =?UTF-8?q?=20=E5=A4=8D=E9=80=89,=E6=94=AF=E6=8C=81=E4=B8=8D=E5=B8=A6?= =?UTF-8?q?=E5=85=A8=E9=80=89=20-=20from=20Richie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/case/combo/demo.text_value_combo.js | 23 ++++ .../combo/textvaluecombo/popup.textvalue.js | 112 +++++++++--------- 2 files changed, 79 insertions(+), 56 deletions(-) diff --git a/demo/js/case/combo/demo.text_value_combo.js b/demo/js/case/combo/demo.text_value_combo.js index cf6b30feb..4f8c4a92e 100644 --- a/demo/js/case/combo/demo.text_value_combo.js +++ b/demo/js/case/combo/demo.text_value_combo.js @@ -209,6 +209,29 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, { ] } ] + }), + this.createCombo("支持复选,不要全选功能", { + type: "bi.vertical", + items: [ + { + type: "bi.text_value_combo", + width: 300, + items: items, + allowClear: true, + defaultText: "请选择", + chooseType: BI.Selection.Multi, + value: [1], + allowSelectAll: false, + listeners: [ + { + eventName: BI.TextValueCombo.EVENT_CHANGE, + action: function () { + console.log(this.getValue()); + } + } + ] + } + ] }) ] }; diff --git a/src/case/combo/textvaluecombo/popup.textvalue.js b/src/case/combo/textvaluecombo/popup.textvalue.js index fa0de7c23..3411793a4 100644 --- a/src/case/combo/textvaluecombo/popup.textvalue.js +++ b/src/case/combo/textvaluecombo/popup.textvalue.js @@ -45,65 +45,38 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { return { type: "bi.vertical", verticalAlign: BI.VerticalAlign.Stretch, - rowSize: ["fill", ""], - items: [ + items: o.allowSelectAll ? [ { - el: o.allowSelectAll ? { - type: "bi.select_list", - logic: { - dynamic: true, - innerVgap: 5, - rowSize: ["", "fill"], - verticalAlign: BI.VerticalAlign.Stretch - }, - ref: (_ref) => { - this.popup = _ref; - }, - el: { - el: { - chooseType: o.chooseType, - } - }, - items: this._formatItems(o.items), - value: { - type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, - value: o.value - }, - listeners: [ - { - eventName: BI.SelectList.EVENT_CHANGE, - action: function (val) { - self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val); - } - } - ] - } : { - type: "bi.list_pane", - logic: { - dynamic: true, - innerVgap: 5, - rowSize: ["", "fill"], - verticalAlign: BI.VerticalAlign.Stretch - }, - ref: (_ref) => { - this.popup = _ref; - }, + type: "bi.select_list", + logic: { + dynamic: true, + innerVgap: 5, + rowSize: ["", "fill"], + verticalAlign: BI.VerticalAlign.Stretch + }, + ref: (_ref) => { + this.popup = _ref; + }, + el: { el: { chooseType: o.chooseType, - }, - items: this._formatItems(o.items), - value: o.value, - listeners: [ - { - eventName: BI.ListPane.EVENT_CHANGE, - action: function (val) { - self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val); - } + } + }, + items: this._formatItems(o.items), + value: { + type: BI.ButtonGroup.CHOOSE_TYPE_MULTI, + value: o.value + }, + height: "fill", + listeners: [ + { + eventName: BI.SelectList.EVENT_CHANGE, + action: function (val) { + self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val); } - ] - } - }, - { + } + ] + }, { type: "bi.center", cls: "list-view-toolbar bi-high-light bi-split-top", height: 24, @@ -127,7 +100,34 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, { isShadowShowingOnSelected: true }) } - ] + ] : [ + { + type: "bi.list_pane", + logic: { + dynamic: true, + innerVgap: 5, + rowSize: ["", "fill"], + verticalAlign: BI.VerticalAlign.Stretch + }, + ref: (_ref) => { + this.popup = _ref; + }, + el: { + chooseType: o.chooseType, + }, + items: this._formatItems(o.items), + value: o.value, + height: "fill", + listeners: [ + { + eventName: BI.ListPane.EVENT_CHANGE, + action: function (val) { + self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val); + } + } + ] + } + ], }; }, From 6e0dd6ac965645b450ac4e36cb16b5a01e12e234 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 1 Dec 2022 18:03:30 +0800 Subject: [PATCH 2/2] auto upgrade version to 2.0.20221201180321 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 412d6436c..51b322873 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221130152547", + "version": "2.0.20221201180321", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",