tabulator-tables 5.6.0 → 5.6.1

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 (64) hide show
  1. package/bower.json +1 -1
  2. package/dist/css/tabulator.css +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +5 -5
  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 +83 -46
  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 +83 -46
  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/RowManager.js +3 -5
  56. package/src/js/core/Tabulator.js +1 -1
  57. package/src/js/core/column/Column.js +4 -0
  58. package/src/js/modules/Edit/Edit.js +16 -6
  59. package/src/js/modules/Edit/defaults/editors/datetime.js +1 -1
  60. package/src/js/modules/Edit/defaults/editors/time.js +3 -1
  61. package/src/js/modules/FrozenColumns/FrozenColumns.js +1 -0
  62. package/src/js/modules/SelectRange/Range.js +18 -11
  63. package/src/js/modules/SelectRange/SelectRange.js +35 -20
  64. package/src/scss/tabulator.scss +7 -7
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.6.0 (c) Oliver Folkerd 2024 */
1
+ /* Tabulator v5.6.1 (c) Oliver Folkerd 2024 */
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) :
@@ -1008,6 +1008,10 @@
1008
1008
  titleElement.focus();
1009
1009
  });
1010
1010
 
1011
+ titleElement.addEventListener("mousedown", (e) => {
1012
+ e.stopPropagation();
1013
+ });
1014
+
1011
1015
  titleElement.addEventListener("change", () => {
1012
1016
  def.title = titleElement.value;
1013
1017
  this.dispatchExternal("columnTitleChanged", this.getComponent());
@@ -5760,13 +5764,11 @@
5760
5764
 
5761
5765
  //redraw table
5762
5766
  redraw (force){
5763
- const resized = this.adjustTableSize();
5767
+ this.adjustTableSize();
5764
5768
  this.table.tableWidth = this.table.element.clientWidth;
5765
5769
 
5766
- if(!force){
5767
- if(resized) {
5768
- this.reRenderInPosition();
5769
- }
5770
+ if(!force){
5771
+ this.reRenderInPosition();
5770
5772
  this.scrollHorizontal(this.scrollLeft);
5771
5773
  }else {
5772
5774
  this.renderTable();
@@ -8733,7 +8735,7 @@
8733
8735
  this.options.height = isNaN(height) ? height : height + "px";
8734
8736
  this.element.style.height = this.options.height;
8735
8737
  this.rowManager.initializeRenderer();
8736
- this.rowManager.redraw();
8738
+ this.rowManager.redraw(true);
8737
8739
  }
8738
8740
 
8739
8741
  //////////////////// Event Bus ///////////////////
@@ -12151,12 +12153,14 @@
12151
12153
  newDatetime = DT.fromFormat(String(cellValue), inputFormat);
12152
12154
  }
12153
12155
 
12154
- cellValue = newDatetime.toFormat("hh:mm");
12156
+ cellValue = newDatetime.toFormat("HH:mm");
12155
12157
 
12156
12158
  }else {
12157
12159
  console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
12158
12160
  }
12159
12161
  }
12162
+
12163
+ console.log("val", cellValue);
12160
12164
 
12161
12165
  input.value = cellValue;
12162
12166
 
@@ -12278,7 +12282,7 @@
12278
12282
  newDatetime = DT.fromFormat(String(cellValue), inputFormat);
12279
12283
  }
12280
12284
 
12281
- cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("hh:mm");
12285
+ cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("HH:mm");
12282
12286
  }else {
12283
12287
  console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js");
12284
12288
  }
@@ -14417,8 +14421,9 @@
14417
14421
  allowEdit = true,
14418
14422
  rendered = function(){},
14419
14423
  element = cell.getElement(),
14424
+ editFinished = false,
14420
14425
  cellEditor, component, params;
14421
-
14426
+
14422
14427
  //prevent editing if another cell is refusing to leave focus (eg. validation fail)
14423
14428
 
