@refinitiv-ui/efx-grid 6.0.130 → 6.0.132

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.
@@ -437,16 +437,15 @@ RowSelectionPlugin.prototype.getSelectedRows = function (sectRef) {
437
437
  * @private
438
438
  * @param {Object} dv
439
439
  * @param {Array<string>} rids
440
- * @param {boolean=} select
440
+ * @param {boolean=} selected
441
441
  */
442
- RowSelectionPlugin.prototype._setHeaderSelections = function(dv, rids, select) {
443
- if(select == null) {
444
- select = true;
442
+ RowSelectionPlugin.prototype._setHeaderSelections = function(dv, rids, selected) {
443
+ if(selected == null) {
444
+ selected = true;
445
445
  }
446
446
  let len = rids.length;
447
447
  for (let i = 0; i < len; i++) {
448
- let rid = rids[i];
449
- this._setHeaderSelection(dv, rid, select);
448
+ this._setHeaderSelection(dv, rids[i], selected);
450
449
  }
451
450
  };
452
451
 
@@ -454,14 +453,13 @@ RowSelectionPlugin.prototype._setHeaderSelections = function(dv, rids, select) {
454
453
  * @private
455
454
  * @param {Object} dv
456
455
  * @param {sting|number} rowRef
457
- * @param {boolean=} select
456
+ * @param {boolean=} selected
458
457
  */
459
- RowSelectionPlugin.prototype._setHeaderSelection = function(dv, rowRef, select) {
460
- if(select == null) {
461
- select = true;
462
- }
458
+ RowSelectionPlugin.prototype._setHeaderSelection = function(dv, rowRef, selected) {
463
459
  let rowId = this._getRowId(dv, rowRef);
464
- this._headerSelection[rowId] = select;
460
+ if(rowId) {
461
+ this._headerSelection[rowId] = (selected == null) ? true : selected;
462
+ }
465
463
  };
466
464
 
467
465
  /**
@@ -471,8 +469,7 @@ RowSelectionPlugin.prototype._setHeaderSelection = function(dv, rowRef, select)
471
469
  * @return {boolean}
472
470
  */
473
471
  RowSelectionPlugin.prototype._isHeaderSelection = function(dv, rowRef) {
474
- let rowId = this._getRowId(dv, rowRef);
475
- return this._headerSelection[rowId];
472
+ return this._headerSelection[this._getRowId(dv, rowRef)] ? true : false;
476
473
  };
477
474
 
478
475
  /**
@@ -592,27 +589,25 @@ RowSelectionPlugin.prototype.setSelectedRow = function (rowIndex, opt_select, se
592
589
  RowSelectionPlugin.prototype.selectSingleRow = function (rowIndex, sectRef, activeGrid) {
593
590
  if(!(rowIndex >= 0)) { return false; }
594
591
 
595
- // 1. first of all let's clear selectedRows of prevGrid
596
- let prevGrid = activeGrid ? this._activeGrid : null;
597
- if(prevGrid) {
598
- this._clearSelectedRows();
599
-
600
- // 2. after clear selection let switch active grid
601
- this._activeGrid = activeGrid; // HACK
592
+ let prevGrid = null;
593
+ if(activeGrid) {
594
+ prevGrid = this._activeGrid;
595
+ if(prevGrid) { // In case of multi-table, clear selection on the previous active grid
596
+ this._clearSelectedRows();
597
+ }
598
+ this._activeGrid = activeGrid;
602
599
  }
603
600
 
604
- // 3. now active grid is switch let's normally select row
605
- let section = this._getSection(sectRef); // TODO: Check if the given section is in the active grid
606
- if(this._selectSingleRow(section, rowIndex)) {
601
+ // WANRING: this._getSection will modify activeGrid, if it does not exist
602
+ let section = this._getSection(sectRef);
603
+ if(this._selectSingleRow(section, rowIndex)) { // This will also clear existing selection in the active grid
607
604
  this._scrollToRow(rowIndex);
608
605
  return true;
609
606
  }
610
- // 4. in case fail to perform _selectSingleRow
611
- // we will turn back _activeGrid to prevGrid
612
- else if(prevGrid) {
613
- this._activeGrid = prevGrid;
614
- }
615
607
 
608
+ if(prevGrid) {
609
+ this._activeGrid = prevGrid; // If the selection is unsuccessful, restore previous active grid
610
+ }
616
611
  return false;
617
612
  };
618
613
  /** @public
@@ -896,9 +891,7 @@ RowSelectionPlugin.prototype._onReselection = function (e) {
896
891
  * @param {Object} e postSectionDataBinding event context
897
892
  */
898
893
  RowSelectionPlugin.prototype._onPostSectionDataBinding = function (e) {
899
- if(!this._basedOnContent
900
- || "content" !== e.sectionType
901
- || !this._activeGrid) {
894
+ if(!this._basedOnContent || e.sectionType !== "content") {
902
895
  return;
903
896
  }
904
897
  let section = e.section;
@@ -1436,6 +1429,18 @@ RowSelectionPlugin.prototype._dispatchSelectionChanged = function (e, rowIndex,
1436
1429
  }
1437
1430
  };
1438
1431
 
1432
+ /** @public
1433
+ * @ignore
1434
+ * @return {!Object}
1435
+ */
1436
+ RowSelectionPlugin.prototype._getEventHandlers = function() {
1437
+ return {
1438
+ "mousedown": this._onMouseDown,
1439
+ "click": this._onClick,
1440
+ "keydown": this._onKeyDown
1441
+ };
1442
+ };
1443
+
1439
1444
 
1440
1445
 
1441
1446
  export default RowSelectionPlugin;
@@ -55,7 +55,7 @@ let _fieldInfo = {
55
55
  "CF_LAST": {type: "number", min: 0.01, max: 1000, prec: 2},
56
56
  "PCTCHNG": {type: "number", min: -1, max: 1, prec: 2, suffix: "%"},
57
57
  "PCTCHNG2": {type: "float", min: -20, max: 20, prec: 2, suffix: "%"},
58
- "CF_CURR": {fixedValue: "USD"},
58
+ "CF_CURR": {type: "set", members: ["USD", "GBP", "EUR", "JPY", "THB"]},
59
59
  "INDICATOR": {type: "number", min: 0, max: 5},
60
60
  "CF_TICK": {type: "number", min: 1, max: 3, changeOnly: true},
61
61
  "PRCTCK_1": {type: "set", members: ["\u21e7", "B\u21e7", "\u2191", "B\u2191", "26", "1", "\"1\"", "-1", "\u21e9", "B\u21e9", "\u2193", "B\u2193", "27", "2", "\"2\""] },
@@ -74,9 +74,9 @@ let _fieldInfo = {
74
74
  "TR.IPODate": {type: "isoDate", min: Date.now() - 63072000000 /* 2 years back from now */, max: Date.now()},
75
75
  "TR.Volume": {type: "number", min: 2000, max: 1e7},
76
76
  "TR.Price52WeekHigh": {type: "number", min: 100, max: 300, prec: 2},
77
- "TR.Price52WeekLow": { type: "number", min: 1, max: 200, prec: 2 },
78
- // eslint-disable-next-line
79
- "TR.InvalidField": { type: "set", members: [undefined] },
77
+ "TR.Price52WeekLow": {type: "number", min: 1, max: 200, prec: 2 },
78
+ "TR.InvalidField": {type: "set", members: [undefined, null, NaN]}, // eslint-disable-line
79
+ "falsyValues": {type: "set", members: [undefined, null, NaN, 0, false, ""]}, // eslint-disable-line
80
80
  "percent": {type: "number", min: 0, max: 101 },
81
81
  "number_1": {type: "number", min: 1, max: 100 },
82
82
  "number_2": {type: "number", min: -100, max: 100 },
@@ -493,8 +493,8 @@ let _generateFieldData = function(field, options, seed) {
493
493
  fInfo.type = "number";
494
494
  addFieldInfo(field, fInfo);
495
495
  }
496
- if(fInfo.fixedValue){
497
- fInfo.value = value;
496
+ if(fInfo.fixedValue !== undefined){ // eslint-disable-line
497
+ fInfo.value = fInfo.fixedValue;
498
498
  return fInfo;
499
499
  }
500
500
  if(seed != null) {
@@ -73,6 +73,8 @@ declare class RowDraggingPlugin extends GridPlugin {
73
73
 
74
74
  public setJETDragContent(content: any): void;
75
75
 
76
+ public moveRows(srcRowIndices: (number)[]|null, destRowIndex: number, srcGrid?: any, destGrid?: any): number;
77
+
76
78
  }
77
79
 
78
80
  export default RowDraggingPlugin;
package/lib/versions.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
- "tr-grid-util": "1.3.164",
2
+ "tr-grid-util": "1.3.167",
3
3
  "tr-grid-printer": "1.0.18",
4
4
  "@grid/column-dragging": "1.0.21",
5
5
  "@grid/row-segmenting": "1.0.35",
6
6
  "@grid/statistics-row": "1.0.17",
7
7
  "@grid/zoom": "1.0.11",
8
- "tr-grid-auto-tooltip": "1.1.8",
8
+ "tr-grid-auto-tooltip": "1.1.9",
9
9
  "tr-grid-cell-selection": "1.0.39",
10
10
  "tr-grid-checkbox": "1.0.70",
11
11
  "tr-grid-column-fitter": "1.0.41",
12
12
  "tr-grid-column-formatting": "0.9.36",
13
- "tr-grid-column-grouping": "1.0.64",
13
+ "tr-grid-column-grouping": "2.0.0",
14
14
  "tr-grid-column-resizing": "1.0.29",
15
15
  "tr-grid-column-selection": "1.0.33",
16
16
  "tr-grid-column-stack": "1.0.76",
@@ -22,11 +22,11 @@
22
22
  "tr-grid-in-cell-editing": "1.0.90",
23
23
  "tr-grid-pagination": "1.0.24",
24
24
  "tr-grid-percent-bar": "1.0.24",
25
- "tr-grid-range-bar": "2.0.8",
26
- "tr-grid-row-dragging": "1.0.36",
27
- "tr-grid-row-filtering": "1.0.83",
25
+ "tr-grid-range-bar": "2.0.9",
26
+ "tr-grid-row-dragging": "1.0.38",
27
+ "tr-grid-row-filtering": "1.0.84",
28
28
  "tr-grid-row-grouping": "1.0.88",
29
- "tr-grid-row-selection": "1.0.32",
29
+ "tr-grid-row-selection": "1.0.33",
30
30
  "tr-grid-rowcoloring": "1.0.26",
31
31
  "tr-grid-textformatting": "1.0.48",
32
32
  "tr-grid-titlewrap": "1.0.22",
package/package.json CHANGED
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "version": "6.0.130"
72
+ "version": "6.0.132"
73
73
  }