@refinitiv-ui/efx-grid 6.0.35 → 6.0.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/lib/core/dist/core.css +1 -1
  2. package/lib/core/dist/core.js +150 -6
  3. package/lib/core/dist/core.min.js +1 -1
  4. package/lib/core/es6/data/DataCache.js +20 -1
  5. package/lib/core/es6/grid/Core.js +25 -2
  6. package/lib/core/es6/grid/ILayoutGrid.js +4 -0
  7. package/lib/core/es6/grid/LayoutGrid.d.ts +4 -0
  8. package/lib/core/es6/grid/LayoutGrid.js +95 -3
  9. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +6 -0
  10. package/lib/core/es6/tr-grid-theme.js +1 -1
  11. package/lib/grid/index.js +1 -1
  12. package/lib/grid/themes/base.less +1 -0
  13. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  14. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  15. package/lib/grid/themes/halo/efx-grid.less +2 -0
  16. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  17. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  18. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  19. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  20. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  21. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  22. package/lib/rt-grid/dist/rt-grid.js +302 -107
  23. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  24. package/lib/rt-grid/es6/FieldDefinition.js +0 -41
  25. package/lib/rt-grid/es6/Grid.js +4 -5
  26. package/lib/rt-grid/es6/RowDefinition.d.ts +2 -2
  27. package/lib/rt-grid/es6/RowDefinition.js +102 -52
  28. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +1 -0
  29. package/lib/tr-grid-column-stack/es6/ColumnStack.js +579 -607
  30. package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +4 -1
  31. package/lib/tr-grid-range-bar/es6/RangeBar.js +99 -39
  32. package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +7 -1
  33. package/lib/tr-grid-util/es6/GroupDefinitions.js +39 -3
  34. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +7 -0
  35. package/lib/types/es6/ColumnStack.d.ts +1 -0
  36. package/lib/types/es6/Core/grid/Core.d.ts +12 -0
  37. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +4 -0
  38. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -2
  39. package/lib/versions.json +3 -3
  40. package/package.json +1 -1
@@ -4765,6 +4765,10 @@ ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPosit
4765
4765
  * @param {number=} topPx Top position of bound
4766
4766
  */
4767
4767
  ILayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx) {};
4768
+ /** @public
4769
+ * @ignore
4770
+ */
4771
+ ILayoutGrid.prototype.updateColumnSeparators = function () {};
4768
4772
 
4769
4773
  /* harmony default export */ const grid_ILayoutGrid = (ILayoutGrid);
4770
4774
 
@@ -8754,7 +8758,14 @@ LayoutGrid.prototype._colSelDirty = false;
8754
8758
  * @private
8755
8759
  */
8756
8760
  LayoutGrid.prototype._hscrollbar = null;
8757
-
8761
+ /** @type {Element}
8762
+ * @private
8763
+ */
8764
+ LayoutGrid.prototype._leftColumnSeparator = null;
8765
+ /** @type {Element}
8766
+ * @private
8767
+ */
8768
+ LayoutGrid.prototype._rightColumnSeparator = null;
8758
8769
 
