@refinitiv-ui/efx-grid 6.0.41 → 6.0.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +1 -0
  2. package/lib/column-format-dialog/lib/column-format-dialog.js +3 -24
  3. package/lib/column-format-dialog/lib/preview-table.d.ts +1 -1
  4. package/lib/column-format-dialog/lib/preview-table.js +15 -27
  5. package/lib/core/dist/core.js +843 -871
  6. package/lib/core/dist/core.min.js +1 -1
  7. package/lib/core/es6/grid/Core.d.ts +4 -0
  8. package/lib/core/es6/grid/Core.js +67 -2
  9. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +3 -2
  10. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +32 -26
  11. package/lib/core/es6/grid/util/util.js +25 -9
  12. package/lib/formatters/es6/CoralButtonFormatter.d.ts +2 -2
  13. package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +1 -1
  14. package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +4 -4
  15. package/lib/formatters/es6/CoralIconFormatter.d.ts +3 -3
  16. package/lib/formatters/es6/CoralInputFormatter.d.ts +1 -1
  17. package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +2 -2
  18. package/lib/formatters/es6/CoralSelectFormatter.d.ts +4 -4
  19. package/lib/formatters/es6/CoralToggleFormatter.d.ts +1 -1
  20. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +1 -1
  21. package/lib/formatters/es6/EFButtonFormatter.d.ts +2 -2
  22. package/lib/formatters/es6/EFCheckboxFormatter.d.ts +1 -1
  23. package/lib/formatters/es6/EFComboBoxFormatter.d.ts +4 -4
  24. package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +1 -1
  25. package/lib/formatters/es6/EFIconFormatter.d.ts +3 -3
  26. package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +1 -1
  27. package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +2 -2
  28. package/lib/formatters/es6/EFSelectFormatter.d.ts +4 -4
  29. package/lib/formatters/es6/EFTextFieldFormatter.d.ts +1 -1
  30. package/lib/formatters/es6/EFToggleFormatter.d.ts +1 -1
  31. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +1 -1
  32. package/lib/formatters/es6/FormatterBuilder.d.ts +6 -2
  33. package/lib/formatters/es6/FormatterBuilder.js +328 -178
  34. package/lib/formatters/es6/NumericInputFormatter.d.ts +1 -1
  35. package/lib/formatters/es6/PercentBarFormatter.d.ts +6 -6
  36. package/lib/formatters/es6/SimpleImageFormatter.d.ts +3 -3
  37. package/lib/formatters/es6/SimpleInputFormatter.d.ts +1 -1
  38. package/lib/formatters/es6/SimpleLinkFormatter.d.ts +3 -3
  39. package/lib/formatters/es6/SimpleTickerFormatter.d.ts +3 -3
  40. package/lib/formatters/es6/SimpleToggleFormatter.d.ts +3 -3
  41. package/lib/formatters/es6/TextFormatter.d.ts +1 -1
  42. package/lib/grid/index.js +1 -1
  43. package/lib/rt-grid/dist/rt-grid.js +213 -44
  44. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  45. package/lib/rt-grid/es6/Grid.d.ts +24 -1
  46. package/lib/rt-grid/es6/Grid.js +92 -4
  47. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
  48. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +34 -19
  49. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +9 -3
  50. package/lib/tr-grid-column-stack/es6/ColumnStack.js +324 -388
  51. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +17 -17
  52. package/lib/tr-grid-filter-input/es6/FilterInput.js +146 -33
  53. package/lib/tr-grid-util/es6/DateTime.js +3 -3
  54. package/lib/tr-grid-util/es6/GridPlugin.js +1 -1
  55. package/lib/types/es6/ColumnGrouping.d.ts +4 -0
  56. package/lib/types/es6/ColumnStack.d.ts +9 -3
  57. package/lib/types/es6/CoralButtonFormatter.d.ts +2 -2
  58. package/lib/types/es6/CoralCheckboxFormatter.d.ts +1 -1
  59. package/lib/types/es6/CoralComboBoxFormatter.d.ts +4 -4
  60. package/lib/types/es6/CoralIconFormatter.d.ts +3 -3
  61. package/lib/types/es6/CoralInputFormatter.d.ts +1 -1
  62. package/lib/types/es6/CoralRadioButtonFormatter.d.ts +2 -2
  63. package/lib/types/es6/CoralSelectFormatter.d.ts +4 -4
  64. package/lib/types/es6/CoralToggleFormatter.d.ts +1 -1
  65. package/lib/types/es6/Core/grid/Core.d.ts +4 -0
  66. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +3 -2
  67. package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +1 -1
  68. package/lib/types/es6/EFButtonFormatter.d.ts +2 -2
  69. package/lib/types/es6/EFCheckboxFormatter.d.ts +1 -1
  70. package/lib/types/es6/EFComboBoxFormatter.d.ts +4 -4
  71. package/lib/types/es6/EFDateTimePickerFormatter.d.ts +1 -1
  72. package/lib/types/es6/EFIconFormatter.d.ts +3 -3
  73. package/lib/types/es6/EFNumberFieldFormatter.d.ts +1 -1
  74. package/lib/types/es6/EFRadioButtonFormatter.d.ts +2 -2
  75. package/lib/types/es6/EFSelectFormatter.d.ts +4 -4
  76. package/lib/types/es6/EFTextFieldFormatter.d.ts +1 -1
  77. package/lib/types/es6/EFToggleFormatter.d.ts +1 -1
  78. package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +1 -1
  79. package/lib/types/es6/FilterInput.d.ts +17 -17
  80. package/lib/types/es6/FormatterBuilder.d.ts +6 -2
  81. package/lib/types/es6/NumericInputFormatter.d.ts +1 -1
  82. package/lib/types/es6/PercentBarFormatter.d.ts +6 -6
  83. package/lib/types/es6/RealtimeGrid/Grid.d.ts +22 -0
  84. package/lib/types/es6/SimpleImageFormatter.d.ts +3 -3
  85. package/lib/types/es6/SimpleInputFormatter.d.ts +1 -1
  86. package/lib/types/es6/SimpleLinkFormatter.d.ts +3 -3
  87. package/lib/types/es6/SimpleTickerFormatter.d.ts +3 -3
  88. package/lib/types/es6/SimpleToggleFormatter.d.ts +3 -3
  89. package/lib/types/es6/TextFormatter.d.ts +1 -1
  90. package/lib/versions.json +6 -6
  91. package/package.json +1 -1
