tabulator-tables 5.0.2 → 5.0.7

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 (58) hide show
  1. package/bower.json +1 -1
  2. package/build/rollup.js +1 -1
  3. package/dist/css/tabulator_bootstrap3.css +9 -0
  4. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  5. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  6. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  7. package/dist/css/tabulator_bootstrap4.css +0 -4
  8. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  9. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  10. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  11. package/dist/css/tabulator_bulma.css +5 -1
  12. package/dist/css/tabulator_bulma.css.map +1 -1
  13. package/dist/css/tabulator_bulma.min.css +1 -1
  14. package/dist/css/tabulator_bulma.min.css.map +1 -1
  15. package/dist/css/tabulator_semanticui.css +11 -2
  16. package/dist/css/tabulator_semanticui.css.map +1 -1
  17. package/dist/css/tabulator_semanticui.min.css +1 -1
  18. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  19. package/dist/js/tabulator.js +460 -308
  20. package/dist/js/tabulator.js.map +1 -1
  21. package/dist/js/tabulator.min.js +2 -2
  22. package/dist/js/tabulator.min.js.map +1 -1
  23. package/dist/js/tabulator_esm.js +426 -297
  24. package/dist/js/tabulator_esm.js.map +1 -1
  25. package/dist/js/tabulator_esm.min.js +2 -2
  26. package/dist/js/tabulator_esm.min.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/js/core/ColumnManager.js +15 -16
  29. package/src/js/core/RowManager.js +5 -3
  30. package/src/js/core/Tabulator.js +178 -117
  31. package/src/js/core/column/Column.js +2 -2
  32. package/src/js/core/tools/DataLoader.js +1 -1
  33. package/src/js/core/tools/ExternalEventBus.js +3 -2
  34. package/src/js/core/tools/Helpers.js +24 -7
  35. package/src/js/modules/Accessor/Accessor.js +1 -1
  36. package/src/js/modules/Ajax/defaults/contentTypeFormatters.js +22 -1
  37. package/src/js/modules/DataTree/DataTree.js +1 -1
  38. package/src/js/modules/Edit/Edit.js +7 -6
  39. package/src/js/modules/Edit/defaults/editors/progress.js +2 -2
  40. package/src/js/modules/Filter/Filter.js +9 -4
  41. package/src/js/modules/Format/defaults/formatters/money.js +8 -1
  42. package/src/js/modules/FrozenColumns/FrozenColumns.js +21 -0
  43. package/src/js/modules/FrozenRows/FrozenRows.js +4 -1
  44. package/src/js/modules/GroupRows/Group.js +2 -0
  45. package/src/js/modules/GroupRows/GroupRows.js +40 -35
  46. package/src/js/modules/History/History.js +3 -1
  47. package/src/js/modules/History/defaults/redoers.js +1 -0
  48. package/src/js/modules/History/defaults/undoers.js +1 -0
  49. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +4 -22
  50. package/src/js/modules/MoveColumns/MoveColumns.js +6 -4
  51. package/src/js/modules/Page/Page.js +0 -4
  52. package/src/js/modules/ReactiveData/ReactiveData.js +28 -27
  53. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +5 -1
  54. package/src/js/modules/SelectRow/SelectRow.js +1 -2
  55. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +9 -0
  56. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +0 -4
  57. package/src/scss/themes/bulma/tabulator_bulma.scss +5 -1
  58. package/src/scss/themes/semanticui/tabulator_semanticui.scss +12 -7
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.0.2 (c) Oliver Folkerd 2021 */
1
+ /* Tabulator v5.0.7 (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) :
@@ -731,7 +731,7 @@
731
731
  return CellComponent;
732
732
  }();
733
733
 
734
- var Cell$1 = /*#__PURE__*/function (_CoreFeature) {
734
+ var Cell = /*#__PURE__*/function (_CoreFeature) {
735
735
  _inherits(Cell, _CoreFeature);
736
736
 
737
737
  var _super = _createSuper(Cell);
@@ -1786,8 +1786,7 @@
1786
1786
  this.reinitializeWidth();
1787
1787
  }
1788
1788
 
1789
- this.table.columnManager._verticalAlignHeaders();
1790
-
1789
+ this.table.columnManager.verticalAlignHeaders();
1791
1790
  this.dispatch("column-show", this, responsiveToggle);
1792
1791
 
1793
1792
  if (!silent) {
@@ -1810,8 +1809,7 @@
1810
1809
  if (this.visible) {
1811
1810
  this.visible = false;
1812
1811
  this.element.style.display = "none";
1813
-
1814
- this.table.columnManager._verticalAlignHeaders();
1812
+ this.table.columnManager.verticalAlignHeaders();
1815
1813
 
1816
1814
  if (this.parent.isGroup) {
1817
1815
  this.parent.checkColumnVisibility();
@@ -2017,7 +2015,7 @@
2017
2015
  }, {
2018
2016
  key: "generateCell",
2019
2017
  value: function generateCell(row) {
2020
- var cell = new Cell$1(this, row);
2018
+ var cell = new Cell(this, row);
2021
2019
  this.cells.push(cell);
2022
2020
  return cell;
2023
2021
  }
@@ -2144,7 +2142,7 @@
2144
2142
 
2145
2143
  Column$1.defaultOptionList = defaultOptions$1;
2146
2144
 
2147
- var Helpers$1 = /*#__PURE__*/function () {
2145
+ var Helpers = /*#__PURE__*/function () {
2148
2146
  function Helpers() {
2149
2147
  _classCallCheck(this, Helpers);
2150
2148
  }
@@ -2165,17 +2163,42 @@
2165
2163
  }
2166
2164
  }, {
2167
2165
  key: "deepClone",
2168
- value: function deepClone(obj) {
2169
- var clone = Object.assign(Array.isArray(obj) ? [] : {}, obj);
2166
+ value: function deepClone(obj, clone) {
2167
+ var _this = this;
2170
2168
 
2171
- for (var i in obj) {
2172
- if (obj[i] != null && _typeof(obj[i]) === "object") {
2173
- if (obj[i] instanceof Date) {
2174
- clone[i] = new Date(obj[i]);
2169
+ var list = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
2170
+ var objectProto = {}.__proto__,
2171
+ arrayProto = [].__proto__;
2172
+
2173
+ if (!clone) {
2174
+ clone = Object.assign(Array.isArray(obj) ? [] : {}, obj);
2175
+ }
2176
+
2177
+ var _loop = function _loop() {
2178
+ var subject = obj[i],
2179
+ match = void 0,
2180
+ copy = void 0;
2181
+
2182
+ if (subject != null && _typeof(subject) === "object" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)) {
2183
+ match = list.findIndex(function (item) {
2184
+ return item.subject === subject;
2185
+ });
2186
+
2187
+ if (match > -1) {
2188
+ clone[i] = list[match].copy;
2175
2189
  } else {
2176
- clone[i] = this.deepClone(obj[i]);
2190
+ copy = Object.assign(Array.isArray(subject) ? [] : {}, subject);
2191
+ list.unshift({
2192
+ subject: subject,
2193
+ copy: copy
2194
+ });
2195
+ clone[i] = _this.deepClone(subject, copy, list);
2177
2196
  }
2178
2197
  }
2198
+ };
2199
+
2200
+ for (var i in obj) {
2201
+ _loop();
2179
2202
  }
2180
2203
 
2181
2204
  return clone;
@@ -2389,8 +2412,8 @@
2389
2412
 
2390
2413
 
2391
2414
  if (!ifVisible) {
2392
- if (Helpers$1.elVisible(rowEl)) {
2393
- offset = Helpers$1.elOffset(rowEl).top - Helpers$1.elOffset(_this2.elementVertical).top;
2415
+ if (Helpers.elVisible(rowEl)) {
2416
+ offset = Helpers.elOffset(rowEl).top - Helpers.elOffset(_this2.elementVertical).top;
2394
2417
 
2395
2418
  if (offset > 0 && offset < _this2.elementVertical.clientHeight - rowEl.offsetHeight) {
2396
2419
  return false;
@@ -3007,6 +3030,7 @@
3007
3030
  value: function createHeadersElement() {
3008
3031
  var el = document.createElement("div");
3009
3032
  el.classList.add("tabulator-headers");
3033
+ el.setAttribute("role", "row");
3010
3034
  return el;
3011
3035
  }
3012
3036
  }, {
@@ -3014,6 +3038,7 @@
3014
3038
  value: function createHeaderElement() {
3015
3039
  var el = document.createElement("div");
3016
3040
  el.classList.add("tabulator-header");
3041
+ el.setAttribute("role", "rowgroup");
3017
3042
 
3018
3043
  if (!this.table.options.headerVisible) {
3019
3044
  el.classList.add("tabulator-header-hidden");
@@ -3173,8 +3198,9 @@
3173
3198
  index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;
3174
3199
 
3175
3200
  if (nextToColumn && index > -1) {
3176
- var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn());
3177
- var nextEl = nextToColumn.getElement();
3201
+ var topColumn = nextToColumn.getTopColumn();
3202
+ var parentIndex = this.columns.indexOf(topColumn);
3203
+ var nextEl = topColumn.getElement();
3178
3204
 
3179
3205
  if (before) {
3180
3206
  this.columns.splice(parentIndex, 0, column);
@@ -3191,10 +3217,9 @@
3191
3217
  this.columns.push(column);
3192
3218
  this.headersElement.appendChild(column.getElement());
3193
3219
  }
3194
-
3195
- column.columnRendered();
3196
3220
  }
3197
3221
 
3222
+ column.columnRendered();
3198
3223
  return column;
3199
3224
  }
3200
3225
  }, {
@@ -3219,8 +3244,8 @@
3219
3244
  } //ensure column headers take up the correct amount of space in column groups
3220
3245
 
3221
3246
  }, {
3222
- key: "_verticalAlignHeaders",
3223
- value: function _verticalAlignHeaders() {
3247
+ key: "verticalAlignHeaders",
3248
+ value: function verticalAlignHeaders() {
3224
3249
  var _this3 = this;
3225
3250
 
3226
3251
  var minHeight = 0;
@@ -3376,8 +3401,7 @@
3376
3401
  to.element.parentNode.insertBefore(to.element, from.element);
3377
3402
  }
3378
3403
 
3379
- this._verticalAlignHeaders();
3380
-
3404
+ this.verticalAlignHeaders();
3381
3405
  this.table.rowManager.reinitialize();
3382
3406
  }
3383
3407
  }, {
@@ -3542,13 +3566,11 @@
3542
3566
 
3543
3567
  _this6.dispatch("column-add", definition, before, nextToColumn);
3544
3568
 
3545
- _this6.redraw(true);
3546
-
3547
3569
  if (_this6.layoutMode() != "fitColumns") {
3548
3570
  column.reinitializeWidth();
3549
3571
  }
3550
3572
 
3551
- _this6._verticalAlignHeaders();
3573
+ _this6.redraw(true);
3552
3574
 
3553
3575
  _this6.table.rowManager.reinitialize();
3554
3576
 
@@ -3582,19 +3604,18 @@
3582
3604
  this.columns.splice(index, 1);
3583
3605
  }
3584
3606
 
3585
- this._verticalAlignHeaders();
3586
-
3607
+ this.verticalAlignHeaders();
3587
3608
  this.redraw();
3588
3609
  } //redraw columns
3589
3610
 
3590
3611
  }, {
3591
3612
  key: "redraw",
3592
3613
  value: function redraw(force) {
3593
- if (force) {
3594
- if (Helpers$1.elVisible(this.element)) {
3595
- this._verticalAlignHeaders();
3596
- }
3614
+ if (Helpers.elVisible(this.element)) {
3615
+ this.verticalAlignHeaders();
3616
+ }
3597
3617
 
3618
+ if (force) {
3598
3619
  this.table.rowManager.resetScroll();
3599
3620
  this.table.rowManager.reinitialize();
3600
3621
  }
@@ -3725,7 +3746,7 @@
3725
3746
  return RowComponent;
3726
3747
  }();
3727
3748
 
3728
- var Row$1 = /*#__PURE__*/function (_CoreFeature) {
3749
+ var Row = /*#__PURE__*/function (_CoreFeature) {
3729
3750
  _inherits(Row, _CoreFeature);
3730
3751
 
3731
3752
  var _super = _createSuper(Row);
@@ -3968,7 +3989,7 @@
3968
3989
  value: function updateData(updatedData) {
3969
3990
  var _this2 = this;
3970
3991
 
3971
- var visible = this.element && Helpers$1.elVisible(this.element),
3992
+ var visible = this.element && Helpers.elVisible(this.element),
3972
3993
  tempData = {},
3973
3994
  newRowData;
3974
3995
  return new Promise(function (resolve, reject) {
@@ -4252,14 +4273,14 @@
4252
4273
  }, {
4253
4274
  key: "scrollToRowNearestTop",
4254
4275
  value: function scrollToRowNearestTop(row) {
4255
- var rowTop = Helpers$1.elOffset(row.getElement()).top;
4276
+ var rowTop = Helpers.elOffset(row.getElement()).top;
4256
4277
  return !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));
4257
4278
  }
4258
4279
  }, {
4259
4280
  key: "scrollToRow",
4260
4281
  value: function scrollToRow(row) {
4261
4282
  var rowEl = row.getElement();
4262
- this.elementVertical.scrollTop = Helpers$1.elOffset(rowEl).top - Helpers$1.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;
4283
+ this.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;
4263
4284
  }
4264
4285
  }, {
4265
4286
  key: "visibleRows",
@@ -4539,7 +4560,7 @@
4539
4560
  position -= topPad;
4540
4561
  }
4541
4562
 
4542
- if (rowsCount && Helpers$1.elVisible(this.elementVertical)) {
4563
+ if (rowsCount && Helpers.elVisible(this.elementVertical)) {
4543
4564
  this.vDomTop = position;
4544
4565
  this.vDomBottom = position - 1;
4545
4566
 
@@ -4935,6 +4956,7 @@
4935
4956
  var el = document.createElement("div");
4936
4957
  el.classList.add("tabulator-tableholder");
4937
4958
  el.setAttribute("tabindex", 0);
4959
+ el.setAttribute("role", "rowgroup");
4938
4960
  return el;
4939
4961
  }
4940
4962
  }, {
@@ -4942,6 +4964,7 @@
4942
4964
  value: function createTableElement() {
4943
4965
  var el = document.createElement("div");
4944
4966
  el.classList.add("tabulator-table");
4967
+ el.setAttribute("role", "rowgroup");
4945
4968
  return el;
4946
4969
  } //return containing element
4947
4970
 
@@ -5009,7 +5032,7 @@
5009
5032
  var _this3 = this;
5010
5033
 
5011
5034
  if (_typeof(subject) == "object") {
5012
- if (subject instanceof Row$1) {
5035
+ if (subject instanceof Row) {
5013
5036
  //subject is row element
5014
5037
  return subject;
5015
5038
  } else if (subject instanceof RowComponent$1) {
@@ -5099,7 +5122,7 @@
5099
5122
  this.dispatch("data-processing", data);
5100
5123
  data.forEach(function (def, i) {
5101
5124
  if (def && _typeof(def) === "object") {
5102
- var row = new Row$1(def, _this5);
5125
+ var row = new Row(def, _this5);
5103
5126
 
5104
5127
  _this5.rows.push(row);
5105
5128
  } else {
@@ -5201,7 +5224,7 @@
5201
5224
  _this6.dispatch("row-added", row, data, pos, index);
5202
5225
  });
5203
5226
 
5204
- _this6.reRenderInPosition();
5227
+ _this6.refreshActiveData(false, false, true);
5205
5228
 
5206
5229
  _this6.regenerateRowNumbers();
5207
5230
 
@@ -5232,7 +5255,7 @@
5232
5255
  }, {
5233
5256
  key: "addRowActual",
5234
5257
  value: function addRowActual(data, pos, index, blockRedraw) {
5235
- var row = data instanceof Row$1 ? data : new Row$1(data || {}, this),
5258
+ var row = data instanceof Row ? data : new Row(data || {}, this),
5236
5259
  top = this.findAddRowPos(pos),
5237
5260
  allIndex = -1,
5238
5261
  activeIndex,
@@ -5384,7 +5407,7 @@
5384
5407
  nextRow = this.getDisplayRows()[index + 1];
5385
5408
  }
5386
5409
 
5387
- if (nextRow && (!(nextRow instanceof Row$1) || nextRow.type != "row")) {
5410
+ if (nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")) {
5388
5411
  return this.nextDisplayRow(nextRow, rowOnly);
5389
5412
  }
5390
5413
 
@@ -5400,7 +5423,7 @@
5400
5423
  prevRow = this.getDisplayRows()[index - 1];
5401
5424
  }
5402
5425
 
5403
- if (rowOnly && prevRow && (!(prevRow instanceof Row$1) || prevRow.type != "row")) {
5426
+ if (rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")) {
5404
5427
  return this.prevDisplayRow(prevRow, rowOnly);
5405
5428
  }
5406
5429
 
@@ -5581,7 +5604,7 @@
5581
5604
 
5582
5605
  }
5583
5606
 
5584
- if (Helpers$1.elVisible(this.element)) {
5607
+ if (Helpers.elVisible(this.element)) {
5585
5608
  if (renderInPosition) {
5586
5609
  this.reRenderInPosition();
5587
5610
  } else {
@@ -5756,9 +5779,9 @@
5756
5779
  this.dispatchExternal("renderStarted");
5757
5780
  this.element.scrollTop = 0;
5758
5781
 
5759
- if (this.displayRowsCount) {
5760
- this._clearTable();
5782
+ this._clearTable();
5761
5783
 
5784
+ if (this.displayRowsCount) {
5762
5785
  this.renderer.renderRows();
5763
5786
 
5764
5787
  if (this.firstRender) {
@@ -6456,7 +6479,7 @@
6456
6479
  _this2.hideLoader();
6457
6480
 
6458
6481
  if (rowData !== false) {
6459
- _this2.dispatchExternal("dataLoaded", data);
6482
+ _this2.dispatchExternal("dataLoaded", rowData);
6460
6483
 
6461
6484
  _this2.table.rowManager.setData(rowData, replace, !replace);
6462
6485
  }
@@ -6573,9 +6596,10 @@
6573
6596
  }(CoreFeature);
6574
6597
 
6575
6598
  var ExternalEventBus = /*#__PURE__*/function () {
6576
- function ExternalEventBus(optionsList, debug) {
6599
+ function ExternalEventBus(table, optionsList, debug) {
6577
6600
  _classCallCheck(this, ExternalEventBus);
6578
6601
 
6602
+ this.table = table;
6579
6603
  this.events = {};
6580
6604
  this.optionsList = optionsList || {};
6581
6605
  this.subscriptionNotifiers = {};
@@ -6661,7 +6685,7 @@
6661
6685
 
6662
6686
  if (this.events[key]) {
6663
6687
  this.events[key].forEach(function (callback, i) {
6664
- var callResult = callback.apply(_this, args);
6688
+ var callResult = callback.apply(_this.table, args);
6665
6689
 
6666
6690
  if (!i) {
6667
6691
  result = callResult;
@@ -7392,7 +7416,7 @@
7392
7416
  _createClass(Localize, [{
7393
7417
  key: "initialize",
7394
7418
  value: function initialize() {
7395
- this.langList = Helpers$1.deepClone(Localize.langs);
7419
+ this.langList = Helpers.deepClone(Localize.langs);
7396
7420
 
7397
7421
  if (this.table.options.columnDefaults.headerFilterPlaceholder !== false) {
7398
7422
  this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);
@@ -7487,7 +7511,7 @@
7487
7511
 
7488
7512
  this.locale = desiredLocale; //load default lang template
7489
7513
 
7490
- this.lang = Helpers$1.deepClone(this.langList["default"] || {});
7514
+ this.lang = Helpers.deepClone(this.langList["default"] || {});
7491
7515
 
7492
7516
  if (desiredLocale != "default") {
7493
7517
  traverseLang(this.langList[desiredLocale], this.lang);
@@ -7765,6 +7789,8 @@
7765
7789
 
7766
7790
  this.rtl = false; //check if the table is in RTL mode
7767
7791
 
7792
+ this.originalElement = null; //hold original table element if it has been replaced
7793
+
7768
7794
  this.componentFunctionBinder = new ComponentFuctionBinder(this); //bind component functions
7769
7795
 
7770
7796
  this.dataLoader = false; //bind component functions
@@ -7823,36 +7849,13 @@
7823
7849
 
7824
7850
  this._mapDepricatedFunctionality();
7825
7851
 
7826
- this.externalEvents = new ExternalEventBus(this.options, this.options.debugEventsExternal);
7852
+ this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
7827
7853
  this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
7828
7854
  this.interactionMonitor = new InteractionManager(this);
7829
7855
  this.dataLoader.initialize();
7830
7856
  this.columnManager.initialize();
7831
7857
  this.rowManager.initialize();
7832
7858
  this.footerManager.initialize();
7833
- }
7834
- }, {
7835
- key: "rtlCheck",
7836
- value: function rtlCheck() {
7837
- var style = window.getComputedStyle(this.element);
7838
-
7839
- switch (this.options.textDirection) {
7840
- case "auto":
7841
- if (style.direction !== "rtl") {
7842
- break;
7843
- }
7844
-
7845
- case "rtl":
7846
- this.element.classList.add("tabulator-rtl");
7847
- this.rtl = true;
7848
- break;
7849
-
7850
- case "ltr":
7851
- this.element.classList.add("tabulator-ltr");
7852
-
7853
- default:
7854
- this.rtl = false;
7855
- }
7856
7859
  } //convert depricated functionality to new functions
7857
7860
 
7858
7861
  }, {
@@ -7885,14 +7888,40 @@
7885
7888
  value: function _create() {
7886
7889
  this.externalEvents.dispatch("tableBuilding");
7887
7890
  this.eventBus.dispatch("table-building");
7888
- this.rtlCheck();
7891
+
7892
+ this._rtlCheck();
7889
7893
 
7890
7894
  this._buildElement();
7891
7895
 
7896
+ this._initializeTable();
7897
+
7892
7898
  this._loadInitialData();
7893
7899
 
7894
7900
  this.initialized = true;
7895
7901
  this.externalEvents.dispatch("tableBuilt");
7902
+ }
7903
+ }, {
7904
+ key: "_rtlCheck",
7905
+ value: function _rtlCheck() {
7906
+ var style = window.getComputedStyle(this.element);
7907
+
7908
+ switch (this.options.textDirection) {
7909
+ case "auto":
7910
+ if (style.direction !== "rtl") {
7911
+ break;
7912
+ }
7913
+
7914
+ case "rtl":
7915
+ this.element.classList.add("tabulator-rtl");
7916
+ this.rtl = true;
7917
+ break;
7918
+
7919
+ case "ltr":
7920
+ this.element.classList.add("tabulator-ltr");
7921
+
7922
+ default:
7923
+ this.rtl = false;
7924
+ }
7896
7925
  } //clear pointers to objects in default config object
7897
7926
 
7898
7927
  }, {
@@ -7909,7 +7938,26 @@
7909
7938
  key: "_buildElement",
7910
7939
  value: function _buildElement() {
7911
7940
  var element = this.element,
7912
- options = this.options;
7941
+ options = this.options,
7942
+ newElement;
7943
+
7944
+ if (element.tagName === "TABLE") {
7945
+ this.originalElement = this.element;
7946
+ newElement = document.createElement("div"); //transfer attributes to new element
7947
+
7948
+ var attributes = element.attributes; // loop through attributes and apply them on div
7949
+
7950
+ for (var i in attributes) {
7951
+ if (_typeof(attributes[i]) == "object") {
7952
+ newElement.setAttribute(attributes[i].name, attributes[i].value);
7953
+ }
7954
+ } // replace table with div element
7955
+
7956
+
7957
+ element.parentNode.replaceChild(newElement, element);
7958
+ this.element = element = newElement;
7959
+ }
7960
+
7913
7961
  element.classList.add("tabulator");
7914
7962
  element.setAttribute("role", "grid"); //empty element
7915
7963
 
@@ -7934,7 +7982,13 @@
7934
7982
  options.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + "px";
7935
7983
  element.style.maxHeight = options.maxHeight;
7936
7984
  }
7985
+ } //initialize core systems and modules
7937
7986
 
7987
+ }, {
7988
+ key: "_initializeTable",
7989
+ value: function _initializeTable() {
7990
+ var element = this.element,
7991
+ options = this.options;
7938
7992
  this.columnManager.initialize();
7939
7993
  this.rowManager.initialize();
7940
7994
 
@@ -8112,7 +8166,11 @@
8112
8166
  }, {
8113
8167
  key: "replaceData",
8114
8168
  value: function replaceData(data, params, config) {
8115
- return this.dataLoader.load(data, params, config, true, true);
8169
+ if (this.initialized) {
8170
+ return this.dataLoader.load(data, params, config, true, true);
8171
+ } else {
8172
+ console.warn("replaceData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
8173
+ }
8116
8174
  } //update table data
8117
8175
 
8118
8176
  }, {
@@ -8121,59 +8179,68 @@
8121
8179
  var _this3 = this;
8122
8180
 
8123
8181
  var responses = 0;
8124
- return new Promise(function (resolve, reject) {
8125
- _this3.dataLoader.blockActiveLoad();
8126
8182
 
8127
- if (typeof data === "string") {
8128
- data = JSON.parse(data);
8129
- }
8183
+ if (this.initialized) {
8184
+ return new Promise(function (resolve, reject) {
8185
+ _this3.dataLoader.blockActiveLoad();
8130
8186
 
8131
- if (data) {
8132
- data.forEach(function (item) {
8133
- var row = _this3.rowManager.findRow(item[_this3.options.index]);
8187
+ if (typeof data === "string") {
8188
+ data = JSON.parse(data);
8189
+ }
8134
8190
 
8135
- if (row) {
8136
- responses++;
8137
- row.updateData(item).then(function () {
8138
- responses--;
8191
+ if (data) {
8192
+ data.forEach(function (item) {
8193
+ var row = _this3.rowManager.findRow(item[_this3.options.index]);
8139
8194
 
8140
- if (!responses) {
8141
- resolve();
8142
- }
8143
- });
8144
- }
8145
- });
8146
- } else {
8147
- console.warn("Update Error - No data provided");
8148
- reject("Update Error - No data provided");
8149
- }
8150
- });
8195
+ if (row) {
8196
+ responses++;
8197
+ row.updateData(item).then(function () {
8198
+ responses--;
8199
+
8200
+ if (!responses) {
8201
+ resolve();
8202
+ }
8203
+ });
8204
+ }
8205
+ });
8206
+ } else {
8207
+ console.warn("Update Error - No data provided");
8208
+ reject("Update Error - No data provided");
8209
+ }
8210
+ });
8211
+ } else {
8212
+ console.warn("updateData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
8213
+ }
8151
8214
  }
8152
8215
  }, {
8153
8216
  key: "addData",
8154
8217
  value: function addData(data, pos, index) {
8155
8218
  var _this4 = this;
8156
8219
 
8157
- return new Promise(function (resolve, reject) {
8158
- _this4.dataLoader.blockActiveLoad();
8220
+ if (this.initialized) {
8221
+ return new Promise(function (resolve, reject) {
8222
+ _this4.dataLoader.blockActiveLoad();
8159
8223
 
8160
- if (typeof data === "string") {
8161
- data = JSON.parse(data);
8162
- }
8224
+ if (typeof data === "string") {
8225
+ data = JSON.parse(data);
8226
+ }
8163
8227
 
8164
- if (data) {
8165
- _this4.rowManager.addRows(data, pos, index).then(function (rows) {
8166
- var output = [];
8167
- rows.forEach(function (row) {
8168
- output.push(row.getComponent());
8228
+ if (data) {
8229
+ _this4.rowManager.addRows(data, pos, index).then(function (rows) {
8230
+ var output = [];
8231
+ rows.forEach(function (row) {
8232
+ output.push(row.getComponent());
8233
+ });
8234
+ resolve(output);
8169
8235
  });
8170
- resolve(output);
8171
- });
8172
- } else {
8173
- console.warn("Update Error - No data provided");
8174
- reject("Update Error - No data provided");
8175
- }
8176
- });
8236
+ } else {
8237
+ console.warn("Update Error - No data provided");
8238
+ reject("Update Error - No data provided");
8239
+ }
8240
+ });
8241
+ } else {
8242
+ console.warn("addData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
8243
+ }
8177
8244
  } //update table data
8178
8245
 
8179
8246
  }, {
@@ -8183,44 +8250,49 @@
8183
8250
 
8184
8251
  var rows = [],
8185
8252
  responses = 0;
8186
- return new Promise(function (resolve, reject) {
8187
- _this5.dataLoader.blockActiveLoad();
8188
8253
 
8189
- if (typeof data === "string") {
8190
- data = JSON.parse(data);
8191
- }
8254
+ if (this.initialized) {
8255
+ return new Promise(function (resolve, reject) {
8256
+ _this5.dataLoader.blockActiveLoad();
8192
8257
 
8193
- if (data) {
8194
- data.forEach(function (item) {
8195
- var row = _this5.rowManager.findRow(item[_this5.options.index]);
8258
+ if (typeof data === "string") {
8259
+ data = JSON.parse(data);
8260
+ }
8196
8261
 
8197
- responses++;
8262
+ if (data) {
8263
+ data.forEach(function (item) {
8264
+ var row = _this5.rowManager.findRow(item[_this5.options.index]);
8198
8265
 
8199
- if (row) {
8200
- row.updateData(item).then(function () {
8201
- responses--;
8202
- rows.push(row.getComponent());
8266
+ responses++;
8203
8267
 
8204
- if (!responses) {
8205
- resolve(rows);
8206
- }
8207
- });
8208
- } else {
8209
- _this5.rowManager.addRows(item).then(function (newRows) {
8210
- responses--;
8211
- rows.push(newRows[0].getComponent());
8268
+ if (row) {
8269
+ row.updateData(item).then(function () {
8270
+ responses--;
8271
+ rows.push(row.getComponent());
8212
8272
 
8213
- if (!responses) {
8214
- resolve(rows);
8215
- }
8216
- });
8217
- }
8218
- });
8219
- } else {
8220
- console.warn("Update Error - No data provided");
8221
- reject("Update Error - No data provided");
8222
- }
8223
- });
8273
+ if (!responses) {
8274
+ resolve(rows);
8275
+ }
8276
+ });
8277
+ } else {
8278
+ _this5.rowManager.addRows(item).then(function (newRows) {
8279
+ responses--;
8280
+ rows.push(newRows[0].getComponent());
8281
+
8282
+ if (!responses) {
8283
+ resolve(rows);
8284
+ }
8285
+ });
8286
+ }
8287
+ });
8288
+ } else {
8289
+ console.warn("Update Error - No data provided");
8290
+ reject("Update Error - No data provided");
8291
+ }
8292
+ });
8293
+ } else {
8294
+ console.warn("updateOrAddData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
8295
+ }
8224
8296
  } //get row object
8225
8297
 
8226
8298
  }, {
@@ -8298,13 +8370,17 @@
8298
8370
  }, {
8299
8371
  key: "addRow",
8300
8372
  value: function addRow(data, pos, index) {
8301
- if (typeof data === "string") {
8302
- data = JSON.parse(data);
8303
- }
8373
+ if (this.initialized) {
8374
+ if (typeof data === "string") {
8375
+ data = JSON.parse(data);
8376
+ }
8304
8377
 
8305
- return this.rowManager.addRows(data, pos, index).then(function (rows) {
8306
- return rows[0].getComponent();
8307
- });
8378
+ return this.rowManager.addRows(data, pos, index).then(function (rows) {
8379
+ return rows[0].getComponent();
8380
+ });
8381
+ } else {
8382
+ console.warn("addRow failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
8383
+ }
8308
8384
  } //update a row if it exitsts otherwise create it
8309
8385
 
8310
8386
  }, {
@@ -8372,7 +8448,11 @@
8372
8448
  }, {
8373
8449
  key: "getRows",
8374
8450
  value: function getRows(active) {
8375
- return this.rowManager.getComponents(active);
8451
+ if (this.initialized) {
8452
+ return this.rowManager.getComponents(active);
8453
+ } else {
8454
+ console.warn("getRows failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
8455
+ }
8376
8456
  } //get position of row in table
8377
8457
 
8378
8458
  }, {
@@ -8391,7 +8471,11 @@
8391
8471
  }, {
8392
8472
  key: "setColumns",
8393
8473
  value: function setColumns(definition) {
8394
- this.columnManager.setColumns(definition);
8474
+ if (this.initialized) {
8475
+ this.columnManager.setColumns(definition);
8476
+ } else {
8477
+ console.warn("setColumns failed - table not yet initialized. To set initial data please use the 'columns' property in the table constructor.");
8478
+ }
8395
8479
  }
8396
8480
  }, {
8397
8481
  key: "getColumns",
@@ -8525,8 +8609,12 @@
8525
8609
  }, {
8526
8610
  key: "redraw",
8527
8611
  value: function redraw(force) {
8528
- this.columnManager.redraw(force);
8529
- this.rowManager.redraw(force);
8612
+ if (this.initialized) {
8613
+ this.columnManager.redraw(force);
8614
+ this.rowManager.redraw(force);
8615
+ } else {
8616
+ console.warn("redraw failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
8617
+ }
8530
8618
  }
8531
8619
  }, {
8532
8620
  key: "setHeight",
@@ -8644,6 +8732,8 @@
8644
8732
  }, {
8645
8733
  key: "initializeColumn",
8646
8734
  value: function initializeColumn(column) {
8735
+ var _this2 = this;
8736
+
8647
8737
  var match = false,
8648
8738
  config = {};
8649
8739
  this.allowedTypes.forEach(function (type) {
@@ -8651,7 +8741,7 @@
8651
8741
  accessor;
8652
8742
 
8653
8743
  if (column.definition[key]) {
8654
- accessor = this.lookupAccessor(column.definition[key]);
8744
+ accessor = _this2.lookupAccessor(column.definition[key]);
8655
8745
 
8656
8746
  if (accessor) {
8657
8747
  match = true;
@@ -8696,7 +8786,7 @@
8696
8786
  var key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)),
8697
8787
  rowComponent = row.getComponent(); //clone data object with deep copy to isolate internal data from returned result
8698
8788
 
8699
- var data = Helpers$1.deepClone(row.data || {});
8789
+ var data = Helpers.deepClone(row.data || {});
8700
8790
  this.table.columnManager.traverse(function (column) {
8701
8791
  var value, accessor, params, colCompnent;
8702
8792
 
@@ -8857,6 +8947,28 @@
8857
8947
  });
8858
8948
  }
8859
8949
 
8950
+ function generateParamsList$1(data, prefix) {
8951
+ var output = [];
8952
+ prefix = prefix || "";
8953
+
8954
+ if (Array.isArray(data)) {
8955
+ data.forEach(function (item, i) {
8956
+ output = output.concat(generateParamsList$1(item, prefix ? prefix + "[" + i + "]" : i));
8957
+ });
8958
+ } else if (_typeof(data) === "object") {
8959
+ for (var key in data) {
8960
+ output = output.concat(generateParamsList$1(data[key], prefix ? prefix + "[" + key + "]" : key));
8961
+ }
8962
+ } else {
8963
+ output.push({
8964
+ key: prefix,
8965
+ value: data
8966
+ });
8967
+ }
8968
+
8969
+ return output;
8970
+ }
8971
+
8860
8972
  var defaultContentTypeFormatters = {
8861
8973
  "json": {
8862
8974
  headers: {
@@ -8869,7 +8981,7 @@
8869
8981
  "form": {
8870
8982
  headers: {},
8871
8983
  body: function body(url, config, params) {
8872
- var output = this.generateParamsList(params),
8984
+ var output = generateParamsList$1(params),
8873
8985
  form = new FormData();
8874
8986
  output.forEach(function (item) {
8875
8987
  form.append(item.key, item.value);
@@ -9959,7 +10071,7 @@
9959
10071
  this.table.modules.mutator.disable();
9960
10072
  }
9961
10073
 
9962
- row = new Row$1(rowData, this, "calc");
10074
+ row = new Row(rowData, this, "calc");
9963
10075
 
9964
10076
  if (this.table.modExists("mutator")) {
9965
10077
  this.table.modules.mutator.enable();
@@ -10000,7 +10112,7 @@
10000
10112
 
10001
10113
  _this4.genColumn.definition.cssClass = column.definition.cssClass; //generate cell and assign to correct column
10002
10114
 
10003
- var cell = new Cell$1(_this4.genColumn, row);
10115
+ var cell = new Cell(_this4.genColumn, row);
10004
10116
  cell.getElement();
10005
10117
  cell.column = column;
10006
10118
  cell.setWidth();
@@ -10434,7 +10546,7 @@
10434
10546
  var config, children;
10435
10547
  output.push(row);
10436
10548
 
10437
- if (row instanceof Row$1) {
10549
+ if (row instanceof Row) {
10438
10550
  row.create();
10439
10551
  config = row.modules.dataTree.children;
10440
10552
 
@@ -10499,7 +10611,7 @@
10499
10611
  }
10500
10612
 
10501
10613
  childArray.forEach(function (childData) {
10502
- var childRow = new Row$1(childData || {}, _this6.table.rowManager);
10614
+ var childRow = new Row(childData || {}, _this6.table.rowManager);
10503
10615
  childRow.create();
10504
10616
  childRow.modules.dataTree.index = row.modules.dataTree.index + 1;
10505
10617
  childRow.modules.dataTree.parent = row;
@@ -10573,7 +10685,7 @@
10573
10685
  }
10574
10686
 
10575
10687
  children.forEach(function (childRow) {
10576
- if (childRow instanceof Row$1) {
10688
+ if (childRow instanceof Row) {
10577
10689
  output.push(childRow);
10578
10690
  }
10579
10691
  });
@@ -10646,7 +10758,7 @@
10646
10758
  var match = false;
10647
10759
 
10648
10760
  if (_typeof(subject) == "object") {
10649
- if (subject instanceof Row$1) {
10761
+ if (subject instanceof Row) {
10650
10762
  //subject is row element
10651
10763
  match = subject.data;
10652
10764
  } else if (subject instanceof RowComponent) {
@@ -10655,7 +10767,7 @@
10655
10767
  } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) {
10656
10768
  if (parent.modules.dataTree) {
10657
10769
  match = parent.modules.dataTree.children.find(function (childRow) {
10658
- return childRow instanceof Row$1 ? childRow.element === subject : false;
10770
+ return childRow instanceof Row ? childRow.element === subject : false;
10659
10771
  });
10660
10772
 
10661
10773
  if (match) {
@@ -10699,7 +10811,7 @@
10699
10811
  }
10700
10812
 
10701
10813
  config.children.forEach(function (childRow) {
10702
- if (childRow instanceof Row$1) {
10814
+ if (childRow instanceof Row) {
10703
10815
  output.push(component ? childRow.getComponent() : childRow);
10704
10816
 
10705
10817
  if (recurse) {
@@ -10715,7 +10827,7 @@
10715
10827
  key: "checkForRestyle",
10716
10828
  value: function checkForRestyle(cell) {
10717
10829
  if (!cell.row.cells.indexOf(cell)) {
10718
- cell.row.reinitialize();
10830
+ this.layoutRow(cell.row);
10719
10831
  }
10720
10832
  }
10721
10833
  }, {
@@ -12015,7 +12127,7 @@
12015
12127
  parseItems(editorParams.values || [], initialDisplayValue);
12016
12128
  }
12017
12129
 
12018
- var offset = Helpers$1.elOffset(cellEl);
12130
+ var offset = Helpers.elOffset(cellEl);
12019
12131
  listEl.style.minWidth = cellEl.offsetWidth + "px";
12020
12132
  listEl.style.top = offset.top + cellEl.offsetHeight + "px";
12021
12133
  listEl.style.left = offset.left + "px";
@@ -12471,7 +12583,7 @@
12471
12583
  listEl.removeChild(listEl.firstChild);
12472
12584
  }
12473
12585
 
12474
- var offset = Helpers$1.elOffset(cellEl);
12586
+ var offset = Helpers.elOffset(cellEl);
12475
12587
  listEl.style.minWidth = cellEl.offsetWidth + "px";
12476
12588
  listEl.style.top = offset.top + cellEl.offsetHeight + "px";
12477
12589
  listEl.style.left = offset.left + "px";
@@ -12778,9 +12890,11 @@
12778
12890
 
12779
12891
  //draggable progress bar
12780
12892
  function progress (cell, onRendered, success, cancel, editorParams) {
12893
+ var _element$getElementsB, _element$getElementsB2;
12894
+
12781
12895
  var element = cell.getElement(),
12782
- max = typeof editorParams.max === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("max") || 100 : editorParams.max,
12783
- min = typeof editorParams.min === "undefined" ? element.getElementsByTagName("div")[0].getAttribute("min") || 0 : editorParams.min,
12896
+ max = typeof editorParams.max === "undefined" ? ((_element$getElementsB = element.getElementsByTagName("div")[0]) === null || _element$getElementsB === void 0 ? void 0 : _element$getElementsB.getAttribute("max")) || 100 : editorParams.max,
12897
+ min = typeof editorParams.min === "undefined" ? ((_element$getElementsB2 = element.getElementsByTagName("div")[0]) === null || _element$getElementsB2 === void 0 ? void 0 : _element$getElementsB2.getAttribute("min")) || 0 : editorParams.min,
12784
12898
  percent = (max - min) / 100,
12785
12899
  value = cell.getValue() || 0,
12786
12900
  handle = document.createElement("div"),
@@ -13173,7 +13287,7 @@
13173
13287
  nextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);
13174
13288
 
13175
13289
  if (nextCell) {
13176
- nextCell.edit();
13290
+ nextCell.getComponent().edit();
13177
13291
  return true;
13178
13292
  }
13179
13293
  }
@@ -13205,7 +13319,7 @@
13205
13319
  nextCell = this.findNextEditableCell(nextRow, -1);
13206
13320
 
13207
13321
  if (nextCell) {
13208
- nextCell.edit();
13322
+ nextCell.getComponent().edit();
13209
13323
  return true;
13210
13324
  }
13211
13325
  }
@@ -13230,7 +13344,7 @@
13230
13344
  nextCell = this.findPrevEditableCell(cell.row, index);
13231
13345
 
13232
13346
  if (nextCell) {
13233
- nextCell.edit();
13347
+ nextCell.getComponent().edit();
13234
13348
  return true;
13235
13349
  }
13236
13350
  }
@@ -13253,7 +13367,7 @@
13253
13367
  nextCell = this.findNextEditableCell(cell.row, index);
13254
13368
 
13255
13369
  if (nextCell) {
13256
- nextCell.edit();
13370
+ nextCell.getComponent().edit();
13257
13371
  return true;
13258
13372
  }
13259
13373
  }
@@ -13276,7 +13390,7 @@
13276
13390
  nextRow = this.table.rowManager.prevDisplayRow(cell.row, true);
13277
13391
 
13278
13392
  if (nextRow) {
13279
- nextRow.cells[index].edit();
13393
+ nextRow.cells[index].getComponent().edit();
13280
13394
  return true;
13281
13395
  }
13282
13396
  }
@@ -13299,7 +13413,7 @@
13299
13413
  nextRow = this.table.rowManager.nextDisplayRow(cell.row, true);
13300
13414
 
13301
13415
  if (nextRow) {
13302
- nextRow.cells[index].edit();
13416
+ nextRow.cells[index].getComponent().edit();
13303
13417
  return true;
13304
13418
  }
13305
13419
  }
@@ -14500,6 +14614,8 @@
14500
14614
  _this.prevHeaderFilterChangeCheck = "{}";
14501
14615
  _this.changed = false; //has filtering changed since last render
14502
14616
 
14617
+ _this.tableInitialized = false;
14618
+
14503
14619
  _this.registerTableOption("filterMode", "local"); //local or remote filtering
14504
14620
 
14505
14621
 
@@ -14598,6 +14714,8 @@
14598
14714
  }
14599
14715
  });
14600
14716
  }
14717
+
14718
+ this.tableInitialized = true;
14601
14719
  }
14602
14720
  }, {
14603
14721
  key: "remoteFilterParams",
@@ -15066,10 +15184,12 @@
15066
15184
  }, {
15067
15185
  key: "refreshFilter",
15068
15186
  value: function refreshFilter() {
15069
- if (this.table.options.filterMode === "remote") {
15070
- this.reloadData();
15071
- } else {
15072
- this.refreshData();
15187
+ if (this.tableInitialized) {
15188
+ if (this.table.options.filterMode === "remote") {
15189
+ this.reloadData();
15190
+ } else {
15191
+ this.refreshData();
15192
+ }
15073
15193
  } //TODO - Persist left position of row manager
15074
15194
  // left = this.scrollLeft;
15075
15195
  // this.scrollHorizontal(left);
@@ -15451,12 +15571,14 @@
15451
15571
 
15452
15572
  function money (cell, formatterParams, onRendered) {
15453
15573
  var floatVal = parseFloat(cell.getValue()),
15574
+ sign = "",
15454
15575
  number,
15455
15576
  integer,
15456
15577
  decimal,
15457
15578
  rgx;
15458
15579
  var decimalSym = formatterParams.decimal || ".";
15459
15580
  var thousandSym = formatterParams.thousand || ",";
15581
+ var negativeSign = formatterParams.negativeSign || "-";
15460
15582
  var symbol = formatterParams.symbol || "";
15461
15583
  var after = !!formatterParams.symbolAfter;
15462
15584
  var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2;
@@ -15465,6 +15587,11 @@
15465
15587
  return this.emptyToSpace(this.sanitizeHTML(cell.getValue()));
15466
15588
  }
15467
15589
 
15590
+ if (floatVal < 0) {
15591
+ floatVal = Math.abs(floatVal);
15592
+ sign = negativeSign;
15593
+ }
15594
+
15468
15595
  number = precision !== false ? floatVal.toFixed(precision) : floatVal;
15469
15596
  number = String(number).split(".");
15470
15597
  integer = number[0];
@@ -15475,7 +15602,7 @@
15475
15602
  integer = integer.replace(rgx, "$1" + thousandSym + "$2");
15476
15603
  }
15477
15604
 
15478
- return after ? integer + decimal + symbol : symbol + integer + decimal;
15605
+ return after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;
15479
15606
  }
15480
15607
 
15481
15608
  function link (cell, formatterParams, onRendered) {
@@ -16382,29 +16509,52 @@
16382
16509
  if (this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow) {
16383
16510
  this.layoutRow(this.table.modules.columnCalcs.botRow);
16384
16511
  }
16512
+
16513
+ if (this.table.modExists("groupRows")) {
16514
+ this.layoutGroupCalcs(this.table.modules.groupRows.getGroups());
16515
+ }
16385
16516
  }
16517
+ }
16518
+ }, {
16519
+ key: "layoutGroupCalcs",
16520
+ value: function layoutGroupCalcs(groups) {
16521
+ var _this3 = this;
16522
+
16523
+ groups.forEach(function (group) {
16524
+ if (group.calcs.top) {
16525
+ _this3.layoutRow(group.calcs.top);
16526
+ }
16527
+
16528
+ if (group.calcs.bottom) {
16529
+ _this3.layoutRow(group.calcs.bottom);
16530
+ }
16531
+
16532
+ if (group.groupList && group.groupList.length) {
16533
+ _this3.layoutGroupCalcs(group.groupList && group.groupList);
16534
+ }
16535
+ });
16386
16536
  } //calculate column positions and layout headers
16387
16537
 
16388
16538
  }, {
16389
16539
  key: "layoutColumnPosition",
16390
16540
  value: function layoutColumnPosition(allCells) {
16391
- var _this3 = this;
16541
+ var _this4 = this;
16392
16542
 
16393
16543
  var leftParents = [];
16394
16544
  this.leftColumns.forEach(function (column, i) {
16395
- column.modules.frozen.margin = _this3._calcSpace(_this3.leftColumns, i) + _this3.table.columnManager.scrollLeft + "px";
16545
+ column.modules.frozen.margin = _this4._calcSpace(_this4.leftColumns, i) + _this4.table.columnManager.scrollLeft + "px";
16396
16546
 
16397
- if (i == _this3.leftColumns.length - 1) {
16547
+ if (i == _this4.leftColumns.length - 1) {
16398
16548
  column.modules.frozen.edge = true;
16399
16549
  } else {
16400
16550
  column.modules.frozen.edge = false;
16401
16551
  }
16402
16552
 
16403
16553
  if (column.parent.isGroup) {
16404
- var parentEl = _this3.getColGroupParentElement(column);
16554
+ var parentEl = _this4.getColGroupParentElement(column);
16405
16555
 
16406
16556
  if (!leftParents.includes(parentEl)) {
16407
- _this3.layoutElement(parentEl, column);
16557
+ _this4.layoutElement(parentEl, column);
16408
16558
 
16409
16559
  leftParents.push(parentEl);
16410
16560
  }
@@ -16413,33 +16563,33 @@
16413
16563
  parentEl.classList.add("tabulator-frozen-" + column.modules.frozen.position);
16414
16564
  }
16415
16565
  } else {
16416
- _this3.layoutElement(column.getElement(), column);
16566
+ _this4.layoutElement(column.getElement(), column);
16417
16567
  }
16418
16568
 
16419
16569
  if (allCells) {
16420
16570
  column.cells.forEach(function (cell) {
16421
- _this3.layoutElement(cell.getElement(true), column);
16571
+ _this4.layoutElement(cell.getElement(true), column);
16422
16572
  });
16423
16573
  }
16424
16574
  });
16425
16575
  this.rightColumns.forEach(function (column, i) {
16426
- column.modules.frozen.margin = _this3.rightPadding - _this3._calcSpace(_this3.rightColumns, i + 1) + "px";
16576
+ column.modules.frozen.margin = _this4.rightPadding - _this4._calcSpace(_this4.rightColumns, i + 1) + "px";
16427
16577
 
16428
- if (i == _this3.rightColumns.length - 1) {
16578
+ if (i == _this4.rightColumns.length - 1) {
16429
16579
  column.modules.frozen.edge = true;
16430
16580
  } else {
16431
16581
  column.modules.frozen.edge = false;
16432
16582
  }
16433
16583
 
16434
16584
  if (column.parent.isGroup) {
16435
- _this3.layoutElement(_this3.getColGroupParentElement(column), column);
16585
+ _this4.layoutElement(_this4.getColGroupParentElement(column), column);
16436
16586
  } else {
16437
- _this3.layoutElement(column.getElement(), column);
16587
+ _this4.layoutElement(column.getElement(), column);
16438
16588
  }
16439
16589
 
16440
16590
  if (allCells) {
16441
16591
  column.cells.forEach(function (cell) {
16442
- _this3.layoutElement(cell.getElement(true), column);
16592
+ _this4.layoutElement(cell.getElement(true), column);
16443
16593
  });
16444
16594
  }
16445
16595
  });
@@ -16453,14 +16603,14 @@
16453
16603
  }, {
16454
16604
  key: "layout",
16455
16605
  value: function layout() {
16456
- var _this4 = this;
16606
+ var _this5 = this;
16457
16607
 
16458
16608
  if (this.active) {
16459
16609
  //calculate row padding
16460
16610
  this.calcMargins();
16461
16611
  this.table.rowManager.getDisplayRows().forEach(function (row) {
16462
16612
  if (row.type === "row") {
16463
- _this4.layoutRow(row);
16613
+ _this5.layoutRow(row);
16464
16614
  }
16465
16615
  });
16466
16616
  this.layoutCalcRows(); //calculate left columns
@@ -16472,7 +16622,7 @@
16472
16622
  }, {
16473
16623
  key: "layoutRow",
16474
16624
  value: function layoutRow(row) {
16475
- var _this5 = this;
16625
+ var _this6 = this;
16476
16626
 
16477
16627
  var rowEl = row.getElement();
16478
16628
  rowEl.style.paddingLeft = this.leftMargin;
@@ -16480,14 +16630,14 @@
16480
16630
  var cell = row.getCell(column);
16481
16631
 
16482
16632
  if (cell) {
16483
- _this5.layoutElement(cell.getElement(true), column);
16633
+ _this6.layoutElement(cell.getElement(true), column);
16484
16634
  }
16485
16635
  });
16486
16636
  this.rightColumns.forEach(function (column) {
16487
16637
  var cell = row.getCell(column);
16488
16638
 
16489
16639
  if (cell) {
16490
- _this5.layoutElement(cell.getElement(true), column);
16640
+ _this6.layoutElement(cell.getElement(true), column);
16491
16641
  }
16492
16642
  });
16493
16643
  }
@@ -16623,7 +16773,11 @@
16623
16773
 
16624
16774
  if (index > -1) {
16625
16775
  var rowEl = row.getElement();
16626
- rowEl.parentNode.removeChild(rowEl);
16776
+
16777
+ if (rowEl.parentNode) {
16778
+ rowEl.parentNode.removeChild(rowEl);
16779
+ }
16780
+
16627
16781
  this.rows.splice(index, 1);
16628
16782
  }
16629
16783
  }
@@ -17331,7 +17485,7 @@
17331
17485
  this.initialized = false;
17332
17486
  this.height = 0;
17333
17487
 
17334
- if (Helpers$1.elVisible(this.element)) {
17488
+ if (Helpers.elVisible(this.element)) {
17335
17489
  this.initialize(true);
17336
17490
  }
17337
17491
  }
@@ -17365,7 +17519,10 @@
17365
17519
  value: function setCellHeight() {}
17366
17520
  }, {
17367
17521
  key: "clearCellHeight",
17368
- value: function clearCellHeight() {} //////////////// Object Generation /////////////////
17522
+ value: function clearCellHeight() {}
17523
+ }, {
17524
+ key: "deinitializeHeight",
17525
+ value: function deinitializeHeight() {} //////////////// Object Generation /////////////////
17369
17526
 
17370
17527
  }, {
17371
17528
  key: "getComponent",
@@ -17458,6 +17615,30 @@
17458
17615
  _createClass(GroupRows, [{
17459
17616
  key: "initialize",
17460
17617
  value: function initialize() {
17618
+ if (this.table.options.groupBy) {
17619
+ this.configureGroupSetup();
17620
+
17621
+ if (this.table.options.groupUpdateOnCellEdit) {
17622
+ this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
17623
+ this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
17624
+ }
17625
+
17626
+ this.subscribe("row-deleting", this.rowDeleting.bind(this));
17627
+ this.subscribe("row-deleted", this.rowsUpdated.bind(this));
17628
+ this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
17629
+ this.subscribe("rows-wipe", this.wipe.bind(this));
17630
+ this.subscribe("rows-added", this.rowsUpdated.bind(this));
17631
+ this.subscribe("row-moving", this.rowMoving.bind(this));
17632
+ this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
17633
+ this.subscribe("rows-sample", this.rowSample.bind(this));
17634
+ this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
17635
+ this.registerDisplayHandler(this.displayHandler, 20);
17636
+ this.initialized = true;
17637
+ }
17638
+ }
17639
+ }, {
17640
+ key: "configureGroupSetup",
17641
+ value: function configureGroupSetup() {
17461
17642
  var _this2 = this;
17462
17643
 
17463
17644
  if (this.table.options.groupBy) {
@@ -17547,23 +17728,6 @@
17547
17728
  if (groupHeader) {
17548
17729
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
17549
17730
  }
17550
-
17551
- if (this.table.options.groupUpdateOnCellEdit) {
17552
- this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
17553
- this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
17554
- }
17555
-
17556
- this.subscribe("row-deleting", this.rowDeleting.bind(this));
17557
- this.subscribe("row-deleted", this.rowsUpdated.bind(this));
17558
- this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
17559
- this.subscribe("rows-wipe", this.wipe.bind(this));
17560
- this.subscribe("rows-added", this.rowsUpdated.bind(this));
17561
- this.subscribe("row-moving", this.rowMoving.bind(this));
17562
- this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
17563
- this.subscribe("rows-sample", this.rowSample.bind(this));
17564
- this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
17565
- this.registerDisplayHandler(this.displayHandler, 20);
17566
- this.initialized = true;
17567
17731
  }
17568
17732
  }
17569
17733
  }, {
@@ -17625,23 +17789,23 @@
17625
17789
  key: "setGroupBy",
17626
17790
  value: function setGroupBy(groups) {
17627
17791
  this.table.options.groupBy = groups;
17628
- this.initialize();
17629
- this.refreshData(false, "display");
17792
+ this.configureGroupSetup();
17793
+ this.refreshData();
17630
17794
  this.trackChanges();
17631
17795
  }
17632
17796
  }, {
17633
17797
  key: "setGroupValues",
17634
17798
  value: function setGroupValues(groupValues) {
17635
17799
  this.table.options.groupValues = groupValues;
17636
- this.initialize();
17637
- this.refreshData(false, "display");
17800
+ this.configureGroupSetup();
17801
+ this.refreshData();
17638
17802
  this.trackChanges();
17639
17803
  }
17640
17804
  }, {
17641
17805
  key: "setGroupStartOpen",
17642
17806
  value: function setGroupStartOpen(values) {
17643
17807
  this.table.options.groupStartOpen = values;
17644
- this.initialize();
17808
+ this.configureGroupSetup();
17645
17809
 
17646
17810
  if (this.table.options.groupBy) {
17647
17811
  this.refreshData();
@@ -17654,7 +17818,7 @@
17654
17818
  key: "setGroupHeader",
17655
17819
  value: function setGroupHeader(values) {
17656
17820
  this.table.options.groupHeader = values;
17657
- this.initialize();
17821
+ this.configureGroupSetup();
17658
17822
 
17659
17823
  if (this.table.options.groupBy) {
17660
17824
  this.refreshData();
@@ -17737,14 +17901,12 @@
17737
17901
  }, {
17738
17902
  key: "getRows",
17739
17903
  value: function getRows(rows) {
17740
- if (this.groupIDLookups.length) {
17741
- if (!Object.keys(this.groups).length) {
17742
- this.dispatchExternal("dataGrouping");
17743
- this.generateGroups(rows);
17904
+ if (this.table.options.groupBy && this.groupIDLookups.length) {
17905
+ this.dispatchExternal("dataGrouping");
17906
+ this.generateGroups(rows);
17744
17907
 
17745
- if (this.subscribedExternal("dataGrouped")) {
17746
- this.dispatchExternal("dataGrouped", this.getGroups(true));
17747
- }
17908
+ if (this.subscribedExternal("dataGrouped")) {
17909
+ this.dispatchExternal("dataGrouped", this.getGroups(true));
17748
17910
  }
17749
17911
 
17750
17912
  return this.updateGroupRows();
@@ -17980,6 +18142,7 @@
17980
18142
  var defaultUndoers = {
17981
18143
  cellEdit: function cellEdit(action) {
17982
18144
  action.component.setValueProcessData(action.data.oldValue);
18145
+ action.component.cellRendered();
17983
18146
  },
17984
18147
  rowAdd: function rowAdd(action) {
17985
18148
  action.component.deleteActual();
@@ -18002,6 +18165,7 @@
18002
18165
  var defaultRedoers = {
18003
18166
  cellEdit: function cellEdit(action) {
18004
18167
  action.component.setValueProcessData(action.data.newValue);
18168
+ action.component.cellRendered();
18005
18169
  },
18006
18170
  rowAdd: function rowAdd(action) {
18007
18171
  var newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);
@@ -18098,7 +18262,7 @@
18098
18262
  }
18099
18263
  }
18100
18264
 
18101
- this.history.action("rowDelete", row, {
18265
+ this.action("rowDelete", row, {
18102
18266
  data: row.getData(),
18103
18267
  pos: !index,
18104
18268
  index: index
@@ -18233,19 +18397,19 @@
18233
18397
  _createClass(HtmlTableImport, [{
18234
18398
  key: "initialize",
18235
18399
  value: function initialize() {
18236
- this.subscribe("table-building", this.tableElementCheck.bind(this));
18400
+ this.tableElementCheck();
18237
18401
  }
18238
18402
  }, {
18239
18403
  key: "tableElementCheck",
18240
18404
  value: function tableElementCheck() {
18241
- if (this.table.element.tagName === "TABLE") {
18405
+ if (this.table.originalElement && this.table.originalElement.tagName === "TABLE") {
18242
18406
  this.parseTable();
18243
18407
  }
18244
18408
  }
18245
18409
  }, {
18246
18410
  key: "parseTable",
18247
18411
  value: function parseTable() {
18248
- var element = this.table.element,
18412
+ var element = this.table.originalElement,
18249
18413
  options = this.table.options,
18250
18414
  columns = options.columns,
18251
18415
  headers = element.getElementsByTagName("th"),
@@ -18283,24 +18447,10 @@
18283
18447
 
18284
18448
 
18285
18449
  data.push(item);
18286
- } //create new element
18287
-
18288
-
18289
- var newElement = document.createElement("div"); //transfer attributes to new element
18290
-
18291
- var attributes = element.attributes; // loop through attributes and apply them on div
18292
-
18293
- for (var i in attributes) {
18294
- if (_typeof(attributes[i]) == "object") {
18295
- newElement.setAttribute(attributes[i].name, attributes[i].value);
18296
- }
18297
- } // replace table with div element
18298
-
18450
+ }
18299
18451
 
18300
- element.parentNode.replaceChild(newElement, element);
18301
18452
  options.data = data;
18302
18453
  this.dispatchExternal("htmlImported");
18303
- this.table.element = newElement;
18304
18454
  } //extract tabulator attribute options
18305
18455
 
18306
18456
  }, {
@@ -18380,7 +18530,7 @@
18380
18530
 
18381
18531
  header.attributes; // //check for tablator inline options
18382
18532
 
18383
- this._extractOptions(header, col, Column.prototype.defaultOptionList);
18533
+ this._extractOptions(header, col, Column$1.prototype.defaultOptionList);
18384
18534
 
18385
18535
  this.fieldIndex[index] = col.field;
18386
18536
 
@@ -18728,7 +18878,7 @@
18728
18878
  callback;
18729
18879
 
18730
18880
  if (this.columnSubscribers[action]) {
18731
- if (component instanceof Cell$1) {
18881
+ if (component instanceof Cell) {
18732
18882
  callback = component.column.definition[action];
18733
18883
  } else if (component instanceof Column$1) {
18734
18884
  callback = component.definition[action];
@@ -19352,7 +19502,7 @@
19352
19502
  y = touch ? e.touches[0].pageY : e.pageY;
19353
19503
  this.positionReversedX = false;
19354
19504
  } else {
19355
- parentOffset = Helpers$1.elOffset(parentEl);
19505
+ parentOffset = Helpers.elOffset(parentEl);
19356
19506
  x = parentOffset.left + parentEl.offsetWidth;
19357
19507
  y = parentOffset.top - 1;
19358
19508
  }
@@ -19492,7 +19642,7 @@
19492
19642
 
19493
19643
  config.mousemove = function (e) {
19494
19644
  if (column.parent === self.moving.parent) {
19495
- if ((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers$1.elOffset(colEl).left + self.table.columnManager.element.scrollLeft > column.getWidth() / 2) {
19645
+ if ((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left + self.table.columnManager.element.scrollLeft > column.getWidth() / 2) {
19496
19646
  if (self.toCol !== column || !self.toColAfter) {
19497
19647
  colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);
19498
19648
  self.moveColumn(column, true);
@@ -19617,9 +19767,11 @@
19617
19767
  }, {
19618
19768
  key: "startMove",
19619
19769
  value: function startMove(e, column) {
19620
- var element = column.getElement();
19770
+ var element = column.getElement(),
19771
+ headerElement = this.table.columnManager.getElement(),
19772
+ headersElement = this.table.columnManager.getHeadersElement();
19621
19773
  this.moving = column;
19622
- this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers$1.elOffset(element).left;
19774
+ this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
19623
19775
  this.table.element.classList.add("tabulator-block-select"); //create placeholder
19624
19776
 
19625
19777
  this.placeholderElement.style.width = column.getWidth() + "px";
@@ -19631,7 +19783,7 @@
19631
19783
  this.hoverElement.classList.add("tabulator-moving");
19632
19784
  this.table.columnManager.getElement().appendChild(this.hoverElement);
19633
19785
  this.hoverElement.style.left = "0";
19634
- this.hoverElement.style.bottom = "0";
19786
+ this.hoverElement.style.bottom = headerElement.clientHeight - headersElement.offsetHeight + "px";
19635
19787
 
19636
19788
  if (!this.touchMove) {
19637
19789
  this._bindMouseMove();
@@ -19671,7 +19823,7 @@
19671
19823
  column.getCells().forEach(function (cell, i) {
19672
19824
  var cellEl = cell.getElement(true);
19673
19825
 
19674
- if (cellEl.parentNode) {
19826
+ if (cellEl.parentNode && movingCells[i]) {
19675
19827
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
19676
19828
  }
19677
19829
  });
@@ -19679,7 +19831,7 @@
19679
19831
  column.getCells().forEach(function (cell, i) {
19680
19832
  var cellEl = cell.getElement(true);
19681
19833
 
19682
- if (cellEl.parentNode) {
19834
+ if (cellEl.parentNode && movingCells[i]) {
19683
19835
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
19684
19836
  }
19685
19837
  });
@@ -19717,7 +19869,7 @@
19717
19869
 
19718
19870
  var columnHolder = this.table.columnManager.getElement(),
19719
19871
  scrollLeft = columnHolder.scrollLeft,
19720
- xPos = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers$1.elOffset(columnHolder).left + scrollLeft,
19872
+ xPos = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left + scrollLeft,
19721
19873
  scrollPos;
19722
19874
  this.hoverElement.style.left = xPos - this.startX + "px";
19723
19875
 
@@ -19841,7 +19993,7 @@
19841
19993
 
19842
19994
 
19843
19995
  config.mousemove = function (e) {
19844
- if (e.pageY - Helpers$1.elOffset(group.element).top + self.table.rowManager.element.scrollTop > group.getHeight() / 2) {
19996
+ if (e.pageY - Helpers.elOffset(group.element).top + self.table.rowManager.element.scrollTop > group.getHeight() / 2) {
19845
19997
  if (self.toRow !== group || !self.toRowAfter) {
19846
19998
  var rowEl = group.getElement();
19847
19999
  rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
@@ -19876,7 +20028,7 @@
19876
20028
  config.mousemove = function (e) {
19877
20029
  var rowEl = row.getElement();
19878
20030
 
19879
- if (e.pageY - Helpers$1.elOffset(rowEl).top + self.table.rowManager.element.scrollTop > row.getHeight() / 2) {
20031
+ if (e.pageY - Helpers.elOffset(rowEl).top + self.table.rowManager.element.scrollTop > row.getHeight() / 2) {
19880
20032
  if (self.toRow !== row || !self.toRowAfter) {
19881
20033
  rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
19882
20034
  self.moveRow(row, true);
@@ -20846,7 +20998,6 @@
20846
20998
  if (Array.isArray(this.table.options.paginationSizeSelector)) {
20847
20999
  pageSizes = this.table.options.paginationSizeSelector;
20848
21000
  this.pageSizes = pageSizes;
20849
- console.log("gen", this.size);
20850
21001
 
20851
21002
  if (this.pageSizes.indexOf(this.size) == -1) {
20852
21003
  pageSizes.unshift(this.size);
@@ -21100,7 +21251,6 @@
21100
21251
  this.generatePageSizeSelectList();
21101
21252
  }
21102
21253
 
21103
- console.log("set", size, this.size);
21104
21254
  this.trackChanges();
21105
21255
  } //setup the pagination buttons
21106
21256
 
@@ -22054,10 +22204,8 @@
22054
22204
  }, {
22055
22205
  key: "watchData",
22056
22206
  value: function watchData(data) {
22057
- var _arguments = arguments,
22058
- _this2 = this;
22059
-
22060
- var version;
22207
+ var self = this,
22208
+ version;
22061
22209
  this.currentVersion++;
22062
22210
  version = this.currentVersion;
22063
22211
  this.unwatchData();
@@ -22068,15 +22216,15 @@
22068
22216
  enumerable: false,
22069
22217
  configurable: true,
22070
22218
  value: function value() {
22071
- var args = Array.from(_arguments);
22219
+ var args = Array.from(arguments);
22072
22220
 
22073
- if (!_this2.blocked && version === _this2.currentVersion) {
22221
+ if (!self.blocked && version === self.currentVersion) {
22074
22222
  args.forEach(function (arg) {
22075
- _this2.table.rowManager.addRowActual(arg, false);
22223
+ self.table.rowManager.addRowActual(arg, false);
22076
22224
  });
22077
22225
  }
22078
22226
 
22079
- return _this2.origFuncs.push.apply(data, _arguments);
22227
+ return self.origFuncs.push.apply(data, arguments);
22080
22228
  }
22081
22229
  }); //override array unshift function
22082
22230
 
@@ -22085,15 +22233,15 @@
22085
22233
  enumerable: false,
22086
22234
  configurable: true,
22087
22235
  value: function value() {
22088
- var args = Array.from(_arguments);
22236
+ var args = Array.from(arguments);
22089
22237
 
22090
- if (!_this2.blocked && version === _this2.currentVersion) {
22238
+ if (!self.blocked && version === self.currentVersion) {
22091
22239
  args.forEach(function (arg) {
22092
- _this2.table.rowManager.addRowActual(arg, true);
22240
+ self.table.rowManager.addRowActual(arg, true);
22093
22241
  });
22094
22242
  }
22095
22243
 
22096
- return _this2.origFuncs.unshift.apply(data, _arguments);
22244
+ return self.origFuncs.unshift.apply(data, arguments);
22097
22245
  }
22098
22246
  }); //override array shift function
22099
22247
 
@@ -22104,9 +22252,9 @@
22104
22252
  value: function value() {
22105
22253
  var row;
22106
22254
 
22107
- if (!_this2.blocked && version === _this2.currentVersion) {
22108
- if (_this2.data.length) {
22109
- row = _this2.table.rowManager.getRowFromDataObject(_this2.data[0]);
22255
+ if (!self.blocked && version === self.currentVersion) {
22256
+ if (self.data.length) {
22257
+ row = self.table.rowManager.getRowFromDataObject(self.data[0]);
22110
22258
 
22111
22259
  if (row) {
22112
22260
  row.deleteActual();
@@ -22114,7 +22262,7 @@
22114
22262
  }
22115
22263
  }
22116
22264
 
22117
- return _this2.origFuncs.shift.call(data);
22265
+ return self.origFuncs.shift.call(data);
22118
22266
  }
22119
22267
  }); //override array pop function
22120
22268
 
@@ -22125,9 +22273,9 @@
22125
22273
  value: function value() {
22126
22274
  var row;
22127
22275
 
22128
- if (!_this2.blocked && version === _this2.currentVersion) {
22129
- if (_this2.data.length) {
22130
- row = _this2.table.rowManager.getRowFromDataObject(_this2.data[_this2.data.length - 1]);
22276
+ if (!self.blocked && version === self.currentVersion) {
22277
+ if (self.data.length) {
22278
+ row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);
22131
22279
 
22132
22280
  if (row) {
22133
22281
  row.deleteActual();
@@ -22135,7 +22283,7 @@
22135
22283
  }
22136
22284
  }
22137
22285
 
22138
- return _this2.origFuncs.pop.call(data);
22286
+ return self.origFuncs.pop.call(data);
22139
22287
  }
22140
22288
  }); //override array splice function
22141
22289
 
@@ -22144,25 +22292,25 @@
22144
22292
  enumerable: false,
22145
22293
  configurable: true,
22146
22294
  value: function value() {
22147
- var args = Array.from(_arguments),
22295
+ var args = Array.from(arguments),
22148
22296
  start = args[0] < 0 ? data.length + args[0] : args[0],
22149
22297
  end = args[1],
22150
22298
  newRows = args[2] ? args.slice(2) : false,
22151
22299
  startRow;
22152
22300
 
22153
- if (!_this2.blocked && version === _this2.currentVersion) {
22301
+ if (!self.blocked && version === self.currentVersion) {
22154
22302
  //add new rows
22155
22303
  if (newRows) {
22156
- startRow = data[start] ? _this2.table.rowManager.getRowFromDataObject(data[start]) : false;
22304
+ startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;
22157
22305
 
22158
22306
  if (startRow) {
22159
22307
  newRows.forEach(function (rowData) {
22160
- _this2.table.rowManager.addRowActual(rowData, true, startRow, true);
22308
+ self.table.rowManager.addRowActual(rowData, true, startRow, true);
22161
22309
  });
22162
22310
  } else {
22163
22311
  newRows = newRows.slice().reverse();
22164
22312
  newRows.forEach(function (rowData) {
22165
- _this2.table.rowManager.addRowActual(rowData, true, false, true);
22313
+ self.table.rowManager.addRowActual(rowData, true, false, true);
22166
22314
  });
22167
22315
  }
22168
22316
  } //delete removed rows
@@ -22171,7 +22319,7 @@
22171
22319
  if (end !== 0) {
22172
22320
  var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end);
22173
22321
  oldRows.forEach(function (rowData, i) {
22174
- var row = _this2.table.rowManager.getRowFromDataObject(rowData);
22322
+ var row = self.table.rowManager.getRowFromDataObject(rowData);
22175
22323
 
22176
22324
  if (row) {
22177
22325
  row.deleteActual(i !== oldRows.length - 1);
@@ -22180,11 +22328,11 @@
22180
22328
  }
22181
22329
 
22182
22330
  if (newRows || end !== 0) {
22183
- _this2.table.rowManager.reRenderInPosition();
22331
+ self.table.rowManager.reRenderInPosition();
22184
22332
  }
22185
22333
  }
22186
22334
 
22187
- return _this2.origFuncs.splice.apply(data, _arguments);
22335
+ return self.origFuncs.splice.apply(data, arguments);
22188
22336
  }
22189
22337
  });
22190
22338
  }
@@ -22221,7 +22369,7 @@
22221
22369
  }, {
22222
22370
  key: "watchTreeChildren",
22223
22371
  value: function watchTreeChildren(row) {
22224
- var _arguments2 = arguments;
22372
+ var _arguments = arguments;
22225
22373
  var childField = row.getData()[this.table.options.dataTreeChildField],
22226
22374
  origFuncs = {};
22227
22375
 
@@ -22237,7 +22385,7 @@
22237
22385
  enumerable: false,
22238
22386
  configurable: true,
22239
22387
  value: function value() {
22240
- var result = origFuncs.push.apply(childField, _arguments2);
22388
+ var result = origFuncs.push.apply(childField, _arguments);
22241
22389
  rebuildTree();
22242
22390
  return result;
22243
22391
  }
@@ -22247,7 +22395,7 @@
22247
22395
  enumerable: false,
22248
22396
  configurable: true,
22249
22397
  value: function value() {
22250
- var result = origFuncs.unshift.apply(childField, _arguments2);
22398
+ var result = origFuncs.unshift.apply(childField, _arguments);
22251
22399
  rebuildTree();
22252
22400
  return result;
22253
22401
  }
@@ -22277,7 +22425,7 @@
22277
22425
  enumerable: false,
22278
22426
  configurable: true,
22279
22427
  value: function value() {
22280
- var result = origFuncs.splice.apply(childField, _arguments2);
22428
+ var result = origFuncs.splice.apply(childField, _arguments);
22281
22429
  rebuildTree();
22282
22430
  return result;
22283
22431
  }
@@ -22287,7 +22435,7 @@
22287
22435
  }, {
22288
22436
  key: "watchKey",
22289
22437
  value: function watchKey(row, data, key) {
22290
- var _this3 = this;
22438
+ var _this2 = this;
22291
22439
 
22292
22440
  var props = Object.getOwnPropertyDescriptor(data, key),
22293
22441
  value = data[key],
@@ -22296,7 +22444,7 @@
22296
22444
  set: function set(newValue) {
22297
22445
  value = newValue;
22298
22446
 
22299
- if (!_this3.blocked && version === _this3.currentVersion) {
22447
+ if (!_this2.blocked && version === _this2.currentVersion) {
22300
22448
  var update = {};
22301
22449
  update[key] = newValue;
22302
22450
  row.updateData(update);
@@ -23086,6 +23234,10 @@
23086
23234
 
23087
23235
  if (column.definition.title && column.field) {
23088
23236
  if (column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters) {
23237
+ var onRendered = function onRendered(callback) {
23238
+ callback();
23239
+ };
23240
+
23089
23241
  mockCellComponent = {
23090
23242
  value: false,
23091
23243
  data: {},
@@ -23108,7 +23260,7 @@
23108
23260
  output.push({
23109
23261
  field: column.field,
23110
23262
  title: column.definition.title,
23111
- value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params)
23263
+ value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)
23112
23264
  });
23113
23265
  } else {
23114
23266
  output.push({
@@ -23224,7 +23376,7 @@
23224
23376
  this.subscribe("row-init", this.initializeRow.bind(this));
23225
23377
  this.subscribe("row-deleting", this.rowDeleted.bind(this));
23226
23378
  this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
23227
- this.subscribe("rows-retrieve", this.clearSelectionData.bind(this));
23379
+ this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
23228
23380
 
23229
23381
  if (this.table.options.selectable && this.table.options.selectablePersistence) {
23230
23382
  this.subscribe("data-refeshing", this.deselectRows.bind(this));