@refinitiv-ui/efx-grid 6.0.82 → 6.0.84

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.
@@ -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, !section.isSelectedRow(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 (section.isSelectedRow(rowIndex)) { // Click on the selected row
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
- // Native copy event will not be triggered, if there's no text selection.
711
- // So we will select text in hiddenInput
712
- // we can only use selection.addRange because it not hijack focus of other element
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 = function(){};
811
- evt.stopPropagation = function(){};
827
+ evt.preventDefault = _emptyFunc;
828
+ evt.stopPropagation = _emptyFunc;
812
829
 
813
830
  if (typeof keyCode === "string") {
814
- keyCode = keyCode.toLowerCase();
815
- keyCode = keyMap[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
 
@@ -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
 
@@ -3,7 +3,7 @@ import {GridPlugin} from "../../tr-grid-util/es6/GridPlugin.js";
3
3
  import {FilterBuilder, stringToDateObject} from "../../tr-grid-util/es6/FilterBuilder.js";
4
4
  import {FilterOperators} from "../../tr-grid-util/es6/FilterOperators.js";
5
5
  import {ElfUtil} from "../../tr-grid-util/es6/ElfUtil.js";
6
- import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
6
+ import { injectCss, prettifyCss, cloneObject } from "../../tr-grid-util/es6/Util.js";
7
7
 
8
8
  declare namespace RowFilteringPlugin {
9
9
 
@@ -32,7 +32,8 @@ declare namespace RowFilteringPlugin {
32
32
  formattedDataAccessor?: ((...params: any[]) => any)|null,
33
33
  sortLogic?: ((...params: any[]) => any)|null,
34
34
  itemList?: any[]|null,
35
- additionalItems?: any[]|null
35
+ additionalItems?: any[]|null,
36
+ blankValues?: (boolean|string)|null
36
37
  };
37
38
 
38
39
  type Options = {
package/lib/versions.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
- "tr-grid-util": "1.3.135",
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.34",
10
- "tr-grid-checkbox": "1.0.63",
11
- "tr-grid-column-fitter": "1.0.39",
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
15
  "tr-grid-column-selection": "1.0.33",
16
16
  "tr-grid-column-stack": "1.0.74",
17
- "tr-grid-conditional-coloring": "1.0.68",
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",
@@ -24,14 +24,14 @@
24
24
  "tr-grid-percent-bar": "1.0.22",
25
25
  "tr-grid-range-bar": "2.0.6",
26
26
  "tr-grid-row-dragging": "1.0.31",
27
- "tr-grid-row-filtering": "1.0.66",
27
+ "tr-grid-row-filtering": "1.0.67",
28
28
  "tr-grid-row-grouping": "1.0.86",
29
- "tr-grid-row-selection": "1.0.26",
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.20",
32
+ "tr-grid-titlewrap": "1.0.21",
33
33
  "@grid/formatters": "1.0.51",
34
34
  "@grid/column-selection-dialog": "4.0.56",
35
- "@grid/filter-dialog": "4.0.62",
35
+ "@grid/filter-dialog": "4.0.63",
36
36
  "@grid/column-format-dialog": "4.0.44"
37
37
  }
package/package.json CHANGED
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "version": "6.0.82"
69
+ "version": "6.0.84"
70
70
  }