tabulator-tables 5.1.0 → 5.1.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/build/rollup.js +2 -1
- package/dist/css/tabulator.css +15 -8
- 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 +15 -8
- 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 +15 -8
- 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_bulma.css +15 -8
- 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 +15 -8
- 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 +15 -8
- 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 +15 -8
- 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 +15 -8
- 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 +15 -8
- 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 +15 -8
- 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 +301 -181
- 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 +820 -721
- 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 +5 -2
- package/src/js/core/FooterManager.js +15 -5
- package/src/js/core/RowManager.js +311 -284
- package/src/js/core/Tabulator.js +12 -29
- package/src/js/core/column/ColumnComponent.js +2 -0
- package/src/js/core/tools/InteractionMonitor.js +31 -23
- package/src/js/core/tools/ModuleBinder.js +15 -3
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +11 -6
- package/src/js/modules/DataTree/DataTree.js +0 -1
- package/src/js/modules/Edit/Edit.js +2 -2
- package/src/js/modules/Export/Export.js +2 -1
- package/src/js/modules/Filter/Filter.js +1 -2
- package/src/js/modules/Format/defaults/formatters/rowSelection.js +18 -1
- package/src/js/modules/Format/defaults/formatters/rownum.js +1 -1
- package/src/js/modules/FrozenColumns/FrozenColumns.js +17 -3
- package/src/js/modules/GroupRows/Group.js +144 -142
- package/src/js/modules/GroupRows/GroupComponent.js +1 -1
- package/src/js/modules/Import/Import.js +1 -3
- package/src/js/modules/Layout/Layout.js +1 -0
- package/src/js/modules/Page/Page.js +9 -4
- package/src/js/modules/Persistence/Persistence.js +6 -4
- package/src/js/modules/Persistence/defaults/readers.js +3 -3
- package/src/js/modules/ResizeColumns/ResizeColumns.js +61 -51
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +5 -5
- package/src/js/modules/SelectRow/SelectRow.js +130 -128
- package/src/scss/tabulator.scss +17 -12
package/dist/js/tabulator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Tabulator v5.1.
|
|
1
|
+
/* Tabulator v5.1.3 (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) :
|
|
@@ -438,7 +438,6 @@
|
|
|
438
438
|
return CoreFeature;
|
|
439
439
|
}();
|
|
440
440
|
|
|
441
|
-
//public column object
|
|
442
441
|
var ColumnComponent = /*#__PURE__*/function () {
|
|
443
442
|
function ColumnComponent(column) {
|
|
444
443
|
_classCallCheck(this, ColumnComponent);
|
|
@@ -1091,7 +1090,7 @@
|
|
|
1091
1090
|
return Cell;
|
|
1092
1091
|
}(CoreFeature);
|
|
1093
1092
|
|
|
1094
|
-
var Column
|
|
1093
|
+
var Column = /*#__PURE__*/function (_CoreFeature) {
|
|
1095
1094
|
_inherits(Column, _CoreFeature);
|
|
1096
1095
|
|
|
1097
1096
|
var _super = _createSuper(Column);
|
|
@@ -2164,7 +2163,7 @@
|
|
|
2164
2163
|
return Column;
|
|
2165
2164
|
}(CoreFeature);
|
|
2166
2165
|
|
|
2167
|
-
Column
|
|
2166
|
+
Column.defaultOptionList = defaultColumnOptions;
|
|
2168
2167
|
|
|
2169
2168
|
var Helpers = /*#__PURE__*/function () {
|
|
2170
2169
|
function Helpers() {
|
|
@@ -3236,7 +3235,7 @@
|
|
|
3236
3235
|
}, {
|
|
3237
3236
|
key: "_addColumn",
|
|
3238
3237
|
value: function _addColumn(definition, before, nextToColumn) {
|
|
3239
|
-
var column = new Column
|
|
3238
|
+
var column = new Column(definition, this),
|
|
3240
3239
|
colEl = column.getElement(),
|
|
3241
3240
|
index = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;
|
|
3242
3241
|
|
|
@@ -3311,7 +3310,7 @@
|
|
|
3311
3310
|
key: "findColumn",
|
|
3312
3311
|
value: function findColumn(subject) {
|
|
3313
3312
|
if (_typeof(subject) == "object") {
|
|
3314
|
-
if (subject instanceof Column
|
|
3313
|
+
if (subject instanceof Column) {
|
|
3315
3314
|
//subject is column element
|
|
3316
3315
|
return subject;
|
|
3317
3316
|
} else if (subject instanceof ColumnComponent) {
|
|
@@ -4957,6 +4956,10 @@
|
|
|
4957
4956
|
|
|
4958
4957
|
_this.heightFixer = _this.createTableElement(); //table element
|
|
4959
4958
|
|
|
4959
|
+
_this.placeholder = null; //placeholder element
|
|
4960
|
+
|
|
4961
|
+
_this.placeholderContents = null; //placeholder element
|
|
4962
|
+
|
|
4960
4963
|
_this.firstRender = false; //handle first render
|
|
4961
4964
|
|
|
4962
4965
|
_this.renderMode = "virtual"; //current rendering mode
|
|
@@ -5010,6 +5013,21 @@
|
|
|
5010
5013
|
el.classList.add("tabulator-table");
|
|
5011
5014
|
el.setAttribute("role", "rowgroup");
|
|
5012
5015
|
return el;
|
|
5016
|
+
}
|
|
5017
|
+
}, {
|
|
5018
|
+
key: "initializePlaceholder",
|
|
5019
|
+
value: function initializePlaceholder() {
|
|
5020
|
+
//configure placeholder element
|
|
5021
|
+
if (typeof this.table.options.placeholder == "string") {
|
|
5022
|
+
var el = document.createElement("div");
|
|
5023
|
+
el.classList.add("tabulator-placeholder");
|
|
5024
|
+
var contents = document.createElement("div");
|
|
5025
|
+
contents.classList.add("tabulator-placeholder-contents");
|
|
5026
|
+
contents.innerHTML = this.table.options.placeholder;
|
|
5027
|
+
el.appendChild(contents);
|
|
5028
|
+
this.placeholderContents = contents;
|
|
5029
|
+
this.placeholder = el;
|
|
5030
|
+
}
|
|
5013
5031
|
} //return containing element
|
|
5014
5032
|
|
|
5015
5033
|
}, {
|
|
@@ -5038,6 +5056,7 @@
|
|
|
5038
5056
|
value: function initialize() {
|
|
5039
5057
|
var _this2 = this;
|
|
5040
5058
|
|
|
5059
|
+
this.initializePlaceholder();
|
|
5041
5060
|
this.initializeRenderer(); //initialize manager
|
|
5042
5061
|
|
|
5043
5062
|
this.element.appendChild(this.tableElement);
|
|
@@ -5055,7 +5074,9 @@
|
|
|
5055
5074
|
_this2.dispatch("scroll-horizontal", left, leftDir);
|
|
5056
5075
|
|
|
5057
5076
|
_this2.dispatchExternal("scrollHorizontal", left, leftDir);
|
|
5058
|
-
|
|
5077
|
+
|
|
5078
|
+
_this2._positionPlaceholder();
|
|
5079
|
+
} //handle vertical scrolling
|
|
5059
5080
|
|
|
5060
5081
|
|
|
5061
5082
|
if (_this2.scrollTop != top) {
|
|
@@ -5237,7 +5258,6 @@
|
|
|
5237
5258
|
key: "addRow",
|
|
5238
5259
|
value: function addRow(data, pos, index, blockRedraw) {
|
|
5239
5260
|
var row = this.addRowActual(data, pos, index, blockRedraw);
|
|
5240
|
-
this.dispatch("row-added", row, data, pos, index);
|
|
5241
5261
|
return row;
|
|
5242
5262
|
} //add multiple rows
|
|
5243
5263
|
|
|
@@ -5616,42 +5636,12 @@
|
|
|
5616
5636
|
|
|
5617
5637
|
return;
|
|
5618
5638
|
} else {
|
|
5619
|
-
this.dispatch("data-refeshing");
|
|
5620
|
-
|
|
5621
|
-
if (!handler) {
|
|
5622
|
-
this.activeRowsPipeline[0] = this.rows.slice(0);
|
|
5623
|
-
} //cascade through data refresh stages
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
switch (stage) {
|
|
5627
|
-
case "all": //handle case where alldata needs refreshing
|
|
5628
|
-
|
|
5629
|
-
case "dataPipeline":
|
|
5630
|
-
for (var i = index; i < this.dataPipeline.length; i++) {
|
|
5631
|
-
var result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));
|
|
5632
|
-
this.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);
|
|
5633
|
-
}
|
|
5634
|
-
|
|
5635
|
-
this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);
|
|
5636
|
-
this.regenerateRowNumbers();
|
|
5637
|
-
|
|
5638
|
-
case "display":
|
|
5639
|
-
index = 0;
|
|
5640
|
-
this.resetDisplayRows();
|
|
5641
|
-
|
|
5642
|
-
case "displayPipeline":
|
|
5643
|
-
for (var _i = index; _i < this.displayPipeline.length; _i++) {
|
|
5644
|
-
var _result = this.displayPipeline[_i].handler((_i ? this.getDisplayRows(_i - 1) : this.activeRows).slice(0), renderInPosition);
|
|
5645
|
-
|
|
5646
|
-
this.setDisplayRows(_result || this.getDisplayRows(_i - 1).slice(0), _i);
|
|
5647
|
-
}
|
|
5648
|
-
|
|
5649
|
-
}
|
|
5650
|
-
|
|
5651
5639
|
if (Helpers.elVisible(this.element)) {
|
|
5652
5640
|
if (renderInPosition) {
|
|
5653
|
-
this.reRenderInPosition();
|
|
5641
|
+
this.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));
|
|
5654
5642
|
} else {
|
|
5643
|
+
this.refreshPipelines(handler, stage, index, renderInPosition);
|
|
5644
|
+
|
|
5655
5645
|
if (!handler) {
|
|
5656
5646
|
this.table.columnManager.renderer.renderColumns();
|
|
5657
5647
|
}
|
|
@@ -5662,10 +5652,47 @@
|
|
|
5662
5652
|
this.table.columnManager.redraw(true);
|
|
5663
5653
|
}
|
|
5664
5654
|
}
|
|
5655
|
+
} else {
|
|
5656
|
+
this.refreshPipelines(handler, stage, index, renderInPosition);
|
|
5665
5657
|
}
|
|
5666
5658
|
|
|
5667
5659
|
this.dispatch("data-refreshed");
|
|
5668
5660
|
}
|
|
5661
|
+
}
|
|
5662
|
+
}, {
|
|
5663
|
+
key: "refreshPipelines",
|
|
5664
|
+
value: function refreshPipelines(handler, stage, index, renderInPosition) {
|
|
5665
|
+
this.dispatch("data-refreshing");
|
|
5666
|
+
|
|
5667
|
+
if (!handler) {
|
|
5668
|
+
this.activeRowsPipeline[0] = this.rows.slice(0);
|
|
5669
|
+
} //cascade through data refresh stages
|
|
5670
|
+
|
|
5671
|
+
|
|
5672
|
+
switch (stage) {
|
|
5673
|
+
case "all": //handle case where alldata needs refreshing
|
|
5674
|
+
|
|
5675
|
+
case "dataPipeline":
|
|
5676
|
+
for (var i = index; i < this.dataPipeline.length; i++) {
|
|
5677
|
+
var result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));
|
|
5678
|
+
this.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);
|
|
5679
|
+
}
|
|
5680
|
+
|
|
5681
|
+
this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);
|
|
5682
|
+
this.regenerateRowNumbers();
|
|
5683
|
+
|
|
5684
|
+
case "display":
|
|
5685
|
+
index = 0;
|
|
5686
|
+
this.resetDisplayRows();
|
|
5687
|
+
|
|
5688
|
+
case "displayPipeline":
|
|
5689
|
+
for (var _i = index; _i < this.displayPipeline.length; _i++) {
|
|
5690
|
+
var _result = this.displayPipeline[_i].handler((_i ? this.getDisplayRows(_i - 1) : this.activeRows).slice(0), renderInPosition);
|
|
5691
|
+
|
|
5692
|
+
this.setDisplayRows(_result || this.getDisplayRows(_i - 1).slice(0), _i);
|
|
5693
|
+
}
|
|
5694
|
+
|
|
5695
|
+
}
|
|
5669
5696
|
} //regenerate row numbers for row number formatter if in use
|
|
5670
5697
|
|
|
5671
5698
|
}, {
|
|
@@ -5766,7 +5793,7 @@
|
|
|
5766
5793
|
break;
|
|
5767
5794
|
|
|
5768
5795
|
case "visible":
|
|
5769
|
-
rows = this.getVisibleRows(true);
|
|
5796
|
+
rows = this.getVisibleRows(false, true);
|
|
5770
5797
|
break;
|
|
5771
5798
|
|
|
5772
5799
|
default:
|
|
@@ -5858,7 +5885,7 @@
|
|
|
5858
5885
|
}, {
|
|
5859
5886
|
key: "renderEmptyScroll",
|
|
5860
5887
|
value: function renderEmptyScroll() {
|
|
5861
|
-
if (this.
|
|
5888
|
+
if (this.placeholder) {
|
|
5862
5889
|
this.tableElement.style.display = "none";
|
|
5863
5890
|
} else {
|
|
5864
5891
|
this.tableElement.style.minWidth = this.table.columnManager.getWidth() + "px"; // this.tableElement.style.minHeight = "1px";
|
|
@@ -5879,17 +5906,27 @@
|
|
|
5879
5906
|
}, {
|
|
5880
5907
|
key: "_showPlaceholder",
|
|
5881
5908
|
value: function _showPlaceholder() {
|
|
5882
|
-
if (this.
|
|
5883
|
-
this.
|
|
5884
|
-
this.getElement().appendChild(this.
|
|
5885
|
-
|
|
5909
|
+
if (this.placeholder) {
|
|
5910
|
+
this.placeholder.setAttribute("tabulator-render-mode", this.renderMode);
|
|
5911
|
+
this.getElement().appendChild(this.placeholder);
|
|
5912
|
+
|
|
5913
|
+
this._positionPlaceholder();
|
|
5886
5914
|
}
|
|
5887
5915
|
}
|
|
5888
5916
|
}, {
|
|
5889
5917
|
key: "_clearPlaceholder",
|
|
5890
5918
|
value: function _clearPlaceholder() {
|
|
5891
|
-
if (this.
|
|
5892
|
-
this.
|
|
5919
|
+
if (this.placeholder && this.placeholder.parentNode) {
|
|
5920
|
+
this.placeholder.parentNode.removeChild(this.placeholder);
|
|
5921
|
+
}
|
|
5922
|
+
}
|
|
5923
|
+
}, {
|
|
5924
|
+
key: "_positionPlaceholder",
|
|
5925
|
+
value: function _positionPlaceholder() {
|
|
5926
|
+
if (this.placeholder && this.placeholder.parentNode) {
|
|
5927
|
+
this.placeholder.style.width = this.table.columnManager.getWidth() + "px";
|
|
5928
|
+
this.placeholderContents.style.width = this.table.rowManager.element.clientWidth + "px";
|
|
5929
|
+
this.placeholderContents.style.marginLeft = this.scrollLeft + "px";
|
|
5893
5930
|
}
|
|
5894
5931
|
}
|
|
5895
5932
|
}, {
|
|
@@ -5942,6 +5979,8 @@
|
|
|
5942
5979
|
}
|
|
5943
5980
|
}
|
|
5944
5981
|
}
|
|
5982
|
+
|
|
5983
|
+
this._positionPlaceholder();
|
|
5945
5984
|
} //renitialize all rows
|
|
5946
5985
|
|
|
5947
5986
|
}, {
|
|
@@ -5986,12 +6025,6 @@
|
|
|
5986
6025
|
if (!force) {
|
|
5987
6026
|
this.reRenderInPosition();
|
|
5988
6027
|
this.scrollHorizontal(left);
|
|
5989
|
-
|
|
5990
|
-
if (!this.displayRowsCount) {
|
|
5991
|
-
if (this.table.options.placeholder) {
|
|
5992
|
-
this.getElement().appendChild(this.table.options.placeholder);
|
|
5993
|
-
}
|
|
5994
|
-
}
|
|
5995
6028
|
} else {
|
|
5996
6029
|
this.renderTable();
|
|
5997
6030
|
}
|
|
@@ -6029,11 +6062,10 @@
|
|
|
6029
6062
|
_this.active = false;
|
|
6030
6063
|
_this.element = _this.createElement(); //containing element
|
|
6031
6064
|
|
|
6065
|
+
_this.containerElement = _this.createContainerElement(); //containing element
|
|
6066
|
+
|
|
6032
6067
|
_this.external = false;
|
|
6033
6068
|
_this.links = [];
|
|
6034
|
-
|
|
6035
|
-
_this.initializeElement();
|
|
6036
|
-
|
|
6037
6069
|
return _this;
|
|
6038
6070
|
}
|
|
6039
6071
|
|
|
@@ -6049,6 +6081,14 @@
|
|
|
6049
6081
|
el.classList.add("tabulator-footer");
|
|
6050
6082
|
return el;
|
|
6051
6083
|
}
|
|
6084
|
+
}, {
|
|
6085
|
+
key: "createContainerElement",
|
|
6086
|
+
value: function createContainerElement() {
|
|
6087
|
+
var el = document.createElement("div");
|
|
6088
|
+
el.classList.add("tabulator-footer-contents");
|
|
6089
|
+
this.element.appendChild(el);
|
|
6090
|
+
return el;
|
|
6091
|
+
}
|
|
6052
6092
|
}, {
|
|
6053
6093
|
key: "initializeElement",
|
|
6054
6094
|
value: function initializeElement() {
|
|
@@ -6056,7 +6096,7 @@
|
|
|
6056
6096
|
switch (_typeof(this.table.options.footerElement)) {
|
|
6057
6097
|
case "string":
|
|
6058
6098
|
if (this.table.options.footerElement[0] === "<") {
|
|
6059
|
-
this.
|
|
6099
|
+
this.containerElement.innerHTML = this.table.options.footerElement;
|
|
6060
6100
|
} else {
|
|
6061
6101
|
this.external = true;
|
|
6062
6102
|
this.element = document.querySelector(this.table.options.footerElement);
|
|
@@ -6079,7 +6119,7 @@
|
|
|
6079
6119
|
key: "append",
|
|
6080
6120
|
value: function append(element, parent) {
|
|
6081
6121
|
this.activate(parent);
|
|
6082
|
-
this.
|
|
6122
|
+
this.containerElement.appendChild(element);
|
|
6083
6123
|
this.table.rowManager.adjustTableSize();
|
|
6084
6124
|
}
|
|
6085
6125
|
}, {
|
|
@@ -6417,6 +6457,10 @@
|
|
|
6417
6457
|
component = rows.find(function (row) {
|
|
6418
6458
|
return row.getElement() === target;
|
|
6419
6459
|
});
|
|
6460
|
+
|
|
6461
|
+
if (targets["row"].parentNode && targets["row"].parentNode.closest(".tabulator-row")) {
|
|
6462
|
+
targets[key] = false;
|
|
6463
|
+
}
|
|
6420
6464
|
}
|
|
6421
6465
|
|
|
6422
6466
|
break;
|
|
@@ -6430,10 +6474,12 @@
|
|
|
6430
6474
|
|
|
6431
6475
|
case "cell":
|
|
6432
6476
|
if (listener.components.includes("cell")) {
|
|
6433
|
-
if (targets["row"]) {
|
|
6477
|
+
if (targets["row"] instanceof Row) {
|
|
6434
6478
|
component = targets["row"].findCell(target);
|
|
6435
6479
|
} else {
|
|
6436
|
-
|
|
6480
|
+
if (targets["row"]) {
|
|
6481
|
+
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?");
|
|
6482
|
+
}
|
|
6437
6483
|
}
|
|
6438
6484
|
}
|
|
6439
6485
|
|
|
@@ -7488,6 +7534,7 @@
|
|
|
7488
7534
|
}, {
|
|
7489
7535
|
key: "layout",
|
|
7490
7536
|
value: function layout() {
|
|
7537
|
+
this.dispatch("layout-refreshing");
|
|
7491
7538
|
Layout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);
|
|
7492
7539
|
this.dispatch("layout-refreshed");
|
|
7493
7540
|
}
|
|
@@ -7880,18 +7927,30 @@
|
|
|
7880
7927
|
|
|
7881
7928
|
|
|
7882
7929
|
tabulator.prototype.bindModules = function () {
|
|
7930
|
+
var orderedMods = [],
|
|
7931
|
+
unOrderedMods = [];
|
|
7883
7932
|
this.modules = {};
|
|
7884
7933
|
|
|
7885
7934
|
for (var name in tabulator.moduleBindings) {
|
|
7886
7935
|
var mod = tabulator.moduleBindings[name];
|
|
7887
|
-
|
|
7936
|
+
var module = new mod(this);
|
|
7937
|
+
this.modules[name] = module;
|
|
7888
7938
|
|
|
7889
7939
|
if (mod.prototype.moduleCore) {
|
|
7890
|
-
this.modulesCore
|
|
7940
|
+
this.modulesCore.push(module);
|
|
7891
7941
|
} else {
|
|
7892
|
-
|
|
7942
|
+
if (mod.moduleInitOrder) {
|
|
7943
|
+
orderedMods.push(module);
|
|
7944
|
+
} else {
|
|
7945
|
+
unOrderedMods.push(module);
|
|
7946
|
+
}
|
|
7893
7947
|
}
|
|
7894
7948
|
}
|
|
7949
|
+
|
|
7950
|
+
orderedMods.sort(function (a, b) {
|
|
7951
|
+
return a.moduleInitOrder > b.moduleInitOrder ? 1 : -1;
|
|
7952
|
+
});
|
|
7953
|
+
this.modulesRegular = orderedMods.concat(unOrderedMods);
|
|
7895
7954
|
};
|
|
7896
7955
|
}
|
|
7897
7956
|
}, {
|
|
@@ -7949,15 +8008,15 @@
|
|
|
7949
8008
|
|
|
7950
8009
|
this.modules = {}; //hold all modules bound to this table
|
|
7951
8010
|
|
|
7952
|
-
this.modulesCore =
|
|
8011
|
+
this.modulesCore = []; //hold core modules bound to this table (for initialization purposes)
|
|
7953
8012
|
|
|
7954
|
-
this.modulesRegular =
|
|
8013
|
+
this.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)
|
|
7955
8014
|
|
|
7956
8015
|
this.optionsList = new OptionsList(this, "table constructor");
|
|
7957
8016
|
this.initialized = false;
|
|
7958
8017
|
|
|
7959
8018
|
if (this.initializeElement(element)) {
|
|
7960
|
-
this.
|
|
8019
|
+
this.initializeCoreSystems(options); //delay table creation to allow event bindings immediately after the constructor
|
|
7961
8020
|
|
|
7962
8021
|
setTimeout(function () {
|
|
7963
8022
|
_this._create();
|
|
@@ -7988,8 +8047,8 @@
|
|
|
7988
8047
|
}
|
|
7989
8048
|
}
|
|
7990
8049
|
}, {
|
|
7991
|
-
key: "
|
|
7992
|
-
value: function
|
|
8050
|
+
key: "initializeCoreSystems",
|
|
8051
|
+
value: function initializeCoreSystems(options) {
|
|
7993
8052
|
this.columnManager = new ColumnManager(this);
|
|
7994
8053
|
this.rowManager = new RowManager(this);
|
|
7995
8054
|
this.footerManager = new FooterManager(this);
|
|
@@ -8004,9 +8063,9 @@
|
|
|
8004
8063
|
this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
|
|
8005
8064
|
this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
|
|
8006
8065
|
this.interactionMonitor = new InteractionManager(this);
|
|
8007
|
-
this.dataLoader.initialize();
|
|
8008
|
-
this.
|
|
8009
|
-
|
|
8066
|
+
this.dataLoader.initialize(); // this.columnManager.initialize();
|
|
8067
|
+
// this.rowManager.initialize();
|
|
8068
|
+
|
|
8010
8069
|
this.footerManager.initialize();
|
|
8011
8070
|
} //convert deprecated functionality to new functions
|
|
8012
8071
|
|
|
@@ -8148,21 +8207,9 @@
|
|
|
8148
8207
|
this._detectBrowser(); //initialize core modules
|
|
8149
8208
|
|
|
8150
8209
|
|
|
8151
|
-
|
|
8152
|
-
var mod = this.modulesCore[key];
|
|
8210
|
+
this.modulesCore.forEach(function (mod) {
|
|
8153
8211
|
mod.initialize();
|
|
8154
|
-
} //
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
if (typeof options.placeholder == "string") {
|
|
8158
|
-
var el = document.createElement("div");
|
|
8159
|
-
el.classList.add("tabulator-placeholder");
|
|
8160
|
-
var span = document.createElement("span");
|
|
8161
|
-
span.innerHTML = options.placeholder;
|
|
8162
|
-
el.appendChild(span);
|
|
8163
|
-
options.placeholder = el;
|
|
8164
|
-
} //build table elements
|
|
8165
|
-
|
|
8212
|
+
}); //build table elements
|
|
8166
8213
|
|
|
8167
8214
|
element.appendChild(this.columnManager.getElement());
|
|
8168
8215
|
element.appendChild(this.rowManager.getElement());
|
|
@@ -8176,12 +8223,9 @@
|
|
|
8176
8223
|
} //initialize regular modules
|
|
8177
8224
|
|
|
8178
8225
|
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
_mod.initialize();
|
|
8183
|
-
}
|
|
8184
|
-
|
|
8226
|
+
this.modulesRegular.forEach(function (mod) {
|
|
8227
|
+
mod.initialize();
|
|
8228
|
+
});
|
|
8185
8229
|
this.columnManager.setColumns(options.columns);
|
|
8186
8230
|
this.eventBus.dispatch("table-built");
|
|
8187
8231
|
}
|
|
@@ -8231,7 +8275,7 @@
|
|
|
8231
8275
|
this.browserSlow = false;
|
|
8232
8276
|
}
|
|
8233
8277
|
|
|
8234
|
-
this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.
|
|
8278
|
+
this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.slice(0, 4));
|
|
8235
8279
|
} ////////////////// Data Handling //////////////////
|
|
8236
8280
|
//block table redrawing
|
|
8237
8281
|
|
|
@@ -9842,7 +9886,7 @@
|
|
|
9842
9886
|
}, {
|
|
9843
9887
|
key: "initialize",
|
|
9844
9888
|
value: function initialize() {
|
|
9845
|
-
this.genColumn = new Column
|
|
9889
|
+
this.genColumn = new Column({
|
|
9846
9890
|
field: "value"
|
|
9847
9891
|
}, this);
|
|
9848
9892
|
this.subscribe("cell-value-changed", this.cellValueChanged.bind(this));
|
|
@@ -9852,7 +9896,7 @@
|
|
|
9852
9896
|
this.subscribe("row-added", this.rowsUpdated.bind(this));
|
|
9853
9897
|
this.subscribe("column-moved", this.recalcActiveRows.bind(this));
|
|
9854
9898
|
this.subscribe("column-add", this.recalcActiveRows.bind(this));
|
|
9855
|
-
this.subscribe("data-refreshed", this.
|
|
9899
|
+
this.subscribe("data-refreshed", this.recalcActiveRowsRefresh.bind(this));
|
|
9856
9900
|
this.subscribe("table-redraw", this.tableRedraw.bind(this));
|
|
9857
9901
|
this.subscribe("rows-visible", this.visibleRows.bind(this));
|
|
9858
9902
|
this.registerTableFunction("getCalcResults", this.getResults.bind(this));
|
|
@@ -9900,6 +9944,15 @@
|
|
|
9900
9944
|
this.recalcActiveRows();
|
|
9901
9945
|
}
|
|
9902
9946
|
}
|
|
9947
|
+
}, {
|
|
9948
|
+
key: "recalcActiveRowsRefresh",
|
|
9949
|
+
value: function recalcActiveRowsRefresh() {
|
|
9950
|
+
if (this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree) {
|
|
9951
|
+
this.recalcAll();
|
|
9952
|
+
} else {
|
|
9953
|
+
this.recalcActiveRows();
|
|
9954
|
+
}
|
|
9955
|
+
}
|
|
9903
9956
|
}, {
|
|
9904
9957
|
key: "recalcActiveRows",
|
|
9905
9958
|
value: function recalcActiveRows() {
|
|
@@ -10154,7 +10207,7 @@
|
|
|
10154
10207
|
data.push(row.getData());
|
|
10155
10208
|
|
|
10156
10209
|
if (_this3.table.options.dataTree && _this3.table.options.dataTreeChildColumnCalcs) {
|
|
10157
|
-
if (row.modules.dataTree.open) {
|
|
10210
|
+
if (row.modules.dataTree && row.modules.dataTree.open) {
|
|
10158
10211
|
var children = _this3.rowsToData(_this3.table.modules.dataTree.getFilteredTreeChildren(row));
|
|
10159
10212
|
|
|
10160
10213
|
data = data.concat(children);
|
|
@@ -10958,7 +11011,6 @@
|
|
|
10958
11011
|
}, {
|
|
10959
11012
|
key: "redrawNeeded",
|
|
10960
11013
|
value: function redrawNeeded(data) {
|
|
10961
|
-
console.log("needed?", data);
|
|
10962
11014
|
return (this.field ? typeof data[this.field] !== "undefined" : false) || (this.elementField ? typeof data[this.elementField] !== "undefined" : false);
|
|
10963
11015
|
}
|
|
10964
11016
|
}]);
|
|
@@ -13336,7 +13388,7 @@
|
|
|
13336
13388
|
this.subscribe("column-layout", this.initializeColumnCheck.bind(this));
|
|
13337
13389
|
this.subscribe("column-delete", this.columnDeleteCheck.bind(this));
|
|
13338
13390
|
this.subscribe("row-deleting", this.rowDeleteCheck.bind(this));
|
|
13339
|
-
this.subscribe("data-
|
|
13391
|
+
this.subscribe("data-refreshing", this.cancelEdit.bind(this));
|
|
13340
13392
|
this.subscribe("keybinding-nav-prev", this.navigatePrev.bind(this, undefined));
|
|
13341
13393
|
this.subscribe("keybinding-nav-next", this.keybindingNavigateNext.bind(this));
|
|
13342
13394
|
this.subscribe("keybinding-nav-left", this.navigateLeft.bind(this, undefined));
|
|
@@ -13356,7 +13408,8 @@
|
|
|
13356
13408
|
if (cell) {
|
|
13357
13409
|
if (!this.navigateNext(cell, e)) {
|
|
13358
13410
|
if (newRow) {
|
|
13359
|
-
|
|
13411
|
+
cell.getElement().firstChild.blur();
|
|
13412
|
+
|
|
13360
13413
|
if (newRow === true) {
|
|
13361
13414
|
newRow = this.table.addRow({});
|
|
13362
13415
|
} else {
|
|
@@ -14254,7 +14307,8 @@
|
|
|
14254
14307
|
var columns = [];
|
|
14255
14308
|
header.forEach(function (col) {
|
|
14256
14309
|
if (col) {
|
|
14257
|
-
|
|
14310
|
+
var title = typeof col.title === "undefined" ? "" : col.title;
|
|
14311
|
+
columns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));
|
|
14258
14312
|
} else {
|
|
14259
14313
|
columns.push(null);
|
|
14260
14314
|
}
|
|
@@ -15375,6 +15429,8 @@
|
|
|
15375
15429
|
value: function addFilter(field, type, value, params) {
|
|
15376
15430
|
var _this4 = this;
|
|
15377
15431
|
|
|
15432
|
+
var changed = false;
|
|
15433
|
+
|
|
15378
15434
|
if (!Array.isArray(field)) {
|
|
15379
15435
|
field = [{
|
|
15380
15436
|
field: field,
|
|
@@ -15390,9 +15446,13 @@
|
|
|
15390
15446
|
if (filter) {
|
|
15391
15447
|
_this4.filterList.push(filter);
|
|
15392
15448
|
|
|
15393
|
-
|
|
15449
|
+
changed = true;
|
|
15394
15450
|
}
|
|
15395
15451
|
});
|
|
15452
|
+
|
|
15453
|
+
if (changed) {
|
|
15454
|
+
this.trackChanges();
|
|
15455
|
+
}
|
|
15396
15456
|
}
|
|
15397
15457
|
}, {
|
|
15398
15458
|
key: "findFilter",
|
|
@@ -16176,7 +16236,7 @@
|
|
|
16176
16236
|
}
|
|
16177
16237
|
|
|
16178
16238
|
function rownum (cell, formatterParams, onRendered) {
|
|
16179
|
-
return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1;
|
|
16239
|
+
return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1 || "";
|
|
16180
16240
|
}
|
|
16181
16241
|
|
|
16182
16242
|
function handle (cell, formatterParams, onRendered) {
|
|
@@ -16219,6 +16279,7 @@
|
|
|
16219
16279
|
var _this = this;
|
|
16220
16280
|
|
|
16221
16281
|
var checkbox = document.createElement("input");
|
|
16282
|
+
var blocked = false;
|
|
16222
16283
|
checkbox.type = 'checkbox';
|
|
16223
16284
|
|
|
16224
16285
|
if (this.table.modExists("selectRow", true)) {
|
|
@@ -16231,8 +16292,25 @@
|
|
|
16231
16292
|
|
|
16232
16293
|
if (row instanceof RowComponent$1) {
|
|
16233
16294
|
checkbox.addEventListener("change", function (e) {
|
|
16234
|
-
|
|
16295
|
+
if (_this.table.options.selectableRangeMode === "click") {
|
|
16296
|
+
if (!blocked) {
|
|
16297
|
+
row.toggleSelect();
|
|
16298
|
+
} else {
|
|
16299
|
+
blocked = false;
|
|
16300
|
+
}
|
|
16301
|
+
} else {
|
|
16302
|
+
row.toggleSelect();
|
|
16303
|
+
}
|
|
16235
16304
|
});
|
|
16305
|
+
|
|
16306
|
+
if (this.table.options.selectableRangeMode === "click") {
|
|
16307
|
+
checkbox.addEventListener("click", function (e) {
|
|
16308
|
+
blocked = true;
|
|
16309
|
+
|
|
16310
|
+
_this.table.modules.selectRow.handleComplexRowClick(row._row, e);
|
|
16311
|
+
});
|
|
16312
|
+
}
|
|
16313
|
+
|
|
16236
16314
|
checkbox.checked = row.isSelected && row.isSelected();
|
|
16237
16315
|
this.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);
|
|
16238
16316
|
} else {
|
|
@@ -16525,6 +16603,7 @@
|
|
|
16525
16603
|
_this.initializationMode = "left";
|
|
16526
16604
|
_this.active = false;
|
|
16527
16605
|
_this.scrollEndTimer = false;
|
|
16606
|
+
_this.blocked = true;
|
|
16528
16607
|
|
|
16529
16608
|
_this.registerColumnOption("frozen");
|
|
16530
16609
|
|
|
@@ -16556,6 +16635,18 @@
|
|
|
16556
16635
|
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
16557
16636
|
this.subscribe("columns-loading", this.reset.bind(this));
|
|
16558
16637
|
this.subscribe("table-redraw", this.layout.bind(this));
|
|
16638
|
+
this.subscribe("layout-refreshing", this.blockLayout.bind(this));
|
|
16639
|
+
this.subscribe("layout-refreshed", this.unblockLayout.bind(this));
|
|
16640
|
+
}
|
|
16641
|
+
}, {
|
|
16642
|
+
key: "blockLayout",
|
|
16643
|
+
value: function blockLayout() {
|
|
16644
|
+
this.blocked = true;
|
|
16645
|
+
}
|
|
16646
|
+
}, {
|
|
16647
|
+
key: "unblockLayout",
|
|
16648
|
+
value: function unblockLayout() {
|
|
16649
|
+
this.blocked = false;
|
|
16559
16650
|
}
|
|
16560
16651
|
}, {
|
|
16561
16652
|
key: "layoutCell",
|
|
@@ -16740,14 +16831,14 @@
|
|
|
16740
16831
|
key: "getColGroupParentElement",
|
|
16741
16832
|
value: function getColGroupParentElement(column) {
|
|
16742
16833
|
return column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();
|
|
16743
|
-
} //layout columns
|
|
16834
|
+
} //layout columns appropriately
|
|
16744
16835
|
|
|
16745
16836
|
}, {
|
|
16746
16837
|
key: "layout",
|
|
16747
16838
|
value: function layout() {
|
|
16748
16839
|
var _this5 = this;
|
|
16749
16840
|
|
|
16750
|
-
if (this.active) {
|
|
16841
|
+
if (this.active && !this.blocked) {
|
|
16751
16842
|
//calculate row padding
|
|
16752
16843
|
this.calcMargins();
|
|
16753
16844
|
this.table.rowManager.getDisplayRows().forEach(function (row) {
|
|
@@ -16768,6 +16859,11 @@
|
|
|
16768
16859
|
|
|
16769
16860
|
var rowEl = row.getElement();
|
|
16770
16861
|
rowEl.style.paddingLeft = this.leftMargin;
|
|
16862
|
+
|
|
16863
|
+
if (this.table.options.layout === "fitDataFill" && this.rightColumns.length) {
|
|
16864
|
+
this.table.rowManager.getTableElement().style.minWidth = "calc(100% - " + this.rightMargin + ")";
|
|
16865
|
+
}
|
|
16866
|
+
|
|
16771
16867
|
this.leftColumns.forEach(function (column) {
|
|
16772
16868
|
var cell = row.getCell(column);
|
|
16773
16869
|
|
|
@@ -16960,7 +17056,7 @@
|
|
|
16960
17056
|
if (typeof target[name] !== "undefined") {
|
|
16961
17057
|
return target[name];
|
|
16962
17058
|
} else {
|
|
16963
|
-
return target._group.table.componentFunctionBinder.handle("row", target._group, name);
|
|
17059
|
+
return target._group.groupManager.table.componentFunctionBinder.handle("row", target._group, name);
|
|
16964
17060
|
}
|
|
16965
17061
|
}
|
|
16966
17062
|
});
|
|
@@ -17201,10 +17297,12 @@
|
|
|
17201
17297
|
}, {
|
|
17202
17298
|
key: "scrollHeader",
|
|
17203
17299
|
value: function scrollHeader(left) {
|
|
17204
|
-
this.arrowElement
|
|
17205
|
-
|
|
17206
|
-
|
|
17207
|
-
|
|
17300
|
+
if (this.arrowElement) {
|
|
17301
|
+
this.arrowElement.style.marginLeft = left;
|
|
17302
|
+
this.groupList.forEach(function (child) {
|
|
17303
|
+
child.scrollHeader(left);
|
|
17304
|
+
});
|
|
17305
|
+
}
|
|
17208
17306
|
}
|
|
17209
17307
|
}, {
|
|
17210
17308
|
key: "getRowIndex",
|
|
@@ -18886,7 +18984,6 @@
|
|
|
18886
18984
|
key: "structureData",
|
|
18887
18985
|
value: function structureData(parsedData) {
|
|
18888
18986
|
var data = [];
|
|
18889
|
-
console.log("structure", parsedData);
|
|
18890
18987
|
|
|
18891
18988
|
if (Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])) {
|
|
18892
18989
|
if (this.table.options.autoColumns) {
|
|
@@ -19268,7 +19365,7 @@
|
|
|
19268
19365
|
if (this.columnSubscribers[action]) {
|
|
19269
19366
|
if (component instanceof Cell) {
|
|
19270
19367
|
callback = component.column.definition[action];
|
|
19271
|
-
} else if (component instanceof Column
|
|
19368
|
+
} else if (component instanceof Column) {
|
|
19272
19369
|
callback = component.definition[action];
|
|
19273
19370
|
}
|
|
19274
19371
|
|
|
@@ -21291,11 +21388,14 @@
|
|
|
21291
21388
|
value: function initialize() {
|
|
21292
21389
|
if (this.table.options.pagination) {
|
|
21293
21390
|
this.subscribe("row-deleted", this.rowsUpdated.bind(this));
|
|
21294
|
-
this.subscribe("row-adding-position", this.rowAddingPosition.bind(this));
|
|
21295
21391
|
this.subscribe("row-added", this.rowsUpdated.bind(this));
|
|
21296
21392
|
this.subscribe("data-processed", this.initialLoadComplete.bind(this));
|
|
21297
21393
|
this.subscribe("table-built", this.calculatePageSizes.bind(this));
|
|
21298
21394
|
|
|
21395
|
+
if (this.table.options.paginationAddRow == "page") {
|
|
21396
|
+
this.subscribe("row-adding-position", this.rowAddingPosition.bind(this));
|
|
21397
|
+
}
|
|
21398
|
+
|
|
21299
21399
|
if (this.table.options.paginationMode === "remote") {
|
|
21300
21400
|
this.subscribe("data-params", this.remotePageParams.bind(this));
|
|
21301
21401
|
this.subscribe("data-loaded", this._parseRemoteData.bind(this));
|
|
@@ -22051,9 +22151,11 @@
|
|
|
22051
22151
|
margin = this.table.options.progressiveLoadScrollMargin || this.table.rowManager.element.clientHeight * 2;
|
|
22052
22152
|
|
|
22053
22153
|
if (this.table.rowManager.element.scrollHeight <= this.table.rowManager.element.clientHeight + margin) {
|
|
22054
|
-
|
|
22055
|
-
|
|
22056
|
-
|
|
22154
|
+
if (this.page < this.max) {
|
|
22155
|
+
setTimeout(function () {
|
|
22156
|
+
_this6.nextPage();
|
|
22157
|
+
});
|
|
22158
|
+
}
|
|
22057
22159
|
}
|
|
22058
22160
|
|
|
22059
22161
|
break;
|
|
@@ -22110,11 +22212,11 @@
|
|
|
22110
22212
|
data; //if cookie exists, decode and load column data into tabulator
|
|
22111
22213
|
|
|
22112
22214
|
if (cookiePos > -1) {
|
|
22113
|
-
cookie = cookie.
|
|
22215
|
+
cookie = cookie.slice(cookiePos);
|
|
22114
22216
|
end = cookie.indexOf(";");
|
|
22115
22217
|
|
|
22116
22218
|
if (end > -1) {
|
|
22117
|
-
cookie = cookie.
|
|
22219
|
+
cookie = cookie.slice(0, end);
|
|
22118
22220
|
}
|
|
22119
22221
|
|
|
22120
22222
|
data = cookie.replace(key + "=", "");
|
|
@@ -22282,9 +22384,9 @@
|
|
|
22282
22384
|
this.subscribe("column-show", this.save.bind(this, "columns"));
|
|
22283
22385
|
this.subscribe("column-hide", this.save.bind(this, "columns"));
|
|
22284
22386
|
this.subscribe("column-moved", this.save.bind(this, "columns"));
|
|
22285
|
-
this.subscribe("table-built", this.tableBuilt.bind(this), 0);
|
|
22286
22387
|
}
|
|
22287
22388
|
|
|
22389
|
+
this.subscribe("table-built", this.tableBuilt.bind(this), 0);
|
|
22288
22390
|
this.subscribe("table-redraw", this.tableRedraw.bind(this));
|
|
22289
22391
|
this.subscribe("filter-changed", this.eventSave.bind(this, "filter"));
|
|
22290
22392
|
this.subscribe("sort-changed", this.eventSave.bind(this, "sort"));
|
|
@@ -22315,7 +22417,7 @@
|
|
|
22315
22417
|
sorters = this.load("sort");
|
|
22316
22418
|
|
|
22317
22419
|
if (!sorters === false) {
|
|
22318
|
-
this.table.initialSort = sorters;
|
|
22420
|
+
this.table.options.initialSort = sorters;
|
|
22319
22421
|
}
|
|
22320
22422
|
}
|
|
22321
22423
|
|
|
@@ -22323,7 +22425,7 @@
|
|
|
22323
22425
|
filters = this.load("filter");
|
|
22324
22426
|
|
|
22325
22427
|
if (!filters === false) {
|
|
22326
|
-
this.table.initialFilter = filters;
|
|
22428
|
+
this.table.options.initialFilter = filters;
|
|
22327
22429
|
}
|
|
22328
22430
|
}
|
|
22329
22431
|
}
|
|
@@ -22606,7 +22708,8 @@
|
|
|
22606
22708
|
return Persistence;
|
|
22607
22709
|
}(Module);
|
|
22608
22710
|
|
|
22609
|
-
Persistence.moduleName = "persistence";
|
|
22711
|
+
Persistence.moduleName = "persistence";
|
|
22712
|
+
Persistence.moduleInitOrder = 1; //load defaults
|
|
22610
22713
|
|
|
22611
22714
|
Persistence.readers = defaultReaders;
|
|
22612
22715
|
Persistence.writers = defaultWriters;
|
|
@@ -23158,11 +23261,18 @@
|
|
|
23158
23261
|
}); //reszie column on double click
|
|
23159
23262
|
|
|
23160
23263
|
handle.addEventListener("dblclick", function (e) {
|
|
23161
|
-
var col = column.getLastColumn()
|
|
23264
|
+
var col = column.getLastColumn(),
|
|
23265
|
+
oldWidth;
|
|
23162
23266
|
|
|
23163
23267
|
if (col && self._checkResizability(col)) {
|
|
23268
|
+
oldWidth = col.getWidth();
|
|
23164
23269
|
e.stopPropagation();
|
|
23165
23270
|
col.reinitializeWidth(true);
|
|
23271
|
+
|
|
23272
|
+
if (oldWidth !== col.getWidth()) {
|
|
23273
|
+
self.dispatch("column-resized", col);
|
|
23274
|
+
self.table.externalEvents.dispatch("columnResized", col.getComponent());
|
|
23275
|
+
}
|
|
23166
23276
|
}
|
|
23167
23277
|
});
|
|
23168
23278
|
prevHandle.addEventListener("click", function (e) {
|
|
@@ -23249,8 +23359,11 @@
|
|
|
23249
23359
|
handle.removeEventListener("touchmove", mouseMove);
|
|
23250
23360
|
handle.removeEventListener("touchend", mouseUp);
|
|
23251
23361
|
self.table.element.classList.remove("tabulator-block-select");
|
|
23252
|
-
|
|
23253
|
-
self.
|
|
23362
|
+
|
|
23363
|
+
if (self.startWidth !== column.getWidth()) {
|
|
23364
|
+
self.dispatch("column-resized", column);
|
|
23365
|
+
self.table.externalEvents.dispatch("columnResized", column.getComponent());
|
|
23366
|
+
}
|
|
23254
23367
|
}
|
|
23255
23368
|
|
|
23256
23369
|
e.stopPropagation(); //prevent resize from interfereing with movable columns
|
|
@@ -23593,6 +23706,8 @@
|
|
|
23593
23706
|
}, {
|
|
23594
23707
|
key: "initializeResponsivity",
|
|
23595
23708
|
value: function initializeResponsivity() {
|
|
23709
|
+
var _this2 = this;
|
|
23710
|
+
|
|
23596
23711
|
var columns = [];
|
|
23597
23712
|
this.mode = this.table.options.responsiveLayout;
|
|
23598
23713
|
this.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;
|
|
@@ -23605,8 +23720,8 @@
|
|
|
23605
23720
|
column.modules.responsive.index = i;
|
|
23606
23721
|
columns.push(column);
|
|
23607
23722
|
|
|
23608
|
-
if (!column.visible &&
|
|
23609
|
-
|
|
23723
|
+
if (!column.visible && _this2.mode === "collapse") {
|
|
23724
|
+
_this2.hiddenColumns.push(column);
|
|
23610
23725
|
}
|
|
23611
23726
|
}
|
|
23612
23727
|
}
|
|
@@ -23871,7 +23986,7 @@
|
|
|
23871
23986
|
var titleHighlight = document.createElement("strong");
|
|
23872
23987
|
titleData.appendChild(titleHighlight);
|
|
23873
23988
|
this.langBind("columns|" + item.field, function (text) {
|
|
23874
|
-
titleHighlight.
|
|
23989
|
+
titleHighlight.innerHTML = text || item.title;
|
|
23875
23990
|
});
|
|
23876
23991
|
|
|
23877
23992
|
if (item.value instanceof Node) {
|
|
@@ -23965,7 +24080,7 @@
|
|
|
23965
24080
|
this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
|
|
23966
24081
|
|
|
23967
24082
|
if (this.table.options.selectable && !this.table.options.selectablePersistence) {
|
|
23968
|
-
this.subscribe("data-
|
|
24083
|
+
this.subscribe("data-refreshing", this.deselectRows.bind(this));
|
|
23969
24084
|
}
|
|
23970
24085
|
}
|
|
23971
24086
|
}
|
|
@@ -24014,53 +24129,7 @@
|
|
|
24014
24129
|
|
|
24015
24130
|
if (self.table.options.selectable && self.table.options.selectable != "highlight") {
|
|
24016
24131
|
if (self.table.options.selectableRangeMode === "click") {
|
|
24017
|
-
element.addEventListener("click",
|
|
24018
|
-
if (e.shiftKey) {
|
|
24019
|
-
self.table._clearSelection();
|
|
24020
|
-
|
|
24021
|
-
self.lastClickedRow = self.lastClickedRow || row;
|
|
24022
|
-
var lastClickedRowIdx = self.table.rowManager.getDisplayRowIndex(self.lastClickedRow);
|
|
24023
|
-
var rowIdx = self.table.rowManager.getDisplayRowIndex(row);
|
|
24024
|
-
var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;
|
|
24025
|
-
var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;
|
|
24026
|
-
var rows = self.table.rowManager.getDisplayRows().slice(0);
|
|
24027
|
-
var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);
|
|
24028
|
-
|
|
24029
|
-
if (e.ctrlKey || e.metaKey) {
|
|
24030
|
-
toggledRows.forEach(function (toggledRow) {
|
|
24031
|
-
if (toggledRow !== self.lastClickedRow) {
|
|
24032
|
-
if (self.table.options.selectable !== true && !self.isRowSelected(row)) {
|
|
24033
|
-
if (self.selectedRows.length < self.table.options.selectable) {
|
|
24034
|
-
self.toggleRow(toggledRow);
|
|
24035
|
-
}
|
|
24036
|
-
} else {
|
|
24037
|
-
self.toggleRow(toggledRow);
|
|
24038
|
-
}
|
|
24039
|
-
}
|
|
24040
|
-
});
|
|
24041
|
-
self.lastClickedRow = row;
|
|
24042
|
-
} else {
|
|
24043
|
-
self.deselectRows(undefined, true);
|
|
24044
|
-
|
|
24045
|
-
if (self.table.options.selectable !== true) {
|
|
24046
|
-
if (toggledRows.length > self.table.options.selectable) {
|
|
24047
|
-
toggledRows = toggledRows.slice(0, self.table.options.selectable);
|
|
24048
|
-
}
|
|
24049
|
-
}
|
|
24050
|
-
|
|
24051
|
-
self.selectRows(toggledRows);
|
|
24052
|
-
}
|
|
24053
|
-
|
|
24054
|
-
self.table._clearSelection();
|
|
24055
|
-
} else if (e.ctrlKey || e.metaKey) {
|
|
24056
|
-
self.toggleRow(row);
|
|
24057
|
-
self.lastClickedRow = row;
|
|
24058
|
-
} else {
|
|
24059
|
-
self.deselectRows(undefined, true);
|
|
24060
|
-
self.selectRows(row);
|
|
24061
|
-
self.lastClickedRow = row;
|
|
24062
|
-
}
|
|
24063
|
-
});
|
|
24132
|
+
element.addEventListener("click", this.handleComplexRowClick.bind(this, row));
|
|
24064
24133
|
} else {
|
|
24065
24134
|
element.addEventListener("click", function (e) {
|
|
24066
24135
|
if (!self.table.modExists("edit") || !self.table.modules.edit.getCurrentCell()) {
|
|
@@ -24107,6 +24176,57 @@
|
|
|
24107
24176
|
element.classList.add("tabulator-unselectable");
|
|
24108
24177
|
element.classList.remove("tabulator-selectable");
|
|
24109
24178
|
}
|
|
24179
|
+
}
|
|
24180
|
+
}, {
|
|
24181
|
+
key: "handleComplexRowClick",
|
|
24182
|
+
value: function handleComplexRowClick(row, e) {
|
|
24183
|
+
var _this2 = this;
|
|
24184
|
+
|
|
24185
|
+
if (e.shiftKey) {
|
|
24186
|
+
this.table._clearSelection();
|
|
24187
|
+
|
|
24188
|
+
this.lastClickedRow = this.lastClickedRow || row;
|
|
24189
|
+
var lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);
|
|
24190
|
+
var rowIdx = this.table.rowManager.getDisplayRowIndex(row);
|
|
24191
|
+
var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;
|
|
24192
|
+
var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;
|
|
24193
|
+
var rows = this.table.rowManager.getDisplayRows().slice(0);
|
|
24194
|
+
var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);
|
|
24195
|
+
|
|
24196
|
+
if (e.ctrlKey || e.metaKey) {
|
|
24197
|
+
toggledRows.forEach(function (toggledRow) {
|
|
24198
|
+
if (toggledRow !== _this2.lastClickedRow) {
|
|
24199
|
+
if (_this2.table.options.selectable !== true && !_this2.isRowSelected(row)) {
|
|
24200
|
+
if (_this2.selectedRows.length < _this2.table.options.selectable) {
|
|
24201
|
+
_this2.toggleRow(toggledRow);
|
|
24202
|
+
}
|
|
24203
|
+
} else {
|
|
24204
|
+
_this2.toggleRow(toggledRow);
|
|
24205
|
+
}
|
|
24206
|
+
}
|
|
24207
|
+
});
|
|
24208
|
+
this.lastClickedRow = row;
|
|
24209
|
+
} else {
|
|
24210
|
+
this.deselectRows(undefined, true);
|
|
24211
|
+
|
|
24212
|
+
if (this.table.options.selectable !== true) {
|
|
24213
|
+
if (toggledRows.length > this.table.options.selectable) {
|
|
24214
|
+
toggledRows = toggledRows.slice(0, this.table.options.selectable);
|
|
24215
|
+
}
|
|
24216
|
+
}
|
|
24217
|
+
|
|
24218
|
+
this.selectRows(toggledRows);
|
|
24219
|
+
}
|
|
24220
|
+
|
|
24221
|
+
this.table._clearSelection();
|
|
24222
|
+
} else if (e.ctrlKey || e.metaKey) {
|
|
24223
|
+
this.toggleRow(row);
|
|
24224
|
+
this.lastClickedRow = row;
|
|
24225
|
+
} else {
|
|
24226
|
+
this.deselectRows(undefined, true);
|
|
24227
|
+
this.selectRows(row);
|
|
24228
|
+
this.lastClickedRow = row;
|
|
24229
|
+
}
|
|
24110
24230
|
} //toggle row selection
|
|
24111
24231
|
|
|
24112
24232
|
}, {
|
|
@@ -24124,14 +24244,14 @@
|
|
|
24124
24244
|
}, {
|
|
24125
24245
|
key: "selectRows",
|
|
24126
24246
|
value: function selectRows(rows) {
|
|
24127
|
-
var
|
|
24247
|
+
var _this3 = this;
|
|
24128
24248
|
|
|
24129
24249
|
var rowMatch;
|
|
24130
24250
|
|
|
24131
24251
|
switch (_typeof(rows)) {
|
|
24132
24252
|
case "undefined":
|
|
24133
24253
|
this.table.rowManager.rows.forEach(function (row) {
|
|
24134
|
-
|
|
24254
|
+
_this3._selectRow(row, true, true);
|
|
24135
24255
|
});
|
|
24136
24256
|
|
|
24137
24257
|
this._rowSelectionChanged();
|
|
@@ -24145,7 +24265,7 @@
|
|
|
24145
24265
|
this._selectRow(rowMatch, true, true);
|
|
24146
24266
|
} else {
|
|
24147
24267
|
this.table.rowManager.getRows(rows).forEach(function (row) {
|
|
24148
|
-
|
|
24268
|
+
_this3._selectRow(row, true, true);
|
|
24149
24269
|
});
|
|
24150
24270
|
}
|
|
24151
24271
|
|
|
@@ -24156,7 +24276,7 @@
|
|
|
24156
24276
|
default:
|
|
24157
24277
|
if (Array.isArray(rows)) {
|
|
24158
24278
|
rows.forEach(function (row) {
|
|
24159
|
-
|
|
24279
|
+
_this3._selectRow(row, true, true);
|
|
24160
24280
|
});
|
|
24161
24281
|
|
|
24162
24282
|
this._rowSelectionChanged();
|