tabulator-tables 5.2.3 → 5.2.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.
package/bower.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tabulator",
3
3
  "main": "dist/js/tabulator.js",
4
- "version": "5.2.3",
4
+ "version": "5.2.4",
5
5
  "description": "Interactive table generation JavaScript library",
6
6
  "keywords": [
7
7
  "table",
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.2.3 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.2.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) :
@@ -323,8 +323,8 @@
323
323
 
324
324
  _createClass(CoreFeature, [{
325
325
  key: "reloadData",
326
- value: function reloadData(data, silent) {
327
- return this.table.dataLoader.load(data, undefined, undefined, undefined, silent);
326
+ value: function reloadData(data, silent, columnsChanged) {
327
+ return this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);
328
328
  } //////////////////////////////////////////
329
329
  ///////////// Localization ///////////////
330
330
  //////////////////////////////////////////
@@ -6691,7 +6691,7 @@
6691
6691
  value: function initialize() {}
6692
6692
  }, {
6693
6693
  key: "load",
6694
- value: function load(data, params, config, replace, silent) {
6694
+ value: function load(data, params, config, replace, silent, columnsChanged) {
6695
6695
  var _this2 = this;
6696
6696
 
6697
6697
  var requestNo = ++this.requestOrder;
@@ -6725,7 +6725,7 @@
6725
6725
  if (rowData !== false) {
6726
6726
  _this2.dispatchExternal("dataLoaded", rowData);
6727
6727
 
6728
- _this2.table.rowManager.setData(rowData, replace, !replace);
6728
+ _this2.table.rowManager.setData(rowData, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
6729
6729
  }
6730
6730
  } else {
6731
6731
  console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made");
@@ -6752,7 +6752,7 @@
6752
6752
  data = [];
6753
6753
  }
6754
6754
 
6755
- this.table.rowManager.setData(data, replace, !replace);
6755
+ this.table.rowManager.setData(data, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
6756
6756
  return Promise.resolve();
6757
6757
  }
6758
6758
  }
@@ -11321,6 +11321,11 @@
11321
11321
  value: function getTreeParent(row) {
11322
11322
  return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;
11323
11323
  }
11324
+ }, {
11325
+ key: "getTreeParentRoot",
11326
+ value: function getTreeParentRoot(row) {
11327
+ return row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;
11328
+ }
11324
11329
  }, {
11325
11330
  key: "getFilteredTreeChildren",
11326
11331
  value: function getFilteredTreeChildren(row) {
@@ -12961,7 +12966,7 @@
12961
12966
  values = this._ajaxRequest(this.params.valuesURL, this.input.value);
12962
12967
  } else {
12963
12968
  if (typeof this.params.valuesLookup === "function") {
12964
- values = this.params.valuesLookup(cell, this.input.value);
12969
+ values = this.params.valuesLookup(this.cell, this.input.value);
12965
12970
  } else if (this.params.valuesLookup) {
12966
12971
  values = this._uniqueColumnValues(this.params.valuesLookupField);
12967
12972
  }
@@ -15954,7 +15959,7 @@
15954
15959
  value: function refreshFilter() {
15955
15960
  if (this.tableInitialized) {
15956
15961
  if (this.table.options.filterMode === "remote") {
15957
- this.reloadData();
15962
+ this.reloadData(null, false, false);
15958
15963
  } else {
15959
15964
  this.refreshData(true);
15960
15965
  }
@@ -17384,7 +17389,8 @@
17384
17389
  this.table.columnManager.headersElement.style.marginLeft = this.leftMargin;
17385
17390
  this.table.columnManager.element.style.paddingRight = this.rightMargin;
17386
17391
  this.leftColumns.forEach(function (column, i) {
17387
- column.modules.frozen.margin = leftMargin + _this4.table.columnManager.scrollLeft + "px";
17392
+ column.modules.frozen.marginValue = leftMargin + _this4.table.columnManager.scrollLeft;
17393
+ column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
17388
17394
 
17389
17395
  if (column.visible) {
17390
17396
  leftMargin += column.getWidth();
@@ -17423,7 +17429,8 @@
17423
17429
  rightMargin += column.getWidth();
17424
17430
  }
17425
17431
 
17426
- column.modules.frozen.margin = _this4.rightPadding - rightMargin + "px";
17432
+ column.modules.frozen.marginValue = _this4.rightPadding - rightMargin;
17433
+ column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
17427
17434
 
17428
17435
  if (i == _this4.rightColumns.length - 1) {
17429
17436
  column.modules.frozen.edge = true;
@@ -18830,6 +18837,11 @@
18830
18837
  key: "getRowGroup",
18831
18838
  value: function getRowGroup(row) {
18832
18839
  var match = false;
18840
+
18841
+ if (this.options("dataTree")) {
18842
+ row = this.table.modules.dataTree.getTreeParentRoot(row);
18843
+ }
18844
+
18833
18845
  this.groupList.forEach(function (group) {
18834
18846
  var result = group.getRowGroup(row);
18835
18847
 
@@ -24018,6 +24030,7 @@
24018
24030
  this.subscribe("column-moved", this.columnLayoutUpdated.bind(this));
24019
24031
  this.subscribe("column-hide", this.deInitializeColumn.bind(this));
24020
24032
  this.subscribe("column-show", this.columnLayoutUpdated.bind(this));
24033
+ this.subscribe("column-width", this.columnWidthUpdated.bind(this));
24021
24034
  this.subscribe("column-delete", this.deInitializeComponent.bind(this));
24022
24035
  this.subscribe("column-height", this.resizeHandle.bind(this));
24023
24036
  this.initialized = true;
@@ -24050,16 +24063,42 @@
24050
24063
  this.reinitializeColumn(prev);
24051
24064
  }
24052
24065
  }
24066
+ }, {
24067
+ key: "columnWidthUpdated",
24068
+ value: function columnWidthUpdated(column) {
24069
+ var _this2 = this;
24070
+
24071
+ if (column.modules.frozen) {
24072
+ if (this.table.modules.frozenColumns.leftColumns.includes(column)) {
24073
+ this.table.modules.frozenColumns.leftColumns.forEach(function (col) {
24074
+ _this2.reinitializeColumn(col);
24075
+ });
24076
+ } else if (this.table.modules.frozenColumns.rightColumns.includes(column)) {
24077
+ this.table.modules.frozenColumns.rightColumns.forEach(function (col) {
24078
+ _this2.reinitializeColumn(col);
24079
+ });
24080
+ }
24081
+ }
24082
+ }
24053
24083
  }, {
24054
24084
  key: "reinitializeColumn",
24055
24085
  value: function reinitializeColumn(column) {
24086
+ var frozenOffset = column.modules.frozen ? column.modules.frozen.marginValue + column.getWidth() + "px" : false;
24056
24087
  column.cells.forEach(function (cell) {
24057
24088
  if (cell.modules.resize && cell.modules.resize.handleEl) {
24089
+ if (frozenOffset) {
24090
+ cell.modules.resize.handleEl.style.left = frozenOffset;
24091
+ }
24092
+
24058
24093
  cell.element.after(cell.modules.resize.handleEl);
24059
24094
  }
24060
24095
  });
24061
24096
 
24062
24097
  if (column.modules.resize && column.modules.resize.handleEl) {
24098
+ if (frozenOffset) {
24099
+ column.modules.resize.handleEl.style.left = frozenOffset;
24100
+ }
24101
+
24063
24102
  column.element.after(column.modules.resize.handleEl);
24064
24103
  }
24065
24104
  }
@@ -24108,6 +24147,12 @@
24108
24147
  self.table.externalEvents.dispatch("columnResized", nearestColumn.getComponent());
24109
24148
  }
24110
24149
  });
24150
+
24151
+ if (column.modules.frozen) {
24152
+ handle.style.position = "absolute";
24153
+ handle.style.left = column.modules.frozen.marginValue + column.getWidth() + "px";
24154
+ }
24155
+
24111
24156
  config.handleEl = handle;
24112
24157
 
24113
24158
  if (element.parentNode) {
@@ -24120,11 +24165,11 @@
24120
24165
  }, {
24121
24166
  key: "deInitializeColumn",
24122
24167
  value: function deInitializeColumn(column) {
24123
- var _this2 = this;
24168
+ var _this3 = this;
24124
24169
 
24125
24170
  this.deInitializeComponent(column);
24126
24171
  column.cells.forEach(function (cell) {
24127
- _this2.deInitializeComponent(cell);
24172
+ _this3.deInitializeComponent(cell);
24128
24173
  });
24129
24174
  }
24130
24175
  }, {
@@ -25846,7 +25891,7 @@
25846
25891
  key: "refreshSort",
25847
25892
  value: function refreshSort() {
25848
25893
  if (this.table.options.sortMode === "remote") {
25849
- this.reloadData();
25894
+ this.reloadData(null, false, false);
25850
25895
  } else {
25851
25896
  this.refreshData(true);
25852
25897
  } //TODO - Persist left position of row manager