@refinitiv-ui/efx-grid 6.0.1 → 6.0.2

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 (133) hide show
  1. package/lib/column-selection-dialog/lib/column-selection-dialog.js +80 -18
  2. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
  3. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
  4. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
  5. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
  6. package/lib/core/dist/core.css +1 -1
  7. package/lib/core/dist/core.js +12961 -10749
  8. package/lib/core/dist/core.min.js +1 -1
  9. package/lib/core/es6/data/DataView.d.ts +22 -7
  10. package/lib/core/es6/data/DataView.js +176 -49
  11. package/lib/core/es6/data/WrappedView.d.ts +289 -0
  12. package/lib/core/es6/data/WrappedView.js +1319 -0
  13. package/lib/core/es6/grid/Core.d.ts +13 -0
  14. package/lib/core/es6/grid/Core.js +393 -155
  15. package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
  16. package/lib/core/es6/grid/ILayoutGrid.js +45 -2
  17. package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
  18. package/lib/core/es6/grid/LayoutGrid.js +257 -82
  19. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
  20. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +314 -27
  21. package/lib/core/es6/grid/components/Column.js +8 -2
  22. package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
  23. package/lib/core/es6/grid/components/HScrollbar.js +20 -4
  24. package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
  25. package/lib/core/es6/grid/util/TrackLayout.js +2 -3
  26. package/lib/core/es6/tr-grid-theme.js +1 -1
  27. package/lib/filter-dialog/lib/filter-dialog.js +8 -6
  28. package/lib/grid/lib/efx-grid.d.ts +14 -7
  29. package/lib/grid/lib/efx-grid.js +113 -114
  30. package/lib/grid/themes/base.less +4 -2
  31. package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
  32. package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
  33. package/lib/grid/themes/halo/efx-grid.less +69 -32
  34. package/lib/grid/themes/halo/light/efx-grid.js +1 -1
  35. package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
  36. package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
  37. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
  38. package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
  39. package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
  40. package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
  41. package/lib/row-segmenting/es6/RowSegmenting.js +40 -11
  42. package/lib/rt-grid/dist/rt-grid.js +10290 -7864
  43. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  44. package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
  45. package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
  46. package/lib/rt-grid/es6/Grid.d.ts +14 -7
  47. package/lib/rt-grid/es6/Grid.js +241 -74
  48. package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
  49. package/lib/rt-grid/es6/RowDefinition.js +52 -2
  50. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
  51. package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
  52. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +2 -0
  53. package/lib/tr-grid-checkbox/es6/Checkbox.js +29 -14
  54. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
  55. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
  56. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
  57. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
  58. package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
  59. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +1 -0
  60. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
  61. package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
  62. package/lib/tr-grid-row-dragging/es6/RowDragging.js +102 -12
  63. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
  64. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
  65. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
  66. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +5 -1
  67. package/lib/tr-grid-row-selection/es6/RowSelection.js +188 -7
  68. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
  69. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
  70. package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
  71. package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
  72. package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
  73. package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
  74. package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
  75. package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
  76. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
  77. package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
  78. package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
  79. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
  80. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
  81. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
  82. package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
  83. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
  84. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +2 -2
  85. package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
  86. package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
  87. package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
  88. package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
  89. package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
  90. package/lib/tr-grid-util/es6/RowPainter.js +66 -12
  91. package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
  92. package/lib/tr-grid-util/es6/Table.d.ts +13 -13
  93. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
  94. package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
  95. package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
  96. package/lib/tr-grid-util/es6/Util.d.ts +6 -6
  97. package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
  98. package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
  99. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
  100. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
  101. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
  102. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
  103. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
  104. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
  105. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
  106. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
  107. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
  108. package/lib/types/es6/CellSelection.d.ts +1 -1
  109. package/lib/types/es6/Checkbox.d.ts +2 -0
  110. package/lib/types/es6/ColumnGrouping.d.ts +1 -0
  111. package/lib/types/es6/ColumnSelection.d.ts +5 -1
  112. package/lib/types/es6/Core/data/DataView.d.ts +22 -7
  113. package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
  114. package/lib/types/es6/Core/grid/Core.d.ts +13 -0
  115. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
  116. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
  117. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
  118. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
  119. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
  120. package/lib/types/es6/FilterInput.d.ts +4 -2
  121. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
  122. package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
  123. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
  124. package/lib/types/es6/RowColoring.d.ts +2 -0
  125. package/lib/types/es6/RowFiltering.d.ts +2 -0
  126. package/lib/types/es6/RowSegmenting.d.ts +1 -0
  127. package/lib/types/es6/RowSelection.d.ts +5 -1
  128. package/lib/types/es6/Zoom.d.ts +2 -1
  129. package/lib/types/es6/index.d.ts +2 -0
  130. package/lib/versions.json +17 -17
  131. package/lib/zoom/es6/Zoom.d.ts +2 -1
  132. package/lib/zoom/es6/Zoom.js +11 -4
  133. package/package.json +7 -7
