@refinitiv-ui/efx-grid 6.0.19 → 6.0.21

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,27 +4,28 @@ import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
4
4
  import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
5
5
  import Dom from "../../tr-grid-util/es6/Dom.js";
6
6
  import { DragUI } from "../../tr-grid-util/es6/DragUI.js";
7
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
7
8
 
8
9
  declare namespace RowDraggingPlugin {
9
10
 
10
11
  type Options = {
11
- dragBox?: boolean,
12
- disabled?: boolean,
13
- mouseInput?: boolean,
14
- dataTransfer?: boolean,
15
- autoScroll?: boolean,
16
- dragBoxRenderer?: ((...params: any[]) => any),
17
- dragStart?: ((...params: any[]) => any),
18
- drag?: ((...params: any[]) => any),
19
- dragEnd?: ((...params: any[]) => any),
20
- dataMoved?: ((...params: any[]) => any)
12
+ dragBox?: boolean|null,
13
+ disabled?: boolean|null,
14
+ mouseInput?: boolean|null,
15
+ dataTransfer?: boolean|null,
16
+ autoScroll?: boolean|null,
17
+ dragBoxRenderer?: ((...params: any[]) => any)|null,
18
+ dragStart?: ((...params: any[]) => any)|null,
19
+ drag?: ((...params: any[]) => any)|null,
20
+ dragEnd?: ((...params: any[]) => any)|null,
21
+ dataMoved?: ((...params: any[]) => any)|null
21
22
  };
22
23
 
23
24
  }
24
25
 
