@refinitiv-ui/efx-grid 6.0.3 → 6.0.4

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 (178) hide show
  1. package/lib/column-dragging/es6/ColumnDragging.d.ts +49 -0
  2. package/lib/column-dragging/es6/ColumnDragging.js +764 -0
  3. package/lib/column-dragging/es6/index.d.ts +1 -0
  4. package/lib/column-dragging/es6/index.js +1 -0
  5. package/lib/core/dist/core.css +1 -1
  6. package/lib/core/dist/core.js +389 -1070
  7. package/lib/core/dist/core.min.js +1 -1
  8. package/lib/core/es6/data/ColumnStats.d.ts +2 -2
  9. package/lib/core/es6/data/DataCache.d.ts +4 -4
  10. package/lib/core/es6/data/DataTable.d.ts +5 -5
  11. package/lib/core/es6/data/DataTable.js +1 -1
  12. package/lib/core/es6/data/DataView.d.ts +12 -12
  13. package/lib/core/es6/data/SegmentCollection.d.ts +3 -3
  14. package/lib/core/es6/data/WrappedView.d.ts +13 -13
  15. package/lib/core/es6/grid/Core.d.ts +29 -27
  16. package/lib/core/es6/grid/Core.js +26 -4
  17. package/lib/core/es6/grid/ILayoutGrid.d.ts +15 -15
  18. package/lib/core/es6/grid/LayoutGrid.js +54 -26
  19. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +66 -0
  20. package/lib/core/es6/grid/components/Cell.d.ts +4 -4
  21. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +1 -1
  22. package/lib/core/es6/grid/components/CellSpans.d.ts +8 -8
  23. package/lib/core/es6/grid/components/Column.d.ts +1 -1
  24. package/lib/core/es6/grid/components/ElementWrapper.d.ts +6 -6
  25. package/lib/core/es6/grid/components/Scrollbar.d.ts +1 -1
  26. package/lib/core/es6/grid/components/StretchedCells.js +2 -2
  27. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  28. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +147 -81
  29. package/lib/core/es6/grid/util/Conflator.d.ts +2 -2
  30. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +3 -3
  31. package/lib/core/es6/grid/util/HttpRequest.d.ts +2 -2
  32. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +1 -1
  33. package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
  34. package/lib/core/es6/grid/util/SectionSettings.d.ts +5 -5
  35. package/lib/core/es6/grid/util/SectionSettings.js +5 -0
  36. package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
  37. package/lib/core/es6/grid/util/TrackLayout.d.ts +7 -3
  38. package/lib/core/es6/grid/util/TrackLayout.js +27 -0
  39. package/lib/core/es6/grid/util/util.d.ts +2 -2
  40. package/lib/core/es6/index.d.ts +1 -5
  41. package/lib/core/es6/index.js +1 -7
  42. package/lib/core/es6/tr-grid-theme.js +1 -1
  43. package/lib/filter-dialog/lib/filter-dialog.d.ts +1 -0
  44. package/lib/filter-dialog/lib/filter-dialog.js +73 -26
  45. package/lib/filter-dialog/themes/base-checkbox.less +8 -1
  46. package/lib/filter-dialog/themes/base.less +69 -1
  47. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
  48. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
  49. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
  50. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
  51. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
  52. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
  53. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
  54. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
  55. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
  56. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
  57. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
  58. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
  59. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
  60. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
  61. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
  62. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
  63. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
  64. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
  65. package/lib/grid/lib/efx-grid.d.ts +8 -5
  66. package/lib/grid/lib/efx-grid.js +10 -4
  67. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  68. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  69. package/lib/grid/themes/halo/efx-grid.less +33 -39
  70. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  71. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  72. package/lib/index.d.ts +2 -0
  73. package/lib/index.js +2 -0
  74. package/lib/row-segmenting/es6/RowSegmenting.d.ts +7 -2
  75. package/lib/row-segmenting/es6/RowSegmenting.js +94 -9
  76. package/lib/rt-grid/dist/rt-grid.js +567 -1171
  77. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  78. package/lib/rt-grid/es6/ColumnDefinition.d.ts +5 -3
  79. package/lib/rt-grid/es6/ColumnDefinition.js +17 -108
  80. package/lib/rt-grid/es6/DataConnector.d.ts +3 -3
  81. package/lib/rt-grid/es6/Grid.d.ts +17 -9
  82. package/lib/rt-grid/es6/Grid.js +201 -101
  83. package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
  84. package/lib/rt-grid/es6/RowDefSorter.js +137 -0
  85. package/lib/rt-grid/es6/RowDefinition.d.ts +9 -7
  86. package/lib/rt-grid/es6/RowDefinition.js +6 -0
  87. package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -1
  88. package/lib/rt-grid/es6/SnapshotFiller.js +23 -0
  89. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +2 -2
  90. package/lib/tr-grid-checkbox/es6/Checkbox.js +38 -20
  91. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +46 -9
  92. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +8 -4
  93. package/lib/tr-grid-column-stack/es6/ColumnStack.js +240 -125
  94. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +1 -1
  95. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +18 -12
  96. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +7 -4
  97. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +93 -2
  98. package/lib/tr-grid-printer/es6/CellWriter.d.ts +3 -3
  99. package/lib/tr-grid-printer/es6/GridPrinter.d.ts +1 -1
  100. package/lib/tr-grid-printer/es6/GridPrinter.js +26 -13
  101. package/lib/tr-grid-printer/es6/PrintTrait.d.ts +2 -2
  102. package/lib/tr-grid-printer/es6/SectionWriter.d.ts +3 -3
  103. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +2 -1
  104. package/lib/tr-grid-row-dragging/es6/RowDragging.js +29 -143
  105. package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +7 -2
  106. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +97 -7
  107. package/lib/tr-grid-row-selection/es6/RowSelection.js +10 -0
  108. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +1 -1
  109. package/lib/tr-grid-textformatting/es6/TextFormatting.js +12 -0
  110. package/lib/tr-grid-util/es6/DragUI.d.ts +16 -0
  111. package/lib/tr-grid-util/es6/DragUI.js +214 -0
  112. package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -0
  113. package/lib/tr-grid-util/es6/ElementObserver.js +28 -1
  114. package/lib/tr-grid-util/es6/ElfUtil.js +1 -1
  115. package/lib/tr-grid-util/es6/FieldFormatter.js +7 -5
  116. package/lib/tr-grid-util/es6/GridPlugin.js +8 -4
  117. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +2 -0
  118. package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
  119. package/lib/tr-grid-util/es6/RowPainter.js +41 -11
  120. package/lib/tr-grid-util/es6/formula/Formula.js +9 -1
  121. package/lib/types/es6/Checkbox.d.ts +2 -2
  122. package/lib/types/es6/ColumnStack.d.ts +8 -4
  123. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +3 -2
  124. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +2 -1
  125. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +20 -18
  126. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +2 -1
  127. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +3 -2
  128. package/lib/types/es6/CompositeGrid/Plugin.d.ts +28 -0
  129. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
  130. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +5 -4
  131. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +2 -1
  132. package/lib/types/es6/CompositeGrid/index.d.ts +9 -9
  133. package/lib/types/es6/ConditionalColoring.d.ts +1 -1
  134. package/lib/types/es6/Core/data/ColumnStats.d.ts +2 -2
  135. package/lib/types/es6/Core/data/DataCache.d.ts +4 -4
  136. package/lib/types/es6/Core/data/DataTable.d.ts +5 -5
  137. package/lib/types/es6/Core/data/DataView.d.ts +12 -12
  138. package/lib/types/es6/Core/data/SegmentCollection.d.ts +3 -3
  139. package/lib/types/es6/Core/data/WrappedView.d.ts +13 -13
  140. package/lib/types/es6/Core/grid/Core.d.ts +29 -27
  141. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +15 -15
  142. package/lib/types/es6/Core/grid/components/Cell.d.ts +4 -4
  143. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +1 -1
  144. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +8 -8
  145. package/lib/types/es6/Core/grid/components/Column.d.ts +1 -1
  146. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +6 -6
  147. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +1 -1
  148. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +14 -6
  149. package/lib/types/es6/Core/grid/util/Conflator.d.ts +2 -2
  150. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +3 -3
  151. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +2 -2
  152. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +1 -1
  153. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
  154. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +5 -5
  155. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
  156. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +7 -3
  157. package/lib/types/es6/Core/grid/util/util.d.ts +2 -2
  158. package/lib/types/es6/Core/index.d.ts +1 -5
  159. package/lib/types/es6/ExtensionOptions.d.ts +2 -0
  160. package/lib/types/es6/InCellEditing.d.ts +7 -4
  161. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +5 -3
  162. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +3 -3
  163. package/lib/types/es6/RealtimeGrid/Grid.d.ts +17 -9
  164. package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
  165. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +9 -7
  166. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -1
  167. package/lib/types/es6/RowDragging.d.ts +2 -1
  168. package/lib/types/es6/RowGrouping.d.ts +7 -2
  169. package/lib/types/es6/RowSegmenting.d.ts +7 -2
  170. package/lib/types/es6/TextFormatting.d.ts +1 -1
  171. package/lib/versions.json +14 -13
  172. package/package.json +1 -1
  173. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  174. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +0 -615
  175. package/lib/core/es6/grid/plugins/Plugin.d.ts +0 -28
  176. package/lib/core/es6/grid/plugins/Plugin.js +0 -272
  177. package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
  178. package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +0 -28
