tabulator-tables 5.4.4 → 5.5.0

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 (96) hide show
  1. package/bower.json +1 -1
  2. package/dist/css/tabulator.css +80 -48
  3. package/dist/css/tabulator.css.map +1 -1
  4. package/dist/css/tabulator.min.css +1 -1
  5. package/dist/css/tabulator.min.css.map +1 -1
  6. package/dist/css/tabulator_bootstrap3.css +89 -53
  7. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  8. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  9. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  10. package/dist/css/tabulator_bootstrap4.css +106 -68
  11. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  13. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  14. package/dist/css/tabulator_bootstrap5.css +110 -70
  15. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  16. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  17. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  18. package/dist/css/tabulator_bulma.css +95 -57
  19. package/dist/css/tabulator_bulma.css.map +1 -1
  20. package/dist/css/tabulator_bulma.min.css +1 -1
  21. package/dist/css/tabulator_bulma.min.css.map +1 -1
  22. package/dist/css/tabulator_materialize.css +93 -58
  23. package/dist/css/tabulator_materialize.css.map +1 -1
  24. package/dist/css/tabulator_materialize.min.css +1 -1
  25. package/dist/css/tabulator_materialize.min.css.map +1 -1
  26. package/dist/css/tabulator_midnight.css +90 -54
  27. package/dist/css/tabulator_midnight.css.map +1 -1
  28. package/dist/css/tabulator_midnight.min.css +1 -1
  29. package/dist/css/tabulator_midnight.min.css.map +1 -1
  30. package/dist/css/tabulator_modern.css +96 -57
  31. package/dist/css/tabulator_modern.css.map +1 -1
  32. package/dist/css/tabulator_modern.min.css +1 -1
  33. package/dist/css/tabulator_modern.min.css.map +1 -1
  34. package/dist/css/tabulator_semanticui.css +131 -75
  35. package/dist/css/tabulator_semanticui.css.map +1 -1
  36. package/dist/css/tabulator_semanticui.min.css +1 -1
  37. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  38. package/dist/css/tabulator_simple.css +80 -48
  39. package/dist/css/tabulator_simple.css.map +1 -1
  40. package/dist/css/tabulator_simple.min.css +1 -1
  41. package/dist/css/tabulator_simple.min.css.map +1 -1
  42. package/dist/css/tabulator_site.css +88 -52
  43. package/dist/css/tabulator_site.css.map +1 -1
  44. package/dist/css/tabulator_site.min.css +1 -1
  45. package/dist/css/tabulator_site.min.css.map +1 -1
  46. package/dist/js/tabulator.js +363 -158
  47. package/dist/js/tabulator.js.map +1 -1
  48. package/dist/js/tabulator.min.js +2 -2
  49. package/dist/js/tabulator.min.js.map +1 -1
  50. package/dist/js/tabulator_esm.js +363 -158
  51. package/dist/js/tabulator_esm.js.map +1 -1
  52. package/dist/js/tabulator_esm.min.js +2 -2
  53. package/dist/js/tabulator_esm.min.js.map +1 -1
  54. package/package.json +1 -1
  55. package/src/js/core/ColumnManager.js +15 -0
  56. package/src/js/core/RowManager.js +57 -41
  57. package/src/js/core/cell/CellComponent.js +5 -3
  58. package/src/js/core/column/ColumnComponent.js +2 -2
  59. package/src/js/core/rendering/renderers/BasicHorizontal.js +7 -2
  60. package/src/js/core/rendering/renderers/BasicVertical.js +8 -5
  61. package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +6 -1
  62. package/src/js/core/rendering/renderers/VirtualDomVertical.js +85 -31
  63. package/src/js/core/row/RowComponent.js +2 -2
  64. package/src/js/modules/ColumnCalcs/defaults/calculations.js +7 -0
  65. package/src/js/modules/DataTree/DataTree.js +1 -1
  66. package/src/js/modules/Download/defaults/downloaders/xlsx.js +5 -2
  67. package/src/js/modules/Edit/Edit.js +2 -3
  68. package/src/js/modules/Edit/List.js +14 -3
  69. package/src/js/modules/Edit/defaults/editors/date.js +1 -1
  70. package/src/js/modules/Edit/defaults/editors/datetime.js +1 -1
  71. package/src/js/modules/Edit/defaults/editors/input.js +1 -1
  72. package/src/js/modules/Edit/defaults/editors/number.js +1 -1
  73. package/src/js/modules/Edit/defaults/editors/range.js +1 -1
  74. package/src/js/modules/Edit/defaults/editors/textarea.js +1 -1
  75. package/src/js/modules/Edit/defaults/editors/tickCross.js +1 -1
  76. package/src/js/modules/Edit/defaults/editors/time.js +1 -1
  77. package/src/js/modules/Export/Export.js +3 -0
  78. package/src/js/modules/Filter/Filter.js +11 -0
  79. package/src/js/modules/Format/Format.js +3 -0
  80. package/src/js/modules/Format/defaults/formatters/money.js +9 -2
  81. package/src/js/modules/FrozenColumns/FrozenColumns.js +1 -1
  82. package/src/js/modules/GroupRows/GroupComponent.js +4 -0
  83. package/src/js/modules/Interaction/Interaction.js +12 -0
  84. package/src/js/modules/Persistence/Persistence.js +15 -1
  85. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -0
  86. package/src/js/modules/SelectRow/SelectRow.js +82 -54
  87. package/src/scss/tabulator.scss +82 -50
  88. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +9 -5
  89. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +27 -19
  90. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +29 -19
  91. package/src/scss/themes/bulma/tabulator_bulma.scss +15 -9
  92. package/src/scss/themes/materialize/tabulator_materialize.scss +14 -10
  93. package/src/scss/themes/semanticui/tabulator_semanticui.scss +52 -27
  94. package/src/scss/themes/tabulator_midnight.scss +10 -6
  95. package/src/scss/themes/tabulator_modern.scss +16 -8
  96. package/src/scss/themes/tabulator_site.scss +8 -4
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.4.4 (c) Oliver Folkerd 2023 */
1
+ /* Tabulator v5.5.0 (c) Oliver Folkerd 2023 */
2
2
  class CoreFeature{
3
3
 
4
4
  constructor(table){
@@ -1505,10 +1505,12 @@ class CellComponent {
1505
1505
  return this._cell.row.getComponent();
1506
1506
  }
1507
1507
 
1508
- getData(){
1509
- return this._cell.row.getData();
1508
+ getData(transform){
1509
+ return this._cell.row.getData(transform);
1510
+ }
1511
+ getType(){
1512
+ return "cell";
1510
1513
  }
1511
-
1512
1514
  getField(){
1513
1515
  return this._cell.column.getField();
1514
1516
  }
@@ -1938,8 +1940,8 @@ class ColumnComponent {
1938
1940
  return this._column;
1939
1941
  }
1940
1942
 
1941
- scrollTo(){
1942
- return this._column.table.columnManager.scrollToColumn(this._column);
1943
+ scrollTo(position, ifVisible){
1944
+ return this._column.table.columnManager.scrollToColumn(this._column, position, ifVisible);
1943
1945
  }
1944
1946
 
1945
1947
  getTable(){
@@ -3008,8 +3010,8 @@ class RowComponent {
3008
3010
  return this._row.delete();
3009
3011
  }
3010
3012
 
3011
- scrollTo(){
3012
- return this._row.table.rowManager.scrollToRow(this._row);
3013
+ scrollTo(position, ifVisible){
3014
+ return this._row.table.rowManager.scrollToRow(this._row, position, ifVisible);
3013
3015
  }
3014
3016
 
3015
3017
  move(to, after){
@@ -3586,6 +3588,13 @@ var defaultCalculations = {
3586
3588
 
3587
3589
  return output;
3588
3590
  },
3591
+ "unique":function(values, data, calcParams){
3592
+ var unique = values.filter((value, index) => {
3593
+ return (values || value === 0) && values.indexOf(value) === index;
3594
+ });
3595
+
3596
+ return unique.length;
3597
+ },
3589
3598
  };
3590
3599
 
3591
3600
  class ColumnCalcs extends Module{
@@ -4460,7 +4469,7 @@ class DataTree extends Module{
4460
4469
 
4461
4470
  row.create();
4462
4471
 
4463
- config = row.modules.dataTree.children;
4472
+ config = row.modules.dataTree;
4464
4473
 
4465
4474
  if(!config.index && config.children !== false){
4466
4475
  children = this.getChildren(row);
@@ -4971,8 +4980,11 @@ function xlsx(list, options, setFileContents){
4971
4980
  workbook = XLSX.utils.book_new(),
4972
4981
  tableFeatures = new CoreFeature(this),
4973
4982
  compression = 'compress' in options ? options.compress : true,
4983
+ writeOptions = options.writeOptions || {bookType:'xlsx', bookSST:true, compression},
4974
4984
  output;
4975
4985
 
4986
+ writeOptions.type = 'binary';
4987
+
4976
4988
  workbook.SheetNames = [];
4977
4989
  workbook.Sheets = {};
4978
4990
 
@@ -5058,7 +5070,7 @@ function xlsx(list, options, setFileContents){
5058
5070
  return buf;
5059
5071
  }
5060
5072
 
5061
- output = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary', compression });
5073
+ output = XLSX.write(workbook, writeOptions);
5062
5074
 
5063
5075
  setFileContents(s2ab(output), "application/octet-stream");
5064
5076
  }
@@ -5356,7 +5368,7 @@ function input(cell, onRendered, success, cancel, editorParams){
5356
5368
  input.value = typeof cellValue !== "undefined" ? cellValue : "";
5357
5369
 
5358
5370
  onRendered(function(){
5359
- if(cell._getSelf){
5371
+ if(cell.getType() === "cell"){
5360
5372
  input.focus({preventScroll: true});
5361
5373
  input.style.height = "100%";
5362
5374
 
@@ -5437,7 +5449,7 @@ function textarea(cell, onRendered, success, cancel, editorParams){
5437
5449
  input.value = value;
5438
5450
 
5439
5451
  onRendered(function(){
5440
- if(cell._getSelf){
5452
+ if(cell.getType() === "cell"){
5441
5453
  input.focus({preventScroll: true});
5442
5454
  input.style.height = "100%";
5443
5455
 
@@ -5571,7 +5583,7 @@ function number(cell, onRendered, success, cancel, editorParams){
5571
5583
  };
5572
5584
 
5573
5585
  onRendered(function () {
5574
- if(cell._getSelf){
5586
+ if(cell.getType() === "cell"){
5575
5587
  //submit new value on blur
5576
5588
  input.removeEventListener("blur", blurFunc);
5577
5589
 
@@ -5675,7 +5687,7 @@ function range(cell, onRendered, success, cancel, editorParams){
5675
5687
  input.value = cellValue;
5676
5688
 
5677
5689
  onRendered(function () {
5678
- if(cell._getSelf){
5690
+ if(cell.getType() === "cell"){
5679
5691
  input.focus({preventScroll: true});
5680
5692
  input.style.height = "100%";
5681
5693
  }
@@ -5780,7 +5792,7 @@ function date(cell, onRendered, success, cancel, editorParams){
5780
5792
  input.value = cellValue;
5781
5793
 
5782
5794
  onRendered(function(){
5783
- if(cell._getSelf){
5795
+ if(cell.getType() === "cell"){
5784
5796
  input.focus({preventScroll: true});
5785
5797
  input.style.height = "100%";
5786
5798
 
@@ -5907,7 +5919,7 @@ function time(cell, onRendered, success, cancel, editorParams){
5907
5919
  input.value = cellValue;
5908
5920
 
5909
5921
  onRendered(function(){
5910
- if(cell._getSelf){
5922
+ if(cell.getType() == "cell"){
5911
5923
  input.focus({preventScroll: true});
5912
5924
  input.style.height = "100%";
5913
5925
 
@@ -6033,7 +6045,7 @@ function datetime(cell, onRendered, success, cancel, editorParams){
6033
6045
  input.value = cellValue;
6034
6046
 
6035
6047
  onRendered(function(){
6036
- if(cell._getSelf){
6048
+ if(cell.getType() === "cell"){
6037
6049
  input.focus({preventScroll: true});
6038
6050
  input.style.height = "100%";
6039
6051
 
@@ -6128,7 +6140,7 @@ class Edit{
6128
6140
 
6129
6141
  this.initialValues = null;
6130
6142
 
6131
- this.isFilter = !cell._getSelf;
6143
+ this.isFilter = cell.getType() === "header";
6132
6144
 
6133
6145
  this.filterTimeout = null;
6134
6146
  this.filtered = false;
@@ -6194,7 +6206,7 @@ class Edit{
6194
6206
  function clickStop(e){
6195
6207
  e.stopPropagation();
6196
6208
  }
6197
-
6209
+
6198
6210
  if(!this.isFilter){
6199
6211
  this.input.style.height = "100%";
6200
6212
  this.input.focus({preventScroll: true});
@@ -6418,6 +6430,7 @@ class Edit{
6418
6430
  break;
6419
6431
 
6420
6432
  case 9: //tab
6433
+ this._keyTab(e);
6421
6434
  break;
6422
6435
 
6423
6436
  default:
@@ -6464,6 +6477,16 @@ class Edit{
6464
6477
  //////// Keyboard Navigation /////////
6465
6478
  //////////////////////////////////////
6466
6479
 
6480
+ _keyTab(e){
6481
+ if(this.params.autocomplete && this.lastAction === "typing"){
6482
+ this._resolveValue(true);
6483
+ }else {
6484
+ if(this.focusedItem){
6485
+ this._chooseItem(this.focusedItem, true);
6486
+ }
6487
+ }
6488
+ }
6489
+
6467
6490
  _keyUp(e){
6468
6491
  var index = this.displayItems.indexOf(this.focusedItem);
6469
6492
 
@@ -7101,7 +7124,7 @@ class Edit{
7101
7124
 
7102
7125
  _resolveValue(blur){
7103
7126
  var output, initialValue;
7104
-
7127
+
7105
7128
  if(this.popup){
7106
7129
  this.popup.hide(true);
7107
7130
  }
@@ -7481,7 +7504,7 @@ function tickCross(cell, onRendered, success, cancel, editorParams){
7481
7504
 
7482
7505
  if(this.table.browser != "firefox" && this.table.browser != "safari"){ //prevent blur issue on mac firefox
7483
7506
  onRendered(function(){
7484
- if(cell._getSelf){
7507
+ if(cell.getType() === "cell"){
7485
7508
  input.focus({preventScroll: true});
7486
7509
  }
7487
7510
  });
@@ -8070,8 +8093,8 @@ class Edit$1 extends Module{
8070
8093
  cellEl = cell.getElement();
8071
8094
 
8072
8095
  if(this.table.modExists("frozenColumns")){
8073
- leftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);
8074
- rightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);
8096
+ leftEdge += parseInt(this.table.modules.frozenColumns.leftMargin || 0);
8097
+ rightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin || 0);
8075
8098
  }
8076
8099
 
8077
8100
  if(this.table.options.renderHorizontal === "virtual"){
@@ -8080,7 +8103,6 @@ class Edit$1 extends Module{
8080
8103
  }
8081
8104
 
8082
8105
  if(cellEl.offsetLeft < leftEdge){
8083
-
8084
8106
  this.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);
8085
8107
  }else {
8086
8108
  if(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){
@@ -8788,6 +8810,9 @@ class Export extends Module{
8788
8810
  getElement:function(){
8789
8811
  return cellEl;
8790
8812
  },
8813
+ getType:function(){
8814
+ return "cell";
8815
+ },
8791
8816
  getColumn:function(){
8792
8817
  return column.getComponent();
8793
8818
  },
@@ -9048,6 +9073,7 @@ class Filter extends Module{
9048
9073
  this.registerTableOption("initialFilter", false); //initial filtering criteria
9049
9074
  this.registerTableOption("initialHeaderFilter", false); //initial header filtering criteria
9050
9075
  this.registerTableOption("headerFilterLiveFilterDelay", 300); //delay before updating column after user types in header filter
9076
+ this.registerTableOption("placeholderHeaderFilter", false); //placeholder when header filter is empty
9051
9077
 
9052
9078
  this.registerColumnOption("headerFilter");
9053
9079
  this.registerColumnOption("headerFilterPlaceholder");
@@ -9083,6 +9109,7 @@ class Filter extends Module{
9083
9109
  this.subscribe("column-width-fit-before", this.hideHeaderFilterElements.bind(this));
9084
9110
  this.subscribe("column-width-fit-after", this.showHeaderFilterElements.bind(this));
9085
9111
  this.subscribe("table-built", this.tableBuilt.bind(this));
9112
+ this.subscribe("placeholder", this.generatePlaceholder.bind(this));
9086
9113
 
9087
9114
  if(this.table.options.filterMode === "remote"){
9088
9115
  this.subscribe("data-params", this.remoteFilterParams.bind(this));
@@ -9118,6 +9145,12 @@ class Filter extends Module{
9118
9145
  return params;
9119
9146
  }
9120
9147
 
9148
+ generatePlaceholder(text){
9149
+ if(this.table.options.placeholderHeaderFilter && Object.keys(this.headerFilters).length){
9150
+ return this.table.options.placeholderHeaderFilter;
9151
+ }
9152
+ }
9153
+
9121
9154
  ///////////////////////////////////
9122
9155
  ///////// Table Functions /////////
9123
9156
  ///////////////////////////////////
@@ -9401,6 +9434,9 @@ class Filter extends Module{
9401
9434
  getTable:() => {
9402
9435
  return this.table;
9403
9436
  },
9437
+ getType:() => {
9438
+ return "header";
9439
+ },
9404
9440
  getRow:function(){
9405
9441
  return {
9406
9442
  normalizeHeight:function(){
@@ -9932,7 +9968,7 @@ function textarea$1(cell, formatterParams, onRendered){
9932
9968
  function money(cell, formatterParams, onRendered){
9933
9969
  var floatVal = parseFloat(cell.getValue()),
9934
9970
  sign = "",
9935
- number, integer, decimal, rgx;
9971
+ number, integer, decimal, rgx, value;
9936
9972
 
9937
9973
  var decimalSym = formatterParams.decimal || ".";
9938
9974
  var thousandSym = formatterParams.thousand || ",";
@@ -9964,7 +10000,14 @@ function money(cell, formatterParams, onRendered){
9964
10000
  }
9965
10001
  }
9966
10002
 
9967
- return after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;
10003
+ value = integer + decimal;
10004
+
10005
+ if(sign === true){
10006
+ value = "(" + value + ")";
10007
+ return after ? value + symbol : symbol + value;
10008
+ }else {
10009
+ return after ? sign + value + symbol : sign + symbol + value;
10010
+ }
9968
10011
  }
9969
10012
 
9970
10013
  function link(cell, formatterParams, onRendered){
@@ -10670,6 +10713,9 @@ class Format extends Module{
10670
10713
  getElement:function(){
10671
10714
  return el;
10672
10715
  },
10716
+ getType:function(){
10717
+ return "header";
10718
+ },
10673
10719
  getColumn:function(){
10674
10720
  return column.getComponent();
10675
10721
  },
@@ -11041,7 +11087,7 @@ class FrozenColumns extends Module{
11041
11087
  layoutElement(element, column){
11042
11088
  var position;
11043
11089
 
11044
- if(column.modules.frozen){
11090
+ if(column.modules.frozen && element){
11045
11091
  element.style.position = "sticky";
11046
11092
 
11047
11093
  if(this.table.rtl){
@@ -11305,6 +11351,10 @@ class GroupComponent {
11305
11351
  this._group.toggleVisibility();
11306
11352
  }
11307
11353
 
11354
+ scrollTo(position, ifVisible){
11355
+ return this._group.groupManager.table.rowManager.scrollToRow(this._group, position, ifVisible);
11356
+ }
11357
+
11308
11358
  _getSelf(){
11309
11359
  return this._group;
11310
11360
  }
@@ -13338,8 +13388,20 @@ class Interaction extends Module{
13338
13388
 
13339
13389
  this.subscribe("column-init", this.initializeColumn.bind(this));
13340
13390
  this.subscribe("cell-dblclick", this.cellContentsSelectionFixer.bind(this));
13391
+ this.subscribe("scroll-horizontal", this.clearTouchWatchers.bind(this));
13392
+ this.subscribe("scroll-vertical", this.clearTouchWatchers.bind(this));
13341
13393
  }
13342
13394
 
13395
+ clearTouchWatchers(){
13396
+ var types = Object.values(this.touchWatchers);
13397
+
13398
+ types.forEach((type) => {
13399
+ for(let key in type){
13400
+ type[key] = null;
13401
+ }
13402
+ });
13403
+ }
13404
+
13343
13405
  cellContentsSelectionFixer(e, cell){
13344
13406
  var range;
13345
13407
 
@@ -16295,6 +16357,7 @@ class Persistence extends Module{
16295
16357
  this.config = {
16296
16358
  sort:this.table.options.persistence === true || this.table.options.persistence.sort,
16297
16359
  filter:this.table.options.persistence === true || this.table.options.persistence.filter,
16360
+ headerFilter:this.table.options.persistence === true || this.table.options.persistence.headerFilter,
16298
16361
  group:this.table.options.persistence === true || this.table.options.persistence.group,
16299
16362
  page:this.table.options.persistence === true || this.table.options.persistence.page,
16300
16363
  columns:this.table.options.persistence === true ? ["title", "width", "visible"] : this.table.options.persistence.columns,
@@ -16345,6 +16408,7 @@ class Persistence extends Module{
16345
16408
  this.subscribe("table-redraw", this.tableRedraw.bind(this));
16346
16409
 
16347
16410
  this.subscribe("filter-changed", this.eventSave.bind(this, "filter"));
16411
+ this.subscribe("filter-changed", this.eventSave.bind(this, "headerFilter"));
16348
16412
  this.subscribe("sort-changed", this.eventSave.bind(this, "sort"));
16349
16413
  this.subscribe("group-changed", this.eventSave.bind(this, "group"));
16350
16414
  this.subscribe("page-changed", this.eventSave.bind(this, "page"));
@@ -16364,7 +16428,7 @@ class Persistence extends Module{
16364
16428
  }
16365
16429
 
16366
16430
  tableBuilt(){
16367
- var sorters, filters;
16431
+ var sorters, filters, headerFilters;
16368
16432
 
16369
16433
  if(this.config.sort){
16370
16434
  sorters = this.load("sort");
@@ -16381,6 +16445,14 @@ class Persistence extends Module{
16381
16445
  this.table.options.initialFilter = filters;
16382
16446
  }
16383
16447
  }
16448
+ if(this.config.headerFilter){
16449
+ headerFilters = this.load("headerFilter");
16450
+
16451
+ if(!headerFilters === false){
16452
+ this.table.options.initialHeaderFilter = headerFilters;
16453
+ }
16454
+ }
16455
+
16384
16456
  }
16385
16457
 
16386
16458
  tableRedraw(force){
@@ -16541,6 +16613,10 @@ class Persistence extends Module{
16541
16613
  data = this.table.modules.filter.getFilters();
16542
16614
  break;
16543
16615
 
16616
+ case "headerFilter":
16617
+ data = this.table.modules.filter.getHeaderFilters();
16618
+ break;
16619
+
16544
16620
  case "sort":
16545
16621
  data = this.validateSorters(this.table.modules.sort.getSort());
16546
16622
  break;
@@ -18273,6 +18349,9 @@ class ResponsiveLayout extends Module{
18273
18349
  getData:function(){
18274
18350
  return data;
18275
18351
  },
18352
+ getType:function(){
18353
+ return "cell";
18354
+ },
18276
18355
  getElement:function(){
18277
18356
  return document.createElement("div");
18278
18357
  },
@@ -18537,7 +18616,7 @@ class SelectRow extends Module{
18537
18616
  }
18538
18617
 
18539
18618
  checkRowSelectability(row){
18540
- if(row.type === "row"){
18619
+ if(row && row.type === "row"){
18541
18620
  return this.table.options.selectableCheck.call(this.table, row.getComponent());
18542
18621
  }
18543
18622
 
@@ -18557,48 +18636,44 @@ class SelectRow extends Module{
18557
18636
 
18558
18637
  //select a number of rows
18559
18638
  selectRows(rows){
18560
- var rowMatch;
18639
+ var changes = [],
18640
+ rowMatch, change;
18561
18641
 
18562
18642
  switch(typeof rows){
18563
18643
  case "undefined":
18564
- this.table.rowManager.rows.forEach((row) => {
18565
- this._selectRow(row, true, true);
18566
- });
18567
-
18568
- this._rowSelectionChanged();
18644
+ rowMatch = this.table.rowManager.rows;
18569
18645
  break;
18570
18646
 
18571
18647
  case "string":
18572
18648
  rowMatch = this.table.rowManager.findRow(rows);
18573
18649
 
18574
- if(rowMatch){
18575
- this._selectRow(rowMatch, true, true);
18576
- this._rowSelectionChanged();
18577
- }else {
18650
+ if(!rowMatch){
18578
18651
  rowMatch = this.table.rowManager.getRows(rows);
18579
-
18580
- rowMatch.forEach((row) => {
18581
- this._selectRow(row, true, true);
18582
- });
18583
-
18584
- if(rowMatch.length){
18585
- this._rowSelectionChanged();
18586
- }
18587
18652
  }
18588
18653
  break;
18589
18654
 
18590
18655
  default:
18591
- if(Array.isArray(rows)){
18592
- rows.forEach((row) => {
18593
- this._selectRow(row, true, true);
18594
- });
18595
-
18596
- this._rowSelectionChanged();
18597
- }else {
18598
- this._selectRow(rows, false, true);
18599
- }
18656
+ rowMatch = rows;
18600
18657
  break;
18601
18658
  }
18659
+
18660
+ if(Array.isArray(rowMatch)){
18661
+ if(rowMatch.length){
18662
+ rowMatch.forEach((row) => {
18663
+ change = this._selectRow(row, true, true);
18664
+
18665
+ if(change){
18666
+ changes.push(change);
18667
+ }
18668
+ });
18669
+
18670
+ this._rowSelectionChanged(false, changes);
18671
+ }
18672
+ }else {
18673
+ if(rowMatch){
18674
+ this._selectRow(rowMatch, false, true);
18675
+ }
18676
+ }
18602
18677
  }
18603
18678
 
18604
18679
  //select an individual row
@@ -18636,7 +18711,9 @@ class SelectRow extends Module{
18636
18711
 
18637
18712
  this.dispatchExternal("rowSelected", row.getComponent());
18638
18713
 
18639
- this._rowSelectionChanged(silent);
18714
+ this._rowSelectionChanged(silent, row);
18715
+
18716
+ return row;
18640
18717
  }
18641
18718
  }else {
18642
18719
  if(!silent){
@@ -18651,39 +18728,51 @@ class SelectRow extends Module{
18651
18728
 
18652
18729
  //deselect a number of rows
18653
18730
  deselectRows(rows, silent){
18654
- var self = this,
18655
- rowCount;
18731
+ var changes = [],
18732
+ rowMatch, change;
18656
18733
 
18657
- if(typeof rows == "undefined"){
18734
+ switch(typeof rows){
18735
+ case "undefined":
18736
+ rowMatch = Object.assign([], this.selectedRows);
18737
+ break;
18658
18738
 
18659
- rowCount = self.selectedRows.length;
18739
+ case "string":
18740
+ rowMatch = this.table.rowManager.findRow(rows);
18660
18741
 
18661
- for(let i = 0; i < rowCount; i++){
18662
- self._deselectRow(self.selectedRows[0], true);
18663
- }
18742
+ if(!rowMatch){
18743
+ rowMatch = this.table.rowManager.getRows(rows);
18744
+ }
18745
+ break;
18664
18746
 
18665
- if(rowCount){
18666
- self._rowSelectionChanged(silent);
18747
+ default:
18748
+ rowMatch = rows;
18749
+ break;
18750
+ }
18751
+
18752
+ if(Array.isArray(rowMatch)){
18753
+ if(rowMatch.length){
18754
+ rowMatch.forEach((row) => {
18755
+ change = this._deselectRow(row, true, true);
18756
+
18757
+ if(change){
18758
+ changes.push(change);
18759
+ }
18760
+ });
18761
+
18762
+ this._rowSelectionChanged(silent, [], changes);
18667
18763
  }
18668
-
18669
18764
  }else {
18670
- if(Array.isArray(rows)){
18671
- rows.forEach(function(row){
18672
- self._deselectRow(row, true);
18673
- });
18674
-
18675
- self._rowSelectionChanged(silent);
18676
- }else {
18677
- self._deselectRow(rows, silent);
18765
+ if(rowMatch){
18766
+ this._deselectRow(rowMatch, silent, true);
18678
18767
  }
18679
- }
18768
+ }
18680
18769
  }
18681
18770
 
18682
18771
  //deselect an individual row
18683
18772
  _deselectRow(rowInfo, silent){
18684
18773
  var self = this,
18685
18774
  row = self.table.rowManager.findRow(rowInfo),
18686
- index;
18775
+ index, element;
18687
18776
 
18688
18777
  if(row){
18689
18778
  index = self.selectedRows.findIndex(function(selectedRow){
@@ -18691,8 +18780,13 @@ class SelectRow extends Module{
18691
18780
  });
18692
18781
 
18693
18782
  if(index > -1){
18783
+
18784
+ element = row.getElement();
18785
+
18786
+ if(element){
18787
+ element.classList.remove("tabulator-selected");
18788
+ }
18694
18789
 
18695
- row.getElement().classList.remove("tabulator-selected");
18696
18790
  if(!row.modules.select){
18697
18791
  row.modules.select = {};
18698
18792
  }
@@ -18709,7 +18803,9 @@ class SelectRow extends Module{
18709
18803
 
18710
18804
  this.dispatchExternal("rowDeselected", row.getComponent());
18711
18805
 
18712
- self._rowSelectionChanged(silent);
18806
+ self._rowSelectionChanged(silent, undefined, row);
18807
+
18808
+ return row;
18713
18809
  }
18714
18810
  }else {
18715
18811
  if(!silent){
@@ -18729,7 +18825,6 @@ class SelectRow extends Module{
18729
18825
  }
18730
18826
 
18731
18827
  getSelectedRows(){
18732
-
18733
18828
  var rows = [];
18734
18829
 
18735
18830
  this.selectedRows.forEach(function(row){
@@ -18739,7 +18834,7 @@ class SelectRow extends Module{
18739
18834
  return rows;
18740
18835
  }
18741
18836
 
18742
- _rowSelectionChanged(silent){
18837
+ _rowSelectionChanged(silent, selected = [], deselected = []){
18743
18838
  if(this.headerCheckboxElement){
18744
18839
  if(this.selectedRows.length === 0){
18745
18840
  this.headerCheckboxElement.checked = false;
@@ -18754,7 +18849,19 @@ class SelectRow extends Module{
18754
18849
  }
18755
18850
 
18756
18851
  if(!silent){
18757
- this.dispatchExternal("rowSelectionChanged", this.getSelectedData(), this.getSelectedRows());
18852
+ if(!Array.isArray(selected)){
18853
+ selected = [selected];
18854
+ }
18855
+
18856
+ selected = selected.map(row => row.getComponent());
18857
+
18858
+ if(!Array.isArray(deselected)){
18859
+ deselected = [deselected];
18860
+ }
18861
+
18862
+ deselected = deselected.map(row => row.getComponent());
18863
+
18864
+ this.dispatchExternal("rowSelectionChanged", this.getSelectedData(), this.getSelectedRows(), selected, deselected);
18758
18865
  }
18759
18866
  }
18760
18867
 
@@ -20444,9 +20551,14 @@ class BasicHorizontal extends Renderer{
20444
20551
  super(table);
20445
20552
  }
20446
20553
 
20447
- renderRowCells(row){
20554
+ renderRowCells(row) {
20555
+ const rowFrag = document.createDocumentFragment();
20556
+ row.cells.forEach((cell) => {
20557
+ rowFrag.appendChild(cell.getElement());
20558
+ });
20559
+ row.element.appendChild(rowFrag);
20560
+
20448
20561
  row.cells.forEach((cell) => {
20449
- row.element.appendChild(cell.getElement());
20450
20562
  cell.cellRendered();
20451
20563
  });
20452
20564
  }
@@ -20631,8 +20743,13 @@ class VirtualDomHorizontal extends Renderer{
20631
20743
  if(this.initialized){
20632
20744
  this.initializeRow(row);
20633
20745
  }else {
20746
+ const rowFrag = document.createDocumentFragment();
20747
+ row.cells.forEach((cell) => {
20748
+ rowFrag.appendChild(cell.getElement());
20749
+ });
20750
+ row.element.appendChild(rowFrag);
20751
+
20634
20752
  row.cells.forEach((cell) => {
20635
- row.element.appendChild(cell.getElement());
20636
20753
  cell.cellRendered();
20637
20754
  });
20638
20755
  }
@@ -21067,6 +21184,8 @@ class ColumnManager extends CoreFeature {
21067
21184
 
21068
21185
  this.contentsElement.insertBefore(this.headersElement, this.contentsElement.firstChild);
21069
21186
  this.element.insertBefore(this.contentsElement, this.element.firstChild);
21187
+
21188
+ this.initializeScrollWheelWatcher();
21070
21189
 
21071
21190
  this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
21072
21191
  this.subscribe("scrollbar-vertical", this.padVerticalScrollbar.bind(this));
@@ -21158,6 +21277,19 @@ class ColumnManager extends CoreFeature {
21158
21277
 
21159
21278
  this.renderer.scrollColumns(left);
21160
21279
  }
21280
+
21281
+ initializeScrollWheelWatcher(){
21282
+ this.contentsElement.addEventListener("wheel", (e) => {
21283
+ var left;
21284
+
21285
+ if(e.deltaX){
21286
+ left = this.contentsElement.scrollLeft + e.deltaX;
21287
+
21288
+ this.table.rowManager.scrollHorizontal(left);
21289
+ this.table.columnManager.scrollHorizontal(left);
21290
+ }
21291
+ });
21292
+ }
21161
21293
 
21162
21294
  ///////////// Column Setup Functions /////////////
21163
21295
  generateColumnsFromRowData(data){
@@ -21784,19 +21916,22 @@ class BasicVertical extends Renderer{
21784
21916
  element.style.visibility = "";
21785
21917
  }
21786
21918
 
21787
- renderRows(){
21919
+ renderRows() {
21788
21920
  var element = this.tableElement,
21789
- onlyGroupHeaders = true;
21921
+ onlyGroupHeaders = true,
21922
+ tableFrag = document.createDocumentFragment();
21790
21923
 
21791
21924
  this.rows().forEach((row, index) => {
21792
21925
  this.styleRow(row, index);
21793
- element.appendChild(row.getElement());
21794
21926
  row.initialize(true);
21795
21927
 
21796
- if(row.type !== "group"){
21928
+ if (row.type !== "group") {
21797
21929
  onlyGroupHeaders = false;
21798
21930
  }
21931
+
21932
+ tableFrag.appendChild(row.getElement());
21799
21933
  });
21934
+ element.appendChild(tableFrag);
21800
21935
 
21801
21936
  if(onlyGroupHeaders){
21802
21937
  element.style.minWidth = this.table.columnManager.getWidth() + "px";
@@ -21877,7 +22012,6 @@ class VirtualDomVertical extends Renderer{
21877
22012
 
21878
22013
  element.style.paddingTop = "";
21879
22014
  element.style.paddingBottom = "";
21880
- // element.style.minWidth = "";
21881
22015
  element.style.minHeight = "";
21882
22016
  element.style.display = "";
21883
22017
  element.style.visibility = "";
@@ -22056,17 +22190,27 @@ class VirtualDomVertical extends Renderer{
22056
22190
  //////////////////////////////////////
22057
22191
 
22058
22192
  //full virtual render
22059
- _virtualRenderFill(position, forceMove, offset){
22193
+ _virtualRenderFill(position, forceMove, offset) {
22060
22194
  var element = this.tableElement,
22061
22195
  holder = this.elementVertical,
22062
22196
  topPad = 0,
22063
22197
  rowsHeight = 0,
22198
+ rowHeight = 0,
22064
22199
  heightOccupied = 0,
22065
22200
  topPadHeight = 0,
22066
22201
  i = 0,
22067
22202
  rows = this.rows(),
22068
22203
  rowsCount = rows.length,
22069
- containerHeight = this.elementVertical.clientHeight;
22204
+ index = 0,
22205
+ row,
22206
+ rowFragment,
22207
+ renderedRows = [],
22208
+ totalRowsRendered = 0,
22209
+ rowsToRender = 0,
22210
+ fixedHeight = this.table.rowManager.fixedHeight,
22211
+ containerHeight = this.elementVertical.clientHeight,
22212
+ avgRowHeight = this.table.options.rowHeight,
22213
+ resized = true;
22070
22214
 
22071
22215
  position = position || 0;
22072
22216
 
@@ -22094,44 +22238,89 @@ class VirtualDomVertical extends Renderer{
22094
22238
 
22095
22239
  if(rowsCount && Helpers.elVisible(this.elementVertical)){
22096
22240
  this.vDomTop = position;
22097
-
22098
22241
  this.vDomBottom = position -1;
22099
22242
 
22100
- while ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){
22101
- var index = this.vDomBottom + 1,
22102
- row = rows[index],
22103
- rowHeight = 0;
22104
-
22105
- this.styleRow(row, index);
22243
+ if(fixedHeight || this.table.options.maxHeight) {
22244
+ if(avgRowHeight) {
22245
+ rowsToRender = (containerHeight / avgRowHeight) + (this.vDomWindowBuffer / avgRowHeight);
22246
+ }
22247
+ rowsToRender = Math.max(this.vDomWindowMinTotalRows, Math.ceil(rowsToRender));
22248
+ }
22249
+ else {
22250
+ rowsToRender = rowsCount;
22251
+ }
22106
22252
 
22107
- element.appendChild(row.getElement());
22253
+ while(((rowsToRender == rowsCount || rowsHeight <= containerHeight + this.vDomWindowBuffer) || totalRowsRendered < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1) {
22254
+ renderedRows = [];
22255
+ rowFragment = document.createDocumentFragment();
22108
22256
 
22109
- row.initialize();
22257
+ i = 0;
22258
+ while ((i < rowsToRender) && this.vDomBottom < rowsCount -1) {
22259
+ index = this.vDomBottom + 1,
22260
+ row = rows[index];
22110
22261
 
22111
- if(!row.heightInitialized){
22112
- row.normalizeHeight(true);
22113
- }
22262
+ this.styleRow(row, index);
22114
22263
 
22115
- rowHeight = row.getHeight();
22264
+ row.initialize();
22265
+ if(!row.heightInitialized && !this.table.options.rowHeight){
22266
+ row.clearCellHeight();
22267
+ }
22116
22268
 
22117
- if(i < topPad){
22118
- topPadHeight += rowHeight;
22119
- }else {
22120
- rowsHeight += rowHeight;
22269
+ rowFragment.appendChild(row.getElement());
22270
+ renderedRows.push(row);
22271
+ this.vDomBottom ++;
22272
+ i++;
22121
22273
  }
22122
22274
 
22123
- if(rowHeight > this.vDomWindowBuffer){
22124
- this.vDomWindowBuffer = rowHeight * 2;
22275
+ if(!renderedRows.length){
22276
+ break;
22125
22277
  }
22278
+ element.appendChild(rowFragment);
22279
+
22280
+ // NOTE: The next 3 loops are separate on purpose
22281
+ // This is to batch up the dom writes and reads which drastically improves performance
22282
+ renderedRows.forEach((row) => {
22283
+ if(!row.heightInitialized) {
22284
+ row.calcHeight(true);
22285
+
22286
+ }
22287
+ });
22126
22288
 
22127
- this.vDomBottom ++;
22128
- i++;
22289
+ renderedRows.forEach((row) => {
22290
+ if(!row.heightInitialized) {
22291
+ row.setCellHeight();
22292
+
22293
+ }
22294
+ });
22295
+
22296
+ renderedRows.forEach((row) => {
22297
+ rowHeight = row.getHeight();
22298
+
22299
+ if(totalRowsRendered < topPad){
22300
+ topPadHeight += rowHeight;
22301
+ }else {
22302
+ rowsHeight += rowHeight;
22303
+ }
22304
+
22305
+ if(rowHeight > this.vDomWindowBuffer){
22306
+ this.vDomWindowBuffer = rowHeight * 2;
22307
+ }
22308
+ totalRowsRendered++;
22309
+ });
22310
+
22311
+ resized = this.table.rowManager.adjustTableSize();
22312
+ containerHeight = this.elementVertical.clientHeight;
22313
+ if(resized && (fixedHeight || this.table.options.maxHeight))
22314
+ {
22315
+ avgRowHeight = rowsHeight / totalRowsRendered;
22316
+ rowsToRender = Math.max(this.vDomWindowMinTotalRows, Math.ceil((containerHeight / avgRowHeight) + (this.vDomWindowBuffer / avgRowHeight)));
22317
+ }
22129
22318
  }
22130
22319
 
22131
22320
  if(!position){
22132
22321
  this.vDomTopPad = 0;
22133
22322
  //adjust row height to match average of rendered elements
22134
- this.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);
22323
+ this.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / totalRowsRendered);
22135
22324
  this.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);
22136
22325
 
22137
22326
  this.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;
@@ -22139,9 +22328,9 @@ class VirtualDomVertical extends Renderer{
22139
22328
  this.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;
22140
22329
  this.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);
22141
22330
  }
22142
-
22143
- element.style.paddingTop = this.vDomTopPad + "px";
22144
- element.style.paddingBottom = this.vDomBottomPad + "px";
22331
+
22332
+ element.style.paddingTop = this.vDomTopPad+"px";
22333
+ element.style.paddingBottom = this.vDomBottomPad+"px";
22145
22334
 
22146
22335
  if(forceMove){
22147
22336
  this.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);
@@ -22444,7 +22633,7 @@ class RowManager extends CoreFeature{
22444
22633
 
22445
22634
  this.dataPipeline = []; //hold data pipeline tasks
22446
22635
  this.displayPipeline = []; //hold data display pipeline tasks
22447
-
22636
+
22448
22637
  this.scrollbarWidth = 0;
22449
22638
 
22450
22639
  this.renderer = null;
@@ -22473,12 +22662,18 @@ class RowManager extends CoreFeature{
22473
22662
 
22474
22663
  initializePlaceholder(){
22475
22664
  var placeholder = this.table.options.placeholder;
22476
-
22665
+
22666
+ if(typeof placeholder === "function"){
22667
+ placeholder = placeholder.call(this.table);
22668
+ }
22669
+
22670
+ placeholder = this.chain("placeholder", [placeholder], placeholder, placeholder) || placeholder;
22671
+
22477
22672
  //configure placeholder element
22478
22673
  if(placeholder){
22479
22674
  let el = document.createElement("div");
22480
22675
  el.classList.add("tabulator-placeholder");
22481
-
22676
+
22482
22677
  if(typeof placeholder == "string"){
22483
22678
  let contents = document.createElement("div");
22484
22679
  contents.classList.add("tabulator-placeholder-contents");
@@ -22494,10 +22689,10 @@ class RowManager extends CoreFeature{
22494
22689
  this.placeholderContents = placeholder;
22495
22690
  }else {
22496
22691
  console.warn("Invalid placeholder provided, must be string or HTML Element", placeholder);
22497
-
22692
+
22498
22693
  this.el = null;
22499
22694
  }
22500
-
22695
+
22501
22696
  this.placeholder = el;
22502
22697
  }
22503
22698
  }
@@ -22658,15 +22853,15 @@ class RowManager extends CoreFeature{
22658
22853
  this.destroy();
22659
22854
 
22660
22855
  this.adjustTableSize();
22661
-
22856
+
22662
22857
  this.dispatch("rows-wiped");
22663
22858
  }
22664
-
22859
+
22665
22860
  destroy(){
22666
22861
  this.rows.forEach((row) => {
22667
22862
  row.wipe();
22668
22863
  });
22669
-
22864
+
22670
22865
  this.rows = [];
22671
22866
  this.activeRows = [];
22672
22867
  this.activeRowsPipeline = [];
@@ -22739,7 +22934,7 @@ class RowManager extends CoreFeature{
22739
22934
  rows.push(row);
22740
22935
  this.dispatch("row-added", row, item, pos, index);
22741
22936
  });
22742
-
22937
+
22743
22938
  this.refreshActiveData(refreshDisplayOnly ? "displayPipeline" : false, false, true);
22744
22939
 
22745
22940
  this.regenerateRowPositions();
@@ -23127,28 +23322,28 @@ class RowManager extends CoreFeature{
23127
23322
 
23128
23323
  for(let i = index; i < this.dataPipeline.length; i++){
23129
23324
  let result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));
23130
-
23325
+
23131
23326
  this.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);
23132
23327
  }
23133
-
23328
+
23134
23329
  this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);
23135
-
23330
+
23136
23331
  case "display":
23137
23332
  index = 0;
23138
23333
  this.resetDisplayRows();
23139
-
23334
+
23140
23335
  case "displayPipeline":
23141
23336
  for(let i = index; i < this.displayPipeline.length; i++){
23142
23337
  let result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);
23143
-
23338
+
23144
23339
  this.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);
23145
23340
  }
23146
23341
 
23147
23342
  case "end":
23148
- //case to handle scenario when trying to skip past end stage
23343
+ //case to handle scenario when trying to skip past end stage
23149
23344
  this.regenerateRowPositions();
23150
23345
  }
23151
-
23346
+
23152
23347
  if(this.getDisplayRows().length){
23153
23348
  this._clearPlaceholder();
23154
23349
  }
@@ -23184,7 +23379,7 @@ class RowManager extends CoreFeature{
23184
23379
  //set display row pipeline data
23185
23380
  setDisplayRows(displayRows, index){
23186
23381
  this.displayRows[index] = displayRows;
23187
-
23382
+
23188
23383
  if(index == this.displayRows.length -1){
23189
23384
  this.displayRowsCount = this.displayRows[this.displayRows.length -1].length;
23190
23385
  }
@@ -23219,7 +23414,7 @@ class RowManager extends CoreFeature{
23219
23414
  //return only actual rows (not group headers etc)
23220
23415
  getRows(type){
23221
23416
  var rows = [];
23222
-
23417
+
23223
23418
  switch(type){
23224
23419
  case "active":
23225
23420
  rows = this.activeRows;
@@ -23228,11 +23423,11 @@ class RowManager extends CoreFeature{
23228
23423
  case "display":
23229
23424
  rows = this.table.rowManager.getDisplayRows();
23230
23425
  break;
23231
-
23426
+
23232
23427
  case "visible":
23233
23428
  rows = this.getVisibleRows(false, true);
23234
23429
  break;
23235
-
23430
+
23236
23431
  default:
23237
23432
  rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
23238
23433
  }
@@ -23253,25 +23448,25 @@ class RowManager extends CoreFeature{
23253
23448
  this.dispatchExternal("renderStarted");
23254
23449
 
23255
23450
  this.renderer.rerenderRows(callback);
23256
-
23451
+
23257
23452
  if(!this.fixedHeight){
23258
23453
  this.adjustTableSize();
23259
23454
  }
23260
-
23455
+
23261
23456
  this.scrollBarCheck();
23262
23457
 
23263
23458
  this.dispatchExternal("renderComplete");
23264
23459
  }
23265
23460
  }
23266
-
23461
+
23267
23462
  scrollBarCheck(){
23268
23463
  var scrollbarWidth = 0;
23269
-
23464
+
23270
23465
  //adjust for vertical scrollbar moving table when present
23271
23466
  if(this.element.scrollHeight > this.element.clientHeight){
23272
23467
  scrollbarWidth = this.element.offsetWidth - this.element.clientWidth;
23273
23468
  }
23274
-
23469
+
23275
23470
  if(scrollbarWidth !== this.scrollbarWidth){
23276
23471
  this.scrollbarWidth = scrollbarWidth;
23277
23472
  this.dispatch("scrollbar-vertical", scrollbarWidth);
@@ -23324,7 +23519,7 @@ class RowManager extends CoreFeature{
23324
23519
 
23325
23520
  if(this.firstRender){
23326
23521
  this.firstRender = false;
23327
-
23522
+
23328
23523
  if(!this.fixedHeight){
23329
23524
  this.adjustTableSize();
23330
23525
  }
@@ -23344,7 +23539,7 @@ class RowManager extends CoreFeature{
23344
23539
  if(!this.displayRowsCount){
23345
23540
  this._showPlaceholder();
23346
23541
  }
23347
-
23542
+
23348
23543
  this.scrollBarCheck();
23349
23544
 
23350
23545
  this.dispatchExternal("renderComplete");
@@ -23369,7 +23564,7 @@ class RowManager extends CoreFeature{
23369
23564
 
23370
23565
  this.renderer.clearRows();
23371
23566
  }
23372
-
23567
+
23373
23568
  tableEmpty(){
23374
23569
  this.renderEmptyScroll();
23375
23570
  this._showPlaceholder();
@@ -23377,6 +23572,12 @@ class RowManager extends CoreFeature{
23377
23572
 
23378
23573
  _showPlaceholder(){
23379
23574
  if(this.placeholder){
23575
+ if(this.placeholder && this.placeholder.parentNode){
23576
+ this.placeholder.parentNode.removeChild(this.placeholder);
23577
+ }
23578
+
23579
+ this.initializePlaceholder();
23580
+
23380
23581
  this.placeholder.setAttribute("tabulator-render-mode", this.renderMode);
23381
23582
 
23382
23583
  this.getElement().appendChild(this.placeholder);
@@ -23388,7 +23589,7 @@ class RowManager extends CoreFeature{
23388
23589
  if(this.placeholder && this.placeholder.parentNode){
23389
23590
  this.placeholder.parentNode.removeChild(this.placeholder);
23390
23591
  }
23391
-
23592
+
23392
23593
  // clear empty table placeholder min
23393
23594
  this.tableElement.style.minWidth = "";
23394
23595
  this.tableElement.style.display = "";
@@ -23423,7 +23624,8 @@ class RowManager extends CoreFeature{
23423
23624
 
23424
23625
  //adjust the height of the table holder to fit in the Tabulator element
23425
23626
  adjustTableSize(){
23426
- var initialHeight = this.element.clientHeight, minHeight;
23627
+ let initialHeight = this.element.clientHeight, minHeight;
23628
+ let resized = false;
23427
23629
 
23428
23630
  if(this.renderer.verticalFillMode === "fill"){
23429
23631
  let otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));
@@ -23431,12 +23633,14 @@ class RowManager extends CoreFeature{
23431
23633
  if(this.fixedHeight){
23432
23634
  minHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + "px";
23433
23635
 
23636
+ const height = "calc(100% - " + otherHeight + "px)";
23434
23637
  this.element.style.minHeight = minHeight || "calc(100% - " + otherHeight + "px)";
23435
- this.element.style.height = "calc(100% - " + otherHeight + "px)";
23436
- this.element.style.maxHeight = "calc(100% - " + otherHeight + "px)";
23437
- }else {
23638
+ this.element.style.height = height;
23639
+ this.element.style.maxHeight = height;
23640
+ } else {
23438
23641
  this.element.style.height = "";
23439
- this.element.style.height = (this.table.element.clientHeight - otherHeight) + "px";
23642
+ this.element.style.height =
23643
+ this.table.element.clientHeight - otherHeight + "px";
23440
23644
  this.element.scrollTop = this.scrollTop;
23441
23645
  }
23442
23646
 
@@ -23444,17 +23648,19 @@ class RowManager extends CoreFeature{
23444
23648
 
23445
23649
  //check if the table has changed size when dealing with variable height tables
23446
23650
  if(!this.fixedHeight && initialHeight != this.element.clientHeight){
23651
+ resized = true;
23447
23652
  if(this.subscribed("table-resize")){
23448
23653
  this.dispatch("table-resize");
23449
23654
  }else {
23450
23655
  this.redraw();
23451
23656
  }
23452
23657
  }
23453
-
23658
+
23454
23659
  this.scrollBarCheck();
23455
23660
  }
23456
23661
 
23457
23662
  this._positionPlaceholder();
23663
+ return resized;
23458
23664
  }
23459
23665
 
23460
23666
  //reinitialize all rows
@@ -23489,15 +23695,14 @@ class RowManager extends CoreFeature{
23489
23695
 
23490
23696
  //redraw table
23491
23697
  redraw (force){
23492
- var left = this.scrollLeft;
23493
-
23494
- this.adjustTableSize();
23495
-
23698
+ const resized = this.adjustTableSize();
23496
23699
  this.table.tableWidth = this.table.element.clientWidth;
23497
23700
 
23498
23701
  if(!force){
23499
- this.reRenderInPosition();
23500
- this.scrollHorizontal(left);
23702
+ if(resized) {
23703
+ this.reRenderInPosition();
23704
+ }
23705
+ this.scrollHorizontal(this.scrollLeft);
23501
23706
  }else {
23502
23707
  this.renderTable();
23503
23708
  }