tabulator-tables 5.2.4 → 5.2.5

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 (33) hide show
  1. package/bower.json +1 -1
  2. package/dist/css/tabulator_bootstrap5.css +41 -32
  3. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  4. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  5. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  6. package/dist/css/tabulator_bulma.css +12 -0
  7. package/dist/css/tabulator_bulma.css.map +1 -1
  8. package/dist/css/tabulator_bulma.min.css +1 -1
  9. package/dist/css/tabulator_bulma.min.css.map +1 -1
  10. package/dist/js/tabulator.js +42 -123
  11. package/dist/js/tabulator.js.map +1 -1
  12. package/dist/js/tabulator.min.js +2 -2
  13. package/dist/js/tabulator.min.js.map +1 -1
  14. package/dist/js/tabulator_esm.js +16 -93
  15. package/dist/js/tabulator_esm.js.map +1 -1
  16. package/dist/js/tabulator_esm.min.js +2 -2
  17. package/dist/js/tabulator_esm.min.js.map +1 -1
  18. package/package.json +1 -1
  19. package/src/js/core/RowManager.js +1 -1
  20. package/src/js/core/cell/Cell.js +1 -2
  21. package/src/js/core/column/Column.js +1 -81
  22. package/src/js/core/rendering/Renderer.js +2 -0
  23. package/src/js/core/tools/Popup.js +6 -0
  24. package/src/js/modules/Download/defaults/downloaders/csv.js +2 -3
  25. package/src/js/modules/Download/defaults/downloaders/pdf.js +2 -3
  26. package/src/js/modules/Edit/List.js +1 -1
  27. package/src/js/modules/Export/Export.js +1 -2
  28. package/src/js/modules/Interaction/Interaction.js +3 -3
  29. package/src/js/modules/Page/Page.js +1 -2
  30. package/src/js/modules/ResizeColumns/ResizeColumns.js +1 -1
  31. package/src/js/modules/Sort/Sort.js +1 -1
  32. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +41 -32
  33. package/src/scss/themes/bulma/tabulator_bulma.scss +47 -32
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.2.4 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.2.5 (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) :
@@ -897,7 +897,6 @@
897
897
  break;
898
898
 
899
899
  case "undefined":
900
- case "null":
901
900
  this.element.innerHTML = "";
902
901
  break;
903
902
 
@@ -1277,7 +1276,6 @@
1277
1276
  }
1278
1277
  }
1279
1278
 
1280
- this.contentElement = this._bindEvents();
1281
1279
  this.contentElement = this._buildColumnHeaderContent();
1282
1280
  this.element.appendChild(this.contentElement);
1283
1281
 
@@ -1288,92 +1286,12 @@
1288
1286
  }
1289
1287
 
1290
1288
  this.dispatch("column-init", this);
