tabulator-tables 5.3.2 → 5.3.3

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 (35) hide show
  1. package/bower.json +1 -1
  2. package/dist/css/tabulator_bootstrap3.css +1 -1
  3. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  4. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  5. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  6. package/dist/css/tabulator_bootstrap4.css +4 -4
  7. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  8. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  9. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  10. package/dist/css/tabulator_bootstrap5.css +4 -4
  11. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  13. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  14. package/dist/js/tabulator.js +151 -133
  15. package/dist/js/tabulator.js.map +1 -1
  16. package/dist/js/tabulator.min.js +2 -2
  17. package/dist/js/tabulator.min.js.map +1 -1
  18. package/dist/js/tabulator_esm.js +297 -283
  19. package/dist/js/tabulator_esm.js.map +1 -1
  20. package/dist/js/tabulator_esm.min.js +2 -2
  21. package/dist/js/tabulator_esm.min.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/js/core/ColumnManager.js +5 -1
  24. package/src/js/core/Module.js +54 -23
  25. package/src/js/core/RowManager.js +20 -23
  26. package/src/js/modules/DataTree/DataTree.js +0 -10
  27. package/src/js/modules/GroupRows/Group.js +3 -7
  28. package/src/js/modules/GroupRows/GroupComponent.js +1 -1
  29. package/src/js/modules/GroupRows/GroupRows.js +200 -199
  30. package/src/js/modules/Page/Page.js +2 -12
  31. package/src/js/modules/Persistence/Persistence.js +3 -2
  32. package/src/js/modules/SelectRow/SelectRow.js +8 -4
  33. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +1 -1
  34. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +1 -1
  35. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +1 -1
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.3.2 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.3.3 (c) Oliver Folkerd 2022 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -3325,6 +3325,7 @@
3325
3325
  var minHeight = 0;
3326
3326
 
3327
3327
  if (!this.redrawBlock) {
3328
+ this.element.style.height = "";
3328
3329
  this.columns.forEach(function (column) {
3329
3330
  column.clearVerticalAlign();
3330
3331
  });
@@ -3335,6 +3336,7 @@
3335
3336
  minHeight = height;
3336
3337
  }
3337
3338
  });
3339
+ this.element.style.height = minHeight + "px";
3338
3340
  this.columns.forEach(function (column) {
3339
3341
  column.verticalAlign(_this3.table.options.columnHeaderVertAlign, minHeight);
3340
3342
  });
@@ -5833,11 +5835,6 @@
5833
5835
  this.displayRows = [];
5834
5836
  this.displayRows.push(this.activeRows.slice(0));
5835
5837
  this.displayRowsCount = this.displayRows[0].length;
