tabulator-tables 5.3.1 → 5.3.2
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/js/tabulator.js +73 -83
- 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 +80 -92
- 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 +1 -1
- package/src/js/core/ColumnManager.js +2 -2
- package/src/js/core/RowManager.js +61 -71
- package/src/js/core/Tabulator.js +2 -2
- package/src/js/core/tools/InteractionMonitor.js +9 -8
- package/src/js/modules/Interaction/Interaction.js +1 -1
- package/src/js/modules/Sort/Sort.js +4 -7
package/bower.json
CHANGED
package/dist/js/tabulator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Tabulator v5.3.
|
|
1
|
+
/* Tabulator v5.3.2 (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) :
|
|
@@ -3479,13 +3479,13 @@
|
|
|
3479
3479
|
}, {
|
|
3480
3480
|
key: "moveColumn",
|
|
3481
3481
|
value: function moveColumn(from, to, after) {
|
|
3482
|
-
this.moveColumnActual(from, to, after);
|
|
3483
3482
|
to.element.parentNode.insertBefore(from.element, to.element);
|
|
3484
3483
|
|
|
3485
3484
|
if (after) {
|
|
3486
3485
|
to.element.parentNode.insertBefore(to.element, from.element);
|
|
3487
3486
|
}
|
|
3488
3487
|
|
|
3488
|
+
this.moveColumnActual(from, to, after);
|
|
3489
3489
|
this.verticalAlignHeaders();
|
|
3490
3490
|
this.table.rowManager.reinitialize();
|
|
3491
3491
|
}
|
|
@@ -5692,80 +5692,82 @@
|
|
|
5692
5692
|
index = 0,
|
|
5693
5693
|
cascadeOrder = ["all", "dataPipeline", "display", "displayPipeline", "end"];
|
|
5694
5694
|
|
|
5695
|
-
if (
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
});
|
|
5699
|
-
|
|
5700
|
-
if (index > -1) {
|
|
5701
|
-
stage = "dataPipeline";
|
|
5702
|
-
|
|
5703
|
-
if (skipStage) {
|
|
5704
|
-
if (index == this.dataPipeline.length - 1) {
|
|
5705
|
-
stage = "display";
|
|
5706
|
-
} else {
|
|
5707
|
-
index++;
|
|
5708
|
-
}
|
|
5709
|
-
}
|
|
5710
|
-
} else {
|
|
5711
|
-
index = this.displayPipeline.findIndex(function (item) {
|
|
5695
|
+
if (!this.table.destroyed) {
|
|
5696
|
+
if (typeof handler === "function") {
|
|
5697
|
+
index = this.dataPipeline.findIndex(function (item) {
|
|
5712
5698
|
return item.handler === handler;
|
|
5713
5699
|
});
|
|
5714
5700
|
|
|
5715
5701
|
if (index > -1) {
|
|
5716
|
-
stage = "
|
|
5702
|
+
stage = "dataPipeline";
|
|
5717
5703
|
|
|
5718
5704
|
if (skipStage) {
|
|
5719
|
-
if (index == this.
|
|
5720
|
-
stage = "
|
|
5705
|
+
if (index == this.dataPipeline.length - 1) {
|
|
5706
|
+
stage = "display";
|
|
5721
5707
|
} else {
|
|
5722
5708
|
index++;
|
|
5723
5709
|
}
|
|
5724
5710
|
}
|
|
5725
5711
|
} else {
|
|
5726
|
-
|
|
5727
|
-
|
|
5712
|
+
index = this.displayPipeline.findIndex(function (item) {
|
|
5713
|
+
return item.handler === handler;
|
|
5714
|
+
});
|
|
5715
|
+
|
|
5716
|
+
if (index > -1) {
|
|
5717
|
+
stage = "displayPipeline";
|
|
5718
|
+
|
|
5719
|
+
if (skipStage) {
|
|
5720
|
+
if (index == this.displayPipeline.length - 1) {
|
|
5721
|
+
stage = "end";
|
|
5722
|
+
} else {
|
|
5723
|
+
index++;
|
|
5724
|
+
}
|
|
5725
|
+
}
|
|
5726
|
+
} else {
|
|
5727
|
+
console.error("Unable to refresh data, invalid handler provided", handler);
|
|
5728
|
+
return;
|
|
5729
|
+
}
|
|
5728
5730
|
}
|
|
5731
|
+
} else {
|
|
5732
|
+
stage = handler || "all";
|
|
5733
|
+
index = 0;
|
|
5729
5734
|
}
|
|
5730
|
-
} else {
|
|
5731
|
-
stage = handler || "all";
|
|
5732
|
-
index = 0;
|
|
5733
|
-
}
|
|
5734
5735
|
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5736
|
+
if (this.redrawBlock) {
|
|
5737
|
+
if (!this.redrawBlockRestoreConfig || this.redrawBlockRestoreConfig && (this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index || cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))) {
|
|
5738
|
+
this.redrawBlockRestoreConfig = {
|
|
5739
|
+
handler: handler,
|
|
5740
|
+
skipStage: skipStage,
|
|
5741
|
+
renderInPosition: renderInPosition,
|
|
5742
|
+
stage: stage,
|
|
5743
|
+
index: index
|
|
5744
|
+
};
|
|
5745
|
+
}
|
|
5745
5746
|
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5747
|
+
return;
|
|
5748
|
+
} else {
|
|
5749
|
+
if (Helpers.elVisible(this.element)) {
|
|
5750
|
+
if (renderInPosition) {
|
|
5751
|
+
this.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));
|
|
5752
|
+
} else {
|
|
5753
|
+
this.refreshPipelines(handler, stage, index, renderInPosition);
|
|
5753
5754
|
|
|
5754
|
-
|
|
5755
|
-
|
|
5756
|
-
|
|
5755
|
+
if (!handler) {
|
|
5756
|
+
this.table.columnManager.renderer.renderColumns();
|
|
5757
|
+
}
|
|
5757
5758
|
|
|
5758
|
-
|
|
5759
|
+
this.renderTable();
|
|
5759
5760
|
|
|
5760
|
-
|
|
5761
|
-
|
|
5761
|
+
if (table.options.layoutColumnsOnNewData) {
|
|
5762
|
+
this.table.columnManager.redraw(true);
|
|
5763
|
+
}
|
|
5762
5764
|
}
|
|
5765
|
+
} else {
|
|
5766
|
+
this.refreshPipelines(handler, stage, index, renderInPosition);
|
|
5763
5767
|
}
|
|
5764
|
-
} else {
|
|
5765
|
-
this.refreshPipelines(handler, stage, index, renderInPosition);
|
|
5766
|
-
}
|
|
5767
5768
|
|
|
5768
|
-
|
|
5769
|
+
this.dispatch("data-refreshed");
|
|
5770
|
+
}
|
|
5769
5771
|
}
|
|
5770
5772
|
}
|
|
5771
5773
|
}, {
|
|
@@ -5841,21 +5843,11 @@
|
|
|
5841
5843
|
}, {
|
|
5842
5844
|
key: "setDisplayRows",
|
|
5843
5845
|
value: function setDisplayRows(displayRows, index) {
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
if (index && typeof this.displayRows[index] != "undefined") {
|
|
5847
|
-
this.displayRows[index] = displayRows;
|
|
5848
|
-
output = true;
|
|
5849
|
-
} else {
|
|
5850
|
-
this.displayRows.push(displayRows);
|
|
5851
|
-
output = index = this.displayRows.length - 1;
|
|
5852
|
-
}
|
|
5846
|
+
this.displayRows[index] = displayRows;
|
|
5853
5847
|
|
|
5854
5848
|
if (index == this.displayRows.length - 1) {
|
|
5855
5849
|
this.displayRowsCount = this.displayRows[this.displayRows.length - 1].length;
|
|
5856
5850
|
}
|
|
5857
|
-
|
|
5858
|
-
return output;
|
|
5859
5851
|
}
|
|
5860
5852
|
}, {
|
|
5861
5853
|
key: "getDisplayRows",
|
|
@@ -6547,6 +6539,7 @@
|
|
|
6547
6539
|
//ensure row component is looked up before cell
|
|
6548
6540
|
var keys = Object.keys(targets).reverse(),
|
|
6549
6541
|
listener = this.listeners[type],
|
|
6542
|
+
matches = {},
|
|
6550
6543
|
targetMatches = {};
|
|
6551
6544
|
|
|
6552
6545
|
var _iterator4 = _createForOfIteratorHelper(keys),
|
|
@@ -6555,9 +6548,9 @@
|
|
|
6555
6548
|
try {
|
|
6556
6549
|
var _loop = function _loop() {
|
|
6557
6550
|
var key = _step4.value;
|
|
6558
|
-
var component = void 0
|
|
6559
|
-
|
|
6560
|
-
|
|
6551
|
+
var component = void 0,
|
|
6552
|
+
target = targets[key],
|
|
6553
|
+
previousTarget = _this5.previousTargets[key];
|
|
6561
6554
|
|
|
6562
6555
|
if (previousTarget && previousTarget.target === target) {
|
|
6563
6556
|
component = previousTarget.component;
|
|
@@ -6588,8 +6581,8 @@
|
|
|
6588
6581
|
|
|
6589
6582
|
case "cell":
|
|
6590
6583
|
if (listener.components.includes("cell")) {
|
|
6591
|
-
if (
|
|
6592
|
-
component =
|
|
6584
|
+
if (matches["row"] instanceof Row) {
|
|
6585
|
+
component = matches["row"].findCell(target);
|
|
6593
6586
|
} else {
|
|
6594
6587
|
if (targets["row"]) {
|
|
6595
6588
|
console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?");
|
|
@@ -6602,7 +6595,7 @@
|
|
|
6602
6595
|
}
|
|
6603
6596
|
|
|
6604
6597
|
if (component) {
|
|
6605
|
-
|
|
6598
|
+
matches[key] = component;
|
|
6606
6599
|
targetMatches[key] = {
|
|
6607
6600
|
target: target,
|
|
6608
6601
|
component: component
|
|
@@ -6620,7 +6613,7 @@
|
|
|
6620
6613
|
}
|
|
6621
6614
|
|
|
6622
6615
|
this.previousTargets = targetMatches;
|
|
6623
|
-
return
|
|
6616
|
+
return matches;
|
|
6624
6617
|
}
|
|
6625
6618
|
}, {
|
|
6626
6619
|
key: "triggerEvents",
|
|
@@ -8923,7 +8916,7 @@
|
|
|
8923
8916
|
data = JSON.parse(data);
|
|
8924
8917
|
}
|
|
8925
8918
|
|
|
8926
|
-
if (data) {
|
|
8919
|
+
if (data && data.length > 0) {
|
|
8927
8920
|
data.forEach(function (item) {
|
|
8928
8921
|
var row = _this2.rowManager.findRow(item[_this2.options.index]);
|
|
8929
8922
|
|
|
@@ -8987,7 +8980,7 @@
|
|
|
8987
8980
|
data = JSON.parse(data);
|
|
8988
8981
|
}
|
|
8989
8982
|
|
|
8990
|
-
if (data) {
|
|
8983
|
+
if (data && data.length > 0) {
|
|
8991
8984
|
data.forEach(function (item) {
|
|
8992
8985
|
var row = _this4.rowManager.findRow(item[_this4.options.index]);
|
|
8993
8986
|
|
|
@@ -20423,7 +20416,7 @@
|
|
|
20423
20416
|
var range;
|
|
20424
20417
|
|
|
20425
20418
|
if (this.table.modExists("edit")) {
|
|
20426
|
-
if (this.table.modules.edit.currentCell ===
|
|
20419
|
+
if (this.table.modules.edit.currentCell === cell) {
|
|
20427
20420
|
return; //prevent instant selection of editor content
|
|
20428
20421
|
}
|
|
20429
20422
|
}
|
|
@@ -26544,13 +26537,10 @@
|
|
|
26544
26537
|
|
|
26545
26538
|
if (match > -1) {
|
|
26546
26539
|
sorters[match].dir = dir;
|
|
26540
|
+
match = sorters.splice(match, 1)[0];
|
|
26547
26541
|
|
|
26548
|
-
if (
|
|
26549
|
-
|
|
26550
|
-
|
|
26551
|
-
if (dir != "none") {
|
|
26552
|
-
sorters.push(match);
|
|
26553
|
-
}
|
|
26542
|
+
if (dir != "none") {
|
|
26543
|
+
sorters.push(match);
|
|
26554
26544
|
}
|
|
26555
26545
|
} else {
|
|
26556
26546
|
if (dir != "none") {
|
|
@@ -26775,7 +26765,7 @@
|
|
|
26775
26765
|
var sortEl = column.modules.sort.element,
|
|
26776
26766
|
arrowEl;
|
|
26777
26767
|
|
|
26778
|
-
if (typeof this.table.options.headerSortElement === "function") {
|
|
26768
|
+
if (column.definition.headerSort && typeof this.table.options.headerSortElement === "function") {
|
|
26779
26769
|
while (sortEl.firstChild) {
|
|
26780
26770
|
sortEl.removeChild(sortEl.firstChild);
|
|
26781
26771
|
}
|