@@ -83,7 +83,8 @@ declare namespace Grid {
83
83
  fieldCaching?: boolean|null,
84
84
  timeSeriesExpansion?: boolean|null,
85
85
  childDataField?: string|null,
86
- topSection?: boolean|null
86
+ topSection?: boolean|null,
87
+ sorting?: SortableTitlePlugin.Options|null
87
88
  };
88
89
 
89
90
  type RowReference = number|string|RowDefinition|null;
@@ -320,6 +321,28 @@ declare class Grid extends EventDispatcher {
320
321
 
321
322
  public replaceRow(rowRef: Grid.RowReference|null, rowOption?: any): any;
322
323
 
324
+ public scrollToColumn(colIndex: number, leftOfView?: boolean|null): boolean;
325
+
326
+ public scrollToRow(rowIndex: number, topOfView?: boolean|null): void;
327
+
328
+ public getScrollLeft(): number;
329
+
330
+ public getScrollTop(): number;
331
+
332
+ public setScrollLeft(pixels: number): void;
333
+
334
+ public setScrollTop(pixels: number): void;
335
+
336
+ public scrollRight(pixels: number): void;
337
+
338
+ public scrollDown(pixels: number): void;
339
+
340
+ public getScrollWidth(): number;
341
+
342
+ public getScrollHeight(): number;
343
+
344
+ public getVScrollView(): any;
345
+
323
346
  }
324
347
 
325
348
  declare function borders(gridOptions?: any): any;
@@ -87,6 +87,7 @@ import { ElementWrapper } from "../../core/es6/grid/components/ElementWrapper.js
87
87
  * @property {boolean=} timeSeriesExpansion=true If disabled, the time series field will be treated as a normal field and not expanded.
88
88
  * @property {string=} childDataField=CHILD_VALUES The given field will be used to store children's static data, such as row color assignment.
89
89
  * @property {boolean=} topSection=true If disabled, title section will not be rendered
90
+ * @property {SortableTitlePlugin~Options=} sorting Options for sorting
90
91
  */
91
92
 
