tabulator-tables 5.3.1 → 5.3.4

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.
Files changed (40) hide show
  1. package/bower.json +1 -1
  2. package/dist/css/tabulator_bootstrap3.css +1 -1
  3. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  4. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  5. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  6. package/dist/css/tabulator_bootstrap4.css +4 -4
  7. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  8. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  9. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  10. package/dist/css/tabulator_bootstrap5.css +4 -4
  11. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  13. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  14. package/dist/js/tabulator.js +225 -216
  15. package/dist/js/tabulator.js.map +1 -1
  16. package/dist/js/tabulator.min.js +2 -2
  17. package/dist/js/tabulator.min.js.map +1 -1
  18. package/dist/js/tabulator_esm.js +379 -377
  19. package/dist/js/tabulator_esm.js.map +1 -1
  20. package/dist/js/tabulator_esm.min.js +2 -2
  21. package/dist/js/tabulator_esm.min.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/js/core/ColumnManager.js +7 -3
  24. package/src/js/core/Module.js +54 -23
  25. package/src/js/core/RowManager.js +81 -94
  26. package/src/js/core/Tabulator.js +2 -2
  27. package/src/js/core/tools/InteractionMonitor.js +9 -8
  28. package/src/js/modules/DataTree/DataTree.js +0 -10
  29. package/src/js/modules/FrozenRows/FrozenRows.js +3 -2
  30. package/src/js/modules/GroupRows/Group.js +3 -7
  31. package/src/js/modules/GroupRows/GroupComponent.js +1 -1
  32. package/src/js/modules/GroupRows/GroupRows.js +200 -200
  33. package/src/js/modules/Interaction/Interaction.js +1 -1
  34. package/src/js/modules/Page/Page.js +2 -12
  35. package/src/js/modules/Persistence/Persistence.js +3 -2
  36. package/src/js/modules/SelectRow/SelectRow.js +8 -4
  37. package/src/js/modules/Sort/Sort.js +4 -7
  38. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +1 -1
  39. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +1 -1
  40. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +1 -1
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.3.1 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.3.4 (c) Oliver Folkerd 2022 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -3325,6 +3325,7 @@
3325
3325
  var minHeight = 0;
3326
3326
 
3327
3327
  if (!this.redrawBlock) {
3328
+ this.headersElement.style.height = "";
3328
3329
  this.columns.forEach(function (column) {
3329
3330
  column.clearVerticalAlign();
3330
3331
  });
@@ -3335,6 +3336,7 @@
3335
3336
  minHeight = height;
3336
3337
  }
3337
3338
  });
3339
+ this.headersElement.style.height = minHeight + "px";
3338
3340
  this.columns.forEach(function (column) {
3339
3341
  column.verticalAlign(_this3.table.options.columnHeaderVertAlign, minHeight);
3340
3342
  });
