@refinitiv-ui/efx-grid 6.0.93 → 6.0.94

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/lib/formatters/es6/CoralButtonFormatter.d.ts +0 -2
  2. package/lib/formatters/es6/CoralButtonFormatter.js +9 -4
  3. package/lib/formatters/es6/CoralCheckboxFormatter.js +10 -5
  4. package/lib/formatters/es6/CoralComboBoxFormatter.js +13 -12
  5. package/lib/formatters/es6/CoralIconFormatter.d.ts +0 -2
  6. package/lib/formatters/es6/CoralIconFormatter.js +9 -4
  7. package/lib/formatters/es6/CoralInputFormatter.js +9 -4
  8. package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +0 -2
  9. package/lib/formatters/es6/CoralRadioButtonFormatter.js +20 -15
  10. package/lib/formatters/es6/CoralSelectFormatter.js +12 -7
  11. package/lib/formatters/es6/CoralToggleFormatter.js +4 -4
  12. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +20 -20
  13. package/lib/formatters/es6/EFButtonFormatter.d.ts +0 -2
  14. package/lib/formatters/es6/EFButtonFormatter.js +9 -4
  15. package/lib/formatters/es6/EFCheckboxFormatter.js +10 -5
  16. package/lib/formatters/es6/EFComboBoxFormatter.js +17 -7
  17. package/lib/formatters/es6/EFDateTimePickerFormatter.js +11 -6
  18. package/lib/formatters/es6/EFIconFormatter.d.ts +0 -2
  19. package/lib/formatters/es6/EFIconFormatter.js +9 -4
  20. package/lib/formatters/es6/EFNumberFieldFormatter.js +9 -4
  21. package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +0 -2
  22. package/lib/formatters/es6/EFRadioButtonFormatter.js +25 -15
  23. package/lib/formatters/es6/EFSelectFormatter.js +17 -7
  24. package/lib/formatters/es6/EFTextFieldFormatter.js +4 -4
  25. package/lib/formatters/es6/EFToggleFormatter.js +4 -4
  26. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +6 -6
  27. package/lib/formatters/es6/FormatterBuilder.js +32 -32
  28. package/lib/formatters/es6/NumericInputFormatter.js +7 -7
  29. package/lib/formatters/es6/PercentBarFormatter.js +5 -5
  30. package/lib/formatters/es6/SimpleImageFormatter.js +3 -3
  31. package/lib/formatters/es6/SimpleInputFormatter.js +4 -4
  32. package/lib/formatters/es6/SimpleLinkFormatter.js +4 -4
  33. package/lib/formatters/es6/SimpleTickerFormatter.js +5 -5
  34. package/lib/formatters/es6/SimpleToggleFormatter.js +16 -16
  35. package/lib/formatters/es6/TextFormatter.js +4 -4
  36. package/lib/grid/index.js +1 -1
  37. package/lib/tr-grid-cell-selection/es6/CellSelection.js +1 -1
  38. package/lib/tr-grid-row-dragging/es6/RowDragging.js +1 -1
  39. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +139 -137
  40. package/lib/tr-grid-row-selection/es6/RowSelection.js +260 -279
  41. package/lib/tr-grid-util/es6/DragUI.js +1 -1
  42. package/lib/types/es6/ColumnGrouping.d.ts +1 -2
  43. package/lib/versions.json +6 -6
  44. package/package.json +1 -1
@@ -4,7 +4,13 @@ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
4
4
  import { isMac as isMacFn } from "../../tr-grid-util/es6/Util.js";
5
5
  import { isIE, prepareTSVContent } from "../../tr-grid-util/es6/Util.js";
6
6
  import { prettifyCss } from "../../tr-grid-util/es6/Util.js";
7
- var isMac = isMacFn();
7
+
8
+ /** @private
9
+ * @type {boolean}
10
+ * @constant
11
+ */
12
+ const IS_MAC = isMacFn();
13
+
8
14
  /** Fired when selection is changed by mouse down or key press. A change by JavaScript APIs will not trigger this event.
9
15
  * @event RowSelectionPlugin#selectionChanged
10
16
  */
@@ -13,7 +19,7 @@ var isMac = isMacFn();
13
19
  * Note that selection by JavaScript APIs cannot be prevented using this event.
14
20
  * @event RowSelectionPlugin#beforeSelection
15
21
  * @example
16
- * var ext = new RowSelectionPlugin();
22
+ * let ext = new RowSelectionPlugin();
17
23
  * ext.listen("beforeSelection" function(e) {
18
24
  * e.cancel = true; // Cancel user selection
19
25
  * });
@@ -34,11 +40,10 @@ var isMac = isMacFn();
34
40
  * @extends {GridPlugin}
35
41
  * @param {RowSelectionPlugin~Options=} options
36
42
  */
