@refinitiv-ui/efx-grid 6.0.26 → 6.0.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/lib/core/dist/core.js +287 -34
  2. package/lib/core/dist/core.min.js +1 -1
  3. package/lib/core/es6/data/DataTable.d.ts +1 -1
  4. package/lib/core/es6/data/DataTable.js +3 -2
  5. package/lib/core/es6/data/DataView.d.ts +1 -1
  6. package/lib/core/es6/data/DataView.js +3 -2
  7. package/lib/core/es6/data/Segment.d.ts +1 -1
  8. package/lib/core/es6/data/Segment.js +12 -3
  9. package/lib/core/es6/data/SegmentCollection.d.ts +1 -1
  10. package/lib/core/es6/data/SegmentCollection.js +3 -2
  11. package/lib/core/es6/grid/Core.d.ts +17 -3
  12. package/lib/core/es6/grid/Core.js +226 -20
  13. package/lib/core/es6/grid/components/Scrollbar.js +6 -0
  14. package/lib/grid/index.js +1 -1
  15. package/lib/row-segmenting/es6/RowSegmenting.js +21 -2
  16. package/lib/rt-grid/dist/rt-grid.js +418 -238
  17. package/lib/rt-grid/dist/rt-grid.min.js +1 -1
  18. package/lib/rt-grid/es6/ColumnDefinition.d.ts +2 -2
  19. package/lib/rt-grid/es6/ColumnDefinition.js +71 -70
  20. package/lib/rt-grid/es6/Grid.d.ts +9 -2
  21. package/lib/rt-grid/es6/Grid.js +55 -132
  22. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +12 -2
  23. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +138 -47
  24. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +14 -1
  25. package/lib/tr-grid-column-stack/es6/ColumnStack.js +317 -187
  26. package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +4 -0
  27. package/lib/tr-grid-range-bar/es6/RangeBar.js +8 -0
  28. package/lib/tr-grid-util/es6/GridPlugin.d.ts +6 -0
  29. package/lib/tr-grid-util/es6/GridPlugin.js +67 -0
  30. package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +5 -1
  31. package/lib/tr-grid-util/es6/GroupDefinitions.js +34 -5
  32. package/lib/types/es6/ColumnGrouping.d.ts +12 -2
  33. package/lib/types/es6/ColumnStack.d.ts +14 -1
  34. package/lib/types/es6/Core/data/DataTable.d.ts +1 -1
  35. package/lib/types/es6/Core/data/DataView.d.ts +1 -1
  36. package/lib/types/es6/Core/data/Segment.d.ts +1 -1
  37. package/lib/types/es6/Core/data/SegmentCollection.d.ts +1 -1
  38. package/lib/types/es6/Core/grid/Core.d.ts +17 -3
  39. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +2 -2
  40. package/lib/types/es6/RealtimeGrid/Grid.d.ts +9 -2
  41. package/lib/versions.json +5 -5
  42. package/package.json +1 -1
@@ -42,7 +42,11 @@ declare class RangeBarPlugin extends GridPlugin {
42
42
 
43
43
  public getTooltipText(colRef: number|string|null, rowRef: number|string|null): string;
44
44
 
45
+ public isRangeBarColumn(colIndex: number): boolean;
46
+
45
47
  }
46
48
 
49
+ declare function colCount(colIndex: number): boolean;
50
+
47
51
  export default RangeBarPlugin;
48
52
  export { RangeBarPlugin, RangeBarPlugin as RangeBar, RangeBarPlugin as RangeBarExtension };
@@ -486,6 +486,14 @@ RangeBarPlugin.prototype._onPostSectionBinding = function (e) {
486
486
  }
487
487
  };
488
488
 
489
+ /** @public
490
+ * @param {number} colIndex
491
+ * @return {boolean}
492
+ */
493
+ RangeBarPlugin.prototype.isRangeBarColumn = function (colIndex) {
494
+ return this._getColumnOption(colIndex, "rangeBar") ? true : false;
495
+ };
496
+
489
497
  /** @private
490
498
  * @param {Object} e
491
499
  */
