tabulator-tables 5.0.6 → 5.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) 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 +450 -278
  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 +672 -505
  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 +2 -2
  57. package/src/js/core/defaults/options.js +1 -1
  58. package/src/js/core/rendering/Renderer.js +3 -2
  59. package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +150 -145
  60. package/src/js/core/rendering/renderers/VirtualDomVertical.js +1 -1
  61. package/src/js/core/tools/{ComponentFuctionBinder.js → ComponentFunctionBinder.js} +1 -1
  62. package/src/js/core/tools/DataLoader.js +2 -2
  63. package/src/js/core/tools/InteractionMonitor.js +143 -48
  64. package/src/js/core/tools/OptionsList.js +2 -2
  65. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +14 -1
  66. package/src/js/modules/DataTree/DataTree.js +18 -9
  67. package/src/js/modules/Download/defaults/downloaders/pdf.js +0 -2
  68. package/src/js/modules/Download/defaults/downloaders/xlsx.js +3 -2
  69. package/src/js/modules/Edit/Edit.js +6 -10
  70. package/src/js/modules/Edit/defaults/editors/progress.js +2 -2
  71. package/src/js/modules/Export/Export.js +1 -1
  72. package/src/js/modules/Filter/Filter.js +9 -4
  73. package/src/js/modules/Format/defaults/formatters/datetime.js +2 -2
  74. package/src/js/modules/Format/defaults/formatters/datetimediff.js +1 -1
  75. package/src/js/modules/FrozenColumns/FrozenColumns.js +1 -1
  76. package/src/js/modules/FrozenRows/FrozenRows.js +4 -1
  77. package/src/js/modules/GroupRows/Group.js +16 -6
  78. package/src/js/modules/GroupRows/GroupRows.js +41 -29
  79. package/src/js/modules/History/History.js +3 -1
  80. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +4 -7
  81. package/src/js/modules/MoveColumns/MoveColumns.js +64 -61
  82. package/src/js/modules/Page/Page.js +8 -10
  83. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -5
  84. package/src/js/modules/SelectRow/SelectRow.js +5 -10
  85. package/src/js/modules/Sort/Sort.js +1 -1
  86. package/src/js/modules/Sort/defaults/sorters/datetime.js +3 -2
  87. package/src/scss/tabulator.scss +4 -0
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.0.6 (c) Oliver Folkerd 2021 */
1
+ /* Tabulator v5.0.10 (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){
@@ -2365,7 +2361,7 @@ class Column$1 extends CoreFeature{
2365
2361
  cell.hide();
2366
2362
  });
2367
2363
 
2368
- this.dispatch("column-hide", this);
2364
+ this.dispatch("column-hide", this, responsiveToggle);
2369
2365
 
2370
2366
  if(!silent){
2371
2367
  this.dispatchExternal("columnVisibilityChanged", this.getComponent(), false);
@@ -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"),
@@ -7048,20 +7065,23 @@ class Edit extends Module{
7048
7065
 
7049
7066
  this.invalidEdit = false;
7050
7067
 
7068
+ console.log("clear", cancel, cell, cell.validate);
7069
+
7051
7070
  if(cell){
7052
7071
  this.currentCell = false;
7053
7072
 
7054
7073
  cellEl = cell.getElement();
7055
7074
 
7056
7075
  if(cancel){
7057
- if(cell.validate){
7058
- cell.validate();
7076
+ if(cell.column.modules.validate && this.table.modExists("validate")){
7077
+ this.table.modules.validate.cellValidate(cell);
7059
7078
  }
7060
7079
  }else {
7061
7080
  cellEl.classList.remove("tabulator-validation-fail");
7062
7081
  }
7063
7082
 
7064
7083
  cellEl.classList.remove("tabulator-editing");
7084
+
7065
7085
  while(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);
7066
7086
 
7067
7087
  cell.row.getElement().classList.remove("tabulator-row-editing");
@@ -7085,6 +7105,7 @@ class Edit extends Module{
7085
7105
  cell.column.definition.cellEditCancelled.call(this.table, component);
7086
7106
  }
7087
7107
 
7108
+ this.dispatch("edit-cancelled", cell);
7088
7109
  this.dispatchExternal("cellEditCancelled", component);
7089
7110
  }
7090
7111
  }
@@ -7215,10 +7236,6 @@ class Edit extends Module{
7215
7236
 
7216
7237
  cell.setValue(value, true);
7217
7238
 
7218
- if(self.table.options.dataTree && self.table.modExists("dataTree")){
7219
- self.table.modules.dataTree.checkForRestyle(cell);
7220
- }
7221
-
7222
7239
  if(valid !== true){
7223
7240
  element.classList.add("tabulator-validation-fail");
7224
7241
  self.table.externalEvents.dispatch("validationFailed", cell.getComponent(), value, valid);
@@ -7241,10 +7258,6 @@ class Edit extends Module{
7241
7258
  function cancel(){
7242
7259
  if(self.currentCell === cell){
7243
7260
  self.cancelEdit();
7244
-
7245
- if(self.table.options.dataTree && self.table.modExists("dataTree")){
7246
- self.table.modules.dataTree.checkForRestyle(cell);
7247
- }
7248
7261
  }
7249
7262
  }
7250
7263
 
@@ -7452,7 +7465,7 @@ class Export extends Module{
7452
7465
  switch(range){
7453
7466
  case true:
7454
7467
  case "visible":
7455
- rows = this.table.rowManager.getVisibleRows(true);
7468
+ rows = this.table.rowManager.getVisibleRows(false, true);
7456
7469
  break;
7457
7470
 
7458
7471
  case "all":
@@ -8118,6 +8131,7 @@ class Filter extends Module{
8118
8131
  this.prevHeaderFilterChangeCheck = "{}";
8119
8132
 
8120
8133
  this.changed = false; //has filtering changed since last render
8134
+ this.tableInitialized = false;
8121
8135
 
8122
8136
  this.registerTableOption("filterMode", "local"); //local or remote filtering
8123
8137
 
@@ -8185,6 +8199,8 @@ class Filter extends Module{
8185
8199
  }
8186
8200
  });
8187
8201
  }
8202
+
8203
+ this.tableInitialized = true;
8188
8204
  }
8189
8205
 
8190
8206
  remoteFilterParams(data, config, silent, params){
@@ -8648,10 +8664,12 @@ class Filter extends Module{
8648
8664
  }
8649
8665
 
8650
8666
  refreshFilter(){
8651
- if(this.table.options.filterMode === "remote"){
8652
- this.reloadData();
8653
- }else {
8654
- this.refreshData();
8667
+ if(this.tableInitialized){
8668
+ if(this.table.options.filterMode === "remote"){
8669
+ this.reloadData();
8670
+ }else {
8671
+ this.refreshData(true);
8672
+ }
8655
8673
  }
8656
8674
 
8657
8675
  //TODO - Persist left position of row manager
@@ -9168,7 +9186,7 @@ function datetime(cell, formatterParams, onRendered){
9168
9186
  var value = cell.getValue();
9169
9187
 
9170
9188
  if(typeof DT != "undefined"){
9171
- var newDatetime = (window.DateTime || luxon.DateTime).fromFormat(value, inputFormat);
9189
+ var newDatetime = DT.fromFormat(String(value), inputFormat);
9172
9190
 
9173
9191
  if(newDatetime.isValid){
9174
9192
 
@@ -9179,7 +9197,7 @@ function datetime(cell, formatterParams, onRendered){
9179
9197
  return newDatetime.toFormat(outputFormat);
9180
9198
  }else {
9181
9199
 
9182
- if(invalid === true){
9200
+ if(invalid === true || !value){
9183
9201
  return value;
9184
9202
  }else if(typeof invalid === "function"){
9185
9203
  return invalid(value);
@@ -9203,7 +9221,7 @@ function datetimediff (cell, formatterParams, onRendered) {
9203
9221
  var value = cell.getValue();
9204
9222
 
9205
9223
  if(typeof DT != "undefined"){
9206
- var newDatetime = DT.fromFormat(value, inputFormat);
9224
+ var newDatetime = DT.fromFormat(String(value), inputFormat);
9207
9225
 
9208
9226
  if (newDatetime.isValid){
9209
9227
  if(humanize);else {
@@ -9816,7 +9834,7 @@ class FrozenColumns extends Module{
9816
9834
  this.subscribe("cell-layout", this.layoutCell.bind(this));
9817
9835
  this.subscribe("column-init", this.initializeColumn.bind(this));
9818
9836
  this.subscribe("column-width", this.layout.bind(this));
9819
- this.subscribe("row-layout-before", this.layoutRow.bind(this));
9837
+ this.subscribe("row-layout-after", this.layoutRow.bind(this));
9820
9838
  this.subscribe("table-layout", this.layout.bind(this));
9821
9839
  this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
9822
9840
  this.subscribe("columns-loading", this.reset.bind(this));
@@ -10174,7 +10192,10 @@ class FrozenRows extends Module{
10174
10192
 
10175
10193
  if(index > -1){
10176
10194
  var rowEl = row.getElement();
10177
- rowEl.parentNode.removeChild(rowEl);
10195
+
10196
+ if(rowEl.parentNode){
10197
+ rowEl.parentNode.removeChild(rowEl);
10198
+ }
10178
10199
 
10179
10200
  this.rows.splice(index, 1);
10180
10201
  }
@@ -10297,10 +10318,16 @@ class Group{
10297
10318
  group.wipe();
10298
10319
  });
10299
10320
  }else {
10300
- this.element = false;
10301
- this.arrowElement = false;
10302
- this.elementContents = false;
10321
+ this.rows.forEach((row) => {
10322
+ if(row.modules){
10323
+ delete row.modules.group;
10324
+ }
10325
+ });
10303
10326
  }
10327
+
10328
+ this.element = false;
10329
+ this.arrowElement = false;
10330
+ this.elementContents = false;
10304
10331
  }
10305
10332
 
10306
10333
  createElements(){
@@ -10522,7 +10549,7 @@ class Group{
10522
10549
  }
10523
10550
 
10524
10551
  this.generateGroupHeaderContents();
10525
-
10552
+
10526
10553
  if(this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table"){
10527
10554
  this.groupManager.table.modules.columnCalcs.recalcGroup(this);
10528
10555
  }
@@ -10702,7 +10729,7 @@ class Group{
10702
10729
 
10703
10730
  this.element.classList.add("tabulator-group-visible");
10704
10731
 
10705
- var prev = this.getElement();
10732
+ var prev = this.generateElement();
10706
10733
 
10707
10734
  if(this.groupList.length){
10708
10735
  this.groupList.forEach((group) => {
@@ -10820,7 +10847,11 @@ class Group{
10820
10847
  ////////////// Standard Row Functions //////////////
10821
10848
 
10822
10849
  getElement(){
10823
- this.addBindingsd = false;
10850
+ return this.elementContents ? this.element : this.generateElement();
10851
+ }
10852
+
10853
+ generateElement(){
10854
+ this.addBindings = false;
10824
10855
 
10825
10856
  this._visSet();
10826
10857
 
@@ -10946,6 +10977,34 @@ class GroupRows extends Module{
10946
10977
 
10947
10978
  //initialize group configuration
10948
10979
  initialize(){
10980
+ if(this.table.options.groupBy){
10981
+
10982
+ this.configureGroupSetup();
10983
+
10984
+ if(this.table.options.groupUpdateOnCellEdit){
10985
+ this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
10986
+ this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
10987
+ }
10988
+
10989
+ this.subscribe("row-deleting", this.rowDeleting.bind(this));
10990
+ this.subscribe("row-deleted", this.rowsUpdated.bind(this));
10991
+ this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
10992
+ this.subscribe("rows-wipe", this.wipe.bind(this));
10993
+ this.subscribe("rows-added", this.rowsUpdated.bind(this));
10994
+ this.subscribe("row-moving", this.rowMoving.bind(this));
10995
+ this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
10996
+
10997
+ this.subscribe("rows-sample", this.rowSample.bind(this));
10998
+
10999
+ this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
11000
+
11001
+ this.registerDisplayHandler(this.displayHandler, 20);
11002
+
11003
+ this.initialized = true;
11004
+ }
11005
+ }
11006
+
11007
+ configureGroupSetup(){
10949
11008
  if(this.table.options.groupBy){
10950
11009
  var groupBy = this.table.options.groupBy,
10951
11010
  startOpen = this.table.options.groupStartOpen,
@@ -11033,27 +11092,6 @@ class GroupRows extends Module{
11033
11092
  if(groupHeader){
11034
11093
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
11035
11094
  }
11036
-
11037
- if(this.table.options.groupUpdateOnCellEdit){
11038
- this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
11039
- this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
11040
- }
11041
-
11042
- this.subscribe("row-deleting", this.rowDeleting.bind(this));
11043
- this.subscribe("row-deleted", this.rowsUpdated.bind(this));
11044
- this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
11045
- this.subscribe("rows-wipe", this.wipe.bind(this));
11046
- this.subscribe("rows-added", this.rowsUpdated.bind(this));
11047
- this.subscribe("row-moving", this.rowMoving.bind(this));
11048
- this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
11049
-
11050
- this.subscribe("rows-sample", this.rowSample.bind(this));
11051
-
11052
- this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
11053
-
11054
- this.registerDisplayHandler(this.displayHandler, 20);
11055
-
11056
- this.initialized = true;
11057
11095
  }
11058
11096
  }
11059
11097
 
@@ -11118,23 +11156,28 @@ class GroupRows extends Module{
11118
11156
 
11119
11157
  setGroupBy(groups){
11120
11158
  this.table.options.groupBy = groups;
11121
- this.initialize();
11122
- this.refreshData(false, "display");
11159
+ if(!this.initialized){
11160
+ this.initialize();
11161
+ }else {
11162
+ this.configureGroupSetup();
11163
+ }
11164
+
11165
+ this.refreshData();
11123
11166
 
11124
11167
  this.trackChanges();
11125
11168
  }
11126
11169
 
11127
11170
  setGroupValues(groupValues){
11128
11171
  this.table.options.groupValues = groupValues;
11129
- this.initialize();
11130
- this.refreshData(false, "display");
11172
+ this.configureGroupSetup();
11173
+ this.refreshData();
11131
11174
 
11132
11175
  this.trackChanges();
11133
11176
  }
11134
11177
 
11135
11178
  setGroupStartOpen(values){
11136
11179
  this.table.options.groupStartOpen = values;
11137
- this.initialize();
11180
+ this.configureGroupSetup();
11138
11181
 
11139
11182
  if(this.table.options.groupBy){
11140
11183
  this.refreshData();
@@ -11147,7 +11190,7 @@ class GroupRows extends Module{
11147
11190
 
11148
11191
  setGroupHeader(values){
11149
11192
  this.table.options.groupHeader = values;
11150
- this.initialize();
11193
+ this.configureGroupSetup();
11151
11194
 
11152
11195
  if(this.table.options.groupBy){
11153
11196
  this.refreshData();
@@ -11228,7 +11271,7 @@ class GroupRows extends Module{
11228
11271
 
11229
11272
  //return appropriate rows with group headers
11230
11273
  getRows(rows){
11231
- if(this.groupIDLookups.length){
11274
+ if(this.table.options.groupBy && this.groupIDLookups.length){
11232
11275
 
11233
11276
  this.dispatchExternal("dataGrouping");
11234
11277
 
@@ -11343,7 +11386,7 @@ class GroupRows extends Module{
11343
11386
  var oldGroups = this.groups;
11344
11387
 
11345
11388
  this.groups = {};
11346
- this.groupList =[];
11389
+ this.groupList = [];
11347
11390
 
11348
11391
  if(this.allowedValues && this.allowedValues[0]){
11349
11392
  this.allowedValues[0].forEach((value) => {
@@ -11576,7 +11619,7 @@ class History extends Module{
11576
11619
  }
11577
11620
  }
11578
11621
 
11579
- this.history.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
11622
+ this.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
11580
11623
  }
11581
11624
 
11582
11625
  cellUpdated(cell){
@@ -11718,7 +11761,7 @@ class HtmlTableImport extends Module{
11718
11761
 
11719
11762
  rows = rows ? rows.getElementsByTagName("tr") : [];
11720
11763
 
11721
- //check for tablator inline options
11764
+ //check for Tabulator inline options
11722
11765
  this._extractOptions(element, options);
11723
11766
 
11724
11767
  if(headers.length){
@@ -11757,7 +11800,7 @@ class HtmlTableImport extends Module{
11757
11800
  //extract tabulator attribute options
11758
11801
  _extractOptions(element, options, defaultOptions){
11759
11802
  var attributes = element.attributes;
11760
- var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options);
11803
+ var optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);
11761
11804
  var optionsList = {};
11762
11805
 
11763
11806
  optionsArr.forEach((item) => {
@@ -11824,11 +11867,8 @@ class HtmlTableImport extends Module{
11824
11867
  col.width = width;
11825
11868
  }
11826
11869
 
11827
- //check for tablator inline options
11828
- header.attributes;
11829
-
11830
- // //check for tablator inline options
11831
- this._extractOptions(header, col, Column$1.prototype.defaultOptionList);
11870
+ //check for Tabulator inline options
11871
+ this._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);
11832
11872
 
11833
11873
  this.fieldIndex[index] = col.field;
11834
11874
 
@@ -12148,7 +12188,7 @@ class Interaction extends Module{
12148
12188
 
12149
12189
  if(this.columnSubscribers[action]){
12150
12190
 
12151
- if(component instanceof Cell$1){
12191
+ if(component instanceof Cell){
12152
12192
  callback = component.column.definition[action];
12153
12193
  }else if(component instanceof Column$1){
12154
12194
  callback = component.definition[action];
@@ -12805,10 +12845,10 @@ class Menu extends Module{
12805
12845
  Menu.moduleName = "menu";
12806
12846
 
12807
12847
  class MoveColumns extends Module{
12808
-
12848
+
12809
12849
  constructor(table){
12810
12850
  super(table);
12811
-
12851
+
12812
12852
  this.placeholderElement = this.createPlaceholderElement();
12813
12853
  this.hoverElement = false; //floating column header element
12814
12854
  this.checkTimeout = false; //click check timeout holder
@@ -12821,35 +12861,36 @@ class MoveColumns extends Module{
12821
12861
  this.autoScrollStep = 5; //auto scroll distance in pixels
12822
12862
  this.autoScrollTimeout = false; //auto scroll timeout
12823
12863
  this.touchMove = false;
12824
-
12864
+
12825
12865
  this.moveHover = this.moveHover.bind(this);
12826
12866
  this.endMove = this.endMove.bind(this);
12827
-
12867
+
12828
12868
  this.registerTableOption("movableColumns", false); //enable movable columns
12829
12869
  }
12830
-
12870
+
12831
12871
  createPlaceholderElement(){
12832
12872
  var el = document.createElement("div");
12833
-
12873
+
12834
12874
  el.classList.add("tabulator-col");
12835
12875
  el.classList.add("tabulator-col-placeholder");
12836
-
12876
+
12837
12877
  return el;
12838
12878
  }
12839
-
12879
+
12840
12880
  initialize(){
12841
- this.subscribe("column-init", this.initializeColumn.bind(this));
12881
+ if(this.table.options.movableColumns){
12882
+ this.subscribe("column-init", this.initializeColumn.bind(this));
12883
+ }
12842
12884
  }
12843
-
12885
+
12844
12886
  initializeColumn(column){
12845
12887
  var self = this,
12846
12888
  config = {},
12847
12889
  colEl;
12848
-
12890
+
12849
12891
  if(!column.modules.frozen){
12850
-
12851
12892
  colEl = column.getElement();
12852
-
12893
+
12853
12894
  config.mousemove = function(e){
12854
12895
  if(column.parent === self.moving.parent){
12855
12896
  if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){
@@ -12865,7 +12906,7 @@ class MoveColumns extends Module{
12865
12906
  }
12866
12907
  }
12867
12908
  }.bind(self);
12868
-
12909
+
12869
12910
  colEl.addEventListener("mousedown", function(e){
12870
12911
  self.touchMove = false;
12871
12912
  if(e.which === 1){
@@ -12874,7 +12915,7 @@ class MoveColumns extends Module{
12874
12915
  }, self.checkPeriod);
12875
12916
  }
12876
12917
  });
12877
-
12918
+
12878
12919
  colEl.addEventListener("mouseup", function(e){
12879
12920
  if(e.which === 1){
12880
12921
  if(self.checkTimeout){
@@ -12882,18 +12923,18 @@ class MoveColumns extends Module{
12882
12923
  }
12883
12924
  }
12884
12925
  });
12885
-
12926
+
12886
12927
  self.bindTouchEvents(column);
12887
12928
  }
12888
-
12929
+
12889
12930
  column.modules.moveColumn = config;
12890
12931
  }
12891
-
12932
+
12892
12933
  bindTouchEvents(column){
12893
12934
  var colEl = column.getElement(),
12894
12935
  startXMove = false, //shifting center position of the cell
12895
12936
  nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;
12896
-
12937
+
12897
12938
  colEl.addEventListener("touchstart", (e) => {
12898
12939
  this.checkTimeout = setTimeout(() => {
12899
12940
  this.touchMove = true;
@@ -12904,27 +12945,27 @@ class MoveColumns extends Module{
12904
12945
  nextColWidthLast = 0;
12905
12946
  prevColWidthLast = 0;
12906
12947
  startXMove = false;
12907
-
12948
+
12908
12949
  this.startMove(e, column);
12909
12950
  }, this.checkPeriod);
12910
12951
  }, {passive: true});
12911
-
12952
+
12912
12953
  colEl.addEventListener("touchmove", (e) => {
12913
12954
  var diff, moveToCol;
12914
-
12955
+
12915
12956
  if(this.moving){
12916
12957
  this.moveHover(e);
12917
-
12958
+
12918
12959
  if(!startXMove){
12919
12960
  startXMove = e.touches[0].pageX;
12920
12961
  }
12921
-
12962
+
12922
12963
  diff = e.touches[0].pageX - startXMove;
12923
-
12964
+
12924
12965
  if(diff > 0){
12925
12966
  if(nextCol && diff - nextColWidthLast > nextColWidth){
12926
12967
  moveToCol = nextCol;
12927
-
12968
+
12928
12969
  if(moveToCol !== column){
12929
12970
  startXMove = e.touches[0].pageX;
12930
12971
  moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);
@@ -12934,7 +12975,7 @@ class MoveColumns extends Module{
12934
12975
  }else {
12935
12976
  if(prevCol && -diff - prevColWidthLast > prevColWidth){
12936
12977
  moveToCol = prevCol;
12937
-
12978
+
12938
12979
  if(moveToCol !== column){
12939
12980
  startXMove = e.touches[0].pageX;
12940
12981
  moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());
@@ -12942,7 +12983,7 @@ class MoveColumns extends Module{
12942
12983
  }
12943
12984
  }
12944
12985
  }
12945
-
12986
+
12946
12987
  if(moveToCol){
12947
12988
  nextCol = moveToCol.nextColumn();
12948
12989
  nextColWidthLast = nextColWidth;
@@ -12953,7 +12994,7 @@ class MoveColumns extends Module{
12953
12994
  }
12954
12995
  }
12955
12996
  }, {passive: true});
12956
-
12997
+
12957
12998
  colEl.addEventListener("touchend", (e) => {
12958
12999
  if(this.checkTimeout){
12959
13000
  clearTimeout(this.checkTimeout);
@@ -12963,41 +13004,43 @@ class MoveColumns extends Module{
12963
13004
  }
12964
13005
  });
12965
13006
  }
12966
-
13007
+
12967
13008
  startMove(e, column){
12968
- var element = column.getElement();
12969
-
13009
+ var element = column.getElement(),
13010
+ headerElement = this.table.columnManager.getElement(),
13011
+ headersElement = this.table.columnManager.getHeadersElement();
13012
+
12970
13013
  this.moving = column;
12971
13014
  this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
12972
-
13015
+
12973
13016
  this.table.element.classList.add("tabulator-block-select");
12974
-
13017
+
12975
13018
  //create placeholder
12976
13019
  this.placeholderElement.style.width = column.getWidth() + "px";
12977
13020
  this.placeholderElement.style.height = column.getHeight() + "px";
12978
-
13021
+
12979
13022
  element.parentNode.insertBefore(this.placeholderElement, element);
12980
13023
  element.parentNode.removeChild(element);
12981
-
13024
+
12982
13025
  //create hover element
12983
13026
  this.hoverElement = element.cloneNode(true);
12984
13027
  this.hoverElement.classList.add("tabulator-moving");
12985
-
13028
+
12986
13029
  this.table.columnManager.getElement().appendChild(this.hoverElement);
12987
-
13030
+
12988
13031
  this.hoverElement.style.left = "0";
12989
- this.hoverElement.style.bottom = "0";
12990
-
13032
+ this.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + "px";
13033
+
12991
13034
  if(!this.touchMove){
12992
13035
  this._bindMouseMove();
12993
-
13036
+
12994
13037
  document.body.addEventListener("mousemove", this.moveHover);
12995
13038
  document.body.addEventListener("mouseup", this.endMove);
12996
13039
  }
12997
-
13040
+
12998
13041
  this.moveHover(e);
12999
13042
  }
13000
-
13043
+
13001
13044
  _bindMouseMove(){
13002
13045
  this.table.columnManager.columnsByIndex.forEach(function(column){
13003
13046
  if(column.modules.moveColumn.mousemove){
@@ -13005,7 +13048,7 @@ class MoveColumns extends Module{
13005
13048
  }
13006
13049
  });
13007
13050
  }
13008
-
13051
+
13009
13052
  _unbindMouseMove(){
13010
13053
  this.table.columnManager.columnsByIndex.forEach(function(column){
13011
13054
  if(column.modules.moveColumn.mousemove){
@@ -13013,65 +13056,65 @@ class MoveColumns extends Module{
13013
13056
  }
13014
13057
  });
13015
13058
  }
13016
-
13059
+
13017
13060
  moveColumn(column, after){
13018
13061
  var movingCells = this.moving.getCells();
13019
-
13062
+
13020
13063
  this.toCol = column;
13021
13064
  this.toColAfter = after;
13022
-
13065
+
13023
13066
  if(after){
13024
13067
  column.getCells().forEach(function(cell, i){
13025
13068
  var cellEl = cell.getElement(true);
13026
-
13027
- if(cellEl.parentNode){
13069
+
13070
+ if(cellEl.parentNode && movingCells[i]){
13028
13071
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
13029
13072
  }
13030
13073
  });
13031
13074
  }else {
13032
13075
  column.getCells().forEach(function(cell, i){
13033
13076
  var cellEl = cell.getElement(true);
13034
-
13035
- if(cellEl.parentNode){
13077
+
13078
+ if(cellEl.parentNode && movingCells[i]){
13036
13079
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
13037
13080
  }
13038
13081
  });
13039
13082
  }
13040
13083
  }
13041
-
13084
+
13042
13085
  endMove(e){
13043
13086
  if(e.which === 1 || this.touchMove){
13044
13087
  this._unbindMouseMove();
13045
-
13088
+
13046
13089
  this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);
13047
13090
  this.placeholderElement.parentNode.removeChild(this.placeholderElement);
13048
13091
  this.hoverElement.parentNode.removeChild(this.hoverElement);
13049
-
13092
+
13050
13093
  this.table.element.classList.remove("tabulator-block-select");
13051
-
13094
+
13052
13095
  if(this.toCol){
13053
13096
  this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);
13054
13097
  }
13055
-
13098
+
13056
13099
  this.moving = false;
13057
13100
  this.toCol = false;
13058
13101
  this.toColAfter = false;
13059
-
13102
+
13060
13103
  if(!this.touchMove){
13061
13104
  document.body.removeEventListener("mousemove", this.moveHover);
13062
13105
  document.body.removeEventListener("mouseup", this.endMove);
13063
13106
  }
13064
13107
  }
13065
13108
  }
13066
-
13109
+
13067
13110
  moveHover(e){
13068
13111
  var columnHolder = this.table.columnManager.getElement(),
13069
13112
  scrollLeft = columnHolder.scrollLeft,
13070
13113
  xPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,
13071
13114
  scrollPos;
13072
-
13115
+
13073
13116
  this.hoverElement.style.left = (xPos - this.startX) + "px";
13074
-
13117
+
13075
13118
  if(xPos - scrollLeft < this.autoScrollMargin){
13076
13119
  if(!this.autoScrollTimeout){
13077
13120
  this.autoScrollTimeout = setTimeout(() => {
@@ -13081,7 +13124,7 @@ class MoveColumns extends Module{
13081
13124
  }, 1);
13082
13125
  }
13083
13126
  }
13084
-
13127
+
13085
13128
  if(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){
13086
13129
  if(!this.autoScrollTimeout){
13087
13130
  this.autoScrollTimeout = setTimeout(() => {
@@ -13881,13 +13924,10 @@ class Page extends Module{
13881
13924
 
13882
13925
  this.pageSizes = [];
13883
13926
 
13884
- this.dataReceivedNames = {}; //TODO - remove once pagimation update is complete
13885
- this.dataSentNames = {}; //TODO - remove once pagimation update is complete
13886
-
13887
13927
  this.registerTableOption("pagination", false); //set pagination type
13888
13928
  this.registerTableOption("paginationMode", "local"); //local or remote pagination
13889
13929
  this.registerTableOption("paginationSize", false); //set number of rows to a page
13890
- this.registerTableOption("paginationInitialPage", 1); //initail page to show on load
13930
+ this.registerTableOption("paginationInitialPage", 1); //initial page to show on load
13891
13931
  this.registerTableOption("paginationButtonCount", 5); // set count of page button
13892
13932
  this.registerTableOption("paginationSizeSelector", false); //add pagination size selector element
13893
13933
  this.registerTableOption("paginationElement", false); //element to hold pagination numbers
@@ -13936,10 +13976,10 @@ class Page extends Module{
13936
13976
  this.createElements();
13937
13977
  this.initializePaginator();
13938
13978
  }else if(this.table.options.progressiveLoad){
13939
-
13940
13979
  this.subscribe("data-params", this.remotePageParams.bind(this));
13941
13980
  this.subscribe("data-loaded", this._parseRemoteData.bind(this));
13942
13981
  this.subscribe("table-built", this.calculatePageSizes.bind(this));
13982
+ this.subscribe("data-processed", this.initialLoadComplete.bind(this));
13943
13983
 
13944
13984
  this.initializeProgressive(this.table.options.progressiveLoad);
13945
13985
 
@@ -14057,7 +14097,8 @@ class Page extends Module{
14057
14097
  margin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);
14058
14098
 
14059
14099
  if(diff < margin){
14060
- this.nextPage();
14100
+ this.nextPage()
14101
+ .catch(() => {}); //consume the exception thrown when on the last page
14061
14102
  }
14062
14103
  }
14063
14104
  }
@@ -14302,7 +14343,7 @@ class Page extends Module{
14302
14343
  }
14303
14344
  }
14304
14345
 
14305
- //set the maxmum page
14346
+ //set the maximum page
14306
14347
  setMaxPage(max){
14307
14348
 
14308
14349
  max = parseInt(max);
@@ -14556,7 +14597,7 @@ class Page extends Module{
14556
14597
  var data, margin;
14557
14598
 
14558
14599
  if(typeof data.last_page === "undefined"){
14559
- console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property");
14600
+ console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").last_page || "last_page") + "' property");
14560
14601
  }
14561
14602
 
14562
14603
  if(data.data){
@@ -14580,7 +14621,7 @@ class Page extends Module{
14580
14621
  break;
14581
14622
 
14582
14623
  case "progressive_scroll":
14583
- data = this.table.rowManager.getData().concat(data.data);
14624
+ data = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);
14584
14625
 
14585
14626
  this.table.rowManager.setData(data, this.page !== 1, this.page == 1);
14586
14627
 
@@ -14603,7 +14644,7 @@ class Page extends Module{
14603
14644
  }
14604
14645
 
14605
14646
  }else {
14606
- console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property");
14647
+ console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").data || "data") + "' property");
14607
14648
  }
14608
14649
 
14609
14650
  return data.data;
@@ -16028,7 +16069,7 @@ class ResponsiveLayout extends Module{
16028
16069
  this.registerColumnOption("responsive");
16029
16070
  }
16030
16071
 
16031
- //generate resposive columns list
16072
+ //generate responsive columns list
16032
16073
  initialize(){
16033
16074
 
16034
16075
  if(this.table.options.responsiveLayout){
@@ -16065,7 +16106,7 @@ class ResponsiveLayout extends Module{
16065
16106
  this.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;
16066
16107
  this.hiddenColumns = [];
16067
16108
 
16068
- //detemine level of responsivity for each column
16109
+ //determine level of responsivity for each column
16069
16110
  this.table.columnManager.columnsByIndex.forEach(function(column, i){
16070
16111
  if(column.modules.responsive){
16071
16112
  if(column.modules.responsive.order && column.modules.responsive.visible){
@@ -16147,10 +16188,8 @@ class ResponsiveLayout extends Module{
16147
16188
  updateColumnVisibility(column, responsiveToggle){
16148
16189
  if(!responsiveToggle && column.modules.responsive){
16149
16190
  column.modules.responsive.visible = column.visible;
16150
- this.initialize();
16191
+ this.initializeResponsivity();
16151
16192
  }
16152
-
16153
- //this.update();
16154
16193
  }
16155
16194
 
16156
16195
  hideColumn(column){
@@ -16386,9 +16425,9 @@ class SelectRow extends Module{
16386
16425
  this.subscribe("row-init", this.initializeRow.bind(this));
16387
16426
  this.subscribe("row-deleting", this.rowDeleted.bind(this));
16388
16427
  this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
16389
- this.subscribe("rows-retrieve", this.clearSelectionData.bind(this));
16428
+ this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
16390
16429
 
16391
- if(this.table.options.selectable && this.table.options.selectablePersistence){
16430
+ if(this.table.options.selectable && !this.table.options.selectablePersistence){
16392
16431
  this.subscribe("data-refeshing", this.deselectRows.bind(this));
16393
16432
  }
16394
16433
  }
@@ -16402,7 +16441,6 @@ class SelectRow extends Module{
16402
16441
  this._deselectRow(row, true);
16403
16442
  }
16404
16443
 
16405
-
16406
16444
  clearSelectionData(silent){
16407
16445
  this.selecting = false;
16408
16446
  this.lastClickedRow = false;
@@ -16628,9 +16666,7 @@ class SelectRow extends Module{
16628
16666
  this.childRowSelection(row, true);
16629
16667
  }
16630
16668
 
16631
- if(!silent){
16632
- this.dispatchExternal("rowSelected", row.getComponent());
16633
- }
16669
+ this.dispatchExternal("rowSelected", row.getComponent());
16634
16670
 
16635
16671
  this._rowSelectionChanged(silent);
16636
16672
  }
@@ -16649,7 +16685,7 @@ class SelectRow extends Module{
16649
16685
  deselectRows(rows, silent){
16650
16686
  var self = this,
16651
16687
  rowCount;
16652
-
16688
+
16653
16689
  if(typeof rows == "undefined"){
16654
16690
 
16655
16691
  rowCount = self.selectedRows.length;
@@ -16701,9 +16737,7 @@ class SelectRow extends Module{
16701
16737
  this.childRowSelection(row, false);
16702
16738
  }
16703
16739
 
16704
- if(!silent){
16705
- this.dispatchExternal("rowDeselected", row.getComponent());
16706
- }
16740
+ this.dispatchExternal("rowDeselected", row.getComponent());
16707
16741
 
16708
16742
  self._rowSelectionChanged(silent);
16709
16743
  }
@@ -16867,8 +16901,9 @@ function datetime$1(a, b, aRow, bRow, column, dir, params){
16867
16901
  emptyAlign = 0;
16868
16902
 
16869
16903
  if(typeof DT != "undefined"){
16870
- a = DT.fromFormat(a, format);
16871
- b = DT.fromFormat(b, format);
16904
+ a = DT.fromFormat(String(a), format);
16905
+ b = DT.fromFormat(String(b), format);
16906
+
16872
16907
  if(!a.isValid){
16873
16908
  emptyAlign = !b.isValid ? 0 : -1;
16874
16909
  }else if(!b.isValid){
@@ -17239,7 +17274,7 @@ class Sort extends Module{
17239
17274
  if(this.table.options.sortMode === "remote"){
17240
17275
  this.reloadData();
17241
17276
  }else {
17242
- this.refreshData();
17277
+ this.refreshData(true);
17243
17278
  }
17244
17279
 
17245
17280
  //TODO - Persist left position of row manager
@@ -17893,7 +17928,7 @@ var modules = /*#__PURE__*/Object.freeze({
17893
17928
  ValidateModule: Validate
17894
17929
  });
