@refinitiv-ui/efx-grid 6.0.91 → 6.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -9,7 +9,7 @@ import { Dom } from "./Dom.js";
|
|
|
9
9
|
* @private
|
|
10
10
|
* @const
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
let GridElements = {
|
|
13
13
|
"EFX-GRID": 1,
|
|
14
14
|
"ATLAS-BLOTTER": 1,
|
|
15
15
|
"EF-GRID": 1
|
|
@@ -18,7 +18,7 @@ var GridElements = {
|
|
|
18
18
|
* @private
|
|
19
19
|
* @const
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
let InvalidHostElements = {
|
|
22
22
|
"BODY": 1,
|
|
23
23
|
"HTML": 1,
|
|
24
24
|
"EFX-GRID": 1,
|
|
@@ -30,16 +30,16 @@ var InvalidHostElements = {
|
|
|
30
30
|
* @param {Object} instance
|
|
31
31
|
* @return {Object}
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
let _cloneInstance = function (instance) {
|
|
34
34
|
return new instance.constructor();
|
|
35
35
|
};
|
|
36
36
|
/** @private
|
|
37
37
|
* @param {number} num
|
|
38
38
|
* @return {!Array.<Object>}
|
|
39
39
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
for(
|
|
40
|
+
let _newArrayOfObject = function (num) {
|
|
41
|
+
let ary = new Array(num);
|
|
42
|
+
for(let i = 0; i < num; ++i) {
|
|
43
43
|
ary[i] = {};
|
|
44
44
|
}
|
|
45
45
|
return ary;
|
|
@@ -48,12 +48,12 @@ var _newArrayOfObject = function (num) {
|
|
|
48
48
|
* @param {Element} elem
|
|
49
49
|
* @param {boolean=} bool
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
let _toggleInlineElement = function (elem, bool) {
|
|
52
52
|
if(!elem || elem.style.display === "none") {
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
let s = elem.style;
|
|
57
57
|
if(bool == null) {
|
|
58
58
|
bool = s.display !== "inline-block";
|
|
59
59
|
}
|
|
@@ -69,7 +69,7 @@ var _toggleInlineElement = function (elem, bool) {
|
|
|
69
69
|
/** @constructor
|
|
70
70
|
* @param {Element} gridElem
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
let MultiTableManager = function (gridElem) {
|
|
73
73
|
this._onDelayedConfiguration = this._onDelayedConfiguration.bind(this);
|
|
74
74
|
this._onConfiguration = this._onConfiguration.bind(this);
|
|
75
75
|
this._onWrapCountChanged = this._onWrapCountChanged.bind(this);
|
|
@@ -130,7 +130,7 @@ MultiTableManager.synchronizeVScrollbar = function(vScrollbarHost, hScrollbarHos
|
|
|
130
130
|
return Promise.reject("Host element cannot be body element.");
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
let gridLen = 0;
|
|
134
134
|
if(gridElems) {
|
|
135
135
|
if(GridElements[gridElems.tagName]) { // Accept single grid element as a parameter
|
|
136
136
|
gridElems = [gridElems];
|
|
@@ -139,8 +139,8 @@ MultiTableManager.synchronizeVScrollbar = function(vScrollbarHost, hScrollbarHos
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// Element validation
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
let i, gridElem;
|
|
143
|
+
let validatedElems = [];
|
|
144
144
|
for(i = 0; i < gridLen; ++i) {
|
|
145
145
|
gridElem = gridElems[i];
|
|
146
146
|
if(gridElem && GridElements[gridElem.tagName]) {
|
|
@@ -152,13 +152,13 @@ MultiTableManager.synchronizeVScrollbar = function(vScrollbarHost, hScrollbarHos
|
|
|
152
152
|
return Promise.reject("No grid element detected for scrollbar synchronization.");
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
let promises = [];
|
|
156
156
|
for(i = 0; i < gridLen; ++i) {
|
|
157
157
|
gridElem = validatedElems[i];
|
|
158
158
|
if(gridElem.api) {
|
|
159
159
|
promises.push(Promise.resolve(gridElem));
|
|
160
160
|
} else {
|
|
161
|
-
|
|
161
|
+
let deferredConfig = gridElem._deferredConfig;
|
|
162
162
|
if(!deferredConfig) {
|
|
163
163
|
deferredConfig = gridElem._deferredConfig = new Deferred();
|
|
164
164
|
gridElem.addEventListener("configured", MultiTableManager._onGridConfigured);
|
|
@@ -175,10 +175,10 @@ MultiTableManager.synchronizeVScrollbar = function(vScrollbarHost, hScrollbarHos
|
|
|
175
175
|
* @param {Object} e
|
|
176
176
|
*/
|
|
177
177
|
MultiTableManager._onGridConfigured = function(e) {
|
|
178
|
-
|
|
178
|
+
let gridElem = e.currentTarget;
|
|
179
179
|
gridElem.removeEventListener("configured", MultiTableManager._onGridConfigured);
|
|
180
180
|
if(gridElem._deferredConfig) {
|
|
181
|
-
|
|
181
|
+
let d = gridElem._deferredConfig;
|
|
182
182
|
gridElem._deferredConfig = null;
|
|
183
183
|
d.resolve(gridElem);
|
|
184
184
|
}
|
|
@@ -190,7 +190,6 @@ MultiTableManager._onGridConfigured = function(e) {
|
|
|
190
190
|
* @param {Array.<Element>} gridElems
|
|
191
191
|
*/
|
|
192
192
|
MultiTableManager._onVScrollbarSynchronization = function(vScrollbarHost, hScrollbarHost, gridElems) {
|
|
193
|
-
// Dom.removeChildren(vScrollbarHost);
|
|
194
193
|
Dom.removeChildren(hScrollbarHost);
|
|
195
194
|
|
|
196
195
|
vScrollbarHost.style.overflow = "hidden";
|
|
@@ -199,11 +198,11 @@ MultiTableManager._onVScrollbarSynchronization = function(vScrollbarHost, hScrol
|
|
|
199
198
|
hScrollbarHost.style.whiteSpace = "nowrap";
|
|
200
199
|
hScrollbarHost.style.overflow = "auto hidden";
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
for(
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
let gridLen = gridElems.length;
|
|
202
|
+
let mainCore = gridElems[0].api.getCoreGrid();
|
|
203
|
+
for(let i = 0; i < gridLen; ++i) {
|
|
204
|
+
let gridElem = gridElems[i];
|
|
205
|
+
let core = gridElem.api.getCoreGrid();
|
|
207
206
|
|
|
208
207
|
_toggleInlineElement(gridElem, true);
|
|
209
208
|
if(i > 0) {
|
|
@@ -215,7 +214,6 @@ MultiTableManager._onVScrollbarSynchronization = function(vScrollbarHost, hScrol
|
|
|
215
214
|
}
|
|
216
215
|
|
|
217
216
|
Dom.appendChild(hScrollbarHost, gridElems);
|
|
218
|
-
// Dom.appendChild(vScrollbarHost, hScrollbarHost);
|
|
219
217
|
};
|
|
220
218
|
|
|
221
219
|
/** @public
|
|
@@ -231,7 +229,7 @@ MultiTableManager.prototype.setGridConfig = function (configObj) {
|
|
|
231
229
|
}
|
|
232
230
|
this._extensions = configObj.extensions ? configObj.extensions.slice() : [];
|
|
233
231
|
|
|
234
|
-
|
|
232
|
+
let main = this._tables[0];
|
|
235
233
|
if(main) {
|
|
236
234
|
configObj = this._cloneConfig();
|
|
237
235
|
main.addEventListener("configured", this._onDelayedConfiguration);
|
|
@@ -266,8 +264,8 @@ MultiTableManager.prototype._onConfiguration = function () {
|
|
|
266
264
|
/** @public
|
|
267
265
|
*/
|
|
268
266
|
MultiTableManager.prototype.dispose = function () {
|
|
269
|
-
|
|
270
|
-
for(
|
|
267
|
+
let len = this._tables.length;
|
|
268
|
+
for(let i = 0; i < len; ++i) {
|
|
271
269
|
this._tables[i].dispose();
|
|
272
270
|
}
|
|
273
271
|
this._tables = [];
|
|
@@ -280,11 +278,11 @@ MultiTableManager.prototype.dispose = function () {
|
|
|
280
278
|
* @return {!Object}
|
|
281
279
|
*/
|
|
282
280
|
MultiTableManager.prototype._cloneConfig = function () {
|
|
283
|
-
|
|
281
|
+
let obj = null;
|
|
284
282
|
if(this._configObj) {
|
|
285
283
|
obj = cloneObject(this._configObj);
|
|
286
284
|
if(Array.isArray(obj.columns)) {
|
|
287
|
-
|
|
285
|
+
let runtimeConfig = this._tables[0].api ? this._tables[0].api.getConfigObject() : this._configObj;
|
|
288
286
|
obj.columns = runtimeConfig.columns.slice();
|
|
289
287
|
}
|
|
290
288
|
}
|
|
@@ -304,7 +302,7 @@ MultiTableManager.prototype._setTableCount = function(num) {
|
|
|
304
302
|
this._tableCount = num > 0 ? num : 1;
|
|
305
303
|
|
|
306
304
|
if(this._ready) {
|
|
307
|
-
|
|
305
|
+
let tableCount = this._tables.length;
|
|
308
306
|
if(this._tableCount > tableCount) {
|
|
309
307
|
this._addTables(this._tableCount - tableCount);
|
|
310
308
|
} else if(this._tableCount < tableCount) {
|
|
@@ -328,15 +326,14 @@ MultiTableManager.prototype.setTableCount = function(num) {
|
|
|
328
326
|
* @return {Element}
|
|
329
327
|
*/
|
|
330
328
|
MultiTableManager.prototype._addTable = function(tableIndex) {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
var configObj = this._cloneConfig();
|
|
329
|
+
let main = this._tables[0];
|
|
330
|
+
let parentElem = main.parentNode;
|
|
331
|
+
let core = main.api.getCoreGrid();
|
|
332
|
+
let mainDataView = main.api.getDataView();
|
|
333
|
+
let stp = core.getPlugin("SortableTitlePlugin");
|
|
334
|
+
let dtp = core.getPlugin("DragAndDropTitlePlugin");
|
|
335
|
+
|
|
336
|
+
let configObj = this._cloneConfig();
|
|
340
337
|
configObj.extensions = this._generateExtensions();
|
|
341
338
|
|
|
342
339
|
delete configObj.staticDataRows;
|
|
@@ -344,15 +341,15 @@ MultiTableManager.prototype._addTable = function(tableIndex) {
|
|
|
344
341
|
delete configObj.dataModel;
|
|
345
342
|
|
|
346
343
|
if(this._wrapSize) {
|
|
347
|
-
|
|
344
|
+
let wrappedViews = mainDataView.getWrappedViews();
|
|
348
345
|
configObj.dataView = wrappedViews[tableIndex - 1];
|
|
349
346
|
configObj.grid = main.api;
|
|
350
347
|
} else {
|
|
351
348
|
configObj["SortableTitle"] = stp;
|
|
352
349
|
configObj["DragAndDropTitle"] = dtp;
|
|
353
|
-
|
|
350
|
+
let rowCount = mainDataView.getRowCount();
|
|
354
351
|
|
|
355
|
-
|
|
352
|
+
let ary = _newArrayOfObject(rowCount);
|
|
356
353
|
if(this._emeraldGrid) {
|
|
357
354
|
configObj.dataModel = {
|
|
358
355
|
data: ary
|
|
@@ -362,12 +359,12 @@ MultiTableManager.prototype._addTable = function(tableIndex) {
|
|
|
362
359
|
}
|
|
363
360
|
}
|
|
364
361
|
|
|
365
|
-
|
|
362
|
+
let sub = document.createElement(main.tagName);
|
|
366
363
|
_toggleInlineElement(sub, true);
|
|
367
364
|
|
|
368
365
|
sub.config = configObj;
|
|
369
366
|
|
|
370
|
-
|
|
367
|
+
let lastTable = this._tables[this._tables.length - 1];
|
|
371
368
|
parentElem.insertBefore(sub, lastTable.nextSibling);
|
|
372
369
|
return sub;
|
|
373
370
|
};
|
|
@@ -380,13 +377,11 @@ MultiTableManager.prototype._addTables = function(num) {
|
|
|
380
377
|
return;
|
|
381
378
|
}
|
|
382
379
|
|
|
383
|
-
|
|
380
|
+
let main = this._tables[0];
|
|
384
381
|
_toggleInlineElement(main, true); // TODO: Check if we need to do this every time
|
|
385
382
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
for(var i = 0; i < num; ++i) {
|
|
389
|
-
var grid = this._addTable(this._tables.length);
|
|
383
|
+
for(let i = 0; i < num; ++i) {
|
|
384
|
+
let grid = this._addTable(this._tables.length);
|
|
390
385
|
this._tables.push(grid);
|
|
391
386
|
}
|
|
392
387
|
|
|
@@ -405,24 +400,20 @@ MultiTableManager.prototype._addTables = function(num) {
|
|
|
405
400
|
* @param {number} num
|
|
406
401
|
*/
|
|
407
402
|
MultiTableManager.prototype._removeTables = function(num) {
|
|
408
|
-
|
|
403
|
+
let tableCount = this._tables.length;
|
|
409
404
|
if (tableCount - num < 1) {
|
|
410
405
|
num = tableCount - 1;
|
|
411
406
|
}
|
|
412
407
|
if(!num) {
|
|
413
408
|
return;
|
|
414
409
|
}
|
|
415
|
-
for(
|
|
416
|
-
|
|
410
|
+
for(let i = 0; i < num; ++i) {
|
|
411
|
+
let sub = this._tables.pop();
|
|
417
412
|
sub.config = null;
|
|
418
413
|
if(sub.parentNode) {
|
|
419
414
|
sub.parentNode.removeChild(sub);
|
|
420
415
|
}
|
|
421
416
|
}
|
|
422
|
-
// if(this._tables.length === 1) {
|
|
423
|
-
// TODO: Reset state
|
|
424
|
-
// this._tables[0].style.display = ""; // Remove display inline
|
|
425
|
-
// }
|
|
426
417
|
};
|
|
427
418
|
|
|
428
419
|
|
|
@@ -433,7 +424,7 @@ MultiTableManager.prototype._wrapTable = function(rowCount) {
|
|
|
433
424
|
this._wrapSize = rowCount > 0 ? rowCount : 0;
|
|
434
425
|
|
|
435
426
|
if(this._ready) {
|
|
436
|
-
|
|
427
|
+
let main = this._tables[0];
|
|
437
428
|
if(this._wrapSize) {
|
|
438
429
|
main.style.display = "none";
|
|
439
430
|
main.api.getCoreGrid().getVScrollbar().disable();
|
|
@@ -443,7 +434,7 @@ MultiTableManager.prototype._wrapTable = function(rowCount) {
|
|
|
443
434
|
main.api.getCoreGrid().getVScrollbar().disable(false);
|
|
444
435
|
}
|
|
445
436
|
|
|
446
|
-
|
|
437
|
+
let dv = main.api.getDataView();
|
|
447
438
|
dv.listen("wrapCountChanged", this._onWrapCountChanged);
|
|
448
439
|
dv.wrapView(this._wrapSize);
|
|
449
440
|
}
|
|
@@ -490,10 +481,10 @@ MultiTableManager.prototype.getTable = function(at) {
|
|
|
490
481
|
* @return {!Array}
|
|
491
482
|
*/
|
|
492
483
|
MultiTableManager.prototype._generateExtensions = function() {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
for(
|
|
496
|
-
|
|
484
|
+
let extCount = this._extensions ? this._extensions.length : 0;
|
|
485
|
+
let ary = new Array(extCount);
|
|
486
|
+
for(let i = 0; i < extCount; ++i) {
|
|
487
|
+
let ext = this._extensions[i];
|
|
497
488
|
if(ext.hasMultiTableSupport && ext.hasMultiTableSupport()) {
|
|
498
489
|
ary[i] = ext;
|
|
499
490
|
} else {
|
|
@@ -507,9 +498,9 @@ MultiTableManager.prototype._generateExtensions = function() {
|
|
|
507
498
|
* @param {...*} args
|
|
508
499
|
*/
|
|
509
500
|
MultiTableManager.prototype._execAll = function(methodName, args) {
|
|
510
|
-
|
|
511
|
-
for(
|
|
512
|
-
|
|
501
|
+
let tableCount = this._tables.length;
|
|
502
|
+
for(let i = 0; i < tableCount; ++i) {
|
|
503
|
+
let tbl = this._tables[i];
|
|
513
504
|
if(args !== undefined) { // eslint-disable-line
|
|
514
505
|
if(arguments.length > 2) {
|
|
515
506
|
tbl.api[methodName].apply(
|
|
@@ -531,15 +522,15 @@ MultiTableManager.prototype._execAll = function(methodName, args) {
|
|
|
531
522
|
*/
|
|
532
523
|
MultiTableManager.prototype.insertRow = function(rowOption, at) {
|
|
533
524
|
if(this._emeraldGrid) {
|
|
534
|
-
return;
|
|
525
|
+
return;
|
|
535
526
|
}
|
|
536
527
|
|
|
537
528
|
if(this._wrapSize) {
|
|
538
529
|
this.getTable().api.insertRow(rowOption, at);
|
|
539
530
|
} else {
|
|
540
|
-
|
|
541
|
-
for(
|
|
542
|
-
|
|
531
|
+
let tableCount = this._tables.length;
|
|
532
|
+
for(let i = 0; i < tableCount; ++i) {
|
|
533
|
+
let tbl = this._tables[i];
|
|
543
534
|
tbl.api.insertRow(rowOption, at);
|
|
544
535
|
}
|
|
545
536
|
}
|
|
@@ -549,7 +540,7 @@ MultiTableManager.prototype.insertRow = function(rowOption, at) {
|
|
|
549
540
|
*/
|
|
550
541
|
MultiTableManager.prototype.removeRow = function(at) {
|
|
551
542
|
if(this._emeraldGrid) {
|
|
552
|
-
return;
|
|
543
|
+
return;
|
|
553
544
|
}
|
|
554
545
|
if(at == null) {
|
|
555
546
|
at = this.getRowCount() - 1;
|
|
@@ -558,9 +549,9 @@ MultiTableManager.prototype.removeRow = function(at) {
|
|
|
558
549
|
if(this._wrapSize) {
|
|
559
550
|
this.getTable().api.removeRow(at);
|
|
560
551
|
} else {
|
|
561
|
-
|
|
562
|
-
for(
|
|
563
|
-
|
|
552
|
+
let tableCount = this._tables.length;
|
|
553
|
+
for(let i = 0; i < tableCount; ++i) {
|
|
554
|
+
let tbl = this._tables[i];
|
|
564
555
|
tbl.api.removeRow(at);
|
|
565
556
|
}
|
|
566
557
|
}
|
|
@@ -579,12 +570,12 @@ MultiTableManager.prototype.getRowCount = function() {
|
|
|
579
570
|
*/
|
|
580
571
|
MultiTableManager.prototype.insertColumn = function(columnOption, idx) {
|
|
581
572
|
if(this._emeraldGrid) {
|
|
582
|
-
return;
|
|
573
|
+
return;
|
|
583
574
|
}
|
|
584
575
|
|
|
585
|
-
|
|
586
|
-
for(
|
|
587
|
-
|
|
576
|
+
let tableCount = this._tables.length;
|
|
577
|
+
for(let i = 0; i < tableCount; ++i) {
|
|
578
|
+
let tbl = this._tables[i];
|
|
588
579
|
tbl.api.insertColumn(columnOption, idx);
|
|
589
580
|
}
|
|
590
581
|
};
|
|
@@ -593,11 +584,11 @@ MultiTableManager.prototype.insertColumn = function(columnOption, idx) {
|
|
|
593
584
|
*/
|
|
594
585
|
MultiTableManager.prototype.removeColumn = function(colRef) {
|
|
595
586
|
if(this._emeraldGrid) {
|
|
596
|
-
return;
|
|
587
|
+
return;
|
|
597
588
|
}
|
|
598
|
-
|
|
599
|
-
for(
|
|
600
|
-
|
|
589
|
+
let tableCount = this._tables.length;
|
|
590
|
+
for(let i = 0; i < tableCount; ++i) {
|
|
591
|
+
let tbl = this._tables[i];
|
|
601
592
|
tbl.api.removeColumn(colRef);
|
|
602
593
|
}
|
|
603
594
|
};
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
* @param {number} num Absolute number
|
|
19
19
|
* @return {number}
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
let _multiplyByHundred = function(num) {
|
|
22
|
+
let intPart = num | 0;
|
|
23
23
|
if(num > intPart) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
let str = num + "";
|
|
25
|
+
let at = str.indexOf(".");
|
|
26
|
+
let fracStr = str.slice(at + 1) + "00";
|
|
27
27
|
return +(str.slice(0, at) + fracStr.slice(0, 2) + "." + fracStr.slice(2));
|
|
28
28
|
}
|
|
29
29
|
return num * 100;
|
|
@@ -33,7 +33,7 @@ var _multiplyByHundred = function(num) {
|
|
|
33
33
|
* @constructor
|
|
34
34
|
* @param {NumberFormatter~Options=} options
|
|
35
35
|
* @example
|
|
36
|
-
*
|
|
36
|
+
* let options = {
|
|
37
37
|
* "precisionEnabled": false, // Default is leaving precision as is
|
|
38
38
|
* "decimalPlaces": 2, // Take effect only precisionEnabled === true
|
|
39
39
|
* "plusSign": false, // Plus sign prefixing
|
|
@@ -42,12 +42,12 @@ var _multiplyByHundred = function(num) {
|
|
|
42
42
|
* "scalingUnit": "", // "b"|"m"
|
|
43
43
|
* "multiplyBy100": false
|
|
44
44
|
*};
|
|
45
|
-
*
|
|
45
|
+
* let nf = new NumberFormatter(options);
|
|
46
46
|
* nf.format(123); // "123"
|
|
47
47
|
* nf.format(-456.789); // "-456.789"
|
|
48
48
|
* nf.getOptions(); // For serialization
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
let NumberFormatter = function (options) {
|
|
51
51
|
this["format"] = this.format = this.format.bind(this);
|
|
52
52
|
|
|
53
53
|
this.init(options);
|
|
@@ -113,10 +113,10 @@ NumberFormatter.prototype.init = function(options) { // deserialize
|
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
let formatType = /** @type{string} */(options["formatType"] || options["type"]);
|
|
117
117
|
|
|
118
118
|
// Note that precision will not be used in scaledValue mode
|
|
119
|
-
|
|
119
|
+
let val = options["precisionEnabled"];
|
|
120
120
|
if(val != null && val !== "") {
|
|
121
121
|
this._precisionEnabled = val ? true : false;
|
|
122
122
|
} else {
|
|
@@ -203,9 +203,9 @@ NumberFormatter.prototype.resetToDefaults = function () {
|
|
|
203
203
|
* NumberFormatter.padDecimalPartWithZeroes("1.000", 2); // "1.000"
|
|
204
204
|
*/
|
|
205
205
|
NumberFormatter.padDecimalPartWithZeroes = function (str, precision) {
|
|
206
|
-
|
|
206
|
+
let dp = str.lastIndexOf(".");
|
|
207
207
|
if (dp >= 0) {
|
|
208
|
-
|
|
208
|
+
let decimalPlace = str.length - dp - 1;
|
|
209
209
|
if (decimalPlace < precision) {
|
|
210
210
|
str += NumberFormatter._zeroes[precision - decimalPlace];
|
|
211
211
|
}
|
|
@@ -240,7 +240,7 @@ NumberFormatter.multiplyByHundred = function (num) {
|
|
|
240
240
|
NumberFormatter.prototype.getOptions = function(options) { // serialize
|
|
241
241
|
if(!options) { options = {}; }
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
let formatType = options["formatType"];
|
|
244
244
|
|
|
245
245
|
if(this._precisionEnabled !== true) {
|
|
246
246
|
options["precisionEnabled"] = this._precisionEnabled; // Default in init
|
|
@@ -259,7 +259,7 @@ NumberFormatter.prototype.getOptions = function(options) { // serialize
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
if(formatType === "scaled" || formatType === "scaledvalue") {
|
|
262
|
-
|
|
262
|
+
let su = "";
|
|
263
263
|
if(this._scaler == "b") {
|
|
264
264
|
su = "billion";
|
|
265
265
|
options["scalingUnit"] = su;
|
|
@@ -295,7 +295,7 @@ NumberFormatter.prototype.format = function(origVal) {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// Simplify logic by making positive value
|
|
298
|
-
|
|
298
|
+
let val, sign;
|
|
299
299
|
if(origVal >= 0) {
|
|
300
300
|
val = origVal;
|
|
301
301
|
sign = this._plusSignEnabled ? "+" : "";
|
|
@@ -303,7 +303,7 @@ NumberFormatter.prototype.format = function(origVal) {
|
|
|
303
303
|
val = -origVal;
|
|
304
304
|
sign = "-";
|
|
305
305
|
}
|
|
306
|
-
|
|
306
|
+
let scalingMode = this._percentFormatEnabled ? "" : this._scaler; // Percent formatting overwrite scaling mode
|
|
307
307
|
|
|
308
308
|
if(this._multiplyBy100Enabled) {
|
|
309
309
|
if(this._precisionEnabled || scalingMode) {
|
|
@@ -313,7 +313,7 @@ NumberFormatter.prototype.format = function(origVal) {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
let absVal = val;
|
|
317
317
|
// Perform scaling
|
|
318
318
|
if (scalingMode) {
|
|
319
319
|
if (scalingMode === "b" && val < 1e9) {
|
|
@@ -332,7 +332,7 @@ NumberFormatter.prototype.format = function(origVal) {
|
|
|
332
332
|
// Perform rounding
|
|
333
333
|
if (this._precisionEnabled) {
|
|
334
334
|
if (this._precision > 0) {
|
|
335
|
-
|
|
335
|
+
let deno = NumberFormatter._denominator[this._precision];
|
|
336
336
|
val = Math.round(val * deno) / deno;
|
|
337
337
|
} else {
|
|
338
338
|
val = Math.round(val);
|
|
@@ -342,14 +342,14 @@ NumberFormatter.prototype.format = function(origVal) {
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
// Convert value to string
|
|
345
|
-
|
|
345
|
+
let str;
|
|
346
346
|
if(val > 0) {
|
|
347
347
|
if(val >= 1e-6) { // Handle high (7 or more digits) precision value
|
|
348
348
|
str = sign + val;
|
|
349
349
|
} else {
|
|
350
|
-
|
|
350
|
+
let fraction = val * 1e7; // Be careful that there are some cases like 1e-7 * 1e6 === 0.099
|
|
351
351
|
str = (fraction / 10) + "";
|
|
352
|
-
str = sign + "0.000000" + str.
|
|
352
|
+
str = sign + "0.000000" + str.slice(2);
|
|
353
353
|
}
|
|
354
354
|
} else {
|
|
355
355
|
str = "0";
|
|
@@ -357,7 +357,7 @@ NumberFormatter.prototype.format = function(origVal) {
|
|
|
357
357
|
|
|
358
358
|
// Add separators
|
|
359
359
|
if(this._separatorEnabled && val >= 1e3) {
|
|
360
|
-
|
|
360
|
+
let strs = str.split(".");
|
|
361
361
|
str = strs[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
362
362
|
if(strs.length > 1) {
|
|
363
363
|
str += "." + strs[1];
|
|
@@ -389,7 +389,7 @@ NumberFormatter.prototype.format = function(origVal) {
|
|
|
389
389
|
|
|
390
390
|
/** @public */
|
|
391
391
|
NumberFormatter.prototype.enableDefaultFormat = function() {
|
|
392
|
-
|
|
392
|
+
let t = this;
|
|
393
393
|
t._precisionEnabled = t._separatorEnabled = t._percentSignEnabled = false;
|
|
394
394
|
t._percentFormatEnabled = t._plusSignEnabled = t._multiplyBy100Enabled = false;
|
|
395
395
|
t._scaler = "";
|