37
- var RowSelectionPlugin = function (options) {
38
- var t = this;
43
+ let RowSelectionPlugin = function (options) {
44
+ let t = this;
39
45
  t._onMouseDown = t._onMouseDown.bind(t);
40
46
  t._onMouseMove = t._onMouseMove.bind(t);
41
- t._onCopy = t._onCopy.bind(t);
42
47
  t._onClick = t._onClick.bind(t);
43
48
  t._onKeyDown = t._onKeyDown.bind(t);
44
49
  t._onBeforeRowRemoved = t._onBeforeRowRemoved.bind(t);
@@ -51,7 +56,7 @@ var RowSelectionPlugin = function (options) {
51
56
  t._isIE = isIE();
52
57
  t._textRange = document.createRange();
53
58
 
54
- if (options) {
59
+ if(options) {
55
60
  t.config({ "rowSelection": options });
56
61
  }
57
62
  };
@@ -133,7 +138,7 @@ RowSelectionPlugin.prototype._pendingSelection = null;
133
138
  * @return {string}
134
139
  */
135
140
  RowSelectionPlugin._styleCalculator = function() {
136
- var styles = [
141
+ let styles = [
137
142
  ".row-selection-menu", [
138
143
  "position: absolute;",
139
144
  "background-color: var(--grid-column-menu-icon-bgcolor);",
@@ -175,7 +180,7 @@ RowSelectionPlugin.prototype.hasMultiTableSupport = function () {
175
180
  * @param {Object=} options Grid configuration object
176
181
  */
177
182
  RowSelectionPlugin.prototype.initialize = function (host, options) {
178
- if (this._hosts.indexOf(host) >= 0) { return; }
183
+ if(this._hosts.indexOf(host) >= 0) { return; }
179
184
  this._hosts.push(host);
180
185
 
181
186
  host.listen("mousedown", this._onMouseDown);
@@ -184,14 +189,12 @@ RowSelectionPlugin.prototype.initialize = function (host, options) {
184
189
  host.listen("postSectionDataBinding", this._onPostSectionDataBinding);
185
190
  host.listen("rowPositionChanged", this._onRowPositionChanged);
186
191
 
187
- var wrapper = this.getGridApi(host);
192
+ let wrapper = this.getGridApi(host);
188
193
  if(wrapper) {
189
194
  wrapper.listen("beforeRowRemoved", this._onBeforeRowRemoved);
190
195
  }
191
196
 
192
197
  // TODO:: listen to copy and cut event when implement autoCopy config
193
- // host.listen("copy", this._onCopy,);
194
- // host.listen("cut", this._onCopy);
195
198
 
196
199
  this.config(options);
197
200
 
@@ -204,12 +207,10 @@ RowSelectionPlugin.prototype.initialize = function (host, options) {
204
207
  * @param {Object=} host core grid instance
205
208
  */
206
209
  RowSelectionPlugin.prototype.unload = function (host) {
207
- var at = this._hosts.indexOf(host);
208
- if (at < 0) { return; }
210
+ let at = this._hosts.indexOf(host);
211
+ if(at < 0) { return; }
209
212
 
210
213
  host.unlisten("mousedown", this._onMouseDown);
211
- host.unlisten("copy", this._onCopy);
212
- host.unlisten("cut", this._onCopy);
213
214
  host.unlisten("click", this._onClick);
214
215
  host.unlisten("keydown", this._onKeyDown);
215
216
  host.unlisten("postSectionDataBinding", this._onPostSectionDataBinding);
@@ -217,7 +218,7 @@ RowSelectionPlugin.prototype.unload = function (host) {
217
218
 
218
219
  this._hosts.splice(at, 1);
219
220
 
220
- if (!this._hosts.length) {
221
+ if(!this._hosts.length) {
221
222
  if(this._timerId) {
222
223
  clearTimeout(this._timerId);
223
224
  this._timerId = 0;
@@ -232,27 +233,27 @@ RowSelectionPlugin.prototype.unload = function (host) {
232
233
  * @param {Object=} options Grid configuration object
233
234
  */
234
235
  RowSelectionPlugin.prototype.config = function (options) {
235
- if (!options) {
236
+ if(!options) {
236
237
  return;
237
238
  }
238
239
 
239
- var pluginOptions = options["rowSelection"];
240
+ let pluginOptions = options["rowSelection"];
240
241
 
241
- if (pluginOptions) {
242
- if (typeof pluginOptions === "object") {
243
- if (pluginOptions["singleSelection"]) {
242
+ if(pluginOptions) {
243
+ if(typeof pluginOptions === "object") {
244
+ if(pluginOptions["singleSelection"]) {
244
245
  this._singleSelMode = true;
245
246
  }
246
- if (pluginOptions["clickToggle"]) {
247
+ if(pluginOptions["clickToggle"]) {
247
248
  this._clickToggleMode = true;
248
249
  }
249
- if (pluginOptions["basedOnContent"]) {
250
+ if(pluginOptions["basedOnContent"]) {
250
251
  this._basedOnContent = true;
251
252
  }
252
- if (pluginOptions["selectionField"]) {
253
+ if(pluginOptions["selectionField"]) {
253
254
  this._selectionField = pluginOptions["selectionField"];
254
255
  }
255
- var val = pluginOptions["menuClicked"];
256
+ let val = pluginOptions["menuClicked"];
256
257
  if(typeof val === "function"){
257
258
  this._onMenuClicked = val;
258
259
  }
@@ -260,13 +261,13 @@ RowSelectionPlugin.prototype.config = function (options) {
260
261
  if(val) {
261
262
  this._menuPosition = val;
262
263
  }
263
- } else if (pluginOptions === "single") {
264
+ } else if(pluginOptions === "single") {
264
265
  this._singleSelMode = true;
265
266
  }
266
267
 
267
268
  this.addListener(pluginOptions, "selectionChanged");
268
269
  this.addListener(pluginOptions, "beforeSelection");
269
- } else if (pluginOptions != null) {
270
+ } else if(pluginOptions != null) {
270
271
  this.disable();
271
272
  }
272
273
  };
@@ -276,9 +277,9 @@ RowSelectionPlugin.prototype.config = function (options) {
276
277
  * @return {!Object}
277
278
  */
278
279
  RowSelectionPlugin.prototype.getConfigObject = function (gridOptions) {
279
- var obj = gridOptions || {};
280
+ let obj = gridOptions || {};
280
281
 
281
- var extOptions = obj.rowSelection;
282
+ let extOptions = obj.rowSelection;
282
283
  if(!extOptions) {
283
284
  extOptions = obj.rowSelection = {};
284
285
  }
@@ -304,12 +305,12 @@ RowSelectionPlugin.prototype.getConfigObject = function (gridOptions) {
304
305
  * @param {Object=} activeGrid Grid for taking user key inputs after clearing
305
306
  */
306
307
  RowSelectionPlugin.prototype.clearAllSelections = function (preserveAnchor, activeGrid) {
307
- if (preserveAnchor == null) {
308
+ if(preserveAnchor == null) {
308
309
  preserveAnchor = true;
309
310
  }
310
311
  this._clearSelectedRows(preserveAnchor);
311
312
 
312
- if (activeGrid) {
313
+ if(activeGrid) {
313
314
  this._activeGrid = activeGrid;
314
315
  }
315
316
  };
@@ -342,14 +343,14 @@ RowSelectionPlugin.prototype.getActiveGrid = function () {
342
343
  * @return {number} rowIndex of anchor
343
344
  */
344
345
  RowSelectionPlugin.prototype.getRowAnchor = function (sectRef) {
345
- if (this._basedOnContent) {
346
- var dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
346
+ if(this._basedOnContent) {
347
+ let dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
347
348
  if( dv && this._anchorRowId){
348
349
  return dv.getRowIndex(this._anchorRowId);
349
350
  }
350
351
  } else {
351
- var section = this._getSection(sectRef);
352
- if (section && section.getRowAnchor){
352
+ let section = this._getSection(sectRef);
353
+ if(section && section.getRowAnchor){
353
354
  return section.getRowAnchor();
354
355
  }
355
356
  }
@@ -361,20 +362,20 @@ RowSelectionPlugin.prototype.getRowAnchor = function (sectRef) {
361
362
  * @return {number|null}
362
363
  */
363
364
  RowSelectionPlugin.prototype.getFirstSelectedIndex = function (sectRef) {
364
- var section = this._getSection(sectRef);
365
- if (!section) {
365
+ let section = this._getSection(sectRef);
366
+ if(!section) {
366
367
  return null;
367
- } else if (this._basedOnContent) {
368
- var dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
369
- if (!dv) return null;
370
-
371
- var rids = dv.getVisibleRowIds(true);
372
- var rows = dv.getMultipleRowData(rids);
373
- var count = rows.length;
374
- var dataRow;
375
- for (var rowIndex = 0; rowIndex < count; rowIndex++) {
368
+ } else if(this._basedOnContent) {
369
+ let dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
370
+ if(!dv) return null;
371
+
372
+ let rids = dv.getVisibleRowIds(true);
373
+ let rows = dv.getMultipleRowData(rids);
374
+ let count = rows.length;
375
+ let dataRow;
376
+ for(let rowIndex = 0; rowIndex < count; rowIndex++) {
376
377
  dataRow = this._rowGetter(rows[rowIndex]);
377
- if (dataRow && dataRow[this._selectionField]) {
378
+ if(dataRow && dataRow[this._selectionField]) {
378
379
  return rowIndex;
379
380
  }
380
381
  }
@@ -389,20 +390,20 @@ RowSelectionPlugin.prototype.getFirstSelectedIndex = function (sectRef) {
389
390
  * @return {number|null}
390
391
  */
391
392
  RowSelectionPlugin.prototype.getLastSelectedIndex = function (sectRef) {
392
- var section = this._getSection(sectRef);
393
- if (!section) {
393
+ let section = this._getSection(sectRef);
394
+ if(!section) {
394
395
  return null;
395
- } else if (this._basedOnContent) {
396
- var dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
397
- if (!dv) return null;
398
-
399
- var rids = dv.getVisibleRowIds(true);
400
- var rows = dv.getMultipleRowData(rids);
401
- var count = rows.length;
402
- var dataRow;
403
- for (var rowIndex = count - 1; rowIndex >= 0; rowIndex--) {
396
+ } else if(this._basedOnContent) {
397
+ let dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
398
+ if(!dv) return null;
399
+
400
+ let rids = dv.getVisibleRowIds(true);
401
+ let rows = dv.getMultipleRowData(rids);
402
+ let count = rows.length;
403
+ let dataRow;
404
+ for(let rowIndex = count - 1; rowIndex >= 0; rowIndex--) {
404
405
  dataRow = this._rowGetter(rows[rowIndex]);
405
- if (dataRow && dataRow[this._selectionField]) {
406
+ if(dataRow && dataRow[this._selectionField]) {
406
407
  return rowIndex;
407
408
  }
408
409
  }
@@ -418,21 +419,21 @@ RowSelectionPlugin.prototype.getLastSelectedIndex = function (sectRef) {
418
419
  * @return {Array.<number>}
419
420
  */
420
421
  RowSelectionPlugin.prototype.getSelectedRows = function (sectRef) {
421
- var section = this._getSection(sectRef);
422
- if (!section) {
422
+ let section = this._getSection(sectRef);
423
+ if(!section) {
423
424
  return null;
424
- } else if (this._basedOnContent) {
425
- var dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
426
- if (!dv) return null;
427
-
428
- var rids = dv.getVisibleRowIds(true);
429
- var rows = dv.getMultipleRowData(rids);
430
- var count = rows.length;
431
- var selectedRows = [];
432
- var dataRow;
433
- for (var rowIndex = 0; rowIndex < count; rowIndex++) {
425
+ } else if(this._basedOnContent) {
426
+ let dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
427
+ if(!dv) return null;
428
+
429
+ let rids = dv.getVisibleRowIds(true);
430
+ let rows = dv.getMultipleRowData(rids);
431
+ let count = rows.length;
432
+ let selectedRows = [];
433
+ let dataRow;
434
+ for(let rowIndex = 0; rowIndex < count; rowIndex++) {
434
435
  dataRow = this._rowGetter(rows[rowIndex]);
435
- if (dataRow && dataRow[this._selectionField]) {
436
+ if(dataRow && dataRow[this._selectionField]) {
436
437
  selectedRows.push(rowIndex);
437
438
  }
438
439
  }
@@ -447,16 +448,16 @@ RowSelectionPlugin.prototype.getSelectedRows = function (sectRef) {
447
448
  * @return {Array.<string>}
448
449
  */
449
450
  RowSelectionPlugin.prototype.getSelectedRowIds = function (sectRef) {
450
- var rids = null;
451
- var len, i;
451
+ let rids = null;
452
+ let len, i;
452
453
 
453
- var selRows = this.getSelectedRows(sectRef);
454
- if (selRows) {
455
- var dv = this._activeGrid.getDataSource();
456
- var rowIds = dv.getVisibleRowIds(true);
454
+ let selRows = this.getSelectedRows(sectRef);
455
+ if(selRows) {
456
+ let dv = this._activeGrid.getDataSource();
457
+ let rowIds = dv.getVisibleRowIds(true);
457
458
  len = selRows.length;
458
459
  rids = new Array(len);
459
- for (i = 0; i < len; ++i) {
460
+ for(i = 0; i < len; ++i) {
460
461
  rids[i] = rowIds[selRows[i]] || "";
461
462
  }
462
463
  }
@@ -468,10 +469,10 @@ RowSelectionPlugin.prototype.getSelectedRowIds = function (sectRef) {
468
469
  * @return {number}
469
470
  */
470
471
  RowSelectionPlugin.prototype.getSelectedRowCount = function (sectRef) {
471
- var section = this._getSection(sectRef);
472
- if (!section) return 0;
473
- if (this._basedOnContent) {
474
- var selectedRows = this.getSelectedRows();
472
+ let section = this._getSection(sectRef);
473
+ if(!section) return 0;
474
+ if(this._basedOnContent) {
475
+ let selectedRows = this.getSelectedRows();
475
476
  return selectedRows ? selectedRows.length : 0;
476
477
  } else {
477
478
  return section.getSelectedRowCount();
@@ -483,8 +484,8 @@ RowSelectionPlugin.prototype.getSelectedRowCount = function (sectRef) {
483
484
  * @param {Object=} sectRef Grid SectionReference
484
485
  */
485
486
  RowSelectionPlugin.prototype.setSelectedRow = function (rowIndex, opt_select, sectRef) {
486
- var section = this._getSection(sectRef);
487
- if (!section) { return; }
487
+ let section = this._getSection(sectRef);
488
+ if(!section) { return; }
488
489
  this._sectionSetSelectedRow(section, rowIndex, opt_select);
489
490
  };
490
491
  /**
@@ -495,11 +496,11 @@ RowSelectionPlugin.prototype.setSelectedRow = function (rowIndex, opt_select, se
495
496
  * @return {boolean}
496
497
  */
497
498
  RowSelectionPlugin.prototype.selectSingleRow = function (rowIndex, sectRef, activeGrid) {
498
- if (!(rowIndex >= 0)) { return false; }
499
+ if(!(rowIndex >= 0)) { return false; }
499
500
 
500
501
  // 1. first of all let's clear selectedRows of prevGrid
501
- var prevGrid = activeGrid ? this._activeGrid : null;
502
- if (prevGrid) {
502
+ let prevGrid = activeGrid ? this._activeGrid : null;
503
+ if(prevGrid) {
503
504
  this._clearSelectedRows();
504
505
 
505
506
  // 2. after clear selection let switch active grid
@@ -507,14 +508,14 @@ RowSelectionPlugin.prototype.selectSingleRow = function (rowIndex, sectRef, acti
507
508
  }
508
509
 
509
510
  // 3. now active grid is switch let's normally select row
510
- var section = this._getSection(sectRef); // TODO: Check if the given section is in the active grid
511
- if (this._selectSingleRow(section, rowIndex)) {
511
+ let section = this._getSection(sectRef); // TODO: Check if the given section is in the active grid
512
+ if(this._selectSingleRow(section, rowIndex)) {
512
513
  this._scrollToRow(rowIndex);
513
514
  return true;
514
515
  }
515
516
  // 4. in case fail to perform _selectSingleRow
516
517
  // we will turn back _activeGrid to prevGrid
517
- else if (prevGrid) {
518
+ else if(prevGrid) {
518
519
  this._activeGrid = prevGrid;
519
520
  }
520
521
 
@@ -524,17 +525,17 @@ RowSelectionPlugin.prototype.selectSingleRow = function (rowIndex, sectRef, acti
524
525
  * @param {Object=} activeGrid core grid instance
525
526
  */
526
527
  RowSelectionPlugin.prototype.selectAllRows = function (activeGrid) {
527
- if (activeGrid) {
528
+ if(activeGrid) {
528
529
  this._activeGrid = activeGrid;
529
- } else if (!this._activeGrid) {
530
+ } else if(!this._activeGrid) {
530
531
  this._activeGrid = this._hosts[0];
531
532
  }
532
533
 
533
- if (this._activeGrid) {
534
- var sections = this._activeGrid.getAllSections("content");
535
- for (var i = sections.length; --i >= 0;) {
534
+ if(this._activeGrid) {
535
+ let sections = this._activeGrid.getAllSections("content");
536
+ for(let i = sections.length; --i >= 0;) {
536
537
  this._selectRowRange(null, null, sections[i]);
537
- if (i == 0) {
538
+ if(i == 0) {
538
539
  this._anchorSection = sections[i];
539
540
  }
540
541
  }
@@ -551,7 +552,7 @@ RowSelectionPlugin.prototype.selectAllRows = function (activeGrid) {
551
552
  RowSelectionPlugin.prototype.selectRowRange = function (rowIndex, length, sectRef, opt_scrollToRow) {
552
553
  this._selectRowRange(rowIndex, length, sectRef);
553
554
 
554
- if (opt_scrollToRow) {
555
+ if(opt_scrollToRow) {
555
556
  this._scrollToRow(rowIndex);
556
557
  }
557
558
  this._updateMenuIcon();
@@ -581,9 +582,9 @@ RowSelectionPlugin.prototype.disableMultiSelection = function (disabled) {
581
582
  * @param {Event} e
582
583
  */
583
584
  RowSelectionPlugin.prototype._onClick = function (e) {
584
- if (this._pendingClickIndex >= 0 && this._anchorSection) {
585
+ if(this._pendingClickIndex >= 0 && this._anchorSection) {
585
586
  this._selectSingleRow(this._anchorSection, this._pendingClickIndex);
586
- var host = this.getRelativeGrid(e);
587
+ let host = this.getRelativeGrid(e);
587
588
  this._clearPendingClickIndex(host);
588
589
 
589
590
  if(!this._basedOnContent) { // Protect against rowPositionChanged and postBindingSection event
@@ -599,7 +600,7 @@ RowSelectionPlugin.prototype._onClick = function (e) {
599
600
  * @param {Object=} mouseEvt
600
601
  */
601
602
  RowSelectionPlugin.prototype.selectByMouse = function (rowIndex, mouseEvt) {
602
- var eventObj = this._mockMouseEvent(0, rowIndex, mouseEvt);
603
+ let eventObj = this._mockMouseEvent(0, rowIndex, mouseEvt);
603
604
  this._onMouseDown(eventObj);
604
605
  };
605
606
 
@@ -610,7 +611,7 @@ RowSelectionPlugin.prototype.selectByMouse = function (rowIndex, mouseEvt) {
610
611
  * @param {Object=} keyboardEvt
611
612
  */
612
613
  RowSelectionPlugin.prototype.selectByKey = function (keyCode, keyboardEvt) {
613
- var eventObj = this._mockKeyboardEvent(keyCode, keyboardEvt);
614
+ let eventObj = this._mockKeyboardEvent(keyCode, keyboardEvt);
614
615
  this._onKeyDown(eventObj);
615
616
  };
616
617
 
@@ -624,71 +625,71 @@ RowSelectionPlugin.prototype.selectByKey = function (keyCode, keyboardEvt) {
624
625
  * @param {Event} e
625
626
  */
626
627
  RowSelectionPlugin.prototype._onMouseDown = function (e) {
627
- if (this._disabled) {
628
+ if(this._disabled) {
628
629
  return;
629
630
  }
630
- if (e.button === 2) { // Right click
631
- if (e.shiftKey || e.ctrlKey) {
631
+ if(e.button === 2) { // Right click
632
+ if(e.shiftKey || e.ctrlKey) {
632
633
  return;
633
634
  }
634
635
  }
635
636
 
636
- var host = this.getRelativeGrid(e);
637
+ let host = this.getRelativeGrid(e);
637
638
 
638
639
  this._clearPendingClickIndex(host);
639
640
 
640
- if (!host) {
641
+ if(!host) {
641
642
  return;
642
643
  }
643
644
 
644
- var ctx = host.getRelativePosition(e);
645
- if (!ctx["hit"] || ctx["sectionType"] !== "content") { return; }
646
- if (e.button === 2) { // Right click at the selected column should override clicking row to select;
647
- var csp = this._getPlugin("ColumnSelectionPlugin");
648
- if (csp && csp["isEnabled"]()) {
649
- if (csp["isSelectedColumn"](ctx["colIndex"])) {
645
+ let ctx = host.getRelativePosition(e);
646
+ if(!ctx["hit"] || ctx["sectionType"] !== "content") { return; }
647
+ if(e.button === 2) { // Right click at the selected column should override clicking row to select;
648
+ let csp = this._getPlugin("ColumnSelectionPlugin");
649
+ if(csp && csp["isEnabled"]()) {
650
+ if(csp["isSelectedColumn"](ctx["colIndex"])) {
650
651
  return;
651
652
  }
652
653
  }
653
654
  }
654
- var dv = ctx["dataSource"];
655
- var rowIndex = ctx["rowIndex"];
656
- if (this._basedOnContent) {
655
+ let dv = ctx["dataSource"];
656
+ let rowIndex = ctx["rowIndex"];
657
+ if(this._basedOnContent) {
657
658
  // ignore group header row
658
- var dataRow = this._getRow(dv, rowIndex);
659
- if (!dataRow) {
659
+ let dataRow = this._getRow(dv, rowIndex);
660
+ if(!dataRow) {
660
661
  return;
661
662
  }
662
663
  }
663
664
 
664
- if (this._dispatchBeforeSelection(e, ctx)) {
665
+ if(this._dispatchBeforeSelection(e, ctx)) {
665
666
  return;
666
667
  }
667
668
 
668
- var singleSelection = this._singleSelMode || !this._activeGrid || (this._activeGrid !== host); // New grid is clicked
669
- var section = ctx["section"];
670
- var prevSel = section.isSelectedRow(rowIndex);
669
+ let singleSelection = this._singleSelMode || !this._activeGrid || (this._activeGrid !== host); // New grid is clicked
670
+ let section = ctx["section"];
671
+ let prevSel = section.isSelectedRow(rowIndex);
671
672
 
672
- if (!singleSelection) {
673
- if (e.shiftKey) { // Shift + Click: selects every rows start from anchor to clicked point. Anchor point doesn't change.
673
+ if(!singleSelection) {
674
+ if(e.shiftKey) { // Shift + Click: selects every rows start from anchor to clicked point. Anchor point doesn't change.
674
675
  this._selectFromAnchorToTarget(section, rowIndex);
675
- } else if ((e.ctrlKey && !isMac) || (isMac && !e.ctrlKey && e.metaKey)) { // Ctrl(windows)/Command(macOS) + Click: additionally selects a row without deselect all others.
676
+ } else if((e.ctrlKey && !IS_MAC) || (IS_MAC && !e.ctrlKey && e.metaKey)) { // Ctrl(windows)/Command(macOS) + Click: additionally selects a row without deselect all others.
676
677
  this._sectionSetSelectedRow(section, rowIndex, !prevSel);
677
678
  } else {
678
679
  singleSelection = true;
679
680
  }
680
681
  }
681
682
 
682
- if (singleSelection) { // Click: selects a single row
683
+ if(singleSelection) { // Click: selects a single row
683
684
  this._anchorSection = section;
684
- if (prevSel) { // Click on the selected row
685
+ if(prevSel) { // Click on the selected row
685
686
  this._setPendingClickIndex(rowIndex, host); // Delay the operation to allow drag and drop operation
686
687
  return;
687
688
  } else { // Perform single click immediately
688
- var prevGrid = this._activeGrid;
689
+ let prevGrid = this._activeGrid;
689
690
 
690
691
  // clear selection row in prevGrid first if prev and current host not the same
691
- if (prevGrid !== host) {
692
+ if(prevGrid !== host) {
692
693
  this._clearSelectedRows(true);
693
694
  this._activeGrid = host;
694
695
  }
@@ -714,7 +715,7 @@ RowSelectionPlugin.prototype._onMouseDown = function (e) {
714
715
  * @param {Event} e
715
716
  */
716
717
  RowSelectionPlugin.prototype._onMouseMove = function (e) {
717
- var host = this.getRelativeGrid(e);
718
+ let host = this.getRelativeGrid(e);
718
719
  this._clearPendingClickIndex(host);
719
720
  };
720
721
 
@@ -741,7 +742,7 @@ RowSelectionPlugin.prototype._clearPendingClickIndex = function (host) {
741
742
  * @param {KeyboardEvent} e
742
743
  */
743
744
  RowSelectionPlugin.prototype._onKeyDown = function (e) {
744
- if (!this._activeGrid) { return; }
745
+ if(!this._activeGrid) { return; }
745
746
 
746
747
  //Arrow Up/Down move a row selection up/down by one.
747
748
  //Arrow Up/Down and shift additionally select a row that is the one before first or after last selected row.
@@ -761,10 +762,10 @@ RowSelectionPlugin.prototype._onKeyDown = function (e) {
761
762
  this._selectByKey(-1, e, true);
762
763
  break;
763
764
  case 37: //Left arrow
764
- if (this._dispatchBeforeSelection(e)) {
765
+ if(this._dispatchBeforeSelection(e)) {
765
766
  return;
766
767
  }
767
- if (this._gotoPrevGrid()) {
768
+ if(this._gotoPrevGrid()) {
768
769
  EventDispatcher.preventDefault(e);
769
770
  }
770
771
  break;
@@ -772,10 +773,10 @@ RowSelectionPlugin.prototype._onKeyDown = function (e) {
772
773
  this._selectByKey(-1, e);
773
774
  break;
774
775
  case 39: //Right arrow
775
- if (this._dispatchBeforeSelection(e)) {
776
+ if(this._dispatchBeforeSelection(e)) {
776
777
  return;
777
778
  }
778
- if (this._gotoNextGrid()) {
779
+ if(this._gotoNextGrid()) {
779
780
  EventDispatcher.preventDefault(e);
780
781
  }
781
782
  break;
@@ -803,7 +804,7 @@ RowSelectionPlugin.prototype._onReselection = function (e) {
803
804
  this._timerId = 0;
804
805
 
805
806
  if(this._pendingSelection != null) {
806
- var firstSel = this.getFirstSelectedIndex();
807
+ let firstSel = this.getFirstSelectedIndex();
807
808
  if(firstSel == null) { // Only perform reselection if the last selection has been removed
808
809
  this.setSelectedRow(this._pendingSelection, true);
809
810
  }
@@ -812,45 +813,25 @@ RowSelectionPlugin.prototype._onReselection = function (e) {
812
813
  this._pendingSelection = null;
813
814
  };
814
815
 
815
- /** @private
816
- * @param {Event} e
817
- */
818
- RowSelectionPlugin.prototype._onCopy = function (e) {
819
- var clipboardData, format;
820
- if (e.clipboardData) {
821
- clipboardData = e.clipboardData;
822
- format = "text/plain";
823
- } else {
824
- clipboardData = window.clipboardData;
825
- format = "Text";
826
- }
827
- // Set clipboards data to copy api.
828
- var txt = this.getSelectedText();
829
- if (txt) {
830
- clipboardData.setData(format, txt);
831
- }
832
- e.preventDefault();
833
- };
834
-
835
816
  /** @private
836
817
  * @param {Object} e postSectionDataBinding event context
837
818
  */
838
819
  RowSelectionPlugin.prototype._onPostSectionDataBinding = function (e) {
839
- if (!this._basedOnContent
820
+ if(!this._basedOnContent
840
821
  || "content" !== e.sectionType
841
822
  || !this._activeGrid) {
842
823
  return;
843
824
  }
844
- var section = e.section;
845
- var dv = e.dataSource;
825
+ let section = e.section;
826
+ let dv = e.dataSource;
846
827
 
847
- var field = this._selectionField;
828
+ let field = this._selectionField;
848
829
  section.clearSelectedRows();
849
830
 
850
- var fromR = section.getFirstIndexInView();
851
- var toR = section.getLastIndexInView();
852
- for (var r = fromR; r <= toR; ++r) {
853
- var dataRow = this._rowGetter(dv.getRowDataAt(r));
831
+ let fromR = section.getFirstIndexInView();
832
+ let toR = section.getLastIndexInView();
833
+ for(let r = fromR; r <= toR; ++r) {
834
+ let dataRow = this._rowGetter(dv.getRowDataAt(r));
854
835
  if(dataRow) {
855
836
  if(dataRow[field]) {
856
837
  section.setSelectedRow(r, true);
@@ -881,25 +862,25 @@ RowSelectionPlugin.prototype._onRowPositionChanged = function (e) {
881
862
  */
882
863
  RowSelectionPlugin.prototype.getSelectedText = function () {
883
864
  // work only with composit and realtime
884
- if (!this._compositeGrid && !this._realTimeGrid) return "";
865
+ if(!this._compositeGrid && !this._realTimeGrid) return "";
885
866
 
886
- var selectedRows = this.getSelectedRows();
887
- var rowCount = selectedRows.length;
888
- var columnCount = this.getColumnCount();
889
- var text = "";
890
- var dv = this._activeGrid.getDataSource();
891
- for (var i = 0; i < rowCount; i++) {
892
- var rowIndex = selectedRows[i];
893
- var rowData = this._getRow(dv, rowIndex);
867
+ let selectedRows = this.getSelectedRows();
868
+ let rowCount = selectedRows.length;
869
+ let columnCount = this.getColumnCount();
870
+ let text = "";
871
+ let dv = this._activeGrid.getDataSource();
872
+ for(let i = 0; i < rowCount; i++) {
873
+ let rowIndex = selectedRows[i];
874
+ let rowData = this._getRow(dv, rowIndex);
894
875
 
895
- if (rowData) {
896
- if (text.length) text += "\n"; // break line before write in case text has content
876
+ if(rowData) {
877
+ if(text.length) text += "\n"; // break line before write in case text has content
897
878
 
898
879
  // data row
899
- for (var colIndex = 0; colIndex < columnCount; colIndex++) {
900
- if (colIndex > 0) text += "\t"; // separate each cell content with tab
880
+ for(let colIndex = 0; colIndex < columnCount; colIndex++) {
881
+ if(colIndex > 0) text += "\t"; // separate each cell content with tab
901
882
  // column fields are available on compositeGrid and realTimeGrid level
902
- var cField = this._getField(colIndex);
883
+ let cField = this._getField(colIndex);
903
884
  text += prepareTSVContent(rowData[cField]);
904
885
  }
905
886
  }
@@ -912,21 +893,21 @@ RowSelectionPlugin.prototype.getSelectedText = function () {
912
893
  * @return {Object} ILayoutGrid
913
894
  */
914
895
  RowSelectionPlugin.prototype._getSection = function (sectRef) {
915
- if (!this._activeGrid) {
896
+ if(!this._activeGrid) {
916
897
  this._activeGrid = this._hosts[0];
917
- if (this._activeGrid) {
898
+ if(this._activeGrid) {
918
899
  this._anchorSection = this._activeGrid.getSection("content");
919
- if (!this._anchorSection) {
900
+ if(!this._anchorSection) {
920
901
  this._activeGrid = null;
921
902
  }
922
903
  }
923
904
  }
924
- if (sectRef) {
905
+ if(sectRef) {
925
906
  return this._activeGrid.getSection(sectRef);
926
907
  }
927
908
 
928
- if (this._anchorSection) {
929
- if (!this._anchorSection.getElement()) { // The section may has been disposed.
909
+ if(this._anchorSection) {
910
+ if(!this._anchorSection.getElement()) { // The section may has been disposed.
930
911
  this._anchorSection = null;
931
912
  }
932
913
  }
@@ -938,23 +919,23 @@ RowSelectionPlugin.prototype._getSection = function (sectRef) {
938
919
  * @param {boolean=} preserveAnchor
939
920
  */
940
921
  RowSelectionPlugin.prototype._clearSelectedRows = function (preserveAnchor) { // Slow
941
- if (!this._activeGrid) {
922
+ if(!this._activeGrid) {
942
923
  return;
943
924
  }
944
- if (this._basedOnContent) {
945
- var dv = this._activeGrid.getDataSource();
946
- if (dv) {
947
- var dt = dv.getDataSource();
925
+ if(this._basedOnContent) {
926
+ let dv = this._activeGrid.getDataSource();
927
+ if(dv) {
928
+ let dt = dv.getDataSource();
948
929
  this._setColumnData(dt, this._selectionField, false);
949
930
  }
950
931
  } else {
951
- var sections = this._activeGrid.getAllSections("content");
952
- for (var i = sections.length; --i >= 0;) {
932
+ let sections = this._activeGrid.getAllSections("content");
933
+ for(let i = sections.length; --i >= 0;) {
953
934
  this._sectionClearSelectedRows(sections[i], preserveAnchor);
954
935
  }
955
936
  }
956
937
 
957
- if (!preserveAnchor) {
938
+ if(!preserveAnchor) {
958
939
  this._anchorSection = null;
959
940
  }
960
941
  this._clearPendingClickIndex(this._activeGrid);
@@ -969,38 +950,38 @@ RowSelectionPlugin.prototype._clearSelectedRows = function (preserveAnchor) { //
969
950
  RowSelectionPlugin.prototype._selectByKey = function (direction, e, pageKey) {
970
951
  e.preventDefault();
971
952
 
972
- if (!this._anchorSection) { return; }
953
+ if(!this._anchorSection) { return; }
973
954
 
974
955
  if(this._activeGrid != null){
975
956
  this._activeGrid.focus();
976
957
  }
977
958
 
978
- var shiftKey = e.shiftKey;
979
- var next = 0;
980
- var rowLimit = this._anchorSection.getRowCount() - 1;
981
- if (pageKey) {
982
- var info = this._activeGrid.getVScrollView();
983
- if (direction === -1) { // Up
984
- if (info) {
959
+ let shiftKey = e.shiftKey;
960
+ let next = 0;
961
+ let rowLimit = this._anchorSection.getRowCount() - 1;
962
+ if(pageKey) {
963
+ let info = this._activeGrid.getVScrollView();
964
+ if(direction === -1) { // Up
965
+ if(info) {
985
966
  next = this.getFirstSelectedIndex(this._anchorSection) <= info["firstFullRow"] ? info["prevPageRowIndex"] : info["firstFullRow"];
986
967
  }
987
968
  } else {
988
- if (info) {
969
+ if(info) {
989
970
  next = this.getLastSelectedIndex(this._anchorSection) >= info["lastFullRow"] ? info["nextPageRowIndex"] : info["lastFullRow"];
990
971
  } else {
991
972
  next = rowLimit;
992
973
  }
993
974
  }
994
975
  } else {
995
- if (direction === -1) {
976
+ if(direction === -1) {
996
977
  next = this.getFirstSelectedIndex(this._anchorSection) + direction;
997
978
  } else {
998
979
  next = this.getLastSelectedIndex(this._anchorSection) + direction;
999
980
  }
1000
981
  }
1001
- if (next < 0) {
1002
- var csp = this._getPlugin("ColumnSelectionPlugin");
1003
- if (!shiftKey && csp && csp["isEnabled"]()) {
982
+ if(next < 0) {
983
+ let csp = this._getPlugin("ColumnSelectionPlugin");
984
+ if(!shiftKey && csp && csp["isEnabled"]()) {
1004
985
  csp["selectSingleColumn"](null, this._activeGrid);
1005
986
 
1006
987
  this.clearAllSelections();
@@ -1008,16 +989,16 @@ RowSelectionPlugin.prototype._selectByKey = function (direction, e, pageKey) {
1008
989
  }
1009
990
  this._scrollToRow(0);
1010
991
  return;
1011
- } else if (next > rowLimit) {
992
+ } else if(next > rowLimit) {
1012
993
  this._scrollToRow(rowLimit);
1013
994
  return;
1014
995
  }
1015
996
 
1016
- if (this._dispatchBeforeSelection(e)) {
997
+ if(this._dispatchBeforeSelection(e)) {
1017
998
  return;
1018
999
  }
1019
1000
 
1020
- if (shiftKey && !this._singleSelMode) {
1001
+ if(shiftKey && !this._singleSelMode) {
1021
1002
  this._selectFromAnchorToTarget(this._anchorSection, next);
1022
1003
  } else {
1023
1004
  this._selectSingleRow(this._anchorSection, next);
@@ -1036,14 +1017,14 @@ RowSelectionPlugin.prototype._selectByKey = function (direction, e, pageKey) {
1036
1017
  */
1037
1018
  RowSelectionPlugin.prototype._sectionSetSelectedRow = function (section, rowIndex, isSelect) {
1038
1019
  // set selection state to rowData when _basedOnContent === true
1039
- if (this._basedOnContent) {
1040
- var dv = (this._activeGrid) ? this._activeGrid.getDataSource() : null;
1020
+ if(this._basedOnContent) {
1021
+ let dv = (this._activeGrid) ? this._activeGrid.getDataSource() : null;
1041
1022
 
1042
- if (dv) {
1043
- var dataRow = this._getRow(dv, rowIndex);
1044
- if (dataRow) {
1023
+ if(dv) {
1024
+ let dataRow = this._getRow(dv, rowIndex);
1025
+ if(dataRow) {
1045
1026
  this._setData(dv, rowIndex, this._selectionField, isSelect);
1046
- if (isSelect) this._anchorRowId = dv.getRowId(rowIndex);
1027
+ if(isSelect) this._anchorRowId = dv.getRowId(rowIndex);
1047
1028
  }
1048
1029
  }
1049
1030
  } else {
@@ -1061,23 +1042,23 @@ RowSelectionPlugin.prototype._selectRangeOnSection = function (section, rowIndex
1061
1042
  if(rowIndex == null) {
1062
1043
  rowIndex = 0;
1063
1044
  }
1064
- if (this._basedOnContent) { // TODO: handle the case where section is not content section
1065
- var dv = (this._activeGrid) ? this._activeGrid.getDataSource() : null;
1045
+ if(this._basedOnContent) { // TODO: handle the case where section is not content section
1046
+ let dv = (this._activeGrid) ? this._activeGrid.getDataSource() : null;
1066
1047
 
1067
- if (dv) {
1068
- var rids = dv.getVisibleRowIds(true);
1048
+ if(dv) {
1049
+ let rids = dv.getVisibleRowIds(true);
1069
1050
  if(length == null) {
1070
1051
  length = rids.length;
1071
1052
  }
1072
- var toRowIndex = rowIndex + length;
1053
+ let toRowIndex = rowIndex + length;
1073
1054
  if(toRowIndex > rids.length) {
1074
1055
  toRowIndex = rids.length;
1075
1056
  }
1076
- var ridList = [];
1077
- var valueList = [];
1078
- for (var r = rowIndex; r < toRowIndex; r++) {
1079
- var dataRow = this._getRow(dv, r);
1080
- if (dataRow) {
1057
+ let ridList = [];
1058
+ let valueList = [];
1059
+ for(let r = rowIndex; r < toRowIndex; r++) {
1060
+ let dataRow = this._getRow(dv, r);
1061
+ if(dataRow) {
1081
1062
  ridList.push(rids[r]);
1082
1063
  valueList.push(true);
1083
1064
  }
@@ -1098,20 +1079,20 @@ RowSelectionPlugin.prototype._selectRangeOnSection = function (section, rowIndex
1098
1079
  * @param {boolean=} preserveAnchor
1099
1080
  */
1100
1081
  RowSelectionPlugin.prototype._sectionClearSelectedRows = function (section, preserveAnchor) {
1101
- if (this._basedOnContent) {
1102
- var selectedRowIds = this.getSelectedRowIds();
1103
- if (selectedRowIds) {
1104
- var dv = (this._activeGrid) ? this._activeGrid.getDataSource() : null;
1105
- if (dv) {
1106
- var len = selectedRowIds.length;
1107
- var valueList = new Array(len);
1108
- for (var i = 0; i < len; i++) {
1082
+ if(this._basedOnContent) {
1083
+ let selectedRowIds = this.getSelectedRowIds();
1084
+ if(selectedRowIds) {
1085
+ let dv = (this._activeGrid) ? this._activeGrid.getDataSource() : null;
1086
+ if(dv) {
1087
+ let len = selectedRowIds.length;
1088
+ let valueList = new Array(len);
1089
+ for(let i = 0; i < len; i++) {
1109
1090
  valueList[i] = false;
1110
1091
  }
1111
1092
  this._setColumnData(dv, this._selectionField, valueList, selectedRowIds);
1112
1093
  }
1113
1094
  }
1114
- if (!preserveAnchor) {
1095
+ if(!preserveAnchor) {
1115
1096
  this._anchorRowId = "";
1116
1097
  }
1117
1098
  } else {
@@ -1126,7 +1107,7 @@ RowSelectionPlugin.prototype._sectionClearSelectedRows = function (section, pres
1126
1107
  * @return {boolean}
1127
1108
  */
1128
1109
  RowSelectionPlugin.prototype._selectSingleRow = function (section, rowIndex) {
1129
- if (!section) { return false; }
1110
+ if(!section) { return false; }
1130
1111
 
1131
1112
  this._clearSelectedRows(); // Deselect all rows
1132
1113
  this._sectionSetSelectedRow(section, rowIndex, true); // The anchor row is set
@@ -1142,40 +1123,40 @@ RowSelectionPlugin.prototype._updateMenuIcon = function () {
1142
1123
  if(!this._onMenuClicked) {
1143
1124
  return false;
1144
1125
  }
1145
- var host = this._activeGrid;
1146
- var startRowIndex = this.getFirstSelectedIndex();
1126
+ let host = this._activeGrid;
1127
+ let startRowIndex = this.getFirstSelectedIndex();
1147
1128
  if(startRowIndex == null || !host) { // have no selected rows
1148
1129
  return false;
1149
1130
  }
1150
- var endRowIndex = this.getLastSelectedIndex();
1151
- var parentEl = host.getParent().parentNode;
1131
+ let endRowIndex = this.getLastSelectedIndex();
1132
+ let parentEl = host.getParent().parentNode;
1152
1133
 
1153
1134
  if(!this._menuButton) {
1154
1135
  this._menuButton = document.createElement("div");
1155
1136
  this._menuButton.classList.add("row-selection-menu");
1156
1137
  this._menuButton.addEventListener("click", this._onMenuClicked);
1157
- var coralIcon = document.createElement("ef-icon");
1138
+ let coralIcon = document.createElement("ef-icon");
1158
1139
  coralIcon.icon = "most-detail";
1159
1140
  this._menuButton.appendChild(coralIcon);
1160
1141
  }
1161
1142
 
1162
1143
  parentEl.appendChild(this._menuButton);
1163
1144
 
1164
- var menuIconSize = 28; // Currently support 28 and 24 pixel only
1165
- var rowRect = host.getRowRect(startRowIndex, endRowIndex);
1145
+ let menuIconSize = 28; // Currently support 28 and 24 pixel only
1146
+ let rowRect = host.getRowRect(startRowIndex, endRowIndex);
1166
1147
 
1167
1148
  if( rowRect.scrollViewSize <= rowRect.top || rowRect.height + rowRect.top <= 0) { // hide icon when have no selection in view both left and right
1168
1149
  this._clearMenuIcon();
1169
1150
  return false;
1170
1151
  }
1171
1152
 
1172
- var leftOffset = rowRect.left + rowRect.width;
1173
- var topOffset = rowRect.top + rowRect.scrollViewTop;
1153
+ let leftOffset = rowRect.left + rowRect.width;
1154
+ let topOffset = rowRect.top + rowRect.scrollViewTop;
1174
1155
  if(this._menuPosition !== "outside") {
1175
1156
  menuIconSize = 24;
1176
1157
  this._menuButton.classList.add("row-selection-menu-inside");
1177
1158
  leftOffset = rowRect.left + rowRect.width - menuIconSize;
1178
- topOffset = rowRect.top + rowRect.scrollViewTop - menuIconSize;
1159
+ topOffset = rowRect.top + rowRect.scrollViewTop - menuIconSize;
1179
1160
 
1180
1161
  if(rowRect.top < menuIconSize) {
1181
1162
  topOffset = rowRect.top + rowRect.scrollViewTop;
@@ -1208,8 +1189,8 @@ RowSelectionPlugin.prototype._clearMenuIcon = function () {
1208
1189
  * @param {Object=} sectRef Grid SectionReference
1209
1190
  */
1210
1191
  RowSelectionPlugin.prototype._selectRowRange = function (rowIndex, length, sectRef) {
1211
- var section = this._getSection(sectRef);
1212
- if (section) {
1192
+ let section = this._getSection(sectRef);
1193
+ if(section) {
1213
1194
  this._selectRangeOnSection(section, rowIndex, length);
1214
1195
  }
1215
1196
  };
@@ -1219,23 +1200,23 @@ RowSelectionPlugin.prototype._selectRowRange = function (rowIndex, length, sectR
1219
1200
  * @param {number} rowIndex
1220
1201
  */
1221
1202
  RowSelectionPlugin.prototype._selectFromAnchorToTarget = function (section, rowIndex) {
1222
- if (this._anchorSection === section) {
1223
- var anchorRow = this.getRowAnchor(this._anchorSection);
1224
- if (anchorRow !== rowIndex) {
1203
+ if(this._anchorSection === section) {
1204
+ let anchorRow = this.getRowAnchor(this._anchorSection);
1205
+ if(anchorRow !== rowIndex) {
1225
1206
  this._clearSelectedRows(true); // Keep anchor section
1226
1207
 
1227
1208
  // WORKAROUND: To support negative count
1228
- var direction = 1; // down
1229
- var startingRow = anchorRow;
1230
- var selectionCount = rowIndex - anchorRow;
1231
- if (selectionCount < 0) {
1209
+ let direction = 1; // down
1210
+ let startingRow = anchorRow;
1211
+ let selectionCount = rowIndex - anchorRow;
1212
+ if(selectionCount < 0) {
1232
1213
  direction = -1; // up
1233
1214
  startingRow = rowIndex;
1234
1215
  }
1235
1216
 
1236
1217
  this._selectRangeOnSection(section, startingRow, (selectionCount * direction) + 1);
1237
1218
 
1238
- if (!this._basedOnContent && this._anchorSection.setRowAnchor) {
1219
+ if(!this._basedOnContent && this._anchorSection.setRowAnchor) {
1239
1220
  //Make sure that the anchor stays at the same position
1240
1221
  this._anchorSection.setRowAnchor(anchorRow);
1241
1222
  }
@@ -1247,13 +1228,13 @@ RowSelectionPlugin.prototype._selectFromAnchorToTarget = function (section, rowI
1247
1228
  * @return {boolean}
1248
1229
  */
1249
1230
  RowSelectionPlugin.prototype._gotoPrevGrid = function () {
1250
- if (!this._activeGrid) { return false; }
1231
+ if(!this._activeGrid) { return false; }
1251
1232
 
1252
- if (this._activeGrid === this._hosts[0]) { // This is the first grid
1233
+ if(this._activeGrid === this._hosts[0]) { // This is the first grid
1253
1234
  return false;
1254
1235
  } else {
1255
- var curIndex = this._hosts.indexOf(this._activeGrid);
1256
- if (curIndex > 0) {
1236
+ let curIndex = this._hosts.indexOf(this._activeGrid);
1237
+ if(curIndex > 0) {
1257
1238
  this._gotoGrid(curIndex - 1);
1258
1239
  return true;
1259
1240
  }
@@ -1264,14 +1245,14 @@ RowSelectionPlugin.prototype._gotoPrevGrid = function () {
1264
1245
  * @return {boolean}
1265
1246
  */
1266
1247
  RowSelectionPlugin.prototype._gotoNextGrid = function () {
1267
- if (!this._activeGrid) { return false; }
1248
+ if(!this._activeGrid) { return false; }
1268
1249
 
1269
- var lastIndex = this._hosts.length - 1;
1270
- if (this._activeGrid === this._hosts[lastIndex]) { // This is the last grid
1250
+ let lastIndex = this._hosts.length - 1;
1251
+ if(this._activeGrid === this._hosts[lastIndex]) { // This is the last grid
1271
1252
  return false;
1272
1253
  } else {
1273
- var curIndex = this._hosts.indexOf(this._activeGrid);
1274
- if (curIndex >= 0) {
1254
+ let curIndex = this._hosts.indexOf(this._activeGrid);
1255
+ if(curIndex >= 0) {
1275
1256
  this._gotoGrid(curIndex + 1);
1276
1257
  return true;
1277
1258
  }
@@ -1282,8 +1263,8 @@ RowSelectionPlugin.prototype._gotoNextGrid = function () {
1282
1263
  * @param {number} gridIndex
1283
1264
  */
1284
1265
  RowSelectionPlugin.prototype._gotoGrid = function (gridIndex) {
1285
- var anchorRow = this.getRowAnchor(this._anchorSection);
1286
- var sectionIndex = this._anchorSection.getIndex();
1266
+ let anchorRow = this.getRowAnchor(this._anchorSection);
1267
+ let sectionIndex = this._anchorSection.getIndex();
1287
1268
  this.clearSelectedRows(); // Clear all current grid's selections
1288
1269
  this.selectSingleRow(anchorRow, sectionIndex, this._hosts[gridIndex]); // go to the next grid at the first column
1289
1270
  if(this._activeGrid != null){
@@ -1295,8 +1276,8 @@ RowSelectionPlugin.prototype._gotoGrid = function (gridIndex) {
1295
1276
  * @param {number} rowIndex
1296
1277
  */
1297
1278
  RowSelectionPlugin.prototype._scrollToRow = function (rowIndex) {
1298
- var host = this._hosts[0];
1299
- if (host) {
1279
+ let host = this._hosts[0];
1280
+ if(host) {
1300
1281
  host.scrollToRow(null, rowIndex);
1301
1282
  }
1302
1283
  };
@@ -1308,14 +1289,14 @@ RowSelectionPlugin.prototype._scrollToRow = function (rowIndex) {
1308
1289
  * @return {boolean} return rather clients prefer cancel selection or not
1309
1290
  */
1310
1291
  RowSelectionPlugin.prototype._dispatchBeforeSelection = function (e, ctx) {
1311
- if (this.hasListener("beforeSelection")) {
1312
- if (!ctx) {
1313
- var grid = this._activeGrid || this._hosts[0];
1292
+ if(this.hasListener("beforeSelection")) {
1293
+ if(!ctx) {
1294
+ let grid = this._activeGrid || this._hosts[0];
1314
1295
  ctx = grid ? grid.getRelativePosition(e) : {};
1315
1296
  }
1316
1297
  ctx["event"] = e;
1317
1298
  this._dispatch("beforeSelection", ctx); // Ask clients if they want to cancel this event
1318
- if (ctx["cancel"]) {
1299
+ if(ctx["cancel"]) {
1319
1300
  return true; // return true if clients want to cancel this event
1320
1301
  }
1321
1302
  }
@@ -1328,23 +1309,23 @@ RowSelectionPlugin.prototype._dispatchBeforeSelection = function (e, ctx) {
1328
1309
  * @param {Object=} section ILayoutGrid
1329
1310
  */
1330
1311
  RowSelectionPlugin.prototype._dispatchSelectionChanged = function (e, rowIndex, section) {
1331
- if (this._activeGrid) {
1332
- var csp = this._getPlugin("ColumnSelectionPlugin");
1333
- if (csp && csp["isEnabled"]()) {
1312
+ if(this._activeGrid) {
1313
+ let csp = this._getPlugin("ColumnSelectionPlugin");
1314
+ if(csp && csp["isEnabled"]()) {
1334
1315
  csp["clearSelection"]();
1335
1316
  }
1336
- var cep = this._getPlugin("CellEditingPlugin");
1337
- if (cep) {
1317
+ let cep = this._getPlugin("CellEditingPlugin");
1318
+ if(cep) {
1338
1319
  cep.closeCellEditor();
1339
1320
  }
1340
1321
  cep = this._getPlugin("InCellEditingPlugin");
1341
- if (cep) {
1322
+ if(cep) {
1342
1323
  cep.closeCellEditor();
1343
1324
  }
1344
1325
  }
1345
1326
 
1346
- if (this.hasListener("selectionChanged")) {
1347
- var obj = {};
1327
+ if(this.hasListener("selectionChanged")) {
1328
+ let obj = {};
1348
1329
  obj["selectedRows"] = this.getSelectedRows();
1349
1330
  obj["rowIndex"] = (rowIndex != null) ? rowIndex : this.getRowAnchor(this._anchorSection);
1350
1331
  obj["section"] = (section != null) ? section : this._anchorSection;