From 4f18cc8cfa1a402e30ed4e270078130998362a5f Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 11:00:46 +0800 Subject: [PATCH 01/12] =?UTF-8?q?BI-115516:=20=E7=AC=AC=E4=B8=80=E9=A1=B5?= =?UTF-8?q?=E5=A4=9A=E6=98=BE=E7=A4=BA=E4=B8=80=E4=BA=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 1672bae8a8002e3035c87175dc227d58f8e355ad Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 11:25:09 +0800 Subject: [PATCH 02/12] auto upgrade version to 2.0.20221018112352 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c7418bc2c..ce2fee7d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018090412", + "version": "2.0.20221018112352", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 4a987bb987938593f5cc126b84f147253570c54b Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 14:04:15 +0800 Subject: [PATCH 03/12] =?UTF-8?q?BI-115516=20check=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=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 --- .../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 1d05fc0b0adf761b64683d0ff2ca207ae1596af8 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 16:15:14 +0800 Subject: [PATCH 04/12] auto upgrade version to 2.0.20221018161504 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ce2fee7d6..0c16da78e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018112352", + "version": "2.0.20221018161504", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 0f5397b31e8ba75b2cfc8037bb146251b7c1aa56 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 16:30:48 +0800 Subject: [PATCH 05/12] bugfix --- 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; From 568a930fdabb8dc469e64dfc966125bc3ca5f6fd Mon Sep 17 00:00:00 2001 From: superman Date: Tue, 18 Oct 2022 15:50:14 +0800 Subject: [PATCH 06/12] 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 07/12] 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 08/12] =?UTF-8?q?Pull=20request=20#3135:=20BI-115516=20che?= =?UTF-8?q?ck=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 09/12] =?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; From 5ff4f87609cadbdc6dcb92223000043eecf364cc Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 16:54:20 +0800 Subject: [PATCH 10/12] auto upgrade version to 2.0.20221018165412 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c16da78e..61a07e3c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018161504", + "version": "2.0.20221018165412", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 2a63939ad1d0bc0df36f6a97348460c0f5a00bb9 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 18 Oct 2022 17:08:15 +0800 Subject: [PATCH 11/12] bugfix --- src/widget/singleselect/trigger/searcher.singleselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/singleselect/trigger/searcher.singleselect.js b/src/widget/singleselect/trigger/searcher.singleselect.js index a5674b8f1..800fd7560 100644 --- a/src/widget/singleselect/trigger/searcher.singleselect.js +++ b/src/widget/singleselect/trigger/searcher.singleselect.js @@ -128,7 +128,7 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, { if (BI.isUndefined(v)) { this.editor.setState(BI.Selection.None); } else { - v = v || ""; + v = v ?? ""; this.editor.setState(o.valueFormatter(v + "") || (v + "")); } }, From 376d18df965ddfc2cf808b4ccd5b15cdcc4426e9 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 18 Oct 2022 17:14:21 +0800 Subject: [PATCH 12/12] auto upgrade version to 2.0.20221018171414 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 61a07e3c4..fa1c5ba6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221018165412", + "version": "2.0.20221018171414", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",