@refinitiv-ui/efx-grid 6.0.81 → 6.0.83
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/core/dist/core.js +5 -1
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +1 -1
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +4 -0
- package/lib/grid/index.js +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +0 -2
- package/lib/tr-grid-checkbox/es6/Checkbox.js +3 -1
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.d.ts +15 -15
- package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +6 -4
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +11 -5
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +18 -0
- package/lib/tr-grid-row-selection/es6/RowSelection.js +7 -35
- package/lib/tr-grid-util/es6/GridPlugin.js +30 -13
- package/lib/versions.json +8 -8
- package/package.json +1 -1
@@ -1179,6 +1179,10 @@ SortableTitlePlugin.prototype._proceedSorting = function (hitObj) {
|
|
1179
1179
|
if (state) {
|
1180
1180
|
this._sortColumn([state], { "isUserAction": true });
|
1181
1181
|
}
|
1182
|
+
var grid = hitObj["grid"];
|
1183
|
+
if(grid && grid["focus"]) {
|
1184
|
+
grid["focus"]();
|
1185
|
+
}
|
1182
1186
|
|
1183
1187
|
if (this._hasListener("clicked")) {
|
1184
1188
|
var ce = {};
|
package/lib/grid/index.js
CHANGED
@@ -406,7 +406,6 @@ CellSelectionPlugin.prototype._onMouseDown = function (e) {
|
|
406
406
|
}
|
407
407
|
this._dirty = true;
|
408
408
|
this.selectSingleCell(newAnchor);
|
409
|
-
activeGrid.setAttribute("draggable", "true");
|
410
409
|
this._draggable = true;
|
411
410
|
};
|
412
411
|
|
@@ -664,7 +663,6 @@ CellSelectionPlugin.prototype._onMouseUp = function (e) {
|
|
664
663
|
if (this._disabled || !this._dirty) {
|
665
664
|
return;
|
666
665
|
}
|
667
|
-
this._hosts[0].removeAttribute("draggable");
|
668
666
|
this._draggable = false;
|
669
667
|
|
670
668
|
// WORKAROUND: FOR IE11
|
@@ -1649,7 +1649,9 @@ CheckboxPlugin.prototype._onPostSectionDataBinding = function (e) {
|
|
1649
1649
|
}
|
1650
1650
|
}
|
1651
1651
|
|
1652
|
-
|
1652
|
+
if(e.actualUpdate) {
|
1653
|
+
this._syncAscendantState(e["sectionSettings"], null, dv);
|
1654
|
+
}
|
1653
1655
|
};
|
1654
1656
|
|
1655
1657
|
|
@@ -4,27 +4,27 @@ import { GridPlugin } from '../../tr-grid-util/es6/GridPlugin.js';
|
|
4
4
|
declare namespace ColumnFitterPlugin {
|
5
5
|
|
6
6
|
type Options = {
|
7
|
-
proportion?: boolean,
|
8
|
-
constraint?: boolean,
|
9
|
-
autoAdjust?: (boolean|number),
|
10
|
-
autoAdjusting?: (boolean|number),
|
11
|
-
title?: boolean,
|
12
|
-
paddingSize?: number,
|
13
|
-
shrinkable?: boolean
|
7
|
+
proportion?: boolean|null,
|
8
|
+
constraint?: boolean|null,
|
9
|
+
autoAdjust?: (boolean|number)|null,
|
10
|
+
autoAdjusting?: (boolean|number)|null,
|
11
|
+
title?: boolean|null,
|
12
|
+
paddingSize?: number|null,
|
13
|
+
shrinkable?: boolean|null
|
14
14
|
};
|
15
15
|
|
16
16
|
type ColumnOptions = {
|
17
|
-
noFitting?: boolean,
|
18
|
-
contentFitting?: boolean,
|
19
|
-
minWidth?: number,
|
20
|
-
maxWidth?: number
|
17
|
+
noFitting?: boolean|null,
|
18
|
+
contentFitting?: boolean|null,
|
19
|
+
minWidth?: number|null,
|
20
|
+
maxWidth?: number|null
|
21
21
|
};
|
22
22
|
|
23
23
|
}
|
24
24
|
|
25
25
|
declare class ColumnFitterPlugin extends GridPlugin {
|
26
26
|
|
27
|
-
constructor(options?: ColumnFitterPlugin.Options);
|
27
|
+
constructor(options?: ColumnFitterPlugin.Options|null);
|
28
28
|
|
29
29
|
public getName(): string;
|
30
30
|
|
@@ -32,15 +32,15 @@ declare class ColumnFitterPlugin extends GridPlugin {
|
|
32
32
|
|
33
33
|
public unload(host: any): void;
|
34
34
|
|
35
|
-
public config(options?: ColumnFitterPlugin.Options): void;
|
35
|
+
public config(options?: ColumnFitterPlugin.Options|null): void;
|
36
36
|
|
37
37
|
public getConfigObject(gridOptions?: any): any;
|
38
38
|
|
39
39
|
public getColumnMenu(colIndex: number, config: any): any;
|
40
40
|
|
41
|
-
public adjustColumnWidth(colIndex?: (number)[]): boolean;
|
41
|
+
public adjustColumnWidth(colIndex?: (number)[]|null): boolean;
|
42
42
|
|
43
|
-
public adjustColumns(colIndices?: (number)[], force?: boolean): boolean;
|
43
|
+
public adjustColumns(colIndices?: (number)[]|null, force?: boolean|null): boolean;
|
44
44
|
|
45
45
|
public adjustAllColumns(): boolean;
|
46
46
|
|
@@ -757,9 +757,10 @@ ColumnFitterPlugin.prototype._getColumnFitContentWidth = function (colIndex) {
|
|
757
757
|
|
758
758
|
for (var s = 0; s < sectionCount; s++) {
|
759
759
|
var section = sections[s];
|
760
|
-
var
|
760
|
+
var fi = section.getFirstIndexInView();
|
761
|
+
var li = section.getLastIndexInView() + 1;
|
761
762
|
|
762
|
-
for (var r =
|
763
|
+
for (var r = fi; r < li; r++) {
|
763
764
|
var cell = section.getCell(colIndex, r, false);
|
764
765
|
|
765
766
|
if (!cell) {
|
@@ -827,9 +828,10 @@ ColumnFitterPlugin.prototype._getColumnFitContentText = function (colIndex) {
|
|
827
828
|
|
828
829
|
for (var s = 0; s < sectionCount; s++) {
|
829
830
|
var section = sections[s];
|
830
|
-
var
|
831
|
+
var fi = section.getFirstIndexInView();
|
832
|
+
var li = section.getLastIndexInView() + 1;
|
831
833
|
|
832
|
-
for (var r =
|
834
|
+
for (var r = fi; r < li; r++) {
|
833
835
|
var cell = section.getCell(colIndex, r, false); // Ignore cell span
|
834
836
|
|
835
837
|
if (!cell) {
|
@@ -829,6 +829,9 @@ ColumnSelectionPlugin.prototype._onClick = function (e) {
|
|
829
829
|
return;
|
830
830
|
}
|
831
831
|
|
832
|
+
var cIndex = info["colIndex"];
|
833
|
+
var prevSel = this.isSelectedColumn(cIndex);
|
834
|
+
|
832
835
|
if (e.button === 2) {
|
833
836
|
// Right button
|
834
837
|
if (e.type === "click") {
|
@@ -837,12 +840,11 @@ ColumnSelectionPlugin.prototype._onClick = function (e) {
|
|
837
840
|
} // To allow right clicking at the content for context menu and multi column selection
|
838
841
|
|
839
842
|
|
840
|
-
if (
|
843
|
+
if (prevSel) {
|
841
844
|
return;
|
842
845
|
}
|
843
846
|
}
|
844
847
|
|
845
|
-
var cIndex = info["colIndex"];
|
846
848
|
var isNewGridClicked = !this._activeGrid || this._activeGrid !== host;
|
847
849
|
var groupId = info["groupId"];
|
848
850
|
var childIndices, childCount;
|
@@ -859,9 +861,9 @@ ColumnSelectionPlugin.prototype._onClick = function (e) {
|
|
859
861
|
}
|
860
862
|
|
861
863
|
if (e.ctrlKey || e.metaKey) {
|
862
|
-
if (!groupId && (!this._singleSelMode ||
|
863
|
-
this.setSelectedColumn(cIndex, !
|
864
|
-
this._anchorCol =
|
864
|
+
if (!groupId && (!this._singleSelMode || prevSel)) {
|
865
|
+
this.setSelectedColumn(cIndex, !prevSel);
|
866
|
+
this._anchorCol = prevSel ? cIndex : this.getFirstSelectedColumn();
|
865
867
|
} else {
|
866
868
|
var newState = !this._isSelectedColumns(childIndices);
|
867
869
|
|
@@ -915,6 +917,10 @@ ColumnSelectionPlugin.prototype._onClick = function (e) {
|
|
915
917
|
if (this._anchorCol < 0) {
|
916
918
|
this._hasSelection = false;
|
917
919
|
this._activeGrid = this._hosts[0] || null; // Maintain selectability even if there is no selection
|
920
|
+
} else {
|
921
|
+
if (this._activeGrid && !prevSel) {
|
922
|
+
this._activeGrid.focus();
|
923
|
+
}
|
918
924
|
}
|
919
925
|
|
920
926
|
this._dispatchSelectionChanged(e, cIndex);
|
@@ -1118,6 +1118,9 @@ ConditionalColoringPlugin._fb = null;
|
|
1118
1118
|
|
1119
1119
|
/** @private */
|
1120
1120
|
ConditionalColoringPlugin.prototype._requestRowRefresh = function () {
|
1121
|
+
if(!this._hasColoring()){
|
1122
|
+
return;
|
1123
|
+
}
|
1121
1124
|
for(var i = this._hosts.length; --i >= 0;) {
|
1122
1125
|
this._hosts[i].requestRowRefresh();
|
1123
1126
|
}
|
@@ -1454,6 +1457,21 @@ ConditionalColoringPlugin._stopCleanUpInterval = function() {
|
|
1454
1457
|
ConditionalColoringPlugin._cleanUpTimer = 0;
|
1455
1458
|
}
|
1456
1459
|
};
|
1460
|
+
/** @private
|
1461
|
+
* @return {Boolean}
|
1462
|
+
*/
|
1463
|
+
ConditionalColoringPlugin.prototype._hasColoring = function() {
|
1464
|
+
var hosts = this._hosts;
|
1465
|
+
var grid = hosts[0];
|
1466
|
+
|
1467
|
+
var colCount = this.getColumnCount();
|
1468
|
+
for(var colIndex = 0; colIndex < colCount; colIndex++){
|
1469
|
+
if(grid.hasColumnClass(colIndex, "conditionally-colored")){
|
1470
|
+
return true;
|
1471
|
+
}
|
1472
|
+
}
|
1473
|
+
return false;
|
1474
|
+
};
|
1457
1475
|
|
1458
1476
|
/** @public
|
1459
1477
|
* @description Deprecated:: Should use reloadThemeColors instead
|
@@ -591,17 +591,6 @@ RowSelectionPlugin.prototype._onClick = function (e) {
|
|
591
591
|
}
|
592
592
|
this._dispatchSelectionChanged(e);
|
593
593
|
}
|
594
|
-
if(this._activeGrid != null){
|
595
|
-
var selectionText;
|
596
|
-
if(this._isIE) {
|
597
|
-
selectionText = document.selection.createRange().htmlText;
|
598
|
-
} else {
|
599
|
-
selectionText = window.getSelection().toString();
|
600
|
-
}
|
601
|
-
if(!selectionText) { // Doesn't select text, tried to focus
|
602
|
-
this._activeGrid.focus();
|
603
|
-
}
|
604
|
-
}
|
605
594
|
};
|
606
595
|
/** @public
|
607
596
|
* @description Select a specified row as if it were clicked by a mouse. This is for testing purpose.
|
@@ -678,12 +667,13 @@ RowSelectionPlugin.prototype._onMouseDown = function (e) {
|
|
678
667
|
|
679
668
|
var singleSelection = this._singleSelMode || !this._activeGrid || (this._activeGrid !== host); // New grid is clicked
|
680
669
|
var section = ctx["section"];
|
670
|
+
var prevSel = section.isSelectedRow(rowIndex);
|
681
671
|
|
682
672
|
if (!singleSelection) {
|
683
673
|
if (e.shiftKey) { // Shift + Click: selects every rows start from anchor to clicked point. Anchor point doesn't change.
|
684
674
|
this._selectFromAnchorToTarget(section, rowIndex);
|
685
675
|
} else if ((e.ctrlKey && !isMac) || (isMac && !e.ctrlKey && e.metaKey)) { // Ctrl(windows)/Command(macOS) + Click: additionally selects a row without deselect all others.
|
686
|
-
this._sectionSetSelectedRow(section, rowIndex, !
|
676
|
+
this._sectionSetSelectedRow(section, rowIndex, !prevSel);
|
687
677
|
} else {
|
688
678
|
singleSelection = true;
|
689
679
|
}
|
@@ -691,7 +681,7 @@ RowSelectionPlugin.prototype._onMouseDown = function (e) {
|
|
691
681
|
|
692
682
|
if (singleSelection) { // Click: selects a single row
|
693
683
|
this._anchorSection = section;
|
694
|
-
if (
|
684
|
+
if (prevSel) { // Click on the selected row
|
695
685
|
this._setPendingClickIndex(rowIndex, host); // Delay the operation to allow drag and drop operation
|
696
686
|
return;
|
697
687
|
} else { // Perform single click immediately
|
@@ -707,29 +697,11 @@ RowSelectionPlugin.prototype._onMouseDown = function (e) {
|
|
707
697
|
}
|
708
698
|
}
|
709
699
|
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
// EXCEPT IE11 there is no way to select text without changing focus element
|
714
|
-
var hiddenInput = host.getHiddenInput();
|
715
|
-
if (hiddenInput) {
|
716
|
-
// we cannot set start with hidden input
|
717
|
-
// it will cause error in IE11
|
718
|
-
// So we use hiddenInput parent instead
|
719
|
-
this._textRange.setStart(hiddenInput.parentNode, 0);
|
720
|
-
this._textRange.setEnd(hiddenInput, 0);
|
721
|
-
var selection = window.getSelection();
|
722
|
-
selection.removeAllRanges();
|
723
|
-
|
724
|
-
// THIS WILL CAUSE IE11 FIRE BLUR EVENT AND CHANG FOCUS
|
725
|
-
selection.addRange(this._textRange);
|
726
|
-
|
727
|
-
// Cause in IE11, active element will change when perform text select
|
728
|
-
// so we will make current grid focus again
|
729
|
-
if (this._isIE) {
|
730
|
-
host.getParent().focus();
|
731
|
-
}
|
700
|
+
if(this._activeGrid && !prevSel) {
|
701
|
+
e.preventDefault();
|
702
|
+
this._activeGrid.focus();
|
732
703
|
}
|
704
|
+
|
733
705
|
if(!this._basedOnContent) { // Protect against rowPositionChanged and postBindingSection event
|
734
706
|
this._updateMenuIcon();
|
735
707
|
}
|
@@ -766,6 +766,30 @@ GridPlugin.prototype._activateColumnRenderer = function(colIndex, id, renderer)
|
|
766
766
|
}
|
767
767
|
};
|
768
768
|
|
769
|
+
/** @private
|
770
|
+
* @function
|
771
|
+
*/
|
772
|
+
var _emptyFunc = function(){};
|
773
|
+
/** @private
|
774
|
+
* @type {Object.<string, number>}
|
775
|
+
* @constant
|
776
|
+
*/
|
777
|
+
var KEY_MAP = {
|
778
|
+
"left": 37,
|
779
|
+
"right": 39,
|
780
|
+
"up": 38,
|
781
|
+
"down": 40,
|
782
|
+
"backspace": 8,
|
783
|
+
"tab": 9,
|
784
|
+
"enter": 13,
|
785
|
+
"esc": 27,
|
786
|
+
"escape": 27,
|
787
|
+
"space": 32,
|
788
|
+
"pageup": 33,
|
789
|
+
"pagedown": 34,
|
790
|
+
"del": 46,
|
791
|
+
"delete": 46
|
792
|
+
};
|
769
793
|
/** @private
|
770
794
|
* @param {number=} colIndex
|
771
795
|
* @param {number=} rowIndex
|
@@ -782,6 +806,8 @@ GridPlugin.prototype._mockMouseEvent = function(colIndex, rowIndex, context) {
|
|
782
806
|
}
|
783
807
|
|
784
808
|
var evt = context ? context : {};
|
809
|
+
evt.preventDefault = _emptyFunc;
|
810
|
+
evt.stopPropagation = _emptyFunc;
|
785
811
|
|
786
812
|
if (colIndex >= 0 && rowIndex >= 0) {
|
787
813
|
var grid = this._activeGrid || this._hosts[0];
|
@@ -791,15 +817,6 @@ GridPlugin.prototype._mockMouseEvent = function(colIndex, rowIndex, context) {
|
|
791
817
|
|
792
818
|
return evt;
|
793
819
|
};
|
794
|
-
|
795
|
-
var keyMap = {
|
796
|
-
"left": 37,
|
797
|
-
"right": 39,
|
798
|
-
"up": 38,
|
799
|
-
"down": 40,
|
800
|
-
"tab": 9
|
801
|
-
};
|
802
|
-
|
803
820
|
/** @private
|
804
821
|
* @param {number|string} keyCode
|
805
822
|
* @param {Object=} context
|
@@ -807,12 +824,12 @@ var keyMap = {
|
|
807
824
|
*/
|
808
825
|
GridPlugin.prototype._mockKeyboardEvent = function(keyCode, context) {
|
809
826
|
var evt = context ? context : {};
|
810
|
-
evt.preventDefault =
|
811
|
-
evt.stopPropagation =
|
827
|
+
evt.preventDefault = _emptyFunc;
|
828
|
+
evt.stopPropagation = _emptyFunc;
|
812
829
|
|
813
830
|
if (typeof keyCode === "string") {
|
814
|
-
|
815
|
-
keyCode =
|
831
|
+
var predefinedCode = KEY_MAP[keyCode.toLowerCase()] || 0;
|
832
|
+
keyCode = predefinedCode ? predefinedCode : keyCode.charCodeAt(0);
|
816
833
|
}
|
817
834
|
evt.keyCode = keyCode;
|
818
835
|
|
package/lib/versions.json
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
{
|
2
|
-
"tr-grid-util": "1.3.
|
2
|
+
"tr-grid-util": "1.3.136",
|
3
3
|
"tr-grid-printer": "1.0.17",
|
4
4
|
"@grid/column-dragging": "1.0.16",
|
5
5
|
"@grid/row-segmenting": "1.0.30",
|
6
6
|
"@grid/statistics-row": "1.0.16",
|
7
7
|
"@grid/zoom": "1.0.11",
|
8
8
|
"tr-grid-auto-tooltip": "1.1.6",
|
9
|
-
"tr-grid-cell-selection": "1.0.
|
10
|
-
"tr-grid-checkbox": "1.0.
|
11
|
-
"tr-grid-column-fitter": "1.0.
|
9
|
+
"tr-grid-cell-selection": "1.0.35",
|
10
|
+
"tr-grid-checkbox": "1.0.64",
|
11
|
+
"tr-grid-column-fitter": "1.0.40",
|
12
12
|
"tr-grid-column-formatting": "0.9.35",
|
13
13
|
"tr-grid-column-grouping": "1.0.57",
|
14
14
|
"tr-grid-column-resizing": "1.0.28",
|
15
|
-
"tr-grid-column-selection": "1.0.
|
15
|
+
"tr-grid-column-selection": "1.0.33",
|
16
16
|
"tr-grid-column-stack": "1.0.74",
|
17
|
-
"tr-grid-conditional-coloring": "1.0.
|
17
|
+
"tr-grid-conditional-coloring": "1.0.69",
|
18
18
|
"tr-grid-content-wrap": "1.0.20",
|
19
19
|
"tr-grid-contextmenu": "1.0.41",
|
20
20
|
"tr-grid-filter-input": "0.9.37",
|
@@ -26,10 +26,10 @@
|
|
26
26
|
"tr-grid-row-dragging": "1.0.31",
|
27
27
|
"tr-grid-row-filtering": "1.0.66",
|
28
28
|
"tr-grid-row-grouping": "1.0.86",
|
29
|
-
"tr-grid-row-selection": "1.0.
|
29
|
+
"tr-grid-row-selection": "1.0.27",
|
30
30
|
"tr-grid-rowcoloring": "1.0.25",
|
31
31
|
"tr-grid-textformatting": "1.0.47",
|
32
|
-
"tr-grid-titlewrap": "1.0.
|
32
|
+
"tr-grid-titlewrap": "1.0.21",
|
33
33
|
"@grid/formatters": "1.0.51",
|
34
34
|
"@grid/column-selection-dialog": "4.0.56",
|
35
35
|
"@grid/filter-dialog": "4.0.62",
|
package/package.json
CHANGED