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
  class CoreFeature{
3
3
 
4
4
  constructor(table){
@@ -195,7 +195,7 @@ class Module extends CoreFeature{
195
195
  }
196
196
  }
197
197
 
198
- class Helpers$1{
198
+ class Helpers{
199
199
 
200
200
  static elVisible(el){
201
201
  return !(el.offsetWidth <= 0 && el.offsetHeight <= 0);
@@ -210,18 +210,35 @@ class Helpers$1{
210
210
  };
211
211
  }
212
212
 
213
- static deepClone(obj){
214
- var clone = Object.assign(Array.isArray(obj) ? [] : {}, obj);
213
+ static deepClone(obj, clone, list = []){
214
+ var objectProto = {}.__proto__,
215
+ arrayProto = [].__proto__;
216
+
217
+ if (!clone){
218
+ clone = Object.assign(Array.isArray(obj) ? [] : {}, obj);
219
+ }
215
220
 
216
221
  for(var i in obj) {
217
- if(obj[i] != null && typeof(obj[i]) === "object"){
218
- if (obj[i] instanceof Date) {
219
- clone[i] = new Date(obj[i]);
220
- } else {
221
- clone[i] = this.deepClone(obj[i]);
222
+ let subject = obj[i],
223
+ match, copy;
224
+
225
+ if(subject != null && typeof subject === "object" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){
226
+ match = list.findIndex((item) => {
227
+ return item.subject === subject;
228
+ });
229
+
230
+ if(match > -1){
231
+ clone[i] = list[match].copy;
232
+ }else {
233
+ copy = Object.assign(Array.isArray(subject) ? [] : {}, subject);
234
+
235
+ list.unshift({subject, copy});
236
+
237
+ clone[i] = this.deepClone(subject, copy, list);
222
238
  }
223
239
  }
224
240
  }
241
+
225
242
  return clone;
226
243
  }
227
244
  }
@@ -259,7 +276,7 @@ class Accessor extends Module{
259
276
  var match = false,
260
277
  config = {};
261
278
 
262
- this.allowedTypes.forEach(function(type){
279
+ this.allowedTypes.forEach((type) => {
263
280
  var key = "accessor" + (type.charAt(0).toUpperCase() + type.slice(1)),
264
281
  accessor;
265
282
 
@@ -309,7 +326,7 @@ class Accessor extends Module{
309
326
  rowComponent = row.getComponent();
310
327
 
311
328
  //clone data object with deep copy to isolate internal data from returned result
312
- var data = Helpers$1.deepClone(row.data || {});
329
+ var data = Helpers.deepClone(row.data || {});
313
330
 
314
331
  this.table.columnManager.traverse(function(column){
315
332
  var value, accessor, params, colCompnent;
@@ -475,6 +492,26 @@ function defaultLoaderPromise(url, config, params){
475
492
  });
476
493
  }
477
494
 
495
+ function generateParamsList$1(data, prefix){
496
+ var output = [];
497
+
498
+ prefix = prefix || "";
499
+
500
+ if(Array.isArray(data)){
501
+ data.forEach((item, i) => {
502
+ output = output.concat(generateParamsList$1(item, prefix ? prefix + "[" + i + "]" : i));
503
+ });
504
+ }else if (typeof data === "object"){
505
+ for (var key in data){
506
+ output = output.concat(generateParamsList$1(data[key], prefix ? prefix + "[" + key + "]" : key));
507
+ }
508
+ }else {
509
+ output.push({key:prefix, value:data});
510
+ }
511
+
512
+ return output;
513
+ }
514
+
478
515
  var defaultContentTypeFormatters = {
479
516
  "json":{
480
517
  headers:{
@@ -488,7 +525,8 @@ var defaultContentTypeFormatters = {
488
525
  headers:{
489
526
  },
490
527
  body:function(url, config, params){
491
- var output = this.generateParamsList(params),
528
+
529
+ var output = generateParamsList$1(params),
492
530
  form = new FormData();
493
531
 
494
532
  output.forEach(function(item){
@@ -1142,7 +1180,7 @@ class CellComponent {
1142
1180
  }
1143
1181
  }
1144
1182
 
1145
- class Cell$1 extends CoreFeature{
1183
+ class Cell extends CoreFeature{
1146
1184
  constructor(column, row){
1147
1185
  super(column.table);
1148
1186
 
@@ -2292,7 +2330,7 @@ class Column$1 extends CoreFeature{
2292
2330
  this.reinitializeWidth();
2293
2331
  }
2294
2332
 
2295
- this.table.columnManager._verticalAlignHeaders();
2333
+ this.table.columnManager.verticalAlignHeaders();
2296
2334
 
2297
2335
  this.dispatch("column-show", this, responsiveToggle);
2298
2336
 
@@ -2317,7 +2355,7 @@ class Column$1 extends CoreFeature{
2317
2355
 
2318
2356
  this.element.style.display = "none";
2319
2357
 
2320
- this.table.columnManager._verticalAlignHeaders();
2358
+ this.table.columnManager.verticalAlignHeaders();
2321
2359
 
2322
2360
  if(this.parent.isGroup){
2323
2361
  this.parent.checkColumnVisibility();
@@ -2519,7 +2557,7 @@ class Column$1 extends CoreFeature{
2519
2557
  //////////////// Cell Management /////////////////
2520
2558
  //generate cell for this column
2521
2559
  generateCell(row){
2522
- var cell = new Cell$1(this, row);
2560
+ var cell = new Cell(this, row);
2523
2561
 
2524
2562
  this.cells.push(cell);
2525
2563
 
@@ -2734,7 +2772,7 @@ class RowComponent$1 {
2734
2772
  }
2735
2773
  }
2736
2774
 
2737
- class Row$1 extends CoreFeature{
2775
+ class Row extends CoreFeature{
2738
2776
  constructor (data, parent, type = "row"){
2739
2777
  super(parent.table);
2740
2778
 
@@ -2949,7 +2987,7 @@ class Row$1 extends CoreFeature{
2949
2987
 
2950
2988
  //update the rows data
2951
2989
  updateData(updatedData){
2952
- var visible = this.element && Helpers$1.elVisible(this.element),
2990
+ var visible = this.element && Helpers.elVisible(this.element),
2953
2991
  tempData = {},
2954
2992
  newRowData;
2955
2993
 
@@ -3576,7 +3614,7 @@ class ColumnCalcs extends Module{
3576
3614
  this.table.modules.mutator.disable();
3577
3615
  }
3578
3616
 
3579
- row = new Row$1(rowData, this, "calc");
3617
+ row = new Row(rowData, this, "calc");
3580
3618
 
3581
3619
  if(this.table.modExists("mutator")){
3582
3620
  this.table.modules.mutator.enable();
@@ -3620,7 +3658,7 @@ class ColumnCalcs extends Module{
3620
3658
  this.genColumn.definition.cssClass = column.definition.cssClass;
3621
3659
 
3622
3660
  //generate cell and assign to correct column
3623
- var cell = new Cell$1(this.genColumn, row);
3661
+ var cell = new Cell(this.genColumn, row);
3624
3662
  cell.getElement();
3625
3663
  cell.column = column;
3626
3664
  cell.setWidth();
@@ -4003,7 +4041,7 @@ class DataTree extends Module{
4003
4041
 
4004
4042
  output.push(row);
4005
4043
 
4006
- if(row instanceof Row$1){
4044
+ if(row instanceof Row){
4007
4045
 
4008
4046
  row.create();
4009
4047
 
@@ -4067,7 +4105,7 @@ class DataTree extends Module{
4067
4105
  }
4068
4106
 
4069
4107
  childArray.forEach((childData) => {
4070
- var childRow = new Row$1(childData || {}, this.table.rowManager);
4108
+ var childRow = new Row(childData || {}, this.table.rowManager);
4071
4109
 
4072
4110
  childRow.create();
4073
4111
 
@@ -4144,7 +4182,7 @@ class DataTree extends Module{
4144
4182
  }
4145
4183
 
4146
4184
  children.forEach((childRow) => {
4147
- if(childRow instanceof Row$1){
4185
+ if(childRow instanceof Row){
4148
4186
  output.push(childRow);
4149
4187
  }
4150
4188
  });
@@ -4215,7 +4253,7 @@ class DataTree extends Module{
4215
4253
 
4216
4254
  if(typeof subject == "object"){
4217
4255
 
4218
- if(subject instanceof Row$1){
4256
+ if(subject instanceof Row){
4219
4257
  //subject is row element
4220
4258
  match = subject.data;
4221
4259
  }else if(subject instanceof RowComponent){
@@ -4224,7 +4262,7 @@ class DataTree extends Module{
4224
4262
  }else if(typeof HTMLElement !== "undefined" && subject instanceof HTMLElement){
4225
4263
  if(parent.modules.dataTree){
4226
4264
  match = parent.modules.dataTree.children.find((childRow) => {
4227
- return childRow instanceof Row$1 ? childRow.element === subject : false;
4265
+ return childRow instanceof Row ? childRow.element === subject : false;
4228
4266
  });
4229
4267
 
4230
4268
  if(match){
@@ -4269,7 +4307,7 @@ class DataTree extends Module{
4269
4307
  }
4270
4308
 
4271
4309
  config.children.forEach((childRow) => {
4272
- if(childRow instanceof Row$1){
4310
+ if(childRow instanceof Row){
4273
4311
  output.push(component ? childRow.getComponent() : childRow);
4274
4312
 
4275
4313
  if(recurse){
@@ -4284,7 +4322,7 @@ class DataTree extends Module{
4284
4322
 
4285
4323
  checkForRestyle(cell){
4286
4324
  if(!cell.row.cells.indexOf(cell)){
4287
- cell.row.reinitialize();
4325
+ this.layoutRow(cell.row);
4288
4326
  }
4289
4327
  }
4290
4328
 
@@ -5592,7 +5630,7 @@ function select(cell, onRendered, success, cancel, editorParams){
5592
5630
  }
5593
5631
 
5594
5632
 
5595
- var offset = Helpers$1.elOffset(cellEl);
5633
+ var offset = Helpers.elOffset(cellEl);
5596
5634
 
5597
5635
  listEl.style.minWidth = cellEl.offsetWidth + "px";
5598
5636
 
@@ -6069,7 +6107,7 @@ function autocomplete(cell, onRendered, success, cancel, editorParams){
6069
6107
  if(!listEl.parentNode){
6070
6108
  while(listEl.firstChild) listEl.removeChild(listEl.firstChild);
6071
6109
 
6072
- var offset = Helpers$1.elOffset(cellEl);
6110
+ var offset = Helpers.elOffset(cellEl);
6073
6111
 
6074
6112
  listEl.style.minWidth = cellEl.offsetWidth + "px";
6075
6113
 
@@ -6384,8 +6422,8 @@ function star(cell, onRendered, success, cancel, editorParams){
6384
6422
  //draggable progress bar
6385
6423
  function progress(cell, onRendered, success, cancel, editorParams){
6386
6424
  var element = cell.getElement(),
6387
- max = typeof editorParams.max === "undefined" ? ( element.getElementsByTagName("div")[0].getAttribute("max") || 100) : editorParams.max,
6388
- min = typeof editorParams.min === "undefined" ? ( element.getElementsByTagName("div")[0].getAttribute("min") || 0) : editorParams.min,
6425
+ max = typeof editorParams.max === "undefined" ? ( element.getElementsByTagName("div")[0]?.getAttribute("max") || 100) : editorParams.max,
6426
+ min = typeof editorParams.min === "undefined" ? ( element.getElementsByTagName("div")[0]?.getAttribute("min") || 0) : editorParams.min,
6389
6427
  percent = (max - min) / 100,
6390
6428
  value = cell.getValue() || 0,
6391
6429
  handle = document.createElement("div"),
@@ -6757,7 +6795,7 @@ class Edit extends Module{
6757
6795
  nextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);
6758
6796
 
6759
6797
  if(nextCell){
6760
- nextCell.edit();
6798
+ nextCell.getComponent().edit();
6761
6799
  return true;
6762
6800
  }
6763
6801
  }
@@ -6788,7 +6826,7 @@ class Edit extends Module{
6788
6826
  nextCell = this.findNextEditableCell(nextRow, -1);
6789
6827
 
6790
6828
  if(nextCell){
6791
- nextCell.edit();
6829
+ nextCell.getComponent().edit();
6792
6830
  return true;
6793
6831
  }
6794
6832
  }
@@ -6812,7 +6850,7 @@ class Edit extends Module{
6812
6850
  nextCell = this.findPrevEditableCell(cell.row, index);
6813
6851
 
6814
6852
  if(nextCell){
6815
- nextCell.edit();
6853
+ nextCell.getComponent().edit();
6816
6854
  return true;
6817
6855
  }
6818
6856
  }
@@ -6834,7 +6872,7 @@ class Edit extends Module{
6834
6872
  nextCell = this.findNextEditableCell(cell.row, index);
6835
6873
 
6836
6874
  if(nextCell){
6837
- nextCell.edit();
6875
+ nextCell.getComponent().edit();
6838
6876
  return true;
6839
6877
  }
6840
6878
  }
@@ -6856,7 +6894,7 @@ class Edit extends Module{
6856
6894
  nextRow = this.table.rowManager.prevDisplayRow(cell.row, true);
6857
6895
 
6858
6896
  if(nextRow){
6859
- nextRow.cells[index].edit();
6897
+ nextRow.cells[index].getComponent().edit();
6860
6898
  return true;
6861
6899
  }
6862
6900
  }
@@ -6878,7 +6916,7 @@ class Edit extends Module{
6878
6916
  nextRow = this.table.rowManager.nextDisplayRow(cell.row, true);
6879
6917
 
6880
6918
  if(nextRow){
6881
- nextRow.cells[index].edit();
6919
+ nextRow.cells[index].getComponent().edit();
6882
6920
  return true;
6883
6921
  }
6884
6922
  }
@@ -8080,6 +8118,7 @@ class Filter extends Module{
8080
8118
  this.prevHeaderFilterChangeCheck = "{}";
8081
8119
 
8082
8120
  this.changed = false; //has filtering changed since last render
8121
+ this.tableInitialized = false;
8083
8122
 
8084
8123
  this.registerTableOption("filterMode", "local"); //local or remote filtering
8085
8124
 
@@ -8147,6 +8186,8 @@ class Filter extends Module{
8147
8186
  }
8148
8187
  });
8149
8188
  }
8189
+
8190
+ this.tableInitialized = true;
8150
8191
  }
8151
8192
 
8152
8193
  remoteFilterParams(data, config, silent, params){
@@ -8610,10 +8651,12 @@ class Filter extends Module{
8610
8651
  }
8611
8652
 
8612
8653
  refreshFilter(){
8613
- if(this.table.options.filterMode === "remote"){
8614
- this.reloadData();
8615
- }else {
8616
- this.refreshData();
8654
+ if(this.tableInitialized){
8655
+ if(this.table.options.filterMode === "remote"){
8656
+ this.reloadData();
8657
+ }else {
8658
+ this.refreshData();
8659
+ }
8617
8660
  }
8618
8661
 
8619
8662
  //TODO - Persist left position of row manager
@@ -8957,10 +9000,12 @@ function textarea$1(cell, formatterParams, onRendered){
8957
9000
 
8958
9001
  function money(cell, formatterParams, onRendered){
8959
9002
  var floatVal = parseFloat(cell.getValue()),
9003
+ sign = "",
8960
9004
  number, integer, decimal, rgx;
8961
9005
 
8962
9006
  var decimalSym = formatterParams.decimal || ".";
8963
9007
  var thousandSym = formatterParams.thousand || ",";
9008
+ var negativeSign = formatterParams.negativeSign || "-";
8964
9009
  var symbol = formatterParams.symbol || "";
8965
9010
  var after = !!formatterParams.symbolAfter;
8966
9011
  var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2;
@@ -8969,6 +9014,11 @@ function money(cell, formatterParams, onRendered){
8969
9014
  return this.emptyToSpace(this.sanitizeHTML(cell.getValue()));
8970
9015
  }
8971
9016
 
9017
+ if(floatVal < 0){
9018
+ floatVal = Math.abs(floatVal);
9019
+ sign = negativeSign;
9020
+ }
9021
+
8972
9022
  number = precision !== false ? floatVal.toFixed(precision) : floatVal;
8973
9023
  number = String(number).split(".");
8974
9024
 
@@ -8981,7 +9031,7 @@ function money(cell, formatterParams, onRendered){
8981
9031
  integer = integer.replace(rgx, "$1" + thousandSym + "$2");
8982
9032
  }
8983
9033
 
8984
- return after ? integer + decimal + symbol : symbol + integer + decimal;
9034
+ return after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;
8985
9035
  }
8986
9036
 
8987
9037
  function link(cell, formatterParams, onRendered){
@@ -9868,12 +9918,33 @@ class FrozenColumns extends Module{
9868
9918
  if(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){
9869
9919
  this.layoutRow(this.table.modules.columnCalcs.topRow);
9870
9920
  }
9921
+
9871
9922
  if(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){
9872
9923
  this.layoutRow(this.table.modules.columnCalcs.botRow);
9873
9924
  }
9925
+
9926
+ if(this.table.modExists("groupRows")){
9927
+ this.layoutGroupCalcs(this.table.modules.groupRows.getGroups());
9928
+ }
9874
9929
  }
9875
9930
  }
9876
9931
 
9932
+ layoutGroupCalcs(groups){
9933
+ groups.forEach((group) => {
9934
+ if(group.calcs.top){
9935
+ this.layoutRow(group.calcs.top);
9936
+ }
9937
+
9938
+ if(group.calcs.bottom){
9939
+ this.layoutRow(group.calcs.bottom);
9940
+ }
9941
+
9942
+ if(group.groupList && group.groupList.length){
9943
+ this.layoutGroupCalcs(group.groupList && group.groupList);
9944
+ }
9945
+ });
9946
+ }
9947
+
9877
9948
  //calculate column positions and layout headers
9878
9949
  layoutColumnPosition(allCells){
9879
9950
 
@@ -10108,7 +10179,10 @@ class FrozenRows extends Module{
10108
10179
 
10109
10180
  if(index > -1){
10110
10181
  var rowEl = row.getElement();
10111
- rowEl.parentNode.removeChild(rowEl);
10182
+
10183
+ if(rowEl.parentNode){
10184
+ rowEl.parentNode.removeChild(rowEl);
10185
+ }
10112
10186
 
10113
10187
  this.rows.splice(index, 1);
10114
10188
  }
@@ -10797,7 +10871,7 @@ class Group{
10797
10871
  this.initialized = false;
10798
10872
  this.height = 0;
10799
10873
 
10800
- if(Helpers$1.elVisible(this.element)){
10874
+ if(Helpers.elVisible(this.element)){
10801
10875
  this.initialize(true);
10802
10876
  }
10803
10877
  }
@@ -10826,6 +10900,8 @@ class Group{
10826
10900
 
10827
10901
  clearCellHeight(){}
10828
10902
 
10903
+ deinitializeHeight(){}
10904
+
10829
10905
  //////////////// Object Generation /////////////////
10830
10906
  getComponent(){
10831
10907
  if(!this.component){
@@ -10878,6 +10954,34 @@ class GroupRows extends Module{
10878
10954
 
10879
10955
  //initialize group configuration
10880
10956
  initialize(){
10957
+ if(this.table.options.groupBy){
10958
+
10959
+ this.configureGroupSetup();
10960
+
10961
+ if(this.table.options.groupUpdateOnCellEdit){
10962
+ this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
10963
+ this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
10964
+ }
10965
+
10966
+ this.subscribe("row-deleting", this.rowDeleting.bind(this));
10967
+ this.subscribe("row-deleted", this.rowsUpdated.bind(this));
10968
+ this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
10969
+ this.subscribe("rows-wipe", this.wipe.bind(this));
10970
+ this.subscribe("rows-added", this.rowsUpdated.bind(this));
10971
+ this.subscribe("row-moving", this.rowMoving.bind(this));
10972
+ this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
10973
+
10974
+ this.subscribe("rows-sample", this.rowSample.bind(this));
10975
+
10976
+ this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
10977
+
10978
+ this.registerDisplayHandler(this.displayHandler, 20);
10979
+
10980
+ this.initialized = true;
10981
+ }
10982
+ }
10983
+
10984
+ configureGroupSetup(){
10881
10985
  if(this.table.options.groupBy){
10882
10986
  var groupBy = this.table.options.groupBy,
10883
10987
  startOpen = this.table.options.groupStartOpen,
@@ -10965,27 +11069,6 @@ class GroupRows extends Module{
10965
11069
  if(groupHeader){
10966
11070
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
10967
11071
  }
10968
-
10969
- if(this.table.options.groupUpdateOnCellEdit){
10970
- this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
10971
- this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
10972
- }
10973
-
10974
- this.subscribe("row-deleting", this.rowDeleting.bind(this));
10975
- this.subscribe("row-deleted", this.rowsUpdated.bind(this));
10976
- this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
10977
- this.subscribe("rows-wipe", this.wipe.bind(this));
10978
- this.subscribe("rows-added", this.rowsUpdated.bind(this));
10979
- this.subscribe("row-moving", this.rowMoving.bind(this));
10980
- this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
10981
-
10982
- this.subscribe("rows-sample", this.rowSample.bind(this));
10983
-
10984
- this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
10985
-
10986
- this.registerDisplayHandler(this.displayHandler, 20);
10987
-
10988
- this.initialized = true;
10989
11072
  }
10990
11073
  }
10991
11074
 
@@ -11050,23 +11133,23 @@ class GroupRows extends Module{
11050
11133
 
11051
11134
  setGroupBy(groups){
11052
11135
  this.table.options.groupBy = groups;
11053
- this.initialize();
11054
- this.refreshData(false, "display");
11136
+ this.configureGroupSetup();
11137
+ this.refreshData();
11055
11138
 
11056
11139
  this.trackChanges();
11057
11140
  }
11058
11141
 
11059
11142
  setGroupValues(groupValues){
11060
11143
  this.table.options.groupValues = groupValues;
11061
- this.initialize();
11062
- this.refreshData(false, "display");
11144
+ this.configureGroupSetup();
11145
+ this.refreshData();
11063
11146
 
11064
11147
  this.trackChanges();
11065
11148
  }
11066
11149
 
11067
11150
  setGroupStartOpen(values){
11068
11151
  this.table.options.groupStartOpen = values;
11069
- this.initialize();
11152
+ this.configureGroupSetup();
11070
11153
 
11071
11154
  if(this.table.options.groupBy){
11072
11155
  this.refreshData();
@@ -11079,7 +11162,7 @@ class GroupRows extends Module{
11079
11162
 
11080
11163
  setGroupHeader(values){
11081
11164
  this.table.options.groupHeader = values;
11082
- this.initialize();
11165
+ this.configureGroupSetup();
11083
11166
 
11084
11167
  if(this.table.options.groupBy){
11085
11168
  this.refreshData();
@@ -11160,16 +11243,14 @@ class GroupRows extends Module{
11160
11243
 
11161
11244
  //return appropriate rows with group headers
11162
11245
  getRows(rows){
11163
- if(this.groupIDLookups.length){
11246
+ if(this.table.options.groupBy && this.groupIDLookups.length){
11164
11247
 
11165
- if(!Object.keys(this.groups).length){
11166
- this.dispatchExternal("dataGrouping");
11248
+ this.dispatchExternal("dataGrouping");
11167
11249
 
11168
- this.generateGroups(rows);
11250
+ this.generateGroups(rows);
11169
11251
 
11170
- if(this.subscribedExternal("dataGrouped")){
11171
- this.dispatchExternal("dataGrouped", this.getGroups(true));
11172
- }
11252
+ if(this.subscribedExternal("dataGrouped")){
11253
+ this.dispatchExternal("dataGrouped", this.getGroups(true));
11173
11254
  }
11174
11255
 
11175
11256
  return this.updateGroupRows();
@@ -11277,7 +11358,7 @@ class GroupRows extends Module{
11277
11358
  var oldGroups = this.groups;
11278
11359
 
11279
11360
  this.groups = {};
11280
- this.groupList =[];
11361
+ this.groupList = [];
11281
11362
 
11282
11363
  if(this.allowedValues && this.allowedValues[0]){
11283
11364
  this.allowedValues[0].forEach((value) => {
@@ -11406,6 +11487,7 @@ GroupRows.moduleName = "groupRows";
11406
11487
  var defaultUndoers = {
11407
11488
  cellEdit: function(action){
11408
11489
  action.component.setValueProcessData(action.data.oldValue);
11490
+ action.component.cellRendered();
11409
11491
  },
11410
11492
 
11411
11493
  rowAdd: function(action){
@@ -11431,6 +11513,7 @@ var defaultUndoers = {
11431
11513
  var defaultRedoers = {
11432
11514
  cellEdit: function(action){
11433
11515
  action.component.setValueProcessData(action.data.newValue);
11516
+ action.component.cellRendered();
11434
11517
  },
11435
11518
 
11436
11519
  rowAdd: function(action){
@@ -11508,7 +11591,7 @@ class History extends Module{
11508
11591
  }
11509
11592
  }
11510
11593
 
11511
- this.history.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
11594
+ this.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
11512
11595
  }
11513
11596
 
11514
11597
  cellUpdated(cell){
@@ -11627,17 +11710,17 @@ class HtmlTableImport extends Module{
11627
11710
  }
11628
11711
 
11629
11712
  initialize(){
11630
- this.subscribe("table-building", this.tableElementCheck.bind(this));
11713
+ this.tableElementCheck();
11631
11714
  }
11632
11715
 
11633
11716
  tableElementCheck(){
11634
- if(this.table.element.tagName === "TABLE"){
11717
+ if(this.table.originalElement && this.table.originalElement.tagName === "TABLE"){
11635
11718
  this.parseTable();
11636
11719
  }
11637
11720
  }
11638
11721
 
11639
11722
  parseTable(){
11640
- var element = this.table.element,
11723
+ var element = this.table.originalElement,
11641
11724
  options = this.table.options,
11642
11725
  columns = options.columns,
11643
11726
  headers = element.getElementsByTagName("th"),
@@ -11681,28 +11764,9 @@ class HtmlTableImport extends Module{
11681
11764
  data.push(item);
11682
11765
  }
11683
11766
 
11684
- //create new element
11685
- var newElement = document.createElement("div");
11686
-
11687
- //transfer attributes to new element
11688
- var attributes = element.attributes;
11689
-
11690
- // loop through attributes and apply them on div
11691
-
11692
- for(var i in attributes){
11693
- if(typeof attributes[i] == "object"){
11694
- newElement.setAttribute(attributes[i].name, attributes[i].value);
11695
- }
11696
- }
11697
-
11698
- // replace table with div element
11699
- element.parentNode.replaceChild(newElement, element);
11700
-
11701
11767
  options.data = data;
11702
11768
 
11703
11769
  this.dispatchExternal("htmlImported");
11704
-
11705
- this.table.element = newElement;
11706
11770
  }
11707
11771
 
11708
11772
  //extract tabulator attribute options
@@ -11779,7 +11843,7 @@ class HtmlTableImport extends Module{
11779
11843
  header.attributes;
11780
11844
 
11781
11845
  // //check for tablator inline options
11782
- this._extractOptions(header, col, Column.prototype.defaultOptionList);
11846
+ this._extractOptions(header, col, Column$1.prototype.defaultOptionList);
11783
11847
 
11784
11848
  this.fieldIndex[index] = col.field;
11785
11849
 
@@ -12099,7 +12163,7 @@ class Interaction extends Module{
12099
12163
 
12100
12164
  if(this.columnSubscribers[action]){
12101
12165
 
12102
- if(component instanceof Cell$1){
12166
+ if(component instanceof Cell){
12103
12167
  callback = component.column.definition[action];
12104
12168
  }else if(component instanceof Column$1){
12105
12169
  callback = component.definition[action];
@@ -12685,7 +12749,7 @@ class Menu extends Module{
12685
12749
 
12686
12750
  this.positionReversedX = false;
12687
12751
  }else {
12688
- parentOffset = Helpers$1.elOffset(parentEl);
12752
+ parentOffset = Helpers.elOffset(parentEl);
12689
12753
  x = parentOffset.left + parentEl.offsetWidth;
12690
12754
  y = parentOffset.top - 1;
12691
12755
  }
@@ -12803,7 +12867,7 @@ class MoveColumns extends Module{
12803
12867
 
12804
12868
  config.mousemove = function(e){
12805
12869
  if(column.parent === self.moving.parent){
12806
- if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers$1.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){
12870
+ if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){
12807
12871
  if(self.toCol !== column || !self.toColAfter){
12808
12872
  colEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);
12809
12873
  self.moveColumn(column, true);
@@ -12916,10 +12980,12 @@ class MoveColumns extends Module{
12916
12980
  }
12917
12981
 
12918
12982
  startMove(e, column){
12919
- var element = column.getElement();
12983
+ var element = column.getElement(),
12984
+ headerElement = this.table.columnManager.getElement(),
12985
+ headersElement = this.table.columnManager.getHeadersElement();
12920
12986
 
12921
12987
  this.moving = column;
12922
- this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers$1.elOffset(element).left;
12988
+ this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
12923
12989
 
12924
12990
  this.table.element.classList.add("tabulator-block-select");
12925
12991
 
@@ -12937,7 +13003,7 @@ class MoveColumns extends Module{
12937
13003
  this.table.columnManager.getElement().appendChild(this.hoverElement);
12938
13004
 
12939
13005
  this.hoverElement.style.left = "0";
12940
- this.hoverElement.style.bottom = "0";
13006
+ this.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + "px";
12941
13007
 
12942
13008
  if(!this.touchMove){
12943
13009
  this._bindMouseMove();
@@ -12975,7 +13041,7 @@ class MoveColumns extends Module{
12975
13041
  column.getCells().forEach(function(cell, i){
12976
13042
  var cellEl = cell.getElement(true);
12977
13043
 
12978
- if(cellEl.parentNode){
13044
+ if(cellEl.parentNode && movingCells[i]){
12979
13045
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
12980
13046
  }
12981
13047
  });
@@ -12983,7 +13049,7 @@ class MoveColumns extends Module{
12983
13049
  column.getCells().forEach(function(cell, i){
12984
13050
  var cellEl = cell.getElement(true);
12985
13051
 
12986
- if(cellEl.parentNode){
13052
+ if(cellEl.parentNode && movingCells[i]){
12987
13053
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
12988
13054
  }
12989
13055
  });
@@ -13018,7 +13084,7 @@ class MoveColumns extends Module{
13018
13084
  moveHover(e){
13019
13085
  var columnHolder = this.table.columnManager.getElement(),
13020
13086
  scrollLeft = columnHolder.scrollLeft,
13021
- xPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers$1.elOffset(columnHolder).left) + scrollLeft,
13087
+ xPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,
13022
13088
  scrollPos;
13023
13089
 
13024
13090
  this.hoverElement.style.left = (xPos - this.startX) + "px";
@@ -13120,7 +13186,7 @@ class MoveRows extends Module{
13120
13186
 
13121
13187
  //same table drag drop
13122
13188
  config.mousemove = function(e){
13123
- if(((e.pageY - Helpers$1.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){
13189
+ if(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){
13124
13190
  if(self.toRow !== group || !self.toRowAfter){
13125
13191
  var rowEl = group.getElement();
13126
13192
  rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
@@ -13154,7 +13220,7 @@ class MoveRows extends Module{
13154
13220
  config.mousemove = function(e){
13155
13221
  var rowEl = row.getElement();
13156
13222
 
13157
- if(((e.pageY - Helpers$1.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){
13223
+ if(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){
13158
13224
  if(self.toRow !== row || !self.toRowAfter){
13159
13225
  rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
13160
13226
  self.moveRow(row, true);
@@ -14070,8 +14136,6 @@ class Page extends Module{
14070
14136
  pageSizes = this.table.options.paginationSizeSelector;
14071
14137
  this.pageSizes = pageSizes;
14072
14138
 
14073
- console.log("gen",this.size);
14074
-
14075
14139
  if(this.pageSizes.indexOf(this.size) == -1){
14076
14140
  pageSizes.unshift(this.size);
14077
14141
  }
@@ -14327,8 +14391,6 @@ class Page extends Module{
14327
14391
  this.generatePageSizeSelectList();
14328
14392
  }
14329
14393
 
14330
- console.log("set", size, this.size);
14331
-
14332
14394
  this.trackChanges();
14333
14395
  }
14334
14396
 
@@ -15223,7 +15285,8 @@ class ReactiveData extends Module{
15223
15285
  }
15224
15286
 
15225
15287
  watchData(data){
15226
- var version;
15288
+ var self = this,
15289
+ version;
15227
15290
 
15228
15291
  this.currentVersion ++;
15229
15292
 
@@ -15239,16 +15302,16 @@ class ReactiveData extends Module{
15239
15302
  Object.defineProperty(this.data, "push", {
15240
15303
  enumerable: false,
15241
15304
  configurable: true,
15242
- value: () => {
15305
+ value: function(){
15243
15306
  var args = Array.from(arguments);
15244
15307
 
15245
- if(!this.blocked && version === this.currentVersion){
15308
+ if(!self.blocked && version === self.currentVersion){
15246
15309
  args.forEach((arg) => {
15247
- this.table.rowManager.addRowActual(arg, false);
15310
+ self.table.rowManager.addRowActual(arg, false);
15248
15311
  });
15249
15312
  }
15250
15313
 
15251
- return this.origFuncs.push.apply(data, arguments);
15314
+ return self.origFuncs.push.apply(data, arguments);
15252
15315
  }
15253
15316
  });
15254
15317
 
@@ -15258,16 +15321,16 @@ class ReactiveData extends Module{
15258
15321
  Object.defineProperty(this.data, "unshift", {
15259
15322
  enumerable: false,
15260
15323
  configurable: true,
15261
- value: () => {
15324
+ value: function(){
15262
15325
  var args = Array.from(arguments);
15263
15326
 
15264
- if(!this.blocked && version === this.currentVersion){
15327
+ if(!self.blocked && version === self.currentVersion){
15265
15328
  args.forEach((arg) => {
15266
- this.table.rowManager.addRowActual(arg, true);
15329
+ self.table.rowManager.addRowActual(arg, true);
15267
15330
  });
15268
15331
  }
15269
15332
 
15270
- return this.origFuncs.unshift.apply(data, arguments);
15333
+ return self.origFuncs.unshift.apply(data, arguments);
15271
15334
  }
15272
15335
  });
15273
15336
 
@@ -15278,12 +15341,12 @@ class ReactiveData extends Module{
15278
15341
  Object.defineProperty(this.data, "shift", {
15279
15342
  enumerable: false,
15280
15343
  configurable: true,
15281
- value: () => {
15344
+ value: function(){
15282
15345
  var row;
15283
15346
 
15284
- if(!this.blocked && version === this.currentVersion){
15285
- if(this.data.length){
15286
- row = this.table.rowManager.getRowFromDataObject(this.data[0]);
15347
+ if(!self.blocked && version === self.currentVersion){
15348
+ if(self.data.length){
15349
+ row = self.table.rowManager.getRowFromDataObject(self.data[0]);
15287
15350
 
15288
15351
  if(row){
15289
15352
  row.deleteActual();
@@ -15291,7 +15354,7 @@ class ReactiveData extends Module{
15291
15354
  }
15292
15355
  }
15293
15356
 
15294
- return this.origFuncs.shift.call(data);
15357
+ return self.origFuncs.shift.call(data);
15295
15358
  }
15296
15359
  });
15297
15360
 
@@ -15301,18 +15364,18 @@ class ReactiveData extends Module{
15301
15364
  Object.defineProperty(this.data, "pop", {
15302
15365
  enumerable: false,
15303
15366
  configurable: true,
15304
- value: () => {
15367
+ value: function(){
15305
15368
  var row;
15306
- if(!this.blocked && version === this.currentVersion){
15307
- if(this.data.length){
15308
- row = this.table.rowManager.getRowFromDataObject(this.data[this.data.length - 1]);
15369
+ if(!self.blocked && version === self.currentVersion){
15370
+ if(self.data.length){
15371
+ row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);
15309
15372
 
15310
15373
  if(row){
15311
15374
  row.deleteActual();
15312
15375
  }
15313
15376
  }
15314
15377
  }
15315
- return this.origFuncs.pop.call(data);
15378
+ return self.origFuncs.pop.call(data);
15316
15379
  }
15317
15380
  });
15318
15381
 
@@ -15323,28 +15386,28 @@ class ReactiveData extends Module{
15323
15386
  Object.defineProperty(this.data, "splice", {
15324
15387
  enumerable: false,
15325
15388
  configurable: true,
15326
- value: () => {
15389
+ value: function(){
15327
15390
  var args = Array.from(arguments),
15328
15391
  start = args[0] < 0 ? data.length + args[0] : args[0],
15329
15392
  end = args[1],
15330
15393
  newRows = args[2] ? args.slice(2) : false,
15331
15394
  startRow;
15332
15395
 
15333
- if(!this.blocked && version === this.currentVersion){
15396
+ if(!self.blocked && version === self.currentVersion){
15334
15397
 
15335
15398
  //add new rows
15336
15399
  if(newRows){
15337
- startRow = data[start] ? this.table.rowManager.getRowFromDataObject(data[start]) : false;
15400
+ startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;
15338
15401
 
15339
15402
  if(startRow){
15340
15403
  newRows.forEach((rowData) => {
15341
- this.table.rowManager.addRowActual(rowData, true, startRow, true);
15404
+ self.table.rowManager.addRowActual(rowData, true, startRow, true);
15342
15405
  });
15343
15406
  }else {
15344
15407
  newRows = newRows.slice().reverse();
15345
15408
 
15346
15409
  newRows.forEach((rowData) => {
15347
- this.table.rowManager.addRowActual(rowData, true, false, true);
15410
+ self.table.rowManager.addRowActual(rowData, true, false, true);
15348
15411
  });
15349
15412
  }
15350
15413
  }
@@ -15354,7 +15417,7 @@ class ReactiveData extends Module{
15354
15417
  var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end);
15355
15418
 
15356
15419
  oldRows.forEach((rowData, i) => {
15357
- var row = this.table.rowManager.getRowFromDataObject(rowData);
15420
+ var row = self.table.rowManager.getRowFromDataObject(rowData);
15358
15421
 
15359
15422
  if(row){
15360
15423
  row.deleteActual(i !== oldRows.length - 1);
@@ -15363,11 +15426,11 @@ class ReactiveData extends Module{
15363
15426
  }
15364
15427
 
15365
15428
  if(newRows || end !== 0){
15366
- this.table.rowManager.reRenderInPosition();
15429
+ self.table.rowManager.reRenderInPosition();
15367
15430
  }
15368
15431
  }
15369
15432
 
15370
- return this.origFuncs.splice.apply(data, arguments);
15433
+ return self.origFuncs.splice.apply(data, arguments);
15371
15434
  }
15372
15435
  });
15373
15436
  }
@@ -16249,10 +16312,14 @@ class ResponsiveLayout extends Module{
16249
16312
  },
16250
16313
  };
16251
16314
 
16315
+ function onRendered(callback){
16316
+ callback();
16317
+ }
16318
+
16252
16319
  output.push({
16253
16320
  field: column.field,
16254
16321
  title: column.definition.title,
16255
- value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params)
16322
+ value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)
16256
16323
  });
16257
16324
  }else {
16258
16325
  output.push({
@@ -16336,7 +16403,7 @@ class SelectRow extends Module{
16336
16403
  this.subscribe("row-init", this.initializeRow.bind(this));
16337
16404
  this.subscribe("row-deleting", this.rowDeleted.bind(this));
16338
16405
  this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
16339
- this.subscribe("rows-retrieve", this.clearSelectionData.bind(this));
16406
+ this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
16340
16407
 
16341
16408
  if(this.table.options.selectable && this.table.options.selectablePersistence){
16342
16409
  this.subscribe("data-refeshing", this.deselectRows.bind(this));
@@ -16352,7 +16419,6 @@ class SelectRow extends Module{
16352
16419
  this._deselectRow(row, true);
16353
16420
  }
16354
16421
 
16355
-
16356
16422
  clearSelectionData(silent){
16357
16423
  this.selecting = false;
16358
16424
  this.lastClickedRow = false;
@@ -18089,8 +18155,8 @@ class Renderer extends CoreFeature{
18089
18155
 
18090
18156
  //check row visibility
18091
18157
  if(!ifVisible){
18092
- if(Helpers$1.elVisible(rowEl)){
18093
- offset = Helpers$1.elOffset(rowEl).top - Helpers$1.elOffset(this.elementVertical).top;
18158
+ if(Helpers.elVisible(rowEl)){
18159
+ offset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;
18094
18160
 
18095
18161
  if(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){
18096
18162
  return false;
@@ -18693,6 +18759,7 @@ class ColumnManager extends CoreFeature {
18693
18759
  var el = document.createElement("div");
18694
18760
 
18695
18761
  el.classList.add("tabulator-headers");
18762
+ el.setAttribute("role", "row");
18696
18763
 
18697
18764
  return el;
18698
18765
  }
@@ -18701,6 +18768,7 @@ class ColumnManager extends CoreFeature {
18701
18768
  var el = document.createElement("div");
18702
18769
 
18703
18770
  el.classList.add("tabulator-header");
18771
+ el.setAttribute("role", "rowgroup");
18704
18772
 
18705
18773
  if(!this.table.options.headerVisible){
18706
18774
  el.classList.add("tabulator-header-hidden");
@@ -18859,9 +18927,9 @@ class ColumnManager extends CoreFeature {
18859
18927
  index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;
18860
18928
 
18861
18929
  if(nextToColumn && index > -1){
18862
-
18863
- var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn());
18864
- var nextEl = nextToColumn.getElement();
18930
+ var topColumn = nextToColumn.getTopColumn();
18931
+ var parentIndex = this.columns.indexOf(topColumn);
18932
+ var nextEl = topColumn.getElement();
18865
18933
 
18866
18934
  if(before){
18867
18935
  this.columns.splice(parentIndex, 0, column);
@@ -18870,7 +18938,6 @@ class ColumnManager extends CoreFeature {
18870
18938
  this.columns.splice(parentIndex + 1, 0, column);
18871
18939
  nextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);
18872
18940
  }
18873
-
18874
18941
  }else {
18875
18942
  if(before){
18876
18943
  this.columns.unshift(column);
@@ -18879,10 +18946,10 @@ class ColumnManager extends CoreFeature {
18879
18946
  this.columns.push(column);
18880
18947
  this.headersElement.appendChild(column.getElement());
18881
18948
  }
18882
-
18883
- column.columnRendered();
18884
18949
  }
18885
18950
 
18951
+ column.columnRendered();
18952
+
18886
18953
  return column;
18887
18954
  }
18888
18955
 
@@ -18905,7 +18972,7 @@ class ColumnManager extends CoreFeature {
18905
18972
  }
18906
18973
 
18907
18974
  //ensure column headers take up the correct amount of space in column groups
18908
- _verticalAlignHeaders(){
18975
+ verticalAlignHeaders(){
18909
18976
  var minHeight = 0;
18910
18977
 
18911
18978
  this.columns.forEach((column) => {
@@ -19062,7 +19129,7 @@ class ColumnManager extends CoreFeature {
19062
19129
  to.element.parentNode.insertBefore(to.element, from.element);
19063
19130
  }
19064
19131
 
19065
- this._verticalAlignHeaders();
19132
+ this.verticalAlignHeaders();
19066
19133
 
19067
19134
  this.table.rowManager.reinitialize();
19068
19135
  }
@@ -19237,13 +19304,11 @@ class ColumnManager extends CoreFeature {
19237
19304
 
19238
19305
  this.dispatch("column-add", definition, before, nextToColumn);
19239
19306
 
19240
- this.redraw(true);
19241
-
19242
19307
  if(this.layoutMode() != "fitColumns"){
19243
19308
  column.reinitializeWidth();
19244
19309
  }
19245
19310
 
19246
- this._verticalAlignHeaders();
19311
+ this.redraw(true);
19247
19312
 
19248
19313
  this.table.rowManager.reinitialize();
19249
19314
 
@@ -19277,18 +19342,18 @@ class ColumnManager extends CoreFeature {
19277
19342
  this.columns.splice(index, 1);
19278
19343
  }
19279
19344
 
19280
- this._verticalAlignHeaders();
19345
+ this.verticalAlignHeaders();
19281
19346
 
19282
19347
  this.redraw();
19283
19348
  }
19284
19349
 
19285
19350
  //redraw columns
19286
19351
  redraw(force){
19287
- if(force){
19288
- if(Helpers$1.elVisible(this.element)){
19289
- this._verticalAlignHeaders();
19290
- }
19352
+ if(Helpers.elVisible(this.element)){
19353
+ this.verticalAlignHeaders();
19354
+ }
19291
19355
 
19356
+ if(force){
19292
19357
  this.table.rowManager.resetScroll();
19293
19358
  this.table.rowManager.reinitialize();
19294
19359
  }
@@ -19362,7 +19427,7 @@ class BaiscVertical extends Renderer{
19362
19427
  }
19363
19428
 
19364
19429
  scrollToRowNearestTop(row){
19365
- var rowTop = Helpers$1.elOffset(row.getElement()).top;
19430
+ var rowTop = Helpers.elOffset(row.getElement()).top;
19366
19431
 
19367
19432
  return !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));
19368
19433
  }
@@ -19370,7 +19435,7 @@ class BaiscVertical extends Renderer{
19370
19435
  scrollToRow(row){
19371
19436
  var rowEl = row.getElement();
19372
19437
 
19373
- this.elementVertical.scrollTop = Helpers$1.elOffset(rowEl).top - Helpers$1.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;
19438
+ this.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;
19374
19439
  }
19375
19440
 
19376
19441
  visibleRows(includingBuffer){
@@ -19632,7 +19697,7 @@ class VirtualDomVertical extends Renderer{
19632
19697
  position -= topPad;
19633
19698
  }
19634
19699
 
19635
- if(rowsCount && Helpers$1.elVisible(this.elementVertical)){
19700
+ if(rowsCount && Helpers.elVisible(this.elementVertical)){
19636
19701
  this.vDomTop = position;
19637
19702
 
19638
19703
  this.vDomBottom = position -1;
@@ -19991,6 +20056,7 @@ class RowManager extends CoreFeature{
19991
20056
 
19992
20057
  el.classList.add("tabulator-tableholder");
19993
20058
  el.setAttribute("tabindex", 0);
20059
+ el.setAttribute("role", "rowgroup");
19994
20060
 
19995
20061
  return el;
19996
20062
  }
@@ -19999,6 +20065,7 @@ class RowManager extends CoreFeature{
19999
20065
  var el = document.createElement("div");
20000
20066
 
20001
20067
  el.classList.add("tabulator-table");
20068
+ el.setAttribute("role", "rowgroup");
20002
20069
 
20003
20070
  return el;
20004
20071
  }
@@ -20060,7 +20127,7 @@ class RowManager extends CoreFeature{
20060
20127
  ////////////////// Row Manipulation //////////////////
20061
20128
  findRow(subject){
20062
20129
  if(typeof subject == "object"){
20063
- if(subject instanceof Row$1){
20130
+ if(subject instanceof Row){
20064
20131
  //subject is row element
20065
20132
  return subject;
20066
20133
  }else if(subject instanceof RowComponent$1){
@@ -20143,7 +20210,7 @@ class RowManager extends CoreFeature{
20143
20210
 
20144
20211
  data.forEach((def, i) => {
20145
20212
  if(def && typeof def === "object"){
20146
- var row = new Row$1(def, this);
20213
+ var row = new Row(def, this);
20147
20214
  this.rows.push(row);
20148
20215
  }else {
20149
20216
  console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", def);
@@ -20246,7 +20313,7 @@ class RowManager extends CoreFeature{
20246
20313
  this.dispatch("row-added", row, data, pos, index);
20247
20314
  });
20248
20315
 
20249
- this.reRenderInPosition();
20316
+ this.refreshActiveData(false, false, true);
20250
20317
 
20251
20318
  this.regenerateRowNumbers();
20252
20319
 
@@ -20275,7 +20342,7 @@ class RowManager extends CoreFeature{
20275
20342
  }
20276
20343
 
20277
20344
  addRowActual(data, pos, index, blockRedraw){
20278
- var row = data instanceof Row$1 ? data : new Row$1(data || {}, this),
20345
+ var row = data instanceof Row ? data : new Row(data || {}, this),
20279
20346
  top = this.findAddRowPos(pos),
20280
20347
  allIndex = -1,
20281
20348
  activeIndex, chainResult;
@@ -20434,7 +20501,7 @@ class RowManager extends CoreFeature{
20434
20501
  nextRow = this.getDisplayRows()[index+1];
20435
20502
  }
20436
20503
 
20437
- if(nextRow && (!(nextRow instanceof Row$1) || nextRow.type != "row")){
20504
+ if(nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")){
20438
20505
  return this.nextDisplayRow(nextRow, rowOnly);
20439
20506
  }
20440
20507
 
@@ -20449,7 +20516,7 @@ class RowManager extends CoreFeature{
20449
20516
  prevRow = this.getDisplayRows()[index-1];
20450
20517
  }
20451
20518
 
20452
- if(rowOnly && prevRow && (!(prevRow instanceof Row$1) || prevRow.type != "row")){
20519
+ if(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")){
20453
20520
  return this.prevDisplayRow(prevRow, rowOnly);
20454
20521
  }
20455
20522
 
@@ -20628,7 +20695,7 @@ class RowManager extends CoreFeature{
20628
20695
  //case to handle scenario when trying to skip past end stage
20629
20696
  }
20630
20697
 
20631
- if(Helpers$1.elVisible(this.element)){
20698
+ if(Helpers.elVisible(this.element)){
20632
20699
  if(renderInPosition){
20633
20700
  this.reRenderInPosition();
20634
20701
  }else {
@@ -20791,13 +20858,13 @@ class RowManager extends CoreFeature{
20791
20858
  }
20792
20859
 
20793
20860
  renderTable(){
20794
-
20795
20861
  this.dispatchExternal("renderStarted");
20796
20862
 
20797
20863
  this.element.scrollTop = 0;
20798
20864
 
20865
+ this._clearTable();
20866
+
20799
20867
  if(this.displayRowsCount){
20800
- this._clearTable();
20801
20868
  this.renderer.renderRows();
20802
20869
 
20803
20870
  if(this.firstRender){
@@ -21400,7 +21467,7 @@ class DataLoader extends CoreFeature{
21400
21467
  this.hideLoader();
21401
21468
 
21402
21469
  if(rowData !== false){
21403
- this.dispatchExternal("dataLoaded", data);
21470
+ this.dispatchExternal("dataLoaded", rowData);
21404
21471
  this.table.rowManager.setData(rowData, replace, !replace);
21405
21472
  }
21406
21473
  }else {
@@ -21504,7 +21571,8 @@ class DataLoader extends CoreFeature{
21504
21571
 
21505
21572
  class ExternalEventBus {
21506
21573
 
21507
- constructor(optionsList, debug){
21574
+ constructor(table, optionsList, debug){
21575
+ this.table = table;
21508
21576
  this.events = {};
21509
21577
  this.optionsList = optionsList || {};
21510
21578
  this.subscriptionNotifiers = {};
@@ -21582,7 +21650,7 @@ class ExternalEventBus {
21582
21650
 
21583
21651
  if(this.events[key]){
21584
21652
  this.events[key].forEach((callback, i) => {
21585
- let callResult = callback.apply(this, args);
21653
+ let callResult = callback.apply(this.table, args);
21586
21654
 
21587
21655
  if(!i){
21588
21656
  result = callResult;
@@ -22165,7 +22233,7 @@ class Localize extends Module{
22165
22233
  }
22166
22234
 
22167
22235
  initialize(){
22168
- this.langList = Helpers$1.deepClone(Localize.langs);
22236
+ this.langList = Helpers.deepClone(Localize.langs);
22169
22237
 
22170
22238
  if(this.table.options.columnDefaults.headerFilterPlaceholder !== false){
22171
22239
  this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);
@@ -22257,7 +22325,7 @@ class Localize extends Module{
22257
22325
  this.locale = desiredLocale;
22258
22326
 
22259
22327
  //load default lang template
22260
- this.lang = Helpers$1.deepClone(this.langList.default || {});
22328
+ this.lang = Helpers.deepClone(this.langList.default || {});
22261
22329
 
22262
22330
  if(desiredLocale != "default"){
22263
22331
  traverseLang(this.langList[desiredLocale], this.lang);
@@ -22494,6 +22562,7 @@ class Tabulator {
22494
22562
  this.browserSlow = false; //handle reduced functionality for slower browsers
22495
22563
  this.browserMobile = false; //check if running on moble, prevent resize cancelling edit on keyboard appearence
22496
22564
  this.rtl = false; //check if the table is in RTL mode
22565
+ this.originalElement = null; //hold original table element if it has been replaced
22497
22566
 
22498
22567
  this.componentFunctionBinder = new ComponentFuctionBinder(this); //bind component functions
22499
22568
  this.dataLoader = false; //bind component functions
@@ -22552,7 +22621,7 @@ class Tabulator {
22552
22621
 
22553
22622
  this._mapDepricatedFunctionality();
22554
22623
 
22555
- this.externalEvents = new ExternalEventBus(this.options, this.options.debugEventsExternal);
22624
+ this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
22556
22625
  this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
22557
22626
 
22558
22627
  this.interactionMonitor = new InteractionManager(this);
@@ -22563,27 +22632,6 @@ class Tabulator {
22563
22632
  this.footerManager.initialize();
22564
22633
  }
22565
22634
 
22566
- rtlCheck(){
22567
- var style = window.getComputedStyle(this.element);
22568
-
22569
- switch(this.options.textDirection){
22570
- case"auto":
22571
- if(style.direction !== "rtl"){
22572
- break;
22573
- }
22574
- case "rtl":
22575
- this.element.classList.add("tabulator-rtl");
22576
- this.rtl = true;
22577
- break;
22578
-
22579
- case "ltr":
22580
- this.element.classList.add("tabulator-ltr");
22581
-
22582
- default:
22583
- this.rtl = false;
22584
- }
22585
- }
22586
-
22587
22635
  //convert depricated functionality to new functions
22588
22636
  _mapDepricatedFunctionality(){
22589
22637
  //all previously deprecated functionality removed in the 5.0 release
@@ -22611,10 +22659,12 @@ class Tabulator {
22611
22659
  this.externalEvents.dispatch("tableBuilding");
22612
22660
  this.eventBus.dispatch("table-building");
22613
22661
 
22614
- this.rtlCheck();
22662
+ this._rtlCheck();
22615
22663
 
22616
22664
  this._buildElement();
22617
22665
 
22666
+ this._initializeTable();
22667
+
22618
22668
  this._loadInitialData();
22619
22669
 
22620
22670
  this.initialized = true;
@@ -22622,6 +22672,27 @@ class Tabulator {
22622
22672
  this.externalEvents.dispatch("tableBuilt");
22623
22673
  }
22624
22674
 
22675
+ _rtlCheck(){
22676
+ var style = window.getComputedStyle(this.element);
22677
+
22678
+ switch(this.options.textDirection){
22679
+ case"auto":
22680
+ if(style.direction !== "rtl"){
22681
+ break;
22682
+ }
22683
+ case "rtl":
22684
+ this.element.classList.add("tabulator-rtl");
22685
+ this.rtl = true;
22686
+ break;
22687
+
22688
+ case "ltr":
22689
+ this.element.classList.add("tabulator-ltr");
22690
+
22691
+ default:
22692
+ this.rtl = false;
22693
+ }
22694
+ }
22695
+
22625
22696
  //clear pointers to objects in default config object
22626
22697
  _clearObjectPointers(){
22627
22698
  this.options.columns = this.options.columns.slice(0);
@@ -22634,7 +22705,28 @@ class Tabulator {
22634
22705
  //build tabulator element
22635
22706
  _buildElement(){
22636
22707
  var element = this.element,
22637
- options = this.options;
22708
+ options = this.options,
22709
+ newElement;
22710
+
22711
+ if(element.tagName === "TABLE"){
22712
+ this.originalElement = this.element;
22713
+ newElement = document.createElement("div");
22714
+
22715
+ //transfer attributes to new element
22716
+ var attributes = element.attributes;
22717
+
22718
+ // loop through attributes and apply them on div
22719
+ for(var i in attributes){
22720
+ if(typeof attributes[i] == "object"){
22721
+ newElement.setAttribute(attributes[i].name, attributes[i].value);
22722
+ }
22723
+ }
22724
+
22725
+ // replace table with div element
22726
+ element.parentNode.replaceChild(newElement, element);
22727
+
22728
+ this.element = element = newElement;
22729
+ }
22638
22730
 
22639
22731
  element.classList.add("tabulator");
22640
22732
  element.setAttribute("role", "grid");
@@ -22659,6 +22751,12 @@ class Tabulator {
22659
22751
  options.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + "px";
22660
22752
  element.style.maxHeight = options.maxHeight;
22661
22753
  }
22754
+ }
22755
+
22756
+ //initialize core systems and modules
22757
+ _initializeTable(){
22758
+ var element = this.element,
22759
+ options = this.options;
22662
22760
 
22663
22761
  this.columnManager.initialize();
22664
22762
  this.rowManager.initialize();
@@ -22674,7 +22772,6 @@ class Tabulator {
22674
22772
 
22675
22773
  //configure placeholder element
22676
22774
  if(typeof options.placeholder == "string"){
22677
-
22678
22775
  var el = document.createElement("div");
22679
22776
  el.classList.add("tabulator-placeholder");
22680
22777
 
@@ -22838,68 +22935,80 @@ class Tabulator {
22838
22935
 
22839
22936
  //replace data, keeping table in position with same sort
22840
22937
  replaceData(data, params, config){
22841
- return this.dataLoader.load(data, params, config, true, true);
22938
+ if(this.initialized){
22939
+ return this.dataLoader.load(data, params, config, true, true);
22940
+ }else {
22941
+ console.warn("replaceData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
22942
+ }
22842
22943
  }
22843
22944
 
22844
22945
  //update table data
22845
22946
  updateData(data){
22846
22947
  var responses = 0;
22847
22948
 
22848
- return new Promise((resolve, reject) => {
22849
- this.dataLoader.blockActiveLoad();
22949
+ if(this.initialized){
22950
+ return new Promise((resolve, reject) => {
22951
+ this.dataLoader.blockActiveLoad();
22850
22952
 
22851
- if(typeof data === "string"){
22852
- data = JSON.parse(data);
22853
- }
22953
+ if(typeof data === "string"){
22954
+ data = JSON.parse(data);
22955
+ }
22854
22956
 
22855
- if(data){
22856
- data.forEach((item) => {
22857
- var row = this.rowManager.findRow(item[this.options.index]);
22957
+ if(data){
22958
+ data.forEach((item) => {
22959
+ var row = this.rowManager.findRow(item[this.options.index]);
22858
22960
 
22859
- if(row){
22860
- responses++;
22961
+ if(row){
22962
+ responses++;
22861
22963
 
22862
- row.updateData(item)
22863
- .then(()=>{
22864
- responses--;
22964
+ row.updateData(item)
22965
+ .then(()=>{
22966
+ responses--;
22865
22967
 
22866
- if(!responses){
22867
- resolve();
22868
- }
22869
- });
22870
- }
22871
- });
22872
- }else {
22873
- console.warn("Update Error - No data provided");
22874
- reject("Update Error - No data provided");
22875
- }
22876
- });
22968
+ if(!responses){
22969
+ resolve();
22970
+ }
22971
+ });
22972
+ }
22973
+ });
22974
+ }else {
22975
+ console.warn("Update Error - No data provided");
22976
+ reject("Update Error - No data provided");
22977
+ }
22978
+ });
22979
+ }else {
22980
+ console.warn("updateData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
22981
+ }
22877
22982
  }
22878
22983
 
22879
22984
  addData(data, pos, index){
22880
- return new Promise((resolve, reject) => {
22881
- this.dataLoader.blockActiveLoad();
22985
+ if(this.initialized){
22986
+ return new Promise((resolve, reject) => {
22987
+ this.dataLoader.blockActiveLoad();
22882
22988
 
22883
- if(typeof data === "string"){
22884
- data = JSON.parse(data);
22885
- }
22989
+ if(typeof data === "string"){
22990
+ data = JSON.parse(data);
22991
+ }
22886
22992
 
22887
- if(data){
22888
- this.rowManager.addRows(data, pos, index)
22889
- .then((rows) => {
22890
- var output = [];
22993
+ if(data){
22994
+ this.rowManager.addRows(data, pos, index)
22995
+ .then((rows) => {
22996
+ var output = [];
22891
22997
 
22892
- rows.forEach(function(row){
22893
- output.push(row.getComponent());
22894
- });
22998
+ rows.forEach(function(row){
22999
+ output.push(row.getComponent());
23000
+ });
22895
23001
 
22896
- resolve(output);
22897
- });
22898
- }else {
22899
- console.warn("Update Error - No data provided");
22900
- reject("Update Error - No data provided");
22901
- }
22902
- });
23002
+ resolve(output);
23003
+ });
23004
+ }else {
23005
+ console.warn("Update Error - No data provided");
23006
+ reject("Update Error - No data provided");
23007
+ }
23008
+ });
23009
+ }else {
23010
+ console.warn("addData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23011
+ }
22903
23012
  }
22904
23013
 
22905
23014
  //update table data
@@ -22907,46 +23016,50 @@ class Tabulator {
22907
23016
  var rows = [],
22908
23017
  responses = 0;
22909
23018
 
22910
- return new Promise((resolve, reject) => {
22911
- this.dataLoader.blockActiveLoad();
23019
+ if(this.initialized){
23020
+ return new Promise((resolve, reject) => {
23021
+ this.dataLoader.blockActiveLoad();
22912
23022
 
22913
- if(typeof data === "string"){
22914
- data = JSON.parse(data);
22915
- }
23023
+ if(typeof data === "string"){
23024
+ data = JSON.parse(data);
23025
+ }
22916
23026
 
22917
- if(data){
22918
- data.forEach((item) => {
22919
- var row = this.rowManager.findRow(item[this.options.index]);
23027
+ if(data){
23028
+ data.forEach((item) => {
23029
+ var row = this.rowManager.findRow(item[this.options.index]);
22920
23030
 
22921
- responses++;
23031
+ responses++;
22922
23032
 
22923
- if(row){
22924
- row.updateData(item)
22925
- .then(()=>{
22926
- responses--;
22927
- rows.push(row.getComponent());
23033
+ if(row){
23034
+ row.updateData(item)
23035
+ .then(()=>{
23036
+ responses--;
23037
+ rows.push(row.getComponent());
22928
23038
 
22929
- if(!responses){
22930
- resolve(rows);
22931
- }
22932
- });
22933
- }else {
22934
- this.rowManager.addRows(item)
22935
- .then((newRows)=>{
22936
- responses--;
22937
- rows.push(newRows[0].getComponent());
23039
+ if(!responses){
23040
+ resolve(rows);
23041
+ }
23042
+ });
23043
+ }else {
23044
+ this.rowManager.addRows(item)
23045
+ .then((newRows)=>{
23046
+ responses--;
23047
+ rows.push(newRows[0].getComponent());
22938
23048
 
22939
- if(!responses){
22940
- resolve(rows);
22941
- }
22942
- });
22943
- }
22944
- });
22945
- }else {
22946
- console.warn("Update Error - No data provided");
22947
- reject("Update Error - No data provided");
22948
- }
22949
- });
23049
+ if(!responses){
23050
+ resolve(rows);
23051
+ }
23052
+ });
23053
+ }
23054
+ });
23055
+ }else {
23056
+ console.warn("Update Error - No data provided");
23057
+ reject("Update Error - No data provided");
23058
+ }
23059
+ });
23060
+ }else {
23061
+ console.warn("updateOrAddData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23062
+ }
22950
23063
  }
22951
23064
 
22952
23065
  //get row object
@@ -23010,14 +23123,18 @@ class Tabulator {
23010
23123
 
23011
23124
  //add row to table
23012
23125
  addRow(data, pos, index){
23013
- if(typeof data === "string"){
23014
- data = JSON.parse(data);
23015
- }
23126
+ if(this.initialized){
23127
+ if(typeof data === "string"){
23128
+ data = JSON.parse(data);
23129
+ }
23016
23130
 
23017
- return this.rowManager.addRows(data, pos, index)
23018
- .then((rows)=>{
23019
- return rows[0].getComponent();
23020
- });
23131
+ return this.rowManager.addRows(data, pos, index)
23132
+ .then((rows)=>{
23133
+ return rows[0].getComponent();
23134
+ });
23135
+ }else {
23136
+ console.warn("addRow failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23137
+ }
23021
23138
  }
23022
23139
 
23023
23140
  //update a row if it exitsts otherwise create it
@@ -23083,7 +23200,11 @@ class Tabulator {
23083
23200
  }
23084
23201
 
23085
23202
  getRows(active){
23086
- return this.rowManager.getComponents(active);
23203
+ if(this.initialized){
23204
+ return this.rowManager.getComponents(active);
23205
+ }else {
23206
+ console.warn("getRows failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23207
+ }
23087
23208
  }
23088
23209
 
23089
23210
  //get position of row in table
@@ -23100,7 +23221,11 @@ class Tabulator {
23100
23221
 
23101
23222
  /////////////// Column Functions ///////////////
23102
23223
  setColumns(definition){
23103
- this.columnManager.setColumns(definition);
23224
+ if(this.initialized){
23225
+ this.columnManager.setColumns(definition);
23226
+ }else {
23227
+ console.warn("setColumns failed - table not yet initialized. To set initial data please use the 'columns' property in the table constructor.");
23228
+ }
23104
23229
  }
23105
23230
 
23106
23231
  getColumns(structured){
@@ -23222,8 +23347,12 @@ class Tabulator {
23222
23347
  //////////// General Public Functions ////////////
23223
23348
  //redraw list without updating data
23224
23349
  redraw(force){
23225
- this.columnManager.redraw(force);
23226
- this.rowManager.redraw(force);
23350
+ if(this.initialized){
23351
+ this.columnManager.redraw(force);
23352
+ this.rowManager.redraw(force);
23353
+ }else {
23354
+ console.warn("redraw failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23355
+ }
23227
23356
  }
23228
23357
 
23229
23358
  setHeight(height){