25
26
  declare class RowDraggingPlugin extends GridPlugin {
26
27
 
27
- constructor(options?: RowDraggingPlugin.Options);
28
+ constructor(options?: RowDraggingPlugin.Options|null);
28
29
 
29
30
  public hasMultiTableSupport(): boolean;
30
31
 
@@ -38,7 +39,7 @@ declare class RowDraggingPlugin extends GridPlugin {
38
39
 
39
40
  public getConfigObject(out_obj?: any): any;
40
41
 
41
- public startDrag(startRef: any, opt_suppressEvent?: boolean): void;
42
+ public startDrag(startRef: any, opt_suppressEvent?: boolean|null): void;
42
43
 
43
44
  public stopDrag(): void;
44
45
 
@@ -46,11 +47,11 @@ declare class RowDraggingPlugin extends GridPlugin {
46
47
 
47
48
  public getGuideline(): Element|null;
48
49
 
49
- public disable(disabled?: boolean): void;
50
+ public disable(disabled?: boolean|null): void;
50
51
 
51
52
  public isDisabled(): boolean;
52
53
 
53
- public disableUIs(disabled?: boolean): void;
54
+ public disableUIs(disabled?: boolean|null): void;
54
55
 
55
56
  }
56
57
 
@@ -4,6 +4,7 @@ import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
4
4
  import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
5
5
  import Dom from "../../tr-grid-util/es6/Dom.js";
6
6
  import { DragUI } from "../../tr-grid-util/es6/DragUI.js";
7
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
7
8
 
8
9
  /** @typedef {Object} RowDraggingPlugin~Options
9
10
  * @description Available options describing `rowDragging` object specified in grid's option
@@ -198,6 +199,14 @@ RowDraggingPlugin.prototype._autoScroll = true;
198
199
  */
199
200
  RowDraggingPlugin.prototype._dragUI = null;
200
201
 
202
+ /** @private Applied theme color in row dragging and dragUI
203
+ * @param {Object} host core grid instance
204
+ */
205
+ var _applyStyles = function(host) {
206
+ RowDraggingPlugin._applyThemeColor(host);
207
+ DragUI.applyThemeColor(host);
208
+ };
209
+
201
210
  /** Prevent built-in config
202
211
  * @public
203
212
  * @ignore
@@ -252,12 +261,12 @@ RowDraggingPlugin.prototype.initialize = function (host, options) {
252
261
  });
253
262
 
254
263
  // Share dragging styles
255
- if(DragUI.stylePromise) {
256
- DragUI.applyThemeColor(host);
257
- } else {
264
+ if(!DragUI.stylePromise) {
258
265
  DragUI.stylePromise = ElfUtil.getThemeColors();
259
266
  DragUI.stylePromise.then(this._onThemeLoaded).catch(this._onThemeLoaded);
260
267
  }
268
+ // TODO: Create a manager to manage styles. Currently, we have to use setTimeout to wait for an element to be created before applying styles
269
+ setTimeout(_applyStyles.bind(this, host), 0);
261
270
 
262
271
  // In case of lazy loading
263
272
  // host.getAllSections("content").forEach(this._registerSection);
@@ -284,10 +293,34 @@ RowDraggingPlugin.prototype.unload = function (host) {
284
293
  /** @private
285
294
  */
286
295
  RowDraggingPlugin.prototype._onThemeLoaded = function() {
296
+ if(!RowDraggingPlugin._styles) {
297
+ var styles = [
298
+ ":host .row-dragging .cover-layer .selection-bound", [
299
+ "border: var(--grid-drag-indicator)"
300
+ ],
301
+ ":host .row-dragging .tr-lg .cell.selected-row", [
302
+ "background-color: unset;"
303
+ ]
304
+ ];
305
+ RowDraggingPlugin._styles = prettifyCss(styles);
306
+ }
307
+
287
308
  var colors = ElfUtil.getColors();
288
309
  this._dragUI.onThemeLoaded(colors); // TODO : onThemeLoaded should be static function like DragUI.applyThemeColor
289
310
  for(var i = this._hosts.length; --i >= 0;) {
290
- DragUI.applyThemeColor(this._hosts[i]);
311
+ _applyStyles(this._hosts[i]);
312
+ }
313
+ };
314
+ /** @private
315
+ * @param {Object} grid core grid instance
316
+ */
317
+ RowDraggingPlugin._applyThemeColor = function(grid) {
318
+ if(!grid || grid._rowDraggingStyles) {
319
+ return;
320
+ }
321
+ if(RowDraggingPlugin._styles) {
322
+ grid._rowDraggingStyles = true; // Prevent loading the same style twice
323
+ injectCss(RowDraggingPlugin._styles, grid.getParent());
291
324
  }
292
325
  };
293
326
 
@@ -528,7 +561,9 @@ RowDraggingPlugin.prototype._onDragStart = function (e) {
528
561
  // TODO: Just update curser will not gonna work since cell is pointer-events: none;
529
562
  // we should do something to overwrite pointer-events first
530
563
  // then set cursor move will have an effect
531
- grid.getElement().classList.add("mouse-dragging");
564
+ var gridElem = grid.getElement();
565
+ gridElem.classList.add("mouse-dragging");
566
+ gridElem.classList.add("row-dragging");
532
567
 
533
568
  this._updateGuidePosition();
534
569
 
@@ -609,7 +644,10 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
609
644
  }
610
645
 
611
646
  var srcGrid = this._startingGrid || this._hosts[0];
612
- srcGrid.getElement().classList.remove("mouse-dragging");
647
+
648
+ var srcGridElem = srcGrid.getElement();
649
+ srcGridElem.classList.remove("mouse-dragging");
650
+ srcGridElem.classList.remove("row-dragging");
613
651
 
614
652
  var destPos = this._pos; // This can be null
615
653
  if(!this._isDragCancelled()) {
@@ -9,20 +9,20 @@ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
9
9
  declare namespace RowSelectionPlugin {
10
10
 
11
11
  type Options = {
12
- singleSelection?: boolean,
13
- selectionChanged?: ((...params: any[]) => any),
14
- beforeSelection?: ((...params: any[]) => any),
15
- basedOnContent?: boolean,
16
- selectionField?: string,
17
- menuClicked?: ((...params: any[]) => any),
18
- menuPosition?: string
12
+ singleSelection?: boolean|null,
13
+ selectionChanged?: ((...params: any[]) => any)|null,
14
+ beforeSelection?: ((...params: any[]) => any)|null,
15
+ basedOnContent?: boolean|null,
16
+ selectionField?: string|null,
17
+ menuClicked?: ((...params: any[]) => any)|null,
18
+ menuPosition?: string|null
19
19
  };
20
20
 
21
21
  }
22
22
 
23
23
  declare class RowSelectionPlugin extends GridPlugin {
24
24
 
25
- constructor(options?: RowSelectionPlugin.Options);
25
+ constructor(options?: RowSelectionPlugin.Options|null);
26
26
 
27
27
  public getName(): string;
28
28
 
@@ -36,11 +36,11 @@ declare class RowSelectionPlugin extends GridPlugin {
36
36
 
37
37
  public getConfigObject(gridOptions?: any): any;
38
38
 
39
- public clearAllSelections(preserveAnchor?: boolean, activeGrid?: any): void;
39
+ public clearAllSelections(preserveAnchor?: boolean|null, activeGrid?: any): void;
40
40
 
41
- public clearSelectedRows(preserveAnchor?: boolean, activeGrid?: any): void;
41
+ public clearSelectedRows(preserveAnchor?: boolean|null, activeGrid?: any): void;
42
42
 
43
- public clearSelection(preserveAnchor?: boolean, activeGrid?: any): void;
43
+ public clearSelection(preserveAnchor?: boolean|null, activeGrid?: any): void;
44
44
 
45
45
  public getActiveGrid(): any;
46
46
 
@@ -56,19 +56,19 @@ declare class RowSelectionPlugin extends GridPlugin {
56
56
 
57
57
  public getSelectedRowCount(sectRef?: any): number;
58
58
 
59
- public setSelectedRow(rowIndex: number, opt_select?: boolean, sectRef?: any): void;
59
+ public setSelectedRow(rowIndex: number, opt_select?: boolean|null, sectRef?: any): void;
60
60
 
61
61
  public selectSingleRow(rowIndex: number, sectRef?: any, activeGrid?: any): boolean;
62
62
 
63
63
  public selectAllRows(activeGrid?: any): void;
64
64
 
65
- public selectRowRange(rowIndex: number, length: number, sectRef?: any, opt_scrollToRow?: boolean): void;
65
+ public selectRowRange(rowIndex: number, length: number, sectRef?: any, opt_scrollToRow?: boolean|null): void;
66
66
 
67
- public disable(disabled?: boolean): void;
67
+ public disable(disabled?: boolean|null): void;
68
68
 
69
69
  public isEnabled(): boolean;
70
70
 
71
- public disableMultiSelection(disabled?: boolean): void;
71
+ public disableMultiSelection(disabled?: boolean|null): void;
72
72
 
73
73
  public getSelectedText(): string;
74
74
 
@@ -615,7 +615,15 @@ RowSelectionPlugin.prototype._onClick = function (e) {
615
615
  this._dispatchSelectionChanged(e);
616
616
  }
617
617
  if(this._activeGrid != null){
618
- this._activeGrid.focus();
618
+ var selectionText;
619
+ if(this._isIE) {
620
+ selectionText = document.selection.createRange().htmlText;
621
+ } else {
622
+ selectionText = window.getSelection().toString();
623
+ }
624
+ if(!selectionText) { // Doesn't select text, tried to focus
625
+ this._activeGrid.focus();
626
+ }
619
627
  }
620
628
  };
621
629
  /** @private
@@ -38,19 +38,19 @@ declare class ColumnGroupingPlugin extends GridPlugin {
38
38
 
39
39
  public addColumnToGroup(column: any, groupId: string, colIndex: number): void;
40
40
 
41
- public addGroup(groupDef: ColumnGroupingPlugin.GroupDefinition|null): boolean;
41
+ public addGroup(groupDef: ColumnGroupingPlugin.GroupDefinition|null): string;
42
42
 
43
43
  public addColumnGrouping(groupDef: ColumnGroupingPlugin.GroupDefinition|null): void;
44
44
 
45
- public removeGroup(groupId: string): any;
45
+ public removeGroup(groupId: string): ColumnGroupingPlugin.GroupDefinition|null;
46
46
 
47
- public setGroupDefinitions(groupDefs: ColumnGroupingPlugin.GroupDefinitions|null): void;
47
+ public getGroupDefinition(groupId: string): ColumnGroupingPlugin.GroupDefinition|null;
48
48
 
49
49
  public getGroupDefinitions(): ColumnGroupingPlugin.GroupDefinitions;
50
50
 
51
51
  public setGroupDefinition(groupId: string, newDef: ColumnGroupingPlugin.GroupDefinition|null): void;
52
52
 
53
- public getGroupDefinition(groupId: string): ColumnGroupingPlugin.GroupDefinition|null;
53
+ public setGroupDefinitions(groupDefs: ColumnGroupingPlugin.GroupDefinitions|null): void;
54
54
 
55
55
  public setGroupChildren(groupId: string, newChildList: (string)[]|null): void;
56
56
 
@@ -259,6 +259,12 @@ declare class Grid extends EventDispatcher {
259
259
 
260
260
  public freezeColumn(colIndex?: number|null, pinnedRightColumns?: number|null): void;
261
261
 
262
+ public pinColumn(colRef: Grid.ColumnReference|(Grid.ColumnReference)[]|null): boolean;
263
+
264
+ public unpinColumn(colRef: Grid.ColumnReference|(Grid.ColumnReference)[]|null, dest?: Grid.ColumnReference|null): boolean;
265
+
266
+ public unpinAllColumns(): boolean;
267
+
262
268
  public updateColumnTitle(): void;
263
269
 
264
270
  public isSorting(): boolean;
@@ -4,27 +4,28 @@ import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
4
4
  import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
5
5
  import Dom from "../../tr-grid-util/es6/Dom.js";
6
6
  import { DragUI } from "../../tr-grid-util/es6/DragUI.js";
7
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
7
8
 
8
9
  declare namespace RowDraggingPlugin {
9
10
 
10
11
  type Options = {
11
- dragBox?: boolean,
12
- disabled?: boolean,
13
- mouseInput?: boolean,
14
- dataTransfer?: boolean,
15
- autoScroll?: boolean,
16
- dragBoxRenderer?: ((...params: any[]) => any),
17
- dragStart?: ((...params: any[]) => any),
18
- drag?: ((...params: any[]) => any),
19
- dragEnd?: ((...params: any[]) => any),
20
- dataMoved?: ((...params: any[]) => any)
12
+ dragBox?: boolean|null,
13
+ disabled?: boolean|null,
14
+ mouseInput?: boolean|null,
15
+ dataTransfer?: boolean|null,
16
+ autoScroll?: boolean|null,
17
+ dragBoxRenderer?: ((...params: any[]) => any)|null,
18
+ dragStart?: ((...params: any[]) => any)|null,
19
+ drag?: ((...params: any[]) => any)|null,
20
+ dragEnd?: ((...params: any[]) => any)|null,
21
+ dataMoved?: ((...params: any[]) => any)|null
21
22
  };
22
23
 
23
24
  }
24
25
 
25
26
  declare class RowDraggingPlugin extends GridPlugin {
26
27
 
27
- constructor(options?: RowDraggingPlugin.Options);
28
+ constructor(options?: RowDraggingPlugin.Options|null);
28
29
 
29
30
  public hasMultiTableSupport(): boolean;
30
31
 
@@ -38,7 +39,7 @@ declare class RowDraggingPlugin extends GridPlugin {
38
39
 
39
40
  public getConfigObject(out_obj?: any): any;
40
41
 
41
- public startDrag(startRef: any, opt_suppressEvent?: boolean): void;
42
+ public startDrag(startRef: any, opt_suppressEvent?: boolean|null): void;
42
43
 
43
44
  public stopDrag(): void;
44
45
 
@@ -46,11 +47,11 @@ declare class RowDraggingPlugin extends GridPlugin {
46
47
 
47
48
  public getGuideline(): Element|null;
48
49
 
49
- public disable(disabled?: boolean): void;
50
+ public disable(disabled?: boolean|null): void;
50
51
 
51
52
  public isDisabled(): boolean;
52
53
 
53
- public disableUIs(disabled?: boolean): void;
54
+ public disableUIs(disabled?: boolean|null): void;
54
55
 
55
56
  }
56
57
 
@@ -29,6 +29,7 @@ declare namespace RowGroupingPlugin {
29
29
  colorTag?: boolean|null,
30
30
  predefinedColors?: any,
31
31
  groupColors?: any,
32
+ defaultCollapse?: boolean|null,
32
33
  clicked?: ((...params: any[]) => any)|null,
33
34
  groupAdded?: ((...params: any[]) => any)|null,
34
35
  beforeGroupAdded?: ((...params: any[]) => any)|null,
@@ -84,6 +85,10 @@ declare class RowGroupingPlugin extends GridPlugin {
84
85
 
85
86
  public setPredefinedColors(predefinedColors: any): void;
86
87
 
88
+ public setDefaultCollapse(collapse: boolean): void;
89
+
90
+ public getDefaultCollapse(): boolean;
91
+
87
92
  public sortGroups(): void;
88
93
 
89
94
  public updateHeaders(): void;
@@ -9,20 +9,20 @@ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
9
9
  declare namespace RowSelectionPlugin {
10
10
 
11
11
  type Options = {
12
- singleSelection?: boolean,
13
- selectionChanged?: ((...params: any[]) => any),
14
- beforeSelection?: ((...params: any[]) => any),
15
- basedOnContent?: boolean,
16
- selectionField?: string,
17
- menuClicked?: ((...params: any[]) => any),
18
- menuPosition?: string
12
+ singleSelection?: boolean|null,
13
+ selectionChanged?: ((...params: any[]) => any)|null,
14
+ beforeSelection?: ((...params: any[]) => any)|null,
15
+ basedOnContent?: boolean|null,
16
+ selectionField?: string|null,
17
+ menuClicked?: ((...params: any[]) => any)|null,
18
+ menuPosition?: string|null
19
19
  };
20
20
 
21
21
  }
22
22
 
23
23
  declare class RowSelectionPlugin extends GridPlugin {
24
24
 
25
- constructor(options?: RowSelectionPlugin.Options);
25
+ constructor(options?: RowSelectionPlugin.Options|null);
26
26
 
27
27
  public getName(): string;
28
28
 
@@ -36,11 +36,11 @@ declare class RowSelectionPlugin extends GridPlugin {
36
36
 
37
37
  public getConfigObject(gridOptions?: any): any;
38
38
 
39
- public clearAllSelections(preserveAnchor?: boolean, activeGrid?: any): void;
39
+ public clearAllSelections(preserveAnchor?: boolean|null, activeGrid?: any): void;
40
40
 
41
- public clearSelectedRows(preserveAnchor?: boolean, activeGrid?: any): void;
41
+ public clearSelectedRows(preserveAnchor?: boolean|null, activeGrid?: any): void;
42
42
 
43
- public clearSelection(preserveAnchor?: boolean, activeGrid?: any): void;
43
+ public clearSelection(preserveAnchor?: boolean|null, activeGrid?: any): void;
44
44
 
45
45
  public getActiveGrid(): any;
46
46
 
@@ -56,19 +56,19 @@ declare class RowSelectionPlugin extends GridPlugin {
56
56
 
57
57
  public getSelectedRowCount(sectRef?: any): number;
58
58
 
59
- public setSelectedRow(rowIndex: number, opt_select?: boolean, sectRef?: any): void;
59
+ public setSelectedRow(rowIndex: number, opt_select?: boolean|null, sectRef?: any): void;
60
60
 
61
61
  public selectSingleRow(rowIndex: number, sectRef?: any, activeGrid?: any): boolean;
62
62
 
63
63
  public selectAllRows(activeGrid?: any): void;
64
64
 
65
- public selectRowRange(rowIndex: number, length: number, sectRef?: any, opt_scrollToRow?: boolean): void;
65
+ public selectRowRange(rowIndex: number, length: number, sectRef?: any, opt_scrollToRow?: boolean|null): void;
66
66
 
67
- public disable(disabled?: boolean): void;
67
+ public disable(disabled?: boolean|null): void;
68
68
 
69
69
  public isEnabled(): boolean;
70
70
 
71
- public disableMultiSelection(disabled?: boolean): void;
71
+ public disableMultiSelection(disabled?: boolean|null): void;
72
72
 
73
73
  public getSelectedText(): string;
74
74
 
package/lib/versions.json CHANGED
@@ -9,8 +9,8 @@
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.35",
13
- "tr-grid-column-resizing": "1.0.26",
12
+ "tr-grid-column-grouping": "1.0.37",
13
+ "tr-grid-column-resizing": "1.0.28",
14
14
  "tr-grid-column-selection": "1.0.25",
15
15
  "tr-grid-column-stack": "1.0.48",
16
16
  "tr-grid-conditional-coloring": "1.0.57",
@@ -23,15 +23,15 @@
23
23
  "tr-grid-percent-bar": "1.0.22",
24
24
  "tr-grid-printer": "1.0.16",
25
25
  "tr-grid-range-bar": "1.0.9",
26
- "tr-grid-row-dragging": "1.0.23",
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",
29
- "tr-grid-row-selection": "1.0.21",
29
+ "tr-grid-row-selection": "1.0.22",
30
30
  "tr-grid-rowcoloring": "1.0.21",
31
31
  "tr-grid-textformatting": "1.0.44",
32
32
  "tr-grid-titlewrap": "1.0.19",
33
33
  "@grid/formatters": "1.0.49",
34
- "@grid/column-selection-dialog": "4.0.45",
35
- "@grid/filter-dialog": "4.0.55",
34
+ "@grid/column-selection-dialog": "4.0.46",
35
+ "@grid/filter-dialog": "4.0.56",
36
36
  "@grid/column-format-dialog": "4.0.43"
37
37
  }
package/package.json CHANGED
@@ -23,6 +23,9 @@
23
23
  ],
24
24
  "grid": [
25
25
  "lib/grid/lib/efx-grid.d.ts"
26
+ ],
27
+ "*": [
28
+ "lib/types/index.d.ts"
26
29
  ]
27
30
  }
28
31
  },
@@ -58,5 +61,5 @@
58
61
  "publishConfig": {
59
62
  "access": "public"
60
63
  },
61
- "version": "6.0.19"
64
+ "version": "6.0.21"
62
65
  }