92
93
  /** @typedef {number|string|RowDefinition} Grid~RowReference
@@ -140,21 +141,17 @@ import { ElementWrapper } from "../../core/es6/grid/components/ElementWrapper.js
140
141
  * @description Fired after ADC data or response received from the server
141
142
  * @property {Array.<Array>} data Data part of the server response
142
143
  */
143
-
144
144
  /** @event Grid#pageIndexChanged
145
145
  * @description Fired after page index in the data view is changed during the active pagination mode
146
146
  */
147
-
148
147
  /** @event Grid#pageCountChanged
149
148
  * @description Fired after page count in the data view is changed during the active pagination mode
150
149
  */
151
-
152
150
  /** @event Grid#dataComposed
153
151
  * @description Trigger before dataChanged. Perform any data update during the event will NOT cause more dataChanged events
154
152
  * @property {Grid} grid
155
153
  * @property {RowDefinition} rowDef
156
154
  */
157
-
158
155
  /** @event Grid#beforeRowRemoved
159
156
  * @description Fired only when a row will be removed through Grid's API and before occurring of the actual removal
160
157
  */
@@ -3921,6 +3918,7 @@ Grid.prototype._logData = function(rowDefs, options) {
3921
3918
 
3922
3919
  console.table(tbl); // eslint-disable-line
3923
3920
  };
3921
+
3924
3922
  /** @public
3925
3923
  * @description Replace existing row with a new row. Row ID would be changed, after row is replaced.
3926
3924
  * @param {Grid~RowReference} rowRef Reference (i.e. row index, row id, or row definition) of the insert position
@@ -3944,5 +3942,95 @@ Grid.prototype.replaceRow = function(rowRef, rowOption) {
3944
3942
  }
3945
3943
  };
3946
3944
 
3945
+ /** Scroll the view to the specified column. If the column is already in the view, nothing happens. If the column is outside of the view, the view will be moved to the column with some additional offsets
3946
+ * @public
3947
+ * @param {number} colIndex
3948
+ * @param {boolean=} leftOfView Default is false. If true, the specified column will be put at the leftmost of the view (no offset)
3949
+ * @returns {boolean} Return true, if there is any change
3950
+ */
3951
+ Grid.prototype.scrollToColumn = function (colIndex, leftOfView) {
3952
+ return this._grid.scrollToColumn(colIndex, leftOfView);
3953
+ };
3954
+ /** Scroll the view to the specified row. If the row is already in the view, nothing happens. If the row is outside of the view, the view will be moved to the row with some additional offsets
3955
+ * @public
3956
+ * @param {number} rowIndex
3957
+ * @param {boolean=} topOfView=false If true, the specified row will be put at the top of the view (no offset)
3958
+ */
3959
+ Grid.prototype.scrollToRow = function (rowIndex, topOfView) {
3960
+ this._grid.scrollToRow("content", rowIndex, topOfView);
3961
+ };
3962
+
3963
+ /** Get scroll value in pixel from the horizontal scrollbar
3964
+ * @public
3965
+ * @returns {number} pixels
3966
+ */
3967
+ Grid.prototype.getScrollLeft = function () {
3968
+ return this._grid.getScrollLeft();
3969
+ };
3970
+ /** Get scroll value in pixel from the vertical scrollbar
3971
+ * @public
3972
+ * @returns {number} pixels
3973
+ */
3974
+ Grid.prototype.getScrollTop = function () {
3975
+ return this._grid.getScrollTop();
3976
+ };
3977
+
3978
+ /** Set scroll value to the horizontal scrollbar. This will move the scrollbar to specific position
3979
+ * @public
3980
+ * @param {number} pixels
3981
+ * @see {@link Grid.scrollRight}
3982
+ */
3983
+ Grid.prototype.setScrollLeft = function (pixels) {
3984
+ this._grid.setScrollLeft(pixels);
3985
+ };
3986
+ /** Set scroll value to the vertical scrollbar. This will move the scrollbar to specific position
3987
+ * @public
3988
+ * @param {number} pixels
3989
+ * @see {@link Grid.scrollDown}
3990
+ */
3991
+ Grid.prototype.setScrollTop = function (pixels) {
3992
+ this._grid.setScrollTop(pixels);
3993
+ };
3994
+
3995
+ /** Scroll the view to the right by the specified value. Use negative value to scroll the view to the left
3996
+ * @public
3997
+ * @param {number} pixels
3998
+ * @see {@link Grid.setScrollLeft}
3999
+ */
4000
+ Grid.prototype.scrollRight = function (pixels) {
4001
+ this._grid.scrollRight(pixels);
4002
+ };
4003
+ /** Scroll the view down by the specified value. Use negative value to scroll the view to the top
4004
+ * @public
4005
+ * @param {number} pixels
4006
+ * @see {@link Grid.setScrollTop}
4007
+ */
4008
+ Grid.prototype.scrollDown = function (pixels) {
4009
+ this._grid.scrollDown(pixels);
4010
+ };
4011
+
4012
+ /** Get width of scrollable area from the horizontal scrollbar. This is useful for determining the end of scrollbar
4013
+ * @public
4014
+ * @returns {number}
4015
+ */
4016
+ Grid.prototype.getScrollWidth = function () {
4017
+ return this._grid.getScrollWidth();
4018
+ };
4019
+ /** Get height of scrollable area from the vertical scrollbar. This is useful for determining the end of scrollbar
4020
+ * @public
4021
+ * @returns {number}
4022
+ */
4023
+ Grid.prototype.getScrollHeight = function () {
4024
+ return this._grid.getScrollHeight();
4025
+ };
4026
+
4027
+ /** Get information about current grid's view and the vertical scrollbar
4028
+ * @public
4029
+ * @returns {Object} Returns null, if vertical scrollbar does not exists
4030
+ */
4031
+ Grid.prototype.getVScrollView = function () {
4032
+ return this._grid.getVScrollView();
4033
+ };
4034
+
3947
4035
  export { Grid };
