@refinitiv-ui/efx-grid 6.0.140 → 6.0.142

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/lib/core/dist/core.js +99 -28
  2. package/lib/core/dist/core.min.js +1 -1
  3. package/lib/core/es6/data/DataTable.d.ts +5 -1
  4. package/lib/core/es6/data/DataTable.js +38 -8
  5. package/lib/core/es6/data/DataView.d.ts +2 -0
  6. package/lib/core/es6/data/DataView.js +8 -0
  7. package/lib/core/es6/data/Segment.d.ts +1 -1
  8. package/lib/core/es6/data/Segment.js +16 -4
  9. package/lib/core/es6/data/SegmentCollection.d.ts +2 -0
  10. package/lib/core/es6/data/SegmentCollection.js +21 -10
  11. package/lib/core/es6/grid/Core.js +1 -1
  12. package/lib/core/es6/grid/components/Cell.js +9 -3
  13. package/lib/core/es6/grid/components/ElementWrapper.d.ts +2 -0
  14. package/lib/core/es6/grid/components/ElementWrapper.js +6 -2
  15. package/lib/grid/index.js +1 -1
  16. package/lib/row-segmenting/es6/RowSegmenting.d.ts +8 -1
  17. package/lib/row-segmenting/es6/RowSegmenting.js +88 -23
  18. package/lib/rt-grid/dist/rt-grid.js +607 -566
  19. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  20. package/lib/rt-grid/es6/Grid.js +37 -14
  21. package/lib/rt-grid/es6/RowDefinition.d.ts +1 -1
  22. package/lib/rt-grid/es6/RowDefinition.js +11 -3
  23. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +1 -1
  24. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +2 -3
  25. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -1
  26. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +18 -3
  27. package/lib/tr-grid-util/es6/CellPainter.d.ts +1 -7
  28. package/lib/tr-grid-util/es6/CellPainter.js +51 -74
  29. package/lib/tr-grid-util/es6/ElfUtil.d.ts +2 -0
  30. package/lib/tr-grid-util/es6/ElfUtil.js +11 -1
  31. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +2 -0
  32. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +38 -8
  33. package/lib/types/es6/ConditionalColoring.d.ts +1 -1
  34. package/lib/types/es6/Core/data/DataTable.d.ts +5 -1
  35. package/lib/types/es6/Core/data/DataView.d.ts +2 -0
  36. package/lib/types/es6/Core/data/Segment.d.ts +1 -1
  37. package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
  38. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +2 -0
  39. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +1 -1
  40. package/lib/versions.json +4 -4
  41. package/package.json +1 -1
@@ -152,6 +152,10 @@ MockSubscriptions.prototype._maxInterval = 850;
152
152
  */
153
153
  MockSubscriptions.prototype._percentageDataUpdate = 0.1; // 10% by default
154
154
  /** @private
155
+ * @type {number}
156
+ */
157
+ MockSubscriptions.prototype._percentageOrderChange = 1; // 100%
158
+ /** @private
155
159
  * @type {boolean}
156
160
  */
157
161
  MockSubscriptions.prototype._constituentCache = false;
@@ -184,6 +188,11 @@ MockSubscriptions.prototype.config = function(options) {
184
188
  this._percentageDataUpdate = num / 100;
185
189
  }
186
190
 
191
+ num = options.percentageOrderChange;
192
+ if(typeof num === "number") {
193
+ this._percentageOrderChange = num / 100;
194
+ }
195
+
187
196
  let value = options.constituentCache;
188
197
  if(value != null) {
189
198
  this._constituentCache = value;
@@ -212,6 +221,15 @@ MockSubscriptions.prototype.setPercentageDataUpdate = function(percent) {
212
221
  }
213
222
  };
214
223
 
224
+ /** @public
225
+ * @param {number=} percent
226
+ */
227
+ MockSubscriptions.prototype.setPercentageOrderChanged = function(percent) {
228
+ if(typeof percent === "number") {
229
+ this._percentageOrderChange = Math.round(percent / 100);
230
+ }
231
+ };
232
+
215
233
  /** @public
216
234
  * @param {number} seed
217
235
  */
@@ -499,7 +517,7 @@ MockSubscriptions.prototype._addSymbol = function(ric, asChain, subId) {
499
517
  childSub["CHILD_ORDER"] = i;
500
518
  this._dataMap.addItem(_joinSubKeys(sub, childSub), childSub);
501
519
  }
