@refinitiv-ui/efx-grid 6.0.66 → 6.0.67

Sign up to get free protection for your applications and to get access to all the features.
@@ -278,6 +278,8 @@ declare class DataView extends EventDispatcher {
278
278
 
279
279
  public enableEmptySegmentFiltering(enabled?: boolean|null): void;
280
280
 
281
+ public enableSeparatorFiltering(enabled?: boolean|null): void;
282
+
281
283
  public setSegmentClassification(segmentRef: string|number|null, fields: string|(string)[]|null): boolean;
282
284
 
283
285
  public getWrapSize(): number;
@@ -131,6 +131,10 @@ DataView.prototype._excludedRids = null;
131
131
  * @type {boolean}
132
132
  */
133
133
  DataView.prototype._emptySegmentFiltering = false;
134
+ /** @private
135
+ * @type {boolean}
136
+ */
137
+ DataView.prototype._separatorFiltering = false;
134
138
 
135
139
  /** @private
136
140
  * @type {Object.<string, number>}
@@ -2566,7 +2570,7 @@ DataView.prototype.sortSeparators = function (sortLogics, sortOrders, cids) {
2566
2570
  DataView.prototype.sortSegments = function (compare) {
2567
2571
  this._dt.sortSegments(compare);
2568
2572
  };
2569
- /** Automatically hide empty segment when all of its member are filtered out. An empty segment will not be hidden, if there is no active filter. Collapsed segment does not count as filtering.
2573
+ /** Automatically hide empty segment when all of its member are filtered out. An empty segment will NOT be hidden, if there is no active filter. Collapsed segment does not count as filtering. A segment with no child is treated the same way as an empty segment.
2570
2574
  * @public
2571
2575
  * @param {boolean=} enabled
2572
2576
  */
@@ -2579,6 +2583,19 @@ DataView.prototype.enableEmptySegmentFiltering = function (enabled) {
2579
2583
  }
2580
2584
  }
2581
2585
  };
2586
+ /** Allow filtering of segment separators as if they were normal rows. Note that even if a separator row is filtered out, its child row may remain in the view and not be filtered out.
2587
+ * @public
2588
+ * @param {boolean=} enabled
2589
+ */
2590
+ DataView.prototype.enableSeparatorFiltering = function (enabled) {
2591
+ enabled = enabled !== false;
2592
+ if(this._separatorFiltering !== enabled) {
2593
+ this._separatorFiltering = enabled;
2594
+ if(this._userFilter) {
2595
+ this._refreshAndNotify();
2596
+ }
2597
+ }
2598
+ };
2582
2599
  /**
2583
2600
  * @public
2584
2601
  * @param {string|number} segmentRef Row id or row index
@@ -2746,14 +2763,19 @@ DataView.prototype._updateRowIds = function(opt_rowIds) {
2746
2763
 
2747
2764
  // Segment separators should not be filtered out (hidden)
2748
2765
  var segments = this._dt._getSegmentSeparators();
2749
- var filterExceptions = segments ? segments.getSegments() : null;
2750
- var userRemoval = this._getRemovalMap(this._excludedRids, this._userFilter, this._filteringOut, filterExceptions);
2766
+ var segmentIds = segments ? segments.getSegments() : null;
2767
+ var userRemoval = this._getRemovalMap(
2768
+ this._excludedRids,
2769
+ this._userFilter,
2770
+ this._filteringOut,
2771
+ this._separatorFiltering ? null : segmentIds
2772
+ );
2751
2773
  exclusionCount += userRemoval;
2752
2774
 
2753
2775
  this._collapsedRids = null;
2754
2776
  if(segments) {
2755
2777
  if(userRemoval && this._emptySegmentFiltering) {
2756
- exclusionCount += this._getEmptySegments(this._excludedRids, filterExceptions);
2778
+ exclusionCount += this._getEmptySegments(this._excludedRids, segmentIds);
2757
2779
  }
2758
2780
  this._collapsedRids = segments.getCollapsedRows();
2759
2781
  // Children of collapsed segments must be filtered out (hidden)
@@ -562,7 +562,7 @@ Core.prototype._batches = null;
562
562
  * @return {string}
563
563
  */
564
564
  Core.getVersion = function () {
565
- return "5.1.76";
565
+ return "5.1.77";
566
566
  };
