@refinitiv-ui/efx-grid 6.0.0 → 6.0.3

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 (151) hide show
  1. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +13 -1
  2. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
  3. package/lib/column-selection-dialog/lib/column-selection-dialog.js +226 -23
  4. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  5. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  6. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  7. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  8. package/lib/core/dist/core.css +1 -1
  9. package/lib/core/dist/core.js +10158 -7908
  10. package/lib/core/dist/core.min.js +1 -1
  11. package/lib/core/es6/data/DataTable.js +32 -10
  12. package/lib/core/es6/data/DataView.d.ts +16 -7
  13. package/lib/core/es6/data/DataView.js +172 -49
  14. package/lib/core/es6/data/Segment.d.ts +2 -0
  15. package/lib/core/es6/data/Segment.js +7 -0
  16. package/lib/core/es6/data/WrappedView.d.ts +289 -0
  17. package/lib/core/es6/data/WrappedView.js +1319 -0
  18. package/lib/core/es6/grid/Core.d.ts +13 -0
  19. package/lib/core/es6/grid/Core.js +406 -160
  20. package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
  21. package/lib/core/es6/grid/ILayoutGrid.js +45 -2
  22. package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
  23. package/lib/core/es6/grid/LayoutGrid.js +257 -82
  24. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
  25. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +316 -24
  26. package/lib/core/es6/grid/components/Column.js +8 -2
  27. package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
  28. package/lib/core/es6/grid/components/HScrollbar.js +20 -4
  29. package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
  30. package/lib/core/es6/grid/util/TrackLayout.js +2 -3
  31. package/lib/core/es6/tr-grid-theme.js +1 -1
  32. package/lib/filter-dialog/lib/checkbox-list.d.ts +13 -1
  33. package/lib/filter-dialog/lib/filter-dialog.d.ts +13 -1
  34. package/lib/filter-dialog/lib/filter-dialog.js +24 -9
  35. package/lib/grid/lib/efx-grid.d.ts +27 -8
  36. package/lib/grid/lib/efx-grid.js +114 -115
  37. package/lib/grid/themes/base.less +5 -3
  38. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  39. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  40. package/lib/grid/themes/halo/efx-grid.less +69 -32
  41. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  42. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  43. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  44. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  45. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  46. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  47. package/lib/index.d.ts +56 -56
  48. package/lib/index.js +56 -56
  49. package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
  50. package/lib/row-segmenting/es6/RowSegmenting.js +43 -12
  51. package/lib/rt-grid/dist/rt-grid.js +10293 -7865
  52. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  53. package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
  54. package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
  55. package/lib/rt-grid/es6/Grid.d.ts +14 -7
  56. package/lib/rt-grid/es6/Grid.js +244 -75
  57. package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
  58. package/lib/rt-grid/es6/RowDefinition.js +52 -2
  59. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
  60. package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
  61. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +4 -1
  62. package/lib/tr-grid-checkbox/es6/Checkbox.js +41 -14
  63. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
  64. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
  65. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
  66. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
  67. package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
  68. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +6 -1
  69. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
  70. package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
  71. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +1 -1
  72. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +13 -1
  73. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -3
  74. package/lib/tr-grid-row-dragging/es6/RowDragging.js +165 -70
  75. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  76. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
  77. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
  78. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +13 -9
  79. package/lib/tr-grid-row-selection/es6/RowSelection.js +220 -29
  80. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
  81. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
  82. package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
  83. package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
  84. package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
  85. package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
  86. package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
  87. package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
  88. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
  89. package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
  90. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
  91. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
  92. package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
  93. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
  94. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
  95. package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
  96. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
  97. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +10 -2
  98. package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
  99. package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
  100. package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
  101. package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
  102. package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
  103. package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
  104. package/lib/tr-grid-util/es6/RowPainter.js +82 -20
  105. package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
  106. package/lib/tr-grid-util/es6/Table.d.ts +13 -13
  107. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
  108. package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
  109. package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
  110. package/lib/tr-grid-util/es6/Util.d.ts +6 -6
  111. package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
  112. package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
  113. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
  114. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
  115. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
  116. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
  117. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
  118. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
  119. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
  120. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
  121. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
  122. package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
  123. package/lib/types/es6/CellSelection.d.ts +1 -1
  124. package/lib/types/es6/Checkbox.d.ts +4 -1
  125. package/lib/types/es6/ColumnGrouping.d.ts +1 -0
  126. package/lib/types/es6/ColumnSelection.d.ts +5 -1
  127. package/lib/types/es6/Core/data/DataView.d.ts +16 -7
  128. package/lib/types/es6/Core/data/Segment.d.ts +2 -0
  129. package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
  130. package/lib/types/es6/Core/grid/Core.d.ts +13 -0
  131. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
  132. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
  133. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
  134. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
  135. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
  136. package/lib/types/es6/FilterInput.d.ts +4 -2
  137. package/lib/types/es6/InCellEditing.d.ts +1 -1
  138. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
  139. package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
  140. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
  141. package/lib/types/es6/RowColoring.d.ts +2 -0
  142. package/lib/types/es6/RowDragging.d.ts +1 -3
  143. package/lib/types/es6/RowFiltering.d.ts +2 -0
  144. package/lib/types/es6/RowSegmenting.d.ts +1 -0
  145. package/lib/types/es6/RowSelection.d.ts +13 -9
  146. package/lib/types/es6/Zoom.d.ts +2 -1
  147. package/lib/types/es6/index.d.ts +3 -0
  148. package/lib/versions.json +19 -19
  149. package/lib/zoom/es6/Zoom.d.ts +2 -1
  150. package/lib/zoom/es6/Zoom.js +11 -4
  151. package/package.json +9 -2