5836
- }
5837
- }, {
5838
- key: "getNextDisplayIndex",
5839
- value: function getNextDisplayIndex() {
5840
- return this.displayRows.length;
5841
5838
  } //set display row pipeline data
5842
5839
 
5843
5840
  }, {
@@ -5881,23 +5878,24 @@
5881
5878
  }, {
5882
5879
  key: "getRows",
5883
5880
  value: function getRows(type) {
5884
- var rows;
5885
-
5886
- switch (type) {
5887
- case "active":
5888
- rows = this.activeRows;
5889
- break;
5881
+ var rows = [];
5890
5882
 
5891
- case "display":
5892
- rows = this.table.rowManager.getDisplayRows();
5893
- break;
5883
+ if (!type) {
5884
+ rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
5885
+ } else {
5886
+ switch (type) {
5887
+ case "active":
5888
+ rows = this.activeRows;
5889
+ break;
5894
5890
 
5895
- case "visible":
5896
- rows = this.getVisibleRows(false, true);
5897
- break;
5891
+ case "display":
5892
+ rows = this.table.rowManager.getDisplayRows();
5893
+ break;
5898
5894
 
5899
- default:
5900
- rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
5895
+ case "visible":
5896
+ rows = this.getVisibleRows(false, true);
5897
+ break;
5898
+ }
5901
5899
  }
5902
5900
 
5903
5901
  return rows;
@@ -6006,9 +6004,7 @@
6006
6004
  this._clearPlaceholder();
6007
6005
 
6008
6006
  this.scrollTop = 0;
6009
- this.scrollLeft = 0; // clear empty table placeholder min
6010
-
6011
- this.tableElement.style.minWidth = "";
6007
+ this.scrollLeft = 0;
6012
6008
  this.renderer.clearRows();
6013
6009
  }
6014
6010
  }, {
@@ -6025,7 +6021,9 @@
6025
6021
  key: "_clearPlaceholder",
6026
6022
  value: function _clearPlaceholder() {
6027
6023
  if (this.placeholder && this.placeholder.parentNode) {
6028
- this.placeholder.parentNode.removeChild(this.placeholder);
6024
+ this.placeholder.parentNode.removeChild(this.placeholder); // clear empty table placeholder min
6025
+
6026
+ this.tableElement.style.minWidth = "";
6029
6027
  }
6030
6028
  }
6031
6029
  }, {
@@ -7641,6 +7639,41 @@
7641
7639
  this.table.rowManager.registerDisplayPipelineHandler(handler, priority);
7642
7640
  this._handler = handler;
7643
7641
  }
7642
+ }, {
7643
+ key: "displayRows",
7644
+ value: function displayRows(adjust) {
7645
+ var _this3 = this;
7646
+
7647
+ var index = this.table.rowManager.displayRows.length - 1,
7648
+ lookupIndex;
7649
+
7650
+ if (this._handler) {
7651
+ lookupIndex = this.table.rowManager.displayPipeline.findIndex(function (item) {
7652
+ return item.handler === _this3._handler;
7653
+ });
7654
+
7655
+ if (lookupIndex > -1) {
7656
+ index = lookupIndex;
7657
+ }
7658
+ }
7659
+
7660
+ if (adjust) {
7661
+ index = index + adjust;
7662
+ }
7663
+
7664
+ if (this._handler) {
7665
+ if (index > -1) {
7666
+ return this.table.rowManager.getDisplayRows(index);
7667
+ } else {
7668
+ return this.activeRows();
7669
+ }
7670
+ }
7671
+ }
7672
+ }, {
7673
+ key: "activeRows",
7674
+ value: function activeRows() {
7675
+ return this.table.rowManager.activeRows;
7676
+ }
7644
7677
  }, {
7645
7678
  key: "refreshData",
7646
7679
  value: function refreshData(renderInPosition, handler) {
@@ -10984,8 +11017,6 @@
10984
11017
 
10985
11018
  _this.startOpen = function () {};
10986
11019
 
10987
- _this.displayIndex = 0;
10988
-
10989
11020
  _this.registerTableOption("dataTree", false); //enable data tree
10990
11021
 
10991
11022
 
@@ -11299,16 +11330,6 @@
11299
11330
  }
11300
11331
  }
11301
11332
  }
11302
- }, {
11303
- key: "setDisplayIndex",
11304
- value: function setDisplayIndex(index) {
11305
- this.displayIndex = index;
11306
- }
11307
- }, {
11308
- key: "getDisplayIndex",
11309
- value: function getDisplayIndex() {
11310
- return this.displayIndex;
11311
- }
11312
11333
  }, {
11313
11334
  key: "getRows",
11314
11335
  value: function getRows(rows) {
@@ -18275,7 +18296,7 @@
18275
18296
  }, {
18276
18297
  key: "isVisible",
18277
18298
  value: function isVisible() {
18278
- return this._group.visible;
18299
+ return this._group._visible;
18279
18300
  }
18280
18301
  }, {
18281
18302
  key: "show",
@@ -18685,8 +18706,7 @@
18685
18706
  });
18686
18707
  }
18687
18708
 
18688
- this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
18689
- this.groupManager.checkBasicModeGroupHeaderWidth();
18709
+ this.groupManager.updateGroupRows(true);
18690
18710
  } else {
18691
18711
  this.groupManager.updateGroupRows(true);
18692
18712
  }
@@ -18721,8 +18741,7 @@
18721
18741
  });
18722
18742
  }
18723
18743
 
18724
- this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
18725
- this.groupManager.checkBasicModeGroupHeaderWidth();
18744
+ this.groupManager.updateGroupRows(true);
18726
18745
  } else {
18727
18746
  this.groupManager.updateGroupRows(true);
18728
18747
  }
@@ -18947,8 +18966,6 @@
18947
18966
  _this.allowedValues = false;
18948
18967
  _this.groups = {}; //hold row groups
18949
18968
 
18950
- _this.displayIndex = 0; //index in display pipeline
18951
-
18952
18969
  _this.displayHandler = _this.getRows.bind(_assertThisInitialized(_this)); //register table options
18953
18970
 
18954
18971
  _this.registerTableOption("groupBy", false); //enable table grouping and set field to group by
