tabulator-tables 5.4.1 → 5.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bower.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tabulator",
3
3
  "main": "dist/js/tabulator.js",
4
- "version": "5.4.1",
4
+ "version": "5.4.2",
5
5
  "description": "Interactive table generation JavaScript library",
6
6
  "keywords": [
7
7
  "table",
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.4.1 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.4.2 (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) :
@@ -1470,6 +1470,16 @@
1470
1470
  return width;
1471
1471
  }
1472
1472
 
1473
+ getLeftOffset(){
1474
+ var offset = this.element.offsetLeft;
1475
+
1476
+ if(this.parent.isGroup){
1477
+ offset += this.parent.getLeftOffset();
1478
+ }
1479
+
1480
+ return offset;
1481
+ }
1482
+
1473
1483
  getHeight(){
1474
1484
  return Math.ceil(this.element.getBoundingClientRect().height);
1475
1485
  }
@@ -3099,10 +3109,11 @@
3099
3109
 
3100
3110
  scrollToColumn(column, position, ifVisible){
3101
3111
  var left = 0,
3102
- offset = 0,
3112
+ offset = column.getLeftOffset(),
3103
3113
  adjust = 0,
3104
3114
  colEl = column.getElement();
3105
3115
 
3116
+
3106
3117
  return new Promise((resolve, reject) => {
3107
3118
 
3108
3119
  if(typeof position === "undefined"){
@@ -3129,16 +3140,13 @@
3129
3140
 
3130
3141
  //check column visibility
3131
3142
  if(!ifVisible){
3132
-
3133
- offset = colEl.offsetLeft;
3134
-
3135
3143
  if(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){
3136
3144
  return false;
3137
3145
  }
3138
3146
  }
3139
3147
 
3140
3148
  //calculate scroll position
3141
- left = colEl.offsetLeft + adjust;
3149
+ left = offset + adjust;
3142
3150
 
3143
3151
  left = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);
3144
3152
 
@@ -9733,6 +9741,16 @@
9733
9741
  }
9734
9742
  }
9735
9743
 
9744
+ reinitializeCalcs(){
9745
+ if(this.topCalcs.length){
9746
+ this.initializeTopRow();
9747
+ }
9748
+
9749
+ if(this.botCalcs.length){
9750
+ this.initializeBottomRow();
9751
+ }
9752
+ }
9753
+
9736
9754
  initializeTopRow(){
9737
9755
  if(!this.topInitialized){
9738
9756
  this.table.columnManager.getContentsElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);
@@ -17119,17 +17137,19 @@
17119
17137
  this.createValueGroups();
17120
17138
  }
17121
17139
 
17122
- wipe(){
17123
- if(this.groupList.length){
17124
- this.groupList.forEach(function(group){
17125
- group.wipe();
17126
- });
17127
- }else {
17128
- this.rows.forEach((row) => {
17129
- if(row.modules){
17130
- delete row.modules.group;
17131
- }
17132
- });
17140
+ wipe(elementsOnly){
17141
+ if(!elementsOnly){
17142
+ if(this.groupList.length){
17143
+ this.groupList.forEach(function(group){
17144
+ group.wipe();
17145
+ });
17146
+ }else {
17147
+ this.rows.forEach((row) => {
17148
+ if(row.modules){
17149
+ delete row.modules.group;
17150
+ }
17151
+ });
17152
+ }
17133
17153
  }
17134
17154
 
17135
17155
  this.element = false;
@@ -17762,7 +17782,7 @@
17762
17782
 
17763
17783
  this.groupIDLookups = [];
17764
17784
 
17765
- if(Array.isArray(groupBy)){
17785
+ if(groupBy){
17766
17786
  if(this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both"){
17767
17787
  this.table.modules.columnCalcs.removeCalcs();
17768
17788
  }
@@ -17902,6 +17922,10 @@
17902
17922
  }
17903
17923
 
17904
17924
  this.configureGroupSetup();
17925
+
17926
+ if(!groups && this.table.modExists("columnCalcs") && this.table.options.columnCalcs === true){
17927
+ this.table.modules.columnCalcs.reinitializeCalcs();
17928
+ }
17905
17929
 
17906
17930
  this.refreshData();
17907
17931
 
@@ -18148,7 +18172,7 @@
18148
18172
  }
18149
18173
 
18150
18174
  Object.values(oldGroups).forEach((group) => {
18151
- group.wipe();
18175
+ group.wipe(true);
18152
18176
  });
18153
18177
  }
18154
18178
 
@@ -19919,7 +19943,7 @@
19919
19943
 
19920
19944
  config.mousemove = function(e){
19921
19945
  if(column.parent === self.moving.parent){
19922
- if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){
19946
+ if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.contentsElement.scrollLeft) > (column.getWidth() / 2)){
19923
19947
  if(self.toCol !== column || !self.toColAfter){
19924
19948
  colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);
19925
19949
  self.moveColumn(column, true);