1291
- }
1292
- }, {
1293
- key: "_bindEvents",
1294
- value: function _bindEvents() {
1295
- var _this3 = this;
1296
-
1297
- var def = this.definition,
1298
- dblTap,
1299
- tapHold,
1300
- tap; //setup header click event bindings
1301
-
1302
- if (typeof def.headerClick == "function") {
1303
- this.element.addEventListener("click", function (e) {
1304
- def.headerClick(e, _this3.getComponent());
1305
- });
1306
- }
1307
-
1308
- if (typeof def.headerDblClick == "function") {
1309
- this.element.addEventListener("dblclick", function (e) {
1310
- def.headerDblClick(e, _this3.getComponent());
1311
- });
1312
- }
1313
-
1314
- if (typeof def.headerContext == "function") {
1315
- this.element.addEventListener("contextmenu", function (e) {
1316
- def.headerContext(e, _this3.getComponent());
1317
- });
1318
- } //setup header tap event bindings
1319
-
1320
-
1321
- if (typeof def.headerTap == "function") {
1322
- tap = false;
1323
- this.element.addEventListener("touchstart", function (e) {
1324
- tap = true;
1325
- }, {
1326
- passive: true
1327
- });
1328
- this.element.addEventListener("touchend", function (e) {
1329
- if (tap) {
1330
- def.headerTap(e, _this3.getComponent());
1331
- }
1332
-
1333
- tap = false;
1334
- });
1335
- }
1336
-
1337
- if (typeof def.headerDblTap == "function") {
1338
- dblTap = null;
1339
- this.element.addEventListener("touchend", function (e) {
1340
- if (dblTap) {
1341
- clearTimeout(dblTap);
1342
- dblTap = null;
1343
- def.headerDblTap(e, _this3.getComponent());
1344
- } else {
1345
- dblTap = setTimeout(function () {
1346
- clearTimeout(dblTap);
1347
- dblTap = null;
1348
- }, 300);
1349
- }
1350
- });
1351
- }
1352
-
1353
- if (typeof def.headerTapHold == "function") {
1354
- tapHold = null;
1355
- this.element.addEventListener("touchstart", function (e) {
1356
- clearTimeout(tapHold);
1357
- tapHold = setTimeout(function () {
1358
- clearTimeout(tapHold);
1359
- tapHold = null;
1360
- tap = false;
1361
- def.headerTapHold(e, this.getComponent());
1362
- }, 1000);
1363
- }, {
1364
- passive: true
1365
- });
1366
- this.element.addEventListener("touchend", function (e) {
1367
- clearTimeout(tapHold);
1368
- tapHold = null;
1369
- });
1370
- }
1371
1289
  } //build header element for header
1372
1290
 
1373
1291
  }, {
1374
1292
  key: "_buildColumnHeader",
1375
1293
  value: function _buildColumnHeader() {
1376
- var _this4 = this;
1294
+ var _this3 = this;
1377
1295
 
1378
1296
  var def = this.definition,
1379
1297
  table = this.table;
@@ -1391,7 +1309,7 @@
1391
1309
  if (def.cssClass) {
1392
1310
  var classeNames = def.cssClass.split(" ");
1393
1311
  classeNames.forEach(function (className) {
1394
- _this4.element.classList.add(className);
1312
+ _this3.element.classList.add(className);
1395
1313
  });
1396
1314
  }
1397
1315
 
@@ -1434,7 +1352,7 @@
1434
1352
  }, {
1435
1353
  key: "_buildColumnHeaderTitle",
1436
1354
  value: function _buildColumnHeaderTitle() {
1437
- var _this5 = this;
1355
+ var _this4 = this;
1438
1356
 
1439
1357
  var def = this.definition;
1440
1358
  var titleHolderElement = document.createElement("div");
@@ -1450,7 +1368,7 @@
1450
1368
  titleElement.addEventListener("change", function () {
1451
1369
  def.title = titleElement.value;
1452
1370
 
1453
- _this5.dispatchExternal("columnTitleChanged", _this5.getComponent());
1371
+ _this4.dispatchExternal("columnTitleChanged", _this4.getComponent());
1454
1372
  });
1455
1373
  titleHolderElement.appendChild(titleElement);
1456
1374
 
@@ -1464,7 +1382,7 @@
1464
1382
  } else {
1465
1383
  if (def.field) {
1466
1384
  this.langBind("columns|" + def.field, function (text) {
1467
- _this5._formatColumnHeaderTitle(titleHolderElement, text || def.title || " ");
1385
+ _this4._formatColumnHeaderTitle(titleHolderElement, text || def.title || " ");
1468
1386
  });
1469
1387
  } else {
1470
1388
  this._formatColumnHeaderTitle(titleHolderElement, def.title || " ");
@@ -1492,7 +1410,6 @@
1492
1410
  break;
1493
1411
 
1494
1412
  case "undefined":
1495
- case "null":
1496
1413
  el.innerHTML = "";
1497
1414
  break;
1498
1415
 
@@ -1504,7 +1421,7 @@
1504
1421
  }, {
1505
1422
  key: "_buildGroupHeader",
1506
1423
  value: function _buildGroupHeader() {
1507
- var _this6 = this;
1424
+ var _this5 = this;
1508
1425
 
1509
1426
  this.element.classList.add("tabulator-col-group");
1510
1427
  this.element.setAttribute("role", "columngroup");
@@ -1513,7 +1430,7 @@
1513
1430
  if (this.definition.cssClass) {
1514
1431
  var classeNames = this.definition.cssClass.split(" ");
1515
1432
  classeNames.forEach(function (className) {
1516
- _this6.element.classList.add(className);
1433
+ _this5.element.classList.add(className);
1517
1434
  });
1518
1435
  }
1519
1436
 
@@ -1944,40 +1861,40 @@
1944
1861
  }, {
1945
1862
  key: "delete",
1946
1863
  value: function _delete() {
1947
- var _this7 = this;
1864
+ var _this6 = this;
1948
1865
 
1949
1866
  return new Promise(function (resolve, reject) {
1950
1867
 
1951
- if (_this7.isGroup) {
1952
- _this7.columns.forEach(function (column) {
1868
+ if (_this6.isGroup) {
1869
+ _this6.columns.forEach(function (column) {
1953
1870
  column["delete"]();
1954
1871
  });
1955
1872
  }
1956
1873
 
1957
- _this7.dispatch("column-delete", _this7);
1874
+ _this6.dispatch("column-delete", _this6);
1958
1875
 
1959
- var cellCount = _this7.cells.length;
1876
+ var cellCount = _this6.cells.length;
1960
1877
 
1961
1878
  for (var i = 0; i < cellCount; i++) {
1962
- _this7.cells[0]["delete"]();
1879
+ _this6.cells[0]["delete"]();
1963
1880
  }
1964
1881
 
1965
- if (_this7.element.parentNode) {
1966
- _this7.element.parentNode.removeChild(_this7.element);
1882
+ if (_this6.element.parentNode) {
1883
+ _this6.element.parentNode.removeChild(_this6.element);
1967
1884
  }
1968
1885
 
1969
- _this7.element = false;
1970
- _this7.contentElement = false;
1971
- _this7.titleElement = false;
1972
- _this7.groupElement = false;
1886
+ _this6.element = false;
1887
+ _this6.contentElement = false;
1888
+ _this6.titleElement = false;
1889
+ _this6.groupElement = false;
1973
1890
 
1974
- if (_this7.parent.isGroup) {
1975
- _this7.parent.removeChild(_this7);
1891
+ if (_this6.parent.isGroup) {
1892
+ _this6.parent.removeChild(_this6);
1976
1893
  }
1977
1894
 
1978
- _this7.table.columnManager.deregisterColumn(_this7);
1895
+ _this6.table.columnManager.deregisterColumn(_this6);
1979
1896
 
1980
- _this7.table.columnManager.renderer.rerenderColumns(true);
1897
+ _this6.table.columnManager.renderer.rerenderColumns(true);
1981
1898
 
1982
1899
  resolve();
1983
1900
  });
@@ -2078,7 +1995,7 @@
2078
1995
  }, {
2079
1996
  key: "updateDefinition",
2080
1997
  value: function updateDefinition(updates) {
2081
- var _this8 = this;
1998
+ var _this7 = this;
2082
1999
 
2083
2000
  var definition;
2084
2001
 
@@ -2087,11 +2004,11 @@
2087
2004
  definition = Object.assign({}, this.getDefinition());
2088
2005
  definition = Object.assign(definition, updates);
2089
2006
  return this.table.columnManager.addColumn(definition, false, this).then(function (column) {
2090
- if (definition.field == _this8.field) {
2091
- _this8.field = false; //cleair field name to prevent deletion of duplicate column from arrays
2007
+ if (definition.field == _this7.field) {
2008
+ _this7.field = false; //cleair field name to prevent deletion of duplicate column from arrays
2092
2009
  }
2093
2010
 
2094
- return _this8["delete"]().then(function () {
2011
+ return _this7["delete"]().then(function () {
2095
2012
  return column.getComponent();
2096
2013
  });
2097
2014
  });
@@ -2442,6 +2359,8 @@
2442
2359
  _this2.elementVertical.scrollTop = _this2.elementVertical.scrollTop - _this2.elementVertical.clientHeight + rowEl.offsetHeight;
2443
2360
  }
2444
2361
 
2362
+ break;
2363
+
2445
2364
  case "top":
2446
2365
  _this2.elementVertical.scrollTop = rowEl.offsetTop;
2447
2366
  break;
@@ -5103,8 +5022,8 @@
5103
5022
  value: function createHolderElement() {
5104
5023
  var el = document.createElement("div");
5105
5024
  el.classList.add("tabulator-tableholder");
5106
- el.setAttribute("tabindex", 0);
5107
- el.setAttribute("role", "rowgroup");
5025
+ el.setAttribute("tabindex", 0); // el.setAttribute("role", "rowgroup");
5026
+
5108
5027
  return el;
5109
5028
  }
5110
5029
  }, {
@@ -7212,6 +7131,7 @@
7212
7131
 
7213
7132
  _this.blurEvent = _this.hide.bind(_assertThisInitialized(_this), false);
7214
7133
  _this.escEvent = _this._escapeCheck.bind(_assertThisInitialized(_this));
7134
+ _this.destroyBinding = _this.hide.bind(_assertThisInitialized(_this), true);
7215
7135
  return _this;
7216
7136
  }
7217
7137
 
@@ -7344,6 +7264,7 @@
7344
7264
  this._fitToScreen(x, y, parentEl, parentOffset, position);
7345
7265
 
7346
7266
  this.visible = true;
7267
+ this.subscribe("table-destroy", this.destroyBinding);
7347
7268
  return this;
7348
7269
  }
7349
7270
  }, {
@@ -7446,6 +7367,8 @@
7446
7367
  if (this.blurCallback && !silent) {
7447
7368
  this.blurCallback();
7448
7369
  }
7370
+
7371
+ this.unsubscribe("table-destroy", this.destroyBinding);
7449
7372
  }
7450
7373
 
7451
7374
  return this;
@@ -11529,11 +11452,10 @@
11529
11452
  if (col) {
11530
11453
  switch (_typeof(col.value)) {
11531
11454
  case "object":
11532
- col.value = JSON.stringify(col.value);
11455
+ col.value = col.value !== null ? JSON.stringify(col.value) : "";
11533
11456
  break;
11534
11457
 
11535
11458
  case "undefined":
11536
- case "null":
11537
11459
  col.value = "";
11538
11460
  break;
11539
11461
  }
@@ -11647,11 +11569,10 @@
11647
11569
  if (col) {
11648
11570
  switch (_typeof(col.value)) {
11649
11571
  case "object":
11650
- col.value = JSON.stringify(col.value);
11572
+ col.value = col.value !== null ? JSON.stringify(col.value) : "";
11651
11573
  break;
11652
11574
 
11653
11575
  case "undefined":
11654
- case "null":
11655
11576
  col.value = "";
11656
11577
  break;
11657
11578
  }
@@ -12522,7 +12443,7 @@
12522
12443
  this.initialValues = this.params.multiselect ? initialValue : [initialValue];
12523
12444
 
12524
12445
  if (this.isFilter) {
12525
- this.input.value = this.initialValues.join(",");
12446
+ this.input.value = this.initialValues ? this.initialValues.join(",") : "";
12526
12447
  this.headerFilterInitialListGen();
12527
12448
  }
12528
12449
  }
@@ -15170,11 +15091,10 @@
15170
15091
  } else {
15171
15092
  switch (_typeof(value)) {
15172
15093
  case "object":
15173
- value = JSON.stringify(value);
15094
+ value = value !== null ? JSON.stringify(value) : "";
15174
15095
  break;
15175
15096
 
15176
15097
  case "undefined":
15177
- case "null":
15178
15098
  value = "";
15179
15099
  break;
15180
15100
 
@@ -22499,7 +22419,6 @@
22499
22419
  break;
22500
22420
 
22501
22421
  case "undefined":
22502
- case "null":
22503
22422
  this.pageCounterElement.innerHTML = "";
22504
22423
  break;
22505
22424
 
@@ -24155,7 +24074,7 @@
24155
24074
 
24156
24075
  config.handleEl = handle;
24157
24076
 
24158
- if (element.parentNode) {
24077
+ if (element.parentNode && column.visible) {
24159
24078
  element.after(handle);
24160
24079
  }
24161
24080
  }
@@ -26067,7 +25986,7 @@
26067
25986
  key: "setColumnHeader",
26068
25987
  value: function setColumnHeader(column, dir) {
26069
25988
  column.modules.sort.dir = dir;
26070
- column.getElement().setAttribute("aria-sort", dir);
25989
+ column.getElement().setAttribute("aria-sort", dir === "asc" ? "ascending" : "descending");
26071
25990
  } //sort each item in sort list
26072
25991
 
26073
25992
  }, {