tabulator-tables 5.4.1 → 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.
- package/bower.json +1 -1
- package/dist/css/tabulator.css +1 -0
- package/dist/css/tabulator.css.map +1 -1
- package/dist/css/tabulator.min.css +1 -1
- package/dist/css/tabulator.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap3.css +1 -0
- package/dist/css/tabulator_bootstrap3.css.map +1 -1
- package/dist/css/tabulator_bootstrap3.min.css +1 -1
- package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap4.css +1 -0
- package/dist/css/tabulator_bootstrap4.css.map +1 -1
- package/dist/css/tabulator_bootstrap4.min.css +1 -1
- package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap5.css +1 -0
- package/dist/css/tabulator_bootstrap5.css.map +1 -1
- package/dist/css/tabulator_bootstrap5.min.css +1 -1
- package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
- package/dist/css/tabulator_bulma.css +1 -0
- package/dist/css/tabulator_bulma.css.map +1 -1
- package/dist/css/tabulator_bulma.min.css +1 -1
- package/dist/css/tabulator_bulma.min.css.map +1 -1
- package/dist/css/tabulator_materialize.css +1 -0
- package/dist/css/tabulator_materialize.css.map +1 -1
- package/dist/css/tabulator_materialize.min.css +1 -1
- package/dist/css/tabulator_materialize.min.css.map +1 -1
- package/dist/css/tabulator_midnight.css +1 -0
- package/dist/css/tabulator_midnight.css.map +1 -1
- package/dist/css/tabulator_midnight.min.css +1 -1
- package/dist/css/tabulator_midnight.min.css.map +1 -1
- package/dist/css/tabulator_modern.css +1 -0
- package/dist/css/tabulator_modern.css.map +1 -1
- package/dist/css/tabulator_modern.min.css +1 -1
- package/dist/css/tabulator_modern.min.css.map +1 -1
- package/dist/css/tabulator_semanticui.css +1 -0
- package/dist/css/tabulator_semanticui.css.map +1 -1
- package/dist/css/tabulator_semanticui.min.css +1 -1
- package/dist/css/tabulator_semanticui.min.css.map +1 -1
- package/dist/css/tabulator_simple.css +1 -0
- package/dist/css/tabulator_simple.css.map +1 -1
- package/dist/css/tabulator_simple.min.css +1 -1
- package/dist/css/tabulator_simple.min.css.map +1 -1
- package/dist/css/tabulator_site.css +1 -0
- package/dist/css/tabulator_site.css.map +1 -1
- package/dist/css/tabulator_site.min.css +1 -1
- package/dist/css/tabulator_site.min.css.map +1 -1
- package/dist/js/tabulator.js +323 -241
- package/dist/js/tabulator.js.map +1 -1
- package/dist/js/tabulator.min.js +2 -2
- package/dist/js/tabulator.min.js.map +1 -1
- package/dist/js/tabulator_esm.js +323 -241
- package/dist/js/tabulator_esm.js.map +1 -1
- package/dist/js/tabulator_esm.min.js +2 -2
- package/dist/js/tabulator_esm.min.js.map +1 -1
- package/package.json +2 -2
- package/src/js/core/ColumnManager.js +3 -5
- package/src/js/core/RowManager.js +49 -30
- package/src/js/core/Tabulator.js +7 -8
- package/src/js/core/column/Column.js +10 -0
- package/src/js/core/tools/Popup.js +1 -1
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +10 -0
- package/src/js/modules/Edit/List.js +1 -1
- package/src/js/modules/Edit/inputMask.js +1 -1
- package/src/js/modules/Export/Export.js +151 -145
- package/src/js/modules/Filter/Filter.js +11 -8
- package/src/js/modules/GroupRows/Group.js +23 -18
- package/src/js/modules/GroupRows/GroupRows.js +29 -9
- package/src/js/modules/Localize/Localize.js +0 -9
- package/src/js/modules/MoveColumns/MoveColumns.js +1 -1
- package/src/js/modules/Print/Print.js +15 -2
- package/src/js/modules/SelectRow/SelectRow.js +10 -2
- 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.
|
|
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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"eslint-plugin-only-warn": "^1.0.3",
|
|
54
54
|
"fs-extra": "^9.0.1",
|
|
55
55
|
"globby": "^11.0.2",
|
|
56
|
-
"node-sass": "^
|
|
56
|
+
"node-sass": "^7.0.3",
|
|
57
57
|
"postcss": "^8.2.4",
|
|
58
58
|
"postcss-prettify": "^0.3.4",
|
|
59
59
|
"rollup": "^2.36.1",
|
|
@@ -535,10 +535,11 @@ export default class ColumnManager extends CoreFeature {
|
|
|
535
535
|
|
|
536
536
|
scrollToColumn(column, position, ifVisible){
|
|
537
537
|
var left = 0,
|
|
538
|
-
offset =
|
|
538
|
+
offset = column.getLeftOffset(),
|
|
539
539
|
adjust = 0,
|
|
540
540
|
colEl = column.getElement();
|
|
541
541
|
|
|
542
|
+
|
|
542
543
|
return new Promise((resolve, reject) => {
|
|
543
544
|
|
|
544
545
|
if(typeof position === "undefined"){
|
|
@@ -565,16 +566,13 @@ export default class ColumnManager extends CoreFeature {
|
|
|
565
566
|
|
|
566
567
|
//check column visibility
|
|
567
568
|
if(!ifVisible){
|
|
568
|
-
|
|
569
|
-
offset = colEl.offsetLeft;
|
|
570
|
-
|
|
571
569
|
if(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){
|
|
572
570
|
return false;
|
|
573
571
|
}
|
|
574
572
|
}
|
|
575
573
|
|
|
576
574
|
//calculate scroll position
|
|
577
|
-
left =
|
|
575
|
+
left = offset + adjust;
|
|
578
576
|
|
|
579
577
|
left = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);
|
|
580
578
|
|
|
@@ -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(
|
|
72
|
+
if(placeholder){
|
|
71
73
|
let el = document.createElement("div");
|
|
72
74
|
el.classList.add("tabulator-placeholder");
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
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
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
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;
|
package/src/js/core/Tabulator.js
CHANGED
|
@@ -290,13 +290,7 @@ class Tabulator {
|
|
|
290
290
|
this.eventBus.dispatch("table-destroy");
|
|
291
291
|
|
|
292
292
|
//clear row data
|
|
293
|
-
this.rowManager.
|
|
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
|
});
|
|
@@ -721,6 +721,16 @@ class Column extends CoreFeature{
|
|
|
721
721
|
return width;
|
|
722
722
|
}
|
|
723
723
|
|
|
724
|
+
getLeftOffset(){
|
|
725
|
+
var offset = this.element.offsetLeft;
|
|
726
|
+
|
|
727
|
+
if(this.parent.isGroup){
|
|
728
|
+
offset += this.parent.getLeftOffset();
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
return offset;
|
|
732
|
+
}
|
|
733
|
+
|
|
724
734
|
getHeight(){
|
|
725
735
|
return Math.ceil(this.element.getBoundingClientRect().height);
|
|
726
736
|
}
|
|
@@ -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
|
|
|
@@ -250,6 +250,16 @@ class ColumnCalcs extends Module{
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
reinitializeCalcs(){
|
|
254
|
+
if(this.topCalcs.length){
|
|
255
|
+
this.initializeTopRow();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if(this.botCalcs.length){
|
|
259
|
+
this.initializeBottomRow();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
253
263
|
initializeTopRow(){
|
|
254
264
|
if(!this.topInitialized){
|
|
255
265
|
this.table.columnManager.getContentsElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);
|
|
@@ -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;
|