@@ -13,6 +13,22 @@
13
13
  * @property {boolean=} mutiplyBy100=false Alias of multiplyBy100
14
14
  */
15
15
 
16
+ /** @private
17
+ * @function
18
+ * @param {number} num Absolute number
19
+ * @return {number}
20
+ */
21
+ var _multiplyByHundred = function(num) {
22
+ var intPart = num | 0;
23
+ if(intPart && num > intPart) {
24
+ var str = num + "";
25
+ var at = str.indexOf(".");
26
+ var fracStr = str.slice(at + 1) + "00";
27
+ return +(str.slice(0, at) + fracStr.slice(0, 2) + "." + fracStr.slice(2));
28
+ }
29
+ return num * 100;
30
+ };
31
+
16
32
  /** NumberFormatter provides a way to format the given number quickly.
17
33
  * @constructor
18
34
  * @param {NumberFormatter~Options=} options
@@ -198,6 +214,24 @@ NumberFormatter.padDecimalPartWithZeroes = function (str, precision) {
198
214
  }
199
215
  return str;
200
216
  };
217
+ /** @public
218
+ * @function
219
+ * @param {number} num
220
+ * @return {number}
221
+ * @example
222
+ * NumberFormatter.multiplyByHundred(1); // 1
223
+ * NumberFormatter.multiplyByHundred(1.1); // 110
224
+ * NumberFormatter.multiplyByHundred(1.21); // 121
225
+ * NumberFormatter.multiplyByHundred(1.321); // 132.1
226
+ * NumberFormatter.multiplyByHundred(-1.4321); // -143.21
227
+ */
228
+ NumberFormatter.multiplyByHundred = function (num) {
229
+ if(num < 0) {
230
+ return -(_multiplyByHundred(-num));
231
+ }
232
+ return _multiplyByHundred(num);
233
+ };
234
+
201
235
 
