From 568a930fdabb8dc469e64dfc966125bc3ca5f6fd Mon Sep 17 00:00:00 2001 From: superman Date: Tue, 18 Oct 2022 15:50:14 +0800 Subject: [PATCH 1/4] Merge pull request #200530 in DEC/fineui from master to feature/x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commit 'b3540cf33517b3b0231b692d0d1085a1d301eb3e': 无JIRA chore: 描述 KERNEL-13123 feat: combo trigger支持 hover-click --- src/base/combination/bubble.js | 11 ++++++++++- typescript/core/platform/web/detectElementResize.ts | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index d3bc2975a..1af43b79c 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -12,7 +12,7 @@ attributes: { tabIndex: -1, }, - trigger: "click", // click || hover || click-hover || "" + trigger: "click", // click || hover || click-hover || "hover-click" || "" toggle: true, direction: "", placement: "bottom-start", // top-start/top/top-end/bottom-start/bottom/bottom-end/left-start/left/left-end/right-start/right/right-end @@ -219,6 +219,15 @@ } }); break; + case "hover-click": + self.element.on("mouseenter." + self.getName(), function (e) { + if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) { + self._popupView(e); + self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo); + self.fireEvent(BI.Bubble.EVENT_EXPAND); + } + }); + break; default: break; } diff --git a/typescript/core/platform/web/detectElementResize.ts b/typescript/core/platform/web/detectElementResize.ts index c0ba6e28d..8e1566ce9 100644 --- a/typescript/core/platform/web/detectElementResize.ts +++ b/typescript/core/platform/web/detectElementResize.ts @@ -2,5 +2,5 @@ import { Widget } from "../../../core/widget"; export type _DetectElementResize = { addResizeListener: (widget: Widget, fn: Function) => Function - removeResizeListener: (widget: Widget, fn: Function) => void -} \ No newline at end of file + removeResizeListener: (widget: Widget, fn?: Function) => void +} From 655410e6a1470149b3031296a4e69b1c87d7935a Mon Sep 17 00:00:00 2001 From: superman Date: Tue, 18 Oct 2022 11:05:13 +0800 Subject: [PATCH 2/4] Merge pull request #200297 in DEC/fineui from master to feature/x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commit '9bdc3080be01ea47ef34b35b6b367aad3430c844': BI-115516: 第一页多显示一些 --- src/widget/multiselect/loader.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 47f34a729..7f4a293de 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -167,7 +167,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { }]); return false; } - this.options.items = (items || []).slice(0, 100); + this.options.items = (items || []).slice(0, (items || []).length % 100); this.times = 1; this.count = 0; this.count += items.length; @@ -184,14 +184,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { populate: function (items, keyword) { if (this._populate.apply(this, arguments)) { this.cachItems = []; - if (items.length > 100) { - this.cachItems = items.slice(100); + var firstItemsCount = 100 + items.length % 100; + if (items.length > firstItemsCount) { + this.cachItems = items.slice(firstItemsCount); } var renderEngine = BI.Widget._renderEngine; BI.Widget.registerRenderEngine(BI.Element.renderEngine); this.cachGroup.populate.call(this.cachGroup, items, keyword); BI.Widget.registerRenderEngine(renderEngine); - this.button_group.populate.call(this.button_group, items.slice(0, 100), keyword); + this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword); } }, From bfbb8d1d3747b094810dc8382146ce7a4e475760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?guy-=E7=8E=8B=E5=B7=9D?= Date: Tue, 18 Oct 2022 14:05:53 +0800 Subject: [PATCH 3/4] =?UTF-8?q?Pull=20request=20#3135:=20BI-115516=20check?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=B9=9F=E5=A4=84=E7=90=86=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge in VISUAL/fineui from ~GUY/fineui:master to master * commit '5c9b9a34fb2f8bbbe092e53113df6b8e47f98f80': BI-115516 check面板也处理下 --- .../multiselect/check/multiselect.display.js | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/widget/multiselect/check/multiselect.display.js b/src/widget/multiselect/check/multiselect.display.js index 337afd59f..b5b4f76e8 100644 --- a/src/widget/multiselect/check/multiselect.display.js +++ b/src/widget/multiselect/check/multiselect.display.js @@ -26,6 +26,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { var self = this, opts = this.options; this.hasNext = false; + var cacheItems = []; this.button_group = BI.createWidget({ type: "bi.list_pane", @@ -45,10 +46,29 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { }] }, itemsCreator: function (options, callback) { + if (options.times === 1) { + cacheItems = []; + } + + if (cacheItems.length > 0) { + var renderedItems = cacheItems.slice(0, 100); + cacheItems = cacheItems.slice(100); + self.hasNext = true; + if (cacheItems.length === 0) { + self.hasNext = false; + } + callback(self._createItems(renderedItems)); + return; + } opts.itemsCreator(options, function (ob) { self.hasNext = !!ob.hasNext; - callback(self._createItems(ob.items)); + var firstItemsCount = 100 + ob.items.length % 100; + if (ob.items.length > 100) { + cacheItems = ob.items.slice(100 + ob.items.length % 100); + self.hasNext = true; + } + callback(self._createItems(ob.items.slice(0, firstItemsCount))); }); }, hasNext: function () { From 7b5878fb6c1efd58dfeeffd013d5d261c718a45c Mon Sep 17 00:00:00 2001 From: windy Date: Tue, 18 Oct 2022 16:43:16 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/multiselect/loader.js b/src/widget/multiselect/loader.js index 7f4a293de..c2c2d8de7 100644 --- a/src/widget/multiselect/loader.js +++ b/src/widget/multiselect/loader.js @@ -167,7 +167,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, { }]); return false; } - this.options.items = (items || []).slice(0, (items || []).length % 100); + this.options.items = (items || []).slice(0, 100 + (items || []).length % 100); this.times = 1; this.count = 0; this.count += items.length;