@refinitiv-ui/efx-grid 6.0.32 → 6.0.34

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.
Files changed (70) hide show
  1. package/lib/core/dist/core.js +197 -46
  2. package/lib/core/dist/core.min.js +1 -1
  3. package/lib/core/es6/data/DataTable.d.ts +1 -1
  4. package/lib/core/es6/data/DataTable.js +9 -8
  5. package/lib/core/es6/data/DataView.js +1 -1
  6. package/lib/core/es6/data/Segment.d.ts +2 -0
  7. package/lib/core/es6/data/Segment.js +16 -0
  8. package/lib/core/es6/data/SegmentCollection.d.ts +1 -3
  9. package/lib/core/es6/data/SegmentCollection.js +25 -18
  10. package/lib/core/es6/grid/Core.d.ts +4 -0
  11. package/lib/core/es6/grid/Core.js +27 -6
  12. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +1 -0
  13. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +36 -12
  14. package/lib/grid/index.js +1 -1
  15. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  16. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  17. package/lib/grid/themes/halo/efx-grid.less +2 -0
  18. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  19. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  20. package/lib/rt-grid/dist/rt-grid.js +945 -331
  21. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  22. package/lib/rt-grid/es6/ColumnDefinition.js +13 -8
  23. package/lib/rt-grid/es6/DataConnector.js +3 -2
  24. package/lib/rt-grid/es6/Grid.d.ts +3 -1
  25. package/lib/rt-grid/es6/Grid.js +130 -28
  26. package/lib/rt-grid/es6/RowDefinition.d.ts +7 -2
  27. package/lib/rt-grid/es6/RowDefinition.js +49 -11
  28. package/lib/rt-grid/es6/SnapshotFiller.d.ts +1 -0
  29. package/lib/rt-grid/es6/SnapshotFiller.js +1 -11
  30. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
  31. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +58 -30
  32. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +2 -0
  33. package/lib/tr-grid-column-stack/es6/ColumnStack.js +56 -22
  34. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +12 -5
  35. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +128 -42
  36. package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +3 -3
  37. package/lib/tr-grid-heat-map/es6/HeatMap.js +13 -2
  38. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +2 -1
  39. package/lib/tr-grid-row-dragging/es6/RowDragging.js +142 -17
  40. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +20 -20
  41. package/lib/tr-grid-textformatting/es6/TextFormatting.js +37 -138
  42. package/lib/tr-grid-util/es6/CellPainter.d.ts +1 -1
  43. package/lib/tr-grid-util/es6/CellPainter.js +56 -55
  44. package/lib/tr-grid-util/es6/FieldFormatter.js +6 -2
  45. package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +2 -0
  46. package/lib/tr-grid-util/es6/GroupDefinitions.js +15 -0
  47. package/lib/tr-grid-util/es6/NumberFormatter.js +23 -11
  48. package/lib/tr-grid-util/es6/Util.d.ts +6 -0
  49. package/lib/tr-grid-util/es6/Util.js +68 -0
  50. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
  51. package/lib/tr-grid-util/es6/jet/CollectionDict.js +12 -2
  52. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +170 -47
  53. package/lib/types/es6/ColumnGrouping.d.ts +4 -0
  54. package/lib/types/es6/ColumnSelection.d.ts +2 -0
  55. package/lib/types/es6/ColumnStack.d.ts +2 -0
  56. package/lib/types/es6/ConditionalColoring.d.ts +12 -5
  57. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  58. package/lib/types/es6/Core/data/SegmentCollection.d.ts +1 -3
  59. package/lib/types/es6/Core/grid/Core.d.ts +4 -0
  60. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +1 -0
  61. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +6 -2
  62. package/lib/types/es6/HeatMap.d.ts +3 -3
  63. package/lib/types/es6/RealtimeGrid/Grid.d.ts +3 -1
  64. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +7 -2
  65. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +1 -0
  66. package/lib/types/es6/RowDragging.d.ts +25 -2
  67. package/lib/types/es6/StatisticsRow.d.ts +25 -25
  68. package/lib/types/es6/TextFormatting.d.ts +20 -20
  69. package/lib/versions.json +7 -7
  70. package/package.json +1 -1
@@ -150,20 +150,22 @@ Ext.inherits = function (childCtor, parentCtor) {
150
150
 
151
151
  "use strict";
152
152
  /* unused harmony export Util */
153
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return extendObject; });
153
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return extendObject; });
154
154
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return cloneObject; });
155
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isEmptyObject; });
156
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return deepEqual; });
155
157
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayToObject; });
156
158
  /* unused harmony export extendProperty */
157
159
  /* unused harmony export extendArrayProperty */
158
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return parseCondition; });
159
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return prettifyCss; });
160
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return parseCondition; });
161
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return prettifyCss; });
160
162
  /* unused harmony export getShadowRoot */
161
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return injectCss; });
163
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return injectCss; });
162
164
  /* unused harmony export isIE */
163
165
  /* unused harmony export isMac */
164
166
  /* unused harmony export isTouchDevice */
165
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return nestedObjectToArray; });
166
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return rgb2Hex; });
167
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return nestedObjectToArray; });
168
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return rgb2Hex; });
167
169
  /* unused harmony export prepareTSVContent */
168
170
  /** @namespace */
169
171
  var Util = {};
@@ -305,6 +307,20 @@ var extendObject = function (obj, extender, limiters) {
305
307
  var cloneObject = function (obj, limiters) {
306
308
  return extendObject({}, obj, limiters);
307
309
  };
310
+
311
+ /** Check empty object
312
+ * @public
313
+ * @function
314
+ * @param {Object} obj
315
+ * @return {boolean}=true, if the obj is empty
316
+ */
317
+ var isEmptyObject = function (obj) {
318
+ for (var key in obj) {
319
+ return false;
320
+ }
321
+ return true;
322
+ };
323
+
308
324
  /** @public
309
325
  * @param {Array=} data
310
326
  * @param {Array.<string>=} fields In case of the given data is an array, this param will be used for mapping index to field
@@ -353,6 +369,58 @@ var extendProperty = function (obj, extender, propName) {
353
369
  }
354
370
  }
355
371
  };
372
+
373
+
374
+ /** Compare the values of obj1 and obj2. if they are the same object or have the same value, the result will be true. Otherwise, it will return false.
375
+ * @public
376
+ * @param {*} obj1
377
+ * @param {*} obj2
378
+ * @return {boolean}
379
+ */
380
+ var deepEqual = function (obj1, obj2) {
381
+
382
+ if(obj1 === obj2) {
383
+ return true;
384
+ }
385
+
386
+ if (typeof obj1 !== typeof obj2) {
387
+ return false;
388
+ }
389
+
390
+ if (typeof obj1 === "object") {
391
+
392
+ // We need to split array and object for performance reason
393
+ if(Array.isArray(obj1)) {
394
+ if(obj1.length !== obj2.length) {
395
+ return false;
396
+ }
397
+
398
+ for (var i = 0; i < obj1.length; i++) {
399
+ if (!deepEqual(obj1[i], obj2[i])) { // The array may not be a match if the elements are not sorted, so it will not be considered equal if there is a mismatch.
400
+ return false;
401
+ }
402
+ }
403
+
404
+ } else {
405
+
406
+ if (Object.keys(obj1).length !== Object.keys(obj2).length) {
407
+ return false;
408
+ }
409
+
410
+ for (var key in obj1) {
411
+ if (!deepEqual(obj1[key], obj2[key])) {
412
+ return false;
413
+ }
414
+ }
415
+ }
416
+
417
+
418
+ return true;
419
+ }
420
+
421
+ return false;
422
+
423
+ };
356
424
  /** Array.push() is much faster than Array.concat(). The downside is the parameters must be an array, whereas concat() has no such requirement. <br>
357
425
  * This method excels in extending known array property in an object.
358
426
  * @public
@@ -3475,7 +3543,7 @@ ElfUtil.injectIcons = function (configObj, optElem) {
3475
3543
  */
3476
3544
  ElfUtil.getIconList = function () {
3477
3545
  var iconStruct = ElfUtil._icons[ElfUtil.getThemeName()];
3478
- return iconStruct ? Object(Util["e" /* nestedObjectToArray */])(iconStruct) : [];
3546
+ return iconStruct ? Object(Util["g" /* nestedObjectToArray */])(iconStruct) : [];
3479
3547
  };
3480
3548
 
3481
3549
  /** @private
@@ -3767,9 +3835,9 @@ ElfUtil._retrieveThemeColors = function(profileName) {
3767
3835
  }
3768
3836
  }
3769
3837
  // WARNING: Computed styles return rgb/rgba color format instead of hex format
3770
- colors["tableBg"] = Object(Util["h" /* rgb2Hex */])(colors["tableBg"]);
3771
- colors["tableText"] = Object(Util["h" /* rgb2Hex */])(colors["tableText"]);
3772
- colors["tableBorder"] = Object(Util["h" /* rgb2Hex */])(colors["tableBorder"]);
3838
+ colors["tableBg"] = Object(Util["j" /* rgb2Hex */])(colors["tableBg"]);
3839
+ colors["tableText"] = Object(Util["j" /* rgb2Hex */])(colors["tableText"]);
3840
+ colors["tableBorder"] = Object(Util["j" /* rgb2Hex */])(colors["tableBorder"]);
3773
3841
  document.body.removeChild(tableElem);
3774
3842
 
3775
3843
  // For CellPainter backward compatability
@@ -10497,6 +10565,22 @@ Segment.prototype.getOrder = function() {
10497
10565
  }
10498
10566
  return this._order * 10000;
10499
10567
  };
10568
+ /** Get the last (highest) order from the entire tree regardless of the current position segment in the hierachy
10569
+ * @public
10570
+ * @return {number}
10571
+ */
10572
+ Segment.prototype.getLastOrder = function() {
10573
+ if(this._subSegDef) {
10574
+ var subSegments = this._subSegDef.subSegments;
10575
+ if(subSegments) {
10576
+ var lastSegment = subSegments[subSegments.length - 1];
10577
+ if(lastSegment) {
10578
+ return lastSegment.getOrder();
10579
+ }
10580
+ }
10581
+ }
10582
+ return this.getOrder();
10583
+ };
10500
10584
  /** @public
10501
10585
  * @param {number} val
10502
10586
  */
@@ -10618,9 +10702,10 @@ SegmentCollection.prototype.dispose = function() {
10618
10702
  };
10619
10703
  /** @public
10620
10704
  * @param {string} rid
10705
+ * @param {Array.<string>=} childRids Children of the newly added segment. This is a shorthand to addSegmentChildren method
10621
10706
  * @return {boolean} Returns true if there is any change. Otherwise, returns false
10622
10707
  */
