@refinitiv-ui/efx-grid 6.0.37 → 6.0.39

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 (31) hide show
  1. package/lib/core/dist/core.js +165 -20
  2. package/lib/core/dist/core.min.js +1 -1
  3. package/lib/core/es6/grid/Core.d.ts +2 -0
  4. package/lib/core/es6/grid/Core.js +62 -5
  5. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +3 -0
  6. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +41 -7
  7. package/lib/core/es6/grid/util/TrackLayout.d.ts +3 -1
  8. package/lib/core/es6/grid/util/TrackLayout.js +23 -5
  9. package/lib/grid/index.js +1 -1
  10. package/lib/rt-grid/dist/rt-grid.js +158 -48
  11. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  12. package/lib/rt-grid/es6/ColumnDefinition.js +4 -3
  13. package/lib/rt-grid/es6/Grid.d.ts +1 -1
  14. package/lib/rt-grid/es6/Grid.js +63 -29
  15. package/lib/rt-grid/es6/RowDefinition.js +6 -6
  16. package/lib/tr-grid-cell-selection/es6/CellSelection.js +180 -421
  17. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
  18. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +221 -2
  19. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +7 -1
  20. package/lib/tr-grid-column-stack/es6/ColumnStack.js +281 -69
  21. package/lib/tr-grid-row-dragging/es6/RowDragging.js +83 -3
  22. package/lib/tr-grid-row-selection/es6/RowSelection.js +18 -40
  23. package/lib/tr-grid-util/es6/GridPlugin.js +91 -42
  24. package/lib/types/es6/ColumnGrouping.d.ts +4 -0
  25. package/lib/types/es6/ColumnStack.d.ts +7 -1
  26. package/lib/types/es6/Core/grid/Core.d.ts +2 -0
  27. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +3 -1
  28. package/lib/types/es6/RealtimeGrid/Grid.d.ts +1 -1
  29. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -2
  30. package/lib/versions.json +6 -6
  31. package/package.json +1 -1
@@ -805,10 +805,11 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
805
805
  obj["minWidth"] = value;
806
806
  }
807
807
 
808
- value = core.isColumnVisible(colIndex);
809
808
  // If "hidden" property already available from core/extensions, don't override this property
