tabulator-tables 5.0.9 → 5.0.10

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.0.9",
4
+ "version": "5.0.10",
5
5
  "description": "Interactive table generation JavaScript library",
6
6
  "keywords": [
7
7
  "table",
package/build/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Bundler from "./Bundler.js";
2
2
 
3
- var bundler = new Bundler("5.0.9", process.env.TARGET);
3
+ var bundler = new Bundler("5.0.10", process.env.TARGET);
4
4
 
5
5
  module.exports = bundler.bundle();
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.0.9 (c) Oliver Folkerd 2021 */
1
+ /* Tabulator v5.0.10 (c) Oliver Folkerd 2021 */
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) :
@@ -1814,7 +1814,7 @@
1814
1814
  this.cells.forEach(function (cell) {
1815
1815
  cell.hide();
1816
1816
  });
1817
- this.dispatch("column-hide", this);
1817
+ this.dispatch("column-hide", this, responsiveToggle);
1818
1818
 
1819
1819
  if (!silent) {
1820
1820
  this.dispatchExternal("columnVisibilityChanged", this.getComponent(), false);
@@ -2340,7 +2340,7 @@
2340
2340
  }
2341
2341
  }, {
2342
2342
  key: "scrollToRowNearestTop",
2343
- value: function scrollToRowNearestTop(row) {//determin weather the row is nearest the top or bottom of the table, retur true for top or false for bottom
2343
+ value: function scrollToRowNearestTop(row) {//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom
2344
2344
  }
2345
2345
  }, {
2346
2346
  key: "visibleRows",
@@ -2535,17 +2535,17 @@
2535
2535
  ok = true;
2536
2536
 
2537
2537
  if (this.options("layout") == "fitDataTable") {
2538
- console.warn("Horizontal Vitrual DOM is not compatible with fitDataTable layout mode");
2538
+ console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode");
2539
2539
  ok = false;
2540
2540
  }
2541
2541
 
2542
2542
  if (this.options("responsiveLayout")) {
2543
- console.warn("Horizontal Vitrual DOM is not compatible with responsive columns");
2543
+ console.warn("Horizontal Virtual DOM is not compatible with responsive columns");
2544
2544
  ok = false;
2545
2545
  }
2546
2546
 
2547
2547
  if (this.options("rtl")) {
2548
- console.warn("Horizontal Vitrual DOM is not currently compatible with RTL text direction");
2548
+ console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction");
2549
2549
  ok = false;
2550
2550
  }
2551
2551
 
@@ -2555,7 +2555,7 @@
2555
2555
  });
2556
2556
 
2557
2557
  if (frozen) {
2558
- console.warn("Horizontal Vitrual DOM is not compatible with frozen columns");
2558
+ console.warn("Horizontal Virtual DOM is not compatible with frozen columns");
2559
2559
  ok = false;
2560
2560
  }
2561
2561
  } // if(!ok){
@@ -2641,7 +2641,7 @@
2641
2641
 
2642
2642
  if (!blockRedraw) {
2643
2643
  if (!update || this.reinitChanged(old)) {
2644
- this.renitializeRows();
2644
+ this.reinitializeRows();
2645
2645
  }
2646
2646
  }
2647
2647
 
@@ -2768,8 +2768,8 @@
2768
2768
  return !match;
2769
2769
  }