@@ -67,9 +67,15 @@ var RowDraggingPlugin = function (options) {
67
67
 
68
68
  t._hosts = [];
69
69
 
70
- t._guideline = document.createElement("svg"); // TODO: Change from svg to normal div
70
+ t._guideline = document.createElement("div"); // Test IE mouse event, guildline close mouse event
71
71
  t._guideline.className = "tr-row-guideline";
72
72
 
73
+ t._dragBox = document.createElement("div");
74
+ t._dragBox.className = "drag-box";
75
+
76
+ t._dragBoxIcon = document.createElement("ef-icon");
77
+ t._dragBoxIcon.className = "drag-box-icon";
78
+
73
79
  t.config({ "rowDragging": options });
74
80
  };
75
81
  Ext.inherits(RowDraggingPlugin, GridPlugin);
@@ -87,6 +93,14 @@ RowDraggingPlugin._stylePromise = null; // Static variable
87
93
  * @private
88
94
  */
89
95
  RowDraggingPlugin.prototype._guideline = null;
96
+ /** @type {Element}
97
+ * @private
98
+ */
99
+ RowDraggingPlugin.prototype._dragBox = null;
100
+ /** @type {Element}
101
+ * @private
102
+ */
103
+ RowDraggingPlugin.prototype._dragBoxIcon = null;
90
104
  /** For disabled UI
91
105
  * @type {boolean}
92
106
  * @private
@@ -257,6 +271,45 @@ RowDraggingPlugin.prototype._onThemeLoaded = function(colors) {
257
271
  "text-align: center;",
258
272
  "border-top-width: 3px;",
259
273
  "border-top-style: solid;"
274
+ ],
275
+ ".drag-box", [
276
+ "position: absolute;",
277
+ "left: 0;",
278
+ "top: 0;",
279
+ "pointer-events: none;",
280
+ "background-color: var(--grid-dragbox-bgcolor);",
281
+ "border: solid 1px var(--grid-title-sort-icon-color);",
282
+ "width: 134px;",
283
+ "height: 29px;",
284
+ "line-height: 29px;",
285
+ "white-space: nowrap;",
286
+ "overflow-x: clip;",
287
+ "text-overflow: ellipsis;",
288
+ "padding: 0 7px 0 7px;",
289
+ "box-shadow: 0 0 8px var(--grid-dragbox-bordercolor);"
290
+ ],
291
+ ".drag-box-icon", [
292
+ "top: -4px;",
293
+ "left: 12px;",
294
+ "padding: 2px;",
295
+ "border-radius: 100%;",
296
+ "font-size: 11px;",
297
+ "position: absolute;"
298
+ ],
299
+ ".drag-box-icon[icon='void']", [
300
+ "background-color:var(--grid-void-icon-bgcolor);",
301
+ "color:var(--grid-void-icon-color);"
302
+ ],
303
+ ".drag-box-icon[icon='add']", [
304
+ "background-color:var(--grid-insertion-icon-bgcolor);",
305
+ "color:var(--grid-insertion-icon-color);"
306
+ ],
307
+ ":host", [
308
+ "--grid-dragbox-bgcolor: #ffffff;", // If the value cannot be found, default to halo-light
309
+ "--grid-insertion-icon-bgcolor: #39c46e;",
310
+ "--grid-insertion-icon-color: #1A1A1A;",
311
+ "--grid-void-icon-bgcolor: #F5475B;",
312
+ "--grid-void-icon-color: #FFFFFF;"
260
313
  ]
261
314
  ];
262
315
  var guidelineColor = "#ff9933";
@@ -268,8 +321,7 @@ RowDraggingPlugin.prototype._onThemeLoaded = function(colors) {
268
321
 
269
322
  styles.push(".tr-row-guideline", [
270
323
  "border-top-color: " + guidelineColor,
271
- "color: " + guidelineColor,
272
- "background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));"
324
+ "color: " + guidelineColor
273
325
  ]);
274
326
 
275
327
  if(ElfVersion < 3) { // Backward compatability
@@ -491,7 +543,7 @@ RowDraggingPlugin.prototype._onDragStart = function (e) {
491
543
 
492
544
  if (this._dragBoxRenderer) { // For custom drag box rendering
493
545
  var arg = cloneObject(e); // TODO: Check if cloning is necessary
494
- arg.dragBox = this._guideline;
546
+ arg.dragBox = this._dragBox;
495
547
  arg.dataRow = this._getRowData(dv.getRowDataAt(rowIndex));
496
548
 
497
549
  if (this._legacyRowReorder) {
@@ -505,10 +557,9 @@ RowDraggingPlugin.prototype._onDragStart = function (e) {
505
557
  // TODO: Just update curser will not gonna work since cell is pointer-events: none;
506
558
  // we should do something to overwrite pointer-events first
507
559
  // then set cursor move will have an effect
508
- grid.getElement().style.cursor = "move";
560
+ grid.getElement().style.cursor = "grabbing";
509
561
 
510
562
  // Initialize guideline
511
- this._guideline.style.lineHeight = this._guideline.style.height = "";
512
563
  this._updateGuideParent(); // Insert guideline to the document
513
564
  this._updateGuidePosition();
514
565
 
@@ -547,11 +598,13 @@ RowDraggingPlugin.prototype._onMouseMove = function (e) {
547
598
  this._pos = this._hitTest(e); // A new object is created
548
599
 
549
600
  this._updateGuideParent();
601
+ this._updateGuidePosition(e);
602
+ this._renderDragBox(e);
603
+
604
+ this._pos.dragBox = this._dragBox; // assign dragBox for user determine valid target
550
605
 
551
606
  // Dispatch drag event to let user determine valid drop target using allowDrag (allowDrop) method
552
607
  this._dispatch("drag", this._pos);
553
-
554
- this._updateGuidePosition(e);
555
608
  };
556
609
  /** @private
557
610
  * @param {Object} e
@@ -564,6 +617,7 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
564
617
  Dom.preventDefault(e);
565
618
  }
566
619
  Dom.removeParent(this._guideline);
620
+ Dom.removeParent(this._dragBox);
567
621
 
568
622
  document.body.classList.remove("tr-dragging");
569
623
 
@@ -727,13 +781,49 @@ RowDraggingPlugin.prototype._updateGuidePosition = function (e) {
727
781
  if (this._hasValidTarget()) {
728
782
  var pos = Dom.getRelativePosition(this._pos["cellElement"], this._guideline.parentNode);
729
783
  this._guideline.style.top = (pos["y"] - 1) + "px";
730
- var height = (this._pos["section"].getRowHeight(
731
- this._pos["rowIndex"]
732
- ) - 3) + "px";
733
- this._guideline.style.lineHeight = this._guideline.style.height = height;
734
784
  }
735
785
  }
736
786
  };
787
+
788
+ /** @private
789
+ * @param {!Element|Event|MouseEvent} e
790
+ */
791
+ RowDraggingPlugin.prototype._renderDragBox = function (e) {
792
+
793
+ if(this._disabled) {
794
+ return;
795
+ }
796
+
797
+ var gridElem = this._startingGrid.getElement();
798
+ var gridParent = this._startingGrid.getParent().parentNode;
799
+ var pn = this._dragBox.parentNode;
800
+ if(!pn) {
801
+ gridParent.appendChild(this._dragBox);
802
+ }
803
+
804
+ Dom.removeParent(this._dragBoxIcon);
805
+
806
+ var dragBoxIcon = this._dragBox.dragBoxIcon;
807
+ this._dragBoxIcon.style.visibility = "visible";
808
+ if(dragBoxIcon === "insertion") {
809
+ this.cancelDrag();
810
+ this._dragBoxIcon.icon = "add";
811
+ this._dragBox.appendChild(this._dragBoxIcon);
812
+ } else if (dragBoxIcon === "not-allowed" || dragBoxIcon === "no-drop" || dragBoxIcon === "void" ) {
813
+ this.cancelDrag();
814
+ this._dragBoxIcon.icon = "void";
815
+ this._dragBox.appendChild(this._dragBoxIcon);
816
+ }
817
+
818
+ var gridRect = gridElem.getBoundingClientRect();
819
+
820
+ var x = e.clientX - gridRect.left;
821
+ var y = e.pageY - gridRect.top;
822
+
823
+ // space for mouse cursor
824
+ this._dragBox.style.left = x - 5 + "px";
825
+ this._dragBox.style.top = y + 8 + "px";
826
+ };
737
827
  /** @private */