@@ -49,6 +49,10 @@ var _newArrayOfObject = function (num) {
49
49
  * @param {boolean=} bool
50
50
  */
51
51
  var _toggleInlineElement = function (elem, bool) {
52
+ if(!elem || elem.style.display === "none") {
53
+ return;
54
+ }
55
+
52
56
  var s = elem.style;
53
57
  if(bool == null) {
54
58
  bool = s.display !== "inline-block";
@@ -68,7 +72,7 @@ var _toggleInlineElement = function (elem, bool) {
68
72
  var MultiTableManager = function (gridElem) {
69
73
  this._onDelayedConfiguration = this._onDelayedConfiguration.bind(this);
70
74
  this._onConfiguration = this._onConfiguration.bind(this);
71
- this._onDataChanged = this._onDataChanged.bind(this);
75
+ this._onWrapCountChanged = this._onWrapCountChanged.bind(this);
72
76
 
73
77
  this._tables = [];
74
78
  if(gridElem) {
@@ -102,6 +106,10 @@ MultiTableManager.prototype._emeraldGrid = false;
102
106
  * @private
103
107
  */
104
108
  MultiTableManager.prototype._ready = false;
109
+ /** @type {number}
110
+ * @private
111
+ */
112
+ MultiTableManager.prototype._wrapSize = 0;
105
113
 
106
114
 
107
115
  /** @public
@@ -196,6 +204,7 @@ MultiTableManager._onVScrollbarSynchronization = function(vScrollbarHost, hScrol
196
204
  for(var i = 0; i < gridLen; ++i) {
197
205
  var gridElem = gridElems[i];
198
206
  var core = gridElem.api.getCoreGrid();
207
+
199
208
  _toggleInlineElement(gridElem, true);
200
209
  if(i > 0) {
201
210
  mainCore.synchronizeVScrollbar(core);
@@ -234,6 +243,8 @@ MultiTableManager.prototype.setGridConfig = function (configObj) {
234
243
  * @param {Object} e
235
244
  */
236
245
  MultiTableManager.prototype._onDelayedConfiguration = function (e) {
246
+ this._ready = false;
247
+ // TODO: Handle the case where config is changed at runtime
237
248
  setTimeout(this._onConfiguration, 10); // Add delay to ensure that scrollbars are synchronized first
238
249
  };
239
250
  /** @private
@@ -245,15 +256,16 @@ MultiTableManager.prototype._onConfiguration = function () {
245
256
  }
246
257
  this._ready = true;
247
258
 
248
- this.setTableCount(this._tableCount);
259
+ if(this._wrapSize) {
260
+ this._wrapTable(this._wrapSize);
261
+ } else {
262
+ this._setTableCount(this._tableCount);
263
+ }
249
264
  };
250
265
 
251
266
  /** @public
252
267
  */
253
268
  MultiTableManager.prototype.dispose = function () {
254
- // var main = this._tables[0];
255
- // main.api.getDataSource().unlisten("dataChanged", this._onDataChanged);
256
-
257
269
  var len = this._tables.length;
258
270
  for(var i = 0; i < len; ++i) {
259
271
  this._tables[i].dispose();
@@ -272,7 +284,8 @@ MultiTableManager.prototype._cloneConfig = function () {
272
284
  if(this._configObj) {
273
285
  obj = cloneObject(this._configObj);
274
286
  if(Array.isArray(obj.columns)) {
275
- obj.columns = this._configObj.columns.slice();
287
+ var runtimeConfig = this._tables[0].api ? this._tables[0].api.getConfigObject() : this._configObj;
288
+ obj.columns = runtimeConfig.columns.slice();
276
289
  }
277
290
  }
278
291
  return obj || {};
@@ -282,13 +295,12 @@ MultiTableManager.prototype._cloneConfig = function () {
282
295
  * @return {number}
283
296
  */
284
297
  MultiTableManager.prototype.getTableCount = function() {
285
- return this._tableCount;
298
+ return this._tables.length;
286
299
  };
287
- /**
288
- * @public
300
+ /** @private
289
301
  * @param {number} num Number of tables. Number cannot be less than one.
290
302
  */
291
- MultiTableManager.prototype.setTableCount = function(num) {
303
+ MultiTableManager.prototype._setTableCount = function(num) {
292
304
  this._tableCount = num > 0 ? num : 1;
293
305
 
294
306
  if(this._ready) {
@@ -301,30 +313,53 @@ MultiTableManager.prototype.setTableCount = function(num) {
301
313
  }
302
314
  };
303
315
  /**
316
+ * @public
317
+ * @param {number} num Number of tables. Number cannot be less than one.
318
+ */
319
+ MultiTableManager.prototype.setTableCount = function(num) {
320
+ if(this._wrapSize) {
321
+ this._wrapTable(0);
322
+ }
323
+ this._setTableCount(num);
324
+ };
325
+ /**
304
326
  * @private
327
+ * @param {number} tableIndex
305
328
  * @return {Element}
306
329
  */
307
- MultiTableManager.prototype._addTable = function() {
330
+ MultiTableManager.prototype._addTable = function(tableIndex) {
308
331
  var main = this._tables[0];
309
332
  var parentElem = main.parentNode;
333
+ var core = main.api.getCoreGrid();
310
334
  var mainDataView = main.api.getDataView();
311
335
  // var mainDataTable = main.api.getDataTable();
336
+ var stp = core.getPlugin("SortableTitlePlugin");
337
+ var dtp = core.getPlugin("DragAndDropTitlePlugin");
312
338
 
313
339
  var configObj = this._cloneConfig();
314
340
  configObj.extensions = this._generateExtensions();
341
+
315
342
  delete configObj.staticDataRows;
316
343
  delete configObj.rows;
317
344
  delete configObj.dataModel;
318
345
 
319
- var rowCount = mainDataView.getRowCount();
320
-
321
- var ary = _newArrayOfObject(rowCount);
322
- if(this._emeraldGrid) {
323
- configObj.dataModel = {
324
- data: ary
325
- };
346
+ if(this._wrapSize) {
347
+ var wrappedViews = mainDataView.getWrappedViews();
348
+ configObj.dataView = wrappedViews[tableIndex - 1];
349
+ configObj.grid = main.api;
326
350
  } else {
327
- configObj.rows = ary;
351
+ configObj["SortableTitle"] = stp;
352
+ configObj["DragAndDropTitle"] = dtp;
353
+ var rowCount = mainDataView.getRowCount();
354
+
355
+ var ary = _newArrayOfObject(rowCount);
356
+ if(this._emeraldGrid) {
357
+ configObj.dataModel = {
358
+ data: ary
359
+ };
360
+ } else {
361
+ configObj.rows = ary;
362
+ }
328
363
  }
329
364
 
330
365
  var sub = document.createElement(main.tagName);
@@ -347,19 +382,22 @@ MultiTableManager.prototype._addTables = function(num) {
347
382
 
348
383
  var main = this._tables[0];
349
384
  _toggleInlineElement(main, true); // TODO: Check if we need to do this every time
385
+
350
386
  // main.api.setFitContentWidth(true);
351
387
 
352
388
  for(var i = 0; i < num; ++i) {
353
- var grid = this._addTable();
389
+ var grid = this._addTable(this._tables.length);
354
390
  this._tables.push(grid);
355
391
  }
356
392
 
357
- if(main._vScrollbarSynchronization) {
358
- MultiTableManager.synchronizeVScrollbar(
359
- main.api.getCoreGrid().getVScrollbar().getParent(),
360
- main.parentNode,
361
- this._tables
362
- );
393
+ if(!this._wrapSize) {
394
+ if(main._vScrollbarSynchronization) {
395
+ MultiTableManager.synchronizeVScrollbar(
396
+ main.api.getCoreGrid().getVScrollbar().getParent(),
397
+ main.parentNode,
398
+ this._tables
399
+ );
400
+ }
363
401
  }
364
402
  };
365
403
  /**
@@ -381,20 +419,62 @@ MultiTableManager.prototype._removeTables = function(num) {
381
419
  sub.parentNode.removeChild(sub);
382
420
  }
383
421
  }
384
- if(this._tables.length === 1) {
385
- // TODO: Reset state
386
- this._tables[0].style.display = "";
422
+ // if(this._tables.length === 1) {
423
+ // TODO: Reset state
424
+ // this._tables[0].style.display = ""; // Remove display inline
425
+ // }
426
+ };
427
+
428
+
429
+ /** @private
430
+ * @param {number} rowCount Number of row per table. Set number to zero to turn off wrap mode.
431
+ */
432
+ MultiTableManager.prototype._wrapTable = function(rowCount) {
433
+ this._wrapSize = rowCount > 0 ? rowCount : 0;
434
+
435
+ if(this._ready) {
436
+ var main = this._tables[0];
437
+ if(this._wrapSize) {
438
+ main.style.display = "none";
439
+ main.api.getCoreGrid().getVScrollbar().disable();
440
+ } else {
441
+ main.style.display = "";
442
+ _toggleInlineElement(main, true);
443
+ main.api.getCoreGrid().getVScrollbar().disable(false);
444
+ }
445
+
446
+ var dv = main.api.getDataView();
447
+ dv.listen("wrapCountChanged", this._onWrapCountChanged);
448
+ dv.wrapView(this._wrapSize);
387
449
  }
388
450
  };
389
451
  /**
390
- * @private
452
+ * @public
453
+ * @param {number} rowCount Number of row per table. Set number to zero to turn off wrap mode.
454
+ */
455
+ MultiTableManager.prototype.wrapTable = function(rowCount) {
456
+ if(rowCount && this._tableCount > 1) {
457
+ this._setTableCount(1);
458
+ }
459
+ if(!rowCount || rowCount < 0) {
460
+ rowCount = 0;
461
+ }
462
+ if(this._wrapSize !== rowCount) {
463
+ this._wrapTable(rowCount);
464
+ }
465
+ };
466
+ /** @private
391
467
  * @param {Object} e
392
468
  */
393
- MultiTableManager.prototype._onDataChanged = function(e) {
394
-
469
+ MultiTableManager.prototype._onWrapCountChanged = function(e) {
470
+ if(e.prevCount < e.newCount) {
471
+ this._addTables(e.newCount - e.prevCount);
472
+ }
473
+ if(e.newCount < e.prevCount) {
474
+ this._removeTables(e.prevCount - e.newCount);
475
+ }
395
476
  };
396
477
 
397
-
398
478
  /** @public
399
479
  * @param {number=} at
400
480
  * @return {Element}
@@ -445,23 +525,6 @@ MultiTableManager.prototype._execAll = function(methodName, args) {
445
525
  }
446
526
  };
447
527
 
448
- /** @private
449
- * @param {number} num
450
- */
451
- MultiTableManager.prototype._setRtRowCount = function(num) {
452
- var tableCount = this._tables.length;
453
- // grid.api.getRowCount();
454
- for(var i = 1; i < tableCount; ++i) {
455
- var sub = this._tables[i];
456
- sub.api.insertRows(_newArrayOfObject(num));
457
- }
458
- };
459
- /** @private
460
- * @param {number} num
461
- */
462
- MultiTableManager.prototype._addCsRows = function(num) {
463
- };
464
-
465
528
  /** @public
466
529
  * @param {Object=} rowOption
467
530
  * @param {number=} at
@@ -471,10 +534,14 @@ MultiTableManager.prototype.insertRow = function(rowOption, at) {
471
534
  return; // TODO
472
535
  }
473
536
 
474
- var tableCount = this._tables.length;
475
- for(var i = 0; i < tableCount; ++i) {
476
- var tbl = this._tables[i];
477
- tbl.api.insertRow(rowOption, at);
537
+ if(this._wrapSize) {
538
+ this.getTable().api.insertRow(rowOption, at);
539
+ } else {
540
+ var tableCount = this._tables.length;
541
+ for(var i = 0; i < tableCount; ++i) {
542
+ var tbl = this._tables[i];
543
+ tbl.api.insertRow(rowOption, at);
544
+ }
478
545
  }
479
546
  };
480
547
  /** @public
@@ -488,18 +555,58 @@ MultiTableManager.prototype.removeRow = function(at) {
488
555
  at = this.getRowCount() - 1;
489
556
  }
490
557
 
558
+ if(this._wrapSize) {
559
+ this.getTable().api.removeRow(at);
560
+ } else {
561
+ var tableCount = this._tables.length;
562
+ for(var i = 0; i < tableCount; ++i) {
563
+ var tbl = this._tables[i];
564
+ tbl.api.removeRow(at);
565
+ }
566
+ }
567
+ };
568
+
569
+ /** @public
570
+ * @return {number}
571
+ */
572
+ MultiTableManager.prototype.getRowCount = function() {
573
+ return this.getTable().api.getRowCount();
574
+ };
575
+
576
+ /** @public
577
+ * @param {*} columnOption String will be treated as field, while object is treated as the column options
578
+ * @param {number=} idx
579
+ */
580
+ MultiTableManager.prototype.insertColumn = function(columnOption, idx) {
581
+ if(this._emeraldGrid) {
582
+ return; // TODO
583
+ }
584
+
491
585
  var tableCount = this._tables.length;
492
586
  for(var i = 0; i < tableCount; ++i) {
493
587
  var tbl = this._tables[i];
494
- tbl.api.removeRow(at);
588
+ tbl.api.insertColumn(columnOption, idx);
589
+ }
590
+ };
591
+ /** @public
592
+ * @param {*} colRef Column reference
593
+ */
594
+ MultiTableManager.prototype.removeColumn = function(colRef) {
595
+ if(this._emeraldGrid) {
596
+ return; // TODO
597
+ }
598
+ var tableCount = this._tables.length;
599
+ for(var i = 0; i < tableCount; ++i) {
600
+ var tbl = this._tables[i];
601
+ tbl.api.removeColumn(colRef);
495
602
  }
496
603
  };
497
604
 
498
605
  /** @public
499
606
  * @return {number}
500
607
  */
501
- MultiTableManager.prototype.getRowCount = function() {
502
- return this.getTable().api.getRowCount();
608
+ MultiTableManager.prototype.getColumnCount = function() {
609
+ return this.getTable().api.getColumnCount();
503
610
  };
504
611
 
505
612
  export default MultiTableManager;
@@ -23,7 +23,7 @@ declare class PercentBar {
23
23
 
24
24
  public static toAlignment(str: string|null): string;
25
25
 
26
- public getElement(): Element;
26
+ public getElement(): Element|null;
27
27
 
28
28
  public getValue(): number;
29
29
 
@@ -12,13 +12,13 @@ declare namespace Perf {
12
12
 
13
13
  function clearResourceTimings(): void;
14
14
 
15
- function getEntries(): (PerformanceEntry)[];
15
+ function getEntries(): (PerformanceEntry)[]|null;
16
16
 
17
- function getEntriesByName(entryName: string, entryType?: string): (PerformanceEntry)[];
17
+ function getEntriesByName(entryName: string, entryType?: string): (PerformanceEntry)[]|null;
18
18
 
19
- function getEntriesByType(entryType: string): (PerformanceEntry)[];
19
+ function getEntriesByType(entryType: string): (PerformanceEntry)[]|null;
20
20
 
21
- function getEntry(entryName: string, entryType?: string): PerformanceEntry;
21
+ function getEntry(entryName: string, entryType?: string): PerformanceEntry|null;
22
22
 
23
23
  function mark(markName: string): void;
24
24
 
@@ -28,7 +28,7 @@ declare class Popup extends EventDispatcher {
28
28
 
29
29
  public dispose(): void;
30
30
 
31
- public getElement(): Element;
31
+ public getElement(): Element|null;
32
32
 
33
33
  public appendChild(childElem: Element): void;
34
34
 
@@ -50,7 +50,7 @@ declare class Popup extends EventDispatcher {
50
50
 
51
51
  public setPopupGap(gap?: number): void;
52
52
 
53
- public setParentElement(parentElement: Element): Element;
53
+ public setParentElement(parentElement: Element): Element|null;
54
54
 
55
55
  public show(opt_shown?: boolean, parentElement?: Element): void;
56
56
 
@@ -20,7 +20,7 @@ declare class RequestQueue {
20
20
 
21
21
  public getQueue(): any[];
22
22
 
23
- public makeRequest(obj: any): Promise<Response>;
23
+ public makeRequest(obj: any): Promise<Response>|null;
24
24
 
25
25
  public isLimitReached(): boolean;
26
26
 
@@ -1,5 +1,6 @@
1
1
  import { injectCss, prettifyCss } from "./Util.js";
2
2
  import { ExpanderIcon } from "./ExpanderIcon.js";
3
+ import { Icon } from "./Icon.js";
3
4
 
4
5
  declare class RowPainter {
5
6
 
@@ -9,6 +10,8 @@ declare class RowPainter {
9
10
 
10
11
  public static disableColorTag(grid: any, disabled?: boolean): void;
11
12
 
13
+ public static enableHeaderMenu(grid: any, enabled?: boolean): void;
14
+
12
15
  public removeHeaderStyle(section: any, columnIndex: number, rowIndex: number): void;
13
16
 
14
17
  public applyHeaderStyle(e: any): void;
@@ -1,5 +1,6 @@
1
1
  import { injectCss, prettifyCss } from "./Util.js";
2
2
  import { ExpanderIcon } from "./ExpanderIcon.js";
3
+ import { Icon } from "./Icon.js";
3
4
 
4
5
  /**
5
6
  * @constructor
@@ -10,6 +11,9 @@ var RowPainter = function(options) {
10
11
  this._headerSpanning = options.headerSpanning;
11
12
  this._footerSpanning = options.footerSpanning;
12
13
  this._onCellClicked = options.onCellClicked;
14
+ this._headerMenuClicked = options.headerMenuClicked;
15
+ this._menuIconClicked = this._menuIconClicked.bind(this);
16
+ this._segmentMode = options.segmentMode;
13
17
  };
14
18
 
15
19
  /** @type {string}
@@ -19,6 +23,9 @@ RowPainter._styles = prettifyCss([
19
23
  ".cell.folder", [
20
24
  "text-align: left;"
21
25
  ],
26
+ ".cell.folder:not(.closed), .cell.folder.main-group", [
27
+ "font-weight: 600;"
28
+ ],
22
29
  ".color-tag::before", [
23
30
  "content: '';",
24
31
  "display: block;",
@@ -26,7 +33,7 @@ RowPainter._styles = prettifyCss([
26
33
  "width: 2px;",
27
34
  "height: 100%;",
28
35
  "left: 0;",
29
- "background-color: var(--expanded-tag-bg-color);"
36
+ "background-color: var(--grid-expanded-tag-bg-color);"
30
37
  ],
31
38
  ".color-tag.main-group::before", [
32
39
  "top: 2px;",
@@ -37,17 +44,31 @@ RowPainter._styles = prettifyCss([
37
44
  "top: 2px;",
38
45
  "width: 4px;",
39
46
  "height: calc(100% - 5px);",
40
- "background-color: var(--tag-bg-color);"
47
+ "background-color: var(--grid-tag-bg-color);"
41
48
  ],
42
49
  ".color-tag-disabled .color-tag::before", [
43
50
  "content: unset;"
44
51
  ],
45
52
  ".cell.highlighted-row.color-tag::before", [
46
- "background-color: var(--expanded-tag-bg-color);"
53
+ "background-color: var(--grid-expanded-tag-bg-color);"
54
+ ],
55
+ ".tr-grid .cell .floating-panel .menu-icon", [
56
+ "display: none;"
57
+ ],
58
+ ".tr-grid.row-menu-enabled .cell:hover .menu-icon", [
59
+ "display: inline-block;"
60
+ ],
61
+ ".folder .menu-icon", [
62
+ "color: var(--grid-row-menu-icon-color);"
63
+ ],
64
+ ".folder .menu-icon:hover", [
65
+ "color: var(--grid-row-menu-icon-hover-color);"
47
66
  ],
48
67
  ":host", [
49
- "--tag-bg-color: #333333;",
50
- "--expanded-tag-bg-color: #4D4D4D;"
68
+ "--grid-tag-bg-color: #333333;",
69
+ "--grid-expanded-tag-bg-color: #4D4D4D;",
70
+ "--grid-row-menu-icon-color: #CCCCCC;",
71
+ "--grid-row-menu-icon-hover-color: #FFFFFF;"
51
72
  ]
52
73
  ]);
53
74
 
@@ -71,6 +92,16 @@ RowPainter.disableColorTag = function(grid, disabled) {
71
92
  }
72
93
  };
73
94
 
95
+ /** @public
96
+ * @param {tr.Grid} grid
97
+ * @param {boolean=} enabled
98
+ */
99
+ RowPainter.enableHeaderMenu = function(grid, enabled) {
100
+ if (grid) {
101
+ grid.enableClass("row-menu-enabled", enabled ? true : false);
102
+ }
103
+ };
104
+
74
105
  /** @private
75
106
  * @param {Object} section ILayoutGrid
76
107
  * @param {number} fromColumnIndex
@@ -78,10 +109,12 @@ RowPainter.disableColorTag = function(grid, disabled) {
78
109
  * @param {number} rowIndex
79
110
  * @param {number} checkboxColumnIndex
80
111
  */
81
- RowPainter._clearCellContent = function(section, fromColumnIndex, toColumnIndex, rowIndex, checkboxColumnIndex) {
82
- for (var c = fromColumnIndex; c <= toColumnIndex; ++c) {
83
- if (section.isColumnVisible(c) && c !== checkboxColumnIndex) {
84
- section.getCell(c, rowIndex, false).setContent("");
112
+ RowPainter.prototype._clearCellContent = function(section, fromColumnIndex, toColumnIndex, rowIndex, checkboxColumnIndex) {
113
+ if(!this._segmentMode) {
114
+ for (var c = fromColumnIndex; c <= toColumnIndex; ++c) {
115
+ if (section.isColumnVisible(c) && c !== checkboxColumnIndex) {
116
+ section.getCell(c, rowIndex, false).setContent("");
117
+ }
85
118
  }
86
119
  }
87
120
  };
@@ -92,13 +125,22 @@ RowPainter._clearCellContent = function(section, fromColumnIndex, toColumnIndex,
92
125
  * @param {number} rowIndex
93
126
  */
94
127
  RowPainter.prototype.removeHeaderStyle = function(section, columnIndex, rowIndex) {
95
- var cell = section.getCell(columnIndex, rowIndex, false);
96
- if (!cell) {
128
+ section.enableRowClass(rowIndex, "header", false); // TODO: Slow
129
+ section.enableRowClass(rowIndex, "folder", false); // TODO: Slow
130
+ var cell = section.unstretchCell(columnIndex, rowIndex);
131
+ this._removeHeaderStyle(cell);
132
+ cell = section.getCell(columnIndex, rowIndex, false);
133
+ this._removeHeaderStyle(cell);
134
+ };
135
+
136
+ /** @private
137
+ * @param {Object} cell Cell container
138
+ */
139
+ RowPainter.prototype._removeHeaderStyle = function(cell) {
140
+ if(!cell || !cell._groupHeaderStyle) {
97
141
  return;
98
142
  }
99
-
100
- section.unstretchCell(columnIndex, rowIndex);
101
- section.enableRowClass(rowIndex, "header", false); // TODO: Slow
143
+ cell._groupHeaderStyle = false;
102
144
  cell.removeClass("folder");
103
145
  cell.removeClass("closed");
104
146
  cell.removeClass("content-header");
@@ -127,13 +169,14 @@ RowPainter.prototype.applyHeaderStyle = function(e) {
127
169
  } else {
128
170
  section.unstretchCell(mainCol, r);
129
171
  section.enableRowClass(r, "header", true);
130
-
172
+ section.enableRowClass(r, "closed", e.collapsed ? true : false);
131
173
  // Remove content from cell that appear on right side of mainCol
132
- RowPainter._clearCellContent(section, mainCol + 1, colCount - 1, r, checkboxColumnIndex);
174
+ this._clearCellContent(section, mainCol + 1, colCount - 1, r, checkboxColumnIndex);
133
175
  }
176
+ cell._groupHeaderStyle = true;
134
177
 
135
178
  // Remove content from cell that appear on left side of mainCol
136
- RowPainter._clearCellContent(section, 0, mainCol - 1, r, checkboxColumnIndex);
179
+ this._clearCellContent(section, 0, mainCol - 1, r, checkboxColumnIndex);
137
180
 
138
181
  // Footer rows and some specific group levels contains no expander (arrow)
139
182
  var newIcon = ExpanderIcon.renderOn(cell, e.hiddenArrow);
@@ -142,19 +185,30 @@ RowPainter.prototype.applyHeaderStyle = function(e) {
142
185
  }
143
186
 
144
187
  if (!footerRow) {
145
- cell.addClass("folder"); // Required by the fallback arrow from the CSS rules. TODO: Change this
188
+ if (stretching) {
189
+ cell.addClass("folder"); // Stretched cell is in the cover-layer
190
+ } else {
191
+ section.enableRowClass(r, "folder", true); // Required by the fallback arrow from the CSS rules. TODO: Change this
192
+ }
146
193
  if (this._clickableCell) {
147
194
  cell.listen("click", this._onCellClicked);
148
195
  }
149
196
  if (e.groupId) {
150
197
  cell.setContent(e.groupId);
151
198
  }
199
+ cell.enableClass("main-group", e.groupLevel === 1);
200
+ if (this._headerMenuClicked && stretching) {
201
+ if (!cell._menuIcon) {
202
+ var icon = cell._menuIcon = Icon.create("more", "menu-icon");
203
+ icon.addEventListener("click", this._menuIconClicked);
204
+ }
205
+ cell.insertFloatingIcon(cell._menuIcon);
206
+ }
152
207
  } else {
153
208
  cell.setContent("");
154
209
  }
155
- cell.enableClass("closed", e.collapsed);
210
+ cell.enableClass("closed", e.collapsed ? true : false);
156
211
  cell.enableClass("color-tag", true);
157
- cell.enableClass("main-group", e.groupLevel === 1);
158
212
  cell.setStyle("paddingLeft", (e.indentSize > 0) ? e.indentSize + "px" : "");
159
213
  };
160
214
 
@@ -184,5 +238,13 @@ RowPainter.prototype.applyRowStyle = function(e) {
184
238
  cell.enableClass("color-tag", e.nonGroupRow ? false : true);
185
239
  };
186
240
 
241
+ /** @private
242
+ * @param {Object} e
243
+ */
244
+ RowPainter.prototype._menuIconClicked = function(e) {
245
+ e.stopPropagation();
246
+ this._headerMenuClicked(e);
247
+ };
248
+
187
249
  export default RowPainter;
188
250
  export {RowPainter};
@@ -6,7 +6,7 @@ declare class SubTable extends ElementWrapper {
6
6
 
7
7
  constructor(opt_elem?: (Element|string));
8
8
 
9
- public insertRow(at?: number): Element;
9
+ public insertRow(at?: number): Element|null;
10
10
 
11
11
  public addRows(count?: number): (Element)[];
12
12
 
@@ -22,19 +22,19 @@ declare class SubTable extends ElementWrapper {
22
22
 
23
23
  public getRowCount(): number;
24
24
 
25
- public getCell(c: number, r: number): Element;
25
+ public getCell(c: number, r: number): Element|null;
26
26
 
27
- public getCellsInColumn(c: number): (Element)[];
27
+ public getCellsInColumn(c: number): (Element)[]|null;
28
28
 
29
- public getCellsInRow(r: number): (Element)[];
29
+ public getCellsInRow(r: number): (Element)[]|null;
30
30
 
31
31
  public getAllCells(): (Element)[];
32
32
 
33
- public getAllRows(): HTMLCollection;
33
+ public getAllRows(): HTMLCollection|null;
34
34
 
35
- public getRows(): HTMLCollection;
35
+ public getRows(): HTMLCollection|null;
36
36
 
37
- public getRow(r: number): Element;
37
+ public getRow(r: number): Element|null;
38
38
 
39
39
  public getTextContents(): (string)[][];
40
40
 
@@ -62,9 +62,9 @@ declare class SubTable extends ElementWrapper {
62
62
 
63
63
  public cloak(elem: Element, opt_elementType?: string): void;
64
64
 
65
- public spanBlock(c1: number, c2: number, r1: number, r2: number): Element;
65
+ public spanBlock(c1: number, c2: number, r1: number, r2: number): Element|null;
66
66
 
67
- public static parseTableContent(tbl: Element): (string)[][];
67
+ public static parseTableContent(tbl: Element): (string)[][]|null;
68
68
 
69
69
  }
70
70