@@ -19119,8 +19136,11 @@
19119
19136
  }, {
19120
19137
  key: "rowSample",
19121
19138
  value: function rowSample(rows, prevValue) {
19122
- var group = this.getGroups(false)[0];
19123
- prevValue.push(group.getRows(false)[0]);
19139
+ if (this.table.options.groupBy) {
19140
+ var group = this.getGroups(false)[0];
19141
+ prevValue.push(group.getRows(false)[0]);
19142
+ }
19143
+
19124
19144
  return prevValue;
19125
19145
  }
19126
19146
  }, {
@@ -19128,40 +19148,43 @@
19128
19148
  value: function virtualRenderFill() {
19129
19149
  var el = this.table.rowManager.tableElement;
19130
19150
  var rows = this.table.rowManager.getVisibleRows();
19131
- rows = rows.filter(function (row) {
19132
- return row.type !== "group";
19133
- });
19134
- el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : ""; // if(this.table.options.groupBy){
19135
- // if(this.layoutMode() != "fitDataFill" && rowsCount == this.table.modules.groupRows.countGroups()){
19136
- // el.style.minWidth = this.table.columnManager.getWidth() + "px";
19137
- // }
19138
- // }
19151
+
19152
+ if (this.table.options.groupBy) {
19153
+ rows = rows.filter(function (row) {
19154
+ return row.type !== "group";
19155
+ });
19156
+ el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : "";
19157
+ } else {
19158
+ return rows;
19159
+ }
19139
19160
  }
19140
19161
  }, {
19141
19162
  key: "rowAddingIndex",
19142
19163
  value: function rowAddingIndex(row, index, top) {
19143
- this.assignRowToGroup(row);
19144
- var groupRows = row.modules.group.rows;
19145
-
19146
- if (groupRows.length > 1) {
19147
- if (!index || index && groupRows.indexOf(index) == -1) {
19148
- if (top) {
19149
- if (groupRows[0] !== row) {
19150
- index = groupRows[0];
19151
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19164
+ if (this.table.options.groupBy) {
19165
+ this.assignRowToGroup(row);
19166
+ var groupRows = row.modules.group.rows;
19167
+
19168
+ if (groupRows.length > 1) {
19169
+ if (!index || index && groupRows.indexOf(index) == -1) {
19170
+ if (top) {
19171
+ if (groupRows[0] !== row) {
19172
+ index = groupRows[0];
19173
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19174
+ }
19175
+ } else {
19176
+ if (groupRows[groupRows.length - 1] !== row) {
19177
+ index = groupRows[groupRows.length - 1];
19178
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19179
+ }
19152
19180
  }
19153
19181
  } else {
19154
- if (groupRows[groupRows.length - 1] !== row) {
19155
- index = groupRows[groupRows.length - 1];
19156
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19157
- }
19182
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19158
19183
  }
19159
- } else {
19160
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
19161
19184
  }
19162
- }
19163
19185
 
19164
- return index;
19186
+ return index;
19187
+ }
19165
19188
  }
19166
19189
  }, {
19167
19190
  key: "trackChanges",
@@ -19243,50 +19266,46 @@
19243
19266
  }, {
19244
19267
  key: "rowMoving",
19245
19268
  value: function rowMoving(from, to, after) {
19246
- if (!after && to instanceof Group) {
19247
- to = this.table.rowManager.prevDisplayRow(from) || to;
19248
- }
19269
+ if (this.table.options.groupBy) {
19270
+ if (!after && to instanceof Group) {
19271
+ to = this.table.rowManager.prevDisplayRow(from) || to;
19272
+ }
19249
19273
 
19250
- var toGroup = to instanceof Group ? to : to.modules.group;
19251
- var fromGroup = from instanceof Group ? from : from.modules.group;
19274
+ var toGroup = to instanceof Group ? to : to.modules.group;
19275
+ var fromGroup = from instanceof Group ? from : from.modules.group;
19252
19276
 
19253
- if (toGroup === fromGroup) {
19254
- this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
19255
- } else {
19256
- if (fromGroup) {
19257
- fromGroup.removeRow(from);
19258
- }
19277
+ if (toGroup === fromGroup) {
19278
+ this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
19279
+ } else {
19280
+ if (fromGroup) {
19281
+ fromGroup.removeRow(from);
19282
+ }
19259
19283
 
19260
- toGroup.insertRow(from, to, after);
19284
+ toGroup.insertRow(from, to, after);
19285
+ }
19261
19286
  }
19262
19287
  }
19263
19288
  }, {
19264
19289
  key: "rowDeleting",
19265
19290
  value: function rowDeleting(row) {
19266
19291
  //remove from group
19267
- if (row.modules.group) {
19292
+ if (this.table.options.groupBy && row.modules.group) {
19268
19293
  row.modules.group.removeRow(row);
19269
19294
  }
19270
19295
  }
19271
19296
  }, {
19272
19297
  key: "rowsUpdated",
19273
19298
  value: function rowsUpdated(row) {
19274
- this.updateGroupRows(true);
19299
+ if (this.table.options.groupBy) {
19300
+ this.updateGroupRows(true);
19301
+ }
19275
19302
  }
19276
19303
  }, {
19277
19304
  key: "cellUpdated",
19278
19305
  value: function cellUpdated(cell) {
19279
- this.reassignRowToGroup(cell.row);
19280
- }
19281
- }, {
19282
- key: "setDisplayIndex",
19283
- value: function setDisplayIndex(index) {
19284
- this.displayIndex = index;
19285
- }
19286
- }, {
19287
- key: "getDisplayIndex",
19288
- value: function getDisplayIndex() {
19289
- return this.displayIndex;
19306
+ if (this.table.options.groupBy) {
19307
+ this.reassignRowToGroup(cell.row);
19308
+ }
19290
19309
  } //return appropriate rows with group headers
19291
19310
 
19292
19311
  }, {
@@ -19337,9 +19356,11 @@
19337
19356
  }, {
19338
19357
  key: "wipe",
19339
19358
  value: function wipe() {
19340
- this.groupList.forEach(function (group) {
19341
- group.wipe();
19342
- });
19359
+ if (this.table.options.groupBy) {
19360
+ this.groupList.forEach(function (group) {
19361
+ group.wipe();
19362
+ });
19363
+ }
19343
19364
  }
19344
19365
  }, {
19345
19366
  key: "pullGroupListData",
@@ -19504,14 +19525,16 @@
19504
19525
  }, {
19505
19526
  key: "scrollHeaders",
19506
19527
  value: function scrollHeaders(left) {
19507
- if (this.table.options.renderHorizontal === "virtual") {
19508
- left -= this.table.columnManager.renderer.vDomPadLeft;
19509
- }
19528
+ if (this.table.options.groupBy) {
19529
+ if (this.table.options.renderHorizontal === "virtual") {
19530
+ left -= this.table.columnManager.renderer.vDomPadLeft;
19531
+ }
19510
19532
 
19511
- left = left + "px";
19512
- this.groupList.forEach(function (group) {
19513
- group.scrollHeader(left);
19514
- });
19533
+ left = left + "px";
19534
+ this.groupList.forEach(function (group) {
19535
+ group.scrollHeader(left);
19536
+ });
19537
+ }
19515
19538
  }
19516
19539
  }, {
19517
19540
  key: "removeGroup",
@@ -22459,8 +22482,6 @@
22459
22482
  _this.count = 5;
22460
22483
  _this.max = 1;
22461
22484
  _this.remoteRowCountEstimate = null;
22462
- _this.displayIndex = 0; //index in display pipeline
22463
-
22464
22485
  _this.initialLoad = true;
22465
22486
  _this.dataChanging = false; //flag to check if data is being changed by this module
22466
22487
 
@@ -22932,16 +22953,6 @@
22932
22953
  key: "trackChanges",
22933
22954
  value: function trackChanges() {
22934
22955
  this.dispatch("page-changed");
22935
- }
22936
- }, {
22937
- key: "setDisplayIndex",
22938
- value: function setDisplayIndex(index) {
22939
- this.displayIndex = index;
22940
- }
22941
- }, {
22942
- key: "getDisplayIndex",
22943
- value: function getDisplayIndex() {
22944
- return this.displayIndex;
22945
22956
  } //calculate maximum page from number of rows
22946
22957
 
22947
22958
  }, {
@@ -23011,7 +23022,7 @@
23011
23022
  }, {
23012
23023
  key: "setPageToRow",
23013
23024
  value: function setPageToRow(row) {
23014
- var rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);
23025
+ var rows = this.displayRows(-1);
23015
23026
  var index = rows.indexOf(row);
23016
23027
 
23017
23028
  if (index > -1) {
@@ -23621,6 +23632,8 @@
23621
23632
  }, {
23622
23633
  key: "initializeColumn",
23623
23634
  value: function initializeColumn(column) {
23635
+ var _this2 = this;
23636
+
23624
23637
  var def, keys;
23625
23638
 
23626
23639
  if (this.config.columns) {
@@ -23636,8 +23649,8 @@
23636
23649
  set: function set(newValue) {
23637
23650
  value = newValue;
23638
23651
 
23639
- if (!this.defWatcherBlock) {
23640
- this.save("columns");
23652
+ if (!_this2.defWatcherBlock) {
23653
+ _this2.save("columns");
23641
23654
  }
23642
23655
 
23643
23656
  if (props.set) {
@@ -23679,20 +23692,20 @@
23679
23692
  }, {
23680
23693
  key: "mergeDefinition",
23681
23694
  value: function mergeDefinition(oldCols, newCols) {
23682
- var _this2 = this;
23695
+ var _this3 = this;
23683
23696
 
23684
23697
  var output = [];
23685
23698
  newCols = newCols || [];
23686
23699
  newCols.forEach(function (column, to) {
23687
- var from = _this2._findColumn(oldCols, column),
23700
+ var from = _this3._findColumn(oldCols, column),
23688
23701
  keys;
23689
23702
 
23690
23703
  if (from) {
23691
- if (_this2.config.columns === true || _this2.config.columns == undefined) {
23704
+ if (_this3.config.columns === true || _this3.config.columns == undefined) {
23692
23705
  keys = Object.keys(from);
23693
23706
  keys.push("width");
23694
23707
  } else {
23695
- keys = _this2.config.columns;
23708
+ keys = _this3.config.columns;
23696
23709
  }
23697
23710
 
23698
23711
  keys.forEach(function (key) {
@@ -23702,14 +23715,14 @@
23702
23715
  });
23703
23716
 
23704
23717
  if (from.columns) {
23705
- from.columns = _this2.mergeDefinition(from.columns, column.columns);
23718
+ from.columns = _this3.mergeDefinition(from.columns, column.columns);
23706
23719
  }
23707
23720
 
23708
23721
  output.push(from);
23709
23722
  }
23710
23723
  });
23711
23724
  oldCols.forEach(function (column, i) {
23712
- var from = _this2._findColumn(newCols, column);
23725
+ var from = _this3._findColumn(newCols, column);
23713
23726
 
23714
23727
  if (!from) {
23715
23728
  if (output.length > i) {
@@ -23823,7 +23836,7 @@
23823
23836
  }, {
23824
23837
  key: "parseColumns",
23825
23838
  value: function parseColumns(columns) {
23826
- var _this3 = this;
23839
+ var _this4 = this;
23827
23840
 
23828
23841
  var definitions = [],
23829
23842
  excludedKeys = ["headerContextMenu", "headerMenu", "contextMenu", "clickMenu"];
@@ -23834,16 +23847,16 @@
23834
23847
 
23835
23848
  if (column.isGroup) {
23836
23849
  defStore.title = colDef.title;
23837
- defStore.columns = _this3.parseColumns(column.getColumns());
23850
+ defStore.columns = _this4.parseColumns(column.getColumns());
23838
23851
  } else {
23839
23852
  defStore.field = column.getField();
23840
23853
 
23841
- if (_this3.config.columns === true || _this3.config.columns == undefined) {
23854
+ if (_this4.config.columns === true || _this4.config.columns == undefined) {
23842
23855
  keys = Object.keys(colDef);
23843
23856
  keys.push("width");
23844
23857
  keys.push("visible");
23845
23858
  } else {
23846
- keys = _this3.config.columns;
23859
+ keys = _this4.config.columns;
23847
23860
  }
23848
23861
 
23849
23862
  keys.forEach(function (key) {
@@ -25837,13 +25850,18 @@
25837
25850
 
25838
25851
  if (rowMatch) {
25839
25852
  this._selectRow(rowMatch, true, true);
25853
+
25854
+ this._rowSelectionChanged();
25840
25855
  } else {
25841
- this.table.rowManager.getRows(rows).forEach(function (row) {
25856
+ rowMatch = this.table.rowManager.getRows(rows);
25857
+ rowMatch.forEach(function (row) {
25842
25858
  _this3._selectRow(row, true, true);
25843
25859
  });
25844
- }
25845
25860
 
25846
- this._rowSelectionChanged();
25861
+ if (rowMatch.length) {
25862
+ this._rowSelectionChanged();
25863
+ }
25864
+ }
25847
25865
 
25848
25866
  break;
25849
25867