17895
17930
 
17896
- var defaultOptions$1 = {
17931
+ var defaultOptions = {
17897
17932
 
17898
17933
  debugEventsExternal:false, //flag to console log events
17899
17934
  debugEventsInternal:false, //flag to console log events
@@ -17914,7 +17949,7 @@ var defaultOptions$1 = {
17914
17949
  autoColumns:false, //build columns from data row structure
17915
17950
  autoColumnsDefinitions:false,
17916
17951
 
17917
- nestedFieldSeparator:".", //seperatpr for nested data
17952
+ nestedFieldSeparator:".", //separator for nested data
17918
17953
 
17919
17954
  tooltipGenerationMode:"load", //when to generate tooltips
17920
17955
 
@@ -17955,10 +17990,10 @@ var defaultOptions$1 = {
17955
17990
  };
17956
17991
 
17957
17992
  class OptionsList {
17958
- constructor(table, msgType){
17993
+ constructor(table, msgType, defaults = {}){
17959
17994
  this.table = table;
17960
17995
  this.msgType = msgType;
17961
- this.registeredDefaults = {};
17996
+ this.registeredDefaults = Object.assign({}, defaults);
17962
17997
  }
17963
17998
 
17964
17999
  register(option, value){
@@ -18074,7 +18109,7 @@ class Renderer extends CoreFeature{
18074
18109
  }
18075
18110
 
18076
18111
  scrollToRowNearestTop(row){
18077
- //determin weather the row is nearest the top or bottom of the table, retur true for top or false for bottom
18112
+ //determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom
18078
18113
  }
18079
18114
 
18080
18115
  visibleRows(includingBuffer){
@@ -18141,8 +18176,9 @@ class Renderer extends CoreFeature{
18141
18176
  if(!ifVisible){
18142
18177
  if(Helpers.elVisible(rowEl)){
18143
18178
  offset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;
18144
-
18179
+
18145
18180
  if(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){
18181
+ resolve();
18146
18182
  return false;
18147
18183
  }
18148
18184
  }
@@ -18215,157 +18251,157 @@ class BaiscHorizontal extends Renderer{
18215
18251
  class VirtualDomHorizontal extends Renderer{
18216
18252
  constructor(table){
18217
18253
  super(table);
18218
-
18254
+
18219
18255
  this.leftCol = 0;
18220
18256
  this.rightCol = 0;
18221
18257
  this.scrollLeft = 0;
18222
-
18258
+
18223
18259
  this.vDomScrollPosLeft = 0;
18224
18260
  this.vDomScrollPosRight = 0;
18225
-
18261
+
18226
18262
  this.vDomPadLeft = 0;
18227
18263
  this.vDomPadRight = 0;
18228
-
18264
+
18229
18265
  this.fitDataColAvg = 0;
18230
-
18266
+
18231
18267
  this.window = 200; //pixel margin to make column visible before it is shown on screen
18232
-
18268
+
18233
18269
  this.initialized = false;
18234
-
18270
+
18235
18271
  this.columns = [];
18236
18272
  }
18237
-
18273
+
18238
18274
  initialize(){
18239
18275
  this.compatabilityCheck();
18240
18276
  }
18241
-
18277
+
18242
18278
  compatabilityCheck(){
18243
18279
  var columns = this.options("columns"),
18244
18280
  frozen = false,
18245
18281
  ok = true;
18246
-
18282
+
18247
18283
  if(this.options("layout") == "fitDataTable"){
18248
- console.warn("Horizontal Vitrual DOM is not compatible with fitDataTable layout mode");
18284
+ console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode");
18249
18285
  ok = false;
18250
18286
  }
18251
-
18287
+
18252
18288
  if(this.options("responsiveLayout")){
18253
- console.warn("Horizontal Vitrual DOM is not compatible with responsive columns");
18289
+ console.warn("Horizontal Virtual DOM is not compatible with responsive columns");
18254
18290
  ok = false;
18255
18291
  }
18256
-
18292
+
18257
18293
  if(this.options("rtl")){
18258
- console.warn("Horizontal Vitrual DOM is not currently compatible with RTL text direction");
18294
+ console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction");
18259
18295
  ok = false;
18260
18296
  }
18261
-
18297
+
18262
18298
  if(columns){
18263
18299
  frozen = columns.find((col) => {
18264
18300
  return col.frozen;
18265
18301
  });
18266
-
18302
+
18267
18303
  if(frozen){
18268
- console.warn("Horizontal Vitrual DOM is not compatible with frozen columns");
18304
+ console.warn("Horizontal Virtual DOM is not compatible with frozen columns");
18269
18305
  ok = false;
18270
18306
  }
18271
18307
  }
18272
-
18308
+
18273
18309
  // if(!ok){
18274
18310
  // options.virtualDomHoz = false;
18275
18311
  // }
18276
-
18312
+
18277
18313
  return ok;
18278
18314
  }
18279
-
18315
+
18280
18316
  //////////////////////////////////////
18281
18317
  ///////// Public Functions ///////////
18282
18318
  //////////////////////////////////////
18283
-
18319
+
18284
18320
  renderColumns(row, force){
18285
18321
  this.dataChange();
18286
18322
  }
18287
-
18323
+
18288
18324
  scrollColumns(left, dir){
18289
18325
  if(this.scrollLeft != left){
18290
18326
  this.scrollLeft = left;
18291
-
18327
+
18292
18328
  this.scroll(left - (this.vDomScrollPosLeft + this.window));
18293
18329
  }
18294
18330
  }
18295
-
18296
- rerenderColumns(update, blockRedraw){
18331
+
18332
+ rerenderColumns(update, blockRedraw){
18297
18333
  var old = {
18298
18334
  cols:this.columns,
18299
18335
  leftCol:this.leftCol,
18300
18336
  rightCol:this.rightCol,
18301
18337
  };
18302
-
18338
+
18303
18339
  if(update && !this.initialized){
18304
18340
  return;
18305
18341
  }
18306
-
18342
+
18307
18343
  this.clear();
18308
-
18344
+
18309
18345
  this.scrollLeft = this.elementVertical.scrollLeft;
18310
-
18346
+
18311
18347
  this.vDomScrollPosLeft = this.scrollLeft - this.window;
18312
18348
  this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.window;
18313
-
18349
+
18314
18350
  var colPos = 0;
18315
-
18351
+
18316
18352
  this.table.columnManager.columnsByIndex.forEach((column) => {
18317
18353
  var config = {};
18318
-
18354
+
18319
18355
  if(column.visible){
18320
18356
  var width = column.getWidth();
18321
-
18357
+
18322
18358
  config.leftPos = colPos;
18323
18359
  config.rightPos = colPos + width;
18324
-
18360
+
18325
18361
  config.width = width;
18326
-
18362
+
18327
18363
  if (this.options("layout") === "fitData") {
18328
18364
  config.fitDataCheck = true;
18329
18365
  }
18330
-
18366
+
18331
18367
  if((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){
18332
- //column is visible
18333
-
18334
- if(this.leftCol == -1){
18335
- this.leftCol = this.columns.length;
18336
- this.vDomPadLeft = colPos;
18337
- }
18338
-
18339
- this.rightCol = this.columns.length;
18340
- }else {
18341
- // column is hidden
18342
- if(this.leftCol !== -1){
18343
- this.vDomPadRight += width;
18344
- }
18345
- }
18346
-
18347
- this.columns.push(column);
18348
-
18349
- column.modules.vdomHoz = config;
18350
-
18351
- colPos += width;
18352
- }
18353
- });
18354
-
18368
+ //column is visible
18369
+
18370
+ if(this.leftCol == -1){
18371
+ this.leftCol = this.columns.length;
18372
+ this.vDomPadLeft = colPos;
18373
+ }
18374
+
18375
+ this.rightCol = this.columns.length;
18376
+ }else {
18377
+ // column is hidden
18378
+ if(this.leftCol !== -1){
18379
+ this.vDomPadRight += width;
18380
+ }
18381
+ }
18382
+
18383
+ this.columns.push(column);
18384
+
18385
+ column.modules.vdomHoz = config;
18386
+
18387
+ colPos += width;
18388
+ }
18389
+ });
18390
+
18355
18391
  this.tableElement.style.paddingLeft = this.vDomPadLeft + "px";
18356
18392
  this.tableElement.style.paddingRight = this.vDomPadRight + "px";
18357
-
18393
+
18358
18394
  this.initialized = true;
18359
-
18395
+
18360
18396
  if(!blockRedraw){
18361
18397
  if(!update || this.reinitChanged(old)){
18362
- this.renitializeRows();
18398
+ this.reinitializeRows();
18363
18399
  }
18364
18400
  }
18365
-
18401
+
18366
18402
  this.elementVertical.scrollLeft = this.scrollLeft;
18367
18403
  }
18368
-
18404
+
18369
18405
  renderRowCells(row){
18370
18406
  if(this.initialized){
18371
18407
  this.initializeRow(row);
@@ -18376,88 +18412,88 @@ class VirtualDomHorizontal extends Renderer{
18376
18412
  });
18377
18413
  }
18378
18414
  }
18379
-
18415
+
18380
18416
  rerenderRowCells(row, force){
18381
18417
  this.reinitializeRow(row, force);
18382
18418
  }
18383
-
18419
+
18384
18420
  reinitializeColumnWidths(columns){
18385
18421
  for(let i = this.leftCol; i <= this.rightCol; i++){
18386
18422
  this.columns[i].reinitializeWidth();
18387
18423
  }
18388
18424
  }
18389
-
18425
+
18390
18426
  //////////////////////////////////////
18391
18427
  //////// Internal Rendering //////////
18392
18428
  //////////////////////////////////////
18393
-
18429
+
18394
18430
  deinitialize(){
18395
18431
  this.initialized = false;
18396
18432
  }
18397
-
18433
+
18398
18434
  clear(){
18399
18435
  this.columns = [];
18400
-
18436
+
18401
18437
  this.leftCol = -1;
18402
18438
  this.rightCol = 0;
18403
-
18439
+
18404
18440
  this.vDomScrollPosLeft = 0;
18405
18441
  this.vDomScrollPosRight = 0;
18406
18442
  this.vDomPadLeft = 0;
18407
18443
  this.vDomPadRight = 0;
18408
18444
  }
18409
-
18445
+
18410
18446
  dataChange(){
18411
18447
  var change = false,
18412
18448
  collsWidth = 0,
18413
18449
  colEnd = 0,
18414
18450
  row, rowEl;
18415
-
18451
+
18416
18452
  if(this.options("layout") === "fitData"){
18417
18453
  this.table.columnManager.columnsByIndex.forEach((column) => {
18418
18454
  if(!column.definition.width && column.visible){
18419
18455
  change = true;
18420
18456
  }
18421
18457
  });
18422
-
18458
+
18423
18459
  if(change){
18424
18460
  if(change && this.table.rowManager.getDisplayRows().length){
18425
-
18461
+
18426
18462
  this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.window;
18427
-
18463
+
18428
18464
  var row = this.chain("rows-sample", [1], [], () => {
18429
18465
  return this.table.rowManager.getDisplayRows()[0];
18430
18466
  })[0];
18431
-
18467
+
18432
18468
  if(row){
18433
-
18469
+
18434
18470
  rowEl = row.getElement();
18435
-
18471
+
18436
18472
  row.generateCells();
18437
-
18473
+
18438
18474
  this.tableElement.appendChild(rowEl);
18439
-
18475
+
18440
18476
  for(var colEnd = 0; colEnd < row.cells.length; colEnd++){
18441
18477
  let cell = row.cells[colEnd];
18442
18478
  rowEl.appendChild(cell.getElement());
18443
-
18479
+
18444
18480
  cell.column.reinitializeWidth();
18445
-
18481
+
18446
18482
  collsWidth += cell.column.getWidth();
18447
-
18483
+
18448
18484
  if(collsWidth > this.vDomScrollPosRight){
18449
18485
  break;
18450
18486
  }
18451
18487
  }
18452
-
18488
+
18453
18489
  rowEl.parentNode.removeChild(rowEl);
18454
-
18490
+
18455
18491
  this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));
18456
-
18492
+
18457
18493
  for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){
18458
18494
  this.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);
18459
18495
  }
18460
-
18496
+
18461
18497
  this.rerenderColumns(false, true);
18462
18498
  }
18463
18499
  }
@@ -18469,34 +18505,34 @@ class VirtualDomHorizontal extends Renderer{
18469
18505
  }
18470
18506
  }
18471
18507
  }
18472
-
18508
+
18473
18509
  reinitChanged(old){
18474
18510
  var match = true;
18475
-
18511
+
18476
18512
  if(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){
18477
18513
  return true;
18478
18514
  }
18479
-
18515
+
18480
18516
  old.cols.forEach((col, i) => {
18481
18517
  if(col !== this.columns[i]){
18482
18518
  match = false;
18483
18519
  }
18484
18520
  });
18485
-
18521
+
18486
18522
  return !match;
18487
18523
  }
18488
-
18489
- renitializeRows(){
18524
+
18525
+ reinitializeRows(){
18490
18526
  var rows = this.table.rowManager.getVisibleRows();
18491
18527
  rows.forEach((row) => {
18492
18528
  this.reinitializeRow(row, true);
18493
18529
  });
18494
18530
  }
18495
-
18531
+
18496
18532
  scroll(diff){
18497
18533
  this.vDomScrollPosLeft += diff;
18498
18534
  this.vDomScrollPosRight += diff;
18499
-
18535
+
18500
18536
  if(diff > (this.elementVertical.clientWidth * .8)){
18501
18537
  this.rerenderColumns();
18502
18538
  }else {
@@ -18511,24 +18547,23 @@ class VirtualDomHorizontal extends Renderer{
18511
18547
  }
18512
18548
  }
18513
18549
  }
18514
-
18550
+
18515
18551
  colPositionAdjust (start, end, diff){
18516
18552
  for(let i = start; i < end; i++){
18517
18553
  let column = this.columns[i];
18518
-
18554
+
18519
18555
  column.modules.vdomHoz.leftPos += diff;
18520
18556
  column.modules.vdomHoz.rightPos += diff;
18521
18557
  }
18522
18558
  }
18523
-
18559
+
18524
18560
  addColRight(){
18525
18561
  var column = this.columns[this.rightCol + 1],
18526
18562
  rows;
18527
-
18563
+
18528
18564
  if(column && column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){
18529
-
18530
18565
  rows = this.table.rowManager.getVisibleRows();
18531
-
18566
+
18532
18567
  rows.forEach((row) => {
18533
18568
  if(row.type !== "group"){
18534
18569
  var cell = row.getCell(column);
@@ -18536,30 +18571,30 @@ class VirtualDomHorizontal extends Renderer{
18536
18571
  cell.cellRendered();
18537
18572
  }
18538
18573
  });
18539
-
18574
+
18540
18575
  this.fitDataColActualWidthCheck(column);
18541
-
18576
+
18542
18577
  this.rightCol++;
18543
-
18578
+
18544
18579
  if(this.rightCol >= (this.columns.length - 1)){
18545
18580
  this.vDomPadRight = 0;
18546
18581
  }else {
18547
18582
  this.vDomPadRight -= column.getWidth();
18548
18583
  }
18549
-
18584
+
18550
18585
  this.tableElement.style.paddingRight = this.vDomPadRight + "px";
18551
-
18586
+
18552
18587
  this.addColRight();
18553
18588
  }
18554
18589
  }
18555
-
18590
+
18556
18591
  addColLeft(){
18557
18592
  var column = this.columns[this.leftCol - 1],
18558
18593
  rows;
18559
-
18594
+
18560
18595
  if(column && column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){
18561
18596
  var rows = this.table.rowManager.getVisibleRows();
18562
-
18597
+
18563
18598
  rows.forEach((row) => {
18564
18599
  if(row.type !== "group"){
18565
18600
  var cell = row.getCell(column);
@@ -18567,119 +18602,125 @@ class VirtualDomHorizontal extends Renderer{
18567
18602
  cell.cellRendered();
18568
18603
  }
18569
18604
  });
18570
-
18605
+
18571
18606
  this.fitDataColActualWidthCheck(column);
18572
-
18607
+
18573
18608
  if(!this.leftCol){
18574
18609
  this.vDomPadLeft = 0;
18575
18610
  }else {
18576
18611
  this.vDomPadLeft -= column.getWidth();
18577
18612
  }
18578
-
18613
+
18579
18614
  this.tableElement.style.paddingLeft = this.vDomPadLeft + "px";
18580
-
18615
+
18581
18616
  this.leftCol--;
18582
-
18617
+
18583
18618
  this.addColLeft();
18584
18619
  }
18585
18620
  }
18586
-
18621
+
18587
18622
  removeColRight(column){
18588
18623
  var column = this.columns[this.rightCol],
18589
18624
  rows;
18590
-
18625
+
18591
18626
  if(column && column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){
18592
18627
  rows = this.table.rowManager.getVisibleRows();
18593
-
18628
+
18594
18629
  column.modules.vdomHoz.visible = false;
18595
-
18630
+
18596
18631
  rows.forEach((row) => {
18597
18632
  if(row.type !== "group"){
18598
18633
  var cell = row.getCell(column);
18599
18634
  row.getElement().removeChild(cell.getElement());
18600
18635
  }
18601
18636
  });
18602
-
18637
+
18603
18638
  this.vDomPadRight += column.getWidth();
18604
18639
  this.tableElement.style.paddingRight = this.vDomPadRight + "px";
18605
-
18640
+
18606
18641
  this.rightCol --;
18607
-
18642
+
18608
18643
  this.removeColRight();
18609
18644
  }
18610
18645
  }
18611
-
18646
+
18612
18647
  removeColLeft(){
18613
18648
  var column = this.columns[this.leftCol],
18614
18649
  rows;
18615
-
18616
- if(column && column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){
18617
-
18650
+
18651
+ if(column && column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){
18618
18652
  rows = this.table.rowManager.getVisibleRows();
18619
-
18653
+
18620
18654
  rows.forEach((row) => {
18655
+ var cell, el;
18656
+
18621
18657
  if(row.type !== "group"){
18622
- var cell = row.getCell(column);
18623
- if(cell.parentNode){
18624
- row.getElement().removeChild(cell.getElement());
18658
+ cell = row.getCell(column);
18659
+
18660
+ if(cell){
18661
+ el = cell.getElement();
18662
+
18663
+ if(el.parentNode){
18664
+ row.getElement().removeChild(el);
18665
+ }
18625
18666
  }
18626
18667
  }
18627
18668
  });
18628
-
18669
+
18629
18670
  this.vDomPadLeft += column.getWidth();
18630
18671
  this.tableElement.style.paddingLeft = this.vDomPadLeft + "px";
18631
-
18672
+
18632
18673
  this.leftCol ++;
18633
-
18674
+
18634
18675
  this.removeColLeft();
18635
18676
  }
18636
18677
  }
18637
-
18678
+
18638
18679
  fitDataColActualWidthCheck(column){
18639
18680
  var newWidth, widthDiff;
18640
-
18681
+
18641
18682
  if(column.modules.vdomHoz.fitDataCheck){
18642
18683
  column.reinitializeWidth();
18643
-
18684
+
18644
18685
  newWidth = column.getWidth();
18645
18686
  widthDiff = newWidth - column.modules.vdomHoz.width;
18646
-
18687
+
18647
18688
  if(widthDiff){
18648
18689
  column.modules.vdomHoz.rightPos += widthDiff;
18649
18690
  column.modules.vdomHoz.width = newWidth;
18650
18691
  this.colPositionAdjust(this.rightCol + 2, this.columns.length, widthDiff);
18651
18692
  }
18652
-
18693
+
18653
18694
  column.modules.vdomHoz.fitDataCheck = false;
18654
18695
  }
18655
18696
  };
18656
-
18697
+
18657
18698
  initializeRow(row){
18658
18699
  if(row.type !== "group"){
18659
18700
  row.modules.vdomHoz = {
18660
18701
  leftCol:this.leftCol,
18661
18702
  rightCol:this.rightCol,
18662
18703
  };
18663
-
18704
+
18664
18705
  for(let i = this.leftCol; i <= this.rightCol; i++){
18665
18706
  let column = this.columns[i];
18666
-
18707
+
18667
18708
  if(column && column.visible){
18668
18709
  let cell = row.getCell(column);
18669
-
18710
+
18670
18711
  row.getElement().appendChild(cell.getElement());
18671
18712
  cell.cellRendered();
18672
18713
  }
18673
18714
  }
18674
18715
  }
18675
18716
  }
18676
-
18717
+
18677
18718
  reinitializeRow(row, force){
18678
18719
  if(row.type !== "group"){
18679
18720
  if(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){
18680
18721
  var rowEl = row.getElement();
18681
18722
  while(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);
18682
-
18723
+
18683
18724
  this.initializeRow(row);
18684
18725
  }
18685
18726
  }
@@ -18698,7 +18739,7 @@ class ColumnManager extends CoreFeature {
18698
18739
  this.columnsByIndex = []; //columns by index
18699
18740
  this.columnsByField = {}; //columns by field
18700
18741
  this.scrollLeft = 0;
18701
- this.optionsList = new OptionsList(this.table, "column definition");
18742
+ this.optionsList = new OptionsList(this.table, "column definition", defaultColumnOptions);
18702
18743
 
18703
18744
  this.renderer = null;
18704
18745
  }
@@ -18911,8 +18952,9 @@ class ColumnManager extends CoreFeature {
18911
18952
  index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;
18912
18953
 
18913
18954
  if(nextToColumn && index > -1){
18914
- var parentIndex = this.columns.indexOf(nextToColumn.getTopColumn());
18915
- var nextEl = nextToColumn.getElement();
18955
+ var topColumn = nextToColumn.getTopColumn();
18956
+ var parentIndex = this.columns.indexOf(topColumn);
18957
+ var nextEl = topColumn.getElement();
18916
18958
 
18917
18959
  if(before){
18918
18960
  this.columns.splice(parentIndex, 0, column);
@@ -19026,7 +19068,7 @@ class ColumnManager extends CoreFeature {
19026
19068
  return this.columnsByIndex[index];
19027
19069
  }
19028
19070
 
19029
- getFirstVisibileColumn(index){
19071
+ getFirstVisibleColumn(index){
19030
19072
  var index = this.columnsByIndex.findIndex((col) => {
19031
19073
  return col.visible;
19032
19074
  });
@@ -19287,13 +19329,11 @@ class ColumnManager extends CoreFeature {
19287
19329
 
19288
19330
  this.dispatch("column-add", definition, before, nextToColumn);
19289
19331
 
19290
- this.redraw(true);
19291
-
19292
19332
  if(this.layoutMode() != "fitColumns"){
19293
19333
  column.reinitializeWidth();
19294
19334
  }
19295
19335
 
19296
- this.verticalAlignHeaders();
19336
+ this.redraw(true);
19297
19337
 
19298
19338
  this.table.rowManager.reinitialize();
19299
19339
 
@@ -19472,7 +19512,7 @@ class VirtualDomVertical extends Renderer{
19472
19512
 
19473
19513
  element.style.paddingTop = "";
19474
19514
  element.style.paddingBottom = "";
19475
- element.style.minWidth = "";
19515
+ // element.style.minWidth = "";
19476
19516
  element.style.minHeight = "";
19477
19517
  element.style.display = "";
19478
19518
  element.style.visibility = "";
@@ -20112,7 +20152,7 @@ class RowManager extends CoreFeature{
20112
20152
  ////////////////// Row Manipulation //////////////////
20113
20153
  findRow(subject){
20114
20154
  if(typeof subject == "object"){
20115
- if(subject instanceof Row$1){
20155
+ if(subject instanceof Row){
20116
20156
  //subject is row element
20117
20157
  return subject;
20118
20158
  }else if(subject instanceof RowComponent$1){
@@ -20195,7 +20235,7 @@ class RowManager extends CoreFeature{
20195
20235
 
20196
20236
  data.forEach((def, i) => {
20197
20237
  if(def && typeof def === "object"){
20198
- var row = new Row$1(def, this);
20238
+ var row = new Row(def, this);
20199
20239
  this.rows.push(row);
20200
20240
  }else {
20201
20241
  console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:", def);
@@ -20327,7 +20367,7 @@ class RowManager extends CoreFeature{
20327
20367
  }
20328
20368
 
20329
20369
  addRowActual(data, pos, index, blockRedraw){
20330
- var row = data instanceof Row$1 ? data : new Row$1(data || {}, this),
20370
+ var row = data instanceof Row ? data : new Row(data || {}, this),
20331
20371
  top = this.findAddRowPos(pos),
20332
20372
  allIndex = -1,
20333
20373
  activeIndex, chainResult;
@@ -20486,7 +20526,7 @@ class RowManager extends CoreFeature{
20486
20526
  nextRow = this.getDisplayRows()[index+1];
20487
20527
  }
20488
20528
 
20489
- if(nextRow && (!(nextRow instanceof Row$1) || nextRow.type != "row")){
20529
+ if(nextRow && (!(nextRow instanceof Row) || nextRow.type != "row")){
20490
20530
  return this.nextDisplayRow(nextRow, rowOnly);
20491
20531
  }
20492
20532
 
@@ -20501,7 +20541,7 @@ class RowManager extends CoreFeature{
20501
20541
  prevRow = this.getDisplayRows()[index-1];
20502
20542
  }
20503
20543
 
20504
- if(rowOnly && prevRow && (!(prevRow instanceof Row$1) || prevRow.type != "row")){
20544
+ if(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != "row")){
20505
20545
  return this.prevDisplayRow(prevRow, rowOnly);
20506
20546
  }
20507
20547
 
@@ -20760,8 +20800,14 @@ class RowManager extends CoreFeature{
20760
20800
  }
20761
20801
  }
20762
20802
 
20763
- getVisibleRows(viewable){
20764
- return this.renderer.visibleRows(!viewable);
20803
+ getVisibleRows(chain, viewable){
20804
+ var rows = Object.assign([], this.renderer.visibleRows(!viewable));
20805
+
20806
+ if(chain){
20807
+ rows = this.chain("rows-visible", [viewable], rows, rows);
20808
+ }
20809
+
20810
+ return rows;
20765
20811
  }
20766
20812
 
20767
20813
  //repeat action accross display rows
@@ -21125,29 +21171,29 @@ class FooterManager extends CoreFeature{
21125
21171
  }
21126
21172
 
21127
21173
  class InteractionManager extends CoreFeature {
21128
-
21174
+
21129
21175
  constructor (table){
21130
21176
  super(table);
21131
-
21132
- this.el = this.table.element;
21133
-
21177
+
21178
+ this.el = null;
21179
+
21134
21180
  this.abortClasses = ["tabulator-headers", "tabulator-table"];
21135
-
21181
+
21136
21182
  this.previousTargets = {};
21137
-
21183
+
21138
21184
  this.listeners = [
21139
- "click",
21140
- "dblclick",
21141
- "contextmenu",
21142
- "mouseenter",
21143
- "mouseleave",
21144
- "mouseover",
21145
- "mouseout",
21146
- "mousemove",
21147
- "touchstart",
21148
- "touchend",
21185
+ "click",
21186
+ "dblclick",
21187
+ "contextmenu",
21188
+ "mouseenter",
21189
+ "mouseleave",
21190
+ "mouseover",
21191
+ "mouseout",
21192
+ "mousemove",
21193
+ "touchstart",
21194
+ "touchend",
21149
21195
  ];
21150
-
21196
+
21151
21197
  this.componentMap = {
21152
21198
  "tabulator-cell":"cell",
21153
21199
  "tabulator-row":"row",
@@ -21155,36 +21201,111 @@ class InteractionManager extends CoreFeature {
21155
21201
  "tabulator-col":"column",
21156
21202
  };
21157
21203
 
21204
+ this.pseudoTrackers = {
21205
+ "row":{
21206
+ subscriber:null,
21207
+ target:null,
21208
+ },
21209
+ "cell":{
21210
+ subscriber:null,
21211
+ target:null,
21212
+ },
21213
+ "group":{
21214
+ subscriber:null,
21215
+ target:null,
21216
+ },
21217
+ "column":{
21218
+ subscriber:null,
21219
+ target:null,
21220
+ },
21221
+ };
21222
+
21223
+ this.pseudoTracking = false;
21224
+ }
21225
+
21226
+ initialize(){
21227
+ this.el = this.table.element;
21158
21228
  this.buildListenerMap();
21159
21229
  this.bindSubscriptionWatchers();
21160
21230
  }
21161
-
21231
+
21162
21232
  buildListenerMap(){
21163
21233
  var listenerMap = {};
21164
-
21234
+
21165
21235
  this.listeners.forEach((listener) => {
21166
21236
  listenerMap[listener] = {
21167
21237
  handler:null,
21168
21238
  components:[],
21169
21239
  };
21170
21240
  });
21171
-
21241
+
21172
21242
  this.listeners = listenerMap;
21173
21243
  }
21174
21244
 
21245
+ bindPseudoEvents(){
21246
+ Object.keys(this.pseudoTrackers).forEach((key) => {
21247
+ this.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);
21248
+ this.subscribe(key + "-mouseover", this.pseudoTrackers[key].subscriber);
21249
+ });
21250
+
21251
+ this.pseudoTracking = true;
21252
+ }
21253
+
21254
+ pseudoMouseEnter(key, e, target){
21255
+ if(this.pseudoTrackers[key].target !== target){
21256
+
21257
+ if(this.pseudoTrackers[key].target){
21258
+ this.dispatch(key + "-mouseleave", e, target);
21259
+ }
21260
+
21261
+ this.pseudoMouseLeave(key, e);
21262
+
21263
+ this.pseudoTrackers[key].target = target;
21264
+
21265
+ this.dispatch(key + "-mouseenter", e, target);
21266
+ }
21267
+ }
21268
+
21269
+ pseudoMouseLeave(key, e){
21270
+ var leaveList = Object.keys(this.pseudoTrackers),
21271
+ linkedKeys = {
21272
+ "row":["cell"],
21273
+ "cell":["row"],
21274
+ };
21275
+
21276
+ leaveList = leaveList.filter((item) => {
21277
+ var links = linkedKeys[key];
21278
+ return item !== key && (!links || (links && !links.includes(item)));
21279
+ });
21280
+
21281
+
21282
+ leaveList.forEach((key) => {
21283
+ var target = this.pseudoTrackers[key].target;
21284
+
21285
+ if(this.pseudoTrackers[key].target){
21286
+ this.dispatch(key + "-mouseleave", e, target);
21287
+
21288
+ this.pseudoTrackers[key].target = null;
21289
+ }
21290
+ });
21291
+ }
21292
+
21293
+
21175
21294
  bindSubscriptionWatchers(){
21176
21295
  var listeners = Object.keys(this.listeners),
21177
21296
  components = Object.values(this.componentMap);
21178
-
21297
+
21179
21298
  for(let comp of components){
21180
21299
  for(let listener of listeners){
21181
21300
  let key = comp + "-" + listener;
21182
-
21301
+
21183
21302
  this.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));
21184
21303
  }
21185
21304
  }
21305
+
21306
+ this.subscribe("table-destroy", this.clearWatchers.bind(this));
21186
21307
  }
21187
-
21308
+
21188
21309
  subscriptionChanged(component, key, added){
21189
21310
  var listener = this.listeners[key].components,
21190
21311
  index = listener.indexOf(component),
@@ -21204,20 +21325,23 @@ class InteractionManager extends CoreFeature {
21204
21325
  }
21205
21326
  }
21206
21327
 
21328
+ if((key === "mouseenter" || key === "mouseleave") && !this.pseudoTracking){
21329
+ this.bindPseudoEvents();
21330
+ }
21331
+
21207
21332
  if(changed){
21208
21333
  this.updateEventListeners();
21209
21334
  }
21210
21335
  }
21211
-
21336
+
21212
21337
  updateEventListeners(){
21213
21338
  for(let key in this.listeners){
21214
21339
  let listener = this.listeners[key];
21215
-
21340
+
21216
21341
  if(listener.components.length){
21217
21342
  if(!listener.handler){
21218
21343
  listener.handler = this.track.bind(this, key);
21219
21344
  this.el.addEventListener(key, listener.handler);
21220
- console.log("add", key);
21221
21345
  // this.el.addEventListener(key, listener.handler, {passive: true})
21222
21346
  }
21223
21347
  }else {
@@ -21228,57 +21352,63 @@ class InteractionManager extends CoreFeature {
21228
21352
  }
21229
21353
  }
21230
21354
  }
21231
-
21355
+
21232
21356
  track(type, e){
21233
21357
  var path = (e.composedPath && e.composedPath()) || e.path;
21358
+
21234
21359
  var targets = this.findTargets(path);
21235
21360
  targets = this.bindComponents(type, targets);
21361
+
21236
21362
  this.triggerEvents(type, e, targets);
21237
- }
21238
21363
 
21364
+ if(this.pseudoTracking && (type == "mouseover" || type == "mouseleave") && !Object.keys(targets).length){
21365
+ this.pseudoMouseLeave("none", e);
21366
+ }
21367
+ }
21368
+
21239
21369
  findTargets(path){
21240
21370
  var targets = {};
21241
-
21371
+
21242
21372
  let componentMap = Object.keys(this.componentMap);
21243
-
21373
+
21244
21374
  for (let el of path) {
21245
21375
  let classList = el.classList ? [...el.classList] : [];
21246
-
21376
+
21247
21377
  let abort = classList.filter((item) => {
21248
21378
  return this.abortClasses.includes(item);
21249
21379
  });
21250
-
21380
+
21251
21381
  if(abort.length){
21252
21382
  break;
21253
21383
  }
21254
-
21384
+
21255
21385
  let elTargets = classList.filter((item) => {
21256
21386
  return componentMap.includes(item);
21257
21387
  });
21258
-
21388
+
21259
21389
  for (let target of elTargets) {
21260
21390
  targets[this.componentMap[target]] = el;
21261
21391
  }
21262
21392
  }
21263
-
21393
+
21264
21394
  if(targets.group && targets.group === targets.row){
21265
21395
  delete targets.row;
21266
21396
  }
21267
-
21397
+
21268
21398
  return targets;
21269
21399
  }
21270
-
21400
+
21271
21401
  bindComponents(type, targets){
21272
21402
  //ensure row component is looked up before cell
21273
21403
  var keys = Object.keys(targets).reverse(),
21274
21404
  listener = this.listeners[type],
21275
21405
  targetMatches = {};
21276
-
21406
+
21277
21407
  for(let key of keys){
21278
21408
  let component;
21279
21409
  let target = targets[key];
21280
21410
  let previousTarget = this.previousTargets[key];
21281
-
21411
+
21282
21412
  if(previousTarget && previousTarget.target === target){
21283
21413
  component = previousTarget.component;
21284
21414
  }else {
@@ -21286,20 +21416,20 @@ class InteractionManager extends CoreFeature {
21286
21416
  case "row":
21287
21417
  case "group":
21288
21418
  if(listener.components.includes("row") || listener.components.includes("cell")){
21289
- let rows = this.table.rowManager.getVisibleRows();
21290
-
21419
+ let rows = this.table.rowManager.getVisibleRows(true);
21420
+
21291
21421
  component = rows.find((row) => {
21292
21422
  return row.getElement() === target;
21293
21423
  });
21294
21424
  }
21295
21425
  break;
21296
-
21426
+
21297
21427
  case "column":
21298
21428
  if(listener.components.includes("column")){
21299
21429
  component = this.table.columnManager.findColumn(target);
21300
21430
  }
21301
21431
  break
21302
-
21432
+
21303
21433
  case "cell":
21304
21434
  if(listener.components.includes("cell")){
21305
21435
  component = targets["row"].findCell(target);
@@ -21307,7 +21437,7 @@ class InteractionManager extends CoreFeature {
21307
21437
  break;
21308
21438
  }
21309
21439
  }
21310
-
21440
+
21311
21441
  if(component){
21312
21442
  targets[key] = component;
21313
21443
  targetMatches[key] = {
@@ -21316,24 +21446,35 @@ class InteractionManager extends CoreFeature {
21316
21446
  };
21317
21447
  }
21318
21448
  }
21319
-
21449
+
21320
21450
  this.previousTargets = targetMatches;
21321
-
21451
+
21322
21452
  return targets;
21323
21453
  }
21324
-
21454
+
21325
21455
  triggerEvents(type, e, targets){
21326
21456
  var listener = this.listeners[type];
21327
-
21457
+
21328
21458
  for(let key in targets){
21329
21459
  if(targets[key] && listener.components.includes(key)){
21330
21460
  this.dispatch(key + "-" + type, e, targets[key]);
21331
21461
  }
21332
21462
  }
21333
21463
  }
21464
+
21465
+ clearWatchers(){
21466
+ for(let key in this.listeners){
21467
+ let listener = this.listeners[key];
21468
+
21469
+ if(listener.handler){
21470
+ this.el.removeEventListener(key, listener.handler);
21471
+ listener.handler = null;
21472
+ }
21473
+ }
21474
+ }
21334
21475
  }
21335
21476
 
21336
- class ComponentFuctionBinder{
21477
+ class ComponentFunctionBinder{
21337
21478
 
21338
21479
  constructor(table){
21339
21480
  this.table = table;
@@ -21428,7 +21569,7 @@ class DataLoader extends CoreFeature{
21428
21569
  data = JSON.parse(data);
21429
21570
  }
21430
21571
 
21431
- if(this.confirm("data-loading", data, params, config, silent)){
21572
+ if(this.confirm("data-loading", [data, params, config, silent])){
21432
21573
  this.loading = true;
21433
21574
 
21434
21575
  if(!silent){
@@ -21436,7 +21577,7 @@ class DataLoader extends CoreFeature{
21436
21577
  }
21437
21578
 
21438
21579
  //get params for request
21439
- var params = this.chain("data-params", [data, config, silent], params || {}, {});
21580
+ params = this.chain("data-params", [data, config, silent], params || {}, params || {});
21440
21581
 
21441
21582
  params = this.mapParams(params, this.table.options.dataSendParams);
21442
21583
 
@@ -22546,11 +22687,11 @@ class Tabulator {
22546
22687
  this.interactionMonitor = false; //track user interaction
22547
22688
  this.browser = ""; //hold current browser type
22548
22689
  this.browserSlow = false; //handle reduced functionality for slower browsers
22549
- this.browserMobile = false; //check if running on moble, prevent resize cancelling edit on keyboard appearence
22690
+ this.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance
22550
22691
  this.rtl = false; //check if the table is in RTL mode
22551
22692
  this.originalElement = null; //hold original table element if it has been replaced
22552
22693
 
22553
- this.componentFunctionBinder = new ComponentFuctionBinder(this); //bind component functions
22694
+ this.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions
22554
22695
  this.dataLoader = false; //bind component functions
22555
22696
 
22556
22697
  this.modules = {}; //hold all modules bound to this table
@@ -22565,13 +22706,13 @@ class Tabulator {
22565
22706
 
22566
22707
  this.initialzeCoreSystems(options);
22567
22708
 
22568
- //delay table creation to allow event bindings immediatly after the constructor
22709
+ //delay table creation to allow event bindings immediately after the constructor
22569
22710
  setTimeout(() => {
22570
22711
  this._create();
22571
22712
  });
22572
22713
  }
22573
22714
 
22574
- TableRegistry.register(this); //register table for inderdevice communication
22715
+ TableRegistry.register(this); //register table for inter-device communication
22575
22716
  }
22576
22717
 
22577
22718
  initializeElement(element){
@@ -22605,7 +22746,7 @@ class Tabulator {
22605
22746
 
22606
22747
  this._clearObjectPointers();
22607
22748
 
22608
- this._mapDepricatedFunctionality();
22749
+ this._mapDeprecatedFunctionality();
22609
22750
 
22610
22751
  this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
22611
22752
  this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
@@ -22618,8 +22759,8 @@ class Tabulator {
22618
22759
  this.footerManager.initialize();
22619
22760
  }
22620
22761
 
22621
- //convert depricated functionality to new functions
22622
- _mapDepricatedFunctionality(){
22762
+ //convert deprecated functionality to new functions
22763
+ _mapDeprecatedFunctionality(){
22623
22764
  //all previously deprecated functionality removed in the 5.0 release
22624
22765
  }
22625
22766
 
@@ -22640,7 +22781,7 @@ class Tabulator {
22640
22781
  this.element.classList.remove("tabulator-block-select");
22641
22782
  }
22642
22783
 
22643
- //concreate table
22784
+ //create table
22644
22785
  _create(){
22645
22786
  this.externalEvents.dispatch("tableBuilding");
22646
22787
  this.eventBus.dispatch("table-building");
@@ -22744,6 +22885,8 @@ class Tabulator {
22744
22885
  var element = this.element,
22745
22886
  options = this.options;
22746
22887
 
22888
+ this.interactionMonitor.initialize();
22889
+
22747
22890
  this.columnManager.initialize();
22748
22891
  this.rowManager.initialize();
22749
22892
 
@@ -22802,7 +22945,7 @@ class Tabulator {
22802
22945
  destroy(){
22803
22946
  var element = this.element;
22804
22947
 
22805
- TableRegistry.deregister(this); //deregister table from inderdevice communication
22948
+ TableRegistry.deregister(this); //deregister table from inter-device communication
22806
22949
 
22807
22950
  this.eventBus.dispatch("table-destroy");
22808
22951
 
@@ -22921,68 +23064,80 @@ class Tabulator {
22921
23064
 
22922
23065
  //replace data, keeping table in position with same sort
22923
23066
  replaceData(data, params, config){
22924
- return this.dataLoader.load(data, params, config, true, true);
23067
+ if(this.initialized){
23068
+ return this.dataLoader.load(data, params, config, true, true);
23069
+ }else {
23070
+ console.warn("replaceData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23071
+ }
22925
23072
  }
22926
23073
 
22927
23074
  //update table data
22928
23075
  updateData(data){
22929
23076
  var responses = 0;
22930
23077
 
22931
- return new Promise((resolve, reject) => {
22932
- this.dataLoader.blockActiveLoad();
23078
+ if(this.initialized){
23079
+ return new Promise((resolve, reject) => {
23080
+ this.dataLoader.blockActiveLoad();
22933
23081
 
22934
- if(typeof data === "string"){
22935
- data = JSON.parse(data);
22936
- }
23082
+ if(typeof data === "string"){
23083
+ data = JSON.parse(data);
23084
+ }
22937
23085
 
22938
- if(data){
22939
- data.forEach((item) => {
22940
- var row = this.rowManager.findRow(item[this.options.index]);
23086
+ if(data){
23087
+ data.forEach((item) => {
23088
+ var row = this.rowManager.findRow(item[this.options.index]);
22941
23089
 
22942
- if(row){
22943
- responses++;
23090
+ if(row){
23091
+ responses++;
22944
23092
 
22945
- row.updateData(item)
22946
- .then(()=>{
22947
- responses--;
23093
+ row.updateData(item)
23094
+ .then(()=>{
23095
+ responses--;
22948
23096
 
22949
- if(!responses){
22950
- resolve();
22951
- }
22952
- });
22953
- }
22954
- });
22955
- }else {
22956
- console.warn("Update Error - No data provided");
22957
- reject("Update Error - No data provided");
22958
- }
22959
- });
23097
+ if(!responses){
23098
+ resolve();
23099
+ }
23100
+ });
23101
+ }
23102
+ });
23103
+ }else {
23104
+ console.warn("Update Error - No data provided");
23105
+ reject("Update Error - No data provided");
23106
+ }
23107
+ });
23108
+ }else {
23109
+ console.warn("updateData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23110
+ }
22960
23111
  }
22961
23112
 
22962
23113
  addData(data, pos, index){
22963
- return new Promise((resolve, reject) => {
22964
- this.dataLoader.blockActiveLoad();
23114
+ if(this.initialized){
23115
+ return new Promise((resolve, reject) => {
23116
+ this.dataLoader.blockActiveLoad();
22965
23117
 
22966
- if(typeof data === "string"){
22967
- data = JSON.parse(data);
22968
- }
23118
+ if(typeof data === "string"){
23119
+ data = JSON.parse(data);
23120
+ }
22969
23121
 
22970
- if(data){
22971
- this.rowManager.addRows(data, pos, index)
22972
- .then((rows) => {
22973
- var output = [];
23122
+ if(data){
23123
+ this.rowManager.addRows(data, pos, index)
23124
+ .then((rows) => {
23125
+ var output = [];
22974
23126
 
22975
- rows.forEach(function(row){
22976
- output.push(row.getComponent());
22977
- });
23127
+ rows.forEach(function(row){
23128
+ output.push(row.getComponent());
23129
+ });
22978
23130
 
22979
- resolve(output);
22980
- });
22981
- }else {
22982
- console.warn("Update Error - No data provided");
22983
- reject("Update Error - No data provided");
22984
- }
22985
- });
23131
+ resolve(output);
23132
+ });
23133
+ }else {
23134
+ console.warn("Update Error - No data provided");
23135
+ reject("Update Error - No data provided");
23136
+ }
23137
+ });
23138
+ }else {
23139
+ console.warn("addData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23140
+ }
22986
23141
  }
22987
23142
 
22988
23143
  //update table data
@@ -22990,46 +23145,50 @@ class Tabulator {
22990
23145
  var rows = [],
22991
23146
  responses = 0;
22992
23147
 
22993
- return new Promise((resolve, reject) => {
22994
- this.dataLoader.blockActiveLoad();
23148
+ if(this.initialized){
23149
+ return new Promise((resolve, reject) => {
23150
+ this.dataLoader.blockActiveLoad();
22995
23151
 
22996
- if(typeof data === "string"){
22997
- data = JSON.parse(data);
22998
- }
23152
+ if(typeof data === "string"){
23153
+ data = JSON.parse(data);
23154
+ }
22999
23155
 
23000
- if(data){
23001
- data.forEach((item) => {
23002
- var row = this.rowManager.findRow(item[this.options.index]);
23156
+ if(data){
23157
+ data.forEach((item) => {
23158
+ var row = this.rowManager.findRow(item[this.options.index]);
23003
23159
 
23004
- responses++;
23160
+ responses++;
23005
23161
 
23006
- if(row){
23007
- row.updateData(item)
23008
- .then(()=>{
23009
- responses--;
23010
- rows.push(row.getComponent());
23162
+ if(row){
23163
+ row.updateData(item)
23164
+ .then(()=>{
23165
+ responses--;
23166
+ rows.push(row.getComponent());
23011
23167
 
23012
- if(!responses){
23013
- resolve(rows);
23014
- }
23015
- });
23016
- }else {
23017
- this.rowManager.addRows(item)
23018
- .then((newRows)=>{
23019
- responses--;
23020
- rows.push(newRows[0].getComponent());
23168
+ if(!responses){
23169
+ resolve(rows);
23170
+ }
23171
+ });
23172
+ }else {
23173
+ this.rowManager.addRows(item)
23174
+ .then((newRows)=>{
23175
+ responses--;
23176
+ rows.push(newRows[0].getComponent());
23021
23177
 
23022
- if(!responses){
23023
- resolve(rows);
23024
- }
23025
- });
23026
- }
23027
- });
23028
- }else {
23029
- console.warn("Update Error - No data provided");
23030
- reject("Update Error - No data provided");
23031
- }
23032
- });
23178
+ if(!responses){
23179
+ resolve(rows);
23180
+ }
23181
+ });
23182
+ }
23183
+ });
23184
+ }else {
23185
+ console.warn("Update Error - No data provided");
23186
+ reject("Update Error - No data provided");
23187
+ }
23188
+ });
23189
+ }else {
23190
+ console.warn("updateOrAddData failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23191
+ }
23033
23192
  }
23034
23193
 
23035
23194
  //get row object
@@ -23093,14 +23252,18 @@ class Tabulator {
23093
23252
 
23094
23253
  //add row to table
23095
23254
  addRow(data, pos, index){
23096
- if(typeof data === "string"){
23097
- data = JSON.parse(data);
23098
- }
23255
+ if(this.initialized){
23256
+ if(typeof data === "string"){
23257
+ data = JSON.parse(data);
23258
+ }
23099
23259
 
23100
- return this.rowManager.addRows(data, pos, index)
23101
- .then((rows)=>{
23102
- return rows[0].getComponent();
23103
- });
23260
+ return this.rowManager.addRows(data, pos, index)
23261
+ .then((rows)=>{
23262
+ return rows[0].getComponent();
23263
+ });
23264
+ }else {
23265
+ console.warn("addRow failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23266
+ }
23104
23267
  }
23105
23268
 
23106
23269
  //update a row if it exitsts otherwise create it
@@ -23135,7 +23298,7 @@ class Tabulator {
23135
23298
  if(row){
23136
23299
  return row.updateData(data)
23137
23300
  .then(()=>{
23138
- resolve(row.getComponent());
23301
+ return Promise.resolve(row.getComponent());
23139
23302
  })
23140
23303
  }else {
23141
23304
  console.warn("Update Error - No matching row found:", index);
@@ -23309,8 +23472,12 @@ class Tabulator {
23309
23472
  //////////// General Public Functions ////////////
23310
23473
  //redraw list without updating data
23311
23474
  redraw(force){
23312
- this.columnManager.redraw(force);
23313
- this.rowManager.redraw(force);
23475
+ if(this.initialized){
23476
+ this.columnManager.redraw(force);
23477
+ this.rowManager.redraw(force);
23478
+ }else {
23479
+ console.warn("redraw failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
23480
+ }
23314
23481
  }
23315
23482
 
23316
23483
  setHeight(height){
@@ -23361,7 +23528,7 @@ class Tabulator {
23361
23528
  }
23362
23529
 
23363
23530
  //default setup options
23364
- Tabulator.defaultOptions = defaultOptions$1;
23531
+ Tabulator.defaultOptions = defaultOptions;
23365
23532
 
23366
23533
  //bind modules and static functionality
23367
23534
  new ModuleBinder(Tabulator);