2770
2770
  }, {
2771
- key: "renitializeRows",
2772
- value: function renitializeRows() {
2771
+ key: "reinitializeRows",
2772
+ value: function reinitializeRows() {
2773
2773
  var _this5 = this;
2774
2774
 
2775
2775
  var rows = this.table.rowManager.getVisibleRows();
@@ -2892,11 +2892,17 @@
2892
2892
  if (column && column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft) {
2893
2893
  rows = this.table.rowManager.getVisibleRows();
2894
2894
  rows.forEach(function (row) {
2895
+ var cell, el;
2896
+
2895
2897
  if (row.type !== "group") {
2896
- var cell = row.getCell(column);
2898
+ cell = row.getCell(column);
2899
+
2900
+ if (cell) {
2901
+ el = cell.getElement();
2897
2902
 
2898
- if (cell.parentNode) {
2899
- row.getElement().removeChild(cell.getElement());
2903
+ if (el.parentNode) {
2904
+ row.getElement().removeChild(el);
2905
+ }
2900
2906
  }
2901
2907
  }
2902
2908
  });
@@ -6111,11 +6117,24 @@
6111
6117
  "tabulator-col": "column"
6112
6118
  };
6113
6119
  _this.pseudoTrackers = {
6114
- "row": null,
6115
- "cell": null,
6116
- "group": null,
6117
- "column": null
6120
+ "row": {
6121
+ subscriber: null,
6122
+ target: null
6123
+ },
6124
+ "cell": {
6125
+ subscriber: null,
6126
+ target: null
6127
+ },
6128
+ "group": {
6129
+ subscriber: null,
6130
+ target: null
6131
+ },
6132
+ "column": {
6133
+ subscriber: null,
6134
+ target: null
6135
+ }
6118
6136
  };
6137
+ _this.pseudoTracking = false;
6119
6138
  return _this;
6120
6139
  }
6121
6140
 
@@ -6125,7 +6144,6 @@
6125
6144
  this.el = this.table.element;
6126
6145
  this.buildListenerMap();
6127
6146
  this.bindSubscriptionWatchers();
6128
- this.bindPseudoEvents();
6129
6147
  }
6130
6148
  }, {
6131
6149
  key: "buildListenerMap",
@@ -6145,20 +6163,22 @@
6145
6163
  var _this2 = this;
6146
6164
 
6147
6165
  Object.keys(this.pseudoTrackers).forEach(function (key) {
6148
- _this2.subscribe(key + "-mouseover", _this2.pseudoMouseEnter.bind(_this2, key)); // this.subscribe(key + "-mouseout", this.pseudoMouseLeave.bind(this, key));
6166
+ _this2.pseudoTrackers[key].subscriber = _this2.pseudoMouseEnter.bind(_this2, key);
6149
6167
 
6168
+ _this2.subscribe(key + "-mouseover", _this2.pseudoTrackers[key].subscriber);
6150
6169
  });
6170
+ this.pseudoTracking = true;
6151
6171
  }
6152
6172
  }, {
6153
6173
  key: "pseudoMouseEnter",
6154
6174
  value: function pseudoMouseEnter(key, e, target) {
6155
- if (this.pseudoTrackers[key] !== target) {
6156
- if (this.pseudoTrackers[key]) {
6175
+ if (this.pseudoTrackers[key].target !== target) {
6176
+ if (this.pseudoTrackers[key].target) {
6157
6177
  this.dispatch(key + "-mouseleave", e, target);
6158
6178
  }
6159
6179
 
6160
6180
  this.pseudoMouseLeave(key, e);
6161
- this.pseudoTrackers[key] = target;
6181
+ this.pseudoTrackers[key].target = target;
6162
6182
  this.dispatch(key + "-mouseenter", e, target);
6163
6183
  }
6164
6184
  }
@@ -6177,12 +6197,12 @@
6177
6197
  return item !== key && (!links || links && !links.includes(item));
6178
6198
  });
6179
6199
  leaveList.forEach(function (key) {
6180
- var target = _this3.pseudoTrackers[key];
6200
+ var target = _this3.pseudoTrackers[key].target;
6181
6201
 
6182
- if (_this3.pseudoTrackers[key]) {
6202
+ if (_this3.pseudoTrackers[key].target) {
6183
6203
  _this3.dispatch(key + "-mouseleave", e, target);
6184
6204
 
6185
- _this3.pseudoTrackers[key] = null;
6205
+ _this3.pseudoTrackers[key].target = null;
6186
6206
  }
6187
6207
  });
6188
6208
  }
@@ -6234,6 +6254,10 @@
6234
6254
  }
