@refinitiv-ui/efx-grid 6.0.69 → 6.0.70
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.
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +19 -7
- package/lib/core/dist/core.js +30 -2
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.d.ts +2 -0
- package/lib/core/es6/grid/Core.js +30 -2
- package/lib/filter-dialog/lib/filter-dialog.js +73 -32
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +52 -17
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.d.ts +5 -2
- package/lib/rt-grid/es6/Grid.js +22 -15
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +7 -27
- package/lib/tr-grid-printer/es6/CellWriter.d.ts +5 -5
- package/lib/tr-grid-printer/es6/CellWriter.js +6 -6
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +7 -6
- package/lib/tr-grid-printer/es6/GridPrinter.js +4 -2
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +1 -1
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +1 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +65 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -2
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +225 -114
- package/lib/tr-grid-row-selection/es6/RowSelection.js +14 -32
- package/lib/tr-grid-util/es6/GridPlugin.js +52 -0
- package/lib/types/es6/Core/grid/Core.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +5 -2
- package/lib/types/es6/RowFiltering.d.ts +2 -2
- package/lib/versions.json +10 -10
- package/package.json +1 -1
@@ -73,7 +73,6 @@ declare namespace Grid {
|
|
73
73
|
contentRightPadding?: number|null,
|
74
74
|
contentBottomPadding?: number|null,
|
75
75
|
dataConflationRate?: number|null,
|
76
|
-
dataComposed?: ((...params: any[]) => any)|null,
|
77
76
|
autoDateConversion?: boolean|null,
|
78
77
|
textSelect?: boolean|null,
|
79
78
|
lang?: string|null,
|
@@ -84,7 +83,11 @@ declare namespace Grid {
|
|
84
83
|
timeSeriesExpansion?: boolean|null,
|
85
84
|
childDataField?: string|null,
|
86
85
|
topSection?: boolean|null,
|
87
|
-
sorting?: SortableTitlePlugin.Options|null
|
86
|
+
sorting?: SortableTitlePlugin.Options|null,
|
87
|
+
dataComposed?: ((...params: any[]) => any)|null,
|
88
|
+
beforeContentBinding?: ((...params: any[]) => any)|null,
|
89
|
+
firstRendered?: ((...params: any[]) => any)|null,
|
90
|
+
afterContentBinding?: ((...params: any[]) => any)|null
|
88
91
|
};
|
89
92
|
|
90
93
|
type RowReference = number|string|RowDefinition|null;
|
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -76,7 +76,6 @@ import { ElementWrapper } from "../../core/es6/grid/components/ElementWrapper.js
|
|
76
76
|
* @property {number=} contentRightPadding=0 Padding that is added next to the right most column. The padding is still a part of scrollable content.
|
77
77
|
* @property {number=} contentBottomPadding=0 Padding that is added below the last section. The padding is still a part of scrollable content.
|
78
78
|
* @property {number=} dataConflationRate=0 set delay for data to avoid to much sorting operation when data changed
|
79
|
-
* @property {Function=} dataComposed Handler for dataComposed event
|
80
79
|
* @property {boolean=} autoDateConversion=false If enabled, date-time field with numeric value will be automatically converted to native date object.
|
81
80
|
* @property {boolean=} textSelect=false If enabled, user can select content text by using mouse drag.
|
82
81
|
* @property {string=} lang laguage for config localization date time, if null the default language is "en"
|
@@ -88,6 +87,10 @@ import { ElementWrapper } from "../../core/es6/grid/components/ElementWrapper.js
|
|
88
87
|
* @property {string=} childDataField=CHILD_VALUES The given field will be used to store children's static data, such as row color assignment.
|
89
88
|
* @property {boolean=} topSection=true If disabled, title section will not be rendered
|
90
89
|
* @property {SortableTitlePlugin~Options=} sorting Options for sorting
|
90
|
+
* @property {Function=} dataComposed Handler for dataComposed event
|
91
|
+
* @property {Function=} beforeContentBinding Handler for beforeContentBinding event
|
92
|
+
* @property {Function=} firstRendered Handler for firstRendered event
|
93
|
+
* @property {Function=} afterContentBinding Handler for afterContentBinding event
|
91
94
|
*/
|
92
95
|
|
93
96
|
/** @typedef {number|string|RowDefinition} Grid~RowReference
|
@@ -158,6 +161,16 @@ import { ElementWrapper } from "../../core/es6/grid/components/ElementWrapper.js
|
|
158
161
|
* @description Trigger before content binding.
|
159
162
|
*/
|
160
163
|
|
164
|
+
/** @event Grid#firstRendered
|
165
|
+
* @property {Object} e Event of firstRendered
|
166
|
+
* @description This event is triggered when the content is rendered for the first time.
|
167
|
+
*/
|
168
|
+
|
169
|
+
/** @event Grid#afterContentBinding
|
170
|
+
* @property {Object} e Event of afterContentBinding
|
171
|
+
* @description Trigger after content binding.
|
172
|
+
*/
|
173
|
+
|
161
174
|
/** @event Grid#beforeRowRemoved
|
162
175
|
* @description Fired only when a row will be removed through Grid's API and before occurring of the actual removal
|
163
176
|
*/
|
@@ -312,7 +325,6 @@ var Grid = function(placeholder, config) {
|
|
312
325
|
t.updateColumnTitle = t.updateColumnTitle.bind(t);
|
313
326
|
t._populateTimeSeriesChildren = t._populateTimeSeriesChildren.bind(t);
|
314
327
|
|
315
|
-
t._onBeforeContentBinding = t._onBeforeContentBinding.bind(t);
|
316
328
|
t._onPostSectionDataBinding = t._onPostSectionDataBinding.bind(t);
|
317
329
|
t._asyncClearDataUpdates = t._asyncClearDataUpdates.bind(t);
|
318
330
|
t._clearDataUpdates = t._clearDataUpdates.bind(t);
|
@@ -405,9 +417,11 @@ var Grid = function(placeholder, config) {
|
|
405
417
|
t._grid.loadPlugin(t._stp, config);
|
406
418
|
}
|
407
419
|
|
408
|
-
t._grid.listen("beforeContentBinding", t.
|
420
|
+
t._grid.listen("beforeContentBinding", t._dispatch.bind(t, "beforeContentBinding"));
|
409
421
|
t._grid.listen("preSectionRender", t._onColumnHeaderBinding);
|
410
422
|
t._grid.listen("postSectionDataBinding", t._onPostSectionDataBinding);
|
423
|
+
t._grid.listen("firstRendered", t._dispatch.bind(t, "firstRendered"));
|
424
|
+
t._grid.listen("afterContentBinding", t._dispatch.bind(t, "afterContentBinding"));
|
411
425
|
|
412
426
|
t._grid.enableRowHighlighting(true);
|
413
427
|
|
@@ -815,6 +829,7 @@ Grid.prototype.initialize = function(gridOption) {
|
|
815
829
|
var t = this; // For minimizing file size
|
816
830
|
t._initializing = true;
|
817
831
|
var grid = t._grid; // core grid
|
832
|
+
grid.resetInternalState();
|
818
833
|
gridOption = grid.normalizeConfig(gridOption);
|
819
834
|
|
820
835
|
var exts = gridOption["plugins"] || gridOption["extensions"];
|
@@ -921,10 +936,10 @@ Grid.prototype.initialize = function(gridOption) {
|
|
921
936
|
t.listen("rowExpansionBinding", rowExpansionBinding);
|
922
937
|
}
|
923
938
|
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
939
|
+
this.addListener(gridOption, "dataComposed");
|
940
|
+
this.addListener(gridOption, "beforeContentBinding");
|
941
|
+
this.addListener(gridOption, "firstRendered");
|
942
|
+
this.addListener(gridOption, "afterContentBinding");
|
928
943
|
|
929
944
|
if(gridOption["autoDateConversion"]) {
|
930
945
|
t._autoDateConversion = true;
|
@@ -2580,7 +2595,6 @@ Grid.prototype.removeAllRows = function() {
|
|
2580
2595
|
|
2581
2596
|
// TODO: This logic should also be in the core grid
|
2582
2597
|
this._grid.getVScrollbar().setScrollTop(0);
|
2583
|
-
this._grid.getHScrollbar().setScrollLeft(0);
|
2584
2598
|
};
|
2585
2599
|
/** WARNING: This does not remove data stored in the data cache
|
2586
2600
|
* @private
|
@@ -3538,13 +3552,6 @@ Grid.prototype._mainSorter = function (rowDefA, rowDefB, order) {
|
|
3538
3552
|
return this._columnSorter(rowDefA, rowDefB, order);
|
3539
3553
|
};
|
3540
3554
|
|
3541
|
-
/** @private
|
3542
|
-
* @param {Object} e
|
3543
|
-
*/
|
3544
|
-
Grid.prototype._onBeforeContentBinding = function(e) {
|
3545
|
-
this._dispatch("beforeContentBinding", e);
|
3546
|
-
};
|
3547
|
-
|
3548
3555
|
/** @private
|
3549
3556
|
* @param {Object} e
|
3550
3557
|
*/
|
@@ -1405,44 +1405,24 @@ ColumnSelectionPlugin.prototype.selectByMouse = function (colIndex, mouseEvt) {
|
|
1405
1405
|
mouseEvt = {};
|
1406
1406
|
}
|
1407
1407
|
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
mouseEvt.target = cell ? cell.getElement() : null;
|
1412
|
-
}
|
1408
|
+
mouseEvt.sectionType = "title";
|
1409
|
+
|
1410
|
+
var eventObj = this._mockMouseEvent(colIndex, 0, mouseEvt);
|
1413
1411
|
|
1414
|
-
this._onClick(
|
1412
|
+
this._onClick(eventObj);
|
1415
1413
|
};
|
1416
1414
|
/** @public
|
1417
1415
|
* @description Select a specified column by a keyboard input. This is for testing purpose.
|
1418
1416
|
* @ignore
|
1419
|
-
* @param {number|string} keyCode Use "left" ,
|
1417
|
+
* @param {number|string} keyCode Use key code number or "left" ,"right" or "tab" string
|
1420
1418
|
* @param {Object=} keyboardEvt
|
1421
1419
|
*/
|
1422
1420
|
|
1423
1421
|
|
1424
1422
|
ColumnSelectionPlugin.prototype.selectByKey = function (keyCode, keyboardEvt) {
|
1425
|
-
|
1426
|
-
keyboardEvt = {};
|
1427
|
-
}
|
1428
|
-
|
1429
|
-
if (keyCode) {
|
1430
|
-
if (keyCode === "left") {
|
1431
|
-
keyboardEvt.keyCode = 37;
|
1432
|
-
} else if (keyCode === "right") {
|
1433
|
-
keyboardEvt.keyCode = 39;
|
1434
|
-
} else if (keyCode === "tab") {
|
1435
|
-
keyboardEvt.keyCode = 9;
|
1436
|
-
} else if (typeof keyCode === "number") {
|
1437
|
-
keyboardEvt.keyCode = keyCode;
|
1438
|
-
}
|
1439
|
-
}
|
1440
|
-
|
1441
|
-
keyboardEvt.preventDefault = function () {};
|
1442
|
-
|
1443
|
-
keyboardEvt.stopPropagation = function () {};
|
1423
|
+
var eventObj = this._mockKeyboardEvent(keyCode, keyboardEvt);
|
1444
1424
|
|
1445
|
-
this._onKeyDown(
|
1425
|
+
this._onKeyDown(eventObj);
|
1446
1426
|
};
|
1447
1427
|
|
1448
1428
|
export default ColumnSelectionPlugin;
|
@@ -8,7 +8,7 @@ declare class CellWriter extends ElementWrapper {
|
|
8
8
|
|
9
9
|
public getContent(): Node|null|null;
|
10
10
|
|
11
|
-
public setContent(content: any, opt_tooltip?: boolean): Element|null;
|
11
|
+
public setContent(content: any, opt_tooltip?: boolean|null): Element|null;
|
12
12
|
|
13
13
|
public setTooltip(str: string): void;
|
14
14
|
|
@@ -20,7 +20,7 @@ declare class CellWriter extends ElementWrapper {
|
|
20
20
|
|
21
21
|
public removeIcon(n: any): void;
|
22
22
|
|
23
|
-
public updateIcon(elem: Element): void;
|
23
|
+
public updateIcon(elem: Element|null): void;
|
24
24
|
|
25
25
|
public unlisten(): void;
|
26
26
|
|
@@ -36,13 +36,13 @@ declare class CellWriter extends ElementWrapper {
|
|
36
36
|
|
37
37
|
public enableClass(str: string, bool: boolean): void;
|
38
38
|
|
39
|
-
public insertFloatingIcon(elem: Element, order: number): void;
|
39
|
+
public insertFloatingIcon(elem: Element|null, order: number): void;
|
40
40
|
|
41
|
-
public removeFloatingIcon(elemRef: string|Element, order: number): void;
|
41
|
+
public removeFloatingIcon(elemRef: string|Element|null, order: number): void;
|
42
42
|
|
43
43
|
public getSection(): null;
|
44
44
|
|
45
|
-
public cloak(elem: Element): void;
|
45
|
+
public cloak(elem: Element|null): void;
|
46
46
|
|
47
47
|
}
|
48
48
|
|
@@ -10,16 +10,16 @@ var CellWriter = function () {
|
|
10
10
|
};
|
11
11
|
Ext.inherits(CellWriter, ElementWrapper);
|
12
12
|
|
13
|
-
/** @
|
14
|
-
* @
|
13
|
+
/** @private
|
14
|
+
* @type {Element}
|
15
15
|
*/
|
16
16
|
CellWriter.prototype._flexRow = null;
|
17
|
-
/** @
|
18
|
-
* @
|
17
|
+
/** @private
|
18
|
+
* @type {Element}
|
19
19
|
*/
|
20
20
|
CellWriter.prototype._floatingPanel = null;
|
21
|
-
/** @
|
22
|
-
* @
|
21
|
+
/** @private
|
22
|
+
* @type {Element}
|
23
23
|
*/
|
24
24
|
CellWriter.prototype._frontPanel = null;
|
25
25
|
|
@@ -7,13 +7,13 @@ import { SectionWriter } from "./SectionWriter.js";
|
|
7
7
|
|
8
8
|
declare namespace GridPrinter {
|
9
9
|
|
10
|
-
function setPrintOptions(options: GridPrinter.Options): void;
|
10
|
+
function setPrintOptions(options: GridPrinter.Options|null): void;
|
11
11
|
|
12
|
-
function observe(iFrameElement?: HTMLIFrameElement): void;
|
12
|
+
function observe(iFrameElement?: HTMLIFrameElement|null): void;
|
13
13
|
|
14
14
|
function unobserve(): void;
|
15
15
|
|
16
|
-
function enableDebugMode(bool?: boolean): void;
|
16
|
+
function enableDebugMode(bool?: boolean|null): void;
|
17
17
|
|
18
18
|
function getPreFlightInfo(grid: any, options?: any): any;
|
19
19
|
|
@@ -22,11 +22,12 @@ declare namespace GridPrinter {
|
|
22
22
|
function print(grid: any): void;
|
23
23
|
|
24
24
|
type Options = {
|
25
|
-
pageWidth?: number,
|
26
|
-
pageHeight?: number,
|
27
|
-
primaryColumn?: number
|
25
|
+
pageWidth?: number|null,
|
26
|
+
pageHeight?: number|null,
|
27
|
+
primaryColumn?: number|null
|
28
28
|
};
|
29
29
|
|
30
30
|
}
|
31
31
|
|
32
|
+
export default GridPrinter;
|
32
33
|
export { GridPrinter };
|
@@ -134,7 +134,7 @@ var _getCoreGrid = function (grid) {
|
|
134
134
|
return core;
|
135
135
|
};
|
136
136
|
|
137
|
-
/** @
|
137
|
+
/** @namespace
|
138
138
|
*/
|
139
139
|
var GridPrinter = {};
|
140
140
|
/** @private
|
@@ -647,7 +647,7 @@ GridPrinter._applyCss = function () {
|
|
647
647
|
};
|
648
648
|
|
649
649
|
/** @public
|
650
|
-
* @param {*} grid grid element, currently supports atlas-blotter, ef-grid, tr.CompositeGrid, rt.Grid and Core
|
650
|
+
* @param {*} grid grid element, currently supports efx-grid, atlas-blotter, ef-grid, tr.CompositeGrid, rt.Grid and Core
|
651
651
|
*/
|
652
652
|
GridPrinter.print = function (grid) {
|
653
653
|
var core = null;
|
@@ -771,4 +771,6 @@ GridPrinter._onAfterPrint = function (e) {
|
|
771
771
|
GridPrinter.Options;
|
772
772
|
|
773
773
|
|
774
|
+
|
775
|
+
export default GridPrinter;
|
774
776
|
export { GridPrinter };
|
@@ -29,7 +29,7 @@ declare class SectionWriter extends ElementWrapper {
|
|
29
29
|
|
30
30
|
public enableRowClass(rowIndex: number, className: string, enabled: boolean): void;
|
31
31
|
|
32
|
-
public stretchCell(colIndex: number, rowIndex: number, opt_stretching?: boolean, opt_noLeftStretching?: boolean): void;
|
32
|
+
public stretchCell(colIndex: number, rowIndex: number, opt_stretching?: boolean|null, opt_noLeftStretching?: boolean|null): void;
|
33
33
|
|
34
34
|
public hasCellSpan(): boolean;
|
35
35
|
|
@@ -465,6 +465,7 @@ RowDraggingPlugin.prototype.getConfigObject = function (out_obj) {
|
|
465
465
|
if(!extOptions) {
|
466
466
|
extOptions = obj.rowDragging = {};
|
467
467
|
}
|
468
|
+
// TODO: should not assign the config object if it's a default value
|
468
469
|
extOptions.dragBox = this._dragBoxEnabled;
|
469
470
|
extOptions.mouseInput = this._mouseInput;
|
470
471
|
extOptions.autoScroll = this._autoScroll;
|
@@ -474,6 +475,70 @@ RowDraggingPlugin.prototype.getConfigObject = function (out_obj) {
|
|
474
475
|
return obj;
|
475
476
|
};
|
476
477
|
|
478
|
+
/** Drag start to simulate "dragStart" event for testing purpose
|
479
|
+
* @ignore
|
480
|
+
* @param {number} rowIndex
|
481
|
+
* @param {*=} mouseEvt
|
482
|
+
*/
|
483
|
+
RowDraggingPlugin.prototype.dragStart = function (rowIndex, mouseEvt) {
|
484
|
+
// dragstart event
|
485
|
+
if(!mouseEvt) {
|
486
|
+
mouseEvt = {};
|
487
|
+
}
|
488
|
+
mouseEvt["type"] = "dragstart";
|
489
|
+
var core = this._hosts[0];
|
490
|
+
var cell = core ? core.getCell("content", 0, rowIndex) : null;
|
491
|
+
mouseEvt.target = cell ? cell.getElement() : null;
|
492
|
+
this._onMouseDown(mouseEvt);
|
493
|
+
this.startDrag(mouseEvt);
|
494
|
+
};
|
495
|
+
|
496
|
+
/** Move mouse to drag cell for testing purpose
|
497
|
+
* @public
|
498
|
+
* @ignore
|
499
|
+
* @param {number} rowIndex
|
500
|
+
* @param {*=} mouseEvt
|
501
|
+
*/
|
502
|
+
RowDraggingPlugin.prototype.dragMove = function (rowIndex, mouseEvt) {
|
503
|
+
// mousemove, touchmove event
|
504
|
+
if(!mouseEvt) {
|
505
|
+
mouseEvt = {};
|
506
|
+
}
|
507
|
+
mouseEvt["type"] = "mousemove";
|
508
|
+
mouseEvt["which"] = 1; // Simulation of mouse down and move
|
509
|
+
var core = this._hosts[0];
|
510
|
+
var cell = core ? core.getCell("content", 0, rowIndex) : null;
|
511
|
+
var cellRelativePosition = core.getRelativePosition(cell); // get relative position of cell only when dragging for calculate dragBox
|
512
|
+
|
513
|
+
mouseEvt.clientX = cellRelativePosition.x;
|
514
|
+
mouseEvt.pageY = cellRelativePosition.y;
|
515
|
+
mouseEvt.target = cell ? cell.getElement() : null;
|
516
|
+
mouseEvt.stopPropagation = function() {};
|
517
|
+
mouseEvt.preventDefault = function() {};
|
518
|
+
this._onMouseMove(mouseEvt);
|
519
|
+
|
520
|
+
};
|
521
|
+
|
522
|
+
/** Mouse up to end of drag for testing purpose
|
523
|
+
* @public
|
524
|
+
* @ignore
|
525
|
+
* @param {number} rowIndex
|
526
|
+
* @param {*=} mouseEvt
|
527
|
+
*/
|
528
|
+
RowDraggingPlugin.prototype.dragEnd = function (rowIndex, mouseEvt) {
|
529
|
+
// mouseup, touchend, touchcancel event
|
530
|
+
if(!mouseEvt) {
|
531
|
+
mouseEvt = {};
|
532
|
+
}
|
533
|
+
mouseEvt["type"] = "mouseup";
|
534
|
+
var core = this._hosts[0];
|
535
|
+
var cell = core ? core.getCell("content", 0, rowIndex) : null;
|
536
|
+
mouseEvt.target = cell ? cell.getElement() : null;
|
537
|
+
mouseEvt.stopPropagation = function() {};
|
538
|
+
mouseEvt.preventDefault = function() {};
|
539
|
+
this._onDragEnd(mouseEvt);
|
540
|
+
};
|
541
|
+
|
477
542
|
/** @public
|
478
543
|
* @param {*=} startRef
|
479
544
|
*/
|
@@ -113,7 +113,7 @@ declare class RowFilteringPlugin extends GridPlugin {
|
|
113
113
|
|
114
114
|
public getColumnFilterStates(): any[];
|
115
115
|
|
116
|
-
public getUniqueValues(field: string, formatter?: ((...params: any[]) => any)|null, fmtField?: string|null, rawDataAccessor?: ((...params: any[]) => any)|null, formattedDataAccessor?: ((...params: any[]) => any)|null): any;
|
116
|
+
public getUniqueValues(field: string, formatter?: ((...params: any[]) => any)|null, fmtField?: string|null, rawDataAccessor?: ((...params: any[]) => any)|null, formattedDataAccessor?: ((...params: any[]) => any)|null, filterFuncs?: ((...params: any[]) => any)|null, selectedItems?: any): any;
|
117
117
|
|
118
118
|
public openDialog(colIndex: number, runtimeDialogOptions?: RowFilteringPlugin.FilterDialogOptions|null): void;
|
119
119
|
|
@@ -123,7 +123,7 @@ declare class RowFilteringPlugin extends GridPlugin {
|
|
123
123
|
|
124
124
|
}
|
125
125
|
|
126
|
-
declare function
|
126
|
+
declare function colSettings(colIndex: number, exp: RowFilteringPlugin.Expression|null, ctx?: (any|string)|null): boolean;
|
127
127
|
|
128
128
|
declare function crf(enabled?: boolean|null): void;
|
129
129
|
|