8759
8770
  /**
8760
8771
  * {@link ElementWrapper#dispose}
@@ -10721,8 +10732,7 @@ LayoutGrid.prototype.selectColumn = function (colIndex, selected) {
10721
10732
 
10722
10733
  var boundLayer = this._boundLayer;
10723
10734
  if(!boundLayer) {
10724
- boundLayer = this._boundLayer = document.createElement("div");
10725
- boundLayer.className = "cover-layer";
10735
+ this._initBoundLayer();
10726
10736
  this._updateLayers();
10727
10737
  }
10728
10738
  }
@@ -10894,6 +10904,92 @@ LayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderAry, topPx)
10894
10904
  }
10895
10905
  };
10896
10906
 
10907
+ /** @public
10908
+ */
10909
+ LayoutGrid.prototype.updateColumnSeparators = function () {
10910
+ var pinnedLeftCount = this._hscrollbar.getPinnedLeftColumnCount();
10911
+ var pinnedRightCount = this._hscrollbar.getPinnedRightColumnCount();
10912
+ if ((pinnedLeftCount || pinnedRightCount) && !this._boundLayer) {
10913
+ this._initBoundLayer();
10914
+ }
10915
+
10916
+ var isScrollbarActive = false;
10917
+ if(this._hscrollbar) {
10918
+ isScrollbarActive = this._hscrollbar.isActive();
10919
+ }
10920
+
10921
+ var boundLayer = this._boundLayer;
10922
+
10923
+ var colSeparator = this._leftColumnSeparator;
10924
+ if (isScrollbarActive && pinnedLeftCount) {
10925
+ if (!colSeparator) {
10926
+ colSeparator = this._leftColumnSeparator = this._createColumnSeparator();
10927
+ }
10928
+ if (!colSeparator.parentNode) {
10929
+ if (boundLayer.children.length) {
10930
+ boundLayer.insertBefore(colSeparator, boundLayer.children[0]);
10931
+ } else {
10932
+ boundLayer.appendChild(colSeparator);
10933
+ }
10934
+ }
10935
+
10936
+ var rightPos = this._trackX.getLaneStart(pinnedLeftCount);
10937
+ colSeparator.style.left = (rightPos - 1) + "px";
10938
+ colSeparator.style.height = this._trackY.getTrackSize() + "px";
10939
+ } else {
10940
+ if (colSeparator && colSeparator.parentNode) {
10941
+ this._boundLayer.removeChild(colSeparator);
10942
+ }
10943
+ }
10944
+
10945
+ colSeparator = this._rightColumnSeparator;
10946
+ if (isScrollbarActive && pinnedRightCount) {
10947
+ if (!colSeparator) {
10948
+ colSeparator = this._rightColumnSeparator = this._createColumnSeparator();
10949
+ }
10950
+
10951
+ if (!colSeparator.parentNode) {
10952
+ if (boundLayer.children.length) {
10953
+ boundLayer.insertBefore(colSeparator, boundLayer.children[0]);
10954
+ } else {
10955
+ boundLayer.appendChild(colSeparator);
10956
+ }
10957
+ }
10958
+ var colCount = this.getColumnCount();
10959
+ var colWidth = this._trackX.getLaneEnd(colCount - 1) - this._trackX.getLaneStart(colCount - pinnedRightCount);
10960
+ var viewSize = this._getViewSize();
10961
+
10962
+ colSeparator.style.left = (viewSize - colWidth - this._rightSpaceSize) + "px";
10963
+ colSeparator.style.height = this._trackY.getTrackSize() + "px";
10964
+ } else {
10965
+ if (colSeparator && colSeparator.parentNode) {
10966
+ this._boundLayer.removeChild(colSeparator);
10967
+ }
10968
+ }
10969
+ };
10970
+
10971
+ /** @private
10972
+ * @return {Element}
10973
+ */
10974
+ LayoutGrid.prototype._createColumnSeparator = function() {
10975
+ var colSeparator = document.createElement("div");
10976
+ colSeparator.classList.add("column-separator");
10977
+ return colSeparator;
10978
+ };
10979
+
10980
+ /** @private
10981
+ * @return {Element}
10982
+ */
10983
+ LayoutGrid.prototype._initBoundLayer = function () {
10984
+ var boundLayer = this._boundLayer;
10985
+ if(!boundLayer) {
10986
+ boundLayer = this._boundLayer = document.createElement("div");
10987
+ boundLayer.className = "cover-layer";
10988
+ this._element.appendChild(boundLayer);
10989
+ }
10990
+ return boundLayer;
10991
+ };
10992
+
10897
10993
  /**
10898
10994
  * @private
10899
10995
  * @param {number} indexX
@@ -12764,7 +12860,8 @@ DataCache_DataCache.prototype._insertRic = function (subId, ric, values) {
12764
12860
  // We cannot cache event arguments because user may want to collect all the updates
12765
12861
  this._onADCForNewRic(subId, ric);
12766
12862
 
12767
- if (!this.getRowData(rid)) { // Ensure that we have subscription id and ric from Quotes2
12863
+ var rowData = this.getRowData(rid);
12864
+ if (!rowData) { // Ensure that we have subscription id and ric from Quotes2
12768
12865
  var tmp = values;
12769
12866
 
12770
12867
  values = {}; // Clone a new object for duplicated ric
@@ -12775,6 +12872,11 @@ DataCache_DataCache.prototype._insertRic = function (subId, ric, values) {
12775
12872
 
12776
12873
  values["SUB_ID"] = subId;
12777
12874
  values["RIC"] = ric;
12875
+ } else {
12876
+ var rowDef = rowData["ROW_DEF"];
12877
+ if(rowDef && rowDef.isChain()){
12878
+ values["SUB_ID"] = subId;
12879
+ }
12778
12880
  }
12779
12881
 
12780
12882
  this.setRowData(rid, values);
@@ -12811,6 +12913,12 @@ DataCache_DataCache.prototype._onQ2SubAdded = function (e) {
12811
12913
  var sub = subs[i];
12812
12914
  var ric = sub["ric"];
12813
12915
 
12916
+ // chain subId fires twice, one with "_ci_" and one without "_ci_"
12917
+ // the subId with "_ci_" should be ignore
12918
+ if(sub["id"].indexOf("_ci_") >= 0){
12919
+ continue;
12920
+ }
12921
+
12814
12922
  this.addSubscription(sub, ric);
12815
12923
 
12816
12924
  if (duplicateSubIds) { // There will be no network request for duplicate subs, and hence we need to update the data from our cache
@@ -12835,6 +12943,13 @@ DataCache_DataCache.prototype._onQ2SubRemoved = function (e) {
12835
12943
 
12836
12944
  for (var i = 0; i < len; ++i) {
12837
12945
  var sub = subs[i];
12946
+
12947
+ // chain subId fires twice, one with "_ci_" and one without "_ci_"
12948
+ // the subId with "_ci_" should be ignore
12949
+ if(sub["id"].indexOf("_ci_") >= 0){
12950
+ continue;
12951
+ }
12952
+
12838
12953
  this.removeSubscription(sub);
12839
12954
  }
12840
12955
  };
@@ -24973,6 +25088,12 @@ VirtualizedLayoutGrid.prototype.updateColumnBounds = function (posAry, noBorderA
24973
25088
  this._grid.updateColumnBounds(posAry, noBorderAry, topPx);
24974
25089
  this._updateRowBounds();
24975
25090
  };
25091
+ /** @public
25092
+ * @ignore
25093
+ */
25094
+ VirtualizedLayoutGrid.prototype.updateColumnSeparators = function () {
25095
+ this._grid.updateColumnSeparators();
25096
+ };
24976
25097
  /** @private
24977
25098
  */