10623
- SegmentCollection.prototype.addSegment = function(rid) {
10708
+ SegmentCollection.prototype.addSegment = function(rid, childRids) {
10624
10709
  if(rid && !this._segments[rid]) {
10625
10710
  if(this.getParentRowId(rid)) {
10626
10711
  console.log("child of a segment cannot be set as a segment separator");
@@ -10631,6 +10716,10 @@ SegmentCollection.prototype.addSegment = function(rid) {
10631
10716
  segment.addEventListener("subSegmentRemoved", this._onSubSegmentRemoved);
10632
10717
  ++this._segmentCount;
10633
10718
  this._segmentList = null; // order could be changed
10719
+
10720
+ if(childRids && childRids.length) {
10721
+ segment.addChildren(childRids);
10722
+ }
10634
10723
  return true;
10635
10724
  }
10636
10725
  return false;
@@ -10978,9 +11067,10 @@ SegmentCollection.prototype.calcSegmentOrder = function(rids) {
10978
11067
  };
10979
11068
  /** @public
10980
11069
  * @param {!Array.<string>} rids Array of row ids
11070
+ * @param {boolean=} partial Indicating that the given ids are not the whole list
10981
11071
  * @return {Array.<number>} Returns Array of segment values, if there are at least one segment, otherwise returns null
10982
- */
10983
- SegmentCollection.prototype.getSegmentValues = function(rids) {
11072
+ */ //
11073
+ SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
10984
11074
  var rowCount = rids ? rids.length : 0;
10985
11075
  if(!rowCount) {
10986
11076
  return null;
@@ -10997,29 +11087,30 @@ SegmentCollection.prototype.getSegmentValues = function(rids) {
10997
11087
  var rid = rids[r];
10998
11088
  curSegment = segmentSeparators[rid];
10999
11089
  if(curSegment) { // segment separator
11000
- if(prevSegment !== curSegment) {
11001
- prevSegment = curSegment;
11002
- segmentVal = curSegment.getOrder() * 100;
11003
- if(segmentVal > highestVal) {
11004
- highestVal = segmentVal;
11090
+ segmentVal = curSegment.getOrder() * 100;
11091
+ offset = 0;
11092
+ if(!curSegment.isSubSegment()) {
11093
+ if(prevSegment !== curSegment) {
11094
+ prevSegment = curSegment;
11095
+ highestVal = curSegment.getLastOrder() * 100;
11005
11096
  }
11006
11097
  }
11007
- offset = 0;
11008
11098
  } else {
11009
11099
  var parentId = childToSegmentId[rid];
11010
11100
  if(parentId) { // segment member
11011
11101
  curSegment = segmentSeparators[parentId];
11012
- if(prevSegment !== curSegment) {
11013
- prevSegment = curSegment;
11014
- segmentVal = curSegment.getOrder() * 100;
11015
- if(segmentVal > highestVal) {
11016
- highestVal = segmentVal;
11017
- }
11018
- }
11102
+ segmentVal = curSegment.getOrder() * 100;
11019
11103
  offset = 1;
11104
+ if(partial) {
11105
+ highestVal = curSegment.getLastOrder() * 100;
11106
+ }
11020
11107
  } else { // row outside of segments
11021
- segmentVal = highestVal;
11022
- offset = 10;
11108
+ if(highestVal) {
11109
+ segmentVal = highestVal;
11110
+ offset = 10;
11111
+ } else {
11112
+ segmentVal = offset = 0;
11113
+ }
11023
11114
  }
11024
11115
  }
11025
11116
 
@@ -12288,9 +12379,9 @@ DataTable.prototype.addSegmentChild = function(segmentId, rid, dataId) {
12288
12379
  if(this._segments) {
12289
12380
  var dirty = this._segments.addSegmentChild(segmentId, rid, dataId);
12290
12381
  if(dirty) {
12291
- if(this._sort(null)) {
12292
- this._dispatchPositionChange();
12293
- }
12382
+ this._sort(null);
12383
+ this._dispatchPositionChange(); // Force rerendering, even if there is no position change
12384
+
12294
12385
  this.requestClassifying();
12295
12386
  return true;
12296
12387
  }
@@ -12307,9 +12398,9 @@ DataTable.prototype.addSegmentChildren = function(segmentId, rids, dataIds) {
12307
12398
  if(this._segments) {
12308
12399
  var dirty = this._segments.addSegmentChildren(segmentId, rids, dataIds);
12309
12400
  if(dirty) {
12310
- if(this._sort(null)) {
12311
- this._dispatchPositionChange();
12312
- }
12401
+ this._sort(null);
12402
+ this._dispatchPositionChange(); // Force rerendering, even if there is no position change
12403
+
12313
12404
  this.requestClassifying();
12314
12405
  return true;
12315
12406
  }
@@ -13062,6 +13153,7 @@ DataTable._proto = DataTable.prototype;
13062
13153
  /** @typedef {Object} RowDefinition~Options
13063
13154
  * @description RowDefinition options
13064
13155
  * @property {string=} ric="" RIC for real-time fields. Prefixing 0# to the ric is equivalent to specifying asChain property.
13156
+ * @property {string=} permId="" Organization PermId to be used instead of ric for private company.
13065
13157
  * @property {(Array|Object)=} values=null Values for static data
13066
13158
  * @property {Array.<string>=} fields=null Field that corresponds to the given static values
13067
13159
  * @property {boolean=} asChain=false The given ric will be treated as a chain
@@ -13104,7 +13196,7 @@ var ROW_TYPES = {
13104
13196
  */
13105
13197
  var RowDefinition = function(rowOptions) {
13106
13198
  this._changes = {};
13107
- if(rowOptions && rowOptions["segmentId"]) {
13199
+ if(rowOptions && rowOptions["segmentId"]) { // This row will be classification header row
13108
13200
  this._dataId = this._rowId = rowOptions["segmentId"];
13109
13201
  this._autoGenerated = true;
13110
13202
  this._subSegment = true;
@@ -13143,6 +13235,10 @@ RowDefinition.prototype._ric = ""; // Contains no 0#
13143
13235
  /** @type {string}
13144
13236
  * @private
13145
13237
  */
13238
+ RowDefinition.prototype._permId = "";
13239
+ /** @type {string}
13240
+ * @private
13241
+ */
13146
13242
  RowDefinition.prototype._displayText = "";
13147
13243
  /** @type {string|null}
13148
13244
  * @private
@@ -13268,13 +13364,20 @@ RowDefinition.prototype.initialize = function(rowOptions) {
13268
13364
 
13269
13365
  var val = rowOptions["ric"];
13270
13366
  if(val != null) {
13271
- this.setContent(/** @type{string} */(val)); // this._dataId is modified
13367
+ this._ric = val;
13368
+ }
13369
+ val = rowOptions["permId"];
13370
+ if(val != null) {
13371
+ this._permId = val;
13372
+ }
13373
+ if(this._ric || this._permId){
13374
+ this.setContent(this._ric, this._permId); // this._dataId is modified
13272
13375
  }
13376
+
13273
13377
  val = rowOptions["chainRic"];
13274
13378
  if(val != null) {
13275
13379
  this._chainRic = val;
13276
13380
  }
13277
-
13278
13381
  val = rowOptions["values"];
13279
13382
  // eslint-disable-next-line no-undefined
13280
13383
  if(val !== undefined) {
@@ -13328,10 +13431,11 @@ RowDefinition.prototype._initializeAsConstituent = function(rowOptions) {
13328
13431
  }
13329
13432
  };
13330
13433
  /** @public
13331
- * @param {string} userInput
13434
+ * @param {string} userInput RIC
13435
+ * @param {string=} permId=null Organization PermId, which use for getting ADC data for private company
13332
13436
  * @return {boolean} True if there is any change otherwise false
13333
13437
  */
13334
- RowDefinition.prototype.setContent = function(userInput) {
13438
+ RowDefinition.prototype.setContent = function(userInput, permId) {
13335
13439
  if(this._autoGenerated) { // AutoGenerated RowDefinition cannot be changed by user input
13336
13440
  return false;
13337
13441
  }
@@ -13342,7 +13446,15 @@ RowDefinition.prototype.setContent = function(userInput) {
13342
13446
  userInput += "";
13343
13447
  }
13344
13448
 
13345
- if(this._userInput === userInput) {
13449
+ var dirty = (this._userInput !== userInput);
13450
+ if(this._permId !== permId){
13451
+ this._permId = permId || "";
13452
+ if(!userInput){
13453
+ this._displayText = this._permId;
13454
+ dirty = true;
13455
+ }
13456
+ }
13457
+ if(!dirty) {
13346
13458
  return false;
13347
13459
  }
13348
13460
 
@@ -13369,7 +13481,7 @@ RowDefinition.prototype.setContent = function(userInput) {
13369
13481
  this._displayText = this._ric; // No 0#
13370
13482
  }
13371
13483
 
13372
- this._dataId = this._rowId + this._ric; // JET/RTK will generate data id to be rowId (given from this rowDef) + ric;
13484
+ this._dataId = this._rowId + this.getSymbol(); // JET/RTK will generate data id to be rowId (given from this rowDef) + ric;
13373
13485
 
13374
13486
  // This will work for runtime ric modification, but not for first initilization.
13375
13487
  if(!this.subscribeForUpdates()) {
@@ -13397,6 +13509,11 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
13397
13509
  obj["ric"] = val;
13398
13510
  }
13399
13511
 
13512
+ val = this._permId;
13513
+ if(val) {
13514
+ obj["permId"] = val;
13515
+ }
13516
+
13400
13517
  val = this._chainRic;
13401
13518
  if(val) {
13402
13519
  obj["chainRic"] = val;
@@ -13642,6 +13759,18 @@ RowDefinition.prototype.getRic = function() {
13642
13759
  /** @public
13643
13760
  * @return {string}
13644
13761
  */
13762
+ RowDefinition.prototype.getPermId = function() {
13763
+ return this._permId;
13764
+ };
13765
+ /** @public
13766
+ * @return {string}
13767
+ */
13768
+ RowDefinition.prototype.getSymbol = function() {
13769
+ return this._ric || this._permId;
13770
+ };
13771
+ /** @public
13772
+ * @return {string}
13773
+ */
13645
13774
  RowDefinition.prototype.getDisplayText = function() {
13646
13775
  if(this._label != null) { // Empty string is allowed
13647
13776
  return this._label;
@@ -13707,7 +13836,7 @@ RowDefinition.prototype.isAutoGenerated = function() {
13707
13836
  * @return {boolean}
13708
13837
  */
13709
13838
  RowDefinition.prototype.isRealTimeRow = function() {
13710
- if(!this._ric) { // Empty row
13839
+ if(!this.getRic()) { // Empty row
13711
13840
  return false;
13712
13841
  }
13713
13842
  if(this.isRowHeader()) {
@@ -13724,7 +13853,7 @@ RowDefinition.prototype.isRealTimeRow = function() {
13724
13853
  * @return {boolean} If a subscription is made, return true.
13725
13854
  */
13726
13855
  RowDefinition.prototype.subscribeForUpdates = function() {
13727
- if(!this.isRealTimeRow()) {
13856
+ if(!this.isRealTimeRow() && !this.getPermId()) {
13728
13857
  return false;
13729
13858
  }
13730
13859
 
@@ -13738,14 +13867,14 @@ RowDefinition.prototype.subscribeForUpdates = function() {
13738
13867
  if(this.isChain()) {
13739
13868
  this._subId = subs["addChain"](this._chainRic || this._ric, this._rowId); // Some chain require 0# symbol to populate its constituents
13740
13869
  // TODO: Handle Dynamic chain such as .PG.PA
13741
- } else {
13870
+ } else if(this._ric) {
13742
13871
  this._subId = subs["addRic"](this._ric, this._rowId);
13743
13872
  }
13744
13873
 
13745
13874
  if(prevRowData) {
13746
13875
  this._dc.setRowData(this._dataId, prevRowData); // TODO: We may need to create a new object instead of prevRowData for data correctness
13747
13876
  } else {
13748
- this._dc.setRowData(this._dataId, {"X_RIC_NAME": this._ric, "ROW_DEF": this}); // Trigger data update immediately
13877
+ this._dc.setRowData(this._dataId, {"X_RIC_NAME": this.getSymbol(), "ROW_DEF": this}); // Trigger data update immediately
13749
13878
  }
13750
13879
  return true;
13751
13880
  };
@@ -15402,7 +15531,7 @@ ColumnDefinition.prototype.getAllFields = function() {
15402
15531
  * @return {boolean}
15403
15532
  */
15404
15533
  ColumnDefinition.prototype.isRealTimeField = function() {
15405
- return js_FieldDefinition.isRealTimeField(this.getField());
15534
+ return js_FieldDefinition.isRealTimeField(this.getField() || this._field);
15406
15535
  };
15407
15536
  /** @public
15408
15537
  * @return {boolean}
@@ -15593,8 +15722,9 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
15593
15722
  obj["sort"] = this._initialOrder;
15594
15723
  }
15595
15724
 
15596
- if(this._classes) {
15597
- obj["className"] = this._classes.join(" ");
15725
+ var classes = this._classes;
15726
+ if(classes && classes.length > 0) {
15727
+ obj["className"] = classes.join(" ");
15598
15728
  }
15599
15729
 
15600
15730
  if(this._textSelect) {
@@ -15612,14 +15742,18 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
15612
15742
  var core = this._eventArg["core"];
15613
15743
  var grid = this._eventArg["grid"];
15614
15744
  var colIndex = grid.getColumnIndex(this);
15615
- value = core.getColumnScalability(colIndex);
15616
- obj["scalable"] = value;
15617
15745
 
15618
- value = core.getColumnCustomLaneSize(colIndex);
15619
- obj["width"] = value;
15746
+ // The scalable, width and minWidth cannot be shifted into core as getConfigObject is accessible from colDef.
15747
+ var scalable = core.getColumnScalability(colIndex);
15748
+ var width = core.getColumnCustomLaneSize(colIndex);
15749
+
15750
+ if (scalable !== true || width !== 1) {
15751
+ obj["scalable"] = scalable;
15752
+ obj["width"] = width;
15753
+ }
15620
15754
 
15621
15755
  value = core.getMinimumColumnWidth(colIndex);
15622
- if(value !== 32) {
15756
+ if(value !== 0) {
15623
15757
  obj["minWidth"] = value;
15624
15758
  }
15625
15759
 
@@ -15976,16 +16110,6 @@ ColumnDefinition.prototype._setCoreColumnDef = function(obj) {
15976
16110
 
15977
16111
 
15978
16112
 
15979
- /** @private
15980
- * @param {Object} obj
15981
- * @return {boolean}
15982
- */
15983
- var isEmptyObject = function (obj) {
15984
- for (var key in obj) {
15985
- return false;
15986
- }
15987
- return true;
15988
- };
15989
16113
 
15990
16114
  /** This class make requesting ADC field easier by encapsulating JET.Data APIs and mapping data to the row
15991
16115
  * @constructor
@@ -16305,7 +16429,7 @@ SnapshotFiller.prototype._onJETSuccess = function (fields, serverResult) {
16305
16429
  var updatedData = {};
16306
16430
  for (ric in ricMap) {
16307
16431
  var obj = ricMap[ric];
16308
- if (!isEmptyObject(obj)) {
16432
+ if (!Object(Util["f" /* isEmptyObject */])(obj)) {
16309
16433
  updatedData[ric] = obj;
16310
16434
  }
16311
16435
  }
@@ -16378,7 +16502,7 @@ SnapshotFiller.prototype._onRTKSuccess = function (fields, serverResult) {
16378
16502
  var updatedData = {};
16379
16503
  for (ric in ricMap) {
16380
16504
  var obj = ricMap[ric];
16381
- if (!isEmptyObject(obj)) {
16505
+ if (!Object(Util["f" /* isEmptyObject */])(obj)) {
16382
16506
  updatedData[ric] = obj;
16383
16507
  }
16384
16508
  }
@@ -16448,7 +16572,7 @@ SnapshotFiller.prototype._onRTKTimeSeriesSuccess = function (fields, serverResul
16448
16572
  var dataMapping = {};
16449
16573
  for (ric in ricMap) {
16450
16574
  var obj = ricMap[ric];
16451
- if (!isEmptyObject(obj)) {
16575
+ if (!Object(Util["f" /* isEmptyObject */])(obj)) {
16452
16576
  dataMapping[ric] = obj;
16453
16577
  }
16454
16578
  }
@@ -17028,7 +17152,22 @@ GroupDefinitions.prototype.setGroupChildren = function (groupId, newChildList) {
17028
17152
  }
17029
17153
  return false;
17030
17154
  };
17155
+ /** @public
17156
+ * @param {string} groupId
17157
+ * @param {string} groupName
17158
+ * @return {boolean}
17159
+ */
17160
+ GroupDefinitions.prototype.setGroupName = function (groupId, groupName) {
17161
+ var groupDef = this._groupMap[groupId];
17162
+ if(groupDef) {
17163
+ if(groupDef.name !== groupName) {
17164
+ groupDef.name = groupName;
17165
+ return true;
17166
+ }
17167
+ }
17031
17168
 
17169
+ return false;
17170
+ };
17032
17171
  /* harmony default export */ var es6_GroupDefinitions = (GroupDefinitions);
17033
17172
 
17034
17173
 
@@ -20185,11 +20324,11 @@ ILayoutGrid.prototype.getHorizontalLayout = function () {};
20185
20324
  ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositions, outNoBorders) {};
20186
20325
  /** @public
20187
20326
  * @ignore
20188
- * @param {!Array.<number>} positions Left and right bound positions in pixel
20189
- * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
20327
+ * @param {!Array.<Array>} posAry Left and right bound positions in pixel
20328
+ * @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
20190
20329
  * @param {number=} topPx Top position of bound
20191
20330
  */
20192
- ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {};
20331
+ ILayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {};
20193
20332
 
20194
20333
  /* harmony default export */ var grid_ILayoutGrid = (ILayoutGrid);
20195
20334
 
@@ -21755,6 +21894,34 @@ SelectionList.prototype.deselect = function (at) {
21755
21894
  }
21756
21895
  return false;
21757
21896
  };
21897
+ /** Deselect all selections starting from the specified index
21898
+ * @public
21899
+ * @param {number} at
21900
+ * @return {boolean}
21901
+ */
21902
+ SelectionList.prototype.deselectFrom = function (at) {
21903
+ if(this._lastIndex < at) {
21904
+ return false;
21905
+ }
21906
+ if(this._firstIndex >= at) {
21907
+ this.clearAllSelections();
21908
+ return true;
21909
+ }
21910
+
21911
+ var lastIndex = this._lastIndex;
21912
+ var sels = this._selections;
21913
+ for(var i = at; i <= lastIndex; ++i) {
21914
+ if (sels[i]) {
21915
+ sels[at] = false;
21916
+ --this._count;
21917
+ }
21918
+ }
21919
+ if (this._anchor >= at) {
21920
+ this._anchor = -1; // No anchor
21921
+ }
21922
+ this._lastIndex = this._findPrevSelection(at);
21923
+ return true;
21924
+ };
21758
21925
  /** @public
21759
21926
  * @param {number} at
21760
21927
  */
@@ -21951,14 +22118,16 @@ SelectionList.prototype.getLastSelectedIndex = function() {
21951
22118
 
21952
22119
  /** WARNING: It will creates a new(EXPENSIVE) defragmented array of selected Index. The selected indices will always be sorted in ascending order
21953
22120
  * @public
21954
- * @return {Array.<number>}
22121
+ * @return {!Array.<number>}
21955
22122
  */
21956
22123
  SelectionList.prototype.getAllSelections = function() {
21957
22124
  if(this._count > 0) {
21958
22125
  var ary = new Array(this._count); // Fastest way to create an array
21959
22126
  var count = 0;
21960
- for(var i = this._firstIndex; i <= this._lastIndex; ++i) {
21961
- if(this._selections[i]) {
22127
+ var sels = this._selections;
22128
+ var lastIdx = this._lastIndex;
22129
+ for(var i = this._firstIndex; i <= lastIdx; ++i) {
22130
+ if(sels[i]) {
21962
22131
  ary[count++] = i;
21963
22132
  }
21964
22133
  }
@@ -21966,6 +22135,45 @@ SelectionList.prototype.getAllSelections = function() {
21966
22135
  }
21967
22136
  return [];
21968
22137
  };
22138
+ /** Get array of connected selection ranges. For intances, if indices 1, 2, 5, and 5 are selected, array of [1, 2] and [5, 5] are returned.
22139
+ * @public
22140
+ * @param {number=} from
22141
+ * @param {number=} to EXCLUSIVE
22142
+ * @return {!Array.<Array.<number>>}
22143
+ */
22144
+ SelectionList.prototype.getConnectedRanges = function(from, to) {
22145
+ if(this._count > 0) {
22146
+ var ary = [];
22147
+ if(from == null || from < this._firstIndex) {
22148
+ from = this._firstIndex;
22149
+ }
22150
+ if(to == null || to > this._lastIndex) {
22151
+ to = this._lastIndex + 1;
22152
+ }
22153
+
22154
+ var pair = null;
22155
+ for(var i = from; i < to; ++i) {
22156
+ if(this._selections[i]) {
22157
+ if(!pair) {
22158
+ pair = [i, -1];
22159
+ }
22160
+ } else if(pair) {
22161
+ pair[1] = i - 1;
22162
+ ary.push(pair);
22163
+ pair = null;
22164
+ }
22165
+ }
22166
+
22167
+ if(pair) {
22168
+ pair[1] = this._lastIndex;
22169
+ ary.push(pair);
22170
+ pair = null;
22171
+ }
22172
+ return ary;
22173
+ }
22174
+ return [];
22175
+ };
22176
+
21969
22177
  /**
21970
22178
  * @public
21971
22179
  * @return {Array.<boolean>}
@@ -21993,13 +22201,13 @@ SelectionList.prototype.clearAllSelections = function() {
21993
22201
  * @public
21994
22202
  * @param {SelectionList} srcSelections
21995
22203
  * @param {number} fromSrcIndex
21996
- * @param {number} offsetIndex
22204
+ * @param {number} offset Offset from the source index to map to destination index of this SelectionList. Use 0 if there is no shifting.
21997
22205
  * @param {number} forLength Positive value only. negative valie is not allowed
21998
22206
  */
21999
- SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offsetIndex, forLength) {
22207
+ SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset, forLength) {
22000
22208
  if (forLength <= 0) { return; }
22001
22209
 
22002
- var toThisIndex = fromSrcIndex + offsetIndex;
22210
+ var toThisIndex = fromSrcIndex + offset;
22003
22211
  if (srcSelections == null) {
22004
22212
  this.deselectRange(toThisIndex, forLength);
22005
22213
  return;
@@ -22020,7 +22228,7 @@ SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset
22020
22228
  this._anchor = -1;
22021
22229
  if (srcSelections._anchor >= 0) {
22022
22230
  if (srcSelections._anchor >= fromSrcIndex && srcSelections._anchor < (fromSrcIndex + forLength)) {
22023
- this._anchor = srcSelections._anchor + offsetIndex;
22231
+ this._anchor = srcSelections._anchor + offset;
22024
22232
  }
22025
22233
  }
22026
22234
  };
@@ -22239,7 +22447,8 @@ var Scrollbar = function () {
22239
22447
  t._element.appendChild(t._trackContent); // WARNING: trackContent is not registered as ElementWrapper's content
22240
22448
 
22241
22449
  t.disableKeyboardInput(false); // Enable keyboard input by default
22242
- Scrollbar._queryNativeTrackThickness(t._dispatch.bind(t, "thicknessChanged"));
22450
+ t._onThicknessChanged = t._dispatch.bind(t, "thicknessChanged");
22451
+ Scrollbar._queryNativeTrackThickness(t._onThicknessChanged);
22243
22452
 
22244
22453
  if(!t._updateEffectiveArea()) {
22245
22454
  t.listen("thicknessChanged", t._updateEffectiveArea);
@@ -22409,6 +22618,12 @@ Scrollbar.prototype._wheelScrolling = "";
22409
22618
  * @ignore
22410
22619
  */
22411
22620
  Scrollbar.prototype._mouseWheelLogic = null;
22621
+ /** @type {Function}
22622
+ * @private
22623
+ * @ignore
22624
+ */
22625
+ Scrollbar.prototype._onThicknessChanged = null;
22626
+
22412
22627
 
22413
22628
  /** @type {number}
22414
22629
  * @private
@@ -22516,6 +22731,7 @@ Scrollbar._retrieveNativeTrackThinkness = function () {
22516
22731
  outer.style.overflow = 'scroll';
22517
22732
  var w2 = inner.offsetWidth;
22518
22733
 
22734
+ // Sometimes, w1 may be equal to w2 on certain browsers or devices, such as a Macbook when opened on the built-in screen. In such cases, the outer.style.overflow scroll may not change the offsetWidth, and the outer.clientWidth will be the same as the inner offsetWidth. As a result, the native track thickness may not be found
22519
22735
  if(w1 == w2) {
22520
22736
  w2 = outer.clientWidth;
22521
22737
  }
@@ -22555,6 +22771,16 @@ Scrollbar.updateTrackThickness = function () {
22555
22771
 
22556
22772
  /** @override */
22557
22773
  Scrollbar.prototype.dispose = function () {
22774
+
22775
+ var sbListeners = Scrollbar._listeners;
22776
+ if(sbListeners) {
22777
+ var idx = sbListeners.indexOf(this._onThicknessChanged);
22778
+ if(idx >= 0 ) {
22779
+ sbListeners.splice(idx, 1);
22780
+ this._onThicknessChanged = null;
22781
+ }
22782
+ }
22783
+
22558
22784
  this.unlistenAll();
22559
22785
  if(this._smoothingId) {
22560
22786
  clearInterval(this._smoothingId);
@@ -24076,10 +24302,18 @@ LayoutGrid.prototype._ctxRows;
24076
24302
  * @private
24077
24303
  */
24078
24304
  LayoutGrid.prototype._boundLayer = null;
24079
- /** @type {Element}
24305
+ /** @type {Array.<Element>}
24080
24306
  * @private
24081
24307
  */
24082
- LayoutGrid.prototype._columnBound = null;
24308
+ LayoutGrid.prototype._colBounds = null;
24309
+ /** @type {Array.<Element>}
24310
+ * @private
24311
+ */
24312
+ LayoutGrid.prototype._colBoundCache = null;
24313
+ /** @type {boolean}
24314
+ * @private
24315
+ */
24316
+ LayoutGrid.prototype._colSelDirty = false;
24083
24317
  /** @type {HScrollbar}
24084
24318
  * @private
24085
24319
  */
@@ -24103,6 +24337,8 @@ LayoutGrid.prototype.dispose = function () {
24103
24337
  }
24104
24338
 
24105
24339
  this._colCount = this._rowCount = this._activeRowEnd = this._availableRowCount = 0;
24340
+ this._colBounds = this._colBoundCache = null;
24341
+ this._colSelDirty = false;
24106
24342
 
24107
24343
  this._highlightedCells.length = 0;
24108
24344
  this._ctx = null;
@@ -26044,16 +26280,15 @@ LayoutGrid.prototype.getContextRow = function (rowIndex) {
26044
26280
  LayoutGrid.prototype.selectColumn = function (colIndex, selected) {
26045
26281
  this.enableColumnClass(colIndex, "selected-column", selected);
26046
26282
 
26047
- var columnBound = this._columnBound;
26048
- if(!columnBound) {
26049
- columnBound = this._columnBound = document.createElement("div");
26050
- columnBound.className = "selection-bound column-bound";
26051
- }
26052
- var boundLayer = this._boundLayer;
26053
- if(!boundLayer) {
26054
- boundLayer = this._boundLayer = document.createElement("div");
26055
- boundLayer.className = "cover-layer";
26056
- this._updateLayers();
26283
+ if(selected) {
26284
+ this._colSelDirty = true;
26285
+
26286
+ var boundLayer = this._boundLayer;
26287
+ if(!boundLayer) {
26288
+ boundLayer = this._boundLayer = document.createElement("div");
26289
+ boundLayer.className = "cover-layer";
26290
+ this._updateLayers();
26291
+ }
26057
26292
  }
26058
26293
  };
26059
26294
  /** @public
@@ -26156,24 +26391,56 @@ LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositi
26156
26391
  };
26157
26392
  /** @public
26158
26393
  * @ignore
26159
- * @param {!Array.<number>} positions Left and right bound positions in pixel
26160
- * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
26394
+ * @param {!Array.<Array>} posAry Left and right bound positions in pixel
26395
+ * @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
26161
26396
  * @param {number=} topPx Top position of bound
26162
26397
  */
26163
- LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
26164
- var columnBound = this._columnBound;
26165
- if(!columnBound) {
26398
+ LayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {
26399
+ if(!this._colSelDirty) {
26166
26400
  return;
26167
26401
  }
26168
26402
 
26169
- var lftPx = positions[0];
26170
- var rgtPx = positions[1];
26171
- if(lftPx >= rgtPx) {
26172
- var pn = columnBound.parentNode;
26403
+ var cbs = this._colBounds;
26404
+ var cbc = this._colBoundCache;
26405
+ if(!cbs) {
26406
+ cbs = this._colBounds = [];
26407
+ }
26408
+ if(!cbc) {
26409
+ cbc = this._colBoundCache = [];
26410
+ }
26411
+
26412
+ var rangeCount = posAry.length;
26413
+ var i;
26414
+ var pn = null; // parentNode
26415
+ var columnBound = null;
26416
+
26417
+ // Remove unused bounds from document
26418
+ var activeCount = cbs.length;
26419
+ for(i = rangeCount; i < activeCount; ++i) {
26420
+ columnBound = cbs[i];
26421
+ pn = columnBound.parentNode;
26173
26422
  if(pn) {
26174
26423
  pn.removeChild(columnBound);
26175
26424
  }
26176
- } else {
26425
+ }
26426
+ cbs.length = activeCount = rangeCount;
26427
+
26428
+ if(!rangeCount) {
26429
+ this._colSelDirty = false;
26430
+ return;
26431
+ }
26432
+
26433
+ for(i = 0; i < rangeCount; ++i) {
26434
+ var positions = posAry[i];
26435
+ var noBorders = noBorderAry[i];
26436
+ var lftPx = /** @type{number} */(positions[0]);
26437
+ var rgtPx = /** @type{number} */(positions[1]);
26438
+
26439
+ columnBound = cbc[i];
26440
+ if(!columnBound) {
26441
+ columnBound = cbc[i] = document.createElement("div");
26442
+ columnBound.className = "selection-bound column-bound";
26443
+ }
26177
26444
  columnBound.style.left = lftPx + "px";
26178
26445
  columnBound.style.width = (rgtPx - lftPx) + "px";
26179
26446
 
@@ -26183,7 +26450,10 @@ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx)
26183
26450
  columnBound.classList.toggle("no-left-bound", noBorders[0]);
26184
26451
  columnBound.classList.toggle("no-right-bound", noBorders[1]);
26185
26452
  if(this._boundLayer) {
26186
- this._boundLayer.appendChild(columnBound);
26453
+ if(!cbs[i]) {
26454
+ cbs[i] = columnBound;
26455
+ this._boundLayer.appendChild(columnBound);
26456
+ }
26187
26457
  }
26188
26458
  }
26189
26459
  };
@@ -31691,7 +31961,7 @@ DataView.prototype._sort = function() {
31691
31961
  if(this._dt._getSegmentSeparators() || this.isSorting()) {
31692
31962
  var rids = this._rids;
31693
31963
  var dataRows = this._dt.getMultipleRowData(rids);
31694
- var segmentValues = this._dt.getSegmentValues(rids);
31964
+ var segmentValues = this._dt.getSegmentValues(rids, true); // WARNING: This does not work well for hidden/filtered rows
31695
31965
  var change = data_DataTable._performMultiLevelSorting(dataRows, this._sortingDefs, segmentValues);
31696
31966
 
31697
31967
  if(change) {
@@ -33691,10 +33961,18 @@ VirtualizedLayoutGrid.prototype._selectionList = null;
33691
33961
  * @private
33692
33962
  */
33693
33963
  VirtualizedLayoutGrid.prototype._reverter = null;
33694
- /** @type {Element}
33964
+ /** @type {Array.<Element>}
33965
+ * @private
33966
+ */
33967
+ VirtualizedLayoutGrid.prototype._rowBounds = null;
33968
+ /** @type {Array.<Element>}
33969
+ * @private
33970
+ */
33971
+ VirtualizedLayoutGrid.prototype._rowBoundCache = null;
33972
+ /** @type {boolean}
33695
33973
  * @private
33696
33974
  */
33697
- VirtualizedLayoutGrid.prototype._rowBound = null;
33975
+ VirtualizedLayoutGrid.prototype._rowSelDirty = false;
33698
33976
  /** @type {Element}
33699
33977
  * @private
33700
33978
  */
@@ -33760,6 +34038,9 @@ VirtualizedLayoutGrid.prototype.dispose = function () {
33760
34038
  this._grid.dispose();
33761
34039
  this._dispose();
33762
34040
  this._reverter.dispose();
34041
+
34042
+ this._rowBounds = this._rowBoundCache = null;
34043
+ this._rowSelDirty = false;
33763
34044
  if(this._rowBoundTimer) {
33764
34045
  clearTimeout(this._rowBoundTimer);
33765
34046
  this._rowBoundTimer = 0;
@@ -34211,9 +34492,10 @@ VirtualizedLayoutGrid.prototype.setSelectedRow = function (rowIndex, opt_selecte
34211
34492
  this._grid.setSelectedRow(rowIndex - this._firstIndex, selected);
34212
34493
 
34213
34494
  if(selected) {
34214
- this._initRowBounds();
34495
+ this._rowSelDirty = true;
34496
+ this._initBoundLayer();
34215
34497
  }
34216
- this._updateRowBounds();
34498
+ this._requestUpdatingRowBounds();
34217
34499
  };
34218
34500
 
34219
34501
  /** @inheritDoc */
@@ -34226,14 +34508,15 @@ VirtualizedLayoutGrid.prototype.selectSingleRow = function (rowIndex) {
34226
34508
  VirtualizedLayoutGrid.prototype.selectRowRange = function (rowIndex, length) {
34227
34509
  this._selectionList.selectRange(rowIndex, length);
34228
34510
  this._updateRowSelection();
34229
- this._initRowBounds();
34230
- this._updateRowBounds();
34511
+ this._rowSelDirty = true;
34512
+ this._initBoundLayer();
34513
+ this._requestUpdatingRowBounds();
34231
34514
  };
34232
34515
  /** @inheritDoc */
34233
34516
  VirtualizedLayoutGrid.prototype.clearSelectedRows = function () {
34234
34517
  var count = this._selectionList.clearAllSelections();
34235
34518
  this._grid.clearSelectedRows();
34236
- this._updateRowBounds();
34519
+ this._requestUpdatingRowBounds(); // WARNING: Row bounds are not removed from the document immediately
34237
34520
  return count;
34238
34521
  };
34239
34522
  /** @inheritDoc */
@@ -34675,12 +34958,12 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
34675
34958
  };
34676
34959
  /** @public
34677
34960
  * @ignore
34678
- * @param {!Array.<number>} positions Left and right bound positions in pixel
34679
- * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
34961
+ * @param {!Array.<Array>} posAry Left and right bound positions in pixel
34962
+ * @param {!Array.<Array>} noBorderAry Boolean values indicating existence of left and right CSS borders
34680
34963
  * @param {number=} topPx Top position of bound
34681
34964
  */
34682
- VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
34683
- this._grid.updateColumnBounds(positions, noBorders, topPx);
34965
+ VirtualizedLayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {
34966
+ this._grid.updateColumnBounds(posAry, noBorderAry, topPx);
34684
34967
  this._updateRowBounds();
34685
34968
  };
34686
34969
  /** @private
@@ -34695,16 +34978,6 @@ VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
34695
34978
  };
34696
34979
  /** @private
34697
34980
  */
34698
- VirtualizedLayoutGrid.prototype._initRowBounds = function () {
34699
- var rowBound = this._rowBound;
34700
- if(!rowBound) {
34701
- rowBound = this._rowBound = document.createElement("div");
34702
- rowBound.className = "selection-bound";
34703
- }
34704
- this._initBoundLayer();
34705
- };
34706
- /** @private
34707
- */
34708
34981
  VirtualizedLayoutGrid.prototype._requestUpdatingRowBounds = function () {
34709
34982
  if(!this._rowBoundTimer) {
34710
34983
  this._rowBoundTimer = setTimeout(this._updateRowBounds, 10);
@@ -34716,54 +34989,88 @@ VirtualizedLayoutGrid.prototype._updateRowBounds = function () {
34716
34989
  this._rowBoundTimer = 0;
34717
34990
  this._updateCellBounds();
34718
34991
 
34719
- var rowBound = this._rowBound;
34720
- if(!rowBound) {
34992
+ if(!this._rowSelDirty) {
34721
34993
  return;
34722
34994
  }
34723
- var topIdx = this.getFirstSelectedRow();
34724
- var btmIdx = -1; // Inclusive
34725
- var topPx = 0;
34726
- var btmPx = 0;
34727
- var rowCount = this._layoutY.getLaneCount();
34728
- if(topIdx >= rowCount) {
34729
- topIdx = rowCount - 1;
34995
+ var rbs = this._rowBounds;
34996
+ var rbc = this._rowBoundCache;
34997
+ if(!rbs) {
34998
+ rbs = this._rowBounds = [];
34730
34999
  }
34731
- if(topIdx >= 0) {
34732
- btmIdx = this.getLastSelectedRow();
34733
- if(btmIdx >= rowCount) {
34734
- btmIdx = rowCount - 1;
34735
- }
34736
- topPx = this._layoutY.getLaneStart(topIdx);
34737
- btmPx = this._layoutY.getLaneEnd(btmIdx);
35000
+ if(!rbc) {
35001
+ rbc = this._rowBoundCache = [];
34738
35002
  }
34739
35003
 
34740
- if(topPx >= btmPx) {
34741
- var pn = rowBound.parentNode;
35004
+ var selList = this._selectionList;
35005
+ var rowCount = this._layoutY.getLaneCount();
35006
+ selList.deselectFrom(rowCount); // TODO: move this to setRowCount
35007
+
35008
+ var selRanges = selList.getConnectedRanges();
35009
+ var rangeCount = selRanges.length;
35010
+ var i;
35011
+ var pn = null; // parentNode
35012
+ var rowBound = null;
35013
+
35014
+ // Remove unused bounds from document
35015
+ var activeCount = rbs.length;
35016
+ for(i = rangeCount; i < activeCount; ++i) {
35017
+ rowBound = rbs[i];
35018
+ pn = rowBound.parentNode;
34742
35019
  if(pn) {
34743
35020
  pn.removeChild(rowBound);
34744
35021
  }
34745
- } else {
35022
+ }
35023
+ rbs.length = activeCount = rangeCount;
35024
+
35025
+ if(!rangeCount) {
35026
+ var selCount = selList.getSelectionCount();
35027
+ if(!selCount) {
35028
+ this._rowSelDirty = false;
35029
+ }
35030
+ return;
35031
+ }
35032
+
35033
+ // Prepare shared parameters
35034
+ var scrollLeft = 0;
35035
+ var pinnedLftCount = 0;
35036
+ var pinnedRgtCount = 0;
35037
+ var endOfScroll = false;
35038
+ if(this._hscrollbar) {
35039
+ scrollLeft = this._hscrollbar.getScrollLeft();
35040
+ pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
35041
+ pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
35042
+ endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
35043
+ }
35044
+ var noLeftBound = !pinnedLftCount && scrollLeft > 0;
35045
+ var noRightBound = !pinnedRgtCount && !endOfScroll;
35046
+ var boundWidth = this._grid._getViewSize();
35047
+
35048
+ // Create row bound elements based on number of selection ranges
35049
+ for(i = 0; i < rangeCount; ++i) {
35050
+ var pair = selRanges[i];
35051
+ var topIdx = pair[0];
35052
+ var btmIdx = pair[1]; // Inclusive
35053
+ var topPx = this._layoutY.getLaneStart(topIdx);
35054
+ var btmPx = this._layoutY.getLaneEnd(btmIdx);
35055
+
35056
+ rowBound = rbc[i];
35057
+ if(!rowBound) {
35058
+ rowBound = rbc[i] = document.createElement("div");
35059
+ rowBound.className = "selection-bound";
35060
+ }
35061
+
34746
35062
  rowBound.style.top = topPx + "px";
34747
35063
  rowBound.style.height = (btmPx - topPx) + "px";
34748
-
34749
- var boundWidth = this._grid._getViewSize();
34750
35064
  rowBound.style.width = boundWidth + "px";
34751
35065
 
34752
- var scrollLeft = 0;
34753
- var pinnedLftCount = 0;
34754
- var pinnedRgtCount = 0;
34755
- var endOfScroll = false;
34756
- if(this._hscrollbar) {
34757
- scrollLeft = this._hscrollbar.getScrollLeft();
34758
- pinnedLftCount = this._hscrollbar.getPinnedLeftColumnCount();
34759
- pinnedRgtCount = this._hscrollbar.getPinnedRightColumnCount();
34760
- endOfScroll = this._hscrollbar.isEndOfHorizontalScroll();
34761
- }
34762
- rowBound.classList.toggle("no-left-bound", !pinnedLftCount && scrollLeft > 0);
34763
- rowBound.classList.toggle("no-right-bound", !pinnedRgtCount && !endOfScroll);
35066
+ rowBound.classList.toggle("no-left-bound", noLeftBound);
35067
+ rowBound.classList.toggle("no-right-bound", noRightBound);
34764
35068
 
34765
35069
  if(this._boundLayer) {
34766
- this._boundLayer.appendChild(rowBound);
35070
+ if(!rbs[i]) {
35071
+ rbs[i] = rowBound;
35072
+ this._boundLayer.appendChild(rowBound);
35073
+ }
34767
35074
  }
34768
35075
  }
34769
35076
  };
@@ -35408,7 +35715,7 @@ Core.prototype._groupDefs = null;
35408
35715
  * @return {string}
35409
35716
  */
35410
35717
  Core.getVersion = function () {
35411
- return "5.1.39";
35718
+ return "5.1.44";
35412
35719
  };
35413
35720
  /** {@link ElementWrapper#dispose}
35414
35721
  * @override
@@ -35544,10 +35851,10 @@ Core.prototype.getConfigObject = function (gridOptions) {
35544
35851
  }
35545
35852
  }
35546
35853
 
35547
- if(this._rowHighlighting) {
35548
- obj["rowHighlighting"] = true;
35549
- }
35550
- obj["columnVirtualization"] = this._colVirtualizer.isEnabled();
35854
+ // It will be overwrite in rt-grid or atlas-blotter
35855
+ obj["rowVirtualization"] = this.isRowVirtualizationEnabled();
35856
+ obj["columnVirtualization"] = this.isColumnVirtualizationEnabled();
35857
+ obj["rowHighlighting"] = this._rowHighlighting;
35551
35858
 
35552
35859
  if(this._fixFrozenTopSections) {
35553
35860
  obj["topFreezingCount"] = this._startVScrollbarIndex >= 0 ? (this._startVScrollbarIndex + 1) : false;
@@ -35560,7 +35867,13 @@ Core.prototype.getConfigObject = function (gridOptions) {
35560
35867
  if(this._rowScrollingStep) {
35561
35868
  obj["stepScroll"] = (this._rowScrollingStep === 1) ? true : this._rowScrollingStep;
35562
35869
  }
35563
- obj["autoHideScrollbar"] = this._vscrollbar.getAutoHide(); // this._hscrollbar has the same settings
35870
+
35871
+ var val = this._vscrollbar.getAutoHide();
35872
+ if(val !== true) {
35873
+ // TODO: check this._hscrollbar and this._vscrollbar can be difference config
35874
+ obj["autoHideScrollbar"] = val; // this._hscrollbar has the same settings
35875
+ }
35876
+
35564
35877
  var wheelSpeed = this._vscrollbar.getMouseWheelSpeed();
35565
35878
  if(wheelSpeed) {
35566
35879
  obj["linearWheelScrolling"] = wheelSpeed;
@@ -38533,6 +38846,14 @@ Core.prototype.enableRowVirtualization = function (opt_enabled) {
38533
38846
  this._rowVirtualizer.deactivate();
38534
38847
  }
38535
38848
  };
38849
+
38850
+ /** @public
38851
+ * @return {boolean}
38852
+ */
38853
+ Core.prototype.isRowVirtualizationEnabled = function () {
38854
+ return this._rowVirtualizer.isEnabled();
38855
+ };
38856
+
38536
38857
  /** No runtime support
38537
38858
  * @public
38538
38859
  * @param {boolean=} opt_enabled
@@ -38547,6 +38868,13 @@ Core.prototype.enableColumnVirtualization = function (opt_enabled) {
38547
38868
  }
38548
38869
  };
38549
38870
 
38871
+ /** @public
38872
+ * @return {boolean}
38873
+ */
38874
+ Core.prototype.isColumnVirtualizationEnabled = function () {
38875
+ return this._colVirtualizer.isEnabled();
38876
+ };
38877
+
38550
38878
  /** Scrolling step will be multiple of the default row height in pixels. For example, if default row height is 32 pixel and row scrolling step is 2, <br>
38551
38879
  * then the actual scrolling step for vertical scrollbar will be (32 * 2) = 64 pixels
38552
38880
  * @public
@@ -38934,47 +39262,72 @@ Core.prototype._updateColumnBounds = function () {
38934
39262
  return;
38935
39263
  }
38936
39264
 
39265
+ var sectCount = this._settings.length;
39266
+ if(!sectCount) {
39267
+ return;
39268
+ }
39269
+
39270
+ // Collecting column selection and selection ranges
39271
+ var selRanges = [];
39272
+ var pair = null;
38937
39273
  var colCount = this.getColumnCount();
38938
- var colIndices = [];
39274
+ var selIndices = [];
38939
39275
  var i;
38940
39276
  for(i = 0; i < colCount; i++) {
38941
39277
  if(this.isSelectedColumn(i)) {
38942
- colIndices.push(i);
39278
+ selIndices.push(i);
39279
+ if(!pair) {
39280
+ pair = [i, -1];
39281
+ }
39282
+ } else if(pair) {
39283
+ pair[1] = i - 1;
39284
+ selRanges.push(pair);
39285
+ pair = null;
38943
39286
  }
38944
39287
  }
39288
+ if(pair) {
39289
+ pair[1] = colCount - 1;
39290
+ selRanges.push(pair);
39291
+ pair = null;
39292
+ }
39293
+
38945
39294
  var arg = {
38946
- selectedColumns: colIndices
39295
+ "selectedColumns": selIndices,
39296
+ "selectionRanges": selRanges
38947
39297
  };
38948
39298
  this._dispatch("beforeColumnBoundUpdate", arg);
38949
39299
 
38950
- var len = this.getColumnCount();
38951
- var lftIdx = -1;
38952
- var rgtIdx = -1;
38953
- for(i = 0; i < len; ++i) {
38954
- if(this.isSelectedColumn(i)) {
38955
- rgtIdx = i;
38956
- if(lftIdx < 0) {
38957
- lftIdx = i;
38958
- }
38959
- }
38960
- }
38961
- var sectCount = this._settings.length;
38962
- if(sectCount) {
38963
- var sectionSetting = this._settings[0];
38964
- var section = sectionSetting.getSection();
39300
+ // Calculate position from ranges
39301
+ var rangeCount = selRanges.length;
39302
+ var posAry = [];
39303
+ var noBorderAry = [];
39304
+ var topSectionSettings = this._settings[0];
39305
+ var section = topSectionSettings.getSection();
39306
+ for(i = 0; i < rangeCount; ++i) {
39307
+ pair = selRanges[i];
38965
39308
  var positions = [0, 0];
38966
39309
  var noBorders = [false, false];
38967
- section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
38968
- var topPx = 0;
38969
- if(sectionSetting.getType() === "title" && arg.topBoundRowIndex != null) {
38970
- topPx = this._layoutY.getLaneStart(arg.topBoundRowIndex);
38971
- }
38972
- section.updateColumnBounds(positions, noBorders, topPx);
38973
- for(i = 1; i < sectCount; i++) {
38974
- section = this._settings[i].getSection();
38975
- section.updateColumnBounds(positions, noBorders);
39310
+ section.calculateColumnBounds(pair[0], pair[1], positions, noBorders);
39311
+ if(positions[0] < positions[1]) {
39312
+ posAry.push(positions);
39313
+ noBorderAry.push(noBorders);
38976
39314
  }
38977
39315
  }
39316
+
39317
+ // Render column bounds
39318
+ var topPx = 0;
39319
+ var topBoundIdx = -1;
39320
+ if(arg["topBoundRowIndex"] != null) {
39321
+ topBoundIdx = +arg["topBoundRowIndex"];
39322
+ }
39323
+ if(topBoundIdx >= 0 && topSectionSettings.getType() === "title") {
39324
+ topPx = this._layoutY.getLaneStart(topBoundIdx);
39325
+ }
39326
+ section.updateColumnBounds(posAry, noBorderAry, topPx);
39327
+ for(i = 1; i < sectCount; i++) {
39328
+ section = this._settings[i].getSection();
39329
+ section.updateColumnBounds(posAry, noBorderAry);
39330
+ }
38978
39331
  };
38979
39332
 
38980
39333
  /** @public
@@ -40538,7 +40891,7 @@ StyleLoader.chainIcon = '';
40538
40891
  /** @type {string}
40539
40892
  * @public
40540
40893
  */
40541
- StyleLoader.styles = Object(Util["g" /* prettifyCss */])([
40894
+ StyleLoader.styles = Object(Util["i" /* prettifyCss */])([
40542
40895
  ".tr-grid .chain-icon", [
40543
40896
  "cursor: pointer;"
40544
40897
  ],
@@ -40561,7 +40914,7 @@ StyleLoader.styles = Object(Util["g" /* prettifyCss */])([
40561
40914
  StyleLoader.applyStyle = function (grid) {
40562
40915
  if (grid && !grid._rowGroupingStyles) { // TODO: Support run-time theme loading
40563
40916
  grid._rowGroupingStyles = true; // Prevent loading the same style twice
40564
- Object(Util["d" /* injectCss */])(StyleLoader.styles, grid.getElement());
40917
+ Object(Util["e" /* injectCss */])(StyleLoader.styles, grid.getElement());
40565
40918
  }
40566
40919
  };
40567
40920
 
@@ -40899,7 +41252,7 @@ DataConnector.prototype.getRowDefByRic = function (ric) {
40899
41252
  * @return {boolean} True if new reference is added.
40900
41253
  */
40901
41254
  DataConnector.prototype.addRic = function (rowDef) {
40902
- var ric = rowDef ? rowDef.getRic() : "";
41255
+ var ric = rowDef ? rowDef.getSymbol() : "";
40903
41256
  if(!ric) {
40904
41257
  return false;
40905
41258
  }
@@ -40927,7 +41280,8 @@ DataConnector.prototype.addRic = function (rowDef) {
40927
41280
  */
40928
41281
  DataConnector.prototype.removeRic = function (rowDef, ric) {
40929
41282
  if(!ric) {
40930
- ric = rowDef ? rowDef.getRic() : "";
41283
+ // TODO: RIC or permId maybe change during run-time, need to check before remove RIC/permId
41284
+ ric = rowDef ? rowDef.getSymbol() : "";
40931
41285
  }
40932
41286
  if(!ric) {
40933
41287
  return;
@@ -41234,6 +41588,7 @@ RowDefSorter.prototype._rowDefSorter = function(rowDefA, rowDefB, order) {
41234
41588
 
41235
41589
 
41236
41590
 
41591
+
41237
41592
  /* eslint-enable */
41238
41593
 
41239
41594
  /** Fired when user click and before the sorting operation.
@@ -41693,7 +42048,10 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
41693
42048
  }
41694
42049
  field = opt["field"];
41695
42050
  if (field) {
41696
- col["sortBy"] = field;
42051
+ if(col["field"] !== field) {
42052
+ col["sortBy"] = field;
42053
+ } // else The default value is an empty sortBy, which refers to the same column field by default.
42054
+
41697
42055
  if (this._sortingSequenceMap && this._sortingSequenceMap[field]) {
41698
42056
  col["sortingSequence"] = this._sortingSequenceMap[field];
41699
42057
  }
@@ -41706,16 +42064,32 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
41706
42064
  extOptions = obj["sorting"] = {};
41707
42065
  }
41708
42066
 
41709
- extOptions["initialSort"] = this.getSortedColumns();
41710
- extOptions["sortableIndicator"] = this._sortableIndicator;
42067
+ var val = this.getSortedColumns();
42068
+ if(val != null) {
42069
+ extOptions["initialSort"] = val;
42070
+ }
42071
+
42072
+ val = this._sortableIndicator;
42073
+ if(val !== false) {
42074
+ extOptions["sortableIndicator"] = val;
42075
+ }
42076
+
41711
42077
  if(this._maxCount !== 1) {
41712
42078
  extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
41713
42079
  }
41714
42080
  if(this._dblClickAllowed) {
41715
42081
  extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
41716
42082
  }
41717
- extOptions["sortableColumns"] = this._sortableColumns;
41718
- extOptions["indicatorOnly"] = !this._dataSorting;
42083
+
42084
+ val = this._sortableColumns;
42085
+ if(val !== true) {
42086
+ extOptions["sortableColumns"] = val;
42087
+ }
42088
+
42089
+ val = this._dataSorting;
42090
+ if(val !== true) {
42091
+ extOptions["indicatorOnly"] = val;
42092
+ }
41719
42093
  // extOptions["mode"] = this._mode;
41720
42094
  if(this._disabled) {
41721
42095
  extOptions["disabled"] = true;
@@ -41732,6 +42106,10 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
41732
42106
  extOptions["sortingSequence"] = sortingSeq.slice();
41733
42107
  }
41734
42108
 
42109
+ if(Object(Util["f" /* isEmptyObject */])(obj["sorting"])) {
42110
+ delete obj["sorting"];
42111
+ }
42112
+
41735
42113
  return obj;
41736
42114
  };
41737
42115
 
@@ -44012,7 +44390,7 @@ Grid.prototype.initialize = function(gridOption) {
44012
44390
  if(rows[n]["values"]) { // merge row's values, values can be object or array
44013
44391
  values = Object(Util["a" /* arrayToObject */])(rows[n]["values"], fields);
44014
44392
  data = Object(Util["a" /* arrayToObject */])(ary[n], fields);
44015
- rows[n]["values"] = Object(Util["c" /* extendObject */])(values, data);
44393
+ rows[n]["values"] = Object(Util["d" /* extendObject */])(values, data);
44016
44394
  } else {
44017
44395
  rows[n]["values"] = ary[n];
44018
44396
  }
@@ -44074,6 +44452,28 @@ Grid.prototype.getConfigObject = function (gridOptions) {
44074
44452
  grid.getConfigObject(obj);
44075
44453
  }
44076
44454
 
44455
+ // Difference from composite grid in default config
44456
+ if(obj["columnVirtualization"] === false) {
44457
+ delete obj["columnVirtualization"];
44458
+ }
44459
+
44460
+ if(obj["rowVirtualization"] === true) {
44461
+ delete obj["rowVirtualization"];
44462
+ }
44463
+
44464
+ if(obj["rowHighlighting"] === true) {
44465
+ delete obj["rowHighlighting"];
44466
+ }
44467
+
44468
+ if(obj["contentVerticalLines"] === false) { // the default value change in wrapper (atlas-blotter)
44469
+ delete obj["contentVerticalLines"];
44470
+ }
44471
+
44472
+ if(obj["borders"] === false) { // the default value change in wrapper (atlas-blotter)
44473
+ delete obj["borders"];
44474
+ }
44475
+
44476
+
44077
44477
  var i, len;
44078
44478
  len = this.getColumnCount();
44079
44479
  for (i = 0; i < len; ++i) {
@@ -44098,12 +44498,12 @@ Grid.prototype.getConfigObject = function (gridOptions) {
44098
44498
  }
44099
44499
 
44100
44500
  val = grid.getDefaultRowHeight();
44101
- if(val !== 32) {
44501
+ if(val !== 28) { // the default value change in wrapper (atlas-blotter)
44102
44502
  obj["rowHeight"] = val;
44103
44503
  }
44104
44504
 
44105
44505
  val = grid.getSection("title").getDefaultRowHeight();
44106
- if(val !== 32) {
44506
+ if(val !== 28) { // the default value change in wrapper (atlas-blotter)
44107
44507
  obj["headerRowHeight"] = val;
44108
44508
  }
44109
44509
 
@@ -44111,7 +44511,8 @@ Grid.prototype.getConfigObject = function (gridOptions) {
44111
44511
  obj["autoLayoutUpdate"] = true;
44112
44512
  }
44113
44513
 
44114
- if (this._defaultColumnOptions) {
44514
+ val = Object(Util["f" /* isEmptyObject */])(this._defaultColumnOptions);
44515
+ if (!val) { // Currently, this variable is the object, we need to check empty array for default value
44115
44516
  obj["defaultColumnOptions"] = this._defaultColumnOptions;
44116
44517
  }
44117
44518
 
@@ -44170,10 +44571,13 @@ Grid.prototype.getConfigObject = function (gridOptions) {
44170
44571
  }
44171
44572
 
44172
44573
  // TODO: The following states need to be retrieved
44173
- // rowHighlighting
44174
- // columnVirtualization
44175
44574
  // topFreezingCount, bottomFreezingCount
44176
44575
  // scrollbarParent
44576
+ // linearWheelScrolling
44577
+ // stepScroll
44578
+ // noColumnDragging
44579
+ // columnReorder
44580
+ // topSection
44177
44581
 
44178
44582
  // NOTE: no need to export synapseApiKey, ADC and RTK
44179
44583
 
@@ -44249,7 +44653,7 @@ Grid.prototype._onRicAdded = function(e) {
44249
44653
  var jLen = rowDefs ? rowDefs.length : 0;
44250
44654
  for (var j = 0; j < jLen; ++j) {
44251
44655
  var rowDef = rowDefs[j];
44252
- if (rowDef.getRic() === ric) {
44656
+ if (rowDef.getSymbol() === ric) {
44253
44657
  this._snapshot.addRic(ric); // ADC
44254
44658
  }
44255
44659
  }
@@ -44274,7 +44678,7 @@ Grid.prototype._onFieldAdded = function(e) {
44274
44678
 
44275
44679
  // ADC
44276
44680
  for (var i in rowDefs) {
44277
- this._snapshot.addRic(rowDefs[i].getRic());
44681
+ this._snapshot.addRic(rowDefs[i].getSymbol());
44278
44682
  }
44279
44683
  this._snapshot.addFields(addedFields);
44280
44684
 
@@ -44468,7 +44872,7 @@ Grid.prototype.replaceColumn = function (columnOption, colRef) {
44468
44872
  colConfig["width"] = value;
44469
44873
 
44470
44874
  value = core.getMinimumColumnWidth(colIndex);
44471
- if(value !== 32) {
44875
+ if(value > 0) {
44472
44876
  colConfig["minWidth"] = value;
44473
44877
  }
44474
44878
 
@@ -44622,6 +45026,79 @@ Grid.prototype.setColumns = function(columns) {
44622
45026
  }
44623
45027
  }
44624
45028
  };
45029
+
45030
+
45031
+ /** Remove, add and keep column based on the given column data
45032
+ * @public
45033
+ * @param {Array.<Object>} columns Array of column options
45034
+ */
45035
+ Grid.prototype.restoreColumns = function(columns) {
45036
+ var configObj = this.getConfigObject();
45037
+ var previousColumns = configObj.columns;
45038
+
45039
+ var preColLen = previousColumns.length;
45040
+ var newColLen = columns.length;
45041
+
45042
+ var removingFields = [];
45043
+ var keepingColumns = [];
45044
+ var columnOrdering = [];
45045
+
45046
+ var i, j, found;
45047
+ // Slow, time complexity BigO(n ^ 2)
45048
+ for (i = 0; i < preColLen; i++) {
45049
+ found = false;
45050
+ for (j = 0; j < newColLen; j++) {
45051
+ if (Object(Util["c" /* deepEqual */])(previousColumns[i], columns[j])) {
45052
+ keepingColumns.push(previousColumns[i]);
45053
+ found = true;
45054
+ break;
45055
+ }
45056
+ }
45057
+ if (!found) {
45058
+ removingFields.push(previousColumns[i].field);
45059
+ }
45060
+ }
45061
+
45062
+ var sortingStates;
45063
+ var removeLen = removingFields.length;
45064
+ if(removeLen > 0 && this._stp) {
45065
+ sortingStates = this._stp.getSortingStates().slice(); // We need to clone array for avoid object reference in remove column
45066
+ }
45067
+
45068
+ this.removeColumns(removingFields);
45069
+
45070
+ var keepingLen = keepingColumns.length;
45071
+ var prevState = false;
45072
+ if(newColLen > 1) {
45073
+ prevState = this._grid.freezeLayout(true); // Insert multiple columns can be a huge time consuming
45074
+ }
45075
+ for (i = 0; i < newColLen; i++) {
45076
+ found = false;
45077
+ for (j = 0; j < keepingLen; j++) { // loop only keeping column
45078
+ if (Object(Util["c" /* deepEqual */])(columns[i], keepingColumns[j])) {
45079
+ found = true;
45080
+ var colIndex = this.getColumnIndex(columns[i].field); // We cannot use 'i' (colIndex) in this case, as it will sort the columns. Instead, we need to obtain a new column index from the field.
45081
+ columnOrdering.push(this.getColumnId(colIndex));
45082
+ break;
45083
+ }
45084
+ }
45085
+ if (!found) {
45086
+ this.insertColumn(columns[i], i);
45087
+ columnOrdering.push(this.getColumnId(i)); // Use new insertion column index
45088
+ }
45089
+ }
45090
+
45091
+ if(newColLen > 1) {
45092
+ this._grid.freezeLayout(prevState);
45093
+ }
45094
+
45095
+ if(removeLen > 0 && this._stp) {
45096
+ this._stp.sortColumns(sortingStates);
45097
+ }
45098
+
45099
+ this._grid.reorderColumns(columnOrdering);
45100
+ };
45101
+
44625
45102
  /** Remove all existing columns and add new columns based on the given texts/fields
44626
45103
  * @public
44627
45104
  * @function
@@ -44766,10 +45243,11 @@ Grid.prototype.removeColumn = function(colRef) {
44766
45243
  this._dc.removeStaticFields([colDef.getField()]);
44767
45244
  }
44768
45245
  }
44769
- colDef.dispose();
44770
- this._grid.removeColumnAt(colIndex);
44771
45246
 
45247
+ this._grid.removeColumnAt(colIndex);
44772
45248
  this._connector.removeFields(colDef);
45249
+
45250
+ colDef.dispose(); // Dispose at the last line to avoid making properties inaccessible
44773
45251
  // TODO: Remove fields that are related to the column (e.g. fields for coloring)
44774
45252
  };
44775
45253
  /** Remove multiple columns through array. To remove all columns, use removeAllColumns() instead of this method
@@ -45115,7 +45593,7 @@ Grid.prototype.setColumnSorter = function(colRef, func) {
45115
45593
  * @param {RowDefinition} rowDef
45116
45594
  */
45117
45595
  Grid.prototype._initDuplicateRicData = function(rowDef) {
45118
- var ric = rowDef.getRic();
45596
+ var ric = rowDef.getSymbol();
45119
45597
  var rowDefs = this._connector.getRowDefByRic(ric);
45120
45598
  if(rowDefs && rowDefs.length) {
45121
45599
  cloneRowData(rowDefs[0], rowDef);
@@ -45349,7 +45827,7 @@ Grid.prototype.removeRow = function(rowRef) {
45349
45827
  if(this._mainGrid) {
45350
45828
  return this._mainGrid.removeRow(this._getRowId(rowRef));
45351
45829
  }
45352
- var rowDef = this._getRowDefinition(rowRef);
45830
+ var rowDef = this._getRowDefinitionByRef(rowRef);
45353
45831
  if(rowDef) {
45354
45832
  if(!rowDef.isAutoGenerated()) { // Users cannot remove auto-generated row by themselves
45355
45833
  this._removeRow(rowDef);
@@ -45380,7 +45858,7 @@ Grid.prototype.removeRows = function(rowRefs) {
45380
45858
 
45381
45859
  // Verify user input
45382
45860
  for(i = 0; i < len; ++i) {
45383
- rowDef = this._getRowDefinition(rowRefs[i]);
45861
+ rowDef = this._getRowDefinitionByRef(rowRefs[i]);
45384
45862
  if(rowDef) {
45385
45863
  if(!rowDef.isAutoGenerated()) {
45386
45864
  rowDefs.push(rowDef);
@@ -45516,7 +45994,7 @@ Grid.prototype.setRic = function(rowRef, str, options) {
45516
45994
  this._mainGrid.setRic(this._toRowId(rowRef), str);
45517
45995
  return;
45518
45996
  }
45519
- var rowDef = this._getRowDefinition(rowRef);
45997
+ var rowDef = this._getRowDefinitionByRef(rowRef);
45520
45998
  if(rowDef) {
45521
45999
  options = options || {};
45522
46000
  var newChain = false;
@@ -45532,8 +46010,9 @@ Grid.prototype.setRic = function(rowRef, str, options) {
45532
46010
  this.insertRow(options, rowIndex);
45533
46011
  }
45534
46012
  } else {
45535
- var oldRic = rowDef.getRic();
45536
- if(rowDef.setContent(str)) { // The given string may not be a RIC
46013
+ var oldRic = rowDef.getSymbol();
46014
+ var permId = options["permId"] || "";
46015
+ if(rowDef.setContent(str, permId)) { // The given string may not be a RIC
45537
46016
  this._connector.removeRic(rowDef, oldRic);
45538
46017
  this._initDuplicateRicData(rowDef);
45539
46018
  this._connector.addRic(rowDef);
@@ -45551,7 +46030,7 @@ Grid.prototype.setRic = function(rowRef, str, options) {
45551
46030
  * @param {Grid~RowReference} rowRef
45552
46031
  */
45553
46032
  Grid.prototype.unlinkChain = function(rowRef) {
45554
- var rowDef = this._getRowDefinition(rowRef);
46033
+ var rowDef = this._getRowDefinitionByRef(rowRef);
45555
46034
  if(!rowDef) {
45556
46035
  return;
45557
46036
  }
@@ -45730,7 +46209,8 @@ Grid.prototype.getRowType = function(rowRef) {
45730
46209
  var rowDef = this.getRowDefinition(rowRef);
45731
46210
  return rowDef ? rowDef.getType() : "";
45732
46211
  };
45733
- /** @public
46212
+ /** Get RowDefinition object by either number or row id
46213
+ * @public
45734
46214
  * @param {number|string} rowRef Row index as shown in the view or row id (string)
45735
46215
  * @return {RowDefinition}
45736
46216
  */
@@ -45760,7 +46240,7 @@ Grid.prototype._getRowDefinitionById = function(rowId) {
45760
46240
  * @param {Grid~RowReference} rowRef
45761
46241
  * @return {RowDefinition}
45762
46242
  */
45763
- Grid.prototype._getRowDefinition = function(rowRef) {
46243
+ Grid.prototype._getRowDefinitionByRef = function(rowRef) {
45764
46244
  if(rowRef instanceof RowDefinition) {
45765
46245
  if(rowRef.getRowId()) { // The row may have been removed from the grid
45766
46246
  return /** @type{!RowDefinition} */(rowRef);
@@ -45853,7 +46333,7 @@ Grid.prototype.setRicData = function(ric, values) {
45853
46333
  var rowCount = rowDefs ? rowDefs.length : 0;
45854
46334
  for (var i = 0; i < rowCount; ++i) {
45855
46335
  var rowDef = rowDefs[i];
45856
- if (rowDef && rowDef.getRic() === ric) {
46336
+ if (rowDef && rowDef.getSymbol() === ric) {
45857
46337
  rowDef.setRowData(values); // TODO: Need conflator to improve performance
45858
46338
  }
45859
46339
  }
@@ -45864,7 +46344,7 @@ Grid.prototype.setRicData = function(ric, values) {
45864
46344
  * @param {Object} values {"FIELD1": value1, "FIELD2": value2, ...} Use null to remove current row data (not row in the view).
45865
46345
  */
45866
46346
  Grid.prototype.setRowData = function(rowRef, values) {
45867
- var rowDef = this._getRowDefinition(rowRef);
46347
+ var rowDef = this._getRowDefinitionByRef(rowRef);
45868
46348
  if(rowDef) {
45869
46349
  rowDef.setRowData(values);
45870
46350
  }
@@ -45876,7 +46356,7 @@ Grid.prototype.setRowData = function(rowRef, values) {
45876
46356
  * @param {Object} values
45877
46357
  */
45878
46358
  Grid.prototype.setStaticRowData = function(rowRef, values) {
45879
- var rowDef = this._getRowDefinition(rowRef);
46359
+ var rowDef = this._getRowDefinitionByRef(rowRef);
45880
46360
  if(rowDef) {
45881
46361
  rowDef.setStaticRowData(values);
45882
46362
  }
@@ -45889,7 +46369,7 @@ Grid.prototype.setStaticRowData = function(rowRef, values) {
45889
46369
  * @param {*} value
45890
46370
  */
45891
46371
  Grid.prototype.setStaticData = function(rowRef, field, value) {
45892
- var rowDef = this._getRowDefinition(rowRef);
46372
+ var rowDef = this._getRowDefinitionByRef(rowRef);
45893
46373
  if(rowDef) {
45894
46374
  rowDef.setStaticData(field, value);
45895
46375
  }
@@ -46239,7 +46719,7 @@ Grid.prototype._onDataChanged = function(e) {
46239
46719
  // The new data update has no row definition, meaning that we have found a new constituent from a chain.
46240
46720
  var subId = rowData[SUB_ID]; // The constituent will share the same sub id as its parent
46241
46721
  if(subId) {
46242
- var parentDef = this._getRowDefinition(subId);
46722
+ var parentDef = this._getRowDefinitionById(subId);
46243
46723
  if(parentDef && parentDef.getRic() !== rowData["RIC"]) { // TODO: Check for delayed ric
46244
46724
  if(!this._chainMembers) {
46245
46725
  this._chainMembers = {};
@@ -46271,7 +46751,7 @@ Grid.prototype._addMemberOfChain = function(rowData) {
46271
46751
  for(i = 0; i < len; ++i) {
46272
46752
  rowData = /** @type{!Object} */(rows[i]);
46273
46753
  var subId = rowData[SUB_ID];
46274
- var parentDef = this._getRowDefinition(subId);
46754
+ var parentDef = this._getRowDefinitionById(subId);
46275
46755
  if(parentDef) {
46276
46756
  var childDef = parentDef.addConstituent(/** @type{string} */(rowData["RIC"]), this._dt);
46277
46757
  if(childDef) {
@@ -46417,7 +46897,7 @@ Grid.prototype.getPageCount = function() {
46417
46897
  * @param {Grid~RowReference} rowRef
46418
46898
  */
46419
46899
  Grid.prototype.toggleChain = function(rowRef) {
46420
- var rowDef = this._getRowDefinition(rowRef);
46900
+ var rowDef = this._getRowDefinitionByRef(rowRef);
46421
46901
  if(rowDef) {
46422
46902
  rowDef.toggleChain();
46423
46903
  }
@@ -46429,7 +46909,7 @@ Grid.prototype.toggleChain = function(rowRef) {
46429
46909
  * @return {boolean}
46430
46910
  */
46431
46911
  Grid.prototype.setClassification = function(rowRef, fields) {
46432
- var rowDef = this._getRowDefinition(rowRef);
46912
+ var rowDef = this._getRowDefinitionByRef(rowRef);
46433
46913
  if(rowDef) {
46434
46914
  return this._dt.setSegmentClassification(rowDef.getRowId(), fields);
46435
46915
  }
@@ -48163,7 +48643,9 @@ MockSubscription.prototype._getUpdateData = function(ric) {
48163
48643
 
48164
48644
 
48165
48645
  // CONCATENATED MODULE: ./node_modules/tr-grid-util/es6/jet/CollectionDict.js
48166
- /** @constructor */
48646
+ /** @description CollectionDict stores a collection (Array) of any value using a text (string) as a key for accessing the collection.
48647
+ * @constructor
48648
+ */
48167
48649
  var CollectionDict = function() {
48168
48650
  this._dict = {};
48169
48651
  };
@@ -48290,9 +48772,17 @@ CollectionDict.prototype.getAllItems = function() {
48290
48772
  return null;
48291
48773
  };
48292
48774
  /** @public
48775
+ * @param {string=} key
48293
48776
  * @return {number}
48294
48777
  */
48295
- CollectionDict.prototype.getItemCount = function() {
48778
+ CollectionDict.prototype.getItemCount = function(key) {
48779
+ if(key) {
48780
+ var items = this._dict[key] || null;
48781
+ if(items) {
48782
+ return items.length;
48783
+ }
48784
+ return 0;
48785
+ }
48296
48786
  return this._count;
48297
48787
  };
48298
48788
  /** @public
@@ -48525,6 +49015,7 @@ MockSubscriptions.prototype.removeSubscription = function(subId) {
48525
49015
  child["parent"] = null;
48526
49016
  }
48527
49017
  sub["children"] = null;
49018
+ sub["ricList"] = null;
48528
49019
  }
48529
49020
  };
48530
49021
  /** @public
@@ -48591,9 +49082,9 @@ MockSubscriptions.prototype.start = function() {
48591
49082
  /** @public */
48592
49083
  MockSubscriptions.prototype.stop = function() {
48593
49084
  this._working = false;
48594
- if(this._timerId >= 0) {
49085
+ if(this._timerId) {
48595
49086
  window.clearTimeout(this._timerId);
48596
- this._timerId = -1;
49087
+ this._timerId = 0;
48597
49088
  }
48598
49089
  };
48599
49090
 
@@ -48726,26 +49217,55 @@ MockSubscriptions.prototype._addSymbol = function(ric, asChain, subId) {
48726
49217
  sub["ric"] = ric;
48727
49218
  sub["chain"] = asChain;
48728
49219
  sub["id"] = subId;
48729
- sub["dataId"] = subId + sub["ric"];
49220
+ sub["dataId"] = subId + ric;
48730
49221
  this._subMap[subId] = sub; // Collect all user subscriptions
48731
- this._dataMap.addItem(sub["ric"], sub);
49222
+ this._dataMap.addItem(ric, sub);
49223
+ var subs = this._dataMap.getItems(ric);
49224
+ var subCount = subs.length;
49225
+
49226
+ this._dispatch("subscriptionAdded", {"subs": [sub]});
49227
+
49228
+ var childSub = null;
49229
+ var childCount = 0;
49230
+ var i;
48732
49231
  if(asChain) {
48733
- sub["children"] = [];
48734
- var childCount = MockSubscriptions.simpleDigest(ric) % 10 + 4;
48735
- for(var i = 0; i < childCount; ++i) {
48736
- // Note that constituents should have no subscription object. They should share the same subscription as their parent. Hence we does not register it to the _subMap
48737
- var childSub = {};
48738
- childSub["ric"] = "Child_" + String.fromCharCode(65 + i);
48739
- childSub["id"] = subId; // Child shares the same sub id as its chain parent
48740
- childSub["dataId"] = subId + childSub["ric"];
48741
- childSub["parent"] = sub; // This does not exist in real subscription
48742
- sub["children"].push(childSub);
49232
+ // Note that constituents should have no subscription object. They should share the same subscription as their parent. Hence we does not register it to the _subMap
49233
+ if(subCount === 1) { // The first chain detected
49234
+ sub["children"] = [];
49235
+ childCount = MockSubscriptions.simpleDigest(ric) % 10 + 4;
49236
+ for(i = 0; i < childCount; ++i) {
49237
+ childSub = {};
49238
+ childSub["ric"] = "Child_" + String.fromCharCode(65 + i);
49239
+ childSub["id"] = subId; // Child shares the same sub id as its chain parent
49240
+ childSub["dataId"] = subId + childSub["ric"];
49241
+ childSub["parent"] = sub; // This does not exist in real subscription
49242
+ sub["children"].push(childSub);
49243
+
49244
+ this._dataMap.addItem(_joinSubKeys(sub, childSub), childSub);
49245
+ }
49246
+ } else {
49247
+ var firstSub = subs[0];
49248
+ var constituents = firstSub["children"];
49249
+ childCount = constituents.length;
49250
+ sub["children"] = new Array(childCount);
48743
49251
 
48744
- this._dataMap.addItem(_joinSubKeys(sub, childSub), childSub);
49252
+ for(i = 0; i < childCount; ++i) {
49253
+ childSub = {};
49254
+ childSub["ric"] = constituents[i]["ric"];
49255
+ childSub["id"] = subId; // Child shares the same sub id as its chain parent
49256
+ childSub["dataId"] = subId + childSub["ric"];
49257
+ childSub["parent"] = sub; // This does not exist in real subscription
49258
+ sub["children"][i] = childSub;
49259
+
49260
+ this._dataMap.addItem(_joinSubKeys(sub, childSub), childSub);
49261
+ }
49262
+ }
49263
+ }
49264
+ if(subCount > 1) { // Duplicate RIC/CHAIN detected
49265
+ if(this._working) {
49266
+ setTimeout(this._updateDuplicateSymbol.bind(this, ric), 10);
48745
49267
  }
48746
49268
  }
48747
-
48748
- this._dispatch("subscriptionAdded", {"subs": [sub]});
48749
49269
 
48750
49270
  this._connect();
48751
49271
  return subId;
@@ -48765,14 +49285,15 @@ MockSubscriptions.simpleDigest = function(str) {
48765
49285
 
48766
49286
  /** @private */
48767
49287
  MockSubscriptions.prototype._connect = function() {
48768
- if(!this._working || this._timerId >= 0) { return; }
48769
- var delay = this._dataGen.randInt(this._minInterval, this._maxInterval);
48770
- this._timerId = window.setTimeout(this._onSubscriptionResponse, delay);
49288
+ if(this._working && !this._timerId) {
49289
+ var delay = this._dataGen.randInt(this._minInterval, this._maxInterval);
49290
+ this._timerId = window.setTimeout(this._onSubscriptionResponse, delay);
49291
+ }
48771
49292
  };
48772
49293
 
48773
49294
  /** @private */
48774
49295
  MockSubscriptions.prototype._onSubscriptionResponse = function() {
48775
- this._timerId = -1;
49296
+ this._timerId = 0;
48776
49297
 
48777
49298
  var keys = this._dataMap.getAllKeys(); // list of all rics
48778
49299
  var len = keys ? keys.length : 0;
@@ -48786,34 +49307,14 @@ MockSubscriptions.prototype._onSubscriptionResponse = function() {
48786
49307
  var maxRow = (this._percentageDataUpdate + 0.02) * len;
48787
49308
  maxRow = maxRow < len ? maxRow : len; // not more than all rows
48788
49309
  var numRows = this._dataGen.randInt(minRow, maxRow);
49310
+ var fields = this._fields;
48789
49311
 
48790
49312
  for(var i = 0; i < numRows; i++) {
48791
49313
  var key = keys[this._dataGen.randIndex(len)]; // WARNING: Same sub could be picked more than once
48792
- var subs = this._dataMap.getItems(key);
48793
-
48794
- var sub = subs[0];
48795
- var ric = sub.ric;
48796
- var prevData = sub.prevData;
48797
-
48798
- var values = {};
48799
- var options = {
48800
- text: ric,
48801
- prefix: sub["parent"] ? sub["parent"]["ric"] : ""
48802
- };
48803
- for(var field in this._fields){
48804
- var data = this._dataGen.generateQuoteData(field, options);
48805
- if(prevData) {
48806
- if(data.changeOnly) {
48807
- if(prevData[field] === data.value) {
48808
- continue;
48809
- }
48810
- }
48811
- prevData[field] = data.value;
48812
- }
49314
+ var subs = this._dataMap.getItems(key); // Get all subs with the same RIC
48813
49315
 
48814
- values[field] = data.value;
48815
- values[field + "_FORMATTED"] = data.formattedValue;
48816
- }
49316
+ var sub = subs[0]; // Only the first sub is need to generate data
49317
+ var values = this._generateQuoteData(sub, fields);
48817
49318
 
48818
49319
  var jLen = subs.length;
48819
49320
  for(var j = 0; j < jLen; ++j) {
@@ -48825,6 +49326,109 @@ MockSubscriptions.prototype._onSubscriptionResponse = function() {
48825
49326
  };
48826
49327
  /** @private
48827
49328
  * @param {Object} sub
49329
+ * @param {Object} fields
49330
+ * @return {!Object}
49331
+ */
49332
+ MockSubscriptions.prototype._generateQuoteData = function(sub, fields) {
49333
+ var ric = sub.ric;
49334
+ var prevData = sub.prevData;
49335
+
49336
+ var values = {};
49337
+ var options = {
49338
+ text: ric,
49339
+ prefix: sub["parent"] ? sub["parent"]["ric"] : "" // prefix for constituents
49340
+ };
49341
+ for(var field in fields){
49342
+ var data = this._dataGen.generateQuoteData(field, options);
49343
+ var formattedField = field + "_FORMATTED";
49344
+ if(prevData) {
49345
+ if(data.changeOnly) {
49346
+ if(prevData[field] === data.value) {
49347
+ continue;
49348
+ }
49349
+ }
49350
+ prevData[field] = data.value;
49351
+ prevData[formattedField] = data.formattedValue;
49352
+ }
49353
+
49354
+ values[field] = data.value;
49355
+ values[formattedField] = data.formattedValue;
49356
+ }
49357
+ return values;
49358
+ };
49359
+
49360
+
49361
+ /** @private
49362
+ * @param {Object} parentSub
49363
+ * @param {string} ric
49364
+ * @return {Object}
49365
+ */
49366
+ MockSubscriptions.prototype._getChildSubByRic = function(parentSub, ric) {
49367
+ var children = parentSub["children"];
49368
+ if(children) {
49369
+ var childCount = children.length;
49370
+ for(var i = 0; i < childCount; ++i) {
49371
+ var child = children[i];
49372
+ if(child["ric"] === ric) {
49373
+ return child;
49374
+ }
49375
+ }
49376
+ }
49377
+ return null;
49378
+ };
49379
+ /** @private
49380
+ * @param {string} ric
49381
+ */
49382
+ MockSubscriptions.prototype._updateDuplicateSymbol = function(ric) {
49383
+ var subs = this._dataMap.getItems(ric);
49384
+ if(!subs) {
49385
+ return;
49386
+ }
49387
+ var subCount = subs.length;
49388
+ if(subCount < 2) {
49389
+ return;
49390
+ }
49391
+ var firstSub = subs[0];
49392
+ var prevData = firstSub["prevData"];
49393
+ var isChain = firstSub["chain"] ? true : false;
49394
+ var i;
49395
+ if(prevData) {
49396
+ for(i = 1; i < subCount; ++i) {
49397
+ var sub = subs[i];
49398
+ if(!sub["prevData"]) {
49399
+ this._dispatchDataChanged(sub, prevData);
49400
+ }
49401
+ }
49402
+ }
49403
+
49404
+
49405
+ if(!isChain) {
49406
+ return;
49407
+ }
49408
+ var ricList = firstSub["ricList"];
49409
+ if(!ricList) {
49410
+ return;
49411
+ }
49412
+ var childCount = ricList.length;
49413
+
49414
+ for(i = 1; i < subCount; ++i) {
49415
+ var sub2 = subs[i];
49416
+ var ricList2 = sub2["ricList"];
49417
+ var childCount2 = ricList2 ? ricList2.length : 0;
49418
+ for(var j = childCount2; j < childCount; ++j) {
49419
+ var childRic = ricList[j];
49420
+ var childSub = this._getChildSubByRic(firstSub, childRic);
49421
+ var childSub2 = this._getChildSubByRic(sub2, childRic);
49422
+ if(childSub && childSub2) {
49423
+ if(childSub["prevData"]) {
49424
+ this._dispatchDataChanged(childSub2, childSub["prevData"]);
49425
+ }
49426
+ }
49427
+ }
49428
+ }
49429
+ };
49430
+ /** @private
49431
+ * @param {Object} sub
48828
49432
  * @param {Object} dataUpdates
48829
49433
  */
48830
49434
  MockSubscriptions.prototype._dispatchDataChanged = function(sub, dataUpdates) {
@@ -48844,6 +49448,15 @@ MockSubscriptions.prototype._dispatchDataChanged = function(sub, dataUpdates) {
48844
49448
  values["STATUS_FORMATTED"] = this._statusMap["1"];
48845
49449
  values["SUB_ID"] = sub["id"];
48846
49450
  copyValues(values, prevData);
49451
+
49452
+ var parentSub = sub.parent;
49453
+ if(parentSub) { // This is the first time constituent have the data
49454
+ var ricList = parentSub["ricList"];
49455
+ if(!ricList) {
49456
+ ricList = parentSub["ricList"] = [];
49457
+ }
49458
+ parentSub["ricList"].push(sub["ric"]);
49459
+ }
48847
49460
  }
48848
49461
  this._dispatch("dataChanged", evtArg);
48849
49462
  };
@@ -48901,7 +49514,7 @@ MockSubscriptions.prototype._working = false;
48901
49514
  /** @type {number}
48902
49515
  * @private
48903
49516
  */
48904
- MockSubscriptions.prototype._timerId = -1;
49517
+ MockSubscriptions.prototype._timerId = 0;
48905
49518
 
48906
49519
  /** @type {number}
48907
49520
  * @private
@@ -49637,7 +50250,7 @@ CellPainter.themeReady = null;
49637
50250
  * var fn = CellPainter.parse("[CF_BID] >= 10 && [CF_BID] <= 100");
49638
50251
  * window.console.log(fn(25));
49639
50252
  */
49640
- CellPainter.parse = Util["f" /* parseCondition */];
50253
+ CellPainter.parse = Util["h" /* parseCondition */];
49641
50254
 
49642
50255
 
49643
50256
  /** @public */
@@ -49735,25 +50348,17 @@ CellPainter.prototype.clearHeatMap = function() {
49735
50348
  /** @public */
49736
50349
  CellPainter.prototype.applyThemeColor = function() {
49737
50350
  var colors = ElfUtil.getColors();
49738
- var cond = this._conditions[0]; // Heatmap, color text condition must be the first
49739
- if(cond) {
49740
- if(this._coloringType === CellPainter.ColoringTypes.HEATMAP) { // Heatmap uses grid color to blend the result color
50351
+ if(this._coloringType === CellPainter.ColoringTypes.HEATMAP) { // Heatmap uses grid color to blend the result color
50352
+ var cond = this._conditions[0]; // Heatmap, color text condition must be the first
50353
+ if(cond) {
49741
50354
  if(cond["textMode"]) {
49742
50355
  cond["baseColor"] = colors["baseText"];
49743
50356
  } else {
49744
50357
  cond["baseColor"] = colors["baseGrid"];
49745
50358
  }
49746
- }
49747
- if(cond["useThemeColor"]) { // Only heatmap and colorText painters use theme color
49748
- if(this._coloringType === CellPainter.ColoringTypes.HEATMAP || this._coloringType === CellPainter.ColoringTypes.TEXT) {
49749
- var up, down;
49750
- if(this._coloringType === CellPainter.ColoringTypes.TEXT && cond["field"] === "CF_TICK") {
49751
- up = colors["tickUp"];
49752
- down = colors["tickDown"];
49753
- } else {
49754
- up = colors["up"];
49755
- down = colors["down"];
49756
- }
50359
+ if(cond["useThemeColor"]) {
50360
+ var up = colors["up"];
50361
+ var down = colors["down"];
49757
50362
  var level = (colors["level"] === colors["baseText"]) ? "" : colors["level"];
49758
50363
  CellPainter._setUpDownColors(cond, up, down, level);
49759
50364
  }
@@ -49872,34 +50477,36 @@ CellPainter.prototype.addHeatmapWithTheme = function(field, midPoint, opt_textMo
49872
50477
  /** @private
49873
50478
  * @param {Function} expression
49874
50479
  * @param {string} field
49875
- * @param {string} upColor
49876
- * @param {string} downColor
49877
- * @param {string} levelColor
50480
+ * @param {string=} upClass CSS class name
50481
+ * @param {string=} downClass CSS class name
50482
+ * @param {string=} levelClass CSS class name
49878
50483
  * @return {!Object}
49879
50484
  */
49880
- CellPainter.prototype._addColorText = function(expression, field, upColor, downColor, levelColor) {
50485
+ CellPainter.prototype._addColorText = function(expression, field, upClass, downClass, levelClass) {
49881
50486
  this._setColoringType(CellPainter.ColoringTypes.TEXT);
49882
50487
 
49883
50488
  var condition = {};
49884
50489
  condition["field"] = field;
49885
50490
  condition["expression"] = expression.bind(null, field);
49886
- CellPainter._setUpDownColors(condition, upColor, downColor, levelColor);
50491
+ condition["upClass"] = upClass;
50492
+ condition["downClass"] = downClass;
50493
+ condition["levelClass"] = levelClass;
49887
50494
 
49888
50495
  this._addCondition(condition);
49889
50496
  return condition;
49890
50497
  };
49891
50498
  /** @public
49892
50499
  * @param {string} field
49893
- * @param {string} upColor
49894
- * @param {string} downColor
49895
- * @param {string} levelColor
50500
+ * @param {string=} upClass CSS class name
50501
+ * @param {string=} downClass CSS class name
50502
+ * @param {string=} levelClass CSS class name
49896
50503
  * @return {!Object}
49897
50504
  */
49898
- CellPainter.prototype.addColorText = function(field, upColor, downColor, levelColor) {
50505
+ CellPainter.prototype.addColorText = function(field, upClass, downClass, levelClass) {
49899
50506
  return this._addColorText(
49900
50507
  TickFields[field] ? CellPainter._tickColorTextCondition : CellPainter._colorTextCondition,
49901
50508
  field,
49902
- upColor, downColor, levelColor
50509
+ upClass, downClass, levelClass
49903
50510
  );
49904
50511
  };
49905
50512
  /** @public
@@ -49907,14 +50514,7 @@ CellPainter.prototype.addColorText = function(field, upColor, downColor, levelCo
49907
50514
  * @return {!Object}
49908
50515
  */
49909
50516
  CellPainter.prototype.addColorTextWithTheme = function(field) {
49910
- var colors = ElfUtil.themeColors;
49911
- var condition = this.addColorText(field,
49912
- colors["up"],
49913
- colors["down"],
49914
- (colors["level"] === colors["baseText"]) ? "" : colors["level"]
49915
- );
49916
-
49917
- condition["useThemeColor"] = true;
50517
+ var condition = this.addColorText(field, "positive", "negative", "neutral");
49918
50518
  return condition;
49919
50519
  };
49920
50520
  /** @public
@@ -50016,14 +50616,16 @@ CellPainter.prototype.renderForPrinting = function(cell, rowData, min, max) {
50016
50616
  return;
50017
50617
  }
50018
50618
  var styles = this._getStyles(rowData, min, max);
50019
- var cssClass = styles["cssClass"];
50020
- if (cssClass) {
50021
- if (cell._coloringCssClass !== cssClass) {
50022
- cell.classList.remove(cell._coloringCssClass);
50023
- cell._coloringCssClass = null;
50619
+ var cssClass = styles["cssClass"]; // Can be an empty string
50620
+ if (cssClass != null) { // Predefined colors mode
50621
+ if (elem._coloringCssClass && elem._coloringCssClass !== cssClass) {
50622
+ elem.classList.remove(elem._coloringCssClass);
50623
+ elem._coloringCssClass = null;
50624
+ }
50625
+ if (cssClass) {
50626
+ elem.classList.add(cssClass);
50627
+ elem._coloringCssClass = cssClass;
50024
50628
  }
50025
- cell.classList.add(cssClass);
50026
- cell._coloringCssClass = cssClass;
50027
50629
  } else {
50028
50630
  if (cell._coloringCssClass) {
50029
50631
  cell.classList.remove(cell._coloringCssClass);
@@ -50156,14 +50758,17 @@ CellPainter._cellRestorer = function(scope) {
50156
50758
  }
50157
50759
 
50158
50760
  var styles = this._getStyles(rowData, min, max);
50159
- var cssClass = styles["cssClass"];
50160
- if (cssClass) {
50761
+ var cssClass = styles["cssClass"]; // Can be an empty string
50762
+ if (cssClass != null) { // Predefined colors mode
50161
50763
  if (elem._coloringCssClass && elem._coloringCssClass !== cssClass) {
50162
50764
  elem.classList.remove(elem._coloringCssClass);
50163
50765
  elem._coloringCssClass = null;
50164
50766
  }
50165
- elem.classList.add(cssClass);
50166
- elem._coloringCssClass = cssClass;
50767
+ if (cssClass) {
50768
+ elem.classList.add(cssClass);
50769
+ elem._coloringCssClass = cssClass;
50770
+ }
50771
+ // Remove blinking color
50167
50772
  elem.style.backgroundColor = "";
50168
50773
  elem.style.color = "";
50169
50774
  } else {
@@ -50218,13 +50823,14 @@ CellPainter.prototype._getStyles = function(rowData, min, max) {
50218
50823
  }
50219
50824
  } else if(this._coloringType === CellPainter.ColoringTypes.TEXT) {
50220
50825
  if(ret > 0) {
50221
- CellPainter._colorObj["color"] = curCond["upColor"];
50826
+ curCond["cssClass"] = curCond["upClass"];
50222
50827
  } else if(ret < 0) {
50223
- CellPainter._colorObj["color"] = curCond["downColor"];
50828
+ curCond["cssClass"] = curCond["downClass"];
50224
50829
  } else {
50225
- CellPainter._colorObj["color"] = this._levelColorDisabled ? "" : curCond["levelColor"];
50830
+ curCond["cssClass"] = this._levelColorDisabled ? "" : curCond["levelClass"];
50226
50831
  }
50227
- return CellPainter._colorObj;
50832
+ curCond["cssClass"] = curCond["cssClass"] || "";
50833
+ return curCond;
50228
50834
  }
50229
50835
 
50230
50836
  // Expected return value is {
@@ -50284,7 +50890,7 @@ CellPainter.blackAndWhite = function (triplet) {
50284
50890
  * @param {string} rgbCode
50285
50891
  * @return {string} resultColor E.g. "#10FF0D"
50286
50892
  */
50287
- CellPainter.rgb2Hex = Util["h" /* rgb2Hex */]; // For backward compatability
50893
+ CellPainter.rgb2Hex = Util["j" /* rgb2Hex */]; // For backward compatability
50288
50894
 
50289
50895
  /** @public
50290
50896
  * @function
@@ -50400,6 +51006,10 @@ CellPainter.clearCellStyle = function(cell, styles) {
50400
51006
  // WARNING: Scope is not removed from the this._scopes collection to speed things up
50401
51007
  }
50402
51008
 
51009
+ if(elem._coloringCssClass) {
51010
+ elem.classList.remove(elem._coloringCssClass);
51011
+ }
51012
+
50403
51013
  styles = styles || CellPainter.supportedStyles;
50404
51014
  for(var i = styles.length; --i >= 0;) {
50405
51015
  elem.style[styles[i]] = ""; // WARNING: Very slow
@@ -50413,22 +51023,24 @@ CellPainter.clearCellStyle = function(cell, styles) {
50413
51023
  * @param {boolean=} withContrast
50414
51024
  */
50415
51025
  CellPainter._setUpDownColors = function(scp, upColor, downColor, levelColor, withContrast) {
51026
+ scp["upColor"] = upColor;
50416
51027
  if(upColor != null) {
50417
- scp["upColor"] = upColor;
50418
51028
  if(withContrast) {
50419
51029
  scp["contrastUpColor"] = CellPainter.getOppositeColor(upColor);
50420
51030
  }
50421
51031
  //scp["rgbUp"] = CellPainter.hex2Rgb(upColor);
50422
51032
  }
51033
+
51034
+ scp["downColor"] = downColor;
50423
51035
  if(downColor != null) {
50424
- scp["downColor"] = downColor;
50425
51036
  if(withContrast) {
50426
51037
  scp["contrastDownColor"] = CellPainter.getOppositeColor(downColor);
50427
51038
  }
50428
51039
  //scp["rgbDown"] = CellPainter.hex2Rgb(downColor);
50429
51040
  }
51041
+
51042
+ scp["levelColor"] = levelColor;
50430
51043
  if(levelColor != null) {
50431
- scp["levelColor"] = levelColor;
50432
51044
  if(withContrast) {
50433
51045
  scp["contrastLevelColor"] = CellPainter.getOppositeColor(levelColor);
50434
51046
  }
@@ -50522,14 +51134,16 @@ CellPainter.prototype._paintCell = function(cell, rowData, min, max) {
50522
51134
  }
50523
51135
 
50524
51136
  var styles = this._getStyles(rowData, min, max);
50525
- var cssClass = styles["cssClass"];
50526
- if (cssClass) {
50527
- if (elem._coloringCssClass !== cssClass) {
51137
+ var cssClass = styles["cssClass"]; // Can be an empty string
51138
+ if (cssClass != null) { // Predefined colors mode
51139
+ if (elem._coloringCssClass && elem._coloringCssClass !== cssClass) {
50528
51140
  elem.classList.remove(elem._coloringCssClass);
50529
51141
  elem._coloringCssClass = null;
50530
51142
  }
50531
- elem.classList.add(cssClass);
50532
- elem._coloringCssClass = cssClass;
51143
+ if (cssClass) {
51144
+ elem.classList.add(cssClass);
51145
+ elem._coloringCssClass = cssClass;
51146
+ }
50533
51147
  } else {
50534
51148
  if (elem._coloringCssClass) {
50535
51149
  elem.classList.remove(elem._coloringCssClass);