tabulator-tables 5.0.5 → 5.0.9

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 (85) hide show
  1. package/bower.json +1 -1
  2. package/build/rollup.js +1 -1
  3. package/dist/css/tabulator.css +4 -0
  4. package/dist/css/tabulator.css.map +1 -1
  5. package/dist/css/tabulator.min.css +1 -1
  6. package/dist/css/tabulator.min.css.map +1 -1
  7. package/dist/css/tabulator_bootstrap3.css +4 -0
  8. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  9. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  10. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  11. package/dist/css/tabulator_bootstrap4.css +4 -0
  12. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  13. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  14. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  15. package/dist/css/tabulator_bulma.css +4 -0
  16. package/dist/css/tabulator_bulma.css.map +1 -1
  17. package/dist/css/tabulator_bulma.min.css +1 -1
  18. package/dist/css/tabulator_bulma.min.css.map +1 -1
  19. package/dist/css/tabulator_materialize.css +4 -0
  20. package/dist/css/tabulator_materialize.css.map +1 -1
  21. package/dist/css/tabulator_materialize.min.css +1 -1
  22. package/dist/css/tabulator_materialize.min.css.map +1 -1
  23. package/dist/css/tabulator_midnight.css +4 -0
  24. package/dist/css/tabulator_midnight.css.map +1 -1
  25. package/dist/css/tabulator_midnight.min.css +1 -1
  26. package/dist/css/tabulator_midnight.min.css.map +1 -1
  27. package/dist/css/tabulator_modern.css +4 -0
  28. package/dist/css/tabulator_modern.css.map +1 -1
  29. package/dist/css/tabulator_modern.min.css +1 -1
  30. package/dist/css/tabulator_modern.min.css.map +1 -1
  31. package/dist/css/tabulator_semanticui.css +4 -0
  32. package/dist/css/tabulator_semanticui.css.map +1 -1
  33. package/dist/css/tabulator_semanticui.min.css +1 -1
  34. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  35. package/dist/css/tabulator_simple.css +4 -0
  36. package/dist/css/tabulator_simple.css.map +1 -1
  37. package/dist/css/tabulator_simple.min.css +1 -1
  38. package/dist/css/tabulator_simple.min.css.map +1 -1
  39. package/dist/css/tabulator_site.css +4 -0
  40. package/dist/css/tabulator_site.css.map +1 -1
  41. package/dist/css/tabulator_site.min.css +1 -1
  42. package/dist/css/tabulator_site.min.css.map +1 -1
  43. package/dist/js/tabulator.js +412 -256
  44. package/dist/js/tabulator.js.map +1 -1
  45. package/dist/js/tabulator.min.js +2 -2
  46. package/dist/js/tabulator.min.js.map +1 -1
  47. package/dist/js/tabulator_esm.js +501 -351
  48. package/dist/js/tabulator_esm.js.map +1 -1
  49. package/dist/js/tabulator_esm.min.js +2 -2
  50. package/dist/js/tabulator_esm.min.js.map +1 -1
  51. package/package.json +1 -1
  52. package/src/js/core/ColumnManager.js +8 -7
  53. package/src/js/core/CoreFeature.js +1 -5
  54. package/src/js/core/RowManager.js +8 -2
  55. package/src/js/core/Tabulator.js +126 -100
  56. package/src/js/core/column/Column.js +1 -1
  57. package/src/js/core/defaults/options.js +1 -1
  58. package/src/js/core/rendering/Renderer.js +2 -1
  59. package/src/js/core/rendering/renderers/VirtualDomVertical.js +1 -1
  60. package/src/js/core/tools/{ComponentFuctionBinder.js → ComponentFunctionBinder.js} +1 -1
  61. package/src/js/core/tools/DataLoader.js +1 -1
  62. package/src/js/core/tools/InteractionMonitor.js +126 -49
  63. package/src/js/core/tools/OptionsList.js +2 -2
  64. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +14 -1
  65. package/src/js/modules/DataTree/DataTree.js +18 -9
  66. package/src/js/modules/Download/defaults/downloaders/pdf.js +0 -2
  67. package/src/js/modules/Download/defaults/downloaders/xlsx.js +3 -2
  68. package/src/js/modules/Edit/Edit.js +1 -8
  69. package/src/js/modules/Edit/defaults/editors/progress.js +2 -2
  70. package/src/js/modules/Export/Export.js +1 -1
  71. package/src/js/modules/Filter/Filter.js +9 -4
  72. package/src/js/modules/Format/defaults/formatters/datetime.js +2 -2
  73. package/src/js/modules/Format/defaults/formatters/datetimediff.js +1 -1
  74. package/src/js/modules/Format/defaults/formatters/money.js +8 -1
  75. package/src/js/modules/FrozenRows/FrozenRows.js +4 -1
  76. package/src/js/modules/GroupRows/Group.js +16 -6
  77. package/src/js/modules/GroupRows/GroupRows.js +41 -29
  78. package/src/js/modules/History/History.js +3 -1
  79. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +5 -7
  80. package/src/js/modules/MoveColumns/MoveColumns.js +64 -61
  81. package/src/js/modules/Page/Page.js +8 -10
  82. package/src/js/modules/SelectRow/SelectRow.js +5 -10
  83. package/src/js/modules/Sort/Sort.js +1 -1
  84. package/src/js/modules/Sort/defaults/sorters/datetime.js +3 -2
  85. package/src/scss/tabulator.scss +4 -0
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.0.5 (c) Oliver Folkerd 2021 */
1
+ /* Tabulator v5.0.9 (c) Oliver Folkerd 2021 */
2
2
  class CoreFeature{
3
3
 
4
4
  constructor(table){
@@ -103,11 +103,7 @@ class CoreFeature{
103
103
  //////////////// Options /////////////////
104
104
  //////////////////////////////////////////
105
105
 
106
- options(key, value){
107
- if(typeof value !== "undefined"){
108
- this.table.options[key] = value;
109
- }
110
-
106
+ options(key){
111
107
  return this.table.options[key];
112
108
  }
113
109
 
@@ -1180,7 +1176,7 @@ class CellComponent {
1180
1176
  }
1181
1177
  }
1182
1178
 
1183
- class Cell$1 extends CoreFeature{
1179
+ class Cell extends CoreFeature{
1184
1180
  constructor(column, row){
1185
1181
  super(column.table);
1186
1182
 
@@ -1648,7 +1644,7 @@ class ColumnComponent {
1648
1644
  }
1649
1645
  }
1650
1646
 
1651
- var defaultOptions = {
1647
+ var defaultColumnOptions = {
1652
1648
  "title": undefined,
1653
1649
  "field": undefined,
1654
1650
  "columns": undefined,
@@ -1810,7 +1806,7 @@ class Column$1 extends CoreFeature{
1810
1806
  var def = this.definition;
1811
1807
 
1812
1808
  //set header tooltips
1813
- var tooltip = typeof def.headerTooltip === "undefined" ? def.tooltip : def.headerTooltip;
1809
+ var tooltip = def.headerTooltip;
1814
1810
 
1815
1811
  if(tooltip){
1816
1812
  if(tooltip === true){
@@ -2557,7 +2553,7 @@ class Column$1 extends CoreFeature{
2557
2553
  //////////////// Cell Management /////////////////
2558
2554
  //generate cell for this column
2559
2555
  generateCell(row){
2560
- var cell = new Cell$1(this, row);
2556
+ var cell = new Cell(this, row);
2561
2557
 
2562
2558
  this.cells.push(cell);
2563
2559
 
@@ -2679,7 +2675,7 @@ class Column$1 extends CoreFeature{
2679
2675
  }
2680
2676
  }
2681
2677
 
2682
- Column$1.defaultOptionList = defaultOptions;
2678
+ Column$1.defaultOptionList = defaultColumnOptions;
2683
2679
 
2684
2680
  //public row object
2685
2681
  class RowComponent$1 {
@@ -2772,7 +2768,7 @@ class RowComponent$1 {
2772
2768
  }
2773
2769
  }
2774
2770
 
2775
- class Row$1 extends CoreFeature{
2771
+ class Row extends CoreFeature{
2776
2772
  constructor (data, parent, type = "row"){
2777
2773
  super(parent.table);
2778
2774
 
@@ -3325,6 +3321,7 @@ class ColumnCalcs extends Module{
3325
3321
  this.subscribe("column-add", this.recalcActiveRows.bind(this));
3326
3322
  this.subscribe("data-refeshed", this.recalcActiveRows.bind(this));
3327
3323
  this.subscribe("table-redraw", this.tableRedraw.bind(this));
3324
+ this.subscribe("rows-visible", this.visibleRows.bind(this));
3328
3325
 
3329
3326
  this.registerTableFunction("getCalcResults", this.getResults.bind(this));
3330
3327
  this.registerTableFunction("recalc", this.userRecalc.bind(this));
@@ -3350,6 +3347,18 @@ class ColumnCalcs extends Module{
3350
3347
  ///////// Internal Logic //////////
3351
3348
  ///////////////////////////////////
3352
3349
 
3350
+ visibleRows(viewable, rows){
3351
+ if(this.topRow){
3352
+ rows.unshift(this.topRow);
3353
+ }
3354
+
3355
+ if(this.botRow){
3356
+ rows.push(this.botRow);
3357
+ }
3358
+
3359
+ return rows;
3360
+ }
3361
+
3353
3362
  rowsUpdated(row){
3354
3363
  if(this.table.options.groupBy){
3355
3364
  this.recalcRowGroup(this);
@@ -3614,7 +3623,7 @@ class ColumnCalcs extends Module{
3614
3623
  this.table.modules.mutator.disable();
3615
3624
  }
3616
3625
 
3617
- row = new Row$1(rowData, this, "calc");
3626
+ row = new Row(rowData, this, "calc");
3618
3627
 
3619
3628
  if(this.table.modExists("mutator")){
3620
3629
  this.table.modules.mutator.enable();
@@ -3626,7 +3635,7 @@ class ColumnCalcs extends Module{
3626
3635
 
3627
3636
  row.getComponent = () => {
3628
3637
  if(!row.component){
3629
- row.component = new CalcComponent(this);
3638
+ row.component = new CalcComponent(row);
3630
3639
  }
3631
3640
 
3632
3641
  return row.component;
@@ -3658,7 +3667,7 @@ class ColumnCalcs extends Module{
3658
3667
  this.genColumn.definition.cssClass = column.definition.cssClass;
3659
3668
 
3660
3669
  //generate cell and assign to correct column
3661
- var cell = new Cell$1(this.genColumn, row);
3670
+ var cell = new Cell(this.genColumn, row);
3662
3671
  cell.getElement();
3663
3672
  cell.column = column;
3664
3673
  cell.setWidth();
@@ -3808,12 +3817,10 @@ class DataTree extends Module{
3808
3817
  initialize(){
3809
3818
  if(this.table.options.dataTree){
3810
3819
  var dummyEl = null,
3811
- firstCol = this.table.columnManager.getFirstVisibileColumn(),
3812
3820
  options = this.table.options;
3813
3821
 
3814
3822
  this.field = options.dataTreeChildField;
3815
3823
  this.indent = options.dataTreeChildIndent;
3816
- this.elementField = options.dataTreeElementColumn || (firstCol ? firstCol.field : false);
3817
3824
 
3818
3825
  if(options.dataTreeBranchElement){
3819
3826
 
@@ -3882,15 +3889,23 @@ class DataTree extends Module{
3882
3889
 
3883
3890
  this.subscribe("row-init", this.initializeRow.bind(this));
3884
3891
  this.subscribe("row-layout-after", this.layoutRow.bind(this));
3885
- this.subscribe("row-relayout", this.layoutRow.bind(this));
3886
3892
  this.subscribe("row-deleted", this.rowDelete.bind(this),0);
3887
3893
  this.subscribe("row-data-changed", this.rowDataChanged.bind(this), 10);
3894
+ this.subscribe("cell-value-updated", this.cellValueChanged.bind(this));
3895
+ this.subscribe("edit-cancelled", this.cellValueChanged.bind(this));
3888
3896
  this.subscribe("column-moving-rows", this.columnMoving.bind(this));
3897
+ this.subscribe("table-built", this.initializeElementField.bind(this));
3889
3898
 
3890
3899
  this.registerDisplayHandler(this.getRows.bind(this), 30);
3891
3900
  }
3892
3901
  }
3893
3902
 
3903
+ initializeElementField(){
3904
+ var firstCol = this.table.columnManager.getFirstVisibleColumn();
3905
+
3906
+ this.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);
3907
+ }
3908
+
3894
3909
  getRowChildren(row){
3895
3910
  return this.getTreeChildren(row, true);
3896
3911
  }
@@ -3916,6 +3931,14 @@ class DataTree extends Module{
3916
3931
  }
3917
3932
  }
3918
3933
 
3934
+ cellValueChanged(cell){
3935
+ var field = cell.column.getField();
3936
+
3937
+ if(field === this.elementField){
3938
+ this.layoutRow(cell.row);
3939
+ }
3940
+ }
3941
+
3919
3942
  initializeRow(row){
3920
3943
  var childArray = row.getData()[this.field];
3921
3944
  var isArray = Array.isArray(childArray);
@@ -4041,7 +4064,7 @@ class DataTree extends Module{
4041
4064
 
4042
4065
  output.push(row);
4043
4066
 
4044
- if(row instanceof Row$1){
4067
+ if(row instanceof Row){
4045
4068
 
4046
4069
  row.create();
4047
4070
 
@@ -4105,7 +4128,7 @@ class DataTree extends Module{
4105
4128
  }
4106
4129
 
4107
4130
  childArray.forEach((childData) => {
4108
- var childRow = new Row$1(childData || {}, this.table.rowManager);
4131
+ var childRow = new Row(childData || {}, this.table.rowManager);
4109
4132
 
4110
4133
  childRow.create();
4111
4134
 
@@ -4182,7 +4205,7 @@ class DataTree extends Module{
4182
4205
  }
4183
4206
 
4184
4207
  children.forEach((childRow) => {
4185
- if(childRow instanceof Row$1){
4208
+ if(childRow instanceof Row){
4186
4209
  output.push(childRow);
4187
4210
  }
4188
4211
  });
@@ -4253,7 +4276,7 @@ class DataTree extends Module{
4253
4276
 
4254
4277
  if(typeof subject == "object"){
4255
4278
 
4256
- if(subject instanceof Row$1){
4279
+ if(subject instanceof Row){
4257
4280
  //subject is row element
4258
4281
  match = subject.data;
4259
4282
  }else if(subject instanceof RowComponent){
@@ -4262,7 +4285,7 @@ class DataTree extends Module{
4262
4285
  }else if(typeof HTMLElement !== "undefined" && subject instanceof HTMLElement){
4263
4286
  if(parent.modules.dataTree){
4264
4287
  match = parent.modules.dataTree.children.find((childRow) => {
4265
- return childRow instanceof Row$1 ? childRow.element === subject : false;
4288
+ return childRow instanceof Row ? childRow.element === subject : false;
4266
4289
  });
4267
4290
 
4268
4291
  if(match){
@@ -4307,7 +4330,7 @@ class DataTree extends Module{
4307
4330
  }
4308
4331
 
4309
4332
  config.children.forEach((childRow) => {
4310
- if(childRow instanceof Row$1){
4333
+ if(childRow instanceof Row){
4311
4334
  output.push(component ? childRow.getComponent() : childRow);
4312
4335
 
4313
4336
  if(recurse){
@@ -4320,17 +4343,12 @@ class DataTree extends Module{
4320
4343
  return output;
4321
4344
  }
4322
4345
 
4323
- checkForRestyle(cell){
4324
- if(!cell.row.cells.indexOf(cell)){
4325
- this.layoutRow(cell.row);
4326
- }
4327
- }
4328
-
4329
4346
  getChildField(){
4330
4347
  return this.field;
4331
4348
  }
4332
4349
 
4333
4350
  redrawNeeded(data){
4351
+ console.log("needed?", data);
4334
4352
  return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false);
4335
4353
  }
4336
4354
  }
@@ -4513,8 +4531,6 @@ function pdf(list, options, setFileContents){
4513
4531
  }
4514
4532
 
4515
4533
  rowData.push(cell);
4516
- }else {
4517
- rowData.push("");
4518
4534
  }
4519
4535
  });
4520
4536
 
@@ -4577,7 +4593,9 @@ function xlsx(list, options, setFileContents){
4577
4593
  rowData.push(!(col.value instanceof Date) && typeof col.value === "object" ? JSON.stringify(col.value) : col.value);
4578
4594
 
4579
4595
  if(col.width > 1 || col.height > -1){
4580
- merges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});
4596
+ if(col.height > 1 || col.width > 1){
4597
+ merges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});
4598
+ }
4581
4599
  }
4582
4600
  }else {
4583
4601
  rowData.push("");
@@ -4587,7 +4605,6 @@ function xlsx(list, options, setFileContents){
4587
4605
  rows.push(rowData);
4588
4606
  });
4589
4607
 
4590
-
4591
4608
  //convert rows to worksheet
4592
4609
  XLSX.utils.sheet_add_aoa(worksheet, rows);
4593
4610
 
@@ -6422,8 +6439,8 @@ function star(cell, onRendered, success, cancel, editorParams){
6422
6439
  //draggable progress bar
6423
6440
  function progress(cell, onRendered, success, cancel, editorParams){
6424
6441
  var element = cell.getElement(),
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,
6442
+ max = typeof editorParams.max === "undefined" ? ((element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("max")) || 100) : editorParams.max,
6443
+ min = typeof editorParams.min === "undefined" ? ((element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("min")) || 0) : editorParams.min,
6427
6444
  percent = (max - min) / 100,
6428
6445
  value = cell.getValue() || 0,
6429
6446
  handle = document.createElement("div"),
@@ -7085,6 +7102,7 @@ class Edit extends Module{
7085
7102
  cell.column.definition.cellEditCancelled.call(this.table, component);
7086
7103
  }
7087
7104
 
7105
+ this.dispatch("edit-cancelled", cell);
7088
7106
  this.dispatchExternal("cellEditCancelled", component);
7089
7107
  }
7090
7108
  }
@@ -7215,10 +7233,6 @@ class Edit extends Module{
7215
7233
 
7216
7234
  cell.setValue(value, true);
7217
7235
 
7218
- if(self.table.options.dataTree && self.table.modExists("dataTree")){
7219
- self.table.modules.dataTree.checkForRestyle(cell);
7220
- }
7221
-
7222
7236
  if(valid !== true){
7223
7237
  element.classList.add("tabulator-validation-fail");
7224
7238
  self.table.externalEvents.dispatch("validationFailed", cell.getComponent(), value, valid);
@@ -7241,10 +7255,6 @@ class Edit extends Module{
7241
7255
  function cancel(){
7242
7256
  if(self.currentCell === cell){
7243
7257
  self.cancelEdit();
7244
-
7245
- if(self.table.options.dataTree && self.table.modExists("dataTree")){
7246
- self.table.modules.dataTree.checkForRestyle(cell);
7247
- }
7248
7258
  }
7249
7259
  }
7250
7260
 
@@ -7452,7 +7462,7 @@ class Export extends Module{
7452
7462
  switch(range){
7453
7463
  case true:
7454
7464
  case "visible":
7455
- rows = this.table.rowManager.getVisibleRows(true);
7465
+ rows = this.table.rowManager.getVisibleRows(false, true);
7456
7466
  break;
7457
7467
 
7458
7468
  case "all":
@@ -8118,6 +8128,7 @@ class Filter extends Module{
8118
8128
  this.prevHeaderFilterChangeCheck = "{}";
8119
8129
 
8120
8130
  this.changed = false; //has filtering changed since last render
8131
+ this.tableInitialized = false;
8121
8132
 
8122
8133
  this.registerTableOption("filterMode", "local"); //local or remote filtering
8123
8134
 
@@ -8185,6 +8196,8 @@ class Filter extends Module{
8185
8196
  }
8186
8197
  });
8187
8198
  }
8199
+
8200
+ this.tableInitialized = true;
8188
8201
  }
8189
8202
 
8190
8203
  remoteFilterParams(data, config, silent, params){
@@ -8648,10 +8661,12 @@ class Filter extends Module{
8648
8661
  }
8649
8662
 
8650
8663
  refreshFilter(){
8651
- if(this.table.options.filterMode === "remote"){
8652
- this.reloadData();
8653
- }else {
8654
- this.refreshData();
8664
+ if(this.tableInitialized){
8665
+ if(this.table.options.filterMode === "remote"){
8666
+ this.reloadData();
8667
+ }else {
8668
+ this.refreshData(true);
8669
+ }
8655
8670
  }
8656
8671
 
8657
8672
  //TODO - Persist left position of row manager
@@ -8995,10 +9010,12 @@ function textarea$1(cell, formatterParams, onRendered){
8995
9010
 
8996
9011
  function money(cell, formatterParams, onRendered){
8997
9012
  var floatVal = parseFloat(cell.getValue()),
9013
+ sign = "",
8998
9014
  number, integer, decimal, rgx;
8999
9015
 
9000
9016
  var decimalSym = formatterParams.decimal || ".";
9001
9017
  var thousandSym = formatterParams.thousand || ",";
9018
+ var negativeSign = formatterParams.negativeSign || "-";
9002
9019
  var symbol = formatterParams.symbol || "";
9003
9020
  var after = !!formatterParams.symbolAfter;
9004
9021
  var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2;
@@ -9007,6 +9024,11 @@ function money(cell, formatterParams, onRendered){
9007
9024
  return this.emptyToSpace(this.sanitizeHTML(cell.getValue()));
9008
9025
  }
9009
9026
 
9027
+ if(floatVal < 0){
9028
+ floatVal = Math.abs(floatVal);
9029
+ sign = negativeSign;
9030
+ }
9031
+
9010
9032
  number = precision !== false ? floatVal.toFixed(precision) : floatVal;
9011
9033
  number = String(number).split(".");
9012
9034
 
@@ -9019,7 +9041,7 @@ function money(cell, formatterParams, onRendered){
9019
9041
  integer = integer.replace(rgx, "$1" + thousandSym + "$2");
9020
9042
  }
9021
9043
 
9022
- return after ? integer + decimal + symbol : symbol + integer + decimal;
9044
+ return after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;
9023
9045
  }
9024
9046
 
9025
9047
  function link(cell, formatterParams, onRendered){
@@ -9161,7 +9183,7 @@ function datetime(cell, formatterParams, onRendered){
9161
9183
  var value = cell.getValue();
9162
9184
 
9163
9185
  if(typeof DT != "undefined"){
9164
- var newDatetime = (window.DateTime || luxon.DateTime).fromFormat(value, inputFormat);
9186
+ var newDatetime = DT.fromFormat(String(value), inputFormat);
9165
9187
 
9166
9188
  if(newDatetime.isValid){
9167
9189
 
@@ -9172,7 +9194,7 @@ function datetime(cell, formatterParams, onRendered){
9172
9194
  return newDatetime.toFormat(outputFormat);
9173
9195
  }else {
9174
9196
 
9175
- if(invalid === true){
9197
+ if(invalid === true || !value){
9176
9198
  return value;
9177
9199
  }else if(typeof invalid === "function"){
9178
9200
  return invalid(value);
@@ -9196,7 +9218,7 @@ function datetimediff (cell, formatterParams, onRendered) {
9196
9218
  var value = cell.getValue();
9197
9219
 
9198
9220
  if(typeof DT != "undefined"){
9199
- var newDatetime = DT.fromFormat(value, inputFormat);
9221
+ var newDatetime = DT.fromFormat(String(value), inputFormat);
9200
9222
 
9201
9223
  if (newDatetime.isValid){
9202
9224
  if(humanize);else {
@@ -10167,7 +10189,10 @@ class FrozenRows extends Module{
10167
10189
 
10168
10190
  if(index > -1){
10169
10191
  var rowEl = row.getElement();
10170
- rowEl.parentNode.removeChild(rowEl);
10192
+
10193
+ if(rowEl.parentNode){
10194
+ rowEl.parentNode.removeChild(rowEl);
10195
+ }
10171
10196
 
10172
10197
  this.rows.splice(index, 1);
10173
10198
  }
@@ -10290,10 +10315,16 @@ class Group{
10290
10315
  group.wipe();
10291
10316
  });
10292
10317
  }else {
10293
- this.element = false;
10294
- this.arrowElement = false;
10295
- this.elementContents = false;
10318
+ this.rows.forEach((row) => {
10319
+ if(row.modules){
10320
+ delete row.modules.group;
10321
+ }
10322
+ });
10296
10323
  }
10324
+
10325
+ this.element = false;
10326
+ this.arrowElement = false;
10327
+ this.elementContents = false;
10297
10328
  }
10298
10329
 
10299
10330
  createElements(){
@@ -10515,7 +10546,7 @@ class Group{
10515
10546
  }
10516
10547
 
10517
10548
  this.generateGroupHeaderContents();
10518
-
10549
+
10519
10550
  if(this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table"){
10520
10551
  this.groupManager.table.modules.columnCalcs.recalcGroup(this);
10521
10552
  }
@@ -10695,7 +10726,7 @@ class Group{
10695
10726
 
10696
10727
  this.element.classList.add("tabulator-group-visible");
10697
10728
 
10698
- var prev = this.getElement();
10729
+ var prev = this.generateElement();
10699
10730
 
10700
10731
  if(this.groupList.length){
10701
10732
  this.groupList.forEach((group) => {
@@ -10813,7 +10844,11 @@ class Group{
10813
10844
  ////////////// Standard Row Functions //////////////
10814
10845
 
10815
10846
  getElement(){
10816
- this.addBindingsd = false;
10847
+ return this.elementContents ? this.element : this.generateElement();
10848
+ }
10849
+
10850
+ generateElement(){
10851
+ this.addBindings = false;
10817
10852
 
10818
10853
  this._visSet();
10819
10854
 
@@ -10939,6 +10974,34 @@ class GroupRows extends Module{
10939
10974
 
10940
10975
  //initialize group configuration
10941
10976
  initialize(){
10977
+ if(this.table.options.groupBy){
10978
+
10979
+ this.configureGroupSetup();
10980
+
10981
+ if(this.table.options.groupUpdateOnCellEdit){
10982
+ this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
10983
+ this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
10984
+ }
10985
+
10986
+ this.subscribe("row-deleting", this.rowDeleting.bind(this));
10987
+ this.subscribe("row-deleted", this.rowsUpdated.bind(this));
10988
+ this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
10989
+ this.subscribe("rows-wipe", this.wipe.bind(this));
10990
+ this.subscribe("rows-added", this.rowsUpdated.bind(this));
10991
+ this.subscribe("row-moving", this.rowMoving.bind(this));
10992
+ this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
10993
+
10994
+ this.subscribe("rows-sample", this.rowSample.bind(this));
10995
+
10996
+ this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
10997
+
10998
+ this.registerDisplayHandler(this.displayHandler, 20);
10999
+
11000
+ this.initialized = true;
11001
+ }
11002
+ }
11003
+
11004
+ configureGroupSetup(){
10942
11005
  if(this.table.options.groupBy){
10943
11006
  var groupBy = this.table.options.groupBy,
10944
11007
  startOpen = this.table.options.groupStartOpen,
@@ -11026,27 +11089,6 @@ class GroupRows extends Module{
11026
11089
  if(groupHeader){
11027
11090
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
11028
11091
  }
11029
-
11030
- if(this.table.options.groupUpdateOnCellEdit){
11031
- this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
11032
- this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
11033
- }
11034
-
11035
- this.subscribe("row-deleting", this.rowDeleting.bind(this));
11036
- this.subscribe("row-deleted", this.rowsUpdated.bind(this));
11037
- this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
11038
- this.subscribe("rows-wipe", this.wipe.bind(this));
11039
- this.subscribe("rows-added", this.rowsUpdated.bind(this));
11040
- this.subscribe("row-moving", this.rowMoving.bind(this));
11041
- this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
11042
-
11043
- this.subscribe("rows-sample", this.rowSample.bind(this));
11044
-
11045
- this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
11046
-
11047
- this.registerDisplayHandler(this.displayHandler, 20);
11048
-
11049
- this.initialized = true;
11050
11092
  }
11051
11093
  }
11052
11094
 
@@ -11111,23 +11153,28 @@ class GroupRows extends Module{
11111
11153
 
11112
11154
  setGroupBy(groups){
11113
11155
  this.table.options.groupBy = groups;
11114
- this.initialize();
11115
- this.refreshData(false, "display");
11156
+ if(!this.initialized){
11157
+ this.initialize();
11158
+ }else {
11159
+ this.configureGroupSetup();
11160
+ }
11161
+
11162
+ this.refreshData();
11116
11163
 
11117
11164
  this.trackChanges();
11118
11165
  }
11119
11166
 
11120
11167
  setGroupValues(groupValues){
11121
11168
  this.table.options.groupValues = groupValues;
11122
- this.initialize();
11123
- this.refreshData(false, "display");
11169
+ this.configureGroupSetup();
11170
+ this.refreshData();
11124
11171
 
11125
11172
  this.trackChanges();
11126
11173
  }
11127
11174
 
11128
11175
  setGroupStartOpen(values){
11129
11176
  this.table.options.groupStartOpen = values;
11130
- this.initialize();
11177
+ this.configureGroupSetup();
11131
11178
 
11132
11179
  if(this.table.options.groupBy){
11133
11180
  this.refreshData();
@@ -11140,7 +11187,7 @@ class GroupRows extends Module{
11140
11187
 
11141
11188
  setGroupHeader(values){
11142
11189
  this.table.options.groupHeader = values;
11143
- this.initialize();
11190
+ this.configureGroupSetup();
11144
11191
 
11145
11192
  if(this.table.options.groupBy){
11146
11193
  this.refreshData();
@@ -11221,7 +11268,7 @@ class GroupRows extends Module{
11221
11268
 
11222
11269
  //return appropriate rows with group headers
11223
11270
  getRows(rows){
11224
- if(this.groupIDLookups.length){
11271
+ if(this.table.options.groupBy && this.groupIDLookups.length){
11225
11272
 
11226
11273
  this.dispatchExternal("dataGrouping");
11227
11274
 
@@ -11336,7 +11383,7 @@ class GroupRows extends Module{
11336
11383
  var oldGroups = this.groups;
11337
11384
 
11338
11385
  this.groups = {};
11339
- this.groupList =[];
11386
+ this.groupList = [];
11340
11387
 
11341
11388
  if(this.allowedValues && this.allowedValues[0]){
11342
11389
  this.allowedValues[0].forEach((value) => {
@@ -11569,7 +11616,7 @@ class History extends Module{
11569
11616
  }
11570
11617
  }
11571
11618
 
11572
- this.history.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
11619
+ this.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
11573
11620
  }
11574
11621
 
11575
11622
  cellUpdated(cell){
@@ -11711,7 +11758,7 @@ class HtmlTableImport extends Module{
11711
11758
 
11712
11759
  rows = rows ? rows.getElementsByTagName("tr") : [];
11713
11760
 
11714
- //check for tablator inline options
11761
+ //check for Tabulator inline options
11715
11762
  this._extractOptions(element, options);
11716
11763
 
11717
11764
  if(headers.length){
@@ -11750,7 +11797,7 @@ class HtmlTableImport extends Module{
11750
11797
  //extract tabulator attribute options
11751
11798
  _extractOptions(element, options, defaultOptions){
11752
11799
  var attributes = element.attributes;
11753
- var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options);
11800
+ var optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);
11754
11801
  var optionsList = {};
11755
11802
 
11756
11803
  optionsArr.forEach((item) => {
@@ -11817,11 +11864,8 @@ class HtmlTableImport extends Module{
11817
11864
  col.width = width;
11818
11865
  }
11819
11866
 
11820
- //check for tablator inline options
11821
- header.attributes;
11822
-
11823
- // //check for tablator inline options
11824
- this._extractOptions(header, col, Column.prototype.defaultOptionList);
11867
+ //check for Tabulator inline options
11868
+ this._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);
11825
11869
 
11826
11870
  this.fieldIndex[index] = col.field;
11827
11871
 
@@ -12141,7 +12185,7 @@ class Interaction extends Module{
12141
12185
 
12142
12186
  if(this.columnSubscribers[action]){
12143
12187
 
12144
- if(component instanceof Cell$1){
12188
+ if(component instanceof Cell){
12145
12189
  callback = component.column.definition[action];
12146
12190
  }else if(component instanceof Column$1){
12147
12191
  callback = component.definition[action];
@@ -12798,10 +12842,10 @@ class Menu extends Module{
12798
12842
  Menu.moduleName = "menu";
12799
12843
 
12800
12844
  class MoveColumns extends Module{
12801
-
12845
+
12802
12846
  constructor(table){
12803
12847
  super(table);
12804
-
12848
+
12805
12849
  this.placeholderElement = this.createPlaceholderElement();
12806
12850
  this.hoverElement = false; //floating column header element
12807
12851
  this.checkTimeout = false; //click check timeout holder
@@ -12814,35 +12858,36 @@ class MoveColumns extends Module{
12814
12858
  this.autoScrollStep = 5; //auto scroll distance in pixels
12815
12859
  this.autoScrollTimeout = false; //auto scroll timeout
12816
12860
  this.touchMove = false;
12817
-
12861
+
12818
12862
  this.moveHover = this.moveHover.bind(this);
12819
12863
  this.endMove = this.endMove.bind(this);
12820
-
12864
+
12821
12865
  this.registerTableOption("movableColumns", false); //enable movable columns
12822
12866
  }
12823
-
12867
+
12824
12868
  createPlaceholderElement(){
12825
12869
  var el = document.createElement("div");
12826
-
12870
+
12827
12871
  el.classList.add("tabulator-col");
12828
12872
  el.classList.add("tabulator-col-placeholder");
12829
-
12873
+
12830
12874
  return el;
12831
12875
  }
12832
-
12876
+
12833
12877
  initialize(){
12834
- this.subscribe("column-init", this.initializeColumn.bind(this));
12878
+ if(this.table.options.movableColumns){
12879
+ this.subscribe("column-init", this.initializeColumn.bind(this));
12880
+ }
12835
12881
  }
12836
-
12882
+
12837
12883
  initializeColumn(column){
12838
12884
  var self = this,
12839
12885
  config = {},
12840
12886
  colEl;
12841
-
12887
+
12842
12888
  if(!column.modules.frozen){
12843
-
12844
12889
  colEl = column.getElement();
12845
-
12890
+
12846
12891
  config.mousemove = function(e){
12847
12892
  if(column.parent === self.moving.parent){
12848
12893
  if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){
@@ -12858,7 +12903,7 @@ class MoveColumns extends Module{
12858
12903
  }
12859
12904
  }
12860
12905
  }.bind(self);
12861
-
12906
+
12862
12907
  colEl.addEventListener("mousedown", function(e){
12863
12908
  self.touchMove = false;
12864
12909
  if(e.which === 1){
@@ -12867,7 +12912,7 @@ class MoveColumns extends Module{
12867
12912
  }, self.checkPeriod);
12868
12913
  }
12869
12914
  });
12870
-
12915
+
12871
12916
  colEl.addEventListener("mouseup", function(e){
12872
12917
  if(e.which === 1){
12873
12918
  if(self.checkTimeout){
@@ -12875,18 +12920,18 @@ class MoveColumns extends Module{
12875
12920
  }
12876
12921
  }
12877
12922
  });
12878
-
12923
+
12879
12924
  self.bindTouchEvents(column);
12880
12925
  }
12881
-
12926
+
12882
12927
  column.modules.moveColumn = config;
12883
12928
  }
12884
-
12929
+
12885
12930
  bindTouchEvents(column){
12886
12931
  var colEl = column.getElement(),
12887
12932
  startXMove = false, //shifting center position of the cell
12888
12933
  nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;
12889
-
12934
+
12890
12935
  colEl.addEventListener("touchstart", (e) => {
12891
12936
  this.checkTimeout = setTimeout(() => {
12892
12937
  this.touchMove = true;
@@ -12897,27 +12942,27 @@ class MoveColumns extends Module{
12897
12942
  nextColWidthLast = 0;
12898
12943
  prevColWidthLast = 0;
12899
12944
  startXMove = false;
12900
-
12945
+
12901
12946
  this.startMove(e, column);
12902
12947
  }, this.checkPeriod);
12903
12948
  }, {passive: true});
12904
-
12949
+
12905
12950
  colEl.addEventListener("touchmove", (e) => {
12906
12951
  var diff, moveToCol;
12907
-
12952
+
12908
12953
  if(this.moving){
12909
12954
  this.moveHover(e);
12910
-
12955
+
12911
12956
  if(!startXMove){
12912
12957
  startXMove = e.touches[0].pageX;
12913
12958
  }
12914
-
12959
+
12915
12960
  diff = e.touches[0].pageX - startXMove;
12916
-
12961
+
12917
12962
  if(diff > 0){
12918
12963
  if(nextCol && diff - nextColWidthLast > nextColWidth){
12919
12964
  moveToCol = nextCol;
12920
-
12965
+
12921
12966
  if(moveToCol !== column){
12922
12967
  startXMove = e.touches[0].pageX;
12923
12968
  moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);
@@ -12927,7 +12972,7 @@ class MoveColumns extends Module{
12927
12972
  }else {
12928
12973
  if(prevCol && -diff - prevColWidthLast > prevColWidth){
12929
12974
  moveToCol = prevCol;
12930
-
12975
+
12931
12976
  if(moveToCol !== column){
12932
12977
  startXMove = e.touches[0].pageX;
12933
12978
  moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());
@@ -12935,7 +12980,7 @@ class MoveColumns extends Module{
12935
12980
  }
12936
12981
  }
12937
12982
  }
12938
-
12983
+
12939
12984
  if(moveToCol){
12940
12985
  nextCol = moveToCol.nextColumn();
12941
12986
  nextColWidthLast = nextColWidth;
@@ -12946,7 +12991,7 @@ class MoveColumns extends Module{
12946
12991
  }
12947
12992
  }
12948
12993
  }, {passive: true});
12949
-
12994
+
12950
12995
  colEl.addEventListener("touchend", (e) => {
12951
12996
  if(this.checkTimeout){
12952
12997
  clearTimeout(this.checkTimeout);
@@ -12956,41 +13001,43 @@ class MoveColumns extends Module{
12956
13001
  }
12957
13002
  });
12958
13003
  }
12959
-
13004
+
12960
13005
  startMove(e, column){
12961
- var element = column.getElement();
12962
-
13006
+ var element = column.getElement(),
13007
+ headerElement = this.table.columnManager.getElement(),
13008
+ headersElement = this.table.columnManager.getHeadersElement();
13009
+
12963
13010
  this.moving = column;
12964
13011
  this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
12965
-
13012
+
12966
13013
  this.table.element.classList.add("tabulator-block-select");
12967
-
13014
+
12968
13015
  //create placeholder
12969
13016
  this.placeholderElement.style.width = column.getWidth() + "px";
12970
13017
  this.placeholderElement.style.height = column.getHeight() + "px";
12971
-
13018
+
12972
13019
  element.parentNode.insertBefore(this.placeholderElement, element);
12973
13020
  element.parentNode.removeChild(element);
12974
-
13021
+
12975
13022
  //create hover element
12976
13023
  this.hoverElement = element.cloneNode(true);
12977
13024
  this.hoverElement.classList.add("tabulator-moving");
12978
-
13025
+
12979
13026
  this.table.columnManager.getElement().appendChild(this.hoverElement);
12980
-
13027
+
12981
13028
  this.hoverElement.style.left = "0";
12982
- this.hoverElement.style.bottom = "0";
12983
-
13029
+ this.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + "px";
13030
+
12984
13031
  if(!this.touchMove){
12985
13032
  this._bindMouseMove();
12986
-
13033
+
12987
13034
  document.body.addEventListener("mousemove", this.moveHover);
12988
13035
  document.body.addEventListener("mouseup", this.endMove);
12989
13036
  }
12990
-
13037
+
12991
13038
  this.moveHover(e);
12992
13039
  }
12993
-
13040
+
12994
13041
  _bindMouseMove(){
12995
13042
  this.table.columnManager.columnsByIndex.forEach(function(column){
12996
13043
  if(column.modules.moveColumn.mousemove){
@@ -12998,7 +13045,7 @@ class MoveColumns extends Module{
12998
13045
  }
12999
13046
  });
13000
13047
  }
13001
-
13048
+
13002
13049
  _unbindMouseMove(){
13003
13050
  this.table.columnManager.columnsByIndex.forEach(function(column){
13004
13051
  if(column.modules.moveColumn.mousemove){
@@ -13006,65 +13053,65 @@ class MoveColumns extends Module{
13006
13053
  }
13007
13054
  });
13008
13055
  }
13009
-
13056
+
13010
13057
  moveColumn(column, after){
13011
13058
  var movingCells = this.moving.getCells();
13012
-
13059
+
13013
13060
  this.toCol = column;
13014
13061
  this.toColAfter = after;
13015
-
13062
+
13016
13063
  if(after){
13017
13064
  column.getCells().forEach(function(cell, i){
13018
13065
  var cellEl = cell.getElement(true);
13019
-
13020
- if(cellEl.parentNode){
13066
+
13067
+ if(cellEl.parentNode && movingCells[i]){
13021
13068
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
13022
13069
  }
13023
13070
  });
13024
13071
  }else {
13025
13072
  column.getCells().forEach(function(cell, i){
13026
13073
  var cellEl = cell.getElement(true);
13027
-
13028
- if(cellEl.parentNode){
13074
+
13075
+ if(cellEl.parentNode && movingCells[i]){
13029
13076
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
13030
13077
  }
13031
13078
  });
13032
13079
  }
13033
13080
  }
13034
-
13081
+
13035
13082
  endMove(e){
13036
13083
  if(e.which === 1 || this.touchMove){
13037
13084
  this._unbindMouseMove();
13038
-
13085
+
13039
13086
  this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);
13040
13087
  this.placeholderElement.parentNode.removeChild(this.placeholderElement);
13041
13088
  this.hoverElement.parentNode.removeChild(this.hoverElement);
13042
-
13089
+
13043
13090
  this.table.element.classList.remove("tabulator-block-select");
13044
-
13091
+
13045
13092
  if(this.toCol){
13046
13093
  this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);
13047
13094
  }
13048
-
13095
+
13049
13096
  this.moving = false;
13050
13097
  this.toCol = false;
13051
13098
  this.toColAfter = false;
13052
-
13099
+
13053
13100
  if(!this.touchMove){
13054
13101
  document.body.removeEventListener("mousemove", this.moveHover);
13055
13102
  document.body.removeEventListener("mouseup", this.endMove);
13056
13103
  }
13057
13104
  }
13058
13105
  }
13059
-
13106
+
13060
13107
  moveHover(e){
13061
13108
  var columnHolder = this.table.columnManager.getElement(),
13062
13109
  scrollLeft = columnHolder.scrollLeft,
13063
13110
  xPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,
13064
13111
  scrollPos;
13065
-
13112
+
13066
13113
  this.hoverElement.style.left = (xPos - this.startX) + "px";
13067
-
13114
+
13068
13115
  if(xPos - scrollLeft < this.autoScrollMargin){
13069
13116
  if(!this.autoScrollTimeout){
13070
13117
  this.autoScrollTimeout = setTimeout(() => {
@@ -13074,7 +13121,7 @@ class MoveColumns extends Module{
13074
13121
  }, 1);
13075
13122
  }
13076
13123
  }
13077
-
13124
+
13078
13125
  if(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){
13079
13126
  if(!this.autoScrollTimeout){
13080
13127
  this.autoScrollTimeout = setTimeout(() => {
@@ -13874,13 +13921,10 @@ class Page extends Module{
13874
13921
 
13875
13922
  this.pageSizes = [];
13876
13923
 
13877
- this.dataReceivedNames = {}; //TODO - remove once pagimation update is complete
13878
- this.dataSentNames = {}; //TODO - remove once pagimation update is complete
13879
-
13880
13924
  this.registerTableOption("pagination", false); //set pagination type
13881
13925
  this.registerTableOption("paginationMode", "local"); //local or remote pagination
13882
13926
  this.registerTableOption("paginationSize", false); //set number of rows to a page
13883
- this.registerTableOption("paginationInitialPage", 1); //initail page to show on load
13927
+ this.registerTableOption("paginationInitialPage", 1); //initial page to show on load
13884
13928
  this.registerTableOption("paginationButtonCount", 5); // set count of page button
13885
13929
  this.registerTableOption("paginationSizeSelector", false); //add pagination size selector element
13886
13930
  this.registerTableOption("paginationElement", false); //element to hold pagination numbers
@@ -13929,10 +13973,10 @@ class Page extends Module{
13929
13973
  this.createElements();
13930
13974
  this.initializePaginator();
13931
13975
  }else if(this.table.options.progressiveLoad){
13932
-
13933
13976
  this.subscribe("data-params", this.remotePageParams.bind(this));
13934
13977
  this.subscribe("data-loaded", this._parseRemoteData.bind(this));
13935
13978
  this.subscribe("table-built", this.calculatePageSizes.bind(this));
13979
+ this.subscribe("data-processed", this.initialLoadComplete.bind(this));
13936
13980
 
13937
13981
  this.initializeProgressive(this.table.options.progressiveLoad);
13938
13982
 
@@ -14050,7 +14094,8 @@ class Page extends Module{
14050
14094
  margin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);
14051
14095
 
14052
14096
  if(diff < margin){
14053
- this.nextPage();
14097
+ this.nextPage()
14098
+ .catch(() => {}); //consume the exception thrown when on the last page
14054
14099
  }
14055
14100
  }
14056
14101
  }
@@ -14295,7 +14340,7 @@ class Page extends Module{
14295
14340
  }
14296
14341
  }
14297
14342
 
14298
- //set the maxmum page
14343
+ //set the maximum page
14299
14344
  setMaxPage(max){
14300
14345
 
14301
14346
  max = parseInt(max);
@@ -14549,7 +14594,7 @@ class Page extends Module{
14549
14594
  var data, margin;
14550
14595
 
14551
14596
  if(typeof data.last_page === "undefined"){
14552
- console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property");
14597
+ console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").last_page || "last_page") + "' property");
14553
14598
  }
14554
14599
 
14555
14600
  if(data.data){
@@ -14573,7 +14618,7 @@ class Page extends Module{
14573
14618
  break;
14574
14619
 
14575
14620
  case "progressive_scroll":
14576
- data = this.table.rowManager.getData().concat(data.data);
14621
+ data = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);
14577
14622
 
14578
14623
  this.table.rowManager.setData(data, this.page !== 1, this.page == 1);
14579
14624
 
@@ -14596,7 +14641,7 @@ class Page extends Module{
14596
14641
  }
14597
14642
 
14598
14643
  }else {
14599
- console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property");
14644
+ console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").data || "data") + "' property");
14600
14645
  }
14601
14646
 
14602
14647
  return data.data;
@@ -16379,9 +16424,9 @@ class SelectRow extends Module{
16379
16424
  this.subscribe("row-init", this.initializeRow.bind(this));
16380
16425
  this.subscribe("row-deleting", this.rowDeleted.bind(this));
16381
16426
  this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
16382
- this.subscribe("rows-retrieve", this.clearSelectionData.bind(this));
16427
+ this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
16383
16428
 
16384
- if(this.table.options.selectable && this.table.options.selectablePersistence){
16429
+ if(this.table.options.selectable && !this.table.options.selectablePersistence){
16385
16430
  this.subscribe("data-refeshing", this.deselectRows.bind(this));
16386
16431
  }
16387
16432
  }
@@ -16395,7 +16440,6 @@ class SelectRow extends Module{
16395
16440
  this._deselectRow(row, true);
16396
16441
  }
16397
16442
 
16398
-
16399
16443
  clearSelectionData(silent){
16400
16444
  this.selecting = false;
16401
16445
  this.lastClickedRow = false;
@@ -16621,9 +16665,7 @@ class SelectRow extends Module{
16621
16665
  this.childRowSelection(row, true);
16622
16666
  }
16623
16667
 
16624
- if(!silent){
16625
- this.dispatchExternal("rowSelected", row.getComponent());
16626
- }
16668
+ this.dispatchExternal("rowSelected", row.getComponent());
16627
16669
 
16628
16670
  this._rowSelectionChanged(silent);
16629
16671
  }
@@ -16642,7 +16684,7 @@ class SelectRow extends Module{
16642
16684
  deselectRows(rows, silent){
16643
16685
  var self = this,
16644
16686
  rowCount;
16645
-
16687
+
16646
16688
  if(typeof rows == "undefined"){
16647
16689
 
16648
16690
  rowCount = self.selectedRows.length;
@@ -16694,9 +16736,7 @@ class SelectRow extends Module{
16694
16736
  this.childRowSelection(row, false);
16695
16737
  }
16696
16738
 
16697
- if(!silent){
16698
- this.dispatchExternal("rowDeselected", row.getComponent());
16699
- }
16739
+ this.dispatchExternal("rowDeselected", row.getComponent());
16700
16740
 
16701
16741
  self._rowSelectionChanged(silent);
16702
16742
  }
@@ -16860,8 +16900,9 @@ function datetime$1(a, b, aRow, bRow, column, dir, params){
16860
16900
  emptyAlign = 0;
16861
16901
 
16862
16902
  if(typeof DT != "undefined"){
16863
- a = DT.fromFormat(a, format);
16864
- b = DT.fromFormat(b, format);
16903
+ a = DT.fromFormat(String(a), format);
16904
+ b = DT.fromFormat(String(b), format);
16905
+
16865
16906
  if(!a.isValid){
16866
16907
  emptyAlign = !b.isValid ? 0 : -1;
16867
16908
  }else if(!b.isValid){
@@ -17232,7 +17273,7 @@ class Sort extends Module{
17232
17273
  if(this.table.options.sortMode === "remote"){
17233
17274
  this.reloadData();
17234
17275
  }else {
17235
- this.refreshData();
17276
+ this.refreshData(true);
17236
17277
  }
17237
17278
 
17238
17279
  //TODO - Persist left position of row manager
@@ -17886,7 +17927,7 @@ var modules = /*#__PURE__*/Object.freeze({
17886
17927
  ValidateModule: Validate
17887
17928
  });
17888
17929
 
17889
- var defaultOptions$1 = {
17930
+ var defaultOptions = {
17890
17931
 
17891
17932
  debugEventsExternal:false, //flag to console log events
17892
17933
  debugEventsInternal:false, //flag to console log events
@@ -17907,7 +17948,7 @@ var defaultOptions$1 = {
17907
17948
  autoColumns:false, //build columns from data row structure
17908
17949
  autoColumnsDefinitions:false,
17909
17950
 
17910
- nestedFieldSeparator:".", //seperatpr for nested data
17951
+ nestedFieldSeparator:".", //separator for nested data
17911
17952
 
17912
17953
  tooltipGenerationMode:"load", //when to generate tooltips
17913
17954
 
@@ -17948,10 +17989,10 @@ var defaultOptions$1 = {
17948
17989
  };
17949
17990
 
17950
17991
  class OptionsList {
17951
- constructor(table, msgType){
17992
+ constructor(table, msgType, defaults = {}){
17952
17993
  this.table = table;
17953
17994
  this.msgType = msgType;
17954
- this.registeredDefaults = {};
17995
+ this.registeredDefaults = Object.assign({}, defaults);
17955
17996
  }
17956
17997
 
17957
17998
  register(option, value){
@@ -18134,8 +18175,9 @@ class Renderer extends CoreFeature{
18134
18175
  if(!ifVisible){
18135
18176
  if(Helpers.elVisible(rowEl)){
18136
18177
  offset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;
18137
-
18178
+
18138
18179
  if(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){
18180
+ resolve();
18139
18181
  return false;
18140
18182
  }
18141
18183
  }
@@ -18691,7 +18733,7 @@ class ColumnManager extends CoreFeature {
18691
18733
  this.columnsByIndex = []; //columns by index
18692
18734
  this.columnsByField = {}; //columns by field
18693
18735
  this.scrollLeft = 0;
18694
- this.optionsList = new OptionsList(this.table, "column definition");
18736
+ this.optionsList = new OptionsList(this.table, "column definition", defaultColumnOptions);
18695
18737
 
18696
18738
  this.renderer = null;
18697
18739
  }
@@ -18904,8 +18946,9 @@ class ColumnManager extends CoreFeature {
18904
18946
  index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;
18905
18947
 
18906
18948
  if(nextToColumn && index > -1){
18907
- var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn());
18908
- var nextEl = nextToColumn.getElement();
18949
+ var topColumn = nextToColumn.getTopColumn();
18950
+ var parentIndex = this.columns.indexOf(topColumn);
18951
+ var nextEl = topColumn.getElement();
18909
18952
 
18910
18953
  if(before){
18911
18954
  this.columns.splice(parentIndex, 0, column);
@@ -19019,7 +19062,7 @@ class ColumnManager extends CoreFeature {
19019
19062
  return this.columnsByIndex[index];
19020
19063
  }
19021
19064
 
19022
- getFirstVisibileColumn(index){
19065
+ getFirstVisibleColumn(index){
19023
19066
  var index = this.columnsByIndex.findIndex((col) => {
19024
19067
  return col.visible;
19025
19068
  });
@@ -19280,13 +19323,11 @@ class ColumnManager extends CoreFeature {
19280
19323
 
19281
19324
  this.dispatch("column-add", definition, before, nextToColumn);
19282
19325
 
19283
- this.redraw(true);
19284
-
19285
19326
  if(this.layoutMode() != "fitColumns"){
19286
19327
  column.reinitializeWidth();
19287
19328
  }
19288
19329
 
19289
- this.verticalAlignHeaders();
19330
+ this.redraw(true);
19290
19331
 
19291
19332
  this.table.rowManager.reinitialize();
19292
19333
 
@@ -19465,7 +19506,7 @@ class VirtualDomVertical extends Renderer{
19465
19506
 
19466
19507
  element.style.paddingTop = "";
19467
19508
  element.style.paddingBottom = "";
19468
- element.style.minWidth = "";
19509
+ // element.style.minWidth = "";
19469
19510
  element.style.minHeight = "";
19470
19511
  element.style.display = "";
19471
19512
  element.style.visibility = "";
@@ -20105,7 +20146,7 @@ class RowManager extends CoreFeature{
20105
20146
  ////////////////// Row Manipulation //////////////////
20106
20147
  findRow(subject){
20107
20148
  if(typeof subject == "object"){
20108
- if(subject instanceof Row$1){
20149
+ if(subject instanceof Row){
20109
20150
  //subject is row element
20110
20151
  return subject;
20111
20152
  }else if(subject instanceof RowComponent$1){
@@ -20188,7 +20229,7 @@ class RowManager extends CoreFeature{
20188
20229
 
20189
20230
  data.forEach((def, i) => {
20190
20231
  if(def && typeof def === "object"){
20191
- var row = new Row$1(def, this);
20232
+ var row = new Row(def, this);
20192
20233
  this.rows.push(row);
20193
20234
  }else {
20194
20235
  console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", def);
@@ -20320,7 +20361,7 @@ class RowManager extends CoreFeature{
20320
20361
  }
20321
20362
 
20322
20363
  addRowActual(data, pos, index, blockRedraw){
20323
- var row = data instanceof Row$1 ? data : new Row$1(data || {}, this),
20364
+ var row = data instanceof Row ? data : new Row(data || {}, this),
20324
20365
  top = this.findAddRowPos(pos),
20325
20366
  allIndex = -1,
20326
20367
  activeIndex, chainResult;
@@ -20479,7 +20520,7 @@ class RowManager extends CoreFeature{
20479
20520
  nextRow = this.getDisplayRows()[index+1];
20480
20521
  }
20481
20522
 
20482
- if(nextRow && (!(nextRow instanceof Row$1) || nextRow.type != "row")){
20523
+ if(nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")){
20483
20524
  return this.nextDisplayRow(nextRow, rowOnly);
20484
20525
  }
20485
20526
 
@@ -20494,7 +20535,7 @@ class RowManager extends CoreFeature{
20494
20535
  prevRow = this.getDisplayRows()[index-1];
20495
20536
  }
20496
20537
 
20497
- if(rowOnly && prevRow && (!(prevRow instanceof Row$1) || prevRow.type != "row")){
20538
+ if(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")){
20498
20539
  return this.prevDisplayRow(prevRow, rowOnly);
20499
20540
  }
20500
20541
 
@@ -20753,8 +20794,14 @@ class RowManager extends CoreFeature{
20753
20794
  }
20754
20795
  }
20755
20796
 
20756
- getVisibleRows(viewable){
20757
- return this.renderer.visibleRows(!viewable);
20797
+ getVisibleRows(chain, viewable){
20798
+ var rows = Object.assign([], this.renderer.visibleRows(!viewable));
20799
+
20800
+ if(chain){
20801
+ rows = this.chain("rows-visible", [viewable], rows, rows);
20802
+ }
20803
+
20804
+ return rows;
20758
20805
  }
20759
20806
 
20760
20807
  //repeat action accross display rows
@@ -21118,29 +21165,29 @@ class FooterManager extends CoreFeature{
21118
21165
  }
21119
21166
 
21120
21167
  class InteractionManager extends CoreFeature {
21121
-
21168
+
21122
21169
  constructor (table){
21123
21170
  super(table);
21124
-
21125
- this.el = this.table.element;
21126
-
21171
+
21172
+ this.el = null;
21173
+
21127
21174
  this.abortClasses = ["tabulator-headers", "tabulator-table"];
21128
-
21175
+
21129
21176
  this.previousTargets = {};
21130
-
21177
+
21131
21178
  this.listeners = [
21132
- "click",
21133
- "dblclick",
21134
- "contextmenu",
21135
- "mouseenter",
21136
- "mouseleave",
21137
- "mouseover",
21138
- "mouseout",
21139
- "mousemove",
21140
- "touchstart",
21141
- "touchend",
21179
+ "click",
21180
+ "dblclick",
21181
+ "contextmenu",
21182
+ "mouseenter",
21183
+ "mouseleave",
21184
+ "mouseover",
21185
+ "mouseout",
21186
+ "mousemove",
21187
+ "touchstart",
21188
+ "touchend",
21142
21189
  ];
21143
-
21190
+
21144
21191
  this.componentMap = {
21145
21192
  "tabulator-cell":"cell",
21146
21193
  "tabulator-row":"row",
@@ -21148,41 +21195,101 @@ class InteractionManager extends CoreFeature {
21148
21195
  "tabulator-col":"column",
21149
21196
  };
21150
21197
 
21198
+ this.pseudoTrackers = {
21199
+ "row":null,
21200
+ "cell":null,
21201
+ "group":null,
21202
+ "column":null,
21203
+ };
21204
+ }
21205
+
21206
+ initialize(){
21207
+ this.el = this.table.element;
21151
21208
  this.buildListenerMap();
21152
21209
  this.bindSubscriptionWatchers();
21210
+ this.bindPseudoEvents();
21153
21211
  }
21154
-
21212
+
21155
21213
  buildListenerMap(){
21156
21214
  var listenerMap = {};
21157
-
21215
+
21158
21216
  this.listeners.forEach((listener) => {
21159
21217
  listenerMap[listener] = {
21160
21218
  handler:null,
21161
21219
  components:[],
21162
21220
  };
21163
21221
  });
21164
-
21222
+
21165
21223
  this.listeners = listenerMap;
21166
21224
  }
21167
21225
 
21226
+ bindPseudoEvents(){
21227
+ Object.keys(this.pseudoTrackers).forEach((key) => {
21228
+ this.subscribe(key + "-mouseover", this.pseudoMouseEnter.bind(this, key));
21229
+ // this.subscribe(key + "-mouseout", this.pseudoMouseLeave.bind(this, key));
21230
+ });
21231
+ }
21232
+
21233
+ pseudoMouseEnter(key, e, target){
21234
+ if(this.pseudoTrackers[key] !== target){
21235
+
21236
+ if(this.pseudoTrackers[key]){
21237
+ this.dispatch(key + "-mouseleave", e, target);
21238
+ }
21239
+
21240
+ this.pseudoMouseLeave(key, e);
21241
+
21242
+ this.pseudoTrackers[key] = target;
21243
+
21244
+ this.dispatch(key + "-mouseenter", e, target);
21245
+ }
21246
+ }
21247
+
21248
+ pseudoMouseLeave(key, e){
21249
+ var leaveList = Object.keys(this.pseudoTrackers),
21250
+ linkedKeys = {
21251
+ "row":["cell"],
21252
+ "cell":["row"],
21253
+ };
21254
+
21255
+ leaveList = leaveList.filter((item) => {
21256
+ var links = linkedKeys[key];
21257
+ return item !== key && (!links || (links && !links.includes(item)));
21258
+ });
21259
+
21260
+
21261
+ leaveList.forEach((key) => {
21262
+ var target = this.pseudoTrackers[key];
21263
+
21264
+ if(this.pseudoTrackers[key]){
21265
+ this.dispatch(key + "-mouseleave", e, target);
21266
+
21267
+ this.pseudoTrackers[key] = null;
21268
+ }
21269
+ });
21270
+ }
21271
+
21272
+
21168
21273
  bindSubscriptionWatchers(){
21169
21274
  var listeners = Object.keys(this.listeners),
21170
21275
  components = Object.values(this.componentMap);
21171
-
21276
+
21172
21277
  for(let comp of components){
21173
21278
  for(let listener of listeners){
21174
21279
  let key = comp + "-" + listener;
21175
-
21280
+
21176
21281
  this.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));
21177
21282
  }
21178
21283
  }
21284
+
21285
+ this.subscribe("table-destroy", this.clearWatchers.bind(this));
21179
21286
  }
21180
-
21287
+
21181
21288
  subscriptionChanged(component, key, added){
21182
21289
  var listener = this.listeners[key].components,
21183
21290
  index = listener.indexOf(component),
21184
21291
  changed = false;
21185
-
21292
+
21186
21293
  if(added){
21187
21294
  if(index === -1){
21188
21295
  listener.push(component);
@@ -21196,16 +21303,16 @@ class InteractionManager extends CoreFeature {
21196
21303
  }
21197
21304
  }
21198
21305
  }
21199
-
21306
+
21200
21307
  if(changed){
21201
21308
  this.updateEventListeners();
21202
21309
  }
21203
21310
  }
21204
-
21311
+
21205
21312
  updateEventListeners(){
21206
21313
  for(let key in this.listeners){
21207
21314
  let listener = this.listeners[key];
21208
-
21315
+
21209
21316
  if(listener.components.length){
21210
21317
  if(!listener.handler){
21211
21318
  listener.handler = this.track.bind(this, key);
@@ -21220,57 +21327,63 @@ class InteractionManager extends CoreFeature {
21220
21327
  }
21221
21328
  }
21222
21329
  }
21223
-
21330
+
21224
21331
  track(type, e){
21225
21332
  var path = (e.composedPath && e.composedPath()) || e.path;
21333
+
21226
21334
  var targets = this.findTargets(path);
21227
21335
  targets = this.bindComponents(type, targets);
21336
+
21228
21337
  this.triggerEvents(type, e, targets);
21229
- }
21230
21338
 
21339
+ if((type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length){
21340
+ this.pseudoMouseLeave("none", e);
21341
+ }
21342
+ }
21343
+
21231
21344
  findTargets(path){
21232
21345
  var targets = {};
21233
-
21346
+
21234
21347
  let componentMap = Object.keys(this.componentMap);
21235
-
21348
+
21236
21349
  for (let el of path) {
21237
21350
  let classList = el.classList ? [...el.classList] : [];
21238
-
21351
+
21239
21352
  let abort = classList.filter((item) => {
21240
21353
  return this.abortClasses.includes(item);
21241
21354
  });
21242
-
21355
+
21243
21356
  if(abort.length){
21244
21357
  break;
21245
21358
  }
21246
-
21359
+
21247
21360
  let elTargets = classList.filter((item) => {
21248
21361
  return componentMap.includes(item);
21249
21362
  });
21250
-
21363
+
21251
21364
  for (let target of elTargets) {
21252
21365
  targets[this.componentMap[target]] = el;
21253
21366
  }
21254
21367
  }
21255
-
21368
+
21256
21369
  if(targets.group && targets.group === targets.row){
21257
21370
  delete targets.row;
21258
21371
  }
21259
-
21372
+
21260
21373
  return targets;
21261
21374
  }
21262
-
21375
+
21263
21376
  bindComponents(type, targets){
21264
21377
  //ensure row component is looked up before cell
21265
21378
  var keys = Object.keys(targets).reverse(),
21266
21379
  listener = this.listeners[type],
21267
21380
  targetMatches = {};
21268
-
21381
+
21269
21382
  for(let key of keys){
21270
21383
  let component;
21271
21384
  let target = targets[key];
21272
21385
  let previousTarget = this.previousTargets[key];
21273
-
21386
+
21274
21387
  if(previousTarget && previousTarget.target === target){
21275
21388
  component = previousTarget.component;
21276
21389
  }else {
@@ -21278,20 +21391,20 @@ class InteractionManager extends CoreFeature {
21278
21391
  case "row":
21279
21392
  case "group":
21280
21393
  if(listener.components.includes("row") || listener.components.includes("cell")){
21281
- let rows = this.table.rowManager.getVisibleRows();
21282
-
21394
+ let rows = this.table.rowManager.getVisibleRows(true);
21395
+
21283
21396
  component = rows.find((row) => {
21284
21397
  return row.getElement() === target;
21285
21398
  });
21286
21399
  }
21287
21400
  break;
21288
-
21401
+
21289
21402
  case "column":
21290
21403
  if(listener.components.includes("column")){
21291
21404
  component = this.table.columnManager.findColumn(target);
21292
21405
  }
21293
21406
  break
21294
-
21407
+
21295
21408
  case "cell":
21296
21409
  if(listener.components.includes("cell")){
21297
21410
  component = targets["row"].findCell(target);
@@ -21299,7 +21412,7 @@ class InteractionManager extends CoreFeature {
21299
21412
  break;
21300
21413
  }
21301
21414
  }
21302
-
21415
+
21303
21416
  if(component){
21304
21417
  targets[key] = component;
21305
21418
  targetMatches[key] = {
@@ -21308,24 +21421,35 @@ class InteractionManager extends CoreFeature {
21308
21421
  };
21309
21422
  }
21310
21423
  }
21311
-
21424
+
21312
21425
  this.previousTargets = targetMatches;
21313
-
21426
+
21314
21427
  return targets;
21315
21428
  }
21316
-
21429
+
21317
21430
  triggerEvents(type, e, targets){
21318
21431
  var listener = this.listeners[type];
21319
-
21432
+
21320
21433
  for(let key in targets){
21321
21434
  if(targets[key] && listener.components.includes(key)){
21322
21435
  this.dispatch(key + "-" + type, e, targets[key]);
21323
21436
  }
21324
21437
  }
21325
21438
  }
21439
+
21440
+ clearWatchers(){
21441
+ for(let key in this.listeners){
21442
+ let listener = this.listeners[key];
21443
+
21444
+ if(listener.handler){
21445
+ this.el.removeEventListener(key, listener.handler);
21446
+ listener.handler = null;
21447
+ }
21448
+ }
21449
+ }
21326
21450
  }
21327
21451
 
21328
- class ComponentFuctionBinder{
21452
+ class ComponentFunctionBinder{
21329
21453
 
21330
21454
  constructor(table){
21331
21455
  this.table = table;
@@ -21428,7 +21552,7 @@ class DataLoader extends CoreFeature{
21428
21552
  }
21429
21553
 
21430
21554
  //get params for request
21431
- var params = this.chain("data-params", [data, config, silent], params || {}, {});
21555
+ params = this.chain("data-params", [data, config, silent], params || {}, params || {});
21432
21556
 
21433
21557
  params = this.mapParams(params, this.table.options.dataSendParams);
21434
21558
 
@@ -22538,11 +22662,11 @@ class Tabulator {
22538
22662
  this.interactionMonitor = false; //track user interaction
22539
22663
  this.browser = ""; //hold current browser type
22540
22664
  this.browserSlow = false; //handle reduced functionality for slower browsers
22541
- this.browserMobile = false; //check if running on moble, prevent resize cancelling edit on keyboard appearence
22665
+ this.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance
22542
22666
  this.rtl = false; //check if the table is in RTL mode
22543
22667
  this.originalElement = null; //hold original table element if it has been replaced
22544
22668
 
22545
- this.componentFunctionBinder = new ComponentFuctionBinder(this); //bind component functions
22669
+ this.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions
22546
22670
  this.dataLoader = false; //bind component functions
22547
22671
 
22548
22672
  this.modules = {}; //hold all modules bound to this table
@@ -22557,13 +22681,13 @@ class Tabulator {
22557
22681
 
22558
22682
  this.initialzeCoreSystems(options);
22559
22683
 
22560
- //delay table creation to allow event bindings immediatly after the constructor
22684
+ //delay table creation to allow event bindings immediately after the constructor
22561
22685
  setTimeout(() => {
22562
22686
  this._create();
22563
22687
  });
22564
22688
  }
22565
22689
 
22566
- TableRegistry.register(this); //register table for inderdevice communication
22690
+ TableRegistry.register(this); //register table for inter-device communication
22567
22691
  }
22568
22692
 
22569
22693
  initializeElement(element){
@@ -22597,7 +22721,7 @@ class Tabulator {
22597
22721
 
22598
22722
  this._clearObjectPointers();
22599
22723
 
22600
- this._mapDepricatedFunctionality();
22724
+ this._mapDeprecatedFunctionality();
22601
22725
 
22602
22726
  this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
22603
22727
  this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
@@ -22610,8 +22734,8 @@ class Tabulator {
22610
22734
  this.footerManager.initialize();
22611
22735
  }
22612
22736
 
22613
- //convert depricated functionality to new functions
22614
- _mapDepricatedFunctionality(){
22737
+ //convert deprecated functionality to new functions
22738
+ _mapDeprecatedFunctionality(){
22615
22739
  //all previously deprecated functionality removed in the 5.0 release
22616
22740
  }
22617
22741
 
@@ -22632,7 +22756,7 @@ class Tabulator {
22632
22756
  this.element.classList.remove("tabulator-block-select");
22633
22757
  }
22634
22758
 
22635
- //concreate table
22759
+ //create table
22636
22760
  _create(){
22637
22761
  this.externalEvents.dispatch("tableBuilding");
22638
22762
  this.eventBus.dispatch("table-building");
@@ -22736,6 +22860,8 @@ class Tabulator {
22736
22860
  var element = this.element,
22737
22861
  options = this.options;
22738
22862
 
22863
+ this.interactionMonitor.initialize();
22864
+
22739
22865
  this.columnManager.initialize();
22740
22866
  this.rowManager.initialize();
22741
22867
 
@@ -22794,7 +22920,7 @@ class Tabulator {
22794
22920
  destroy(){
22795
22921
  var element = this.element;
22796
22922
 
22797
- TableRegistry.deregister(this); //deregister table from inderdevice communication
22923
+ TableRegistry.deregister(this); //deregister table from inter-device communication
22798
22924
 
22799
22925
  this.eventBus.dispatch("table-destroy");
22800
22926
 
@@ -22913,68 +23039,80 @@ class Tabulator {
22913
23039
 
22914
23040
  //replace data, keeping table in position with same sort
22915
23041
  replaceData(data, params, config){
22916
- return this.dataLoader.load(data, params, config, true, true);
23042
+ if(this.initialized){
23043
+ return this.dataLoader.load(data, params, config, true, true);
23044
+ }else {
23045
+ console.warn("replaceData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23046
+ }
22917
23047
  }
22918
23048
 
22919
23049
  //update table data
22920
23050
  updateData(data){
22921
23051
  var responses = 0;
22922
23052
 
22923
- return new Promise((resolve, reject) => {
22924
- this.dataLoader.blockActiveLoad();
23053
+ if(this.initialized){
23054
+ return new Promise((resolve, reject) => {
23055
+ this.dataLoader.blockActiveLoad();
22925
23056
 
22926
- if(typeof data === "string"){
22927
- data = JSON.parse(data);
22928
- }
23057
+ if(typeof data === "string"){
23058
+ data = JSON.parse(data);
23059
+ }
22929
23060
 
22930
- if(data){
22931
- data.forEach((item) => {
22932
- var row = this.rowManager.findRow(item[this.options.index]);
23061
+ if(data){
23062
+ data.forEach((item) => {
23063
+ var row = this.rowManager.findRow(item[this.options.index]);
22933
23064
 
22934
- if(row){
22935
- responses++;
23065
+ if(row){
23066
+ responses++;
22936
23067
 
22937
- row.updateData(item)
22938
- .then(()=>{
22939
- responses--;
23068
+ row.updateData(item)
23069
+ .then(()=>{
23070
+ responses--;
22940
23071
 
22941
- if(!responses){
22942
- resolve();
22943
- }
22944
- });
22945
- }
22946
- });
22947
- }else {
22948
- console.warn("Update Error - No data provided");
22949
- reject("Update Error - No data provided");
22950
- }
22951
- });
23072
+ if(!responses){
23073
+ resolve();
23074
+ }
23075
+ });
23076
+ }
23077
+ });
23078
+ }else {
23079
+ console.warn("Update Error - No data provided");
23080
+ reject("Update Error - No data provided");
23081
+ }
23082
+ });
23083
+ }else {
23084
+ console.warn("updateData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23085
+ }
22952
23086
  }
22953
23087
 
22954
23088
  addData(data, pos, index){
22955
- return new Promise((resolve, reject) => {
22956
- this.dataLoader.blockActiveLoad();
23089
+ if(this.initialized){
23090
+ return new Promise((resolve, reject) => {
23091
+ this.dataLoader.blockActiveLoad();
22957
23092
 
22958
- if(typeof data === "string"){
22959
- data = JSON.parse(data);
22960
- }
23093
+ if(typeof data === "string"){
23094
+ data = JSON.parse(data);
23095
+ }
22961
23096
 
22962
- if(data){
22963
- this.rowManager.addRows(data, pos, index)
22964
- .then((rows) => {
22965
- var output = [];
23097
+ if(data){
23098
+ this.rowManager.addRows(data, pos, index)
23099
+ .then((rows) => {
23100
+ var output = [];
22966
23101
 
22967
- rows.forEach(function(row){
22968
- output.push(row.getComponent());
22969
- });
23102
+ rows.forEach(function(row){
23103
+ output.push(row.getComponent());
23104
+ });
22970
23105
 
22971
- resolve(output);
22972
- });
22973
- }else {
22974
- console.warn("Update Error - No data provided");
22975
- reject("Update Error - No data provided");
22976
- }
22977
- });
23106
+ resolve(output);
23107
+ });
23108
+ }else {
23109
+ console.warn("Update Error - No data provided");
23110
+ reject("Update Error - No data provided");
23111
+ }
23112
+ });
23113
+ }else {
23114
+ console.warn("addData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23115
+ }
22978
23116
  }
22979
23117
 
22980
23118
  //update table data
@@ -22982,46 +23120,50 @@ class Tabulator {
22982
23120
  var rows = [],
22983
23121
  responses = 0;
22984
23122
 
22985
- return new Promise((resolve, reject) => {
22986
- this.dataLoader.blockActiveLoad();
23123
+ if(this.initialized){
23124
+ return new Promise((resolve, reject) => {
23125
+ this.dataLoader.blockActiveLoad();
22987
23126
 
22988
- if(typeof data === "string"){
22989
- data = JSON.parse(data);
22990
- }
23127
+ if(typeof data === "string"){
23128
+ data = JSON.parse(data);
23129
+ }
22991
23130
 
22992
- if(data){
22993
- data.forEach((item) => {
22994
- var row = this.rowManager.findRow(item[this.options.index]);
23131
+ if(data){
23132
+ data.forEach((item) => {
23133
+ var row = this.rowManager.findRow(item[this.options.index]);
22995
23134
 
22996
- responses++;
23135
+ responses++;
22997
23136
 
22998
- if(row){
22999
- row.updateData(item)
23000
- .then(()=>{
23001
- responses--;
23002
- rows.push(row.getComponent());
23137
+ if(row){
23138
+ row.updateData(item)
23139
+ .then(()=>{
23140
+ responses--;
23141
+ rows.push(row.getComponent());
23003
23142
 
23004
- if(!responses){
23005
- resolve(rows);
23006
- }
23007
- });
23008
- }else {
23009
- this.rowManager.addRows(item)
23010
- .then((newRows)=>{
23011
- responses--;
23012
- rows.push(newRows[0].getComponent());
23143
+ if(!responses){
23144
+ resolve(rows);
23145
+ }
23146
+ });
23147
+ }else {
23148
+ this.rowManager.addRows(item)
23149
+ .then((newRows)=>{
23150
+ responses--;
23151
+ rows.push(newRows[0].getComponent());
23013
23152
 
23014
- if(!responses){
23015
- resolve(rows);
23016
- }
23017
- });
23018
- }
23019
- });
23020
- }else {
23021
- console.warn("Update Error - No data provided");
23022
- reject("Update Error - No data provided");
23023
- }
23024
- });
23153
+ if(!responses){
23154
+ resolve(rows);
23155
+ }
23156
+ });
23157
+ }
23158
+ });
23159
+ }else {
23160
+ console.warn("Update Error - No data provided");
23161
+ reject("Update Error - No data provided");
23162
+ }
23163
+ });
23164
+ }else {
23165
+ console.warn("updateOrAddData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23166
+ }
23025
23167
  }
23026
23168
 
23027
23169
  //get row object
@@ -23085,14 +23227,18 @@ class Tabulator {
23085
23227
 
23086
23228
  //add row to table
23087
23229
  addRow(data, pos, index){
23088
- if(typeof data === "string"){
23089
- data = JSON.parse(data);
23090
- }
23230
+ if(this.initialized){
23231
+ if(typeof data === "string"){
23232
+ data = JSON.parse(data);
23233
+ }
23091
23234
 
23092
- return this.rowManager.addRows(data, pos, index)
23093
- .then((rows)=>{
23094
- return rows[0].getComponent();
23095
- });
23235
+ return this.rowManager.addRows(data, pos, index)
23236
+ .then((rows)=>{
23237
+ return rows[0].getComponent();
23238
+ });
23239
+ }else {
23240
+ console.warn("addRow failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23241
+ }
23096
23242
  }
23097
23243
 
23098
23244
  //update a row if it exitsts otherwise create it
@@ -23127,7 +23273,7 @@ class Tabulator {
23127
23273
  if(row){
23128
23274
  return row.updateData(data)
23129
23275
  .then(()=>{
23130
- resolve(row.getComponent());
23276
+ return Promise.resolve(row.getComponent());
23131
23277
  })
23132
23278
  }else {
23133
23279
  console.warn("Update Error - No matching row found:", index);
@@ -23301,8 +23447,12 @@ class Tabulator {
23301
23447
  //////////// General Public Functions ////////////
23302
23448
  //redraw list without updating data
23303
23449
  redraw(force){
23304
- this.columnManager.redraw(force);
23305
- this.rowManager.redraw(force);
23450
+ if(this.initialized){
23451
+ this.columnManager.redraw(force);
23452
+ this.rowManager.redraw(force);
23453
+ }else {
23454
+ console.warn("redraw failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23455
+ }
23306
23456
  }
23307
23457
 
23308
23458
  setHeight(height){
@@ -23353,7 +23503,7 @@ class Tabulator {
23353
23503
  }
23354
23504
 
23355
23505
  //default setup options
23356
- Tabulator.defaultOptions = defaultOptions$1;
23506
+ Tabulator.defaultOptions = defaultOptions;
23357
23507
 
23358
23508
  //bind modules and static functionality
23359
23509
  new ModuleBinder(Tabulator);