@refinitiv-ui/efx-grid 6.0.100 → 6.0.101

Sign up to get free protection for your applications and to get access to all the features.
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.100" };
3
+ window.EFX_GRID = { version: "6.0.101" };
@@ -15285,7 +15285,7 @@ PredefinedFormula.remove = function(field) {
15285
15285
  * @property {boolean=} leftPinned=false If enabled, the column will not be part of the scrollable area and is pinned to the left side
15286
15286
  * @property {boolean=} rightPinned=false If enabled, the column will not be part of the scrollable area and is pinned to the right side
15287
15287
  * @property {Object=} info=null For storing any additional information to the column
15288
- * @property {boolean} focusable=false If enabled, the column will be used to find focusable element when pressing tab key
15288
+ * @property {boolean=} focusable=false If enabled, the column will be used to find focusable element when pressing tab key
15289
15289
  */
15290
15290
 
15291
15291
  /** mapping of field type to javascript type
@@ -44,7 +44,7 @@ declare namespace ColumnDefinition {
44
44
  leftPinned?: boolean|null,
45
45
  rightPinned?: boolean|null,
46
46
  info?: any,
47
- focusable: boolean
47
+ focusable?: boolean|null
48
48
  };
49
49
 
50
50
  }
@@ -50,7 +50,7 @@ import Engine from "../../tr-grid-util/es6/formula/Engine.js";
50
50
  * @property {boolean=} leftPinned=false If enabled, the column will not be part of the scrollable area and is pinned to the left side
51
51
  * @property {boolean=} rightPinned=false If enabled, the column will not be part of the scrollable area and is pinned to the right side
52
52
  * @property {Object=} info=null For storing any additional information to the column
53
- * @property {boolean} focusable=false If enabled, the column will be used to find focusable element when pressing tab key
53
+ * @property {boolean=} focusable=false If enabled, the column will be used to find focusable element when pressing tab key
54
54
  */
55
55
 
56
56
  /** mapping of field type to javascript type
@@ -884,10 +884,13 @@ InCellEditingPlugin.prototype.unload = function (host) {
884
884
  clearTimeout(this._editorTimerId);
885
885
  }
886
886
  window.removeEventListener("scroll", this._onScroll);
887
+ if(this._starterTextPopup) {
888
+ this._starterTextPopup.dispose();
889
+ }
887
890
  }
888
-
889
- if(this._starterTextPopup) {
890
- this._starterTextPopup.dispose();
891
+ if(this.isEditing()) {
892
+ this.closeRowEditor(false);
893
+ this.closeCellEditor(false);
891
894
  }
892
895
  this._dispose();
893
896
  };
@@ -136,6 +136,42 @@ let _arrayConcat = function(ary, val) {
136
136
  }
137
137
  return ary;
138
138
  };
139
+
140
+ /** @type {Object}
141
+ * @private
142
+ * @const
143
+ */
144
+ const BlankValues = {
145
+ "": true,
146
+ "null": true,
147
+ "undefined": true,
148
+ "NaN": true
149
+ };
150
+ /** @private
151
+ * @function
152
+ * @param {Array} ary
153
+ * @param {string} str
154
+ * @returns {boolean} Returns true if there is any change
155
+ */
156
+ let _pushRawValue = function(ary, str) {
157
+ if(str) {
158
+ if(!BlankValues[str]) {
159
+ let dateObj = stringToDateObject(str);
160
+ if(dateObj !== str) {
161
+ ary.push(dateObj);
162
+ } else {
163
+ try {
164
+ ary.push(JSON.parse(str));
165
+ } catch (err) {
166
+ ary.push(str);
167
+ }
168
+ }
169
+ return true;
170
+ }
171
+ }
172
+ return false;
173
+ };
174
+
139
175
  /** @private
140
176
  * @function
141
177
  * @param {Object} obj
@@ -670,8 +706,8 @@ RowFilteringPlugin.prototype._parseFilter = function(exp, colIndex, ctx) {
670
706
  rawDataAccessor = ctx.rawDataAccessor || null;
671
707
  formattedDataAccessor = ctx.formattedDataAccessor || null;
672
708
  }
673
- if(!Array.isArray(exp)) {
674
- if(exp[BLANKS] || (ctx && ctx.blankValues)) {
709
+ if(!Array.isArray(exp)) { // If exp is an object
710
+ if(exp[BLANKS] || (ctx && ctx.blankValues)) { // it contains BLANKS key or context object has blank option
675
711
  exp[""] = exp["null"] = exp["undefined"] = exp["NaN"] = true;
676
712
  delete exp[BLANKS];
677
713
  }
@@ -1485,7 +1521,7 @@ let _valueToString = function(formattedVal, rawVal) {
1485
1521
  } else if(formattedVal instanceof Date) {
1486
1522
  return formattedVal.toLocaleString("en-GB");
1487
1523
  } else { // Object type cannot be converted to string
1488
- return"";
1524
+ return "";
1489
1525
  }
1490
1526
  } else if(formattedVal === 0) {
1491
1527
  return "0";
@@ -1650,19 +1686,22 @@ RowFilteringPlugin._formatArrayExpression = function(exp, field, formatter) {
1650
1686
  ary.rawValue = val;
1651
1687
  ary.formattedValue = formattedVal;
1652
1688
  }
1653
- if(field && formatter && typeof val !== "string") {
1654
- if(val != null) {
1689
+ if(typeof val !== "string" && val != null) {
1690
+ if(field && formatter) {
1655
1691
  let dummyRow = {};
1656
1692
  dummyRow[field] = val;
1657
1693
  formattedVal = formatter(dummyRow);
1658
- if(formattedVal) {
1659
- ary.rawValue = val;
1660
- ary.formattedValue = formattedVal;
1661
- val = formattedVal;
1662
- }
1694
+ } else {
1695
+ formattedVal = _valueToString(val, val);
1696
+ }
1697
+ if(formattedVal) {
1698
+ ary.rawValue = val;
1699
+ ary.formattedValue = formattedVal;
1700
+ } else {
1701
+ formattedVal = val;
1663
1702
  }
1664
1703
  }
1665
- ary[1] = val;
1704
+ ary[1] = formattedVal;
1666
1705
  return ary;
1667
1706
  }
1668
1707
  return null;
@@ -1802,22 +1841,36 @@ RowFilteringPlugin.prototype.openDialog = function(colIndex, runtimeDialogOption
1802
1841
  let filterFuncs = null;
1803
1842
  let exp = colSettings.expression;
1804
1843
  if(exp) {
1844
+ let userInputs = [];
1845
+ if(cfo._filters && cfo._filters.length) {
1846
+ filterFuncs = cfo._filters;
1847
+ }
1805
1848
  if(Array.isArray(exp)) {
1806
1849
  if(exp.length) {
1807
1850
  condition2D = Array.isArray(exp[0]) ? exp.slice() : [exp]; // Guaranteed condition2D to be a 2D array
1808
- condition2D[0] = RowFilteringPlugin._formatArrayExpression(condition2D[0], field, formatter);
1809
- condition2D[1] = RowFilteringPlugin._formatArrayExpression(condition2D[1], field, formatter);
1851
+ let conditionAry = null;
1852
+ conditionAry = RowFilteringPlugin._formatArrayExpression(condition2D[0], field, formatter);
1853
+ condition2D[0] = conditionAry;
1854
+ if(conditionAry) {
1855
+ _pushRawValue(userInputs, conditionAry.rawValue != null ? conditionAry.rawValue : conditionAry[1]);
1856
+ }
1857
+
1858
+ conditionAry = RowFilteringPlugin._formatArrayExpression(condition2D[1], field, formatter);
1859
+ condition2D[1] = conditionAry;
1860
+ if(conditionAry) {
1861
+ _pushRawValue(userInputs, conditionAry.rawValue != null ? conditionAry.rawValue : conditionAry[1]);
1862
+ }
1863
+
1810
1864
  filterMode = "advanced";
1811
1865
  }
1812
1866
  } else if(typeof exp === "function" || typeof exp === "string" || typeof exp === "object") {
1813
- if(cfo._filters && cfo._filters.length) {
1814
- filterFuncs = cfo._filters;
1815
- }
1816
1867
  if(typeof exp === "object") {
1817
- exp = _handledBlankProperties(exp);
1818
- dialogConfig.additionalItems = _arrayConcat(dialogConfig.additionalItems, Object.keys(exp));
1868
+ for(let expKey in exp) {
1869
+ _pushRawValue(userInputs, expKey);
1870
+ }
1819
1871
  }
1820
1872
  }
1873
+ dialogConfig.additionalItems = _arrayConcat(dialogConfig.additionalItems, userInputs);
1821
1874
  }
1822
1875
 
1823
1876
  let selectedItems = {};
@@ -327,6 +327,8 @@ declare class Core extends ElementWrapper {
327
327
 
328
328
  public scrollToRow(sectionRef: Core.SectionReference|null, rowIndex: number, topOfView?: boolean|null): void;
329
329
 
330
+ public getVerticalViewInfo(): any;
331
+
330
332
  public getVScrollView(): any;
331
333
 
332
334
  public getScrollTop(): number;
@@ -45,7 +45,8 @@ declare namespace ColumnDefinition {
45
45
  stationary?: boolean|null,
46
46
  leftPinned?: boolean|null,
47
47
  rightPinned?: boolean|null,
48
- info?: any
48
+ info?: any,
49
+ focusable?: boolean|null
49
50
  };
50
51
 
51
52
  }
@@ -160,6 +161,8 @@ declare class ColumnDefinition {
160
161
 
161
162
  public getColumnInfo(): any;
162
163
 
164
+ public isFocusable(): boolean;
165
+
163
166
  }
164
167
 
165
168
  declare const COL_DEF: string;
package/lib/versions.json CHANGED
@@ -19,12 +19,12 @@
19
19
  "tr-grid-contextmenu": "1.0.41",
20
20
  "tr-grid-filter-input": "0.9.39",
21
21
  "tr-grid-heat-map": "1.0.29",
22
- "tr-grid-in-cell-editing": "1.0.85",
22
+ "tr-grid-in-cell-editing": "1.0.86",
23
23
  "tr-grid-pagination": "1.0.24",
24
24
  "tr-grid-percent-bar": "1.0.24",
25
25
  "tr-grid-range-bar": "2.0.8",
26
26
  "tr-grid-row-dragging": "1.0.35",
27
- "tr-grid-row-filtering": "1.0.74",
27
+ "tr-grid-row-filtering": "1.0.75",
28
28
  "tr-grid-row-grouping": "1.0.87",
29
29
  "tr-grid-row-selection": "1.0.30",
30
30
  "tr-grid-rowcoloring": "1.0.25",
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.100"
69
+ "version": "6.0.101"
70
70
  }