@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
|
@@ -6,7 +6,7 @@ import EventDispatcher from "../../../tr-grid-util/es6/EventDispatcher.js";
|
|
|
6
6
|
* @param {string} rid
|
|
7
7
|
* @param {!Object} sharedObj
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
let Segment = function(rid, sharedObj) {
|
|
10
10
|
this._rid = rid;
|
|
11
11
|
this._children = {};
|
|
12
12
|
this._shared = sharedObj;
|
|
@@ -114,11 +114,11 @@ Segment.prototype.dispose = function() {
|
|
|
114
114
|
this._disposed = true;
|
|
115
115
|
|
|
116
116
|
this.removeAllEventListeners();
|
|
117
|
-
|
|
117
|
+
let segmentNames = this._subSegNames;
|
|
118
118
|
if(segmentNames) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
for(
|
|
119
|
+
let segmentCount = segmentNames.length;
|
|
120
|
+
let segmentMap = this._subSegMap;
|
|
121
|
+
for(let i = 0; i < segmentCount; ++i) {
|
|
122
122
|
segmentMap[segmentNames[i]].dispose();
|
|
123
123
|
}
|
|
124
124
|
this._subSegMap = this._subSegNames = null;
|
|
@@ -150,16 +150,16 @@ Segment.prototype.getParentId = function() {
|
|
|
150
150
|
* @return {Array.<string>}
|
|
151
151
|
*/
|
|
152
152
|
Segment.prototype.getSubSegmentIds = function(out_ary) {
|
|
153
|
-
|
|
153
|
+
let segmentNames = this._subSegNames;
|
|
154
154
|
if(segmentNames) {
|
|
155
155
|
if(!out_ary) {
|
|
156
156
|
out_ary = [];
|
|
157
157
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
for(
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
let segmentCount = segmentNames.length;
|
|
159
|
+
let segmentMap = this._subSegMap;
|
|
160
|
+
for(let i = 0; i < segmentCount; ++i) {
|
|
161
|
+
let segmentName = segmentNames[i];
|
|
162
|
+
let segment = segmentMap[segmentName];
|
|
163
163
|
out_ary.push(segment.getId());
|
|
164
164
|
segment.getSubSegmentIds(out_ary);
|
|
165
165
|
}
|
|
@@ -195,10 +195,10 @@ Segment.prototype.addChild = function(rid, dataId) {
|
|
|
195
195
|
* @return {boolean}
|
|
196
196
|
*/
|
|
197
197
|
Segment.prototype.addChildren = function(rids, dataIds) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
let rowIds = Array.isArray(rids) ? rids : [rids];
|
|
199
|
+
let rowCount = rowIds.length;
|
|
200
|
+
let dirty = 0;
|
|
201
|
+
let i;
|
|
202
202
|
if(dataIds != null) {
|
|
203
203
|
dataIds = Array.isArray(dataIds) ? dataIds : [dataIds];
|
|
204
204
|
for(i = 0; i < rowCount; ++i) {
|
|
@@ -233,7 +233,7 @@ Segment.prototype.removeChild = function(rid) {
|
|
|
233
233
|
return false; // The specified rid is not a child of this segment
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
|
|
236
|
+
let objMap = this._shared.childToSegment;
|
|
237
237
|
delete objMap[rid];
|
|
238
238
|
delete this._children[rid]; // Slow
|
|
239
239
|
--this._childCount;
|
|
@@ -254,10 +254,10 @@ Segment.prototype.removeChildren = function(rids) {
|
|
|
254
254
|
if(!this._childCount) {
|
|
255
255
|
return false;
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
for(
|
|
257
|
+
let rowIds = Array.isArray(rids) ? rids : [rids];
|
|
258
|
+
let rowCount = rowIds.length;
|
|
259
|
+
let dirty = 0;
|
|
260
|
+
for(let i = 0; i < rowCount; ++i) {
|
|
261
261
|
dirty |= this.removeChild(rowIds[i]);
|
|
262
262
|
}
|
|
263
263
|
return dirty ? true : false;
|
|
@@ -272,9 +272,9 @@ Segment.prototype.removeAllChildren = function() {
|
|
|
272
272
|
if(!this._childCount) {
|
|
273
273
|
return false;
|
|
274
274
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
for(
|
|
275
|
+
let objMap = this._shared.childToSegment;
|
|
276
|
+
let chdr = this._children;
|
|
277
|
+
for(let rid in chdr) {
|
|
278
278
|
if(objMap[rid]) {
|
|
279
279
|
delete objMap[rid]; // TODO: Check if we need to do this
|
|
280
280
|
}
|
|
@@ -324,12 +324,12 @@ Segment.prototype.setClassification = function(fields) {
|
|
|
324
324
|
if(this._subSegLevel) {
|
|
325
325
|
return false; // non-root segment cannot be classified
|
|
326
326
|
}
|
|
327
|
-
|
|
327
|
+
let classifiers = null;
|
|
328
328
|
if(this._subSegDef) {
|
|
329
329
|
classifiers = this._subSegDef.classifiers;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
|
|
332
|
+
let newClassifiers = null;
|
|
333
333
|
if(fields) {
|
|
334
334
|
if(typeof fields === "string") {
|
|
335
335
|
newClassifiers = [fields];
|
|
@@ -337,11 +337,11 @@ Segment.prototype.setClassification = function(fields) {
|
|
|
337
337
|
newClassifiers = fields;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
let i;
|
|
341
|
+
let fieldCount = newClassifiers ? newClassifiers.length : 0;
|
|
342
342
|
|
|
343
343
|
if(fieldCount) {
|
|
344
|
-
|
|
344
|
+
let curCount = classifiers ? classifiers.length : 0;
|
|
345
345
|
if(curCount === fieldCount) { // Check duplication
|
|
346
346
|
for(i = 0; i < fieldCount; ++i) {
|
|
347
347
|
if(newClassifiers[i] !== classifiers[i]) {
|
|
@@ -377,11 +377,11 @@ Segment.prototype.setClassification = function(fields) {
|
|
|
377
377
|
* @return {boolean}
|
|
378
378
|
*/
|
|
379
379
|
Segment.prototype.classify = function(rows) {
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
let classifiers = this._subSegDef ? this._subSegDef.classifiers : null;
|
|
381
|
+
let classifierCount = classifiers ? classifiers.length : 0;
|
|
382
382
|
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
let segmentNames = this._subSegNames;
|
|
384
|
+
let segmentCount = segmentNames ? segmentNames.length : 0;
|
|
385
385
|
|
|
386
386
|
if(!segmentCount) {
|
|
387
387
|
if(this._subSegLevel >= classifierCount) {
|
|
@@ -389,18 +389,18 @@ Segment.prototype.classify = function(rows) {
|
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
-
|
|
392
|
+
let sharedObj = this._shared;
|
|
393
393
|
if(this._collapsed) {
|
|
394
394
|
sharedObj.dirtyCollapsingState = true;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
397
|
// Prepare existing sub segments for checking change in its members
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
398
|
+
let i;
|
|
399
|
+
let segmentName = "";
|
|
400
|
+
let nonExistenceGroups = {};
|
|
401
|
+
let removalCount = 0;
|
|
402
|
+
let segmentMap = this._subSegMap;
|
|
403
|
+
let segment = null;
|
|
404
404
|
if(segmentCount) {
|
|
405
405
|
removalCount = segmentCount;
|
|
406
406
|
for(i = 0; i < removalCount; ++i) {
|
|
@@ -419,21 +419,21 @@ Segment.prototype.classify = function(rows) {
|
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
// Loop through row children and assign them to their corresponding sub segment
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
422
|
+
let isRootSegment = !this._subSegLevel;
|
|
423
|
+
let rid;
|
|
424
|
+
let children = this._children;
|
|
425
425
|
if(this._subSegLevel < classifierCount && rows) {
|
|
426
426
|
if(!segmentMap) {
|
|
427
427
|
segmentMap = this._subSegMap = {};
|
|
428
428
|
segmentNames = this._subSegNames = [];
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
|
|
431
|
+
let classifier = classifiers[this._subSegLevel];
|
|
432
432
|
|
|
433
433
|
for(rid in children) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
434
|
+
let dataId = children[rid];
|
|
435
|
+
let record = rows[dataId];
|
|
436
|
+
let val = record ? record[classifier] : null; // WARNING: row could already be removed
|
|
437
437
|
|
|
438
438
|
sharedObj.childToSegment[rid] = this._rid; // Relocate child in case of it has been moved to a non existence group
|
|
439
439
|
|
|
@@ -482,7 +482,7 @@ Segment.prototype.classify = function(rows) {
|
|
|
482
482
|
segment = segmentMap[segmentName];
|
|
483
483
|
delete segmentMap[segmentName];
|
|
484
484
|
// TODO: Slow
|
|
485
|
-
|
|
485
|
+
let at = segmentNames.indexOf(segmentName);
|
|
486
486
|
if(at >= 0) {
|
|
487
487
|
segmentNames.splice(at, 1);
|
|
488
488
|
}
|
|
@@ -514,7 +514,7 @@ Segment.prototype.classify = function(rows) {
|
|
|
514
514
|
if(isRootSegment) { // If this is a root segment
|
|
515
515
|
if(this._subSegDef) {
|
|
516
516
|
if(segmentCount) {
|
|
517
|
-
|
|
517
|
+
let subSegments = this._subSegDef.subSegments = [];
|
|
518
518
|
this.getAllSubSegments(subSegments);
|
|
519
519
|
subSegments.forEach(Segment._assignSubSegmentOrder);
|
|
520
520
|
} else {
|
|
@@ -545,7 +545,7 @@ Segment.prototype.isSubSegment = function() {
|
|
|
545
545
|
*/
|
|
546
546
|
Segment.prototype.getFirstAncestor = function() {
|
|
547
547
|
if(this._subSegLevel && this._subSegDef) {
|
|
548
|
-
|
|
548
|
+
let ancestor = this._subSegDef.root;
|
|
549
549
|
return /** @type{Segment} */(ancestor) || null;
|
|
550
550
|
}
|
|
551
551
|
return null;
|
|
@@ -555,15 +555,15 @@ Segment.prototype.getFirstAncestor = function() {
|
|
|
555
555
|
* @return {Array.<Segment>}
|
|
556
556
|
*/
|
|
557
557
|
Segment.prototype.getAllSubSegments = function(out_ary) {
|
|
558
|
-
|
|
558
|
+
let segmentNames = this._subSegNames;
|
|
559
559
|
if(segmentNames) {
|
|
560
560
|
if(!out_ary) {
|
|
561
561
|
out_ary = [];
|
|
562
562
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
for(
|
|
566
|
-
|
|
563
|
+
let segmentMap = this._subSegMap;
|
|
564
|
+
let segmentCount = segmentNames.length;
|
|
565
|
+
for(let i = 0; i < segmentCount; ++i) {
|
|
566
|
+
let segment = segmentMap[segmentNames[i]];
|
|
567
567
|
out_ary.push(segment);
|
|
568
568
|
segment.getAllSubSegments(out_ary);
|
|
569
569
|
}
|
|
@@ -585,7 +585,7 @@ Segment.prototype.setRowData = function(rows, clsSource) {
|
|
|
585
585
|
if(!rows) {
|
|
586
586
|
return;
|
|
587
587
|
}
|
|
588
|
-
|
|
588
|
+
let row = rows[this._rid];
|
|
589
589
|
if(!row) {
|
|
590
590
|
row = rows[this._rid] = {};
|
|
591
591
|
}
|
|
@@ -598,7 +598,7 @@ Segment.prototype.setRowData = function(rows, clsSource) {
|
|
|
598
598
|
row = clsSource[this._rid] = {};
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
-
|
|
601
|
+
let segment = this;
|
|
602
602
|
while(segment && segment.isSubSegment()) {
|
|
603
603
|
segment.getSubSegmentName(row);
|
|
604
604
|
segment = segment._subSegParent;
|
|
@@ -610,8 +610,8 @@ Segment.prototype.setRowData = function(rows, clsSource) {
|
|
|
610
610
|
*/
|
|
611
611
|
Segment.prototype.getSubSegmentName = function(row) {
|
|
612
612
|
if(row && this._subSegLevel) {
|
|
613
|
-
|
|
614
|
-
|
|
613
|
+
let classifiers = this.getClassification();
|
|
614
|
+
let field = classifiers[this._subSegLevel - 1];
|
|
615
615
|
if(field) {
|
|
616
616
|
row[field] = this._subSegName;
|
|
617
617
|
}
|
|
@@ -651,7 +651,7 @@ Segment.prototype.isCollapsed = function() {
|
|
|
651
651
|
* @return {boolean}
|
|
652
652
|
*/
|
|
653
653
|
Segment.prototype.getCollapsingStates = function(objMap, parentState) {
|
|
654
|
-
|
|
654
|
+
let segmentNames = this._subSegNames;
|
|
655
655
|
if(!this._subSegLevel) { // Only root segment
|
|
656
656
|
if(!segmentNames) { // No sub segment
|
|
657
657
|
if(!this._collapsed) {
|
|
@@ -663,7 +663,7 @@ Segment.prototype.getCollapsingStates = function(objMap, parentState) {
|
|
|
663
663
|
if(!objMap) {
|
|
664
664
|
objMap = {};
|
|
665
665
|
}
|
|
666
|
-
|
|
666
|
+
let dirty = false;
|
|
667
667
|
if(this._subSegLevel) { // Sub segments are also subjected to collapsing
|
|
668
668
|
if(parentState) {
|
|
669
669
|
objMap[this._rid] = true;
|
|
@@ -671,20 +671,20 @@ Segment.prototype.getCollapsingStates = function(objMap, parentState) {
|
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
if(this._childCount) {
|
|
674
|
-
|
|
674
|
+
let collapsed = parentState || this._collapsed;
|
|
675
675
|
if(segmentNames) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
for(
|
|
679
|
-
|
|
676
|
+
let segmentMap = this._subSegMap;
|
|
677
|
+
let segmentCount = segmentNames.length;
|
|
678
|
+
for(let i = 0; i < segmentCount; ++i) {
|
|
679
|
+
let segment = segmentMap[segmentNames[i]];
|
|
680
680
|
objMap[segment.getId()] = !!parentState;
|
|
681
681
|
if(segment.getCollapsingStates(objMap, collapsed)) {
|
|
682
682
|
dirty = true;
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
685
|
} else if(collapsed) {
|
|
686
|
-
|
|
687
|
-
for(
|
|
686
|
+
let chdr = this._children;
|
|
687
|
+
for(let rid in chdr) {
|
|
688
688
|
objMap[rid] = collapsed;
|
|
689
689
|
}
|
|
690
690
|
dirty = true;
|
|
@@ -698,7 +698,7 @@ Segment.prototype.getCollapsingStates = function(objMap, parentState) {
|
|
|
698
698
|
*/
|
|
699
699
|
Segment.prototype.getOrder = function() {
|
|
700
700
|
if(this._subSegLevel) {
|
|
701
|
-
|
|
701
|
+
let ancestor = this.getFirstAncestor();
|
|
702
702
|
if(ancestor) {
|
|
703
703
|
// WARNING: this._order cannot be greater than 9999
|
|
704
704
|
return ancestor.getOrder() + this._order;
|
|
@@ -712,9 +712,9 @@ Segment.prototype.getOrder = function() {
|
|
|
712
712
|
*/
|
|
713
713
|
Segment.prototype.getLastOrder = function() {
|
|
714
714
|
if(this._subSegDef) {
|
|
715
|
-
|
|
715
|
+
let subSegments = this._subSegDef.subSegments;
|
|
716
716
|
if(subSegments) {
|
|
717
|
-
|
|
717
|
+
let lastSegment = subSegments[subSegments.length - 1];
|
|
718
718
|
if(lastSegment) {
|
|
719
719
|
return lastSegment.getOrder();
|
|
720
720
|
}
|
|
@@ -738,29 +738,29 @@ Segment._tabs = null;
|
|
|
738
738
|
* @return {Array.<string>} lines
|
|
739
739
|
*/
|
|
740
740
|
Segment.prototype.log = function(lines) {
|
|
741
|
-
|
|
742
|
-
|
|
741
|
+
let i;
|
|
742
|
+
let tabs = Segment._tabs;
|
|
743
743
|
if(!tabs) {
|
|
744
744
|
tabs = Segment._tabs = [];
|
|
745
|
-
|
|
745
|
+
let tabCh = "";
|
|
746
746
|
for(i = 0; i < 11; ++i) {
|
|
747
747
|
tabs[i] = tabCh;
|
|
748
748
|
tabCh += " ";
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
|
|
751
|
+
let collapsedCh = this._collapsed ? "+ " : "- ";
|
|
752
752
|
lines.push(tabs[this._subSegLevel] + collapsedCh + this._rid);
|
|
753
753
|
|
|
754
|
-
|
|
754
|
+
let segmentNames = this._subSegNames;
|
|
755
755
|
if(segmentNames) {
|
|
756
|
-
|
|
757
|
-
|
|
756
|
+
let segmentCount = segmentNames.length;
|
|
757
|
+
let segmentMap = this._subSegMap;
|
|
758
758
|
for(i = 0; i < segmentCount; ++i) {
|
|
759
759
|
segmentMap[segmentNames[i]].log(lines);
|
|
760
760
|
}
|
|
761
761
|
} else if(this._childCount) {
|
|
762
|
-
|
|
763
|
-
for(
|
|
762
|
+
let indent = tabs[this._subSegLevel + 1];
|
|
763
|
+
for(let rid in this._children) {
|
|
764
764
|
lines.push(indent + "- " + rid);
|
|
765
765
|
}
|
|
766
766
|
}
|