810
- if(!value && obj["hidden"] == null) {
811
- obj["hidden"] = true;
809
+ if(obj["hidden"] == null) {
810
+ if(!core.getColumnVisibility(colIndex, 0)) {
811
+ obj["hidden"] = true;
812
+ }
812
813
  }
813
814
 
814
815
  value = core.getColumnAlignment(colIndex);
@@ -266,7 +266,7 @@ declare class Grid extends EventDispatcher {
266
266
 
267
267
  public freezeColumn(colIndex?: number|null, pinnedRightColumns?: number|null): void;
268
268
 
269
- public pinColumn(colRef: Grid.ColumnReference|(Grid.ColumnReference)[]|null): boolean;
269
+ public pinColumn(colRef: Grid.ColumnReference|(Grid.ColumnReference)[]|null, side?: string|null): boolean;
270
270
 
271
271
  public unpinColumn(colRef: Grid.ColumnReference|(Grid.ColumnReference)[]|null, dest?: Grid.ColumnReference|null): boolean;
272
272
 
@@ -3101,50 +3101,72 @@ Grid.prototype.freezeColumn = function(colIndex, pinnedRightColumns) {
3101
3101
  }
3102
3102
  this._grid.freezeColumn(colIndex, pinnedRightColumns);
3103
3103
  };
3104
+
3104
3105
  /** Pin column to the left side by moving the specified column to the rightmost of the frozen columns. <br>
3105
3106
  * The method will do nothing if the specified column is already pinned to the left side
3106
3107
  * @public
3107
3108
  * @param {Grid~ColumnReference|Array.<Grid~ColumnReference>} colRef
3109
+ * @param {string=} side Available values are: left|right. If no value is supplied, the column will be pinned to the left.
3108
3110
  * @return {boolean}
3109
3111
  */
3110
- Grid.prototype.pinColumn = function(colRef) {
3112
+ Grid.prototype.pinColumn = function(colRef, side) {
3111
3113
  if(Array.isArray(colRef)) {
3112
3114
  var ary = colRef;
3113
3115
  var len = ary.length;
3114
3116
 
3115
3117
  var dirty = 0;
3116
3118
  for(var i = 0; i < len; ++i) {
3117
- dirty |= this._pinColumn(ary[i]);
3119
+ dirty |= this._pinColumn(ary[i], side);
3118
3120
  }
3119
3121
  return dirty ? true : false;
3120
3122
  }
3121
- return this._pinColumn(colRef);
3123
+ return this._pinColumn(colRef, side);
3122
3124
  };
3123
3125
  /** @private
3124
3126
  * @param {Grid~ColumnReference} colRef
3127
+ * @param {string=} side Available values are: left|right. If no value is supplied, the column will be pinned to the left.
3125
3128
  * @return {boolean}
3126
3129
  */
3127
- Grid.prototype._pinColumn = function(colRef) {
3130
+ Grid.prototype._pinColumn = function(colRef, side) {
3128
3131
  var colIndex = this.getColumnIndex(colRef);
3129
- if(colIndex < 0) {
3132
+ var colCount = this.getColumnCount();
3133
+ if(colIndex < 0 || colIndex > colCount) {
3130
3134
  return false;
3131
3135
  }
3132
- var pinnedCount = this._grid.getFrozenColumnCount();
3133
- if(colIndex < pinnedCount) {
3134
- return false; // The column is already pinned area
3135
- }
3136
- if(!pinnedCount) {
3137
- var stationaryIdx = this._grid.getStationaryColumnIndex();
3138
- if(stationaryIdx >= 0) {
3139
- pinnedCount = stationaryIdx;
3140
- if(colIndex > stationaryIdx) {
3141
- pinnedCount++;
3136
+
3137
+ var leftPinnedCount = this._grid.getPinnedLeftColumnCount();
3138
+ var rightPinnedCount = this._grid.getPinnedRightColumnCount();
3139
+ var stationaryIdx = this._grid.getStationaryColumnIndex();
3140
+
3141
+ if(side && side.toLowerCase() === "right") {
3142
+ var rightPinnedIndex = this._grid.getFirstPinnedRightIndex();
3143
+ if(colIndex >= rightPinnedIndex) {
3144
+ return false; // The column is already pinned area
3145
+ }
3146
+
3147
+ if(stationaryIdx >= 0 && colIndex <= stationaryIdx) {
3148
+ return false;
3149
+ }
3150
+
3151
+ this.moveColumnById(colIndex, rightPinnedIndex);
3152
+ rightPinnedCount += 1;
3153
+ leftPinnedCount -= 1;
3154
+ } else {
3155
+ if(colIndex < leftPinnedCount) {
3156
+ return false; // The column is already pinned area
3157
+ }
3158
+ if(!leftPinnedCount) {
3159
+ if(stationaryIdx >= 0) {
3160
+ leftPinnedCount = stationaryIdx;
3161
+ if(colIndex > stationaryIdx) {
3162
+ leftPinnedCount++;
3163
+ }
3142
3164
  }
3143
3165
  }
3166
+ this.moveColumnById(colIndex, leftPinnedCount);
3144
3167
  }
3145
3168
 
3146
- this.moveColumnById(colIndex, pinnedCount);
3147
- this._grid.freezeColumn(pinnedCount);
3169
+ this._grid.freezeColumn(leftPinnedCount, rightPinnedCount);
3148
3170
  return true;
3149
3171
  };
3150
3172
  /** Unpin column from the left side by moving the specified column to the end of the frozen columns. <br>
@@ -3177,13 +3199,16 @@ Grid.prototype._unpinColumn = function(colRef, dest) {
3177
3199
  if(colIndex < 0) {
3178
3200
  return false;
3179
3201
  }
3180
- var pinnedCount = this._grid.getFrozenColumnCount();
3181
- if(!pinnedCount) {
3202
+
3203
+ var leftPinnedCount = this._grid.getPinnedLeftColumnCount();
3204
+ var rightPinnedCount = this._grid.getPinnedRightColumnCount();
3205
+ var colCount = this.getColumnCount();
3206
+ var firstRightPinnedIndex = colCount - rightPinnedCount;
3207
+
3208
+ if(colIndex >= leftPinnedCount && colIndex < firstRightPinnedIndex) {
3182
3209
  return false;
3183
3210
  }
3184
- if(colIndex >= pinnedCount) {
3185
- return false; // The column is outside of frozen area
3186
- }
3211
+
3187
3212
  var srcId = null;
3188
3213
  var destId = null;
3189
3214
  if(dest != null) {
@@ -3194,11 +3219,19 @@ Grid.prototype._unpinColumn = function(colRef, dest) {
3194
3219
 
3195
3220
  var stationaryIdx = this._grid.getStationaryColumnIndex();
3196
3221
 
3197
- if(colIndex > stationaryIdx) {
3198
- this.moveColumnById(colIndex, pinnedCount);
3199
- }
3222
+ if(colIndex < leftPinnedCount) {
3223
+ if(colIndex > stationaryIdx) {
3224
+ this.moveColumnById(colIndex, leftPinnedCount);
3225
+ }
3200
3226
 
3201
- this._grid.freezeColumn(pinnedCount - 2); // Column index is used for freezing
3227
+ this._grid.freezeColumn(leftPinnedCount - 2, rightPinnedCount); // Column index is used for freezing
3228
+ } else if(colIndex >= firstRightPinnedIndex) {
3229
+ if(colIndex > stationaryIdx) {
3230
+ this.moveColumnById(colIndex, firstRightPinnedIndex);
3231
+ }
3232
+
3233
+ this._grid.freezeColumn(leftPinnedCount - 1, rightPinnedCount - 1); // Column index is used for freezing
3234
+ }
3202
3235
 
3203
3236
  if(colIndex > stationaryIdx) {
3204
3237
  if(destId != null) {
@@ -3213,11 +3246,12 @@ Grid.prototype._unpinColumn = function(colRef, dest) {
3213
3246
  * @return {boolean}
3214
3247
  */
3215
3248
  Grid.prototype.unpinAllColumns = function() {
3216
- var pinnedCount = this._grid.getFrozenColumnCount();
3217
- if(!pinnedCount) {
3249
+ var leftPinnedCount = this._grid.getPinnedLeftColumnCount();
3250
+ var rightPinnedCount = this._grid.getPinnedRightColumnCount();
3251
+ if(!leftPinnedCount && !rightPinnedCount) {
3218
3252
  return false;
3219
3253
  }
3220
- this._grid.freezeColumn(-1); // Column index is used for freezing
3254
+ this._grid.freezeColumn(-1, 0); // Column index is used for left freezing and column count is used for right freezing
3221
3255
  return true;
3222
3256
  };
3223
3257
 
@@ -94,7 +94,7 @@ RowDefinition.prototype._permId = "";
94
94
  /** @type {string|null}
95
95
  * @private
96
96
  */
97
- RowDefinition.prototype._label = null; // Label overrides _ric and _displayText
97
+ RowDefinition.prototype._label = null; // Label overrides _ric and _permId
98
98
  /** @type {boolean|null}
99
99
  * @private
100
100
  */
@@ -261,15 +261,15 @@ RowDefinition.prototype.initialize = function(rowOptions) {
261
261
 
262
262
  var expanded = this._expanded;
263
263
  var symbol = this._ric || this._chainRic;
264
- var asChain = rowOptions["asChain"] || !!this._chainRic;
264
+ var asChain = this._isChain || !!this._chainRic;
265
265
  if(this._ric && this._ric.indexOf("0#") >= 0){
266
266
  asChain = true;
267
267
  expanded = true;
268
268
  }
269
- if(rowOptions["asChain"] === false){
269
+ if(this._isChain === false){
270
270
  asChain = false;
271
271
  }
272
- if(rowOptions["collapsed"] === true){
272
+ if(this._expanded === false){
273
273
  expanded = false;
274
274
  }
275
275
  if(symbol || this._permId){
@@ -284,7 +284,7 @@ RowDefinition.prototype._initializeAsConstituent = function(rowOptions) {
284
284
  var parentDef = /** @type{RowDefinition} */(rowOptions["parent"]);
285
285
  if(this.setParent(parentDef)) {
286
286
  this._dataId = /** @type{string} */(rowOptions["dataId"]); // Constituent will have the same subId as its parent but with different ric
287
-
287
+ this._ric = /** @type{string} */(rowOptions["ric"]);
288
288
  this._dc = parentDef._dc; // Parent chain must have data cache
289
289
  if(this._dc) {
290
290
  var rowData = this.getRowData(); // Do not trigger any data update
@@ -339,7 +339,7 @@ RowDefinition.prototype.setContent = function(userInput, permId, asChain, expand
339
339
  if(asChain === false){
340
340
  this._ric = this._userInput;
341
341
  } else {
342
- this._ric = expanded ? this._userInput.replace("0#", "") : this._userInput;
342
+ this._ric = expanded === false ? this._userInput : this._userInput.replace("0#", "");
343
343
  this._expanded = expanded;
344
344
  this._isChain = true; // Only chain can be expanded by 0#
345
345
  this._chainRic = this._userInput;