3948
4036
  export default Grid;
@@ -93,6 +93,10 @@ declare class ColumnGroupingPlugin extends GridPlugin {
93
93
 
94
94
  public unpinGroup(groupId: string, dest?: (number|string)|null): void;
95
95
 
96
+ public static getObjectIndex(column: any): number;
97
+
98
+ public static getObjectId(column: any): string;
99
+
96
100
  }
97
101
 
98
102
  export default ColumnGroupingPlugin;
@@ -483,7 +483,7 @@ ColumnGroupingPlugin.prototype._applyGrouping = function () {
483
483
  for (r = 0; r < rowCount; r++) {
484
484
  cell = section.getCell(c, r, false);
485
485
  if (cell) {
486
- cell.reset();
486
+ // TODO: The style and class from the user will not be reset, for example, the color or background
487
487
  cell.removeClass("no-sort");
488
488
  cell.removeAttribute("group-id");
489
489
  }
@@ -1122,14 +1122,13 @@ ColumnGroupingPlugin.prototype.setGroupDefinition = function (groupId, groupDef)
1122
1122
  if (this._groupDefs.setGroup(groupId, groupDef)) {
1123
1123
  var newDef = this._groupDefs.getGroup(groupId);
1124
1124
  if (newDef) {
1125
- var chdr = newDef.children;
1125
+ var host = this._hosts[0];
1126
+ var chdr = host.getValidColumnList(newDef.children).map(ColumnGroupingPlugin.getObjectId); //this return only valid columns without group
1126
1127
  var len = chdr.length;
1127
- // TODO: Filter out group id
1128
1128
  if (len > 1) {
1129
- this.reorderColumns(chdr, chdr[0]); // WARNING: group id doesn't work
1129
+ this.reorderColumns(chdr, chdr[0]);
1130
1130
  }
1131
1131
  }
1132
-
1133
1132
  this._applyGrouping();
1134
1133
  return groupId;
1135
1134
  }
@@ -1192,16 +1191,17 @@ ColumnGroupingPlugin.prototype._getAvaliableChildren = function (groupId) {
1192
1191
  var childCount = chdr ? chdr.length : 0;
1193
1192
  var validChildren = [];
1194
1193
  if (childCount) {
1194
+ var host = this._hosts[0];
1195
+ var validCols = host.getValidColumnList(chdr);
1196
+ validChildren = validCols.map(ColumnGroupingPlugin.getObjectId);
1195
1197
  var groupMap = this._groupDefs.getGroupMap();
1196
- // Filter out columns that do not exist
1197
1198
  for (var i = 0; i < childCount; i++) {
1198
1199
  var childId = chdr[i];
1199
- if (groupMap[childId] || this.getColumnIndex(childId) > -1) {
1200
- validChildren.push(childId); // TODO: This is slow
1200
+ if (groupMap[childId]) {
1201
+ validChildren.push(childId);
1201
1202
  }
1202
1203
  }
1203
1204
  }
1204
-
1205
1205
  return validChildren;
1206
1206
  };
1207
1207
 
@@ -1223,19 +1223,14 @@ ColumnGroupingPlugin.prototype.getGroupChildren = function (groupId) {
1223
1223
  * @return {Array.<number>}
1224
1224
  */
1225
1225
  ColumnGroupingPlugin.prototype.getChildColumnIndices = function (groupId) {
1226
+ var colIndices = [];
1227
+ var host = this._hosts[0];
1226
1228
  var colIds = this._groupDefs.getLeafDescendants(groupId);
1227
1229
  if (colIds) {
1228
- var colIndices = [];
1229
- var leafCount = colIds.length;
1230
- for (var i = 0; i < leafCount; i++) {
1231
- var index = this.getColumnIndex(colIds[i]);
1232
- if (index >= 0) {
1233
- colIndices.push(index);
1234
- }
1235
- }
1236
- return colIndices.sort(ColumnGroupingPlugin._ascSortLogic); // TODO: This could be unnecessary
1230
+ var validColList = host.getValidColumnList(colIds);
1231
+ colIndices = validColList.map(ColumnGroupingPlugin.getObjectIndex);
1232
+ return colIndices;
1237
1233
  }
1238
-
1239
1234
  return null;
1240
1235
  };
1241
1236
 
@@ -1715,5 +1710,25 @@ ColumnGroupingPlugin.prototype.unpinGroup = function (groupId, dest) {
1715
1710
  this.moveGroup(groupId, destId);
1716
1711
  }
1717
1712
  };
1713
+
1714
+ /** Get column index from column object
1715
+ * @public
1716
+ * @function
1717
+ * @param {Object} column
1718
+ * @return {number}
1719
+ */
1720
+ ColumnGroupingPlugin.getObjectIndex = function (column) {
1721
+ return column["index"];
1722
+ };
1723
+
1724
+ /** Get column id from column object
1725
+ * @public
1726
+ * @function
1727
+ * @param {Object} column
1728
+ * @return {string}
1729
+ */
1730
+ ColumnGroupingPlugin.getObjectId = function (column) {
1731
+ return column["id"];
1732
+ };
1718
1733
  export default ColumnGroupingPlugin;
1719
1734
  export { ColumnGroupingPlugin, ColumnGroupingPlugin as ColumnGrouping, ColumnGroupingPlugin as ColumnGroupingExtension };
@@ -32,8 +32,8 @@ declare namespace ColumnStackPlugin {
32
32
  id: string,
33
33
  spreading?: boolean|null,
34
34
  collapsed?: boolean|null,
35
- children: (string)[]|null,
36
- fields: (string)[]|null,
35
+ children?: (string)[]|null,
36
+ fields?: (string)[]|null,
37
37
  name?: string|null,
38
38
  activeColumn?: string|null
39
39
  };
@@ -88,7 +88,11 @@ declare class ColumnStackPlugin extends GridPlugin {
88
88
 
89
89
  public stackColumns(colRefs?: (number|string)[]|null, stackId?: string|null, options?: ColumnStackPlugin.StackConfiguration|null): boolean;
90
90
 
91
- public setStack(colRefs?: (number|string)[]|null, activeColRef?: number|string|null): boolean;
91
+ public setStack(colRefs?: (number|string)[]|null, activeColRef?: (number|string)|null): boolean;
92
+
93
+ public setStacks(stacks: (ColumnStackPlugin.StackDefinition)[]|null): void;
94
+
95
+ public getStacks(): (ColumnStackPlugin.StackDefinition)[];
92
96
 
93
97
  public unstackColumns(colIndices?: (number)[]|null): boolean;
94
98
 
@@ -120,6 +124,8 @@ declare class ColumnStackPlugin extends GridPlugin {
120
124
 
121
125
  public getStackName(stackId: string): string;
122
126
 
127
+ public getActiveColumnId(stackId: string): string;
128
+
123
129
  public getActiveColumnField(stackId: string): string;
124
130
 
125
131
  public getActiveColumnIndex(stackId: string): number;