738
828
  RowDraggingPlugin.prototype._clearCache = function () {
739
829
  if (this._dragPulseId) {
@@ -2,6 +2,7 @@ import {Ext} from '../../tr-grid-util/es6/Ext.js';
2
2
  import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
3
3
  import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
4
4
  import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
5
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
5
6
 
6
7
  declare namespace RowFilteringPlugin {
7
8
 
@@ -32,6 +33,7 @@ declare namespace RowFilteringPlugin {
32
33
 
33
34
  type Options = {
34
35
  disabledUI?: boolean,
36
+ iconActivation?: string,
35
37
  click?: ((...params: any[]) => any),
36
38
  clicked?: ((...params: any[]) => any),
37
39
  iconCreated?: ((...params: any[]) => any),
@@ -4,6 +4,7 @@ import { Ext } from '../../tr-grid-util/es6/Ext.js';
4
4
  import { GridPlugin } from '../../tr-grid-util/es6/GridPlugin.js';
5
5
  import { FilterBuilder } from '../../tr-grid-util/es6/FilterBuilder.js';
6
6
  import { ElfUtil } from '../../tr-grid-util/es6/ElfUtil.js';
7
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
7
8
  /** @event RowFilteringPlugin#click
8
9
  * @description click event is dispatched when a user clicks the column filter icon.
9
10
  */
@@ -71,6 +72,7 @@ The expression can take various forms:<br>
71
72
  /** @typedef {Object} RowFilteringPlugin~Options
72
73
  * @description The options can be specified by `rowFiltering` property of the main grid's options
73
74
  * @property {boolean=} disabledUI=false If enabled, filter icon will not be created/shown.
75
+ * @property {string=} iconActivation=onActiveFilter Filter icon redering behavior, can be set to `always`,`onHover`,`onActiveFilter`,or `none`
74
76
  * @property {Function=} click=null Event handler dispatched when a user clicks the column filter icon.
75
77
  * @property {Function=} clicked=null Alias to `click` event handler
76
78
  * @property {Function=} iconCreated=null Event handler dispatched when a new column filter icon is created.
@@ -134,11 +136,6 @@ RowFilteringPlugin.prototype._nameMap; // Mapping name to filter function for re
134
136
  */
135
137
 
136
138
  RowFilteringPlugin.prototype._disabled = false;
137
- /** @type {boolean}
138
- * @private
139
- */
140
-
141
- RowFilteringPlugin.prototype._disabledUI = false;
142
139
  /** @type {Object.<string, boolean>}
143
140
  * @private
144
141
  */
@@ -165,6 +162,11 @@ RowFilteringPlugin.prototype._columnFilters;
165
162
  */
166
163
 
167
164
  RowFilteringPlugin.prototype._activeColFilters = null;
165
+ /** @type {string}
166
+ * @private
167
+ */
168
+
169
+ RowFilteringPlugin.prototype._iconActivation = "onActiveFilter";
168
170
  /** @type {number}
169
171
  * @private
170
172
  */
@@ -231,6 +233,15 @@ RowFilteringPlugin.prototype.initialize = function (host, options) {
231
233
 
232
234
  this._hosts.push(host);
233
235
 
236
+ if (!RowFilteringPlugin._styles) {
237
+ RowFilteringPlugin._styles = prettifyCss([".hovering-filter-icon .cell:not(.active-filter):hover .floating-panel .title-filter-icon", ["display: flex;"], ".hovering-filter-icon .cell:not(.active-filter) .floating-panel .title-filter-icon", ["display: none;"], ".floating-panel", ["position:relative;"], ".floating-panel .title-filter-icon", ["color: var(--grid-title-filter-icon-color,inherit);"], ".floating-panel .title-filter-icon:hover", ["color: var(--grid-title-filter-icon-hover-color,inherit);"], ".hovering-filter-icon .tiny-col .cell:hover, .tr-grid .tiny-col .cell.active-filter", ["padding-left:0px;"], ".tiny-col .cell .floating-panel .title-filter-icon:before", ["content: '.';", "position: absolute;", "margin-left: auto;", "margin-right: auto;", "left: 0;", "right: 0;", "top: -10px;", "font-size: 10px;", "font-family: monospace;", "color: var(--grid-title-dot-icon,inherit);", "text-align:center;"]]);
238
+ }
239
+
240
+ if (!host._rowFilteringStyles) {
241
+ host._rowFilteringStyles = true;
242
+ injectCss(RowFilteringPlugin._styles, host.getElement());
243
+ }
244
+
234
245
  host.unloadPlugin("ColumnFilterPlugin");
235
246
  host.listen("preSectionRender", this._onPreSectionRender);
236
247
  host.listen("postDataSourceChanged", this._requestFilterRefresh); // TODO: Check if this is necessary
@@ -275,7 +286,17 @@ RowFilteringPlugin.prototype.config = function (options) {
275
286
 
276
287
  if (rowFiltering) {
277
288
  if (rowFiltering["disabledUI"] || rowFiltering["uiDisabled"]) {
278
- this._disabledUI = true;
289
+ this._iconActivation = "none";
290
+ }
291
+
292
+ if (rowFiltering["iconActivation"]) {
293
+ this._iconActivation = rowFiltering["iconActivation"];
294
+
295
+ if (this._iconActivation === "onHover") {
296
+ this._hosts[0].enableClass("hovering-filter-icon", true);
297
+ } else {
298
+ this._hosts[0].enableClass("hovering-filter-icon", false);
299
+ }
279
300
  }
280
301
 
281
302
  if (rowFiltering["clicked"]) {
@@ -302,6 +323,8 @@ RowFilteringPlugin.prototype.config = function (options) {
302
323
 
303
324
  this._setColumnOptions(i, column);
304
325
  }
326
+
327
+ this.updateAllColumnIcons(); //Create icon at first time
305
328
  };
306
329
  /** @public
307
330
  * @param {Object=} gridOptions
@@ -352,7 +375,7 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
352
375
  extOptions = obj.rowFiltering = {};
353
376
  }
354
377
 
355
- extOptions.disabledUI = this._disabledUI;
378
+ extOptions.iconActivation = this._iconActivation;
356
379
  return obj;
357
380
  };
358
381
  /** All filter logics in DataView will be temporarily removed until re-enabling. This is useful when trying to insert an item at the specified index. After re-enabling, both logics and icons will be restored.
@@ -604,12 +627,12 @@ RowFilteringPlugin.prototype.setColumnFilter = function (colIndex, exp, ctx) {
604
627
 
605
628
 
606
629
  RowFilteringPlugin.prototype._setColumnOptions = function (colIndex, columnOptions) {
607
- var fieldDataType = columnOptions["fieldDataType"]; // TODO: This should not be set here
630
+ var fieldDataType = columnOptions["fieldDataType"] || columnOptions["dataType"]; // TODO: This should not be set here, should retreive data type from Composite/Realtime Grid
608
631
 
609
632
  if (fieldDataType) {
610
633
  var colOptions = this._newExtColumnOptions(colIndex);
611
634
 
612
- colOptions.fieldDataType = fieldDataType; // TODO: This should not be set here
635
+ colOptions.fieldDataType = fieldDataType; // TODO: This should not be set here, should retreive data type from Composite/Realtime Grid
613
636
  }
614
637
 
615
638
  var exp = columnOptions["filter"];
@@ -1143,7 +1166,7 @@ RowFilteringPlugin.prototype._requestFilterRefresh = function () {
1143
1166
 
1144
1167
 
1145
1168
  RowFilteringPlugin.prototype._setTimerForUpdatingIcons = function () {
1146
- if (this._disabledUI) {
1169
+ if (this._iconActivation === "none") {
1147
1170
  return;
1148
1171
  }
1149
1172
 
@@ -1216,10 +1239,6 @@ RowFilteringPlugin.prototype.refresh = function () {
1216
1239
 
1217
1240
 
1218
1241
  RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
1219
- if (this._disabledUI) {
1220
- return;
1221
- }
1222
-
1223
1242
  var cfo = this._getColumnFilterOption(colIndex);
1224
1243
 
1225
1244
  var hasFilter = cfo ? cfo._filters.length : 0;
@@ -1244,9 +1263,11 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
1244
1263
  cell["updatePadding"]();
1245
1264
  }
1246
1265
 
1247
- if (!this._disabled && hasFilter) {
1266
+ var onActiveFilter = this._iconActivation !== "always" && this._iconActivation !== "onHover";
1267
+ var noFilterIcon = this._disabled || this._iconActivation === "none" || onActiveFilter && !hasFilter;
1268
+
1269
+ if (!noFilterIcon) {
1248
1270
  if (!cell._filterIcon) {
1249
- cell.addClass("filtering");
1250
1271
  var filterIcon;
1251
1272
 
1252
1273
  if (ElfUtil.hasComponent("ef-icon") >= 3) {
@@ -1257,6 +1278,8 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
1257
1278
  filterIcon.className = "filter-symbol icon-filter ef-icon";
1258
1279
  }
1259
1280
 
1281
+ filterIcon.classList.add("title-filter-icon"); // Icon reference
1282
+
1260
1283
  filterIcon.addEventListener("click", this._onIconClick, false);
1261
1284
 
1262
1285
  this._dispatch("iconCreated", {
@@ -1268,11 +1291,17 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
1268
1291
  cell.insertFloatingIcon(filterIcon, 10);
1269
1292
  cell._filterIcon = filterIcon;
1270
1293
  }
1294
+
1295
+ if (hasFilter || this._iconActivation == "always") {
1296
+ cell.enableClass("active-filter", true);
1297
+ } else {
1298
+ cell.enableClass("active-filter", false);
1299
+ }
1271
1300
  } else {
1272
1301
  if (cell._filterIcon) {
1273
1302
  cell.removeFloatingIcon(cell._filterIcon);
1274
1303
  cell._filterIcon = null;
1275
- cell.removeClass("filtering");
1304
+ cell.enableClass("active-filter", false);
1276
1305
  }
1277
1306
  }
1278
1307
  }
@@ -1614,38 +1643,64 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, options) {
1614
1643
  nodes: [],
1615
1644
  checked: selectedItems[formattedVal] ? true : false
1616
1645
  };
1617
- });
1646
+ }); //Setting up default default column options
1618
1647
 
1619
- var colOptions = this._getExtColumnOptions(colIndex);
1648
+ var colOptions = this._newExtColumnOptions(colIndex);
1620
1649
 
1621
1650
  var fdt = "";
1651
+ var sui = true;
1652
+ var fui = true;
1653
+ var lang = "";
1622
1654
 
1623
- if (colOptions && colOptions.fieldDataType) {
1624
- // TODO: Retrieve data type from Composite/Realtime Grid instead
1625
- fdt = colOptions.fieldDataType;
1655
+ if (colOptions) {
1656
+ if (colOptions.fieldDataType != null) {
1657
+ fdt = colOptions.fieldDataType; // TODO: Retrieve data type from Composite/Realtime Grid instead
1658
+ }
1659
+
1660
+ if (colOptions.sortUI != null) {
1661
+ sui = colOptions.sortUI;
1662
+ }
1663
+
1664
+ if (colOptions.filterUI != null) {
1665
+ fui = colOptions.filterUI;
1666
+ }
1667
+
1668
+ if (colOptions.lang != null) {
1669
+ lang = colOptions.lang;
1670
+ }
1626
1671
  }
1627
1672
 
1628
1673
  var dialogConfig = {
1629
- sortUI: true,
1630
- filterUI: true,
1631
- fieldDataType: fdt
1674
+ sortUI: sui,
1675
+ filterUI: fui,
1676
+ fieldDataType: fdt,
1677
+ lang: lang
1632
1678
  };
1633
1679
 
1634
1680
  if (options && _typeof(options) === "object") {
1635
- if (options.sortUI === false) {
1636
- dialogConfig.sortUI = options.sortUI;
1681
+ var fieldDataType = options["fieldDataType"];
1682
+ var sortUI = options["sortUI"];
1683
+ var filterUI = options["filterUI"];
1684
+ var optionLang = options["lang"];
1685
+
1686
+ if (sortUI === false) {
1687
+ dialogConfig.sortUI = sortUI;
1688
+ colOptions.sortUI = sortUI;
1637
1689
  }
1638
1690
 
1639
- if (options.filterUI === false) {
1640
- dialogConfig.filterUI = options.filterUI;
1691
+ if (filterUI === false) {
1692
+ dialogConfig.filterUI = filterUI;
1693
+ colOptions.filterUI = filterUI;
1641
1694
  }
1642
1695
 
1643
- if (options.fieldDataType != null) {
1644
- dialogConfig.fieldDataType = options.fieldDataType;
1696
+ if (fieldDataType != null) {
1697
+ dialogConfig.fieldDataType = fieldDataType;
1698
+ colOptions.fieldDataType = fieldDataType;
1645
1699
  }
1646
1700
 
1647
- if (options.lang != null) {
1648
- dialogConfig.lang = options.lang;
1701
+ if (optionLang != null) {
1702
+ dialogConfig.lang = optionLang;
1703
+ colOptions.lang = optionLang;
1649
1704
  }
1650
1705
  }
1651
1706
 
@@ -143,7 +143,6 @@ var RowGroupingPlugin = function (options) {
143
143
  t._criteria = [];
144
144
  t._criteriaFuncs = [];
145
145
  t._hosts = [];
146
- t._indentSize = [0, 22, 37, 52, 67];
147
146
  t.config({ "rowGrouping": options });
148
147
  };
149
148
  Ext.inherits(RowGroupingPlugin, GridPlugin);
@@ -193,10 +192,14 @@ RowGroupingPlugin.prototype._headerColumn = -1; // Actual display column
193
192
  * @private
194
193
  */
195
194
  RowGroupingPlugin.prototype._headerColumnField = ''; // Actual display column field
196
- /** @type {!Array.<number>}
195
+ /** @type {Array.<number>}
197
196
  * @private
198
197
  */
199
- RowGroupingPlugin.prototype._indentSize = null;
198
+ RowGroupingPlugin.prototype._indentSizes = null;
199
+ /** @type {number}
200
+ * @private
201
+ */
202
+ RowGroupingPlugin.prototype._arrowSize = 9; // Solar theme's arrow size
200
203
  /** @type {boolean}
201
204
  * @private
202
205
  */
@@ -359,12 +362,8 @@ RowGroupingPlugin.prototype.getName = function () {
359
362
  * @param {Object} config
360
363
  */
361
364
  RowGroupingPlugin.prototype.beforeInit = function(elem, config) {
362
- // Set default indentSize here
363
365
  if (ElfUtil.isHaloTheme()) {
364
- // only for halo theme
365
- this._indentSize = [0, 30, 50, 70, 90];
366
- } else {
367
- this._indentSize = [0, 22, 37, 52, 67];
366
+ this._arrowSize = 18;
368
367
  }
369
368
  };
370
369
 
@@ -495,22 +494,24 @@ RowGroupingPlugin.prototype.config = function (options) {
495
494
  var indentSize = option.indentSize;
496
495
  if (indentSize != null) {
497
496
  if (typeof indentSize === "boolean") {
498
- if (!indentSize) {
499
- this._indentSize = [0];
497
+ if (indentSize) {
498
+ this._indentSizes = null; // Set to default
499
+ } else {
500
+ this._indentSizes = [0];
500
501
  } // TODO: Handle default case
501
502
  } else if (typeof indentSize === "number") {
502
- this._indentSize = new Array(5);
503
+ this._indentSizes = new Array(5);
503
504
  for (var j = 0; j < 5; j++) {
504
- this._indentSize[j] = indentSize * j;
505
+ this._indentSizes[j] = indentSize * j;
505
506
  }
506
507
  } else if (Array.isArray(indentSize)) {
507
- this._indentSize = indentSize;
508
+ this._indentSizes = indentSize;
508
509
  }
509
510
  }
510
511
  if (option.noCollapsible != null) {
511
512
  this._noCollapsible = !!option.noCollapsible;
512
513
  if (this._noCollapsible) {
513
- this._indentSize = [0]; // Content will not be indented
514
+ this._indentSizes = [0]; // Content will not be indented
514
515
  }
515
516
  }
516
517
  if (this._contentAsHeader || this._noCollapsible) { // contentAsHeader has higher priority than hiddenArrow
@@ -616,7 +617,9 @@ RowGroupingPlugin.prototype.getConfigObject = function (gridOptions) {
616
617
  if(this._autoGroupSorting) {
617
618
  extOptions.autoGroupSorting = this._autoGroupSorting;
618
619
  }
619
- extOptions.indentSize = this._indentSize;
620
+ if(this._indentSizes) {
621
+ extOptions.indentSize = this._indentSizes;
622
+ }
620
623
 
621
624
  if(this._colorTag != null) {
622
625
  extOptions.colorTag = this._colorTag;
@@ -1197,7 +1200,7 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
1197
1200
  arg.rowData = this._rowGetter(dataSource.getRowData(rowId));
1198
1201
  arg.noIndent = false;
1199
1202
 
1200
- rowPainter.removeHeaderStyle(section, headerColumn, r);
1203
+ var contentHeaderGroup = rowsForContentHeader[rowId];
1201
1204
  var groupView = dataSource.getGroupByRowId(rowId);
1202
1205
  if (groupView) { // Header Render
1203
1206
  currentGroup = groupView;
@@ -1216,22 +1219,20 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
1216
1219
  curGroupLevel = currentGroup.getGroupLevel();
1217
1220
  }
1218
1221
 
1219
- var grp = rowsForContentHeader[rowId];
1220
- if (grp || nonGroupListener) {
1222
+ if (contentHeaderGroup || nonGroupListener) {
1221
1223
  arg.dataSource = dataSource;
1222
1224
  arg.footerIndex = null;
1223
1225
  arg.groupId = null;
1224
1226
 
1225
- if (grp) {
1226
- arg.collapsed = grp.isCollapsed();
1227
- rowPainter.applyContentAsHeaderStyle(arg);
1227
+ if (contentHeaderGroup) {
1228
+ arg.collapsed = contentHeaderGroup.isCollapsed();
1228
1229
  }
1229
1230
 
1230
1231
  if (nonGroupListener) {
1231
1232
  arg.rowData = this._rowGetter(dataSource.getRowData(rowId));
1232
1233
  }
1233
1234
  }
1234
- if (grp) { // In contentHeader mode indent in contentHeader will same the parent header when group level 2
1235
+ if (contentHeaderGroup) { // In contentHeader mode indent in contentHeader will same the parent header when group level 2
1235
1236
  indentOffset = -2;
1236
1237
  } else {
1237
1238
  // In contentHeader mode with 1 level the content indent more than contentHeader 1
@@ -1243,7 +1244,7 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
1243
1244
 
1244
1245
  arg.groupLevel = curGroupLevel;
1245
1246
 
1246
- var rowLevel;
1247
+ var rowLevel = 0;
1247
1248
  var nonGroupRow = this._autoGroupHiding && currentGroup.getGroupValue() == null && curGroupLevel === 1 && !this._contentAsHeader;
1248
1249
  arg.nonGroupRow = nonGroupRow;
1249
1250
 
@@ -1253,15 +1254,20 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
1253
1254
  rowLevel = curGroupLevel - 1;
1254
1255
  } else { // content
1255
1256
  rowLevel = curGroupLevel + indentOffset; // content have indent more than header 1
1256
- if(rowLevel < 0) {
1257
- rowLevel = 0;
1258
- }
1259
1257
  }
1260
1258
 
1261
- var indentSize = this._indentSize[rowLevel];
1262
- if (indentSize == null) {
1263
- var len = this._indentSize.length;
1264
- indentSize = this._indentSize[len - 1];
1259
+ var indentSize = 0;
1260
+ if(this._indentSizes) {
1261
+ indentSize = this._indentSizes[0];
1262
+ if(rowLevel > 0) {
1263
+ var indentLimit = this._indentSizes.length;
1264
+ indentSize = rowLevel < indentLimit ? this._indentSizes[rowLevel] : this._indentSizes[indentLimit - 1];
1265
+ }
1266
+ } else if(rowLevel > 0) {
1267
+ indentSize = 8 + rowLevel * 4; // 8 is default cell padding
1268
+ if(!groupView) {
1269
+ indentSize += this._arrowSize;
1270
+ }
1265
1271
  }
1266
1272
  if (maxColWidth > -1 && maxColWidth < indentSize) {
1267
1273
  indentSize = maxColWidth;
@@ -1273,6 +1279,10 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
1273
1279
  rowPainter.applyHeaderStyle(arg);
1274
1280
  this._dispatch(footerRow ? "groupFooterBinding" : "groupHeaderBinding", arg);
1275
1281
  } else {
1282
+ rowPainter.removeHeaderStyle(section, headerColumn, r);
1283
+ if (contentHeaderGroup) {
1284
+ rowPainter.applyContentAsHeaderStyle(arg);
1285
+ }
1276
1286
  rowPainter.applyRowStyle(arg);
1277
1287
  this._dispatch("nonGroupBinding", arg);
1278
1288
  }
@@ -1294,7 +1304,7 @@ RowGroupingPlugin.prototype._getRowsForContentAsHeader = function () {
1294
1304
  for (var grpId in allGroups) {
1295
1305
  var grp = allGroups[grpId];
1296
1306
  if (!grp.hasGroup()) { // Deepest level group
1297
- var firstRowId = grp.getAllRowIds()[0]; // Prepare first row in group for contentAsHeader mode to use.
1307
+ var firstRowId = grp.getAllRowIds(true)[0]; // Prepare first row in group for contentAsHeader mode to use.
1298
1308
  if (firstRowId) {
1299
1309
  result[firstRowId] = grp;
1300
1310
  }
@@ -3,6 +3,8 @@ import { EventDispatcher } from '../../tr-grid-util/es6/EventDispatcher.js';
3
3
  import { GridPlugin } from '../../tr-grid-util/es6/GridPlugin.js';
4
4
  import { isMac as isMacFn } from '../../tr-grid-util/es6/Util.js';
5
5
  import { isIE, prepareTSVContent } from "../../tr-grid-util/es6/Util.js";
6
+ import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
7
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
6
8
 
7
9
  declare namespace RowSelectionPlugin {
8
10
 
@@ -11,7 +13,9 @@ declare namespace RowSelectionPlugin {
11
13
  selectionChanged?: ((...params: any[]) => any),
12
14
  beforeSelection?: ((...params: any[]) => any),
13
15
  basedOnContent?: boolean,
14
- selectionField?: string
16
+ selectionField?: string,
17
+ menuClicked?: ((...params: any[]) => any),
18
+ menuPosition?: string
15
19
  };
16
20
 
17
21
  }