@@ -3479,13 +3481,13 @@
3479
3481
  }, {
3480
3482
  key: "moveColumn",
3481
3483
  value: function moveColumn(from, to, after) {
3482
- this.moveColumnActual(from, to, after);
3483
3484
  to.element.parentNode.insertBefore(from.element, to.element);
3484
3485
 
3485
3486
  if (after) {
3486
3487
  to.element.parentNode.insertBefore(to.element, from.element);
3487
3488
  }
3488
3489
 
3490
+ this.moveColumnActual(from, to, after);
3489
3491
  this.verticalAlignHeaders();
3490
3492
  this.table.rowManager.reinitialize();
3491
3493
  }
@@ -5692,80 +5694,82 @@
5692
5694
  index = 0,
5693
5695
  cascadeOrder = ["all", "dataPipeline", "display", "displayPipeline", "end"];
5694
5696
 
5695
- if (typeof handler === "function") {
5696
- index = this.dataPipeline.findIndex(function (item) {
5697
- return item.handler === handler;
5698
- });
5699
-
5700
- if (index > -1) {
5701
- stage = "dataPipeline";
5702
-
5703
- if (skipStage) {
5704
- if (index == this.dataPipeline.length - 1) {
5705
- stage = "display";
5706
- } else {
5707
- index++;
5708
- }
5709
- }
5710
- } else {
5711
- index = this.displayPipeline.findIndex(function (item) {
5697
+ if (!this.table.destroyed) {
5698
+ if (typeof handler === "function") {
5699
+ index = this.dataPipeline.findIndex(function (item) {
5712
5700
  return item.handler === handler;
5713
5701
  });
5714
5702
 
5715
5703
  if (index > -1) {
5716
- stage = "displayPipeline";
5704
+ stage = "dataPipeline";
5717
5705
 
5718
5706
  if (skipStage) {
5719
- if (index == this.displayPipeline.length - 1) {
5720
- stage = "end";
5707
+ if (index == this.dataPipeline.length - 1) {
5708
+ stage = "display";
5721
5709
  } else {
5722
5710
  index++;
5723
5711
  }
5724
5712
  }
5725
5713
  } else {
5726
- console.error("Unable to refresh data, invalid handler provided", handler);
5727
- return;
5714
+ index = this.displayPipeline.findIndex(function (item) {
5715
+ return item.handler === handler;
5716
+ });
5717
+
5718
+ if (index > -1) {
5719
+ stage = "displayPipeline";
5720
+
5721
+ if (skipStage) {
5722
+ if (index == this.displayPipeline.length - 1) {
5723
+ stage = "end";
5724
+ } else {
5725
+ index++;
5726
+ }
5727
+ }
5728
+ } else {
5729
+ console.error("Unable to refresh data, invalid handler provided", handler);
5730
+ return;
5731
+ }
5728
5732
  }
5733
+ } else {
5734
+ stage = handler || "all";
5735
+ index = 0;
5729
5736
  }
5730
- } else {
5731
- stage = handler || "all";
5732
- index = 0;
5733
- }
5734
5737
 
5735
- if (this.redrawBlock) {
5736
- if (!this.redrawBlockRestoreConfig || this.redrawBlockRestoreConfig && (this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index || cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))) {
5737
- this.redrawBlockRestoreConfig = {
5738
- handler: handler,
5739
- skipStage: skipStage,
5740
- renderInPosition: renderInPosition,
5741
- stage: stage,
5742
- index: index
5743
- };
5744
- }
5738
+ if (this.redrawBlock) {
5739
+ if (!this.redrawBlockRestoreConfig || this.redrawBlockRestoreConfig && (this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index || cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))) {
5740
+ this.redrawBlockRestoreConfig = {
5741
+ handler: handler,
5742
+ skipStage: skipStage,
5743
+ renderInPosition: renderInPosition,
5744
+ stage: stage,
5745
+ index: index
5746
+ };
5747
+ }
5745
5748
 
5746
- return;
5747
- } else {
5748
- if (Helpers.elVisible(this.element)) {
5749
- if (renderInPosition) {
5750
- this.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));
5751
- } else {
5752
- this.refreshPipelines(handler, stage, index, renderInPosition);
5749
+ return;
5750
+ } else {
5751
+ if (Helpers.elVisible(this.element)) {
5752
+ if (renderInPosition) {
5753
+ this.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));
5754
+ } else {
5755
+ this.refreshPipelines(handler, stage, index, renderInPosition);
5753
5756
 
5754
- if (!handler) {
5755
- this.table.columnManager.renderer.renderColumns();
5756
- }
5757
+ if (!handler) {
5758
+ this.table.columnManager.renderer.renderColumns();
5759
+ }
5757
5760
 
5758
- this.renderTable();
5761
+ this.renderTable();
5759
5762
 
5760
- if (table.options.layoutColumnsOnNewData) {
5761
- this.table.columnManager.redraw(true);
5763
+ if (table.options.layoutColumnsOnNewData) {
5764
+ this.table.columnManager.redraw(true);
5765
+ }
5762
5766
  }
5767
+ } else {
5768
+ this.refreshPipelines(handler, stage, index, renderInPosition);
5763
5769
  }
5764
- } else {
5765
- this.refreshPipelines(handler, stage, index, renderInPosition);
5766
- }
5767
5770
 
5768
- this.dispatch("data-refreshed");
5771
+ this.dispatch("data-refreshed");
5772
+ }
5769
5773
  }
5770
5774
  }
5771
5775
  }, {
@@ -5831,31 +5835,16 @@
5831
5835
  this.displayRows = [];
5832
5836
  this.displayRows.push(this.activeRows.slice(0));
5833
5837
  this.displayRowsCount = this.displayRows[0].length;
5834
- }
5835
- }, {
5836
- key: "getNextDisplayIndex",
5837
- value: function getNextDisplayIndex() {
5838
- return this.displayRows.length;
5839
5838
  } //set display row pipeline data
5840
5839
 
5841
5840
  }, {
5842
5841
  key: "setDisplayRows",
5843
5842
  value: function setDisplayRows(displayRows, index) {
5844
- var output = true;
5845
-
5846
- if (index && typeof this.displayRows[index] != "undefined") {
5847
- this.displayRows[index] = displayRows;
5848
- output = true;
5849
- } else {
5850
- this.displayRows.push(displayRows);
5851
- output = index = this.displayRows.length - 1;
5852
- }
5843
+ this.displayRows[index] = displayRows;
5853
5844
 
5854
5845
  if (index == this.displayRows.length - 1) {
5855
5846
  this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length;
5856
5847
  }
5857
-
5858
- return output;
5859
5848
  }
5860
5849
  }, {
5861
5850
  key: "getDisplayRows",
@@ -5889,23 +5878,24 @@
5889
5878
  }, {
5890
5879
  key: "getRows",
5891
5880
  value: function getRows(type) {
5892
- var rows;
5893
-
5894
- switch (type) {
5895
- case "active":
5896
- rows = this.activeRows;
5897
- break;
5881
+ var rows = [];
5898
5882
 
5899
- case "display":
5900
- rows = this.table.rowManager.getDisplayRows();
5901
- break;
5883
+ if (!type || type === true) {
5884
+ rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
5885
+ } else {
5886
+ switch (type) {
5887
+ case "active":
5888
+ rows = this.activeRows;
5889
+ break;
5902
5890
 
5903
- case "visible":
5904
- rows = this.getVisibleRows(false, true);
5905
- break;
5891
+ case "display":
5892
+ rows = this.table.rowManager.getDisplayRows();
5893
+ break;
5906
5894
 
5907
- default:
5908
- rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
5895
+ case "visible":
5896
+ rows = this.getVisibleRows(false, true);
5897
+ break;
5898
+ }
5909
5899
  }
5910
5900
 
5911
5901
  return rows;
@@ -6014,9 +6004,7 @@
6014
6004
  this._clearPlaceholder();
6015
6005
 
6016
6006
  this.scrollTop = 0;
6017
- this.scrollLeft = 0; // clear empty table placeholder min
6018
-
6019
- this.tableElement.style.minWidth = "";
6007
+ this.scrollLeft = 0;
6020
6008
  this.renderer.clearRows();
6021
6009
  }
6022
6010
  }, {
@@ -6034,7 +6022,10 @@
6034
6022
  value: function _clearPlaceholder() {
6035
6023
  if (this.placeholder && this.placeholder.parentNode) {
6036
6024
  this.placeholder.parentNode.removeChild(this.placeholder);
6037
- }
6025
+ } // clear empty table placeholder min
6026
+
6027
+
6028
+ this.tableElement.style.minWidth = "";
6038
6029
  }
6039
6030
  }, {
6040
6031
  key: "_positionPlaceholder",
@@ -6547,6 +6538,7 @@
6547
6538
  //ensure row component is looked up before cell
6548
6539
  var keys = Object.keys(targets).reverse(),
6549
6540
  listener = this.listeners[type],
6541
+ matches = {},
6550
6542
  targetMatches = {};
6551
6543
 
6552
6544
  var _iterator4 = _createForOfIteratorHelper(keys),
@@ -6555,9 +6547,9 @@
6555
6547
  try {
6556
6548
  var _loop = function _loop() {
6557
6549
  var key = _step4.value;
6558
- var component = void 0;
6559
- var target = targets[key];
6560
- var previousTarget = _this5.previousTargets[key];
6550
+ var component = void 0,
6551
+ target = targets[key],
6552
+ previousTarget = _this5.previousTargets[key];
6561
6553
 
6562
6554
  if (previousTarget && previousTarget.target === target) {
6563
6555
  component = previousTarget.component;
@@ -6588,8 +6580,8 @@
6588
6580
 
6589
6581
  case "cell":
6590
6582
  if (listener.components.includes("cell")) {
6591
- if (targets["row"] instanceof Row) {
6592
- component = targets["row"].findCell(target);
6583
+ if (matches["row"] instanceof Row) {
6584
+ component = matches["row"].findCell(target);
6593
6585
  } else {
6594
6586
  if (targets["row"]) {
6595
6587
  console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?");
@@ -6602,7 +6594,7 @@
6602
6594
  }
6603
6595
 
6604
6596
  if (component) {
6605
- targets[key] = component;
6597
+ matches[key] = component;
6606
6598
  targetMatches[key] = {
6607
6599
  target: target,
6608
6600
  component: component
@@ -6620,7 +6612,7 @@
6620
6612
  }
6621
6613
 
6622
6614
  this.previousTargets = targetMatches;
6623
- return targets;
6615
+ return matches;
6624
6616
  }
6625
6617
  }, {
6626
6618
  key: "triggerEvents",
@@ -7648,6 +7640,41 @@
7648
7640
  this.table.rowManager.registerDisplayPipelineHandler(handler, priority);
7649
7641
  this._handler = handler;
7650
7642
  }
7643
+ }, {
7644
+ key: "displayRows",
7645
+ value: function displayRows(adjust) {
7646
+ var _this3 = this;
7647
+
7648
+ var index = this.table.rowManager.displayRows.length - 1,
7649
+ lookupIndex;
7650
+
7651
+ if (this._handler) {
7652
+ lookupIndex = this.table.rowManager.displayPipeline.findIndex(function (item) {
7653
+ return item.handler === _this3._handler;
7654
+ });
7655
+
7656
+ if (lookupIndex > -1) {
7657
+ index = lookupIndex;
7658
+ }
7659
+ }
7660
+
7661
+ if (adjust) {
7662
+ index = index + adjust;
7663
+ }
7664
+
7665
+ if (this._handler) {
7666
+ if (index > -1) {
7667
+ return this.table.rowManager.getDisplayRows(index);
7668
+ } else {
7669
+ return this.activeRows();
7670
+ }
7671
+ }
7672
+ }
7673
+ }, {
7674
+ key: "activeRows",
7675
+ value: function activeRows() {
7676
+ return this.table.rowManager.activeRows;
7677
+ }
7651
7678
  }, {
7652
7679
  key: "refreshData",
7653
7680
  value: function refreshData(renderInPosition, handler) {
@@ -8923,7 +8950,7 @@
8923
8950
  data = JSON.parse(data);
8924
8951
  }
8925
8952
 
8926
- if (data) {
8953
+ if (data && data.length > 0) {
8927
8954
  data.forEach(function (item) {
8928
8955
  var row = _this2.rowManager.findRow(item[_this2.options.index]);
8929
8956
 
@@ -8987,7 +9014,7 @@
8987
9014
  data = JSON.parse(data);
8988
9015
  }
8989
9016
 
8990
- if (data) {
9017
+ if (data && data.length > 0) {
8991
9018
  data.forEach(function (item) {
8992
9019
  var row = _this4.rowManager.findRow(item[_this4.options.index]);
8993
9020
 
@@ -10991,8 +11018,6 @@
10991
11018
 
10992
11019
  _this.startOpen = function () {};
10993
11020
 
10994
- _this.displayIndex = 0;
10995
-
10996
11021
  _this.registerTableOption("dataTree", false); //enable data tree
10997
11022
 
10998
11023
 
@@ -11306,16 +11331,6 @@
11306
11331
  }
11307
11332
  }
11308
11333
  }
11309
- }, {
11310
- key: "setDisplayIndex",
11311
- value: function setDisplayIndex(index) {
11312
- this.displayIndex = index;
11313
- }
11314
- }, {
11315
- key: "getDisplayIndex",
11316
- value: function getDisplayIndex() {
11317
- return this.displayIndex;
11318
- }
11319
11334
  }, {
11320
11335
  key: "getRows",
11321
11336
  value: function getRows(rows) {
@@ -18176,9 +18191,9 @@
18176
18191
  this.topElement.appendChild(row.getElement());
18177
18192
  row.initialize();
18178
18193
  row.normalizeHeight();
18179
- this.table.rowManager.adjustTableSize();
18180
18194
  this.rows.push(row);
18181
18195
  this.refreshData(false, "display");
18196
+ this.table.rowManager.adjustTableSize();
18182
18197
  this.styleRows();
18183
18198
  } else {
18184
18199
  console.warn("Freeze Error - Row is already frozen");
@@ -18282,7 +18297,7 @@
18282
18297
  }, {
18283
18298
  key: "isVisible",
18284
18299
  value: function isVisible() {
18285
- return this._group.visible;
18300
+ return this._group._visible;
18286
18301
  }
18287
18302
  }, {
18288
18303
  key: "show",
@@ -18692,8 +18707,7 @@
18692
18707
  });
18693
18708
  }
18694
18709
 
18695
- this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
18696
- this.groupManager.checkBasicModeGroupHeaderWidth();
18710
+ this.groupManager.updateGroupRows(true);
18697
18711
  } else {
18698
18712
  this.groupManager.updateGroupRows(true);
18699
18713
  }
@@ -18728,8 +18742,7 @@
18728
18742
  });
18729
18743
  }
18730
18744
 
18731
- this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
18732
- this.groupManager.checkBasicModeGroupHeaderWidth();
18745
+ this.groupManager.updateGroupRows(true);
18733
18746
  } else {
18734
18747
  this.groupManager.updateGroupRows(true);
18735
18748
  }
@@ -18954,8 +18967,6 @@
18954
18967
  _this.allowedValues = false;
18955
18968
  _this.groups = {}; //hold row groups
18956
18969
 
18957
- _this.displayIndex = 0; //index in display pipeline
18958
-
18959
18970
  _this.displayHandler = _this.getRows.bind(_assertThisInitialized(_this)); //register table options
18960
18971
 
18961
18972
  _this.registerTableOption("groupBy", false); //enable table grouping and set field to group by
@@ -19126,8 +19137,11 @@
19126
19137
  }, {
19127
19138
  key: "rowSample",
19128
19139
  value: function rowSample(rows, prevValue) {
19129
- var group = this.getGroups(false)[0];
19130
- prevValue.push(group.getRows(false)[0]);
19140
+ if (this.table.options.groupBy) {
19141
+ var group = this.getGroups(false)[0];
19142
+ prevValue.push(group.getRows(false)[0]);
19143
+ }
19144
+
19131
19145
  return prevValue;
19132
19146
  }
19133
19147
  }, {
@@ -19135,40 +19149,43 @@
19135
19149
  value: function virtualRenderFill() {
19136
19150
  var el = this.table.rowManager.tableElement;
19137
19151
  var rows = this.table.rowManager.getVisibleRows();
19138
- rows = rows.filter(function (row) {
19139
- return row.type !== "group";
19140
- });
19141
- el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : ""; // if(this.table.options.groupBy){
19142
- // if(this.layoutMode() != "fitDataFill" && rowsCount == this.table.modules.groupRows.countGroups()){
19143
- // el.style.minWidth = this.table.columnManager.getWidth() + "px";
19144
- // }
19145
- // }
19152
+
19153
+ if (this.table.options.groupBy) {
19154
+ rows = rows.filter(function (row) {
19155
+ return row.type !== "group";
19156
+ });
19157
+ el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : "";
19158
+ } else {
19159
+ return rows;
19160
+ }
19146
19161
  }
19147
19162
  }, {
19148
19163
  key: "rowAddingIndex",
19149
19164
  value: function rowAddingIndex(row, index, top) {
19150
- this.assignRowToGroup(row);
19151
- var groupRows = row.modules.group.rows;
19152
-
19153
- if (groupRows.length > 1) {
19154
- if (!index || index && groupRows.indexOf(index) == -1) {
19155
- if (top) {
19156
- if (groupRows[0] !== row) {
19157
- index = groupRows[0];
19158
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19165
+ if (this.table.options.groupBy) {
19166
+ this.assignRowToGroup(row);
19167
+ var groupRows = row.modules.group.rows;
19168
+
19169
+ if (groupRows.length > 1) {
19170
+ if (!index || index && groupRows.indexOf(index) == -1) {
19171
+ if (top) {
19172
+ if (groupRows[0] !== row) {
19173
+ index = groupRows[0];
19174
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19175
+ }
19176
+ } else {
19177
+ if (groupRows[groupRows.length - 1] !== row) {
19178
+ index = groupRows[groupRows.length - 1];
19179
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19180
+ }
19159
19181
  }
19160
19182
  } else {
19161
- if (groupRows[groupRows.length - 1] !== row) {
19162
- index = groupRows[groupRows.length - 1];
19163
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19164
- }
19183
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19165
19184
  }
19166
- } else {
19167
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19168
19185
  }
19169
- }
19170
19186
 
19171
- return index;
19187
+ return index;
19188
+ }
19172
19189
  }
19173
19190
  }, {
19174
19191
  key: "trackChanges",
@@ -19250,50 +19267,46 @@
19250
19267
  }, {
19251
19268
  key: "rowMoving",
19252
19269
  value: function rowMoving(from, to, after) {
19253
- if (!after && to instanceof Group) {
19254
- to = this.table.rowManager.prevDisplayRow(from) || to;
19255
- }
19270
+ if (this.table.options.groupBy) {
19271
+ if (!after && to instanceof Group) {
19272
+ to = this.table.rowManager.prevDisplayRow(from) || to;
19273
+ }
19256
19274
 
19257
- var toGroup = to instanceof Group ? to : to.modules.group;
19258
- var fromGroup = from instanceof Group ? from : from.modules.group;
19275
+ var toGroup = to instanceof Group ? to : to.modules.group;
19276
+ var fromGroup = from instanceof Group ? from : from.modules.group;
19259
19277
 
19260
- if (toGroup === fromGroup) {
19261
- this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
19262
- } else {
19263
- if (fromGroup) {
19264
- fromGroup.removeRow(from);
19265
- }
19278
+ if (toGroup === fromGroup) {
19279
+ this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
19280
+ } else {
19281
+ if (fromGroup) {
19282
+ fromGroup.removeRow(from);
19283
+ }
19266
19284
 
19267
- toGroup.insertRow(from, to, after);
19285
+ toGroup.insertRow(from, to, after);
19286
+ }
19268
19287
  }
19269
19288
  }
19270
19289
  }, {
19271
19290
  key: "rowDeleting",
19272
19291
  value: function rowDeleting(row) {
19273
19292
  //remove from group
19274
- if (row.modules.group) {
19293
+ if (this.table.options.groupBy && row.modules.group) {
19275
19294
  row.modules.group.removeRow(row);
19276
19295
  }
19277
19296
  }
19278
19297
  }, {
19279
19298
  key: "rowsUpdated",
19280
19299
  value: function rowsUpdated(row) {
19281
- this.updateGroupRows(true);
19300
+ if (this.table.options.groupBy) {
19301
+ this.updateGroupRows(true);
19302
+ }
19282
19303
  }
19283
19304
  }, {
19284
19305
  key: "cellUpdated",
19285
19306
  value: function cellUpdated(cell) {
19286
- this.reassignRowToGroup(cell.row);
19287
- }
19288
- }, {
19289
- key: "setDisplayIndex",
19290
- value: function setDisplayIndex(index) {
19291
- this.displayIndex = index;
19292
- }
19293
- }, {
19294
- key: "getDisplayIndex",
19295
- value: function getDisplayIndex() {
19296
- return this.displayIndex;
19307
+ if (this.table.options.groupBy) {
19308
+ this.reassignRowToGroup(cell.row);
19309
+ }
19297
19310
  } //return appropriate rows with group headers
19298
19311
 
19299
19312
  }, {
@@ -19344,9 +19357,11 @@
19344
19357
  }, {
19345
19358
  key: "wipe",
19346
19359
  value: function wipe() {
19347
- this.groupList.forEach(function (group) {
19348
- group.wipe();
19349
- });
19360
+ if (this.table.options.groupBy) {
19361
+ this.groupList.forEach(function (group) {
19362
+ group.wipe();
19363
+ });
19364
+ }
19350
19365
  }
19351
19366
  }, {
19352
19367
  key: "pullGroupListData",
@@ -19511,14 +19526,16 @@
19511
19526
  }, {
19512
19527
  key: "scrollHeaders",
19513
19528
  value: function scrollHeaders(left) {
19514
- if (this.table.options.renderHorizontal === "virtual") {
19515
- left -= this.table.columnManager.renderer.vDomPadLeft;
19516
- }
19529
+ if (this.table.options.groupBy) {
19530
+ if (this.table.options.renderHorizontal === "virtual") {
19531
+ left -= this.table.columnManager.renderer.vDomPadLeft;
19532
+ }
19517
19533
 
19518
- left = left + "px";
19519
- this.groupList.forEach(function (group) {
19520
- group.scrollHeader(left);
19521
- });
19534
+ left = left + "px";
19535
+ this.groupList.forEach(function (group) {
19536
+ group.scrollHeader(left);
19537
+ });
19538
+ }
19522
19539
  }
19523
19540
  }, {
19524
19541
  key: "removeGroup",
@@ -20423,7 +20440,7 @@
20423
20440
  var range;
20424
20441
 
20425
20442
  if (this.table.modExists("edit")) {
20426
- if (this.table.modules.edit.currentCell === this) {
20443
+ if (this.table.modules.edit.currentCell === cell) {
20427
20444
  return; //prevent instant selection of editor content
20428
20445
  }
20429
20446
  }
@@ -22466,8 +22483,6 @@
22466
22483
  _this.count = 5;
22467
22484
  _this.max = 1;
22468
22485
  _this.remoteRowCountEstimate = null;
22469
- _this.displayIndex = 0; //index in display pipeline
22470
-
22471
22486
  _this.initialLoad = true;
22472
22487
  _this.dataChanging = false; //flag to check if data is being changed by this module
22473
22488
 
@@ -22939,16 +22954,6 @@
22939
22954
  key: "trackChanges",
22940
22955
  value: function trackChanges() {
22941
22956
  this.dispatch("page-changed");
22942
- }
22943
- }, {
22944
- key: "setDisplayIndex",
22945
- value: function setDisplayIndex(index) {
22946
- this.displayIndex = index;
22947
- }
22948
- }, {
22949
- key: "getDisplayIndex",
22950
- value: function getDisplayIndex() {
22951
- return this.displayIndex;
22952
22957
  } //calculate maximum page from number of rows
22953
22958
 
22954
22959
  }, {
@@ -23018,7 +23023,7 @@
23018
23023
  }, {
23019
23024
  key: "setPageToRow",
23020
23025
  value: function setPageToRow(row) {
23021
- var rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);
23026
+ var rows = this.displayRows(-1);
23022
23027
  var index = rows.indexOf(row);
23023
23028
 
23024
23029
  if (index > -1) {
@@ -23628,6 +23633,8 @@
23628
23633
  }, {
23629
23634
  key: "initializeColumn",
23630
23635
  value: function initializeColumn(column) {
23636
+ var _this2 = this;
23637
+
23631
23638
  var def, keys;
23632
23639
 
23633
23640
  if (this.config.columns) {
@@ -23643,8 +23650,8 @@
23643
23650
  set: function set(newValue) {
23644
23651
  value = newValue;
23645
23652
 
23646
- if (!this.defWatcherBlock) {
23647
- this.save("columns");
23653
+ if (!_this2.defWatcherBlock) {
23654
+ _this2.save("columns");
23648
23655
  }
23649
23656
 
23650
23657
  if (props.set) {
@@ -23686,20 +23693,20 @@
23686
23693
  }, {
23687
23694
  key: "mergeDefinition",
23688
23695
  value: function mergeDefinition(oldCols, newCols) {
23689
- var _this2 = this;
23696
+ var _this3 = this;
23690
23697
 
23691
23698
  var output = [];
23692
23699
  newCols = newCols || [];
23693
23700
  newCols.forEach(function (column, to) {
23694
- var from = _this2._findColumn(oldCols, column),
23701
+ var from = _this3._findColumn(oldCols, column),
23695
23702
  keys;
23696
23703
 
23697
23704
  if (from) {
23698
- if (_this2.config.columns === true || _this2.config.columns == undefined) {
23705
+ if (_this3.config.columns === true || _this3.config.columns == undefined) {
23699
23706
  keys = Object.keys(from);
23700
23707
  keys.push("width");
23701
23708
  } else {
23702
- keys = _this2.config.columns;
23709
+ keys = _this3.config.columns;
23703
23710
  }
23704
23711
 
23705
23712
  keys.forEach(function (key) {
@@ -23709,14 +23716,14 @@
23709
23716
  });
23710
23717
 
23711
23718
  if (from.columns) {
23712
- from.columns = _this2.mergeDefinition(from.columns, column.columns);
23719
+ from.columns = _this3.mergeDefinition(from.columns, column.columns);
23713
23720
  }
23714
23721
 
23715
23722
  output.push(from);
23716
23723
  }
23717
23724
  });
23718
23725
  oldCols.forEach(function (column, i) {
23719
- var from = _this2._findColumn(newCols, column);
23726
+ var from = _this3._findColumn(newCols, column);
23720
23727
 
23721
23728
  if (!from) {
23722
23729
  if (output.length > i) {
@@ -23830,7 +23837,7 @@
23830
23837
  }, {
23831
23838
  key: "parseColumns",
23832
23839
  value: function parseColumns(columns) {
23833
- var _this3 = this;
23840
+ var _this4 = this;
23834
23841
 
23835
23842
  var definitions = [],
23836
23843
  excludedKeys = ["headerContextMenu", "headerMenu", "contextMenu", "clickMenu"];
@@ -23841,16 +23848,16 @@
23841
23848
 
23842
23849
  if (column.isGroup) {
23843
23850
  defStore.title = colDef.title;
23844
- defStore.columns = _this3.parseColumns(column.getColumns());
23851
+ defStore.columns = _this4.parseColumns(column.getColumns());
23845
23852
  } else {
23846
23853
  defStore.field = column.getField();
23847
23854
 
23848
- if (_this3.config.columns === true || _this3.config.columns == undefined) {
23855
+ if (_this4.config.columns === true || _this4.config.columns == undefined) {
23849
23856
  keys = Object.keys(colDef);
23850
23857
  keys.push("width");
23851
23858
  keys.push("visible");
23852
23859
  } else {
23853
- keys = _this3.config.columns;
23860
+ keys = _this4.config.columns;
23854
23861
  }
23855
23862
 
23856
23863
  keys.forEach(function (key) {
@@ -25844,13 +25851,18 @@
25844
25851
 
25845
25852
  if (rowMatch) {
25846
25853
  this._selectRow(rowMatch, true, true);
25854
+
25855
+ this._rowSelectionChanged();
25847
25856
  } else {
25848
- this.table.rowManager.getRows(rows).forEach(function (row) {
25857
+ rowMatch = this.table.rowManager.getRows(rows);
25858
+ rowMatch.forEach(function (row) {
25849
25859
  _this3._selectRow(row, true, true);
25850
25860
  });
25851
- }
25852
25861
 
25853
- this._rowSelectionChanged();
25862
+ if (rowMatch.length) {
25863
+ this._rowSelectionChanged();
25864
+ }
25865
+ }
25854
25866
 
25855
25867
  break;
25856
25868
 
@@ -26544,13 +26556,10 @@
26544
26556
 
26545
26557
  if (match > -1) {
26546
26558
  sorters[match].dir = dir;
26559
+ match = sorters.splice(match, 1)[0];
26547
26560
 
26548
- if (match != sorters.length - 1) {
26549
- match = sorters.splice(match, 1)[0];
26550
-
26551
- if (dir != "none") {
26552
- sorters.push(match);
26553
- }
26561
+ if (dir != "none") {
26562
+ sorters.push(match);
26554
26563
  }
26555
26564
  } else {
26556
26565
  if (dir != "none") {
@@ -26775,7 +26784,7 @@
26775
26784
  var sortEl = column.modules.sort.element,
26776
26785
  arrowEl;
26777
26786
 
26778
- if (typeof this.table.options.headerSortElement === "function") {
26787
+ if (column.definition.headerSort && typeof this.table.options.headerSortElement === "function") {
26779
26788
  while (sortEl.firstChild) {
26780
26789
  sortEl.removeChild(sortEl.firstChild);
26781
26790
  }