567
567
  /** {@link ElementWrapper#dispose}
568
568
  * @override
package/lib/grid/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import {Grid} from "./lib/efx-grid.js";
2
2
  export {Grid}
3
- window.EFX_GRID = { version: "6.0.66" };
3
+ window.EFX_GRID = { version: "6.0.67" };
@@ -9,7 +9,8 @@ declare namespace ConditionalColoringPlugin {
9
9
 
10
10
  type Options = {
11
11
  predefinedColors?: any,
12
- blinkingDuration?: number|null
12
+ blinkingDuration?: number|null,
13
+ insertionBlinking?: boolean|null
13
14
  };
14
15
 
15
16
  type ColumnOptions = {
@@ -81,6 +82,8 @@ declare class ConditionalColoringPlugin extends GridPlugin {
81
82
 
82
83
  public setPredefinedColors(predefinedColors: any): void;
83
84
 
85
+ public setInsertionBlinking(blinking: boolean): void;
86
+
84
87
  public getColumnPainter(colIndex: number): CellPainter|null;
85
88
 
86
89
  public applyColor(colIndex: number, cell: any, rowData?: any): void;
@@ -8,7 +8,8 @@ import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
8
8
  /** @typedef {Object} ConditionalColoringPlugin~Options
9
9
  * @description The options can be specified by `conditionalColoring` property of the main grid's options
10
10
  * @property {Object=} predefinedColors Predefined color object map for conditional coloring
11
- * @property {number=} blinkingDuration=250 Blinking duration in milliseconds
11
+ * @property {number=} blinkingDuration=250 Blinking duration in milliseconds
12
+ * @property {boolean=} insertionBlinking=false Blinking when a row is added to a grid
12
13
  */
13
14
 
14
15
  /** @typedef {Object} ConditionalColoringPlugin~ColumnOptions
@@ -149,6 +150,10 @@ ConditionalColoringPlugin.prototype._predefinedColors = null;
149
150
  * @private
150
151
  */
151
152
  ConditionalColoringPlugin.prototype._blinkingDuration = 250;
153
+ /** @type {boolean}
154
+ * @private
155
+ */
156
+ ConditionalColoringPlugin.prototype._insertionBlinking = false;
152
157
  /** @type {string}
153
158
  * @private
154
159
  */
@@ -198,6 +203,10 @@ ConditionalColoringPlugin.prototype.initialize = function (host, options) {
198
203
  if(blinkingDuration != null && typeof blinkingDuration === "number"){
199
204
  this._blinkingDuration = blinkingDuration;
200
205
  }
206
+ var insertionBlinking = extOptions["insertionBlinking"];
207
+ if(insertionBlinking != null){
208
+ this._insertionBlinking = insertionBlinking;
209
+ }
201
210
  }
202
211
 
203
212
  if(hosts.length === 1) {
@@ -1075,6 +1084,14 @@ ConditionalColoringPlugin.prototype.setPredefinedColors = function(predefinedCol
1075
1084
  }
1076
1085
  }
1077
1086
  };
1087
+ /** @public
1088
+ * @param {boolean} blinking enable blinking on row insertion
1089
+ */
1090
+ ConditionalColoringPlugin.prototype.setInsertionBlinking = function(blinking) {
1091
+ if (blinking != null) {
1092
+ this._insertionBlinking = blinking;
1093
+ }
1094
+ };
1078
1095
  /** @private
1079
1096
  * @function
1080
1097
  * @return {!FilterBuilder}
@@ -1130,7 +1147,7 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1130
1147
  return; // dataRows could be empty in case of no column is presented
1131
1148
  }
1132
1149
 
1133
- var c, r, cell, painter, changedCols, rowDef, rid, changedRow, changedRows;
1150
+ var c, r, cell, painter, changedCols, rowDef, rid, changedRow, changedRows, allowBlinking, insertedRow;
1134
1151
  var dataRow, insertedId, colData, blinking, bgBlinking, cachedValues, updatePrev;
1135
1152
  var section = e["section"];
1136
1153
  var colCount = section.getColumnCount();
@@ -1149,6 +1166,8 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1149
1166
  }
1150
1167
 
1151
1168
  var prevDataRow, prevDataRows = host._prevDataRows;
1169
+ var prevIds = Object.keys(prevDataRows);
1170
+ var prevRowCount = prevIds.length;
1152
1171
  for (r = fromR; r < toR; ++r) {
1153
1172
  dataRow = this._rowGetter(dataRows[r]);
1154
1173
  if (!dataRow) continue; // prevent from null value access when using with RowGroupingExtension
@@ -1159,14 +1178,18 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1159
1178
  // TODO: check rid from e.rids
1160
1179
  rowDef = /** @type{RowDefinition} */(dataRow["ROW_DEF"]);
