@refinitiv-ui/efx-grid 6.0.91 → 6.0.92
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/column-dragging/es6/ColumnDragging.d.ts +1 -1
- package/lib/column-dragging/es6/ColumnDragging.js +144 -34
- package/lib/core/dist/core.js +2410 -2621
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.js +14 -14
- package/lib/core/es6/data/DataCache.js +118 -118
- package/lib/core/es6/data/DataTable.d.ts +3 -1
- package/lib/core/es6/data/DataTable.js +208 -190
- package/lib/core/es6/data/DataView.d.ts +1 -1
- package/lib/core/es6/data/DataView.js +291 -291
- package/lib/core/es6/data/Segment.js +79 -79
- package/lib/core/es6/data/SegmentCollection.js +81 -81
- package/lib/core/es6/data/WrappedView.js +41 -41
- package/lib/core/es6/grid/Core.js +635 -635
- package/lib/core/es6/grid/ILayoutGrid.js +1 -1
- package/lib/core/es6/grid/LayoutGrid.js +183 -183
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +91 -91
- package/lib/core/es6/grid/components/Cell.js +29 -29
- package/lib/core/es6/grid/components/CellFloatingPanel.js +11 -11
- package/lib/core/es6/grid/components/CellSpan.js +7 -7
- package/lib/core/es6/grid/components/CellSpans.js +36 -34
- package/lib/core/es6/grid/components/Column.js +40 -40
- package/lib/core/es6/grid/components/ElementWrapper.js +17 -17
- package/lib/core/es6/grid/components/HScrollbar.js +31 -31
- package/lib/core/es6/grid/components/Scrollbar.js +77 -77
- package/lib/core/es6/grid/components/StretchedCells.js +49 -49
- package/lib/core/es6/grid/components/VScrollbar.js +11 -11
- package/lib/core/es6/grid/components/VirtualItems.js +3 -3
- package/lib/core/es6/grid/event/EventDispatcher.js +9 -9
- package/lib/core/es6/grid/event/EventListeners.js +4 -4
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +186 -186
- package/lib/core/es6/grid/util/Conflator.js +4 -4
- package/lib/core/es6/grid/util/Reverter.js +1 -1
- package/lib/core/es6/grid/util/SectionSettings.js +20 -20
- package/lib/core/es6/grid/util/SelectionList.js +23 -23
- package/lib/core/es6/grid/util/TrackLayout.js +74 -74
- package/lib/core/es6/grid/util/Virtualizer.js +15 -15
- package/lib/core/es6/grid/util/util.js +20 -20
- package/lib/core/es6/index.d.ts +0 -2
- package/lib/core/es6/index.js +0 -3
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +193 -70
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +46 -30
- package/lib/rt-grid/es6/RowDefinition.d.ts +2 -1
- package/lib/rt-grid/es6/RowDefinition.js +74 -16
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +56 -1
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -1
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +29 -1
- package/lib/tr-grid-util/es6/CellPainter.js +94 -93
- package/lib/tr-grid-util/es6/Conflator.js +4 -4
- package/lib/tr-grid-util/es6/CoralItems.js +6 -6
- package/lib/tr-grid-util/es6/DateTime.js +39 -39
- package/lib/tr-grid-util/es6/Deferred.js +5 -5
- package/lib/tr-grid-util/es6/Delay.js +1 -1
- package/lib/tr-grid-util/es6/Dom.js +26 -26
- package/lib/tr-grid-util/es6/DragUI.js +17 -17
- package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
- package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
- package/lib/tr-grid-util/es6/ElfDate.js +4 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
- package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
- package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
- package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
- package/lib/tr-grid-util/es6/Ext.js +6 -6
- package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
- package/lib/tr-grid-util/es6/FilterBuilder.js +57 -57
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
- package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
- package/lib/tr-grid-util/es6/GridPlugin.js +86 -86
- package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
- package/lib/tr-grid-util/es6/Icon.js +4 -4
- package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
- package/lib/tr-grid-util/es6/MultiTableManager.js +68 -68
- package/lib/tr-grid-util/es6/NumberFormatter.js +22 -22
- package/lib/tr-grid-util/es6/PercentBar.js +17 -17
- package/lib/tr-grid-util/es6/Perf.js +5 -5
- package/lib/tr-grid-util/es6/Popup.js +42 -42
- package/lib/tr-grid-util/es6/RangeBar.js +5 -5
- package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
- package/lib/tr-grid-util/es6/RowPainter.js +23 -23
- package/lib/tr-grid-util/es6/SubTable.js +94 -94
- package/lib/tr-grid-util/es6/Table.js +51 -51
- package/lib/tr-grid-util/es6/TextHighlighter.js +49 -49
- package/lib/tr-grid-util/es6/TickCodes.js +2 -2
- package/lib/tr-grid-util/es6/Timer.js +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
- package/lib/tr-grid-util/es6/Util.js +50 -50
- package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
- package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
- package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
- package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
- package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
- package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
- package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
- package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
- package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
- package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
- package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
- package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
- package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
- package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
- package/lib/tr-grid-util/es6/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
- package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
- package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
- package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
- package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
- package/lib/tr-grid-util/es6/jet/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
- package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation.js +1 -1
- package/lib/types/es6/ColumnDragging.d.ts +1 -1
- package/lib/types/es6/ColumnGrouping.d.ts +3 -1
- package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
- package/lib/types/es6/Core/index.d.ts +0 -2
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
- package/lib/versions.json +4 -4
- package/package.json +1 -1
- package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
- package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
- package/lib/core/es6/grid/util/HttpRequest.js +0 -371
- package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
- package/lib/core/es6/grid/util/PercentBar.js +0 -390
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
- package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
- package/lib/core/es6/grid/util/RangeBar.js +0 -255
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +0 -25
@@ -16,7 +16,7 @@ import HScrollbar from "./components/HScrollbar.js";
|
|
16
16
|
* @param {number} limit
|
17
17
|
* @return {number}
|
18
18
|
*/
|
19
|
-
|
19
|
+
let _validateIndex = function(idx, limit) {
|
20
20
|
if(idx > limit) {
|
21
21
|
return limit;
|
22
22
|
} else if(idx < 0) {
|
@@ -30,8 +30,8 @@ var _validateIndex = function(idx, limit) {
|
|
30
30
|
* @param {Object=} options
|
31
31
|
* @extends {ElementWrapper}
|
32
32
|
*/
|
33
|
-
|
34
|
-
|
33
|
+
let VirtualizedLayoutGrid = function (options) {
|
34
|
+
let _t = this;
|
35
35
|
_t._onRestingPosition = _t._onRestingPosition.bind(_t);
|
36
36
|
_t._updateRowBounds = _t._updateRowBounds.bind(_t);
|
37
37
|
|
@@ -202,7 +202,7 @@ VirtualizedLayoutGrid.prototype.show = function (opt_shown) {
|
|
202
202
|
//#region ====== Implementing ILayoutGrid ======//
|
203
203
|
/** @inheritDoc */
|
204
204
|
VirtualizedLayoutGrid.prototype.hitTest = function (x, y) {
|
205
|
-
|
205
|
+
let e = [];
|
206
206
|
e["colIndex"] = this._grid.hitTestX(x);
|
207
207
|
e["rowIndex"] = this._layoutY.hitTest(y);
|
208
208
|
return e;
|
@@ -231,7 +231,7 @@ VirtualizedLayoutGrid.prototype.getDefaultRowHeight = function () {
|
|
231
231
|
};
|
232
232
|
/** @inheritDoc */
|
233
233
|
VirtualizedLayoutGrid.prototype.setDefaultRowHeight = function (val) {
|
234
|
-
|
234
|
+
let prevVal = this._layoutY.getDefaultLaneSize();
|
235
235
|
if (prevVal !== val) {
|
236
236
|
this._layoutY.setDefaultLaneSize(val);
|
237
237
|
this._element.style.height = this._layoutY.getTrackSize() + "px";
|
@@ -272,13 +272,13 @@ VirtualizedLayoutGrid.prototype._startBindingSession = function (enabled) {
|
|
272
272
|
if(!enabled){
|
273
273
|
// Clear old session
|
274
274
|
if(this._tempRowHeights){
|
275
|
-
|
276
|
-
|
277
|
-
|
275
|
+
let defaultRowHeight = this.getDefaultRowHeight();
|
276
|
+
let hasSession = true;
|
277
|
+
let removedIndices = [];
|
278
278
|
|
279
|
-
for(
|
280
|
-
|
281
|
-
|
279
|
+
for(let key in this._tempRowHeights){
|
280
|
+
let index = +key;
|
281
|
+
let rowSession = this._layoutY.getLaneProperty(index, "sizeSession");
|
282
282
|
if(rowSession) {
|
283
283
|
if(rowSession != this._session){
|
284
284
|
this.setRowHeight(index, defaultRowHeight);
|
@@ -287,12 +287,12 @@ VirtualizedLayoutGrid.prototype._startBindingSession = function (enabled) {
|
|
287
287
|
}
|
288
288
|
}
|
289
289
|
}
|
290
|
-
|
291
|
-
for(
|
290
|
+
let removedCount = removedIndices.length;
|
291
|
+
for(let i = 0; i < removedCount; i++){
|
292
292
|
delete this._tempRowHeights[removedIndices[i]];
|
293
293
|
}
|
294
294
|
if(removedCount){
|
295
|
-
for(
|
295
|
+
for(let remainingKey in this._tempRowHeights){
|
296
296
|
hasSession = remainingKey != null;
|
297
297
|
break;
|
298
298
|
}
|
@@ -475,7 +475,7 @@ VirtualizedLayoutGrid.prototype.getRowCount = function () {
|
|
475
475
|
};
|
476
476
|
/** @inheritDoc */
|
477
477
|
VirtualizedLayoutGrid.prototype.setRowCount = function (val, noBinding) {
|
478
|
-
|
478
|
+
let prevCount = this._layoutY.getLaneCount();
|
479
479
|
if(prevCount !== val){
|
480
480
|
this._layoutY.setLaneCount(val);
|
481
481
|
if(this._tempRowHeights){
|
@@ -504,7 +504,7 @@ VirtualizedLayoutGrid.prototype.addRow = function (val) {
|
|
504
504
|
/** @inheritDoc */
|
505
505
|
VirtualizedLayoutGrid.prototype.removeRow = function (val) {
|
506
506
|
if (val <= 0) { return; }
|
507
|
-
|
507
|
+
let rowCount = this._layoutY.getLaneCount();
|
508
508
|
if (val > rowCount) { val = rowCount; }
|
509
509
|
this.setRowCount(rowCount - val);
|
510
510
|
};
|
@@ -579,7 +579,7 @@ VirtualizedLayoutGrid.prototype.enableRowHighlighting = function (opt_bool) {
|
|
579
579
|
|
580
580
|
/** @inheritDoc */
|
581
581
|
VirtualizedLayoutGrid.prototype.getRowHighlight = function () {
|
582
|
-
|
582
|
+
let index = this._grid.getRowHighlight();
|
583
583
|
if(index >= 0){
|
584
584
|
index += this._firstIndex;
|
585
585
|
}
|
@@ -588,7 +588,7 @@ VirtualizedLayoutGrid.prototype.getRowHighlight = function () {
|
|
588
588
|
|
589
589
|
/** @inheritDoc */
|
590
590
|
VirtualizedLayoutGrid.prototype.setRowHighlight = function (rowIndex) {
|
591
|
-
|
591
|
+
let prevIndex = this._grid.getRowHighlight();
|
592
592
|
if (prevIndex >= 0) { prevIndex += this._firstIndex; }
|
593
593
|
this._grid.setRowHighlight(rowIndex - this._firstIndex);
|
594
594
|
//Check row highligh is in view
|
@@ -596,7 +596,7 @@ VirtualizedLayoutGrid.prototype.setRowHighlight = function (rowIndex) {
|
|
596
596
|
if (rowIndex >= 0) { rowIndex += this._firstIndex; }
|
597
597
|
|
598
598
|
if (this._hasListener("rowHighlighted")) {
|
599
|
-
|
599
|
+
let e = {};
|
600
600
|
e["prevRowIndex"] = prevIndex;
|
601
601
|
e["rowIndex"] = rowIndex;
|
602
602
|
this._dispatch("rowHighlighted", e);
|
@@ -624,7 +624,7 @@ VirtualizedLayoutGrid.prototype.isSelectedRow = function (at) {
|
|
624
624
|
VirtualizedLayoutGrid.prototype.setSelectedRow = function (rowIndex, opt_selected) {
|
625
625
|
this._selectionList.setSelection(rowIndex, opt_selected);
|
626
626
|
|
627
|
-
|
627
|
+
let selected = this._selectionList.getSelection(rowIndex);
|
628
628
|
this._grid.setSelectedRow(rowIndex - this._firstIndex, selected);
|
629
629
|
|
630
630
|
if(selected) {
|
@@ -650,7 +650,7 @@ VirtualizedLayoutGrid.prototype.selectRowRange = function (rowIndex, length) {
|
|
650
650
|
};
|
651
651
|
/** @inheritDoc */
|
652
652
|
VirtualizedLayoutGrid.prototype.clearSelectedRows = function () {
|
653
|
-
|
653
|
+
let count = this._selectionList.clearAllSelections();
|
654
654
|
this._grid.clearSelectedRows();
|
655
655
|
this._requestUpdatingRowBounds(); // WARNING: Row bounds are not removed from the document immediately
|
656
656
|
return count;
|
@@ -678,7 +678,7 @@ VirtualizedLayoutGrid.prototype.activateColumn = function (colIndex, opt_bool) {
|
|
678
678
|
};
|
679
679
|
/** @inheritDoc */
|
680
680
|
VirtualizedLayoutGrid.prototype.activateRows = function (from, to, updateRange) {
|
681
|
-
|
681
|
+
let maxLen = this._layoutY.getLaneCount();
|
682
682
|
if(!from) { from = this._rowOffset; }
|
683
683
|
if(!to && to !== 0) { to = from + maxLen; }
|
684
684
|
|
@@ -687,15 +687,15 @@ VirtualizedLayoutGrid.prototype.activateRows = function (from, to, updateRange)
|
|
687
687
|
to -= this._rowOffset; // Convert to relative index
|
688
688
|
if(to < 0) { to = 0; }
|
689
689
|
|
690
|
-
|
691
|
-
|
692
|
-
|
690
|
+
let prevLen = this._getInnerRowCount();
|
691
|
+
let pfi = this._firstIndex;
|
692
|
+
let fi = 0;
|
693
693
|
|
694
694
|
fi = from - (from & 1); // This is done to maintain zebra background color.
|
695
695
|
if (fi < 0) { fi = 0; }
|
696
696
|
else if (fi > maxLen) { fi = maxLen; }
|
697
697
|
|
698
|
-
|
698
|
+
let newLen = (to + (to & 1)) - fi;
|
699
699
|
if(newLen + 2 === prevLen) { // To remove unnecessary shrinking during scrolling
|
700
700
|
newLen = prevLen;
|
701
701
|
}
|
@@ -704,23 +704,23 @@ VirtualizedLayoutGrid.prototype.activateRows = function (from, to, updateRange)
|
|
704
704
|
else if(newLen + fi > maxLen) { newLen = maxLen - fi; }
|
705
705
|
|
706
706
|
this._firstIndex = fi;
|
707
|
-
|
707
|
+
let ei = fi + newLen;
|
708
708
|
|
709
709
|
// Re-position inner grid
|
710
|
-
|
711
|
-
|
710
|
+
let px = this._layoutY.getLaneStart(fi);
|
711
|
+
let gridElem = this._grid.getElement(); // GRID-347 Chrome 86 does not recognize top property of grand children
|
712
712
|
if(gridElem) {
|
713
713
|
gridElem.style.transform = px ? "translateY(" + px + "px)" : ""; // Replacement for this._grid.setTop(px);
|
714
714
|
gridElem.style.top = "";
|
715
715
|
this._reverter.start();
|
716
716
|
}
|
717
717
|
this._grid._onEnterDocument();
|
718
|
-
|
718
|
+
let force = false; // Forcing flag to update entire range
|
719
719
|
|
720
720
|
if (newLen !== prevLen) {
|
721
721
|
this._grid.setRowCount(newLen);
|
722
722
|
if(newLen > prevLen) { // New row is available. Fire event to render the cells.
|
723
|
-
|
723
|
+
let e = {};
|
724
724
|
e["prevRowIndex"] = fi + prevLen;
|
725
725
|
e["rowIndex"] = fi + newLen;
|
726
726
|
if(updateRange) {
|
@@ -734,7 +734,7 @@ VirtualizedLayoutGrid.prototype.activateRows = function (from, to, updateRange)
|
|
734
734
|
if(!force) {
|
735
735
|
// TODO: Check where to clearSelectedRows() more properly
|
736
736
|
this._grid.clearSelectedRows(); // Because row will be moving up and down, we need to clear the selection first
|
737
|
-
|
737
|
+
let pei = pfi + prevLen;
|
738
738
|
if(fi < pfi && pfi < ei && pei >= ei) {
|
739
739
|
this.moveRowsToTop(ei - pfi);
|
740
740
|
updateRange[0] = fi;
|
@@ -775,10 +775,10 @@ VirtualizedLayoutGrid.prototype.getFirstIndexInView = function () {
|
|
775
775
|
|
776
776
|
/** @inheritDoc */
|
777
777
|
VirtualizedLayoutGrid.prototype.getLastIndexInView = function () {
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
778
|
+
let li = this._firstIndex + this._getInnerRowCount() - 1;
|
779
|
+
let core = this._grid._getContext();
|
780
|
+
let dv = core.getDataSource();
|
781
|
+
let actualLastIndex = dv ? dv.getRowCount() - 1 : -1;
|
782
782
|
if (li > actualLastIndex) { //Avoid incorrect index because the delay of row count synchronization after filtering
|
783
783
|
return actualLastIndex;
|
784
784
|
}
|
@@ -833,7 +833,7 @@ VirtualizedLayoutGrid.prototype.getColumnIndex = function (colElem) {
|
|
833
833
|
};
|
834
834
|
/** @inheritDoc */
|
835
835
|
VirtualizedLayoutGrid.prototype.getCellIndex = function (colIndex, cellElem) {
|
836
|
-
|
836
|
+
let at = this._grid.getCellIndex(colIndex, cellElem);
|
837
837
|
if(at < 0) {
|
838
838
|
return -1;
|
839
839
|
}
|
@@ -869,7 +869,7 @@ VirtualizedLayoutGrid.prototype.updateLayout = function () {
|
|
869
869
|
/** {@link ILayoutGrid#stretchCell}
|
870
870
|
* @inheritDoc */
|
871
871
|
VirtualizedLayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching, onlyToTheRight) {
|
872
|
-
|
872
|
+
let stretchedCell = this._grid.stretchCell(
|
873
873
|
cellRef,
|
874
874
|
(rowIndex != null) ? rowIndex - this._firstIndex : null,
|
875
875
|
opt_stretching,
|
@@ -877,7 +877,7 @@ VirtualizedLayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_s
|
|
877
877
|
);
|
878
878
|
|
879
879
|
if (stretchedCell){
|
880
|
-
|
880
|
+
let cellElem = stretchedCell.getElement();
|
881
881
|
if(rowIndex === 0) {
|
882
882
|
cellElem.classList.add("top");
|
883
883
|
} else {
|
@@ -1008,7 +1008,7 @@ VirtualizedLayoutGrid.prototype.selectCell = function (colIndex, rowIndex, selec
|
|
1008
1008
|
* @param {number} height
|
1009
1009
|
*/
|
1010
1010
|
VirtualizedLayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, width, height) {
|
1011
|
-
|
1011
|
+
let cellBound = this._cellBound;
|
1012
1012
|
if(!cellBound) {
|
1013
1013
|
cellBound = this._cellBound = document.createElement("div");
|
1014
1014
|
cellBound.className = "selection-bound";
|
@@ -1016,11 +1016,11 @@ VirtualizedLayoutGrid.prototype.setCellBounds = function (colIndex, rowIndex, wi
|
|
1016
1016
|
this._initBoundLayer();
|
1017
1017
|
|
1018
1018
|
// Validate inputs
|
1019
|
-
|
1020
|
-
|
1019
|
+
let rgtIndex = colIndex + width; // Exclusive
|
1020
|
+
let btmIndex = rowIndex + height; // Exclusive
|
1021
1021
|
|
1022
|
-
|
1023
|
-
|
1022
|
+
let colCount = this.getColumnCount();
|
1023
|
+
let rowCount = this._layoutY.getLaneCount();
|
1024
1024
|
|
1025
1025
|
this._cbLftIdx = _validateIndex(colIndex, colCount);
|
1026
1026
|
this._cbRgtIdx = _validateIndex(rgtIndex, colCount);
|
@@ -1049,18 +1049,18 @@ VirtualizedLayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx
|
|
1049
1049
|
/** @private
|
1050
1050
|
*/
|
1051
1051
|
VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
1052
|
-
|
1052
|
+
let cellBound = this._cellBound;
|
1053
1053
|
if(!cellBound) {
|
1054
1054
|
return;
|
1055
1055
|
}
|
1056
1056
|
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1057
|
+
let layoutX = this.getHorizontalLayout();
|
1058
|
+
let layoutY = this._layoutY;
|
1059
|
+
let lftIdx = this._cbLftIdx;
|
1060
|
+
let rgtIdx = this._cbRgtIdx; // Exclusive
|
1061
|
+
let topIdx = this._cbTopIdx;
|
1062
|
+
let btmIdx = this._cbBtmIdx; // Exclusive
|
1063
|
+
let lftPx, rgtPx, topPx, btmPx;
|
1064
1064
|
lftPx = rgtPx = topPx = btmPx = 0;
|
1065
1065
|
if(lftIdx < rgtIdx && topIdx < btmIdx) {
|
1066
1066
|
lftPx = layoutX.getLaneStart(lftIdx);
|
@@ -1069,11 +1069,11 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
|
1069
1069
|
btmPx = layoutY.getLaneEnd(btmIdx - 1);
|
1070
1070
|
}
|
1071
1071
|
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1072
|
+
let width = rgtPx - lftPx;
|
1073
|
+
let height = btmPx - topPx;
|
1074
|
+
let noBorders = [false, false];
|
1075
1075
|
if(width > 0 && height > 0 && this._hscrollbar) {
|
1076
|
-
|
1076
|
+
let positions = [0, 0];
|
1077
1077
|
this.calculateColumnBounds(lftIdx, rgtIdx - 1, positions, noBorders);
|
1078
1078
|
lftPx = positions[0];
|
1079
1079
|
rgtPx = positions[1];
|
@@ -1093,7 +1093,7 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
|
1093
1093
|
this._boundLayer.appendChild(cellBound);
|
1094
1094
|
}
|
1095
1095
|
} else {
|
1096
|
-
|
1096
|
+
let pn = cellBound.parentNode;
|
1097
1097
|
if(pn) {
|
1098
1098
|
pn.removeChild(cellBound);
|
1099
1099
|
}
|
@@ -1118,7 +1118,7 @@ VirtualizedLayoutGrid.prototype.updateColumnSeparators = function () {
|
|
1118
1118
|
/** @private
|
1119
1119
|
*/
|
1120
1120
|
VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
|
1121
|
-
|
1121
|
+
let boundLayer = this._boundLayer;
|
1122
1122
|
if(!boundLayer) {
|
1123
1123
|
boundLayer = this._boundLayer = document.createElement("div");
|
1124
1124
|
boundLayer.className = "cover-layer";
|
@@ -1141,8 +1141,8 @@ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
|
|
1141
1141
|
if(!this._rowSelDirty) {
|
1142
1142
|
return;
|
1143
1143
|
}
|
1144
|
-
|
1145
|
-
|
1144
|
+
let rbs = this._rowBounds;
|
1145
|
+
let rbc = this._rowBoundCache;
|
1146
1146
|
if(!rbs) {
|
1147
1147
|
rbs = this._rowBounds = [];
|
1148
1148
|
}
|
@@ -1150,18 +1150,18 @@ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
|
|
1150
1150
|
rbc = this._rowBoundCache = [];
|
1151
1151
|
}
|
1152
1152
|
|
1153
|
-
|
1154
|
-
|
1153
|
+
let selList = this._selectionList;
|
1154
|
+
let rowCount = this._layoutY.getLaneCount();
|
1155
1155
|
selList.deselectFrom(rowCount); // TODO: move this to setRowCount
|
1156
1156
|
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1157
|
+
let selRanges = selList.getConnectedRanges();
|
1158
|
+
let rangeCount = selRanges.length;
|
1159
|
+
let i;
|
1160
|
+
let pn = null; // parentNode
|
1161
|
+
let rowBound = null;
|
1162
1162
|
|
1163
1163
|
// Remove unused bounds from document
|
1164
|
-
|
1164
|
+
let activeCount = rbs.length;
|
1165
1165
|
for(i = rangeCount; i < activeCount; ++i) {
|
1166
1166
|
rowBound = rbs[i];
|
1167
1167
|
pn = rowBound.parentNode;
|
@@ -1172,7 +1172,7 @@ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
|
|
1172
1172
|
rbs.length = activeCount = rangeCount;
|
1173
1173
|
|
1174
1174
|
if(!rangeCount) {
|
1175
|
-
|
1175
|
+
let selCount = selList.getSelectionCount();
|
1176
1176
|
if(!selCount) {
|
1177
1177
|
this._rowSelDirty = false;
|
1178
1178
|
}
|
@@ -1180,27 +1180,27 @@ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
|
|
1180
1180
|
}
|
1181
1181
|
|
1182
1182
|
// Prepare shared parameters
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1183
|
+
let scrollLeft = 0;
|
1184
|
+
let pinnedLftCount = 0;
|
1185
|
+
let pinnedRgtCount = 0;
|
1186
|
+
let endOfScroll = false;
|
1187
1187
|
if(this._hscrollbar) {
|
1188
1188
|
scrollLeft = this._hscrollbar.getScrollLeft();
|
1189
1189
|
pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
|
1190
1190
|
pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
|
1191
1191
|
endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
|
1192
1192
|
}
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1193
|
+
let noLeftBound = !pinnedLftCount && scrollLeft > 0;
|
1194
|
+
let noRightBound = !pinnedRgtCount && !endOfScroll;
|
1195
|
+
let boundWidth = this._grid._getViewSize();
|
1196
1196
|
|
1197
1197
|
// Create row bound elements based on number of selection ranges
|
1198
1198
|
for(i = 0; i < rangeCount; ++i) {
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1199
|
+
let pair = selRanges[i];
|
1200
|
+
let topIdx = pair[0];
|
1201
|
+
let btmIdx = pair[1]; // Inclusive
|
1202
|
+
let topPx = this._layoutY.getLaneStart(topIdx);
|
1203
|
+
let btmPx = this._layoutY.getLaneEnd(btmIdx);
|
1204
1204
|
|
1205
1205
|
rowBound = rbc[i];
|
1206
1206
|
if(!rowBound) {
|
@@ -1236,13 +1236,13 @@ VirtualizedLayoutGrid.prototype._getInnerRowCount = function () {
|
|
1236
1236
|
/** @private */
|
1237
1237
|
VirtualizedLayoutGrid.prototype._updateRowSelection = function () {
|
1238
1238
|
this._grid.clearSelectedRows();
|
1239
|
-
|
1240
|
-
|
1239
|
+
let sl = this._selectionList;
|
1240
|
+
let count = sl.getSelectionCount();
|
1241
1241
|
if(count <= 0) { return; }
|
1242
1242
|
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1243
|
+
let r;
|
1244
|
+
let fi = this._firstIndex;
|
1245
|
+
let ei = fi + this._getInnerRowCount();
|
1246
1246
|
if(count === 1) {
|
1247
1247
|
r = sl.getFirstSelectedIndex();
|
1248
1248
|
if (fi <= r && r < ei) {
|
@@ -1256,8 +1256,8 @@ VirtualizedLayoutGrid.prototype._updateRowSelection = function () {
|
|
1256
1256
|
}
|
1257
1257
|
}
|
1258
1258
|
} else {
|
1259
|
-
|
1260
|
-
for(
|
1259
|
+
let selections = sl.getAllSelections();
|
1260
|
+
for(let i = 0; i < count; ++i){
|
1261
1261
|
r = selections[i];
|
1262
1262
|
if (fi <= r && r < ei) {
|
1263
1263
|
this._grid.setSelectedRow(r - fi, true);
|
@@ -1275,7 +1275,7 @@ VirtualizedLayoutGrid.prototype._updateRowSelection = function () {
|
|
1275
1275
|
VirtualizedLayoutGrid.prototype._dispatchRowHeightChangedEvent = function (from, to) {
|
1276
1276
|
if (from >= to) { return false; }
|
1277
1277
|
|
1278
|
-
|
1278
|
+
let e = {};
|
1279
1279
|
e["rowIndex"] = from;
|
1280
1280
|
e["changeLength"] = to - from;
|
1281
1281
|
this._dispatch("rowHeightChanged", e);
|
@@ -1284,9 +1284,9 @@ VirtualizedLayoutGrid.prototype._dispatchRowHeightChangedEvent = function (from,
|
|
1284
1284
|
/** @private
|
1285
1285
|
*/
|
1286
1286
|
VirtualizedLayoutGrid.prototype._onRestingPosition = function () {
|
1287
|
-
|
1287
|
+
let gridElem = this._grid.getElement();
|
1288
1288
|
if(gridElem) {
|
1289
|
-
|
1289
|
+
let px = this._layoutY.getLaneStart(this._firstIndex);
|
1290
1290
|
gridElem.style.transform = "";
|
1291
1291
|
gridElem.style.top = px ? px + "px" : ""; // WORKAROUND: GRID-402
|
1292
1292
|
}
|
@@ -12,7 +12,7 @@ import CellFloatingPanel from "../components/CellFloatingPanel.js";
|
|
12
12
|
* @param {Element=} opt_element
|
13
13
|
* @param {ILayoutGrid=} opt_section Parent section
|
14
14
|
*/
|
15
|
-
|
15
|
+
let Cell = function (opt_element, opt_section) {
|
16
16
|
this._id = Cell._runningId++;
|
17
17
|
this._element = document.createElement("div");
|
18
18
|
this._element.className = "cell";
|
@@ -106,14 +106,14 @@ Cell.prototype.setContent = function (content, opt_tooltip) {
|
|
106
106
|
}
|
107
107
|
|
108
108
|
if(this._aligner) {// Hack: Someone has changed the content without notice
|
109
|
-
|
109
|
+
let fc = this._aligner.firstChild;
|
110
110
|
if(fc !== this._content) {
|
111
111
|
this._rawContent = fc;
|
112
112
|
this._content = /** @type{Element} */(fc);
|
113
113
|
}
|
114
114
|
}
|
115
115
|
|
116
|
-
|
116
|
+
let ret = this._setRawContent(content);
|
117
117
|
|
118
118
|
if (opt_tooltip != null && this._content) { // Apply tooltip after the real content has been populated
|
119
119
|
this._content.setAttribute("title", opt_tooltip);
|
@@ -178,14 +178,14 @@ Cell.prototype.getParent = function () {
|
|
178
178
|
* @override
|
179
179
|
*/
|
180
180
|
Cell.prototype.setParent = function (obj, opt_prepend) {
|
181
|
-
|
181
|
+
let parent = Util.getElement(obj);
|
182
182
|
if (parent) {
|
183
183
|
this.initialize();
|
184
184
|
if(this._collapsedState === 1) {
|
185
185
|
return; // Cell is being collapsed and not in the document
|
186
186
|
}
|
187
187
|
|
188
|
-
|
188
|
+
let sibling;
|
189
189
|
if (opt_prepend === true) {
|
190
190
|
sibling = parent.firstChild;
|
191
191
|
}
|
@@ -202,7 +202,7 @@ Cell.prototype.setParent = function (obj, opt_prepend) {
|
|
202
202
|
* @ignore
|
203
203
|
*/
|
204
204
|
Cell.prototype.removeParent = function () {
|
205
|
-
|
205
|
+
let el = this._element;
|
206
206
|
if (el && el.parentNode) {
|
207
207
|
el.parentNode.removeChild(el);
|
208
208
|
}
|
@@ -211,13 +211,13 @@ Cell.prototype.removeParent = function () {
|
|
211
211
|
* @override
|
212
212
|
*/
|
213
213
|
Cell.prototype.insertBefore = function (nextSibling) {
|
214
|
-
|
214
|
+
let nextNode = Util.getElement(nextSibling);
|
215
215
|
if (nextNode == null) {
|
216
216
|
this.setParent(this.getParent());
|
217
217
|
return;
|
218
218
|
}
|
219
219
|
|
220
|
-
|
220
|
+
let parent = nextNode.parentNode;
|
221
221
|
if (parent == null) { return; }
|
222
222
|
|
223
223
|
this.initialize();
|
@@ -302,7 +302,7 @@ Cell.prototype.fillParentHeight = function (percent) { return false; };
|
|
302
302
|
* @override
|
303
303
|
*/
|
304
304
|
Cell.prototype.show = function (opt_shown) {
|
305
|
-
|
305
|
+
let shown = opt_shown !== false;
|
306
306
|
if(shown !== this._visible) {
|
307
307
|
this._visible = shown;
|
308
308
|
this._updateDisplay();
|
@@ -377,7 +377,7 @@ Cell.prototype.updateIcon = function(icon) {
|
|
377
377
|
return;
|
378
378
|
}
|
379
379
|
|
380
|
-
|
380
|
+
let fi = this._frontIcon;
|
381
381
|
if (fi) {
|
382
382
|
if(fi.containItem(icon)) { // Check same icon which duplicate with insertItem in _frontIcon
|
383
383
|
return;
|
@@ -389,7 +389,7 @@ Cell.prototype.updateIcon = function(icon) {
|
|
389
389
|
/** @public
|
390
390
|
*/
|
391
391
|
Cell.prototype.removeIcon = function() {
|
392
|
-
|
392
|
+
let fi = this._frontIcon;
|
393
393
|
if (fi) {
|
394
394
|
fi.clearItems();
|
395
395
|
this._element.removeChild(fi.getElement());
|
@@ -438,8 +438,8 @@ Cell.prototype.lockContent = function (opt_locked) {
|
|
438
438
|
Cell.prototype.reset = function() {
|
439
439
|
if(!this._element) { return; }
|
440
440
|
|
441
|
-
|
442
|
-
|
441
|
+
let width = this._element.style.width;
|
442
|
+
let height = this._element.style.height;
|
443
443
|
this.removeAttribute("style");
|
444
444
|
if(width) {
|
445
445
|
this._element.style.width = width;
|
@@ -450,7 +450,7 @@ Cell.prototype.reset = function() {
|
|
450
450
|
this.resetClass();
|
451
451
|
|
452
452
|
// HACK!!
|
453
|
-
|
453
|
+
let blinkState = this["blinkState"];
|
454
454
|
if(blinkState) {
|
455
455
|
if (blinkState.timerId >= 0) {
|
456
456
|
clearInterval(blinkState.timerId);
|
@@ -458,7 +458,7 @@ Cell.prototype.reset = function() {
|
|
458
458
|
delete this["blinkState"];
|
459
459
|
}
|
460
460
|
delete this["trendState"];
|
461
|
-
|
461
|
+
let scope = this["blinking"];
|
462
462
|
if(scope) {
|
463
463
|
if(scope["blinking"] >= 0) {
|
464
464
|
clearTimeout(scope["blinking"]);
|
@@ -481,7 +481,7 @@ Cell.prototype.reset = function() {
|
|
481
481
|
* @public
|
482
482
|
*/
|
483
483
|
Cell.prototype.resetClass = function() {
|
484
|
-
|
484
|
+
let className = "cell";
|
485
485
|
if(this.hasClass("spanned")) {
|
486
486
|
className += " spanned";
|
487
487
|
}
|
@@ -518,14 +518,14 @@ Cell.prototype.insertFloatingIcon = function (elem, opt_order) {
|
|
518
518
|
return;
|
519
519
|
}
|
520
520
|
|
521
|
-
|
521
|
+
let fp = this._floatingPanel;
|
522
522
|
if(!fp) {
|
523
523
|
fp = this._floatingPanel = new CellFloatingPanel();
|
524
524
|
}
|
525
525
|
fp.insertItem(elem, opt_order);
|
526
526
|
fp.addClass("floating-panel");
|
527
527
|
|
528
|
-
|
528
|
+
let element = this._element;
|
529
529
|
if (!element.contains(fp.getElement())) {
|
530
530
|
element.appendChild(fp.getElement());
|
531
531
|
}
|
@@ -535,12 +535,12 @@ Cell.prototype.insertFloatingIcon = function (elem, opt_order) {
|
|
535
535
|
* @return {Element|null} removed element
|
536
536
|
*/
|
537
537
|
Cell.prototype.removeFloatingIcon = function (elemRef) {
|
538
|
-
|
538
|
+
let fp = this._floatingPanel;
|
539
539
|
if (!fp) {
|
540
540
|
return null;
|
541
541
|
}
|
542
542
|
|
543
|
-
|
543
|
+
let removeElem = fp.removeItem(elemRef);
|
544
544
|
if (!fp.hasItem()) {
|
545
545
|
this._element.removeChild(fp.getElement());
|
546
546
|
this._floatingPanel = null;
|
@@ -557,14 +557,14 @@ Cell.prototype.insertFrontIcon = function (elem, opt_order) {
|
|
557
557
|
return;
|
558
558
|
}
|
559
559
|
|
560
|
-
|
560
|
+
let fi = this._frontIcon;
|
561
561
|
if(!fi) {
|
562
562
|
fi = this._frontIcon = new CellFloatingPanel();
|
563
563
|
}
|
564
564
|
fi.insertItem(elem, opt_order);
|
565
565
|
fi.addClass("front-panel");
|
566
566
|
|
567
|
-
|
567
|
+
let element = this._element;
|
568
568
|
if (!element.contains(fi.getElement())) {
|
569
569
|
element.insertBefore(fi.getElement(), element.firstChild);
|
570
570
|
}
|
@@ -574,12 +574,12 @@ Cell.prototype.insertFrontIcon = function (elem, opt_order) {
|
|
574
574
|
* @return {Element|null} removed element
|
575
575
|
*/
|
576
576
|
Cell.prototype.removeFrontIcon = function (elemRef) {
|
577
|
-
|
577
|
+
let fi = this._frontIcon;
|
578
578
|
if (!fi) {
|
579
579
|
return null;
|
580
580
|
}
|
581
581
|
|
582
|
-
|
582
|
+
let removeElem = fi.removeItem(elemRef);
|
583
583
|
if (!fi.hasItem()) {
|
584
584
|
removeElem = fi.getElement();
|
585
585
|
this._element.removeChild(removeElem);
|
@@ -612,9 +612,9 @@ Cell.prototype.updatePadding = function() {
|
|
612
612
|
* @return {boolean}
|
613
613
|
*/
|
614
614
|
Cell.prototype.collapse = function (opt_collapsed, opt_remainedInDoc) {
|
615
|
-
|
615
|
+
let collapsed = opt_collapsed !== false;
|
616
616
|
(opt_remainedInDoc ? 2 : 1);
|
617
|
-
|
617
|
+
let collapsedState;
|
618
618
|
if (collapsed) {
|
619
619
|
collapsedState = (opt_remainedInDoc ? 2 : 1);
|
620
620
|
} else {
|
@@ -678,7 +678,7 @@ Cell.prototype._setRawContent = function (value) {
|
|
678
678
|
if (this._rawContent !== value) {
|
679
679
|
this._rawContent = value;
|
680
680
|
|
681
|
-
|
681
|
+
let actualContent = /** @type{Element|NodeList} */(this._rawContent);
|
682
682
|
if (typeof this._rawContent == "string") {
|
683
683
|
if (!this._textSpan) {
|
684
684
|
this._textSpan = document.createElement("span");
|
@@ -693,7 +693,7 @@ Cell.prototype._setRawContent = function (value) {
|
|
693
693
|
|
694
694
|
this.initialize();
|
695
695
|
|
696
|
-
|
696
|
+
let aligner = this._aligner;
|
697
697
|
while (aligner.lastChild ) {
|
698
698
|
aligner.removeChild(aligner.lastChild);
|
699
699
|
}
|
@@ -709,7 +709,7 @@ Cell.prototype._setRawContent = function (value) {
|
|
709
709
|
/** @private
|
710
710
|
*/
|
711
711
|
Cell.prototype._updateDisplay = function () {
|
712
|
-
|
712
|
+
let visibility = false;
|
713
713
|
if(this.isVisible()) {
|
714
714
|
if(this._width && this._height) {
|
715
715
|
visibility = true;
|