202
236
  /** @public
203
237
  * @param {Object=} options
@@ -206,20 +240,28 @@ NumberFormatter.padDecimalPartWithZeroes = function (str, precision) {
206
240
  NumberFormatter.prototype.getOptions = function(options) { // serialize
207
241
  if(!options) { options = {}; }
208
242
 
243
+ var formatType = options["formatType"];
244
+
209
245
  options["precisionEnabled"] = this._precisionEnabled;
210
246
  options["decimalPlaces"] = this._precision;
211
247
  options["plusSign"] = this._plusSignEnabled;
212
248
  options["separator"] = this._separatorEnabled;
213
- options["percentSign"] = this._percentSignEnabled;
214
- var su = "";
215
- if(this._scaler == "b") {
216
- su = "billion";
217
- } else if(this._scaler == "m") {
218
- su = "million";
249
+
250
+ if(formatType === "scaled" || formatType === "scaledvalue") {
251
+ var su = "";
252
+ if(this._scaler == "b") {
253
+ su = "billion";
254
+ } else if(this._scaler == "m") {
255
+ su = "million";
256
+ }
257
+ options["scalingUnit"] = su;
258
+ }
259
+
260
+ if(formatType === "percent") {
261
+ options["percentSign"] = this._percentSignEnabled;
262
+ options["mutiplyBy100"] = this._multiplyBy100Enabled;
263
+ options["multiplyBy100"] = this._multiplyBy100Enabled;
219
264
  }
220
- options["scalingUnit"] = su;
221
- options["mutiplyBy100"] = this._multiplyBy100Enabled;
222
- options["multiplyBy100"] = this._multiplyBy100Enabled;
223
265
  return options;
224
266
  };
225
267
 
@@ -240,7 +282,7 @@ NumberFormatter.prototype.format = function(origVal) {
240
282
  }
241
283
  }
242
284
 
243
- // Make value to be positive value for simpler logic
285
+ // Simplify logic by making positive value
244
286
  var val, sign;
245
287
  if(origVal >= 0) {
246
288
  val = origVal;
@@ -249,14 +291,18 @@ NumberFormatter.prototype.format = function(origVal) {
249
291
  val = -origVal;
250
292
  sign = "-";
251
293
  }
252
- if(this._multiplyBy100Enabled) {
253
- val = val * 100;
254
- }
255
- var absVal = val;
256
294
  var scalingMode = this._percentFormatEnabled ? "" : this._scaler; // Percent formatting overwrite scaling mode
257
295
 
258
- // Perform rounding
296
+ if(this._multiplyBy100Enabled) {
297
+ if(this._precisionEnabled || scalingMode) {
298
+ val = val * 100; // Since value will be rounded later, there is no need to avoid rounding issue
299
+ } else {
300
+ val = _multiplyByHundred(val);
301
+ }
302
+ }
259
303
 
304
+ var absVal = val;
305
+ // Perform scaling
260
306
  if (scalingMode) {
261
307
  if (scalingMode === "b" && val < 1e9) {
262
308
  scalingMode = "m";
@@ -270,11 +316,8 @@ NumberFormatter.prototype.format = function(origVal) {
270
316
  } else if (scalingMode === "b") {
271
317
  val = val / 1e9;
272
318
  }
273
-
274
- if (!this._precisionEnabled) {
275
- val = Math.round(val * 100) / 100;
276
- }
277
319
  }
320
+ // Perform rounding
278
321
  if (this._precisionEnabled) {
279
322
  if (this._precision > 0) {
280
323
  var deno = NumberFormatter._denominator[this._precision];
@@ -282,6 +325,8 @@ NumberFormatter.prototype.format = function(origVal) {
282
325
  } else {
283
326
  val = Math.round(val);
284
327
  }
328
+ } else if(scalingMode) {
329
+ val = Math.round(val * 100) / 100;
285
330
  }
286
331
 
287
332
  // Convert value to string
@@ -72,6 +72,29 @@ RowPainter._styles = prettifyCss([
72
72
  ]
73
73
  ]);
74
74
 
75
+ /** @private
76
+ * @param {Object} cell
77
+ * @param {string=} className
78
+ */
79
+ RowPainter._applyColorTagClass = function(cell, className) {
80
+ if (!cell) {
81
+ return;
82
+ }
83
+ var el = cell.getElement();
84
+ if (el) {
85
+ if (el._tagColoringClass !== className) {
86
+ if (el._tagColoringClass) {
87
+ el.classList.remove(el._tagColoringClass);
88
+ el._tagColoringClass = null;
89
+ }
90
+ if (className) {
91
+ el.classList.add(className);
92
+ el._tagColoringClass = className;
93
+ }
94
+ }
95
+ }
96
+ };
97
+
75
98
  /** @public
76
99
  * @param {tr.Grid} grid
77
100
  */
