@refinitiv-ui/efx-grid 6.0.118 → 6.0.119

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.
@@ -2290,9 +2290,46 @@ Grid.prototype.setColumnSorter = function(colRef, func) {
2290
2290
  * @param {!RowDefinition} rowDef
2291
2291
  */
2292
2292
  Grid.prototype._initDuplicateRicData = function(rowDef) {
2293
+ if(!rowDef) {
2294
+ return;
2295
+ }
2293
2296
  let rowDefs = this._connector.getRowDefByRic(rowDef.getSymbol());
2294
- if(rowDefs) {
2295
- rowDef.copyRowData(rowDefs[0]);
2297
+ if(rowDefs && rowDefs.length > 0) { // Found at least 1 Duplicate chain/ric data
2298
+ let firstRowDef = rowDefs[0];
2299
+ rowDef.copyRowData(firstRowDef);
2300
+ if(rowDef.isChain()) {
2301
+ let children = firstRowDef.getChildren();
2302
+ if(children && children.length > 0) {
2303
+ setTimeout(this._cloneChain.bind(this, rowDef), 0); // Need to delay to wait row inserted
2304
+ }
2305
+ }
2306
+ }
2307
+ };
2308
+
2309
+ /** @private
2310
+ * @param {Object} rowDef
2311
+ * @param {Array<Object>} children
2312
+ */
2313
+ Grid.prototype._cloneChain = function(rowDef) {
2314
+ let rowDefs = this._connector.getRowDefByRic(rowDef.getSymbol());
2315
+ let firstRowDef = rowDefs ? rowDefs[0] : null;
2316
+ let constituents = firstRowDef ? firstRowDef.getChildren() : null;
2317
+
2318
+ if(!constituents) {
2319
+ return;
2320
+ }
2321
+ let count = constituents.length;
2322
+ if(count < 0 ) {
2323
+ return;
2324
+ }
2325
+
2326
+ let subId = rowDef.getData(SUB_ID);
2327
+ for (let i = 0; i < count; i++) {
2328
+ let childRowDef = constituents[i];
2329
+ let rowData = childRowDef.cloneRowData();
2330
+ rowData["SUB_ID"] = subId;
2331
+ let rid = subId + rowData["RIC"];
2332
+ this._dc.setRowData(rid, rowData);
2296
2333
  }
2297
2334
  };
2298
2335
  /** @public
@@ -64,6 +64,8 @@ declare class RowDefinition {
64
64
 
65
65
  public copyRowData(srcRowDef: RowDefinition|null): void;
66
66
 
67
+ public cloneRowData(obj?: any, exceptionObj?: any): any;
68
+
67
69
  public setRowData(data: { [key: string]: any }): void;
68
70
 
69
71
  public setData(field: string, value: any): void;
@@ -704,28 +704,38 @@ RowDefinition.prototype.updateRowData = function(data, indexToFieldMap) {
704
704
  */
705
705
  RowDefinition.prototype.copyRowData = function(srcRowDef) {
706
706
  if(srcRowDef && srcRowDef !== this) {
707
- let field;
708
- let uncopiable_fields = {
709
- "ROW_DEF": 1,
710
- "SUB_ID": 1
711
- };
712
- let staticValues = this._staticValues;
713
- for(field in staticValues) {
714
- uncopiable_fields[field] = 1;
715
- }
716
- staticValues = srcRowDef._staticValues;
717
- for(field in staticValues) {
718
- uncopiable_fields[field] = 1;
719
- }
720
-
721
- let srcRowData = srcRowDef.getRowData();
722
707
  let rowData = this.getRowData();
723
- for(field in srcRowData) {
724
- if(!uncopiable_fields[field]) {
725
- rowData[field] = srcRowData[field]; // There is no dataChanged event fired
726
- }
708
+ srcRowDef.cloneRowData(rowData, this._staticValues);
709
+ }
710
+ };
711
+ /** @public
712
+ * @param {Object=} obj
713
+ * @param {Object=} exceptionObj
714
+ * @return {!Object}
715
+ */
716
+ RowDefinition.prototype.cloneRowData = function(obj, exceptionObj) {
717
+ let rowObj = obj || {};
718
+ let field;
719
+ let uncopiable_fields = {
720
+ "ROW_DEF": 1,
721
+ "SUB_ID": 1
722
+ };
723
+ let staticValues = this._staticValues;
724
+ for(field in staticValues) {
725
+ uncopiable_fields[field] = 1;
726
+ }
727
+
728
+ for(field in exceptionObj) {
729
+ uncopiable_fields[field] = 1;
730
+ }
731
+
732
+ let rowData = this.getRowData();
733
+ for(field in rowData) {
734
+ if(!uncopiable_fields[field]) {
735
+ rowObj[field] = rowData[field];
727
736
  }
728
737
  }
738
+ return rowObj;
729
739
  };
730
740
  /** @public
731
741
  * @param {Object.<string, *>} data
@@ -297,7 +297,8 @@ ColumnStackPlugin._styles = prettifyCss([
297
297
  "cursor: pointer;" // change the mouse cursor on the collapsed stack icon to allow for expansion but disallow sorting
298
298
  ],
299
299
  ".tr-grid .collapsed .cell.grouping .floating-panel .stack-icon", [
300
- "margin-left: 0;"
300
+ "margin-left: 0;",
301
+ "margin-right: 0;"
301
302
  ],
302
303
  ".stack-icon", [
303
304
  "color: var(--grid-title-filter-icon-color);"
@@ -106,9 +106,9 @@ declare class InCellEditingPlugin extends GridPlugin {
106
106
 
107
107
  public isColumnEditable(colIndex: number): boolean;
108
108
 
109
- public enableReadonly(bool: boolean): void;
109
+ public enableReadonly(enabled?: boolean|null): void;
110
110
 
111
- public disableReadonly(bool: boolean): void;
111
+ public disableReadonly(disabled?: boolean|null): void;
112
112
 
113
113
  public openRowEditor(rowIndex: number, grid?: any): void;
114
114
 
@@ -1387,17 +1387,22 @@ InCellEditingPlugin.prototype.isColumnEditable = function (colIndex) {
1387
1387
 
1388
1388
  /**
1389
1389
  * @public
1390
- * @param {boolean} bool
1390
+ * @param {boolean=} enabled
1391
1391
  */
1392
- InCellEditingPlugin.prototype.enableReadonly = function (bool) {
1393
- this._readonly = bool !== false;
1392
+ InCellEditingPlugin.prototype.enableReadonly = function (enabled) {
1393
+ this._readonly = enabled !== false;
1394
+ if(this._readonly) {
1395
+ this._updateStaterText(false);
1396
+ } else {
1397
+ this._updateStaterText();
1398
+ }
1394
1399
  };
1395
1400
  /**
1396
1401
  * @public
1397
- * @param {boolean} bool
1402
+ * @param {boolean=} disabled
1398
1403
  */
1399
- InCellEditingPlugin.prototype.disableReadonly = function () {
1400
- this.enableReadonly(false);
1404
+ InCellEditingPlugin.prototype.disableReadonly = function (disabled) {
1405
+ this.enableReadonly(disabled === false);
1401
1406
  };
1402
1407
  /** @public
1403
1408
  * @description Supply an keyboard input. This is for testing purpose.
@@ -151,6 +151,10 @@ MockSubscriptions.prototype._maxInterval = 850;
151
151
  * @type {number}
152
152
  */
153
153
  MockSubscriptions.prototype._percentageDataUpdate = 0.1; // 10% by default
154
+ /** @private
155
+ * @type {boolean}
156
+ */
157
+ MockSubscriptions.prototype._constituentCache = false;
154
158
 
155
159
  /** @public
156
160
  * @param {Object=} options
@@ -179,6 +183,12 @@ MockSubscriptions.prototype.config = function(options) {
179
183
  if(typeof num === "number") {
180
184
  this._percentageDataUpdate = num / 100;
181
185
  }
186
+
187
+ let value = options.constituentCache;
188
+ if(value != null) {
189
+ this._constituentCache = value;
190
+ }
191
+
182
192
  };
183
193
  /** @public
184
194
  * @param {number=} min
@@ -706,6 +716,9 @@ MockSubscriptions.prototype._updateDuplicateSymbol = function(ric) {
706
716
  if(!isChain) {
707
717
  return;
708
718
  }
719
+ if(!this._constituentCache) {
720
+ return;
721
+ }
709
722
  let ricList = firstSub["ricList"];
710
723
  if(!ricList) {
711
724
  return;
@@ -1,5 +1,6 @@
1
1
  import { Ext } from "../../tr-grid-util/es6/Ext.js";
2
2
  import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
3
+ import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
3
4
 
4
5
  declare namespace AutoTooltipPlugin {
5
6
 
@@ -106,9 +106,9 @@ declare class InCellEditingPlugin extends GridPlugin {
106
106
 
107
107
  public isColumnEditable(colIndex: number): boolean;
108
108
 
109
- public enableReadonly(bool: boolean): void;
109
+ public enableReadonly(enabled?: boolean|null): void;
110
110
 
111
- public disableReadonly(bool: boolean): void;
111
+ public disableReadonly(disabled?: boolean|null): void;
112
112
 
113
113
  public openRowEditor(rowIndex: number, grid?: any): void;
114
114
 
@@ -64,6 +64,8 @@ declare class RowDefinition {
64
64
 
65
65
  public copyRowData(srcRowDef: RowDefinition|null): void;
66
66
 
67
+ public cloneRowData(obj?: any, exceptionObj?: any): any;
68
+
67
69
  public setRowData(data: { [key: string]: any }): void;
68
70
 
69
71
  public setData(field: string, value: any): void;
package/lib/versions.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "tr-grid-util": "1.3.156",
2
+ "tr-grid-util": "1.3.157",
3
3
  "tr-grid-printer": "1.0.18",
4
4
  "@grid/column-dragging": "1.0.20",
5
5
  "@grid/row-segmenting": "1.0.33",
@@ -13,13 +13,13 @@
13
13
  "tr-grid-column-grouping": "1.0.62",
14
14
  "tr-grid-column-resizing": "1.0.29",
15
15
  "tr-grid-column-selection": "1.0.33",
16
- "tr-grid-column-stack": "1.0.75",
16
+ "tr-grid-column-stack": "1.0.76",
17
17
  "tr-grid-conditional-coloring": "1.0.70",
18
18
  "tr-grid-content-wrap": "1.0.20",
19
19
  "tr-grid-contextmenu": "1.0.44",
20
20
  "tr-grid-filter-input": "0.9.41",
21
21
  "tr-grid-heat-map": "1.0.29",
22
- "tr-grid-in-cell-editing": "1.0.89",
22
+ "tr-grid-in-cell-editing": "1.0.90",
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",
package/package.json CHANGED
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "version": "6.0.118"
72
+ "version": "6.0.119"
73
73
  }