502
- } else {
520
+ } else { // Duplicate chain
503
521
  let firstSub = subs[0];
504
522
  let constituents = firstSub["children"];
505
523
  childCount = constituents.length;
@@ -547,7 +565,6 @@ MockSubscriptions.prototype._connect = function() {
547
565
  }
548
566
  };
549
567
 
550
- /** @private */
551
568
  MockSubscriptions.prototype._onSubscriptionResponse = function() {
552
569
  this._timerId = 0;
553
570
 
@@ -565,20 +582,22 @@ MockSubscriptions.prototype._onSubscriptionResponse = function() {
565
582
  let numRows = this._dataGen.randInt(minRow, maxRow);
566
583
  let fields = this._fields;
567
584
 
585
+ let updateCount = 0;
586
+ let childOrderChange;
568
587
  for(let i = 0; i < numRows; i++) {
588
+ // find key to random subs (key is subId)
569
589
  let key = keys[this._dataGen.randIndex(len)]; // WARNING: Same sub could be picked more than once
570
590
  let subs = this._dataMap.getItems(key); // Get all subs with the same RIC
571
591
 
572
592
  let sub = subs[0]; // Only the first sub is need to generate data
593
+ let values, j, jLen;
573
594
  let subParent = sub.parent;
574
- let updatePosition = this._dataGen.randBoolean(); // Flag for change CHILD_ORDER position
595
+ let updatePosition = this._dataGen.randInt(0, 100) < this._percentageOrderChange * 100 ? true : false; // Random chance to change dynamic chain position (2% to change)
575
596
 
576
- let values, j, jLen;
577
597
  if(_isDynamicChain(key) && subParent && updatePosition) { // subParent in header of dynamic chain is behavior like a normal ric
578
- // TODO: support rate of ordering is changed
579
598
  let children = subParent.children;
580
599
 
581
- children = _shuffleArray(children);
600
+ children = _shuffleArray(children); // Random swap children in array
582
601
  let childrenLen = children.length;
583
602
  let subIndex = children.indexOf(sub);
584
603
  sub["CHILD_ORDER"] = subIndex;
@@ -600,22 +619,33 @@ MockSubscriptions.prototype._onSubscriptionResponse = function() {
600
619
  });
601
620
  }
602
621
  }
603
- this._dispatchPostUpdate({ childOrderChange: true });
622
+ childOrderChange = true;
604
623
  }
605
624
 
606
625
  } else {
607
626
  values = this._generateQuoteData(sub, fields);
608
- jLen = subs.length;
627
+ jLen = subs.length; // Duplicate ric or chain
609
628
  for(j = 0; j < jLen; ++j) { // It could be same ric and it need to dispatch with same ric number
610
629
  let childOrder = subs[j]["CHILD_ORDER"];
611
630
  if(childOrder != null) { // Children of chain will have a CHILD_ORDER
612
631
  values["CHILD_ORDER"] = childOrder;
613
632
  }
614
633
  this._dispatchDataChanged(subs[j], values);
634
+ updateCount++;
615
635
  }
616
636
  }
617
637
  }
618
638
 
639
+ let postObj = {};
640
+ if(childOrderChange != null) {
641
+ postObj["childOrderChange"] = childOrderChange;
642
+ }
643
+ if(updateCount != null) {
644
+ postObj["updateCount"] = updateCount;
645
+ }
646
+
647
+ this._dispatchPostUpdate(postObj);
648
+
619
649
  this._connect();
620
650
  };
621
651
 
@@ -1,6 +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 {extendObject, injectCss, prettifyCss, isEmptyObject} from '../../tr-grid-util/es6/Util.js';
3
+ import {extendObject, injectCss, prettifyCss} from '../../tr-grid-util/es6/Util.js';
4
4
  import {CellPainter} from '../../tr-grid-util/es6/CellPainter.js';
5
5
  import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
6
6
  import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
