tabulator-tables 5.4.2 → 5.4.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 (66) hide show
  1. package/dist/css/tabulator.css +1 -0
  2. package/dist/css/tabulator.css.map +1 -1
  3. package/dist/css/tabulator.min.css +1 -1
  4. package/dist/css/tabulator.min.css.map +1 -1
  5. package/dist/css/tabulator_bootstrap3.css +1 -0
  6. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  7. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  8. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  9. package/dist/css/tabulator_bootstrap4.css +1 -0
  10. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  11. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  12. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  13. package/dist/css/tabulator_bootstrap5.css +1 -0
  14. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  15. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  16. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  17. package/dist/css/tabulator_bulma.css +1 -0
  18. package/dist/css/tabulator_bulma.css.map +1 -1
  19. package/dist/css/tabulator_bulma.min.css +1 -1
  20. package/dist/css/tabulator_bulma.min.css.map +1 -1
  21. package/dist/css/tabulator_materialize.css +1 -0
  22. package/dist/css/tabulator_materialize.css.map +1 -1
  23. package/dist/css/tabulator_materialize.min.css +1 -1
  24. package/dist/css/tabulator_materialize.min.css.map +1 -1
  25. package/dist/css/tabulator_midnight.css +1 -0
  26. package/dist/css/tabulator_midnight.css.map +1 -1
  27. package/dist/css/tabulator_midnight.min.css +1 -1
  28. package/dist/css/tabulator_midnight.min.css.map +1 -1
  29. package/dist/css/tabulator_modern.css +1 -0
  30. package/dist/css/tabulator_modern.css.map +1 -1
  31. package/dist/css/tabulator_modern.min.css +1 -1
  32. package/dist/css/tabulator_modern.min.css.map +1 -1
  33. package/dist/css/tabulator_semanticui.css +1 -0
  34. package/dist/css/tabulator_semanticui.css.map +1 -1
  35. package/dist/css/tabulator_semanticui.min.css +1 -1
  36. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  37. package/dist/css/tabulator_simple.css +1 -0
  38. package/dist/css/tabulator_simple.css.map +1 -1
  39. package/dist/css/tabulator_simple.min.css +1 -1
  40. package/dist/css/tabulator_simple.min.css.map +1 -1
  41. package/dist/css/tabulator_site.css +1 -0
  42. package/dist/css/tabulator_site.css.map +1 -1
  43. package/dist/css/tabulator_site.min.css +1 -1
  44. package/dist/css/tabulator_site.min.css.map +1 -1
  45. package/dist/js/tabulator.js +280 -222
  46. package/dist/js/tabulator.js.map +1 -1
  47. package/dist/js/tabulator.min.js +2 -2
  48. package/dist/js/tabulator.min.js.map +1 -1
  49. package/dist/js/tabulator_esm.js +280 -222
  50. package/dist/js/tabulator_esm.js.map +1 -1
  51. package/dist/js/tabulator_esm.min.js +2 -2
  52. package/dist/js/tabulator_esm.min.js.map +1 -1
  53. package/package.json +1 -1
  54. package/src/js/core/RowManager.js +49 -30
  55. package/src/js/core/Tabulator.js +7 -8
  56. package/src/js/core/tools/Popup.js +1 -1
  57. package/src/js/modules/Edit/List.js +1 -1
  58. package/src/js/modules/Edit/inputMask.js +1 -1
  59. package/src/js/modules/Export/Export.js +151 -145
  60. package/src/js/modules/Filter/Filter.js +11 -8
  61. package/src/js/modules/GroupRows/Group.js +10 -7
  62. package/src/js/modules/GroupRows/GroupRows.js +23 -7
  63. package/src/js/modules/Localize/Localize.js +0 -9
  64. package/src/js/modules/Print/Print.js +15 -2
  65. package/src/js/modules/SelectRow/SelectRow.js +10 -2
  66. package/src/scss/tabulator.scss +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabulator-tables",
3
- "version": "5.4.2",
3
+ "version": "5.4.3",
4
4
  "description": "Interactive table generation JavaScript library",
5
5
  "style": "dist/css/tabulator.css",
6
6
  "main": "dist/js/tabulator.js",
@@ -66,18 +66,32 @@ export default class RowManager extends CoreFeature{
66
66
  }
67
67
 
