@refinitiv-ui/efx-grid 6.0.91 → 6.0.93
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/filter-dialog/lib/filter-dialog.js +1 -0
- 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-checkbox/es6/Checkbox.js +268 -268
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -2
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +60 -32
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +279 -279
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +227 -207
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +11 -11
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -2
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +120 -121
- package/lib/tr-grid-util/es6/CellPainter.js +94 -104
- 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 +41 -41
- package/lib/tr-grid-util/es6/Deferred.js +5 -5
- package/lib/tr-grid-util/es6/Delay.d.ts +3 -3
- package/lib/tr-grid-util/es6/Delay.js +14 -3
- 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 -58
- 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 -87
- 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 +71 -80
- package/lib/tr-grid-util/es6/NumberFormatter.js +23 -23
- 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 +52 -52
- 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/types/es6/RowDragging.d.ts +1 -2
- package/lib/versions.json +12 -12
- 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
@@ -6,7 +6,7 @@ import ElementWrapper from "./ElementWrapper.js";
|
|
6
6
|
/** @constructor
|
7
7
|
* @extends {ElementWrapper}
|
8
8
|
*/
|
9
|
-
|
9
|
+
let CellFloatingPanel = function () {
|
10
10
|
this._items = [];
|
11
11
|
this._element = null;
|
12
12
|
};
|
@@ -35,7 +35,7 @@ CellFloatingPanel.prototype.containItem = function (icon) {
|
|
35
35
|
* @param {number=} opt_order The greater the order, the farther the position to the right
|
36
36
|
*/
|
37
37
|
CellFloatingPanel.prototype.insertItem = function (item, opt_order) {
|
38
|
-
|
38
|
+
let items = this._items;
|
39
39
|
if(items.indexOf(item) > -1) {
|
40
40
|
return; // There is no need to insert the same icon
|
41
41
|
}
|
@@ -55,13 +55,13 @@ CellFloatingPanel.prototype.insertItem = function (item, opt_order) {
|
|
55
55
|
* @return {Element|null} removed element
|
56
56
|
*/
|
57
57
|
CellFloatingPanel.prototype.removeItem = function (elemRef) {
|
58
|
-
|
59
|
-
|
58
|
+
let items = this._items;
|
59
|
+
let targetIndex = -1;
|
60
60
|
if (!elemRef) {
|
61
61
|
targetIndex = items.length - 1;
|
62
62
|
} else {
|
63
|
-
for(
|
64
|
-
|
63
|
+
for(let i = items.length; --i >= 0;) {
|
64
|
+
let ch = items[i];
|
65
65
|
if (typeof elemRef === "string") {
|
66
66
|
if(ch.classList.contains(elemRef)) {
|
67
67
|
targetIndex = i;
|
@@ -75,7 +75,7 @@ CellFloatingPanel.prototype.removeItem = function (elemRef) {
|
|
75
75
|
}
|
76
76
|
}
|
77
77
|
}
|
78
|
-
|
78
|
+
let removedItem = null;
|
79
79
|
if (targetIndex > -1) {
|
80
80
|
removedItem = items.splice(targetIndex, 1)[0];
|
81
81
|
}
|
@@ -85,7 +85,7 @@ CellFloatingPanel.prototype.removeItem = function (elemRef) {
|
|
85
85
|
/** @public
|
86
86
|
*/
|
87
87
|
CellFloatingPanel.prototype.clearItems = function () {
|
88
|
-
|
88
|
+
let items = this._items;
|
89
89
|
if (!items.length) {
|
90
90
|
return;
|
91
91
|
}
|
@@ -110,8 +110,8 @@ CellFloatingPanel._iconComparer = function(elemA, elemB) {
|
|
110
110
|
/** @private
|
111
111
|
*/
|
112
112
|
CellFloatingPanel.prototype._updatePanelItems = function() {
|
113
|
-
|
114
|
-
|
113
|
+
let items = this._items;
|
114
|
+
let elem = this._element;
|
115
115
|
if (!items.length) {
|
116
116
|
return;
|
117
117
|
}
|
@@ -121,7 +121,7 @@ CellFloatingPanel.prototype._updatePanelItems = function() {
|
|
121
121
|
while (elem.lastChild) {
|
122
122
|
elem.removeChild(elem.lastChild);
|
123
123
|
}
|
124
|
-
for (
|
124
|
+
for (let i = 0; i < items.length; i++) {
|
125
125
|
elem.appendChild(items[i]);
|
126
126
|
}
|
127
127
|
};
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* @param {number} x
|
4
4
|
* @param {number} y
|
5
5
|
*/
|
6
|
-
|
6
|
+
let CellSpan = function (x, y) {
|
7
7
|
this.indexX = x;
|
8
8
|
this.indexY = y;
|
9
9
|
};
|
@@ -45,7 +45,7 @@ CellSpan.prototype.unregister = function (allSpans, occupiedMap) {
|
|
45
45
|
* @param {boolean} bool
|
46
46
|
*/
|
47
47
|
CellSpan.prototype._register = function (allSpans, occupiedMap, bool) {
|
48
|
-
|
48
|
+
let at = allSpans.indexOf(this);
|
49
49
|
if(bool) {
|
50
50
|
if(at < 0) {
|
51
51
|
allSpans.push(this);
|
@@ -56,11 +56,11 @@ CellSpan.prototype._register = function (allSpans, occupiedMap, bool) {
|
|
56
56
|
}
|
57
57
|
}
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
for (
|
63
|
-
for (
|
59
|
+
let obj = bool ? this : null;
|
60
|
+
let endCol = this.indexX + this.colSpan;
|
61
|
+
let endRow = this.indexY + this.rowSpan;
|
62
|
+
for (let c = this.indexX; c < endCol; ++c) {
|
63
|
+
for (let r = this.indexY; r < endRow; ++r) {
|
64
64
|
occupiedMap[c + "," + r] = obj;
|
65
65
|
}
|
66
66
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import CellSpan from "./CellSpan.js";
|
2
2
|
|
3
3
|
/** @constructor */
|
4
|
-
|
4
|
+
let CellSpans = function () {
|
5
5
|
this._spans = [];
|
6
6
|
this._occupiedMap = {};
|
7
7
|
};
|
@@ -11,7 +11,7 @@ var CellSpans = function () {
|
|
11
11
|
* @return {boolean} Return true if there is any change
|
12
12
|
*/
|
13
13
|
CellSpans.prototype.removeColumn = function (at) { // Use when a column is removed
|
14
|
-
|
14
|
+
let dirty = false;
|
15
15
|
if(this.removeSpanByColIndex(at)) {
|
16
16
|
dirty = true;
|
17
17
|
}
|
@@ -34,10 +34,10 @@ CellSpans.prototype.freezeMapping = function (bool) {
|
|
34
34
|
/** @private
|
35
35
|
*/
|
36
36
|
CellSpans.prototype._mapCellSpans = function () {
|
37
|
-
|
37
|
+
let cellSpans = this._spans;
|
38
38
|
this._spans = [];
|
39
39
|
this._occupiedMap = {};
|
40
|
-
|
40
|
+
let i, cellSpan;
|
41
41
|
for(i = cellSpans.length; --i >= 0;) {
|
42
42
|
cellSpan = cellSpans[i];
|
43
43
|
if(cellSpan.indexX >= 0) {
|
@@ -55,9 +55,9 @@ CellSpans.prototype._mapCellSpans = function () {
|
|
55
55
|
CellSpans.prototype.shiftColumn = function (from, amount) { // Use when a column is inserted or removed
|
56
56
|
if(this._spans.length <= 0 || amount === 0) { return false; }
|
57
57
|
|
58
|
-
|
59
|
-
for (
|
60
|
-
|
58
|
+
let dirty = false;
|
59
|
+
for (let i = this._spans.length; --i >= 0;) {
|
60
|
+
let cellSpan = this._spans[i];
|
61
61
|
if(cellSpan.indexX >= from) {
|
62
62
|
dirty = true;
|
63
63
|
cellSpan.indexX += amount;
|
@@ -77,8 +77,8 @@ CellSpans.prototype.shiftColumn = function (from, amount) { // Use when a column
|
|
77
77
|
CellSpans.prototype.removeSpan = function (indexX, indexY) {
|
78
78
|
if(this._spans.length <= 0) { return null; }
|
79
79
|
|
80
|
-
|
81
|
-
|
80
|
+
let key = indexX + "," + indexY;
|
81
|
+
let cellSpan = this._occupiedMap[key];
|
82
82
|
if(!cellSpan || cellSpan.isOccupiedIndices(indexX, indexY)) { return null; }
|
83
83
|
|
84
84
|
cellSpan.unregister(this._spans, this._occupiedMap);
|
@@ -90,13 +90,14 @@ CellSpans.prototype.removeSpan = function (indexX, indexY) {
|
|
90
90
|
* @return {Array.<CellSpan>} Return null if no CellSpan is removed
|
91
91
|
*/
|
92
92
|
CellSpans.prototype.removeSpanByColIndex = function (at, opt_ary) {
|
93
|
-
|
93
|
+
let len = this._spans.length;
|
94
94
|
if(len <= 0) { return null; }
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
96
|
+
let cellSpan;
|
97
|
+
let removedCellSpans = opt_ary || [];
|
98
|
+
let count = 0;
|
99
|
+
let i;
|
100
|
+
for (i = 0; i < len; ++i) {
|
100
101
|
cellSpan = this._spans[i];
|
101
102
|
if(cellSpan && cellSpan.indexX === at) {
|
102
103
|
removedCellSpans.push(cellSpan);
|
@@ -117,13 +118,14 @@ CellSpans.prototype.removeSpanByColIndex = function (at, opt_ary) {
|
|
117
118
|
* @return {Array.<CellSpan>} Return null if no CellSpan is removed
|
118
119
|
*/
|
119
120
|
CellSpans.prototype.removeSpanStartedFromRowIndex = function (at, opt_ary) {
|
120
|
-
|
121
|
+
let len = this._spans.length;
|
121
122
|
if(len <= 0) { return null; }
|
122
123
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
124
|
+
let cellSpan;
|
125
|
+
let removedCellSpans = opt_ary || [];
|
126
|
+
let count = 0;
|
127
|
+
let i;
|
128
|
+
for (i = 0; i < len; ++i) {
|
127
129
|
cellSpan = this._spans[i];
|
128
130
|
if(cellSpan && cellSpan.indexY >= at) {
|
129
131
|
removedCellSpans.push(cellSpan);
|
@@ -145,7 +147,7 @@ CellSpans.prototype.removeSpanStartedFromRowIndex = function (at, opt_ary) {
|
|
145
147
|
CellSpans.prototype.clearAllSpans = function () {
|
146
148
|
if(this._spans.length <= 0) { return null; }
|
147
149
|
|
148
|
-
|
150
|
+
let allCellSpans = this._spans;
|
149
151
|
this._spans = [];
|
150
152
|
this._occupiedMap = {};
|
151
153
|
return allCellSpans;
|
@@ -163,7 +165,7 @@ CellSpans.prototype.hasSpan = function () {
|
|
163
165
|
* @return {CellSpan|null}
|
164
166
|
*/
|
165
167
|
CellSpans.prototype.getSpan = function (indexX, indexY) {
|
166
|
-
|
168
|
+
let cellSpan = this.getOccupyingSpan(indexX, indexY);
|
167
169
|
if(cellSpan && cellSpan.isSpanIndices(indexX, indexY)) {
|
168
170
|
return cellSpan;
|
169
171
|
}
|
@@ -195,7 +197,7 @@ CellSpans.prototype.getAllSpans = function () {
|
|
195
197
|
* @return {number}
|
196
198
|
*/
|
197
199
|
CellSpans.prototype.getColSpan = function (indexX, indexY) {
|
198
|
-
|
200
|
+
let cellSpan = this._occupiedMap[indexX + "," + indexY];
|
199
201
|
if(cellSpan == null) {
|
200
202
|
return 1;
|
201
203
|
}
|
@@ -214,7 +216,7 @@ CellSpans.prototype.getColSpan = function (indexX, indexY) {
|
|
214
216
|
* @return {number}
|
215
217
|
*/
|
216
218
|
CellSpans.prototype.getRowSpan = function (indexX, indexY) {
|
217
|
-
|
219
|
+
let cellSpan = this._occupiedMap[indexX + "," + indexY];
|
218
220
|
if(cellSpan == null) {
|
219
221
|
return 1;
|
220
222
|
}
|
@@ -252,15 +254,15 @@ CellSpans.prototype.setRowSpan = function (indexX, indexY, spanVal) {
|
|
252
254
|
*/
|
253
255
|
CellSpans.prototype._updateSpan = function (c0, r0, isColumn, spanVal) {
|
254
256
|
if (spanVal < 1) { spanVal = 1; }
|
255
|
-
|
257
|
+
let cellSpan = this.getSpan(c0, r0);
|
256
258
|
if(cellSpan) { cellSpan.retVal = 0; }
|
257
259
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
260
|
+
let c1 = c0;
|
261
|
+
let r1 = r0;
|
262
|
+
let cs = (cellSpan) ? cellSpan.colSpan : 1;
|
263
|
+
let rs = (cellSpan) ? cellSpan.rowSpan : 1;
|
264
|
+
let c2, r2, target, key;
|
265
|
+
let isExpanding = true;
|
264
266
|
if (isColumn) {
|
265
267
|
if (cs === spanVal) { return cellSpan; }
|
266
268
|
if (cs > spanVal) {
|
@@ -294,9 +296,9 @@ CellSpans.prototype._updateSpan = function (c0, r0, isColumn, spanVal) {
|
|
294
296
|
}
|
295
297
|
|
296
298
|
// Collecting affected cells
|
297
|
-
|
299
|
+
let c, r;
|
298
300
|
if (isExpanding) { // Check all affected cells for occupying
|
299
|
-
|
301
|
+
let keys = [];
|
300
302
|
for (c = c1; c < c2; ++c) {
|
301
303
|
for (r = r1; r < r2; ++r) {
|
302
304
|
key = c + "," + r;
|
@@ -318,10 +320,10 @@ CellSpans.prototype._updateSpan = function (c0, r0, isColumn, spanVal) {
|
|
318
320
|
this._occupiedMap[keys[c]] = cellSpan;
|
319
321
|
}
|
320
322
|
} else {
|
321
|
-
|
323
|
+
let noLongerSpan = (isColumn) ? (spanVal + rs <= 2) : (spanVal + cs <= 2);
|
322
324
|
if (noLongerSpan) {
|
323
325
|
key = c0 + "," + r0;
|
324
|
-
|
326
|
+
let at = this._spans.indexOf(cellSpan);
|
325
327
|
this._spans.splice(at, 1);
|
326
328
|
this._occupiedMap[key] = null;
|
327
329
|
}
|
@@ -11,8 +11,8 @@ import ILayoutGrid from "../ILayoutGrid.js";
|
|
11
11
|
* @extends {ElementWrapper}
|
12
12
|
* @param {ILayoutGrid} section Parent section
|
13
13
|
*/
|
14
|
-
|
15
|
-
|
14
|
+
let Column = function (section) {
|
15
|
+
let elem = this._element = document.createElement("div");
|
16
16
|
elem.className = "column";
|
17
17
|
this._cells = [];
|
18
18
|
this._section = section;
|
@@ -94,7 +94,7 @@ Column.prototype._pinned = true;
|
|
94
94
|
/** @public
|
95
95
|
*/
|
96
96
|
Column.prototype.clearContent = function() {
|
97
|
-
for(
|
97
|
+
for(let r = this._cells.length; --r >= 0;) {
|
98
98
|
this._cells[r].setContent(null);
|
99
99
|
}
|
100
100
|
};
|
@@ -129,7 +129,7 @@ Column.prototype.enableAbsolutePosition = function (bool) {
|
|
129
129
|
*/
|
130
130
|
Column.prototype.dispose = function () {
|
131
131
|
this._dispose();
|
132
|
-
for(
|
132
|
+
for(let r = this._cells.length; --r >= 0;) {
|
133
133
|
this._cells[r].dispose();
|
134
134
|
}
|
135
135
|
this._scrollFrame = this._nextSibling = this._parent = this._cells = this._section = null;
|
@@ -138,10 +138,10 @@ Column.prototype.dispose = function () {
|
|
138
138
|
* @override
|
139
139
|
*/
|
140
140
|
Column.prototype.setStyle = function (str, val) {
|
141
|
-
|
141
|
+
let elem = this._element;
|
142
142
|
elem.style[str] = val;
|
143
143
|
|
144
|
-
|
144
|
+
let bgc = elem.style.backgroundColor;
|
145
145
|
if(bgc) {
|
146
146
|
if(!elem.classList.contains("no-shading")) { elem.classList.add("no-shading"); }
|
147
147
|
} else {
|
@@ -152,13 +152,13 @@ Column.prototype.setStyle = function (str, val) {
|
|
152
152
|
* @override
|
153
153
|
*/
|
154
154
|
Column.prototype.setStyles = function (json) {
|
155
|
-
|
156
|
-
|
157
|
-
for (
|
155
|
+
let elem = this._element;
|
156
|
+
let styles = elem.style;
|
157
|
+
for (let key in json) {
|
158
158
|
styles[key] = json[key];
|
159
159
|
}
|
160
160
|
|
161
|
-
|
161
|
+
let bgc = elem.style.backgroundColor;
|
162
162
|
if(bgc) {
|
163
163
|
if(!elem.classList.contains("no-shading")) { elem.classList.add("no-shading"); }
|
164
164
|
} else {
|
@@ -178,7 +178,7 @@ Column.prototype.show = function (opt_shown) {
|
|
178
178
|
*/
|
179
179
|
Column.prototype.setWidth = function (val) {
|
180
180
|
this._element.style.width = val + "px";
|
181
|
-
|
181
|
+
let magnitude = 0;
|
182
182
|
if(val > 0 && val <= 24){
|
183
183
|
magnitude = 3;
|
184
184
|
}
|
@@ -189,8 +189,8 @@ Column.prototype.setWidth = function (val) {
|
|
189
189
|
magnitude = 1;
|
190
190
|
}
|
191
191
|
|
192
|
-
|
193
|
-
|
192
|
+
let i;
|
193
|
+
let sc = this._sizeClasses;
|
194
194
|
if(sc) {
|
195
195
|
if(sc.length > magnitude) {
|
196
196
|
for(i = sc.length; --i >= magnitude;) {
|
@@ -240,11 +240,11 @@ Column.prototype.getParent = function () {
|
|
240
240
|
* @override
|
241
241
|
*/
|
242
242
|
Column.prototype.setParent = function (parent, opt_prepend) {
|
243
|
-
|
243
|
+
let el = this._element;
|
244
244
|
if(!el) { return; }
|
245
245
|
|
246
246
|
this._parent = Util.getElement(parent);
|
247
|
-
|
247
|
+
let hidingMethod = this._section ? this._section.getHidingMethod() : "";
|
248
248
|
|
249
249
|
// hidden column with hidingMethod should appear in tree
|
250
250
|
// to prevent from unability of showing
|
@@ -345,7 +345,7 @@ Column.prototype.deactivate = function (opt_disabled) {
|
|
345
345
|
* @param {number} count
|
346
346
|
*/
|
347
347
|
Column.prototype.setCellCount = function (count) {
|
348
|
-
|
348
|
+
let r;
|
349
349
|
for(r = this._cells.length; r < count; ++r) {
|
350
350
|
this._cells.push(new Cell(null, this._section));
|
351
351
|
}
|
@@ -378,12 +378,12 @@ Column.prototype.getCell = function (rowIndex) {
|
|
378
378
|
Column.prototype.collapseCells = function (from, length, collapsed, excludeFirstCell, keptInDoc) {
|
379
379
|
if(length <= 0) { return; }
|
380
380
|
|
381
|
-
|
382
|
-
|
381
|
+
let dirty = false;
|
382
|
+
let cell = this._cells[from];
|
383
383
|
if(cell && !excludeFirstCell) { // If we need to process the first cell
|
384
384
|
dirty |= cell.collapse(collapsed, keptInDoc); // If we have multiple rows kept the cell in the doc for positioning
|
385
385
|
}
|
386
|
-
for(
|
386
|
+
for(let i = 1; i < length; ++i) {
|
387
387
|
cell = this._cells[from + i];
|
388
388
|
if(cell) {
|
389
389
|
dirty |= cell.collapse(collapsed, keptInDoc);
|
@@ -413,8 +413,8 @@ Column.prototype.uncollapseAllCells = Util._deprecatedFunction;
|
|
413
413
|
* @param {number} to
|
414
414
|
*/
|
415
415
|
Column.prototype.activateCells = function (from, to) {
|
416
|
-
|
417
|
-
|
416
|
+
let r;
|
417
|
+
let parent = this._element;
|
418
418
|
if(this._hasCollapsedCells) { // There is a vertical span and no row virtualization. We only need to appendChild incrementally
|
419
419
|
from = this._cellEnd;
|
420
420
|
if(to > this._cellEnd) {
|
@@ -422,7 +422,7 @@ Column.prototype.activateCells = function (from, to) {
|
|
422
422
|
}
|
423
423
|
} else {
|
424
424
|
if(this._cellStart === from) {
|
425
|
-
|
425
|
+
let diff = this._cellEnd - to;
|
426
426
|
if(diff > 0) {
|
427
427
|
for(r = this._cellEnd; --r >= to;) {
|
428
428
|
this._cells[r].removeParent();
|
@@ -445,7 +445,7 @@ Column.prototype.activateCells = function (from, to) {
|
|
445
445
|
}
|
446
446
|
|
447
447
|
for(r = from; r < to; ++r) {
|
448
|
-
|
448
|
+
let cell = this._cells[r];
|
449
449
|
if(cell.isKeptInDoc()) {
|
450
450
|
cell.initialize();
|
451
451
|
parent.appendChild(cell.getElement());
|
@@ -461,9 +461,9 @@ Column.prototype.moveCellsToTop = function (numCells) {
|
|
461
461
|
return; // There is no point in cycling cells when the column is inactive
|
462
462
|
}
|
463
463
|
|
464
|
-
|
465
|
-
for(
|
466
|
-
|
464
|
+
let parent = this._element;
|
465
|
+
for(let i = 0; i < numCells; ++i) {
|
466
|
+
let cell = this._cells[i];
|
467
467
|
if(cell.isKeptInDoc()) {
|
468
468
|
parent.appendChild(cell.getElement());
|
469
469
|
}
|
@@ -475,9 +475,9 @@ Column.prototype.moveCellsToTop = function (numCells) {
|
|
475
475
|
*/
|
476
476
|
Column.prototype.updateCellOrders = function () {
|
477
477
|
this._hasCollapsedCells = false;
|
478
|
-
|
479
|
-
for(
|
480
|
-
|
478
|
+
let parent = this._element;
|
479
|
+
for(let i = this._cellStart; i < this._cellEnd; ++i) {
|
480
|
+
let cell = this._cells[i];
|
481
481
|
if(cell.isKeptInDoc()) {
|
482
482
|
parent.appendChild(cell.getElement());
|
483
483
|
} else {
|
@@ -499,8 +499,8 @@ Column.prototype.hasCollapsedCells = function () {
|
|
499
499
|
*/
|
500
500
|
Column.prototype.getCellIndex = function (cellElem) {
|
501
501
|
if(!cellElem) { return -1; }
|
502
|
-
for(
|
503
|
-
|
502
|
+
for(let i = this._cellStart; i < this._cellEnd; ++i) {
|
503
|
+
let cell = this._cells[i];
|
504
504
|
if(cell.getElement() === cellElem) {
|
505
505
|
return i;
|
506
506
|
}
|
@@ -522,9 +522,9 @@ Column.prototype.getSection = function () {
|
|
522
522
|
* @return {Array.<string>}
|
523
523
|
*/
|
524
524
|
Column.prototype.log = function () {
|
525
|
-
|
526
|
-
|
527
|
-
for(
|
525
|
+
let ary = [];
|
526
|
+
let len = this._cells.length;
|
527
|
+
for(let i = 0; i < len; ++i) {
|
528
528
|
ary.push(this._cells[i].getTextContent());
|
529
529
|
}
|
530
530
|
return ary;
|
@@ -543,32 +543,32 @@ Column.prototype.getVisibility = function () {
|
|
543
543
|
* @param {*} shown
|
544
544
|
*/
|
545
545
|
Column.prototype.setVisibility = function (bitIndex, shown) {
|
546
|
-
|
546
|
+
let prevVis = !this._invisibility;
|
547
547
|
|
548
|
-
|
548
|
+
let bit = this._bits[bitIndex] || 1;
|
549
549
|
if(shown) {
|
550
550
|
this._invisibility &= ~bit; // Remove invisibility bit
|
551
551
|
} else {
|
552
552
|
this._invisibility |= bit; // Add invisibility bit
|
553
553
|
}
|
554
554
|
|
555
|
-
|
555
|
+
let newVis = !this._invisibility;
|
556
556
|
if (prevVis === newVis) {
|
557
557
|
return; // Nothing has changed
|
558
558
|
}
|
559
559
|
|
560
|
-
|
560
|
+
let hidingMethod = this._section ? this._section.getHidingMethod() : "";
|
561
561
|
if(hidingMethod) {
|
562
562
|
this.enableClass("hidden", !newVis); // Custom class method
|
563
563
|
// this._element.style.display = (newVis !== false) ? "" : "none";
|
564
564
|
} else {
|
565
565
|
if(newVis) { // Find a proper place to insert (show)
|
566
566
|
// this._element.style.display = "";
|
567
|
-
|
567
|
+
let curParent = this._parent;
|
568
568
|
if(!curParent) {
|
569
569
|
return; // WARNING: It could possibly be a bug, if there is no parent at this moment
|
570
570
|
}
|
571
|
-
|
571
|
+
let nextSibling = this._nextSibling; // Next sibling can be an empty object
|
572
572
|
while(nextSibling) {
|
573
573
|
if (nextSibling._parent !== curParent) {
|
574
574
|
// This could mean either this is pinned left column or column within the scroll frame (i.e. any column that is not pinned to the right)
|
@@ -9,7 +9,7 @@ import Util from "../util/util.js";
|
|
9
9
|
* @extends {EventDispatcher}
|
10
10
|
* @param {Element=} opt_element If not specified "div" element is instantly created.
|
11
11
|
*/
|
12
|
-
|
12
|
+
let ElementWrapper = function (opt_element) {
|
13
13
|
this._element = opt_element ? opt_element : document.createElement("div");
|
14
14
|
};
|
15
15
|
Ext.inherits(ElementWrapper, EventDispatcher);
|
@@ -128,7 +128,7 @@ ElementWrapper.prototype.removeContent = function (content) {
|
|
128
128
|
* @param {number=} opt_priority The higher the priority, the sooner the listener get executed. Undefined priority listener will be executed last
|
129
129
|
*
|
130
130
|
* @example
|
131
|
-
*
|
131
|
+
* let grid = new Core();
|
132
132
|
* grid.listen("click", function(e) { console.log("Grid is clicked"); });
|
133
133
|
*/
|
134
134
|
ElementWrapper.prototype.listen = function (type, handler, opt_priority) {
|
@@ -140,7 +140,7 @@ ElementWrapper.prototype.listen = function (type, handler, opt_priority) {
|
|
140
140
|
if (!this._nativeEvents) {
|
141
141
|
this._nativeEvents = {};
|
142
142
|
}
|
143
|
-
|
143
|
+
let e = this._nativeEvents[type];
|
144
144
|
if (!e) {
|
145
145
|
e = new EventListeners();
|
146
146
|
this._nativeEvents[type] = e;
|
@@ -149,9 +149,9 @@ ElementWrapper.prototype.listen = function (type, handler, opt_priority) {
|
|
149
149
|
|
150
150
|
if (!ElementWrapper._passiveEvents) {
|
151
151
|
// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection
|
152
|
-
|
152
|
+
let supportsPassive = false;
|
153
153
|
try {
|
154
|
-
|
154
|
+
let opts = /** @type{boolean} */(Object.defineProperty({}, 'passive', {
|
155
155
|
/**
|
156
156
|
* @return {boolean}
|
157
157
|
*/
|
@@ -165,7 +165,7 @@ ElementWrapper.prototype.listen = function (type, handler, opt_priority) {
|
|
165
165
|
} catch (err) {}
|
166
166
|
|
167
167
|
if(supportsPassive) {
|
168
|
-
|
168
|
+
let passiveOption = { "passive": true };
|
169
169
|
|
170
170
|
// "wheel" and "mousewheel" have default behavior that needs to be prevented. We have to exclude them from the list
|
171
171
|
ElementWrapper._passiveEvents = {
|
@@ -196,7 +196,7 @@ ElementWrapper.prototype.unlisten = function (type, handler) {
|
|
196
196
|
}
|
197
197
|
|
198
198
|
if (this._nativeEvents) {
|
199
|
-
|
199
|
+
let e = this._nativeEvents[type];
|
200
200
|
if (e) {
|
201
201
|
e.unlisten(handler);
|
202
202
|
}
|
@@ -214,7 +214,7 @@ ElementWrapper.prototype.unlistenAll = function (opt_type) {
|
|
214
214
|
this._customEvents[opt_type].unlistenAll();
|
215
215
|
}
|
216
216
|
} else {
|
217
|
-
for (
|
217
|
+
for (let customEvt in this._customEvents) {
|
218
218
|
this._customEvents[customEvt].unlistenAll();
|
219
219
|
}
|
220
220
|
}
|
@@ -227,7 +227,7 @@ ElementWrapper.prototype.unlistenAll = function (opt_type) {
|
|
227
227
|
delete this._nativeEvents[opt_type];
|
228
228
|
}
|
229
229
|
} else {
|
230
|
-
for (
|
230
|
+
for (let key in this._nativeEvents) {
|
231
231
|
this._unlistenAll(key);
|
232
232
|
}
|
233
233
|
this._nativeEvents = null;
|
@@ -239,7 +239,7 @@ ElementWrapper.prototype.unlistenAll = function (opt_type) {
|
|
239
239
|
* @param {string} type
|
240
240
|
*/
|
241
241
|
ElementWrapper.prototype._unlistenAll = function (type) {
|
242
|
-
|
242
|
+
let e = this._nativeEvents[type];
|
243
243
|
this._element.removeEventListener(type, e.dispatch, false);
|
244
244
|
e.unlistenAll();
|
245
245
|
};
|
@@ -268,7 +268,7 @@ ElementWrapper.prototype._dispose = function () {
|
|
268
268
|
*/
|
269
269
|
ElementWrapper.prototype.setEventArgExtender = function (type, func) {
|
270
270
|
if(this._customEvents) {
|
271
|
-
|
271
|
+
let evt = this._customEvents[type];
|
272
272
|
if(evt) {
|
273
273
|
evt.setEventArgExtender(func);
|
274
274
|
}
|
@@ -343,7 +343,7 @@ ElementWrapper.prototype._insertBefore = function (nextSibling) {
|
|
343
343
|
return;
|
344
344
|
}
|
345
345
|
|
346
|
-
|
346
|
+
let parent = nextSibling.parentNode;
|
347
347
|
if (parent == null) { return; }
|
348
348
|
|
349
349
|
parent.insertBefore(this._element, nextSibling);
|
@@ -401,7 +401,7 @@ ElementWrapper.prototype.removeClass = function (str) {
|
|
401
401
|
* @param {(boolean|null)=} forcedVal If specified, force CSS class state as the specified value
|
402
402
|
*/
|
403
403
|
ElementWrapper.prototype.toggleClass = function (cls, forcedVal) {
|
404
|
-
|
404
|
+
let elem = this._element;
|
405
405
|
if(elem) {
|
406
406
|
if(forcedVal == null) {
|
407
407
|
forcedVal = !elem.classList.contains(cls);
|
@@ -453,7 +453,7 @@ ElementWrapper.prototype.setAttribute = function (str, val) { this._element.setA
|
|
453
453
|
* @param {Object} json Key is the attribute names and value is string value (i.e. "readonly", "50", "checkbox")
|
454
454
|
*/
|
455
455
|
ElementWrapper.prototype.setAttributes = function (json) {
|
456
|
-
for (
|
456
|
+
for (let key in json) {
|
457
457
|
this._element.setAttribute(key, json[key]);
|
458
458
|
}
|
459
459
|
};
|
@@ -480,8 +480,8 @@ ElementWrapper.prototype.setStyle = function (str, val) { this._element.style[st
|
|
480
480
|
* @param {Object} json Key is the property names and value is style value (i.e. "center", "#FF00FF", "10px")
|
481
481
|
*/
|
482
482
|
ElementWrapper.prototype.setStyles = function (json) {
|
483
|
-
|
484
|
-
for (
|
483
|
+
let styles = this._element.style;
|
484
|
+
for (let key in json) {
|
485
485
|
styles[key] = json[key];
|
486
486
|
}
|
487
487
|
};
|
@@ -507,7 +507,7 @@ ElementWrapper.prototype.setId = function (val) {
|
|
507
507
|
* @return {string}
|
508
508
|
*/
|
509
509
|
ElementWrapper.prototype.toString = function () {
|
510
|
-
|
510
|
+
let outer = this._element.outerHTML;
|
511
511
|
outer = outer.replace(this._element.innerHTML, "");
|
512
512
|
return outer;
|
513
513
|
};
|