6235
6255
  }
6236
6256
 
6257
+ if ((key === "mouseenter" || key === "mouseleave") && !this.pseudoTracking) {
6258
+ this.bindPseudoEvents();
6259
+ }
6260
+
6237
6261
  if (changed) {
6238
6262
  this.updateEventListeners();
6239
6263
  }
@@ -6265,7 +6289,7 @@
6265
6289
  targets = this.bindComponents(type, targets);
6266
6290
  this.triggerEvents(type, e, targets);
6267
6291
 
6268
- if ((type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length) {
6292
+ if (this.pseudoTracking && (type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length) {
6269
6293
  this.pseudoMouseLeave("none", e);
6270
6294
  }
6271
6295
  }
@@ -6536,7 +6560,7 @@
6536
6560
  data = JSON.parse(data);
6537
6561
  }
6538
6562
 
6539
- if (this.confirm("data-loading", data, params, config, silent)) {
6563
+ if (this.confirm("data-loading", [data, params, config, silent])) {
6540
6564
  this.loading = true;
6541
6565
 
6542
6566
  if (!silent) {
@@ -13648,14 +13672,15 @@
13648
13672
  var cell = this.currentCell,
13649
13673
  cellEl;
13650
13674
  this.invalidEdit = false;
13675
+ console.log("clear", cancel, cell, cell.validate);
13651
13676
 
13652
13677
  if (cell) {
13653
13678
  this.currentCell = false;
13654
13679
  cellEl = cell.getElement();
13655
13680
 
13656
13681
  if (cancel) {
13657
- if (cell.validate) {
13658
- cell.validate();
13682
+ if (cell.column.modules.validate && this.table.modExists("validate")) {
13683
+ this.table.modules.validate.cellValidate(cell);
13659
13684
  }
13660
13685
  } else {
13661
13686
  cellEl.classList.remove("tabulator-validation-fail");
@@ -16499,7 +16524,7 @@
16499
16524
  this.subscribe("cell-layout", this.layoutCell.bind(this));
16500
16525
  this.subscribe("column-init", this.initializeColumn.bind(this));
16501
16526
  this.subscribe("column-width", this.layout.bind(this));
16502
- this.subscribe("row-layout-before", this.layoutRow.bind(this));
16527
+ this.subscribe("row-layout-after", this.layoutRow.bind(this));
16503
16528
  this.subscribe("table-layout", this.layout.bind(this));
16504
16529
  this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
16505
16530
  this.subscribe("columns-loading", this.reset.bind(this));
@@ -23076,7 +23101,7 @@
23076
23101
  _this.registerColumnOption("responsive");
23077
23102
 
23078
23103
  return _this;
23079
- } //generate resposive columns list
23104
+ } //generate responsive columns list
23080
23105
 
23081
23106
 
23082
23107
  _createClass(ResponsiveLayout, [{
@@ -23115,7 +23140,7 @@
23115
23140
  this.mode = this.table.options.responsiveLayout;
23116
23141
  this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;
23117
23142
  this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;
23118
- this.hiddenColumns = []; //detemine level of responsivity for each column
23143
+ this.hiddenColumns = []; //determine level of responsivity for each column
23119
23144
 
23120
23145
  this.table.columnManager.columnsByIndex.forEach(function (column, i) {
23121
23146
  if (column.modules.responsive) {
@@ -23212,9 +23237,8 @@
23212
23237
  value: function updateColumnVisibility(column, responsiveToggle) {
23213
23238
  if (!responsiveToggle && column.modules.responsive) {
23214
23239
  column.modules.responsive.visible = column.visible;
23215
- this.initialize();
23216
- } //this.update();
23217
-
23240
+ this.initializeResponsivity();
23241
+ }
23218
23242
  }
23219
23243
  }, {
23220
23244
  key: "hideColumn",