@refinitiv-ui/efx-grid 6.0.49 → 6.0.51

Sign up to get free protection for your applications and to get access to all the features.
@@ -1070,8 +1070,7 @@ ColumnDefinition.prototype._retrieveNestedFields = function(fields) {
1070
1070
  */
1071
1071
  ColumnDefinition.prototype._defaultRenderer = function(e) {
1072
1072
  var rowDef = /** @type{RowDefinition} */(e["dataValue"]);
1073
- var data = rowDef.getData(this._field);
1074
- e["cell"].setContent(data);
1073
+ e["cell"].setContent(rowDef ? rowDef.getData(this._field) : null);
1075
1074
  };
1076
1075
  /** @private
1077
1076
  * @param {Object} e
@@ -152,6 +152,12 @@ import { ElementWrapper } from "../../core/es6/grid/components/ElementWrapper.js
152
152
  * @property {Grid} grid
153
153
  * @property {RowDefinition} rowDef
154
154
  */
155
+
156
+ /** @event Grid#beforeContentBinding
157
+ * @property {Object} e Event of beforeContentBinding, We can use e.actualUpdate to check the actual data update, otherwise It will be empty when it is rendered by row virtualization or only the UI changes.
158
+ * @description Trigger before content binding.
159
+ */
160
+
155
161
  /** @event Grid#beforeRowRemoved
156
162
  * @description Fired only when a row will be removed through Grid's API and before occurring of the actual removal
157
163
  */
@@ -302,6 +308,7 @@ var Grid = function(placeholder, config) {
302
308
  t.updateColumnTitle = t.updateColumnTitle.bind(t);
303
309
  t._populateTimeSeriesChildren = t._populateTimeSeriesChildren.bind(t);
304
310
 
311
+ t._onBeforeContentBinding = t._onBeforeContentBinding.bind(t);
305
312
  t._onPostSectionDataBinding = t._onPostSectionDataBinding.bind(t);
306
313
  t._asyncClearDataUpdates = t._asyncClearDataUpdates.bind(t);
307
314
  t._clearDataUpdates = t._clearDataUpdates.bind(t);
@@ -394,6 +401,7 @@ var Grid = function(placeholder, config) {
394
401
  t._grid.loadPlugin(t._stp, config);
395
402
  }
396
403
 
404
+ t._grid.listen("beforeContentBinding", t._onBeforeContentBinding);
397
405
  t._grid.listen("preSectionRender", t._onColumnHeaderBinding);
398
406
  t._grid.listen("postSectionDataBinding", t._onPostSectionDataBinding);
399
407
 
@@ -3513,6 +3521,13 @@ Grid.prototype._mainSorter = function (rowDefA, rowDefB, order) {
3513
3521
  return this._columnSorter(rowDefA, rowDefB, order);
3514
3522
  };
3515
3523
 
3524
+ /** @private
3525
+ * @param {Object} e
3526
+ */
3527
+ Grid.prototype._onBeforeContentBinding = function(e) {
3528
+ this._dispatch("beforeContentBinding", e);
3529
+ };
3530
+
3516
3531
  /** @private
3517
3532
  * @param {Object} e
3518
3533
  */
@@ -114,13 +114,13 @@ var _setColumnAlignment = function (tbl, colIndex, alignment) {
114
114
  };
115
115
 
116
116
  /** @private
117
- * @param {*} grid grid element, currently supports atlas-blotter, emerald-grid, tr.CompositeGrid, rt.Grid and Core
117
+ * @param {*} grid grid element, currently supports atlas-blotter, ef-grid, tr.CompositeGrid, rt.Grid and Core
118
118
  * @return {Object} core grid
119
119
  */
120
120
  var _getCoreGrid = function (grid) {
121
121
  var core = null;
122
122
  try {
123
- if (grid.api) { // emerald-grid or atlas-blotter
123
+ if (grid.api) { // ef-grid or atlas-blotter
124
124
  core = grid.api.getCoreGrid();
125
125
  } else if (grid.getCoreGrid) { // tr.CompositeGrid or rt.Grid
126
126
  core = grid.getCoreGrid();
@@ -352,7 +352,7 @@ GridPrinter.getPreFlightInfo = function (grid, options) {
352
352
  };
353
353
 
354
354
  /** @public
355
- * @param {*} grid grid element, currently supports atlas-blotter, emerald-grid, tr.CompositeGrid, rt.Grid and Core
355
+ * @param {*} grid grid element, currently supports atlas-blotter, ef-grid, tr.CompositeGrid, rt.Grid and Core
356
356
  * @param {Object=} options
357
357
  * @return {Element}
358
358
  */
@@ -523,7 +523,7 @@ GridPrinter._applyCss = function () {
523
523
  ".tr-printing-root .tr-align-center", [
524
524
  "text-align: center;"
525
525
  ],
526
- ".tr-printing-root .cell coral-icon", [
526
+ ".tr-printing-root .cell ef-icon", [
527
527
  "margin-top: 3px;"
528
528
  ],
529
529
  ".tr-printing-root .cell .sort-symbol", [
@@ -647,7 +647,7 @@ GridPrinter._applyCss = function () {
647
647
  };
648
648
 
649
649
  /** @public
650
- * @param {*} grid grid element, currently supports atlas-blotter, emerald-grid, tr.CompositeGrid, rt.Grid and Core
650
+ * @param {*} grid grid element, currently supports atlas-blotter, ef-grid, tr.CompositeGrid, rt.Grid and Core
651
651
  */
652
652
  GridPrinter.print = function (grid) {
653
653
  var core = null;
@@ -1,11 +1,11 @@
1
1
  /** @namespace */
2
2
  var CoralItems = {};
3
3
 
4
- /** Create new array with valid object items to be consumed by coral-select's data property from the given input
4
+ /** Create new array with valid object items to be consumed by ef-select's data property from the given input
5
5
  * @public
6
6
  * @function
7
7
  * @param {Array} userItems This can be array of anything (e.g. texts, numbers, objects or etc.).
8
- * @return {Array.<Object>} Valid data objects for generating coral-item by coral-select
8
+ * @return {Array.<Object>} Valid data objects for generating ef-item by ef-select
9
9
  * @example
10
10
  * CoralItems.create(["a", "b"]); // [{label: "a", value: "a"}, {label: "b", value: "b"}]
11
11
  * CoralItems.create([33]); // [{label: "33", value: 33}]
@@ -62,7 +62,7 @@ ElfDate.prefixSingleDigit = function (n) {
62
62
  */
63
63
  ElfDate._ymdRe = /^\d{4}\-d{2}\-\d{2}/; // eslint-disable-line
64
64
 
65
- /** Returns yyyy-MM-dd string format for emerald-datetime-picker.
65
+ /** Returns yyyy-MM-dd string format for ef-datetime-picker.
66
66
  * @public
67
67
  * @function
68
68
  * @param {string|Date} d
@@ -156,7 +156,7 @@ ElfUtil.getElfVersion = function () {
156
156
  * @param {string} compName
157
157
  * @return {number}
158
158
  * @example
159
- * ElfUtil.hasComponent("coral-button"); // 1 or 3
159
+ * ElfUtil.hasComponent("ef-button"); // 1 or 3
160
160
  * ElfUtil.hasComponent("unknown-button"); // 0
161
161
  */
162
162
  ElfUtil.hasComponent = function (compName) {
@@ -329,7 +329,7 @@ ElfUtil.prepareIconPreloading = function() {
329
329
  var iconList = ElfUtil.getIconList();
330
330
  if(iconList.length) {
331
331
  setTimeout(ElfUtil._onIconPreloaded, 10);
332
- var dummyIcon = ElfUtil._dummyIcon = document.createElement("coral-icon");
332
+ var dummyIcon = ElfUtil._dummyIcon = document.createElement("ef-icon");
333
333
  dummyIcon.style.transform = "scale(0)";
334
334
  document.body.appendChild(dummyIcon);
335
335
  return iconList;
@@ -11,7 +11,7 @@ import { ElfUtil } from "./ElfUtil.js";
11
11
  var ExpanderIcon = function () {
12
12
  var elem;
13
13
  if (ExpanderIcon._iconName) {
14
- elem = document.createElement("coral-icon");
14
+ elem = document.createElement("ef-icon");
15
15
  elem.setAttribute("icon", ExpanderIcon._iconName);
16
16
  } else {
17
17
  elem = document.createElement("span");
@@ -419,7 +419,7 @@ GridPlugin.prototype._requestPlugin = function (host, pluginRef, configObj) {
419
419
  };
420
420
  /** Make a request to load a plugin/extension into the given core grid (tr-grid). Return a promise of plugin/extension instance
421
421
  * @public
422
- * @param {*} ref This can be emerald-grid, atlas-blotter, composite grid, real-time grid, or core grid.
422
+ * @param {*} ref This can be ef-grid, atlas-blotter, composite grid, real-time grid, or core grid.
423
423
  * @param {*} pluginRef Plugin/Extension name or instance
424
424
  * @param {Object=} configObj
425
425
  * @param {*=} compositeGrid
@@ -5,10 +5,10 @@ var Icon = {};
5
5
  * @function
6
6
  * @param {string=} iconName
7
7
  * @param {string=} className
8
- * @return {!Element} coral-icon element
8
+ * @return {!Element} ef-icon element
9
9
  */
10
10
  Icon.create = function(iconName, className) {
11
- var icon = document.createElement("coral-icon");
11
+ var icon = document.createElement("ef-icon");
12
12
  if(className) {
13
13
  icon.className = className;
14
14
  }
@@ -47,7 +47,7 @@ Icon.box = function(iconName, className, boxRef) {
47
47
 
48
48
  /** @public
49
49
  * @function
50
- * @param {Element} iconElem coral-icon element
50
+ * @param {Element} iconElem ef-icon element
51
51
  * @param {string=} iconName
52
52
  */
53
53
  Icon.change = function(iconElem, iconName) {
@@ -12,7 +12,7 @@ import { Dom } from "./Dom.js";
12
12
  var GridElements = {
13
13
  "EFX-GRID": 1,
14
14
  "ATLAS-BLOTTER": 1,
15
- "EMERALD-GRID": 1
15
+ "EF-GRID": 1
16
16
  };
17
17
  /** @type {Object.<string, number>}
18
18
  * @private
@@ -23,7 +23,7 @@ var InvalidHostElements = {
23
23
  "HTML": 1,
24
24
  "EFX-GRID": 1,
25
25
  "ATLAS-BLOTTER": 1,
26
- "EMERALD-GRID": 1
26
+ "EF-GRID": 1
27
27
  };
28
28
 
29
29
  /** @private
@@ -76,7 +76,7 @@ var MultiTableManager = function (gridElem) {
76
76
 
77
77
  this._tables = [];
78
78
  if(gridElem) {
79
- this._emeraldGrid = gridElem.tagName === "EMERALD-GRID";
79
+ this._emeraldGrid = gridElem.tagName === "EF-GRID";
80
80
  this._tables.push(gridElem);
81
81
  }
82
82
  };
@@ -16,7 +16,11 @@ var _joinSubKeys = function(subA, subB) {
16
16
  */
17
17
  var _isDynamicChain = function(ric) {
18
18
  // Dynamic chain will be 2 . (dot) for example .PG.PA
19
- return ric.match(/\./g).length > 1;
19
+ var matching = ric.match(/\./g); // Can be null when doesn't found dot(.)
20
+ if(matching) {
21
+ return matching.length > 1;
22
+ }
23
+ return false;
20
24
  };
21
25
 
22
26
  /** @private
@@ -112,7 +112,7 @@ declare class DataTable extends DataCache {
112
112
 
113
113
  public getSegmentChildIds(segmentId: string): (string)[]|null;
114
114
 
115
- public sortSeparators(sortLogics: ((...params: any[]) => any)|(((...params: any[]) => any))[]|null, sortOrders: (number)[]|null, cids: (string)[]|null): boolean;
115
+ public sortSeparators(sortLogics: ((...params: any[]) => any)|(((...params: any[]) => any))[]|any|null, sortOrders?: (number)[]|null, cids?: (string)[]|null): boolean;
116
116
 
117
117
  public sortSegments(compare: ((...params: any[]) => any)|null): boolean;
118
118
 
@@ -272,10 +272,12 @@ declare class DataView extends EventDispatcher {
272
272
 
273
273
  public getSegmentChildIds(segmentRef: string|number|null): (string)[]|null;
274
274
 
275
- public sortSeparators(sortLogics: (((...params: any[]) => any))[]|null, sortOrders: (number)[]|null, cids: (string)[]|null): void;
275
+ public sortSeparators(sortLogics: ((...params: any[]) => any)|(((...params: any[]) => any))[]|any|null, sortOrders?: (number)[]|null, cids?: (string)[]|null): void;
276
276
 
277
277
  public sortSegments(compare: ((...params: any[]) => any)|null): void;
278
278
 
279
+ public enableEmptySegmentFiltering(enabled?: boolean|null): void;
280
+
279
281
  public setSegmentClassification(segmentRef: string|number|null, fields: string|(string)[]|null): boolean;
280
282
 
281
283
  public getWrapSize(): number;
@@ -27,6 +27,8 @@ declare class Segment extends EventDispatcher {
27
27
 
28
28
  public getChildIds(): (string)[];
29
29
 
30
+ public getChildren(): any;
31
+
30
32
  public getChildCount(): number;
31
33
 
32
34
  public getClassification(): (string)[]|null;
package/lib/versions.json CHANGED
@@ -1,4 +1,6 @@
1
1
  {
2
+ "tr-grid-util": "1.3.116",
3
+ "tr-grid-printer": "1.0.16",
2
4
  "@grid/column-dragging": "1.0.14",
3
5
  "@grid/row-segmenting": "1.0.24",
4
6
  "@grid/statistics-row": "1.0.14",
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.49"
69
+ "version": "6.0.51"
70
70
  }