@@ -34,6 +34,12 @@ declare class GridPlugin extends EventDispatcher {
34
34
 
35
35
  public getColumnId(colIndex: number|string|null): string;
36
36
 
37
+ public getColumnIds(): (string)[];
38
+
39
+ public getColumnField(colIndex: number): string;
40
+
41
+ public getColumnFields(): (string)[];
42
+
37
43
  public getColumnCount(): number;
38
44
 
39
45
  public static requestPlugin(ref: any, pluginRef: any, configObj?: any, compositeGrid?: any, realTimeGrid?: any): Promise<any>|null;
@@ -238,6 +238,7 @@ GridPlugin.prototype.getColumnName = function (colRef) {
238
238
  * @return {number}
239
239
  */
240
240
  GridPlugin.prototype.getColumnIndex = function (colRef) {
241
+ // TODO: Unify the below logics
241
242
  if(typeof colRef === "number") {
242
243
  return colRef;
243
244
  }
@@ -258,6 +259,7 @@ GridPlugin.prototype.getColumnIndex = function (colRef) {
258
259
  * @return {Array.<number>} column indices
259
260
  */
260
261
  GridPlugin.prototype.getColumnIndices = function (colRefs) {
262
+ // TODO: Unify the below logics
261
263
  if(this._compositeGrid) {
262
264
  var allFields = this._compositeGrid.getColumnFields();
263
265
  var columnCount = this._compositeGrid.getColumnCount();
@@ -286,6 +288,7 @@ GridPlugin.prototype.getColumnIndices = function (colRefs) {
286
288
  * @return {string}
287
289
  */
288
290
  GridPlugin.prototype.getColumnId = function (colIndex) {
291
+ // TODO: Unify the below logics
289
292
  if(typeof colIndex === "string") {
290
293
  return colIndex;
291
294
  }
@@ -300,6 +303,34 @@ GridPlugin.prototype.getColumnId = function (colIndex) {
300
303
  return "";
301
304
  };
302
305
  /** @public
306
+ * @return {!Array.<string>} Return all column ids from existing column
307
+ */
308
+ GridPlugin.prototype.getColumnIds = function () {
309
+ if(this._hosts && this._hosts.length) {
310
+ return this._hosts[0].getColumnIds();
311
+ }
312
+ return [];
313
+ };
314
+ /** @public
315
+ * @param {number} colIndex
316
+ * @return {string} Return empty string if the specified column does not exist
317
+ */
318
+ GridPlugin.prototype.getColumnField = function (colIndex) {
319
+ if(this._hosts && this._hosts.length) {
320
+ return this._hosts[0].getColumnField(colIndex);
321
+ }
322
+ return "";
323
+ };
324
+ /** @public
325
+ * @return {!Array.<string>} Return all column fields from existing column
326
+ */
327
+ GridPlugin.prototype.getColumnFields = function () {
328
+ if(this._hosts && this._hosts.length) {
329
+ return this._hosts[0].getColumnFields();
330
+ }
331
+ return [];
332
+ };
333
+ /** @public
303
334
  * @return {number}
304
335
  */
305
336
  GridPlugin.prototype.getColumnCount = function() {
@@ -309,6 +340,42 @@ GridPlugin.prototype.getColumnCount = function() {
309
340
  }
310
341
  return 0;
311
342
  };
343
+ /** @protected
344
+ * @ignore
345
+ * @param {number|string} srcCol Column Id or index
346
+ * @param {(number|string)=} destCol Column Id or index of the destination
347
+ * @return {boolean}
348
+ */
349
+ GridPlugin.prototype._moveColumnById = function (srcCol, destCol) {
350
+ var hosts = this._hosts;
351
+ var len = hosts ? hosts.length : 0;
352
+ if(len) {
353
+ var dirty = 0;
354
+ for(var i = 0; i < len; ++i) {
355
+ dirty |= hosts[i].moveColumnById(srcCol, destCol);
356
+ }
357
+ return dirty ? true : false;
358
+ }
359
+ return false;
360
+ };
361
+ /** @protected
362
+ * @ignore
363
+ * @param {number|string|Array.<number|string>} colRefs List of column index or column id to be moved
364
+ * @param {(number|string)=} destCol Destination position where the moved columns will be placed BEFORE the specified position. This can be column id or index
365
+ * @return {boolean} Return true if there is any change, and false otherwise
366
+ */
367
+ GridPlugin.prototype._reorderColumns = function (colRefs, destCol) {
368
+ var hosts = this._hosts;
369
+ var len = hosts ? hosts.length : 0;
370
+ if(len) {
371
+ var dirty = 0;
372
+ for(var i = 0; i < len; ++i) {
373
+ dirty |= hosts[i].reorderColumns(colRefs, destCol);
374
+ }
375
+ return dirty ? true : false;
376
+ }
377
+ return false;
378
+ };
312
379
 
313
380
  /** @protected
314
381
  * @deprecated
@@ -44,9 +44,13 @@ declare class GroupDefinitions {
44
44
 
45
45
  public setGroup(groupId: string, groupDef?: (string)[]|any|null): string;
46
46
 
47
+ public hasGroupChild(parentId: string, childId: string): boolean;
48
+
47
49
  public addGroupChild(parentId: string, childId: string): boolean;
48
50
 
49
- public removeGroupChild(childId: string): boolean;
51
+ public removeGroupChild(parentId: string, childId?: string|null): boolean;
52
+
53
+ public unsetParent(childId: string): boolean;
50
54
 
51
55
  public removeAllChildren(groupId: string): boolean;
52
56
 
@@ -356,7 +356,7 @@ GroupDefinitions.prototype.removeGroup = function (groupId) {
356
356
  var curDef = this._groupMap[groupId];
357
357
  if(curDef) {
358
358
  this.removeAllChildren(groupId);
359
- this.removeGroupChild(groupId);
359
+ this.unsetParent(groupId);
360
360
  delete this._groupMap[groupId];
361
361
 
362
362
  return true;
@@ -415,12 +415,26 @@ GroupDefinitions.prototype._ungroupChildren = function(children) {
415
415
  if (Array.isArray(children)) {
416
416
  var len = children.length;
417
417
  for(var i = 0; i < len; ++i) {
418
- this.removeGroupChild(children[i]);
418
+ this.unsetParent(children[i]);
419
419
  }
420
420
  }
421
421
  };
422
422
 
423
-
423
+ /** @public
424
+ * @param {string} parentId Group id
425
+ * @param {string} childId
426
+ * @return {boolean}
427
+ */
428
+ GroupDefinitions.prototype.hasGroupChild = function (parentId, childId) {
429
+ var groupDef = this._groupMap[parentId];
430
+ if(childId && groupDef) {
431
+ var chdr = groupDef.children;
432
+ if(chdr) {
433
+ return chdr.indexOf(childId) >= 0;
434
+ }
435
+ }
436
+ return false;
437
+ };
424
438
  /** @public
425
439
  * @param {string} parentId Group id
426
440
  * @param {string} childId
@@ -432,7 +446,7 @@ GroupDefinitions.prototype.addGroupChild = function (parentId, childId) {
432
446
  if(childId && groupDef) {
433
447
  var chdr = groupDef.children;
434
448
  if(chdr && chdr.indexOf(childId) < 0) {
435
- this.removeGroupChild(childId); // Remove previous parent
449
+ this.unsetParent(childId); // Remove previous parent
436
450
  // Add new child to group structures
437
451
  this._childToParent[childId] = parentId;
438
452
  var childDef = this._groupMap[childId];
@@ -445,12 +459,27 @@ GroupDefinitions.prototype.addGroupChild = function (parentId, childId) {
445
459
  }
446
460
  return false;
447
461
  };
462
+ /** Remove the given child from the specified parent. If childId is not given, unsetParent will be used on parentId instead of childId.
463
+ * @public
464
+ * @param {string} parentId Group id
465
+ * @param {string=} childId
466
+ * @return {boolean}
467
+ */
468
+ GroupDefinitions.prototype.removeGroupChild = function (parentId, childId) {
469
+ if(childId == null) {
470
+ return this.unsetParent(parentId);
471
+ }
472
+ if(this.hasGroupChild(parentId, childId)) {
473
+ return this.unsetParent(childId);
474
+ }
475
+ return false;
476
+ };
448
477
  /** Remove the given child from its own parent (i.e., unset Parent of the given child).
449
478
  * @public
450
479
  * @param {string} childId
451
480
  * @return {boolean}
452
481
  */
453
- GroupDefinitions.prototype.removeGroupChild = function (childId) {
482
+ GroupDefinitions.prototype.unsetParent = function (childId) {
454
483
  var parentId = this._childToParent[childId];
455
484
  if(!parentId) {
456
485
  return false;
@@ -69,11 +69,21 @@ declare class ColumnGroupingPlugin extends GridPlugin {
69
69
 
70
70
  public moveColumnIntoGroup(colRef: number|string|null, to: number, groupId: string): void;
71
71
 
72
- public setColumnParent(colRef: number|string|null, groupId: string): void;
72
+ public setColumnParent(colRef: number|string|null, groupId: string): boolean;
73
+
74
+ public addGroupChild(parentId: string, childRef: number|string|null): boolean;
75
+
76
+ public removeGroupChild(parentId: string, childRef: number|string|null): boolean;
77
+
78
+ public unsetParent(childRef: number|string|null): boolean;
73
79
 
74
80
  public getValidDestinationIndex(id: string, destCol: number|string|null): number;
75
81
 
76
- public moveGroup(id: string, destCol: number|string|null): void;
82
+ public moveGroup(id: string, destCol?: (number|string)|null): void;
83
+
84
+ public reorderColumns(colList: (number|string)[]|null, destCol?: (number|string)|null): boolean;
85
+
86
+ public moveColumnById(srcCol: number|string|null, destCol?: (number|string)|null): boolean;
77
87
 
78
88
  }
79
89
 
@@ -12,7 +12,8 @@ declare namespace ColumnStackPlugin {
12
12
  type Options = {
13
13
  fields: (string)[]|null,
14
14
  stacks: (ColumnStackPlugin.StackDefinition)[]|null,
15
- autoStacking?: boolean|null
15
+ autoStacking?: boolean|null,
16
+ clicked?: ((...params: any[]) => any)|null
16
17
  };
17
18
 
18
19
  type ColumnOptions = {
@@ -90,6 +91,8 @@ declare class ColumnStackPlugin extends GridPlugin {
90
91
 
91
92
  public unstackColumns(colIndices?: (number)[]|null): boolean;
92
93
 
94
+ public removeStack(stackId: string): boolean;
95
+
93
96
  public removeAllStacks(enableUpdateUI?: boolean|null): boolean;
94
97
 
95
98
  public swapColumn(colRef: number|Event|null, swappingIndex: number): boolean;
@@ -116,6 +119,16 @@ declare class ColumnStackPlugin extends GridPlugin {
116
119
 
117
120
  public getActiveColumnField(stackId: string): string;
118
121
 
122
+ public addStackChild(stackId: string, colRef: number|string|null): void;
123
+
124
+ public removeStackChild(stackId: string, colRef: number|string|null): void;
125
+
126
+ public unsetParent(colRef: number|string|null): void;
127
+
128
+ public reorderColumns(colList: (number|string)[]|null, destCol?: (number|string)|null): boolean;
129
+
130
+ public moveColumnById(srcCol: number|string|null, destCol?: (number|string)|null): boolean;
131
+
119
132
  }
120
133
 
121
134
  export default ColumnStackPlugin;
@@ -98,7 +98,7 @@ declare class DataTable extends DataCache {
98
98
 
99
99
  public addSegmentChild(segmentId: string, rid: string, dataId?: string|null): boolean;
100
100
 
101
- public addSegmentChildren(segmentId: string, rids: (string)[]|null): boolean;
101
+ public addSegmentChildren(segmentId: string, rids: (string)[]|null, dataIds?: (string)[]|null): boolean;
102
102
 
103
103
  public removeSegmentChild(segmentId: string, rid: string): boolean;
104
104
 
@@ -258,7 +258,7 @@ declare class DataView extends EventDispatcher {
258
258
 
259
259
  public addSegmentChild(segmentRef: string|number|null, rowRef: string|number|null, dataId?: string|null): boolean;
260
260
 
261
- public addSegmentChildren(segmentRef: string|number|null, rowRefs: (string|number)[]|null): boolean;
261
+ public addSegmentChildren(segmentRef: string|number|null, rowRefs: (string|number)[]|null, dataIds?: (string)[]|null): boolean;
262
262
 
263
263
  public removeSegmentChild(segmentRef: string|number|null, rowRef: string|number|null): boolean;
264
264
 
@@ -15,7 +15,7 @@ declare class Segment extends EventDispatcher {
15
15
 
16
16
  public addChild(rid: string, dataId?: string|null): boolean;
17
17
 
18
- public addChildren(rids: (string)[]|null): boolean;
18
+ public addChildren(rids: (string)[]|null, dataIds?: (string)[]|null): boolean;
19
19
 
20
20
  public containsChild(rid: string): boolean;
21
21
 
@@ -40,7 +40,7 @@ declare class SegmentCollection extends EventDispatcher {
40
40
 
41
41
  public addSegmentChild(segmentId: string, rid: string, dataId?: string|null): boolean;
42
42
 
43
- public addSegmentChildren(segmentId: string, rids: (string)[]|null): boolean;
43
+ public addSegmentChildren(segmentId: string, rids: (string)[]|null, dataIds?: (string)[]|null): boolean;
44
44
 
45
45
  public containsSegmentChild(segmentId: string, rid: string): boolean;
46
46
 
@@ -133,6 +133,10 @@ declare class Core extends ElementWrapper {
133
133
 
134
134
  public moveColumn(fromCol: number|(number)[]|null, destCol: number): boolean;
135
135
 
136
+ public moveColumnById(srcCol: number|string|null, destCol?: (number|string)|null): boolean;
137
+
138
+ public reorderColumns(colRefs: number|string|(number|string)[]|null, destCol?: (number|string)|null): boolean;
139
+
136
140
  public addRow(opt_num?: number|null): void;
137
141
 
138
142
  public removeRow(opt_num?: number|null): void;
@@ -297,8 +301,6 @@ declare class Core extends ElementWrapper {
297
301
 
298
302
  public getRelativePosition(obj: ElementWrapper|Element|Event|MouseEvent, context?: any): Core.MouseInfo;
299
303
 
300
- public getColumnIndex(str: string): number;
301
-
302
304
  public getVScrollbar(): ElementWrapper;
303
305
 
304
306
  public getHScrollbar(): ElementWrapper;
@@ -393,6 +395,18 @@ declare class Core extends ElementWrapper {
393
395
 
394
396
  public getColumnIds(): (string)[];
395
397
 
398
+ public setColumnField(colIndex: number, field: string): void;
399
+
400
+ public getColumnField(colIndex: number): string;
401
+
402
+ public getColumnFields(): (string)[];
403
+
404
+ public getColumnIndex(colRef: string|number|null): number;
405
+
406
+ public getColumnIndices(colRefs: (number|string)[]|null): (number)[];
407
+
408
+ public getColumnIndexMap(): { [key: string]: number };
409
+
396
410
  }
397
411
 
398
412
  declare function num(opt_type?: string|null): (ILayoutGrid)[];
@@ -409,7 +423,7 @@ declare function section(): number;
409
423
 
410
424
  declare function path(obj: ElementWrapper|Element|Event|MouseEvent, context?: any): Core.MouseInfo;
411
425
 
412
- declare function cellElement(str: string): number;
426
+ declare function cellElement(): ElementWrapper;
413
427
 
414
428
  export default Core;
415
429
  export { Core };
@@ -51,13 +51,13 @@ declare namespace ColumnDefinition {
51
51
 
52
52
  declare class ColumnDefinition {
53
53
 
54
- constructor(columnOption?: ColumnDefinition.Options|string|null, hostGrid?: any);
54
+ constructor(columnOption?: ColumnDefinition.Options|null, hostGrid?: any);
55
55
 
56
56
  public dispose(): void;
57
57
 
58
58
  public _initializeTimeSeriesChild(columnOption?: ColumnDefinition.Options|string|null): void;
59
59
 
60
- public initialize(columnOption?: ColumnDefinition.Options|string|null): void;
60
+ public initialize(columnOption?: ColumnDefinition.Options|null): void;
61
61
 
62
62
  public getId(): string;
63
63
 
@@ -83,7 +83,8 @@ declare namespace Grid {
83
83
  formulaEngine?: boolean|null,
84
84
  adcPollingInterval?: number|null,
85
85
  fieldCaching?: boolean|null,
86
- childDataField?: string|null
86
+ childDataField?: string|null,
87
+ topSection?: boolean|null
87
88
  };
88
89
 
89
90
  type RowReference = number|string|RowDefinition|null;
@@ -146,7 +147,7 @@ declare class Grid extends EventDispatcher {
146
147
 
147
148
  public moveColumnById(srcCol: number|string|null, destCol?: (number|string)|null): boolean;
148
149
 
149
- public reorderColumns(colRefs: number|string|(number|string)[]|null, destCol: number|string|null): boolean;
150
+ public reorderColumns(colRefs: number|string|(number|string)[]|null, destCol?: (number|string)|null): boolean;
150
151
 
151
152
  public hideColumn(colRef: Grid.ColumnReference|null, hidden?: boolean|null): void;
152
153
 
@@ -296,6 +297,10 @@ declare class Grid extends EventDispatcher {
296
297
 
297
298
  public setClassification(rowRef: Grid.RowReference|null, fields: (string)[]|null): boolean;
298
299
 
300
+ public contains(elem: Element|null): boolean;
301
+
302
+ public isFocused(): boolean;
303
+
299
304
  public focus(): void;
300
305
 
301
306
  public requestRowRefresh(): void;
@@ -316,6 +321,8 @@ declare class Grid extends EventDispatcher {
316
321
 
317
322
  declare function borders(gridOptions?: any): any;
318
323
 
324
+ declare function idx(colRef: Grid.ColumnReference|null): void;
325
+
319
326
  declare function colCount(rowRef: number|string|null): string;
320
327
 
321
328
  export { Grid };
package/lib/versions.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "tr-grid-util": "1.3.84",
2
+ "tr-grid-util": "1.3.87",
3
3
  "@grid/column-dragging": "1.0.11",
4
- "@grid/row-segmenting": "1.0.22",
4
+ "@grid/row-segmenting": "1.0.23",
5
5
  "@grid/statistics-row": "1.0.13",
6
6
  "@grid/zoom": "1.0.11",
7
7
  "tr-grid-auto-tooltip": "1.1.5",
@@ -9,10 +9,10 @@
9
9
  "tr-grid-checkbox": "1.0.60",
10
10
  "tr-grid-column-fitter": "1.0.39",
11
11
  "tr-grid-column-formatting": "0.9.34",
12
- "tr-grid-column-grouping": "1.0.44",
12
+ "tr-grid-column-grouping": "1.0.46",
13
13
  "tr-grid-column-resizing": "1.0.28",
14
14
  "tr-grid-column-selection": "1.0.26",
15
- "tr-grid-column-stack": "1.0.50",
15
+ "tr-grid-column-stack": "1.0.52",
16
16
  "tr-grid-conditional-coloring": "1.0.57",
17
17
  "tr-grid-content-wrap": "1.0.19",
18
18
  "tr-grid-contextmenu": "1.0.38",
@@ -22,7 +22,7 @@
22
22
  "tr-grid-pagination": "1.0.24",
23
23
  "tr-grid-percent-bar": "1.0.22",
24
24
  "tr-grid-printer": "1.0.16",
25
- "tr-grid-range-bar": "2.0.2",
25
+ "tr-grid-range-bar": "2.0.3",
26
26
  "tr-grid-row-dragging": "1.0.24",
27
27
  "tr-grid-row-filtering": "1.0.55",
28
28
  "tr-grid-row-grouping": "1.0.80",
package/package.json CHANGED
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "version": "6.0.26"
65
+ "version": "6.0.28"
66
66
  }