1161
1180
  rid = rowDef ? rowDef.getRowId() : "";
1162
- if (rid && !insertedId[rid]) {
1181
+ insertedRow = insertedId[rid];
1182
+ allowBlinking = !insertedRow || this._insertionBlinking;
1183
+ if (rid && allowBlinking) {
1163
1184
  changedCols = rowDef.getUpdates();
1164
1185
  }
1165
1186
  } else { // composite grid
1166
1187
  changedRow = changedRows[r];
1167
1188
  if (changedRow) {
1168
1189
  rid = changedRow.rid;
1169
- if (!insertedId[rid]) {
1190
+ insertedRow = insertedId[rid];
1191
+ allowBlinking = !insertedRow || this._insertionBlinking;
1192
+ if (allowBlinking) {
1170
1193
  changedCols = changedRow.changed;
1171
1194
  }
1172
1195
  }
@@ -1195,7 +1218,7 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1195
1218
  colData = this._getColumnData(c);
1196
1219
  bgBlinking = false;
1197
1220
  blinking = false;
1198
- if (colData["blinking"] && actualUpdate) { // blinking
1221
+ if (colData["blinking"] && actualUpdate && allowBlinking) { // blinking
1199
1222
  var field = colData["blinkingField"] || this._getField(c);
1200
1223
  var newValue = dataRow[field];
1201
1224
  if (prevDataRow) {
@@ -1206,6 +1229,11 @@ ConditionalColoringPlugin.prototype._onSectionBinding = function (e) {
1206
1229
  bgBlinking = painter.blinkCell(cell, newValue, prevValue, dataRow, dataRow);
1207
1230
  }
1208
1231
  }
1232
+ } else {
1233
+ if(prevRowCount && insertedRow){
1234
+ blinking = true;
1235
+ bgBlinking = painter.blinkCell(cell, newValue, newValue, dataRow, dataRow);
1236
+ }
1209
1237
  }
1210
1238
 
1211
1239
  if (!blinking) {
@@ -49,7 +49,8 @@ declare namespace ContextMenuPlugin {
49
49
  type OnMenuEvent = {
50
50
  cell: any,
51
51
  colIndex: number,
52
- columnDef: object|null,
52
+ field: string,
53
+ colId: string,
53
54
  context: ContextMenuPlugin.Context|null,
54
55
  items: object|null,
55
56
  menu: MenuEventAPI|null,
@@ -53,7 +53,8 @@ import CellPainter from "../../tr-grid-util/es6/CellPainter.js";
53
53
  /** @typedef {Object} ContextMenuPlugin~OnMenuEvent
54
54
  * @property {Object} cell Grid cell object at the mouse clicked position
55
55
  * @property {number} colIndex Index number of the column that the mouse clicked on
56
- * @property {object} columnDef Column Definition of the column that the mouse clicked on
56
+ * @property {string} field Field of the column that the mouse clicked on
57
+ * @property {string} colId Column ID of the column that the mouse clicked on
57
58
  * @property {ContextMenuPlugin~Context} context Area of the grid that the mouse clicked on
58
59
  * @property {object} items Object reference to the menu items under items option
59
60
  * @property {MenuEventAPI} menu API for adding menu items to be rendered
@@ -128,10 +129,6 @@ ContextMenuPlugin.prototype._rsp = null;
128
129
  * @private
129
130
  */
130
131
  ContextMenuPlugin.prototype._contextMenu = null;
131
- /** @type {Array}
132
- * @private
133
- */
134
- ContextMenuPlugin.prototype._userColumns = null;
135
132
 
136
133
  /** @public
137
134
  * @return {string}
@@ -191,7 +188,6 @@ ContextMenuPlugin.prototype.config = function (options) {
191
188
 
192
189
  var t = this;
193
190
 
194
- t._userColumns = options["columns"];
195
191
  var contextMenu = options["contextMenu"];
196
192
 
197
193
  if (contextMenu == null) { return; }
@@ -237,11 +233,15 @@ ContextMenuPlugin.prototype.getMenuModel = function () {
237
233
  * @return {!Object} Mouse related information
238
234
  */
239
235
  ContextMenuPlugin.prototype._configureMouseInfo = function (e) {
240
- var mouseInfo = this._hosts[0].getRelativePosition(e);
236
+ var host = this._hosts[0];
237
+ var mouseInfo = host.getRelativePosition(e);
241
238
 
242
239
  // Supply possibly needed arguments for the event handler
243
240
  mouseInfo.context = this._contextMap[mouseInfo.sectionType] || "";
244
- mouseInfo.columnDef = this._userColumns[mouseInfo.colIndex];
241
+ var colIndex = mouseInfo.colIndex;
242
+ var columnDef = mouseInfo.columnDef = {};
243
+ mouseInfo.field = columnDef.field = this.getColumnField(colIndex);
244
+ mouseInfo.colId = columnDef.id = this.getColumnId(colIndex);
245
245
 
246
246
  if (!this._csp) {
247
247
  this._csp = this._getPlugin("ColumnSelectionPlugin");
@@ -35,6 +35,7 @@ declare namespace RowFilteringPlugin {
35
35
 
36
36
  type Options = {
37
37
  emptySegmentFiltering?: boolean|null,
38
+ separatorFiltering?: boolean|null,
38
39
  disabledUI?: boolean|null,
39
40
  iconActivation?: string|null,
40
41
  dialogOptions?: RowFilteringPlugin.FilterDialogOptions|null,
@@ -118,6 +119,8 @@ declare class RowFilteringPlugin extends GridPlugin {
118
119
 
119
120
  public enableEmptySegmentFiltering(enabled?: boolean|null): void;
120
121
 
122
+ public enableSeparatorFiltering(enabled?: boolean|null): void;
123
+
121
124
  }
122
125
 
123
126
  declare function field(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
@@ -87,7 +87,8 @@ The expression can take various forms:<br>
87
87
 
88
88
  /** @typedef {Object} RowFilteringPlugin~Options
89
89
  * @description The options can be specified by `rowFiltering` property of the main grid's options
90
- * @property {boolean=} emptySegmentFiltering=false If enabled, the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter.
90
+ * @property {boolean=} emptySegmentFiltering=false If enabled, the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter. A segment with no child is treated the same way as an empty segment.
91
+ * @property {boolean=} separatorFiltering=false If enabled, segment separators will be filtered as if they were normal rows. Note that even if a separator row is filtered out, its child row may remain in the view and not be filtered out.
91
92
  * @property {boolean=} disabledUI=false Deprecated in favor of `iconActivation`. Set iconActivation to none instead.
92
93
  * @property {string=} iconActivation=onActiveFilter Filter icon redering behavior, can be set to `always`,`onHover`,`onActiveFilter`,or `none`
93
94
  * @property {RowFilteringPlugin~FilterDialogOptions=} dialogOptions=null Default configuration for Filter Dialog, applying to all columns.
@@ -371,6 +372,11 @@ RowFilteringPlugin.prototype.config = function (options) {
371
372
  this.enableEmptySegmentFiltering(rowFiltering["emptySegmentFiltering"] ? true : false);
372
373
  }
373
374
 
375
+ if (rowFiltering["separatorFiltering"] != null) {
376
+ // TODO: there is a chance that there is no DataView during the configuration
377
+ this.enableSeparatorFiltering(rowFiltering["separatorFiltering"] ? true : false);
378
+ }
379
+
374
380
  if (rowFiltering["iconActivation"]) {
375
381
  this._iconActivation = rowFiltering["iconActivation"];
376
382
 
@@ -479,6 +485,7 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
479
485
 
480
486
  dirty = true;
481
487
  } // TODO: get emptySegmentFiltering setting from DataView
488
+ // TODO: get separatorFiltering setting from DataView
482
489
 
483
490
 
484
491
  if (dirty) {
@@ -2137,7 +2144,7 @@ RowFilteringPlugin.prototype._onColumnRemoved = function (e) {
2137
2144
  this._requestFilterRefresh();
2138
2145
  }
2139
2146
  };
2140
- /** the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter.
2147
+ /** the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter. A segment with no child is treated the same way as an empty segment.
2141
2148
  * @public
2142
2149
  * @param {boolean=} enabled=true
2143
2150
  */
@@ -2151,6 +2158,20 @@ RowFilteringPlugin.prototype.enableEmptySegmentFiltering = function (enabled) {
2151
2158
  dv.enableEmptySegmentFiltering(enabled);
2152
2159
  }
2153
2160
  };
2161
+ /** the filter will automatically hide empty segment when all of its member are filtered out. If there is no active filter, any empty segment will not be hidden. Collapsed segment does not count as having a filter.
2162
+ * @public
2163
+ * @param {boolean=} enabled=true
2164
+ */
2165
+
2166
+
2167
+ RowFilteringPlugin.prototype.enableSeparatorFiltering = function (enabled) {
2168
+ var host = this._hosts[0];
2169
+ var dv = host ? host.getDataSource() : null;
2170
+
2171
+ if (dv && dv.enableSeparatorFiltering) {
2172
+ dv.enableSeparatorFiltering(enabled);
2173
+ }
2174
+ };
2154
2175
 
2155
2176
  export default RowFilteringPlugin;
2156
2177
  export { RowFilteringPlugin, RowFilteringPlugin as RowFiltering, RowFilteringPlugin as RowFilteringExtension };
@@ -9,7 +9,8 @@ declare namespace ConditionalColoringPlugin {
9
9
 
10
10
  type Options = {
11
11
  predefinedColors?: any,
12
- blinkingDuration?: number|null
12
+ blinkingDuration?: number|null,
13
+ insertionBlinking?: boolean|null
13
14
  };
14
15
 
15
16
  type ColumnOptions = {
@@ -81,6 +82,8 @@ declare class ConditionalColoringPlugin extends GridPlugin {
81
82
 
82
83
  public setPredefinedColors(predefinedColors: any): void;
83
84
 
85
+ public setInsertionBlinking(blinking: boolean): void;
86
+
84
87
  public getColumnPainter(colIndex: number): CellPainter|null;
85
88
 
86
89
  public applyColor(colIndex: number, cell: any, rowData?: any): void;
@@ -49,7 +49,8 @@ declare namespace ContextMenuPlugin {
49
49
  type OnMenuEvent = {
50
50
  cell: any,
51
51
  colIndex: number,
52
- columnDef: object|null,
52
+ field: string,
53
+ colId: string,
53
54
  context: ContextMenuPlugin.Context|null,
54
55
  items: object|null,
55
56
  menu: MenuEventAPI|null,
@@ -278,6 +278,8 @@ declare class DataView extends EventDispatcher {
278
278
 
279
279
  public enableEmptySegmentFiltering(enabled?: boolean|null): void;
280
280
 
281
+ public enableSeparatorFiltering(enabled?: boolean|null): void;
282
+
281
283
  public setSegmentClassification(segmentRef: string|number|null, fields: string|(string)[]|null): boolean;
282
284
 
283
285
  public getWrapSize(): number;
@@ -35,6 +35,7 @@ declare namespace RowFilteringPlugin {
35
35
 
36
36
  type Options = {
37
37
  emptySegmentFiltering?: boolean|null,
38
+ separatorFiltering?: boolean|null,
38
39
  disabledUI?: boolean|null,
39
40
  iconActivation?: string|null,
40
41
  dialogOptions?: RowFilteringPlugin.FilterDialogOptions|null,
@@ -118,6 +119,8 @@ declare class RowFilteringPlugin extends GridPlugin {
118
119
 
119
120
  public enableEmptySegmentFiltering(enabled?: boolean|null): void;
120
121
 
122
+ public enableSeparatorFiltering(enabled?: boolean|null): void;
123
+
121
124
  }
122
125
 
123
126
  declare function field(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
package/lib/versions.json CHANGED
@@ -14,9 +14,9 @@
14
14
  "tr-grid-column-resizing": "1.0.28",
15
15
  "tr-grid-column-selection": "1.0.29",
16
16
  "tr-grid-column-stack": "1.0.72",
17
- "tr-grid-conditional-coloring": "1.0.64",
17
+ "tr-grid-conditional-coloring": "1.0.65",
18
18
  "tr-grid-content-wrap": "1.0.20",
19
- "tr-grid-contextmenu": "1.0.39",
19
+ "tr-grid-contextmenu": "1.0.40",
20
20
  "tr-grid-filter-input": "0.9.33",
21
21
  "tr-grid-heat-map": "1.0.29",
22
22
  "tr-grid-in-cell-editing": "1.0.80",
@@ -24,7 +24,7 @@
24
24
  "tr-grid-percent-bar": "1.0.22",
25
25
  "tr-grid-range-bar": "2.0.5",
26
26
  "tr-grid-row-dragging": "1.0.29",
27
- "tr-grid-row-filtering": "1.0.60",
27
+ "tr-grid-row-filtering": "1.0.61",
28
28
  "tr-grid-row-grouping": "1.0.82",
29
29
  "tr-grid-row-selection": "1.0.23",
30
30
  "tr-grid-rowcoloring": "1.0.24",
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.66"
69
+ "version": "6.0.67"
70
70
  }