14424
14429
  if(this.currentCell){
@@ -14430,13 +14435,15 @@
14430
14435
 
14431
14436
  //handle successful value change
14432
14437
  function success(value){
14433
- if(self.currentCell === cell){
14438
+ if(self.currentCell === cell && !editFinished){
14434
14439
  var valid = self.chain("edit-success", [cell, value], true, true);
14435
-
14440
+
14436
14441
  if(valid === true || self.table.options.validationMode === "highlight"){
14442
+
14443
+ editFinished = true;
14444
+
14437
14445
  self.clearEditor();
14438
14446
 
14439
-
14440
14447
  if(!cell.modules.edit){
14441
14448
  cell.modules.edit = {};
14442
14449
  }
@@ -14448,12 +14455,17 @@
14448
14455
  }
14449
14456
 
14450
14457
  cell.setValue(value, true);
14451
-
14458
+
14452
14459
  return valid === true;
14453
14460
  }else {
14461
+ editFinished = true;
14454
14462
  self.invalidEdit = true;
14455
14463
  self.focusCellNoEvent(cell, true);
14456
14464
  rendered();
14465
+
14466
+ setTimeout(() => {
14467
+ editFinished = false;
14468
+ }, 10);
14457
14469
  return false;
14458
14470
  }
14459
14471
  }
@@ -14461,7 +14473,9 @@
14461
14473
 
14462
14474
  //handle aborted edit
14463
14475
  function cancel(){
14464
- if(self.currentCell === cell){
14476
+ // editFinished = true;
14477
+
14478
+ if(self.currentCell === cell && !editFinished){
14465
14479
  self.cancelEdit();
14466
14480
  }
14467
14481
  }
@@ -17170,6 +17184,7 @@
17170
17184
  this.subscribe("column-deleted", this.reinitializeColumns.bind(this));
17171
17185
  this.subscribe("column-hide", this.reinitializeColumns.bind(this));
17172
17186
  this.subscribe("column-show", this.reinitializeColumns.bind(this));
17187
+ this.subscribe("columns-loaded", this.reinitializeColumns.bind(this));
17173
17188
 
17174
17189
  this.subscribe("table-redraw", this.layout.bind(this));
17175
17190
  this.subscribe("layout-refreshing", this.blockLayout.bind(this));
@@ -26169,6 +26184,13 @@
26169
26184
  this.table = table;
26170
26185
  this.start = {row:0, col:0};
26171
26186
  this.end = {row:0, col:0};
26187
+
26188
+ if(this.rangeManager.rowHeader){
26189
+ this.left = 1;
26190
+ this.right = 1;
26191
+ this.start.col = 1;
26192
+ this.end.col = 1;
26193
+ }
26172
26194
 
26173
26195
  this.initElement();
26174
26196
 
@@ -26228,14 +26250,14 @@
26228
26250
 
26229
26251
  if (element.type === "column") {
26230
26252
  if(this.rangeManager.columnSelection){
26231
- this.setStart(0, element.getPosition() - 2);
26253
+ this.setStart(0, element.getPosition() - 1);
26232
26254
  }
26233
26255
  }else {
26234
26256
  row = element.row.position - 1;
26235
- col = element.column.getPosition() - 2;
26257
+ col = element.column.getPosition() - 1;
26236
26258
 
26237
26259
  if (element.column === this.rangeManager.rowHeader) {
26238
- this.setStart(row, 0);
26260
+ this.setStart(row, 1);
26239
26261
  } else {
26240
26262
  this.setStart(row, col);
26241
26263
  }
@@ -26249,18 +26271,18 @@
26249
26271
  if (element.type === "column") {
26250
26272
  if(this.rangeManager.columnSelection){
26251
26273
  if (this.rangeManager.selecting === "column") {
26252
- this.setEnd(rowsCount - 1, element.getPosition() - 2);
26274
+ this.setEnd(rowsCount - 1, element.getPosition() - 1);
26253
26275
  } else if (this.rangeManager.selecting === "cell") {
26254
- this.setEnd(0, element.getPosition() - 2);
26276
+ this.setEnd(0, element.getPosition() - 1);
26255
26277
  }
26256
26278
  }
26257
26279
  }else {
26258
26280
  row = element.row.position - 1;
26259
- col = element.column.getPosition() - 2;
26281
+ col = element.column.getPosition() - 1;
26260
26282
  isRowHeader = element.column === this.rangeManager.rowHeader;
26261
26283
 
26262
26284
  if (this.rangeManager.selecting === "row") {
26263
- this.setEnd(row, this._getTableColumns().length - 2);
26285
+ this.setEnd(row, this._getTableColumns().length - 1);
26264
26286
  } else if (this.rangeManager.selecting !== "row" && isRowHeader) {
26265
26287
  this.setEnd(row, 0);
26266
26288
  } else if (this.rangeManager.selecting === "column") {
@@ -26342,11 +26364,11 @@
26342
26364
  }
26343
26365
 
26344
26366
  atTopLeft(cell) {
26345
- return cell.row.position - 1 === this.top && cell.column.getPosition() - 2 === this.left;
26367
+ return cell.row.position - 1 === this.top && cell.column.getPosition() - 1 === this.left;
26346
26368
  }
26347
26369
 
26348
26370
  atBottomRight(cell) {
26349
- return cell.row.position - 1 === this.bottom && cell.column.getPosition() - 2 === this.right;
26371
+ return cell.row.position - 1 === this.bottom && cell.column.getPosition() - 1 === this.right;
26350
26372
  }
26351
26373
 
26352
26374
  occupies(cell) {
@@ -26358,7 +26380,7 @@
26358
26380
  }
26359
26381
 
26360
26382
  occupiesColumn(col) {
26361
- return this.left <= col.getPosition() - 2 && col.getPosition() - 2 <= this.right;
26383
+ return this.left <= col.getPosition() - 1 && col.getPosition() - 1 <= this.right;
26362
26384
  }
26363
26385
 
26364
26386
  overlaps(left, top, right, bottom) {
@@ -26427,7 +26449,7 @@
26427
26449
  }
26428
26450
 
26429
26451
  getColumns() {
26430
- return this._getTableColumns().slice(this.left + 1, this.right + 2);
26452
+ return this._getTableColumns().slice(this.left, this.right + 1);
26431
26453
  }
26432
26454
 
26433
26455
  clearValues(){
@@ -26613,7 +26635,7 @@
26613
26635
 
26614
26636
  initializeColumn(column) {
26615
26637
  if(this.columnSelection && column.definition.headerSort && this.options("headerSortClickElement") !== "icon"){
26616
- console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior");
26638
+ console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'.");
26617
26639
  }
26618
26640
 
26619
26641
  if (column.modules.edit) ;
@@ -26908,7 +26930,7 @@
26908
26930
  nextCol = Math.max(nextCol - 1, 0);
26909
26931
  break;
26910
26932
  case "right":
26911
- nextCol = Math.min(nextCol + 1, this.getTableColumns().length - 2);
26933
+ nextCol = Math.min(nextCol + 1, this.getTableColumns().length - 1);
26912
26934
  break;
26913
26935
  case "up":
26914
26936
  nextRow = Math.max(nextRow - 1, 0);
@@ -27002,13 +27024,14 @@
27002
27024
  findJumpCellLeft(rowPos, colPos){
27003
27025
  var row = this.getRowByRangePos(rowPos),
27004
27026
  cells = row.cells.filter((cell) => cell.column.visible),
27005
- isStartingCellEmpty = !cells[colPos + 1].getValue(),
27027
+ isStartingCellEmpty = !cells[colPos].getValue(),
27006
27028
  isLeftOfStartingCellEmpty = cells[colPos] ? !cells[colPos].getValue() : false,
27007
27029
  jumpCol = colPos,
27008
- nextCell = this.findJumpCell(cells.slice(0, colPos), true, isStartingCellEmpty, isLeftOfStartingCellEmpty);
27030
+ targetCells = this.rowHeader ? cells.slice(1, colPos) : cells.slice(0, colPos),
27031
+ nextCell = this.findJumpCell(targetCells, true, isStartingCellEmpty, isLeftOfStartingCellEmpty);
27009
27032
 
27010
27033
  if(nextCell){
27011
- jumpCol = nextCell.column.getPosition() - 2;
27034
+ jumpCol = nextCell.column.getPosition() - 1;
27012
27035
  }
27013
27036
 
27014
27037
  return jumpCol;
@@ -27017,13 +27040,13 @@
27017
27040
  findJumpCellRight(rowPos, colPos){
27018
27041
  var row = this.getRowByRangePos(rowPos),
27019
27042
  cells = row.cells.filter((cell) => cell.column.visible),
27020
- isStartingCellEmpty = !cells[colPos + 1].getValue(),
27021
- isRightOfStartingCellEmpty = cells[colPos + 2] ? !cells[colPos + 2].getValue() : false,
27043
+ isStartingCellEmpty = !cells[colPos].getValue(),
27044
+ isRightOfStartingCellEmpty = cells[colPos + 1] ? !cells[colPos + 1].getValue() : false,
27022
27045
  jumpCol = colPos,
27023
- nextCell = this.findJumpCell(cells.slice(colPos + 2, cells.length), false, isStartingCellEmpty, isRightOfStartingCellEmpty);
27046
+ nextCell = this.findJumpCell(cells.slice(colPos + 1, cells.length), false, isStartingCellEmpty, isRightOfStartingCellEmpty);
27024
27047
 
27025
27048
  if(nextCell){
27026
- jumpCol = nextCell.column.getPosition() - 2;
27049
+ jumpCol = nextCell.column.getPosition() - 1;
27027
27050
  }
27028
27051
 
27029
27052
  return jumpCol;
@@ -27074,8 +27097,13 @@
27074
27097
  range = this.resetRanges();
27075
27098
  this.selecting = "all";
27076
27099
 
27077
- const topLeftCell = this.getCell(0, 0);
27078
- const bottomRightCell = this.getCell(-1, -1);
27100
+ var topLeftCell, bottomRightCell = this.getCell(-1, -1);
27101
+
27102
+ if(this.rowHeader){
27103
+ topLeftCell = this.getCell(0, 1);
27104
+ }else {
27105
+ topLeftCell = this.getCell(0, 0);
27106
+ }
27079
27107
 
27080
27108
  range.setBounds(topLeftCell, bottomRightCell);
27081
27109
  return;
@@ -27099,9 +27127,8 @@
27099
27127
 
27100
27128
  autoScroll(range, row, column) {
27101
27129
  var tableHolder = this.table.rowManager.element,
27102
- rowHeader = this.rowHeader.getElement(),
27103
- rect, view, withinHorizontalView, withinVerticalView;
27104
-
27130
+ rowHeader, rect, view, withinHorizontalView, withinVerticalView;
27131
+
27105
27132
  if (typeof row === 'undefined') {
27106
27133
  row = this.getRowByRangePos(range.end.row).getElement();
27107
27134
  }
@@ -27109,6 +27136,10 @@
27109
27136
  if (typeof column === 'undefined') {
27110
27137
  column = this.getColumnByRangePos(range.end.col).getElement();
27111
27138
  }
27139
+
27140
+ if (this.rowHeader) {
27141
+ rowHeader = this.rowHeader.getElement();
27142
+ }
27112
27143
 
27113
27144
  rect = {
27114
27145
  left: column.offsetLeft,
@@ -27118,11 +27149,15 @@
27118
27149
  };
27119
27150
 
27120
27151
  view = {
27121
- left: tableHolder.scrollLeft + rowHeader.offsetWidth,
27152
+ left: tableHolder.scrollLeft,
27122
27153
  right: Math.ceil(tableHolder.scrollLeft + tableHolder.clientWidth),
27123
27154
  top: tableHolder.scrollTop,
27124
27155
  bottom: tableHolder.scrollTop + tableHolder.offsetHeight - this.table.rowManager.scrollbarWidth,
27125
27156
  };
27157
+
27158
+ if (rowHeader) {
27159
+ view.left += rowHeader.offsetWidth;
27160
+ }
27126
27161
 
27127
27162
  withinHorizontalView = view.left < rect.left && rect.left < view.right && view.left < rect.right && rect.right < view.right;
27128
27163
 
@@ -27130,7 +27165,10 @@
27130
27165
 
27131
27166
  if (!withinHorizontalView) {
27132
27167
  if (rect.left < view.left) {
27133
- tableHolder.scrollLeft = rect.left - rowHeader.offsetWidth;
27168
+ tableHolder.scrollLeft = rect.left;
27169
+ if (rowHeader) {
27170
+ tableHolder.scrollLeft -= rowHeader.offsetWidth;
27171
+ }
27134
27172
  } else if (rect.right > view.right) {
27135
27173
  tableHolder.scrollLeft = rect.right - tableHolder.clientWidth;
27136
27174
  }
@@ -27249,8 +27287,7 @@
27249
27287
  var row;
27250
27288
 
27251
27289
  if (colIdx < 0) {
27252
- colIdx = this.getTableColumns().length + colIdx - 1;
27253
-
27290
+ colIdx = this.getTableColumns().length + colIdx;
27254
27291
  if (colIdx < 0) {
27255
27292
  return null;
27256
27293
  }
@@ -27262,7 +27299,7 @@
27262
27299
 
27263
27300
  row = this.table.rowManager.getRowFromPosition(rowIdx + 1);
27264
27301
 
27265
- return row ? row.getCells(false, true).filter((cell) => cell.column.visible)[colIdx + 1] : null;
27302
+ return row ? row.getCells(false, true).filter((cell) => cell.column.visible)[colIdx] : null;
27266
27303
  }
27267
27304
 
27268
27305
 
@@ -27275,7 +27312,7 @@
27275
27312
  }
27276
27313
 
27277
27314
  getColumnByRangePos(pos) {
27278
- return this.getTableColumns()[pos + 1];
27315
+ return this.getTableColumns()[pos];
27279
27316
  }
27280
27317
 
27281
27318
  getTableRows() {