24978
25099
  VirtualizedLayoutGrid.prototype._initBoundLayer = function () {
@@ -25738,7 +25859,7 @@ Core_Core.prototype._batches = null;
25738
25859
  * @return {string}
25739
25860
  */
25740
25861
  Core_Core.getVersion = function () {
25741
- return "5.1.48";
25862
+ return "5.1.50";
25742
25863
  };
25743
25864
  /** {@link ElementWrapper#dispose}
25744
25865
  * @override
@@ -26951,6 +27072,7 @@ Core_Core.prototype._moveColumn = function (fromCol, destCol) {
26951
27072
  }
26952
27073
  }
26953
27074
  this._updateColumnBounds();
27075
+ this._updateColumnSeparators();
26954
27076
  return true;
26955
27077
  };
26956
27078
 
@@ -27281,6 +27403,7 @@ Core_Core.prototype.setDefaultRowHeight = function (val, opt_includeTitle) {
27281
27403
  this._syncRowHeights();
27282
27404
  this._rowHeightSync = true;
27283
27405
  this.setRowScrollingStep(this._rowScrollingStep);
27406
+ this._updateColumnSeparators();
27284
27407
  }
27285
27408
  };
27286
27409
 
@@ -28115,6 +28238,7 @@ Core_Core.prototype.freezeColumn = function (frozenColIndex, numRightColumn) {
28115
28238
 
28116
28239
  this._onColumnCountChanged(); // Activate horizontal scrollbar and column virtualization
28117
28240
  this._updateScrollbarWidth(true, true);
28241
+ this._updateColumnSeparators();
28118
28242
  };
28119
28243
 
28120
28244
  /** @private
@@ -29356,6 +29480,21 @@ Core_Core.prototype._updateColumnBounds = function () {
29356
29480
  section.updateColumnBounds(posAry, noBorderAry);
29357
29481
  }
29358
29482
  };
29483
+ /* @private
29484
+ */
29485
+ Core_Core.prototype._updateColumnSeparators = function() {
29486
+ var sectCount = this._settings.length;
29487
+ if(!sectCount) {
29488
+ return;
29489
+ }
29490
+
29491
+ for(var i = 0; i < sectCount; i++) {
29492
+ var section = this._settings[i].getSection();
29493
+ if (section) {
29494
+ section.updateColumnSeparators();
29495
+ }
29496
+ }
29497
+ };
29359
29498
 
29360
29499
  /** @public
29361
29500
  * @param {number} startColIndex INCLUSIVE
@@ -30425,6 +30564,8 @@ Core_Core.prototype._onRowCountChanged = function (e) {
30425
30564
  if(!forceUpdate) {
30426
30565
  this._updateVScrollbar(); // Asynchronous
30427
30566
  }
30567
+
30568
+ this._updateColumnSeparators();
30428
30569
  if(prevRowCount < newRowCount) {
30429
30570
  this._dispatch("rowAdded", e);
30430
30571
  } else if(prevRowCount > newRowCount) {
@@ -30482,7 +30623,7 @@ Core_Core.prototype._onRowHeightChanged = function (e) {
30482
30623
  minSectionIndex >= this._startVScrollbarIndex);
30483
30624
  }
30484
30625
  }
30485
-
30626
+ this._updateColumnSeparators();
30486
30627
  this._dispatchRowPositionChanged();
30487
30628
  };
30488
30629
  /** @private
@@ -30547,6 +30688,7 @@ Core_Core.prototype._onColumnCountChanged = function () {
30547
30688
  var pinnedRight = this._countPinnedRightColumns();
30548
30689
 
30549
30690
  this._updateColumnBounds();
30691
+ this._updateColumnSeparators();
30550
30692
 
30551
30693
  if (this._hScrollbarEnabled && pinnedLeft + pinnedRight < this.getColumnCount()) {
30552
30694
  this._hscrollbar.enable();
@@ -30828,6 +30970,7 @@ Core_Core.prototype._syncLayoutToColumns = function (from, to, opt_forceDispatch
30828
30970
  var paneChanged = forceUpdate || (from < this.getHScrollStartIndex()) || (to > this.getFirstPinnedRightIndex());
30829
30971
  this._updateScrollbarWidth(paneChanged, true /* contentChanged */);
30830
30972
  this._updateColumnBounds();
30973
+ this._updateColumnSeparators();
30831
30974
  this._dispatchColumnPositionChanged();
30832
30975
 
30833
30976
  if (dirty || opt_forceDispatching) {
@@ -30923,6 +31066,7 @@ Core_Core.prototype._updateLayout = function () {
30923
31066
  var section = this._settings[s].getSection();
30924
31067
  section.updateLayout(); // Notify section about forced recalculation of the layout
30925
31068
  }
31069
+ this._updateColumnSeparators();
30926
31070
  };
30927
31071
 
30928
31072
  /** @private */