From 8cc5ed019917c62da81f7de80c1606b180e46890 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 26 Sep 2022 22:18:30 +0800 Subject: [PATCH 1/9] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/list/virtualgrouplist.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js index a4a811c73..34b11e800 100644 --- a/src/base/list/virtualgrouplist.js +++ b/src/base/list/virtualgrouplist.js @@ -27,7 +27,7 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; - + return { type: "bi.vertical", items: [{ @@ -97,12 +97,13 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { this.container[self.renderedIndex === -1 ? "populate" : "addItems"](items.map(function (item, i) { return o.itemFormatter(item, index + i); }), this); - var addedHeight = getElementHeight() - lastHeight; + var elementHeight = getElementHeight(); + var addedHeight = elementHeight - lastHeight; this.tree.set(cnt, addedHeight); this.renderedIndex = cnt; cnt++; index += o.blockSize; - lastHeight = this.renderedIndex === -1 ? 0 : getElementHeight(); + lastHeight = this.renderedIndex === -1 ? 0 : elementHeight; } }, From b5bd2cab66d670957e4cee0db41d0b0749fe89ab Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 28 Sep 2022 15:32:10 +0800 Subject: [PATCH 2/9] =?UTF-8?q?KERNEL-12982=20feat:=20[=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8C=96]=20:=20BI.Popover=E6=8F=90=E4=BE=9B=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E8=83=BD=E5=90=A6=E6=8B=96=E5=8A=A8=E7=9A=84=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popover.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index 2a4453472..4244a1efb 100644 --- a/src/base/layer/layer.popover.js +++ b/src/base/layer/layer.popover.js @@ -158,15 +158,17 @@ BI.Popover = BI.inherit(BI.Widget, { mounted: function () { var self = this; this.dragger.element.mousedown(function (e) { - self.startX = self.element[0].offsetLeft; - self.startY = self.element[0].offsetTop; - self.tracker.captureMouseMoves(e); + if (self.options.draggable !== false) { + self.startX = self.element[0].offsetLeft; + self.startY = self.element[0].offsetTop; + self.tracker.captureMouseMoves(e); + } }); }, _getSuitableBodyHeight: function (height) { var o = this.options; - + return BI.clamp(height, 0, BI.Widget._renderEngine.createElement("body")[0].clientHeight - o.headerHeight - (o.footer ? o.footerHeight : 0) - o.bodyTgap); }, @@ -207,6 +209,10 @@ BI.Popover = BI.inherit(BI.Widget, { }; }, + setDraggable: function (b) { + this.options.draggable = b; + }, + hide: function () { }, @@ -224,9 +230,6 @@ BI.Popover = BI.inherit(BI.Widget, { setZindex: function (zindex) { this.element.css({ "z-index": zindex }); }, - - destroyed: function () { - }, }); BI.shortcut("bi.popover", BI.Popover); From 415d05e22c9aba083f16210ba40ff85efee1345b Mon Sep 17 00:00:00 2001 From: data Date: Wed, 28 Sep 2022 19:45:13 +0800 Subject: [PATCH 3/9] auto upgrade version to 2.0.20220928194458 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5a12b0a9..b7701d0b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220928160431", + "version": "2.0.20220928194458", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From a459b0884d5883f8ed42d02f57db519316720fcf Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 3 Oct 2022 13:15:51 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=97=A0JIRA=20fix:=20=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=9D=A2=E6=9D=BFborder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/dynamicdate/dynamicdate.param.item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/dynamicdate/dynamicdate.param.item.js b/src/widget/dynamicdate/dynamicdate.param.item.js index c8771e908..fed229fa2 100644 --- a/src/widget/dynamicdate/dynamicdate.param.item.js +++ b/src/widget/dynamicdate/dynamicdate.param.item.js @@ -20,7 +20,7 @@ BI.DynamicDateParamItem = BI.inherit(BI.Widget, { items: [{ el: { type: "bi.sign_editor", - cls: "bi-border", + cls: "bi-border bi-focus-shadow bi-border-radius", height: BI.SIZE_CONSANTS.TOOL_BAR_HEIGHT - 2, validationChecker: function (v) { return BI.isNaturalNumber(v); From 422594d6da2558330543629185c7b9645640b3aa Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 3 Oct 2022 16:28:17 +0800 Subject: [PATCH 5/9] =?UTF-8?q?feature:=20=E6=94=AF=E6=8C=81type=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9B=B4=E6=8E=A5=E4=BC=A0=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89xtype=E9=83=BD=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/5.inject.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/5.inject.js b/src/core/5.inject.js index 9e0ae8503..0554740f7 100644 --- a/src/core/5.inject.js +++ b/src/core/5.inject.js @@ -411,7 +411,7 @@ // 根据配置属性生成widget var createWidget = function (config, context, lazy) { - var cls = kv[config.type]; + var cls = BI.isFunction(config.type) ? config.type : kv[config.type]; if (!cls) { throw new Error("组件: [" + config.type + "] 未定义"); @@ -449,9 +449,10 @@ } else if (item.el && (item.el.type || options.type)) { el = BI.extend({}, options, item.el); } - + if (el) { - runConfigFunction(el.type); + var elType = (el.type && el.type.xtype) || el.type; + runConfigFunction(elType); } // 先把准备环境准备好 @@ -466,13 +467,14 @@ return item; } if (el) { - w = BI.Plugin.getWidget(el.type, el); - if (w.type === el.type) { - if (BI.Plugin.hasObject(el.type)) { + w = BI.Plugin.getWidget(elType, el); + var wType = (w.type && w.type.xtype) || w.type; + if (wType === elType) { + if (BI.Plugin.hasObject(elType)) { w.listeners = (w.listeners || []).concat([{ eventName: BI.Events.MOUNT, action: function () { - BI.Plugin.getObject(el.type, this); + BI.Plugin.getObject(elType, this); } }]); } From a3e3ae3cb2dc4e31164a579a8962015ac09ba7a9 Mon Sep 17 00:00:00 2001 From: data Date: Mon, 3 Oct 2022 16:55:47 +0800 Subject: [PATCH 6/9] auto upgrade version to 2.0.20221003165530 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7701d0b7..f83b63d3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220928194458", + "version": "2.0.20221003165530", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 2dbcb33ad2615ab37576bd3c933f9cd7bb4edfc2 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 4 Oct 2022 14:34:55 +0800 Subject: [PATCH 7/9] auto upgrade version to 2.0.20221004143445 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f83b63d3c..b060e689b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221003165530", + "version": "2.0.20221004143445", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From b08014b5946ba933323d0b69bd486807d4e648b7 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 7 Oct 2022 02:06:37 +0800 Subject: [PATCH 8/9] resizeObserver --- src/core/platform/web/detectElementResize.js | 29 ++++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/core/platform/web/detectElementResize.js b/src/core/platform/web/detectElementResize.js index b34d21771..7137bb50c 100644 --- a/src/core/platform/web/detectElementResize.js +++ b/src/core/platform/web/detectElementResize.js @@ -112,7 +112,21 @@ }; var addResizeListener = function (element, fn) { - if (attachEvent) { + if (window.ResizeObserver) { + if (!element.__resizeObserver__) { + var resizeObserver = new window.ResizeObserver(function () { + element.__resizeListeners__.forEach(function (listener) { + listener(); + }); + }); + resizeObserver.observe(element); + element.__resizeObserver__ = resizeObserver; + } + if (!element.__resizeListeners__) { + element.__resizeListeners__ = []; + } + element.__resizeListeners__.push(fn); + } else if (attachEvent) { element.attachEvent("onresize", fn); BI.nextTick(fn); } else { @@ -137,8 +151,17 @@ } }; var removeResizeListener = function (element, fn) { - if (attachEvent) element.detachEvent("onresize", fn); - else { + if (window.ResizeObserver) { + var index = element.__resizeListeners__.indexOf(fn); + if (index >= 0) { + element.__resizeListeners__.splice(index, 1); + if (!element.__resizeListeners__.length) { + element.__resizeObserver__ && element.__resizeObserver__.unobserve(element); + } + } + } else if (attachEvent) { + element.detachEvent("onresize", fn); + } else { element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { element.removeEventListener("scroll", scrollListener); From 3ab68cd8324047a78d88176938520adbe5f712cf Mon Sep 17 00:00:00 2001 From: data Date: Fri, 7 Oct 2022 09:06:10 +0800 Subject: [PATCH 9/9] auto upgrade version to 2.0.20221007090556 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b060e689b..7fe64f1d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221004143445", + "version": "2.0.20221007090556", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",