From 0a0bc094920119e8021293c2ba0ef101cf7a36e7 Mon Sep 17 00:00:00 2001 From: Mio Date: Thu, 22 Apr 2021 21:28:18 +0800 Subject: [PATCH 1/6] =?UTF-8?q?JSY-4371=20feat:=20=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E8=A1=8C=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E5=88=97=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/collection/collection.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 3cb3b67215..b9bb3383bb 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -103,7 +103,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { _cellRenderers: function (height, width, x, y) { this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y); - return this._cellGroupRenderer(); +return this._cellGroupRenderer(); }, _cellGroupRenderer: function () { @@ -113,7 +113,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { var cellMetadata = self._sectionManager.getCellMetadata(index); rendered.push(cellMetadata); }); - return rendered; +return rendered; }, _calculateChildrenToRender: function () { @@ -160,6 +160,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { var datum = childrenToDisplay[i]; var index = this.renderedKeys[datum.index] && this.renderedKeys[datum.index][1]; var child; + var lastDatum = childrenToDisplay[len - 1]; if (index >= 0) { if (datum.width !== this.renderedCells[index]._width) { this.renderedCells[index]._width = datum.width; @@ -182,7 +183,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { width: datum.width, height: datum.height }, o.items[datum.index], { - cls: (o.items[datum.index].cls || "") + " collection-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : ""), + cls: (o.items[datum.index].cls || "") + " collection-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : "") + (datum.row === lastDatum.row ? " last-row" : "") + (datum.col === lastDatum.col ? " last-col" : ""), _left: datum.x, _top: datum.y })); From afc39e6da867a24c0e1d6dea7f85ac0487369249 Mon Sep 17 00:00:00 2001 From: Mio Date: Thu, 22 Apr 2021 21:30:38 +0800 Subject: [PATCH 2/6] =?UTF-8?q?JSY-4371=20feat:=20=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/collection/collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index b9bb3383bb..404903384d 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -103,7 +103,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { _cellRenderers: function (height, width, x, y) { this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y); -return this._cellGroupRenderer(); + return this._cellGroupRenderer(); }, _cellGroupRenderer: function () { @@ -113,7 +113,7 @@ return this._cellGroupRenderer(); var cellMetadata = self._sectionManager.getCellMetadata(index); rendered.push(cellMetadata); }); -return rendered; + return rendered; }, _calculateChildrenToRender: function () { From 9e9bcbf38367ca5d68fd2ca4bd5818fa9a13092b Mon Sep 17 00:00:00 2001 From: Mio Date: Thu, 22 Apr 2021 23:28:31 +0800 Subject: [PATCH 3/6] =?UTF-8?q?JSY-4371=20feat:=20=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E8=A1=8C=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E5=88=97=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/collection/collection.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 404903384d..6ef7ed8135 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -156,11 +156,13 @@ BI.CollectionView = BI.inherit(BI.Widget, { border[offset] = 0; } }; + var lastDatum = BI.last(BI.sortBy(childrenToDisplay, function (index, child) { + return (child.x + child.width + child.y + child.height); + })); for (var i = 0, len = childrenToDisplay.length; i < len; i++) { var datum = childrenToDisplay[i]; var index = this.renderedKeys[datum.index] && this.renderedKeys[datum.index][1]; var child; - var lastDatum = childrenToDisplay[len - 1]; if (index >= 0) { if (datum.width !== this.renderedCells[index]._width) { this.renderedCells[index]._width = datum.width; @@ -183,7 +185,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { width: datum.width, height: datum.height }, o.items[datum.index], { - cls: (o.items[datum.index].cls || "") + " collection-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : "") + (datum.row === lastDatum.row ? " last-row" : "") + (datum.col === lastDatum.col ? " last-col" : ""), + cls: (o.items[datum.index].cls || "") + " collection-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : "") + ((datum.height + datum.y) === (lastDatum.height + lastDatum.y) ? " last-row" : "") + ((datum.width + datum.x) === (lastDatum.width + lastDatum.x) ? " last-col" : ""), _left: datum.x, _top: datum.y })); From e2597851f94d496b4fd6f2a3cd4308a37f0d09c5 Mon Sep 17 00:00:00 2001 From: Kira Date: Fri, 23 Apr 2021 09:24:54 +0800 Subject: [PATCH 4/6] =?UTF-8?q?refactor:=20=E5=A3=B0=E6=98=8E=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/ob.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/core/ob.ts b/typescript/core/ob.ts index 50a80b8d60..9c4e4b9472 100644 --- a/typescript/core/ob.ts +++ b/typescript/core/ob.ts @@ -71,7 +71,7 @@ export declare class OB { once(eventName: string, fn: Function): void; - un(eName: string, fn: Function): void; + un(eName: string, fn?: Function): void; _initRef(): void; From 402f2c594f028df8d4b1bfde7d5388dd40b7f379 Mon Sep 17 00:00:00 2001 From: Kira Date: Fri, 23 Apr 2021 10:19:05 +0800 Subject: [PATCH 5/6] =?UTF-8?q?JSY-4371=20feat:=20=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E6=9C=80=E5=90=8E=E4=B8=80=E8=A1=8C=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E5=88=97=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/collection/collection.js | 2 +- src/core/structure/sectionManager.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 6ef7ed8135..09b8f9de0b 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -156,7 +156,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { border[offset] = 0; } }; - var lastDatum = BI.last(BI.sortBy(childrenToDisplay, function (index, child) { + var lastDatum = BI.last(BI.sortBy(this._sectionManager.getAllCellMetadata(), function (index, child) { return (child.x + child.width + child.y + child.height); })); for (var i = 0, len = childrenToDisplay.length; i < len; i++) { diff --git a/src/core/structure/sectionManager.js b/src/core/structure/sectionManager.js index ee0692072c..314fbb4ab7 100644 --- a/src/core/structure/sectionManager.js +++ b/src/core/structure/sectionManager.js @@ -46,6 +46,10 @@ }); }, + getAllCellMetadata: function () { + return this._cellMetadata; + }, + getCellMetadata: function (index) { return this._cellMetadata[index]; }, From c83aa2093620d7e4693b10156d5fb952ce8c5f09 Mon Sep 17 00:00:00 2001 From: Kira Date: Fri, 23 Apr 2021 11:23:51 +0800 Subject: [PATCH 6/6] =?UTF-8?q?revert:=20=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/collection/collection.js | 5 +---- src/core/structure/sectionManager.js | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/base/collection/collection.js b/src/base/collection/collection.js index 09b8f9de0b..3cb3b67215 100644 --- a/src/base/collection/collection.js +++ b/src/base/collection/collection.js @@ -156,9 +156,6 @@ BI.CollectionView = BI.inherit(BI.Widget, { border[offset] = 0; } }; - var lastDatum = BI.last(BI.sortBy(this._sectionManager.getAllCellMetadata(), function (index, child) { - return (child.x + child.width + child.y + child.height); - })); for (var i = 0, len = childrenToDisplay.length; i < len; i++) { var datum = childrenToDisplay[i]; var index = this.renderedKeys[datum.index] && this.renderedKeys[datum.index][1]; @@ -185,7 +182,7 @@ BI.CollectionView = BI.inherit(BI.Widget, { width: datum.width, height: datum.height }, o.items[datum.index], { - cls: (o.items[datum.index].cls || "") + " collection-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : "") + ((datum.height + datum.y) === (lastDatum.height + lastDatum.y) ? " last-row" : "") + ((datum.width + datum.x) === (lastDatum.width + lastDatum.x) ? " last-col" : ""), + cls: (o.items[datum.index].cls || "") + " collection-cell" + (datum.y === 0 ? " first-row" : "") + (datum.x === 0 ? " first-col" : ""), _left: datum.x, _top: datum.y })); diff --git a/src/core/structure/sectionManager.js b/src/core/structure/sectionManager.js index 314fbb4ab7..ee0692072c 100644 --- a/src/core/structure/sectionManager.js +++ b/src/core/structure/sectionManager.js @@ -46,10 +46,6 @@ }); }, - getAllCellMetadata: function () { - return this._cellMetadata; - }, - getCellMetadata: function (index) { return this._cellMetadata[index]; },