68
68
  initializePlaceholder(){
69
+ var placeholder = this.table.options.placeholder;
70
+
69
71
  //configure placeholder element
70
- if(typeof this.table.options.placeholder == "string"){
72
+ if(placeholder){
71
73
  let el = document.createElement("div");
72
74
  el.classList.add("tabulator-placeholder");
73
-
74
- let contents = document.createElement("div");
75
- contents.classList.add("tabulator-placeholder-contents");
76
- contents.innerHTML = this.table.options.placeholder;
77
-
78
- el.appendChild(contents);
79
-
80
- this.placeholderContents = contents;
75
+
76
+ if(typeof placeholder == "string"){
77
+ let contents = document.createElement("div");
78
+ contents.classList.add("tabulator-placeholder-contents");
79
+ contents.innerHTML = placeholder;
80
+
81
+ el.appendChild(contents);
82
+
83
+ this.placeholderContents = contents;
84
+
85
+ }else if(typeof HTMLElement !== "undefined" && placeholder instanceof HTMLElement){
86
+
87
+ el.appendChild(placeholder);
88
+ this.placeholderContents = placeholder;
89
+ }else{
90
+ console.warn("Invalid placeholder provided, must be string or HTML Element", placeholder);
91
+
92
+ this.el = null;
93
+ }
94
+
81
95
  this.placeholder = el;
82
96
  }
83
97
  }
@@ -235,18 +249,24 @@ export default class RowManager extends CoreFeature{
235
249
  _wipeElements(){
236
250
  this.dispatch("rows-wipe");
237
251
 
252
+ this.destroy();
253
+
254
+ this.adjustTableSize();
255
+
256
+ this.dispatch("rows-wiped");
257
+ }
258
+
259
+ destroy(){
238
260
  this.rows.forEach((row) => {
239
261
  row.wipe();
240
262
  });
241
-
263
+
242
264
  this.rows = [];
243
265
  this.activeRows = [];
244
266
  this.activeRowsPipeline = [];
245
267
  this.activeRowsCount = 0;
246
268
  this.displayRows = [];
247
269
  this.displayRowsCount = 0;
248
-
249
- this.adjustTableSize();
250
270
  }
251
271
 
252
272
  deleteRow(row, blockRedraw){
@@ -294,7 +314,7 @@ export default class RowManager extends CoreFeature{
294
314
  }
295
315
 
296
316
  //add multiple rows
297
- addRows(data, pos, index){
317
+ addRows(data, pos, index, refreshDisplayOnly){
298
318
  var rows = [];
299
319
 
300
320
  return new Promise((resolve, reject) => {
@@ -313,8 +333,8 @@ export default class RowManager extends CoreFeature{
313
333
  rows.push(row);
314
334
  this.dispatch("row-added", row, data, pos, index);
315
335
  });
316
-
317
- this.refreshActiveData(false, false, true);
336
+
337
+ this.refreshActiveData(refreshDisplayOnly ? "displayPipeline" : false, false, true);
318
338
 
319
339
  this.regenerateRowPositions();
320
340
 
@@ -794,22 +814,21 @@ export default class RowManager extends CoreFeature{
794
814
  getRows(type){
795
815
  var rows = [];
796
816
 
797
- if(!type || type === true){
798
- rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
799
- }else{
800
- switch(type){
801
- case "active":
802
- rows = this.activeRows;
803
- break;
817
+ switch(type){
818
+ case "active":
819
+ rows = this.activeRows;
820
+ break;
821
+
822
+ case "display":
823
+ rows = this.table.rowManager.getDisplayRows();
824
+ break;
804
825
 
805
- case "display":
806
- rows = this.table.rowManager.getDisplayRows();
807
- break;
808
-
809
- case "visible":
810
- rows = this.getVisibleRows(false, true);
811
- break;
812
- }
826
+ case "visible":
827
+ rows = this.getVisibleRows(false, true);
828
+ break;
829
+
830
+ default:
831
+ rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
813
832
  }
814
833
 
815
834
  return rows;
@@ -290,13 +290,7 @@ class Tabulator {
290
290
  this.eventBus.dispatch("table-destroy");
291
291
 
292
292
  //clear row data
293
- this.rowManager.rows.forEach(function(row){
294
- row.wipe();
295
- });
296
-
297
- this.rowManager.rows = [];
298
- this.rowManager.activeRows = [];
299
- this.rowManager.displayRows = [];
293
+ this.rowManager.destroy();
300
294
 
301
295
  //clear DOM
302
296
  while(element.firstChild) element.removeChild(element.firstChild);
@@ -431,7 +425,12 @@ class Tabulator {
431
425
  if(!responses){
432
426
  resolve();
433
427
  }
428
+ })
429
+ .catch((e) => {
430
+ reject("Update Error - Unable to update row", item, e);
434
431
  });
432
+ }else{
433
+ reject("Update Error - Unable to find row", item);
435
434
  }
436
435
  });
437
436
  }else{
@@ -587,7 +586,7 @@ class Tabulator {
587
586
  data = JSON.parse(data);
588
587
  }
589
588
 
590
- return this.rowManager.addRows(data, pos, index)
589
+ return this.rowManager.addRows(data, pos, index, true)
591
590
  .then((rows)=>{
592
591
  return rows[0].getComponent();
593
592
  });
@@ -25,7 +25,7 @@ export default class Popup extends CoreFeature{
25
25
  this.blurEvent = this.hide.bind(this, false);
26
26
  this.escEvent = this._escapeCheck.bind(this);
27
27
 
28
- this.destroyBinding = this.tableDestroyed;
28
+ this.destroyBinding = this.tableDestroyed.bind(this);
29
29
  this.destroyed = false;
30
30
  }
31
31
 
@@ -1006,7 +1006,7 @@ export default class Edit{
1006
1006
  if(this.currentItems[0]){
1007
1007
  output = this.currentItems[0].value;
1008
1008
  }else{
1009
- initialValue = this.initialValues[0];
1009
+ initialValue = Array.isArray(this.initialValues) ? this.initialValues[0] : this.initialValues;
1010
1010
 
1011
1011
  if(initialValue === null || typeof initialValue === "undefined" || initialValue === ""){
1012
1012
  output = initialValue;
@@ -16,7 +16,7 @@ export default function maskInput(el, options){
16
16
  var index = el.value.length,
17
17
  char = e.key;
18
18
 
19
- if(e.keyCode > 46){
19
+ if(e.keyCode > 46 && !e.ctrlKey && !e.metaKey){
20
20
  if(index >= mask.length){
21
21
  e.preventDefault();
22
22
  e.stopPropagation();