@@ -137,18 +160,23 @@ RowPainter.prototype.removeHeaderStyle = function(section, columnIndex, rowIndex
137
160
  * @param {Object} cell Cell container
138
161
  */
139
162
  RowPainter.prototype._removeHeaderStyle = function(cell) {
140
- if(!cell || !cell._groupHeaderStyle) {
163
+ if(!cell) {
141
164
  return;
142
165
  }
143
- cell._groupHeaderStyle = false;
144
- cell.removeClass("folder");
145
- cell.removeClass("closed");
146
- cell.removeClass("content-header");
147
- cell.removeClass("color-tag");
148
- cell.removeClass("main-group");
149
- cell.setStyle("paddingLeft", "");
150
- cell.removeIcon();
151
- cell.unlisten("click", this._onCellClicked);
166
+
167
+ RowPainter._applyColorTagClass(cell, "");
168
+
169
+ if(cell._groupHeaderStyle) {
170
+ cell._groupHeaderStyle = false;
171
+ cell.removeClass("folder");
172
+ cell.removeClass("closed");
173
+ cell.removeClass("content-header");
174
+ cell.removeClass("color-tag");
175
+ cell.removeClass("main-group");
176
+ cell.setStyle("paddingLeft", "");
177
+ cell.removeIcon();
178
+ cell.unlisten("click", this._onCellClicked);
179
+ }
152
180
  };
153
181
 
154
182
  /** @public
@@ -209,6 +237,7 @@ RowPainter.prototype.applyHeaderStyle = function(e) {
209
237
  }
210
238
  cell.enableClass("closed", e.collapsed ? true : false);
211
239
  cell.enableClass("color-tag", true);
240
+ RowPainter._applyColorTagClass(cell, e.colorTagClass);
212
241
  cell.setStyle("paddingLeft", (e.indentSize > 0) ? e.indentSize + "px" : "");
213
242
  };
214
243
 
@@ -218,7 +247,7 @@ RowPainter.prototype.applyHeaderStyle = function(e) {
218
247
  */
219
248
  RowPainter.prototype.applyContentAsHeaderStyle = function (e) {
220
249
  var cell = e.cell;
221
-
250
+ cell._groupHeaderStyle = true;
222
251
  cell.addClass("folder"); // Required by the fallback arrow from the CSS rules. TODO: Change this
223
252
  cell.enableClass("content-header", true);
224
253
  cell.enableClass("closed", e.collapsed);
@@ -236,6 +265,7 @@ RowPainter.prototype.applyRowStyle = function(e) {
236
265
  var indentSize = e.indentSize;
237
266
  cell.setStyle("paddingLeft", (indentSize > 0) ? indentSize + "px" : "");
238
267
  cell.enableClass("color-tag", e.nonGroupRow ? false : true);
268
+ RowPainter._applyColorTagClass(cell, e.colorTagClass);
239
269
  };
240
270
 
241
271
  /** @private
@@ -345,7 +345,15 @@ Formula.toUpperCase = function(exp) {
345
345
  exp = exp.toUpperCase(); // Upper case the remaining
346
346
 
347
347
  // May have the new string token from ADC field with parameter
348
- exp = exp.replace(/TR\.[\w_ ]+\([^\(\)]*\)(\.[a-zA-Z]+)*/g, Formula._encloseWithTR);
348
+ // Regex for adc fileds
349
+ // TR : start with tr
350
+ // (\.[\w]+)+ : dot follow by any character at least 1
351
+ // \( : start parentheses
352
+ // [^\(\)]* : any except parentheses
353
+ // \) : end parentheses
354
+ // (\.[a-zA-Z]+)* : dot follow by any character (optional)
355
+
356
+ exp = exp.replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g, Formula._encloseWithTR);
349
357
 
350
358
  exp = Formula.resolveTokens(exp, tokens, calcHierarchy); // Restore the string
351
359
 
@@ -1,7 +1,7 @@
1
1
  import {Ext} from '../../tr-grid-util/es6/Ext.js';
2
2
  import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
3
3
  import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
4
- import {injectCss, prettifyCss, extendObject} from "../../tr-grid-util/es6/Util.js";
4
+ import {injectCss, prettifyCss} from "../../tr-grid-util/es6/Util.js";
5
5
 
6
6
  declare namespace CheckboxPlugin {
7
7
 
@@ -42,7 +42,7 @@ declare class CheckboxPlugin extends GridPlugin {
42
42
 
43
43
  public getDisplayColumn(): number;
44
44
 
45
- public getCheckbox(sectionRef: any, rowIndex: number): Element;
45
+ public getCheckbox(sectionRef: any, rowIndex: number): Element|null;
46
46
 
47
47
  public selectAll(): void;
48
48
 
@@ -9,6 +9,10 @@ import { preventDefault } from "../../tr-grid-util/es6/EventDispatcher.js";
9
9
 
10
10
  declare namespace ColumnStackPlugin {
11
11
 
12
+ type Options = {
13
+ fields: (string)[]
14
+ };
15
+
12
16
  type ColumnOptions = {
13
17
  stackId?: string,
14
18
  stack?: (string|StackOptions)
@@ -34,11 +38,11 @@ declare class ColumnStackPlugin extends GridPlugin {
34
38
 
35
39
  public getConfigObject(gridOptions?: any): any;
36
40
 
37
- public getMemberIndices(colIndex: number): (number)[];
41
+ public getMemberIndices(colIndex: number): (number)[]|null;
38
42
 
39
- public collapseGroup(colIndex: number, collapsed?: boolean): (number)[];
43
+ public collapseGroup(colIndex: number, collapsed?: boolean): (number)[]|null;
40
44
 
41
- public expandGroup(colIndex: number): (number)[];
45
+ public expandGroup(colIndex: number): (number)[]|null;
42
46
 
43
47
  public isColumnStackable(colIndices: (number)[]): boolean;
44
48
 
@@ -60,7 +64,7 @@ declare class ColumnStackPlugin extends GridPlugin {
60
64
 
61
65
  public getStackId(colIndex: number): string;
62
66
 
63
- public stackColumns(colIndices?: (number)[], stackId?: string, options?: any): boolean;
67
+ public stackColumns(colRefs?: (number|string)[], stackId?: string, options?: any): boolean;
64
68
 
65
69
  public setStack(colRefs: (number|string)[]): boolean;
66
70
 
@@ -1,6 +1,7 @@
1
1
  import Ext from "../../../tr-grid-util/es6/Ext.js";
2
2
  import Util from "../Core/grid/util/util.js";
3
- import { Plugin, ILayoutGrid, Core} from "../Core/index.js";
3
+ import Plugin from "./Plugin.js";
4
+ import { ILayoutGrid, Core} from "../Core/index.js";
4
5
 
5
6
  declare class ColumnSelectionPlugin extends Plugin {
6
7
 
@@ -28,7 +29,7 @@ declare class ColumnSelectionPlugin extends Plugin {
28
29
 
29
30
  public isSelectedColumn(colIndex: number): boolean;
30
31
 
31
- public getActiveGrid(): Core;
32
+ public getActiveGrid(): Core|null;
32
33
 
33
34
  public enableSingleSelectionMode(bool?: boolean): void;
34
35
 
@@ -1,6 +1,7 @@
1
1
  import Ext from "../../../tr-grid-util/es6/Ext.js";
2
2
  import Util from "../Core/grid/util/util.js";
3
- import { Plugin, Conflator } from "../Core/index.js";
3
+ import Plugin from "./Plugin.js";
4
+ import { Conflator } from "../Core/index.js";
4
5
  import TextWidthCalculator from "./TextWidthCalculator.js"
5
6
 
6
7
  declare class ColumnWidthAdjustingPlugin extends Plugin {
@@ -83,12 +83,12 @@ declare namespace CompositeGrid {
83
83
  formatter?: GridFormatter & CompositeGrid.ColumnFormatter,
84
84
  styles?: { [key: string]: string },
85
85
  classes?: { [key: string]: string },
86
+ stationary?: boolean,
86
87
  sortable?: boolean,
87
88
  sortBy?: string,
88
89
  sortLogic?: DataTable.SortLogic,
89
90
  sortingLogic?: DataTable.SortLogic,
90
- sorter?: DataTable.SortLogic,
91
- defaultSort?: SortableTitlePlugin.SortOrder
91
+ sorter?: DataTable.SortLogic
92
92
  };
93
93
 
94
94
  type DataModel = {
@@ -105,7 +105,7 @@ declare class CompositeGrid extends ElementWrapper {
105
105
 
106
106
  public getModel(): any;
107
107
 
108
- public getColumns(): (any)[];
108
+ public getColumns(): (any)[]|null;
109
109
 
110
110
  public addColumn(columnModel: any): void;
111
111
 
@@ -143,7 +143,7 @@ declare class CompositeGrid extends ElementWrapper {
143
143
 
144
144
  public autoResizeAllColumns(): void;
145
145
 
146
- public moveColumn(fromColIndex: number|(number)[], toColIndex: number): void;
146
+ public moveColumn(fromColIndex: number|(number)[], toColIndex: number): boolean;
147
147
 
148
148
  public freezeColumn(opt_colIndex?: number, pinnedRightColumns?: number): void;
149
149
 
@@ -151,17 +151,17 @@ declare class CompositeGrid extends ElementWrapper {
151
151
 
152
152
  public unpinColumn(columnList: string|(string)[]): void;
153
153
 
154
- public getPinnedColumns(): (string)[];
154
+ public getPinnedColumns(): (string)[]|null;
155
155
 
156
156
  public restorePinnedColumns(pinnedColumns: (string)[]): void;
157
157
 
158
158
  public addData(data: any|(any|any[])[], format?: string): void;
159
159
 
160
- public getDataView(): DataView;
160
+ public getDataView(): DataView|null;
161
161
 
162
- public getDataTable(): DataTable;
162
+ public getDataTable(): DataTable|null;
163
163
 
164
- public getDataRows(rowIndices: (number)[]): (any)[];
164
+ public getDataRows(rowIndices: (number)[]): (any)[]|null;
165
165
 
166
166
  public getColumnModel(colRef: number|string): any;
167
167
 
@@ -173,7 +173,7 @@ declare class CompositeGrid extends ElementWrapper {
173
173
 
174
174
  public getColumnIndex(columnId: string): number;
175
175
 
176
- public findColumnIndex(columnId: (string|number)[]|string, opt_includeNotFound?: boolean): (number)[]|number;
176
+ public findColumnIndex(columnId: (string|number)[]|string, opt_includeNotFound?: boolean): (number)[]|number|null;
177
177
 
178
178
  public getColumnCount(): number;
179
179
 
@@ -183,13 +183,13 @@ declare class CompositeGrid extends ElementWrapper {
183
183
 
184
184
  public collapseAllGroups(): void;
185
185
 
186
- public getGroupExpandingStates(): { [key: string]: boolean };
186
+ public getGroupExpandingStates(): { [key: string]: boolean }|null;
187
187
 
188
188
  public restoreGroupExpandingStates(states: any, opt_default?: boolean): void;
189
189
 
190
190
  public sortColumn(columnRef: string|number, direction: string): void;
191
191
 
192
- public getSortingStates(): (any)[];
192
+ public getSortingStates(): (any)[]|null;
193
193
 
194
194
  public restoreSortingStates(states: (any)[]): void;
195
195
 
@@ -213,17 +213,17 @@ declare class CompositeGrid extends ElementWrapper {
213
213
 
214
214
  public clearSelection(): void;
215
215
 
216
- public getSelectedRows(): (number)[];
216
+ public getSelectedRows(): (number)[]|null;
217
217
 
218
- public getSelectedDataRows(): (any)[];
218
+ public getSelectedDataRows(): (any)[]|null;
219
219
 
220
- public getSection(sectionRef: Core.SectionReference): ILayoutGrid;
220
+ public getSection(sectionRef: Core.SectionReference): ILayoutGrid|null;
221
221
 
222
- public addHeaderSection(sectionName: string): ILayoutGrid;
222
+ public addHeaderSection(sectionName: string): ILayoutGrid|null;
223
223
 
224
224
  public removeHeaderSection(sectionName: string): void;
225
225
 
226
- public addFooterSection(sectionName: string): ILayoutGrid;
226
+ public addFooterSection(sectionName: string): ILayoutGrid|null;
227
227
 
228
228
  public removeFooterSection(sectionName: string): void;
229
229
 
@@ -231,7 +231,7 @@ declare class CompositeGrid extends ElementWrapper {
231
231
 
232
232
  public scrollToColumn(colIndex: number, opt_leftOfView?: boolean): void;
233
233
 
234
- public getCoreGrid(): Core;
234
+ public getCoreGrid(): Core|null;
235
235
 
236
236
  public getRelativePosition(obj: ElementWrapper|Element|Event|MouseEvent): any;
237
237
 
@@ -271,6 +271,8 @@ declare class CompositeGrid extends ElementWrapper {
271
271
 
272
272
  public setScrollTop(px: number): void;
273
273
 
274
+ public requestRowRefresh(): void;
275
+
274
276
  public getConfigObject(gridOptions?: any): any;
275
277
 
276
278
  public setPagingState(currentPage: number, totalRows: number): void;
@@ -279,7 +281,7 @@ declare class CompositeGrid extends ElementWrapper {
279
281
 
280
282
  declare function tgtColModel(colIndex: number, name: string): void;
281
283
 
282
- declare function dataModel(): DataView;
284
+ declare function dataModel(): DataView|null;
283
285
 
284
286
  declare function colCount(columnIndex: number): string;
285
287
 
@@ -1,6 +1,7 @@
1
1
  import Ext from "../../../tr-grid-util/es6/Ext.js";
2
2
  import Util from "../Core/grid/util/util.js";
3
- import { Plugin, Core, ILayoutGrid } from "../Core/index.js";
3
+ import Plugin from "./Plugin.js";
4
+ import { Core, ILayoutGrid } from "../Core/index.js";
4
5
 
5
6
  declare class DragAndDropTitlePlugin extends Plugin {
6
7
 
@@ -1,6 +1,7 @@
1
1
  import Ext from "../../../tr-grid-util/es6/Ext.js";
2
2
  import Util from "../Core/grid/util/util.js";
3
- import { Plugin, ElementWrapper, Core } from "../Core/index.js";
3
+ import Plugin from "./Plugin.js";
4
+ import { ElementWrapper, Core } from "../Core/index.js";
4
5
 
5
6
  declare class DraggableContentPlugin extends Plugin {
6
7
 
@@ -14,7 +15,7 @@ declare class DraggableContentPlugin extends Plugin {
14
15
 
15
16
  public setDragContent(content: string|Element|ElementWrapper|any): void;
16
17
 
17
- public getDragBox(): ElementWrapper;
18
+ public getDragBox(): ElementWrapper|null;
18
19
 
19
20
  public getDragSource(): string;
20
21
 
@@ -0,0 +1,28 @@
1
+ import Ext from "../../../tr-grid-util/es6/Ext.js";
2
+ import Util from "../Core/grid/util/util.js";
3
+ import Core from "../Core/grid/Core.js"; // eslint-disable-line
4
+ import EventDispatcher from "../Core/grid/event/EventDispatcher.js";
5
+ import ElementWrapper from "../Core/grid/components/ElementWrapper.js"; // eslint-disable-line
6
+
7
+ declare class Plugin extends EventDispatcher {
8
+
9
+ constructor();
10
+
11
+ public getName(): string;
12
+
13
+ public initialize(owner: Core): void;
14
+
15
+ public unload(owner: Core): void;
16
+
17
+ public getRelativeGrid(e: Event|Element|ElementWrapper): Core|null;
18
+
19
+ public getGridElementFromPoint(x: number, y: number): Element|null;
20
+
21
+ }
22
+
23
+ declare function gridAPI(x: number, y: number): Element|null;
24
+
25
+ declare function to(e: any): void;
26
+
27
+ export default Plugin;
28
+ export { Plugin };
@@ -1,6 +1,7 @@
1
1
  import Ext from "../../../tr-grid-util/es6/Ext.js";
2
2
  import Util from "../Core/grid/util/util.js";
3
- import { Plugin, Core } from "../Core/index.js";
3
+ import Plugin from "./Plugin.js";
4
+ import { Core } from "../Core/index.js";
4
5
 
5
6
  declare class ResizableTitlePlugin extends Plugin {
6
7
 
@@ -1,6 +1,7 @@
1
1
  import Ext from "../../../tr-grid-util/es6/Ext.js";
2
2
  import Util from "../Core/grid/util/util.js";
3
- import { Plugin, Core, ILayoutGrid } from "../Core/index.js";
3
+ import Plugin from "./Plugin.js";
4
+ import { Core, ILayoutGrid } from "../Core/index.js";
4
5
 
5
6
  declare class RowSelectionPlugin extends Plugin {
6
7
 
@@ -8,7 +9,7 @@ declare class RowSelectionPlugin extends Plugin {
8
9
 
9
10
  public clearSelectedRows(opt_preserveAnchor?: boolean, opt_activeGrid?: Core): void;
10
11
 
11
- public getActiveGrid(): Core;
12
+ public getActiveGrid(): Core|null;
12
13
 
13
14
  public setActiveGrid(grid: Core): void;
14
15
 
@@ -16,9 +17,9 @@ declare class RowSelectionPlugin extends Plugin {
16
17
 
17
18
  public getRowAnchor(opt_sectRef?: Core.SectionReference): number;
18
19
 
19
- public getFirstSelectedIndex(opt_sectRef?: Core.SectionReference): number|null;
20
+ public getFirstSelectedIndex(opt_sectRef?: Core.SectionReference): number|null|null;
20
21
 
21
- public getSelectedRows(opt_sectRef?: Core.SectionReference): (number)[];
22
+ public getSelectedRows(opt_sectRef?: Core.SectionReference): (number)[]|null;
22
23
 
23
24
  public getSelectedRowCount(opt_sectRef?: Core.SectionReference): number;
24
25
 
@@ -1,6 +1,7 @@
1
1
  import Ext from "../../../tr-grid-util/es6/Ext.js";
2
2
  import Util from "../Core/grid/util/util.js";
3
- import { Plugin, SectionSettings, ILayoutGrid } from "../Core/index.js";
3
+ import Plugin from "./Plugin.js";
4
+ import { SectionSettings, ILayoutGrid } from "../Core/index.js";
4
5
 
5
6
  declare class TreeIndentingPlugin extends Plugin {
6
7
 
@@ -1,9 +1,9 @@
1
- // Composite grid
2
- import { CompositeGrid } from "./CompositeGrid.js";
3
-
4
-
5
-
6
- export {
7
- CompositeGrid
8
- };
9
-
1
+ // Composite grid
2
+ import { CompositeGrid } from "./CompositeGrid.js";
3
+
4
+
5
+
6
+ export {
7
+ CompositeGrid
8
+ };
9
+
@@ -46,7 +46,7 @@ declare class ConditionalColoringPlugin extends GridPlugin {
46
46
 
47
47
  public getConfigObject(gridOptions?: any): any;
48
48
 
49
- public setColumnColoring(colIndex: number, columnOptions: ConditionalColoringPlugin.ColumnOptions): void;
49
+ public setColumnColoring(colIndex: number, columnOptions?: (ConditionalColoringPlugin.ColumnOptions|null)): void;
50
50
 
51
51
  public setColumnBlinking(colIndex: number, blinkingOptions?: (boolean|ConditionalColoringPlugin.Blinking), field?: string): void;
52
52
 
@@ -14,7 +14,7 @@ declare class ColumnStats {
14
14
 
15
15
  public setColumnDataGetter(func: ((...params: any[]) => any)): void;
16
16
 
17
- public getColumnDataGetter(): ((...params: any[]) => any);
17
+ public getColumnDataGetter(): ((...params: any[]) => any)|null;
18
18
 
19
19
  public getSum(): number;
20
20
 
@@ -32,7 +32,7 @@ declare class ColumnStats {
32
32
 
33
33
  public getMidRange(): number;
34
34
 
35
- public getCachedColumnData(): (number)[];
35
+ public getCachedColumnData(): (number)[]|null;
36
36
 
37
37
  public markDirty(): boolean;
38
38
 
@@ -29,9 +29,9 @@ declare class DataCache extends EventDispatcher {
29
29
 
30
30
  public getData(rid: string, cid: string): any;
31
31
 
32
- public getAllRics(): { [key: string]: any };
32
+ public getAllRics(): { [key: string]: any }|null;
33
33
 
34
- public getAllRowIds(): (string)[];
34
+ public getAllRowIds(): (string)[]|null;
35
35
 
36
36
  public hasRowId(rid: string): boolean;
37
37
 
@@ -57,7 +57,7 @@ declare class DataCache extends EventDispatcher {
57
57
 
58
58
  public resetStaticFields(): void;
59
59
 
60
- public getStaticFields(): { [key: string]: number };
60
+ public getStaticFields(): { [key: string]: number }|null;
61
61
 
62
62
  public dump(options?: any): (any)[];
63
63
 
@@ -65,7 +65,7 @@ declare class DataCache extends EventDispatcher {
65
65
 
66
66
  public setDataCloudSettings(userId: string, productId: string, url: string, opt_lang?: string): void;
67
67
 
68
- public getDataCloudFields(): (string)[];
68
+ public getDataCloudFields(): (string)[]|null;
69
69
 
70
70
  public addDataCloudFields(fields: (string)[]|string): boolean;
71
71
 
@@ -51,9 +51,9 @@ declare class DataTable extends DataCache {
51
51
 
52
52
  public removeAllRows(suppressEvent?: boolean): void;
53
53
 
54
- public moveRow(fromIndex: (number)[]|number, toIndex: number, suppressEvent?: boolean): (string)[]|string;
54
+ public moveRow(fromIndex: (number)[]|number, toIndex: number, suppressEvent?: boolean): (string)[]|string|null;
55
55
 
56
- public moveRows(startIndex: number|string, toIndex: number|string, opt_count?: number, suppressEvent?: boolean): (string)[];
56
+ public moveRows(startIndex: number|string, toIndex: number|string, opt_count?: number, suppressEvent?: boolean): (string)[]|null;
57
57
 
58
58
  public swapRow(fromIndex: number, toIndex: number): void;
59
59
 
@@ -85,7 +85,7 @@ declare class DataTable extends DataCache {
85
85
 
86
86
  public getSegmentParentRowId(rid: string): string;
87
87
 
88
- public getSegmentValues(rids?: (string)[]): (number)[];
88
+ public getSegmentValues(rids?: (string)[]): (number)[]|null;
89
89
 
90
90
  public fillSegment(segmentId: string): void;
91
91
 
@@ -101,9 +101,9 @@ declare class DataTable extends DataCache {
101
101
 
102
102
  public removeAllSegmentChildren(): boolean;
103
103
 
104
- public getSegmentIds(): (string)[];
104
+ public getSegmentIds(): (string)[]|null;
105
105
 
106
- public getSegmentChildIds(segmentId: string): (string)[];
106
+ public getSegmentChildIds(segmentId: string): (string)[]|null;
107
107
 
108
108
  public sortSegments(compare: ((...params: any[]) => any)): void;
109
109