@@ -88,6 +88,8 @@ declare class DataTable extends DataCache {
88
88
 
89
89
  public hasSegmentation(): boolean;
90
90
 
91
+ public hasSegmentClassification(): boolean;
92
+
91
93
  public isSegmentSeparator(rid: string): boolean;
92
94
 
93
95
  public getSegment(rid: string): Segment|null;
@@ -132,6 +134,8 @@ declare class DataTable extends DataCache {
132
134
 
133
135
  public requestClassifying(): void;
134
136
 
137
+ public setSegmentDefaultCollapsing(bool: boolean): boolean;
138
+
135
139
  public dispatchGlobalChange(suppressEvent?: boolean|null): void;
136
140
 
137
141
  public static getSortingDefinitions(): void;
@@ -144,7 +148,7 @@ declare function prevFrozen(ary: (any)[][], opt_cidList?: (string)[]|null, opt_r
144
148
 
145
149
  declare function cid(): null;
146
150
 
147
- declare function removalList(sortingDefs: (any[])[]|null): boolean;
151
+ declare function removalList(bool: boolean): boolean;
148
152
 
149
153
  declare function logic(a: number, b: number, order: number, sortingDefs: (any[])[]|null): number;
150
154
 
@@ -304,6 +304,8 @@ declare class DataView extends EventDispatcher {
304
304
 
305
305
  public setSegmentClassification(segmentRef: string|number|null, fields: string|(string)[]|null): boolean;
306
306
 
307
+ public setSegmentDefaultCollapsing(bool: boolean): boolean;
308
+
307
309
  public getWrapSize(): number;
308
310
 
309
311
  public getWrappedViews(): (WrappedView)[]|null;
@@ -65,7 +65,7 @@ declare class Segment extends EventDispatcher {
65
65
 
66
66
  public setOrder(val: number): void;
67
67
 
68
- public log(lines: (string)[]|null): (string)[]|null;
68
+ public log(lines?: (string)[]|null): (string)[];
69
69
 
70
70
  }
71
71
 
@@ -70,6 +70,8 @@ declare class SegmentCollection extends EventDispatcher {
70
70
 
71
71
  public classify(rows: { [key: string]: any }|null): boolean;
72
72
 
73
+ public setDefaultCollapsing(bool: boolean): boolean;
74
+
73
75
  }
74
76
 
75
77
  export default SegmentCollection;
@@ -51,6 +51,8 @@ declare class ElementWrapper extends EventDispatcher {
51
51
 
52
52
  public getAttribute(str: string): string;
53
53
 
54
+ public hasAttribute(str: string): boolean;
55
+
54
56
  public setAttribute(str: string, val: string): void;
55
57
 
56
58
  public setAttributes(json: any): void;
@@ -48,7 +48,7 @@ declare class RowDefinition {
48
48
 
49
49
  public getType(): string;
50
50
 
51
- public setDataSource(dataSource: DataCache|null, subs?: any): void;
51
+ public setDataSource(dataSource: DataCache|null, subs?: any): boolean;
52
52
 
53
53
  public getDataSource(): DataCache|null;
54
54
 
package/lib/versions.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "tr-grid-util": "1.3.168",
2
+ "tr-grid-util": "1.3.171",
3
3
  "tr-grid-printer": "1.0.18",
4
4
  "@grid/column-dragging": "1.0.21",
5
- "@grid/row-segmenting": "2.0.0",
5
+ "@grid/row-segmenting": "2.0.1",
6
6
  "@grid/statistics-row": "1.0.17",
7
7
  "@grid/zoom": "1.0.13",
8
8
  "tr-grid-auto-tooltip": "1.1.9",
@@ -14,7 +14,7 @@
14
14
  "tr-grid-column-resizing": "1.0.29",
15
15
  "tr-grid-column-selection": "1.0.33",
16
16
  "tr-grid-column-stack": "1.0.76",
17
- "tr-grid-conditional-coloring": "1.0.73",
17
+ "tr-grid-conditional-coloring": "1.0.74",
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.43",
@@ -24,7 +24,7 @@
24
24
  "tr-grid-percent-bar": "1.0.24",
25
25
  "tr-grid-range-bar": "2.0.9",
26
26
  "tr-grid-row-dragging": "1.0.38",
27
- "tr-grid-row-filtering": "1.0.88",
27
+ "tr-grid-row-filtering": "1.0.89",
28
28
  "tr-grid-row-grouping": "1.0.88",
29
29
  "tr-grid-row-selection": "1.0.33",
30
30
  "tr-grid-rowcoloring": "1.0.26",
package/package.json CHANGED
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "version": "6.0.140"
72
+ "version": "6.0.142"
73
73
  }