tabulator-tables 5.0.7 → 5.0.8
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 +1 -1
- package/dist/js/tabulator.js +69 -57
- 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 +119 -106
- 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 +3 -1
- package/src/js/core/Tabulator.js +14 -16
- package/src/js/core/tools/{ComponentFuctionBinder.js → ComponentFunctionBinder.js} +1 -1
- package/src/js/core/tools/InteractionMonitor.js +4 -1
- package/src/js/core/tools/OptionsList.js +2 -2
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +1 -1
- package/src/js/modules/Edit/defaults/editors/progress.js +2 -2
- package/src/js/modules/Filter/Filter.js +1 -1
- package/src/js/modules/Format/defaults/formatters/datetime.js +2 -2
- package/src/js/modules/Format/defaults/formatters/datetimediff.js +1 -1
- package/src/js/modules/GroupRows/Group.js +10 -4
- package/src/js/modules/GroupRows/GroupRows.js +6 -1
- package/src/js/modules/HtmlTableImport/HtmlTableImport.js +4 -7
- package/src/js/modules/MoveColumns/MoveColumns.js +58 -57
- package/src/js/modules/Page/Page.js +2 -1
- package/src/js/modules/SelectRow/SelectRow.js +2 -1
- package/src/js/modules/Sort/Sort.js +1 -1
- package/src/js/modules/Sort/defaults/sorters/datetime.js +3 -2
package/dist/js/tabulator_esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Tabulator v5.0.
|
|
1
|
+
/* Tabulator v5.0.8 (c) Oliver Folkerd 2021 */
|
|
2
2
|
class CoreFeature{
|
|
3
3
|
|
|
4
4
|
constructor(table){
|
|
@@ -1648,7 +1648,7 @@ class ColumnComponent {
|
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
1650
1650
|
|
|
1651
|
-
var
|
|
1651
|
+
var defaultColumnOptions = {
|
|
1652
1652
|
"title": undefined,
|
|
1653
1653
|
"field": undefined,
|
|
1654
1654
|
"columns": undefined,
|
|
@@ -2679,7 +2679,7 @@ class Column$1 extends CoreFeature{
|
|
|
2679
2679
|
}
|
|
2680
2680
|
}
|
|
2681
2681
|
|
|
2682
|
-
Column$1.defaultOptionList =
|
|
2682
|
+
Column$1.defaultOptionList = defaultColumnOptions;
|
|
2683
2683
|
|
|
2684
2684
|
//public row object
|
|
2685
2685
|
class RowComponent$1 {
|
|
@@ -3626,7 +3626,7 @@ class ColumnCalcs extends Module{
|
|
|
3626
3626
|
|
|
3627
3627
|
row.getComponent = () => {
|
|
3628
3628
|
if(!row.component){
|
|
3629
|
-
row.component = new CalcComponent(
|
|
3629
|
+
row.component = new CalcComponent(row);
|
|
3630
3630
|
}
|
|
3631
3631
|
|
|
3632
3632
|
return row.component;
|
|
@@ -6422,8 +6422,8 @@ function star(cell, onRendered, success, cancel, editorParams){
|
|
|
6422
6422
|
//draggable progress bar
|
|
6423
6423
|
function progress(cell, onRendered, success, cancel, editorParams){
|
|
6424
6424
|
var element = cell.getElement(),
|
|
6425
|
-
max = typeof editorParams.max === "undefined" ? ( element.getElementsByTagName("div")[0]
|
|
6426
|
-
min = typeof editorParams.min === "undefined" ? ( element.getElementsByTagName("div")[0]
|
|
6425
|
+
max = typeof editorParams.max === "undefined" ? ((element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("max")) || 100) : editorParams.max,
|
|
6426
|
+
min = typeof editorParams.min === "undefined" ? ((element.getElementsByTagName("div")[0] && element.getElementsByTagName("div")[0].getAttribute("min")) || 0) : editorParams.min,
|
|
6427
6427
|
percent = (max - min) / 100,
|
|
6428
6428
|
value = cell.getValue() || 0,
|
|
6429
6429
|
handle = document.createElement("div"),
|
|
@@ -8655,7 +8655,7 @@ class Filter extends Module{
|
|
|
8655
8655
|
if(this.table.options.filterMode === "remote"){
|
|
8656
8656
|
this.reloadData();
|
|
8657
8657
|
}else {
|
|
8658
|
-
this.refreshData();
|
|
8658
|
+
this.refreshData(true);
|
|
8659
8659
|
}
|
|
8660
8660
|
}
|
|
8661
8661
|
|
|
@@ -9173,7 +9173,7 @@ function datetime(cell, formatterParams, onRendered){
|
|
|
9173
9173
|
var value = cell.getValue();
|
|
9174
9174
|
|
|
9175
9175
|
if(typeof DT != "undefined"){
|
|
9176
|
-
var newDatetime =
|
|
9176
|
+
var newDatetime = DT.fromFormat(String(value), inputFormat);
|
|
9177
9177
|
|
|
9178
9178
|
if(newDatetime.isValid){
|
|
9179
9179
|
|
|
@@ -9184,7 +9184,7 @@ function datetime(cell, formatterParams, onRendered){
|
|
|
9184
9184
|
return newDatetime.toFormat(outputFormat);
|
|
9185
9185
|
}else {
|
|
9186
9186
|
|
|
9187
|
-
if(invalid === true){
|
|
9187
|
+
if(invalid === true || !value){
|
|
9188
9188
|
return value;
|
|
9189
9189
|
}else if(typeof invalid === "function"){
|
|
9190
9190
|
return invalid(value);
|
|
@@ -9208,7 +9208,7 @@ function datetimediff (cell, formatterParams, onRendered) {
|
|
|
9208
9208
|
var value = cell.getValue();
|
|
9209
9209
|
|
|
9210
9210
|
if(typeof DT != "undefined"){
|
|
9211
|
-
var newDatetime = DT.fromFormat(value, inputFormat);
|
|
9211
|
+
var newDatetime = DT.fromFormat(String(value), inputFormat);
|
|
9212
9212
|
|
|
9213
9213
|
if (newDatetime.isValid){
|
|
9214
9214
|
if(humanize);else {
|
|
@@ -10305,10 +10305,16 @@ class Group{
|
|
|
10305
10305
|
group.wipe();
|
|
10306
10306
|
});
|
|
10307
10307
|
}else {
|
|
10308
|
-
this.
|
|
10309
|
-
|
|
10310
|
-
|
|
10308
|
+
this.rows.forEach((row) => {
|
|
10309
|
+
if(row.modules){
|
|
10310
|
+
delete row.modules.group;
|
|
10311
|
+
}
|
|
10312
|
+
});
|
|
10311
10313
|
}
|
|
10314
|
+
|
|
10315
|
+
this.element = false;
|
|
10316
|
+
this.arrowElement = false;
|
|
10317
|
+
this.elementContents = false;
|
|
10312
10318
|
}
|
|
10313
10319
|
|
|
10314
10320
|
createElements(){
|
|
@@ -10530,7 +10536,7 @@ class Group{
|
|
|
10530
10536
|
}
|
|
10531
10537
|
|
|
10532
10538
|
this.generateGroupHeaderContents();
|
|
10533
|
-
|
|
10539
|
+
|
|
10534
10540
|
if(this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.options.columnCalcs != "table"){
|
|
10535
10541
|
this.groupManager.table.modules.columnCalcs.recalcGroup(this);
|
|
10536
10542
|
}
|
|
@@ -11133,7 +11139,12 @@ class GroupRows extends Module{
|
|
|
11133
11139
|
|
|
11134
11140
|
setGroupBy(groups){
|
|
11135
11141
|
this.table.options.groupBy = groups;
|
|
11136
|
-
this.
|
|
11142
|
+
if(!this.initialized){
|
|
11143
|
+
this.initialize();
|
|
11144
|
+
}else {
|
|
11145
|
+
this.configureGroupSetup();
|
|
11146
|
+
}
|
|
11147
|
+
|
|
11137
11148
|
this.refreshData();
|
|
11138
11149
|
|
|
11139
11150
|
this.trackChanges();
|
|
@@ -11733,7 +11744,7 @@ class HtmlTableImport extends Module{
|
|
|
11733
11744
|
|
|
11734
11745
|
rows = rows ? rows.getElementsByTagName("tr") : [];
|
|
11735
11746
|
|
|
11736
|
-
//check for
|
|
11747
|
+
//check for Tabulator inline options
|
|
11737
11748
|
this._extractOptions(element, options);
|
|
11738
11749
|
|
|
11739
11750
|
if(headers.length){
|
|
@@ -11772,7 +11783,7 @@ class HtmlTableImport extends Module{
|
|
|
11772
11783
|
//extract tabulator attribute options
|
|
11773
11784
|
_extractOptions(element, options, defaultOptions){
|
|
11774
11785
|
var attributes = element.attributes;
|
|
11775
|
-
var optionsArr = defaultOptions ? Object.
|
|
11786
|
+
var optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);
|
|
11776
11787
|
var optionsList = {};
|
|
11777
11788
|
|
|
11778
11789
|
optionsArr.forEach((item) => {
|
|
@@ -11839,11 +11850,8 @@ class HtmlTableImport extends Module{
|
|
|
11839
11850
|
col.width = width;
|
|
11840
11851
|
}
|
|
11841
11852
|
|
|
11842
|
-
//check for
|
|
11843
|
-
header.
|
|
11844
|
-
|
|
11845
|
-
// //check for tablator inline options
|
|
11846
|
-
this._extractOptions(header, col, Column$1.prototype.defaultOptionList);
|
|
11853
|
+
//check for Tabulator inline options
|
|
11854
|
+
this._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);
|
|
11847
11855
|
|
|
11848
11856
|
this.fieldIndex[index] = col.field;
|
|
11849
11857
|
|
|
@@ -12820,10 +12828,10 @@ class Menu extends Module{
|
|
|
12820
12828
|
Menu.moduleName = "menu";
|
|
12821
12829
|
|
|
12822
12830
|
class MoveColumns extends Module{
|
|
12823
|
-
|
|
12831
|
+
|
|
12824
12832
|
constructor(table){
|
|
12825
12833
|
super(table);
|
|
12826
|
-
|
|
12834
|
+
|
|
12827
12835
|
this.placeholderElement = this.createPlaceholderElement();
|
|
12828
12836
|
this.hoverElement = false; //floating column header element
|
|
12829
12837
|
this.checkTimeout = false; //click check timeout holder
|
|
@@ -12836,35 +12844,36 @@ class MoveColumns extends Module{
|
|
|
12836
12844
|
this.autoScrollStep = 5; //auto scroll distance in pixels
|
|
12837
12845
|
this.autoScrollTimeout = false; //auto scroll timeout
|
|
12838
12846
|
this.touchMove = false;
|
|
12839
|
-
|
|
12847
|
+
|
|
12840
12848
|
this.moveHover = this.moveHover.bind(this);
|
|
12841
12849
|
this.endMove = this.endMove.bind(this);
|
|
12842
|
-
|
|
12850
|
+
|
|
12843
12851
|
this.registerTableOption("movableColumns", false); //enable movable columns
|
|
12844
12852
|
}
|
|
12845
|
-
|
|
12853
|
+
|
|
12846
12854
|
createPlaceholderElement(){
|
|
12847
12855
|
var el = document.createElement("div");
|
|
12848
|
-
|
|
12856
|
+
|
|
12849
12857
|
el.classList.add("tabulator-col");
|
|
12850
12858
|
el.classList.add("tabulator-col-placeholder");
|
|
12851
|
-
|
|
12859
|
+
|
|
12852
12860
|
return el;
|
|
12853
12861
|
}
|
|
12854
|
-
|
|
12862
|
+
|
|
12855
12863
|
initialize(){
|
|
12856
|
-
|
|
12864
|
+
if(this.table.options.movableColumns){
|
|
12865
|
+
this.subscribe("column-init", this.initializeColumn.bind(this));
|
|
12866
|
+
}
|
|
12857
12867
|
}
|
|
12858
|
-
|
|
12868
|
+
|
|
12859
12869
|
initializeColumn(column){
|
|
12860
12870
|
var self = this,
|
|
12861
12871
|
config = {},
|
|
12862
12872
|
colEl;
|
|
12863
|
-
|
|
12873
|
+
|
|
12864
12874
|
if(!column.modules.frozen){
|
|
12865
|
-
|
|
12866
12875
|
colEl = column.getElement();
|
|
12867
|
-
|
|
12876
|
+
|
|
12868
12877
|
config.mousemove = function(e){
|
|
12869
12878
|
if(column.parent === self.moving.parent){
|
|
12870
12879
|
if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){
|
|
@@ -12880,7 +12889,7 @@ class MoveColumns extends Module{
|
|
|
12880
12889
|
}
|
|
12881
12890
|
}
|
|
12882
12891
|
}.bind(self);
|
|
12883
|
-
|
|
12892
|
+
|
|
12884
12893
|
colEl.addEventListener("mousedown", function(e){
|
|
12885
12894
|
self.touchMove = false;
|
|
12886
12895
|
if(e.which === 1){
|
|
@@ -12889,7 +12898,7 @@ class MoveColumns extends Module{
|
|
|
12889
12898
|
}, self.checkPeriod);
|
|
12890
12899
|
}
|
|
12891
12900
|
});
|
|
12892
|
-
|
|
12901
|
+
|
|
12893
12902
|
colEl.addEventListener("mouseup", function(e){
|
|
12894
12903
|
if(e.which === 1){
|
|
12895
12904
|
if(self.checkTimeout){
|
|
@@ -12897,18 +12906,18 @@ class MoveColumns extends Module{
|
|
|
12897
12906
|
}
|
|
12898
12907
|
}
|
|
12899
12908
|
});
|
|
12900
|
-
|
|
12909
|
+
|
|
12901
12910
|
self.bindTouchEvents(column);
|
|
12902
12911
|
}
|
|
12903
|
-
|
|
12912
|
+
|
|
12904
12913
|
column.modules.moveColumn = config;
|
|
12905
12914
|
}
|
|
12906
|
-
|
|
12915
|
+
|
|
12907
12916
|
bindTouchEvents(column){
|
|
12908
12917
|
var colEl = column.getElement(),
|
|
12909
12918
|
startXMove = false, //shifting center position of the cell
|
|
12910
12919
|
nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;
|
|
12911
|
-
|
|
12920
|
+
|
|
12912
12921
|
colEl.addEventListener("touchstart", (e) => {
|
|
12913
12922
|
this.checkTimeout = setTimeout(() => {
|
|
12914
12923
|
this.touchMove = true;
|
|
@@ -12919,27 +12928,27 @@ class MoveColumns extends Module{
|
|
|
12919
12928
|
nextColWidthLast = 0;
|
|
12920
12929
|
prevColWidthLast = 0;
|
|
12921
12930
|
startXMove = false;
|
|
12922
|
-
|
|
12931
|
+
|
|
12923
12932
|
this.startMove(e, column);
|
|
12924
12933
|
}, this.checkPeriod);
|
|
12925
12934
|
}, {passive: true});
|
|
12926
|
-
|
|
12935
|
+
|
|
12927
12936
|
colEl.addEventListener("touchmove", (e) => {
|
|
12928
12937
|
var diff, moveToCol;
|
|
12929
|
-
|
|
12938
|
+
|
|
12930
12939
|
if(this.moving){
|
|
12931
12940
|
this.moveHover(e);
|
|
12932
|
-
|
|
12941
|
+
|
|
12933
12942
|
if(!startXMove){
|
|
12934
12943
|
startXMove = e.touches[0].pageX;
|
|
12935
12944
|
}
|
|
12936
|
-
|
|
12945
|
+
|
|
12937
12946
|
diff = e.touches[0].pageX - startXMove;
|
|
12938
|
-
|
|
12947
|
+
|
|
12939
12948
|
if(diff > 0){
|
|
12940
12949
|
if(nextCol && diff - nextColWidthLast > nextColWidth){
|
|
12941
12950
|
moveToCol = nextCol;
|
|
12942
|
-
|
|
12951
|
+
|
|
12943
12952
|
if(moveToCol !== column){
|
|
12944
12953
|
startXMove = e.touches[0].pageX;
|
|
12945
12954
|
moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);
|
|
@@ -12949,7 +12958,7 @@ class MoveColumns extends Module{
|
|
|
12949
12958
|
}else {
|
|
12950
12959
|
if(prevCol && -diff - prevColWidthLast > prevColWidth){
|
|
12951
12960
|
moveToCol = prevCol;
|
|
12952
|
-
|
|
12961
|
+
|
|
12953
12962
|
if(moveToCol !== column){
|
|
12954
12963
|
startXMove = e.touches[0].pageX;
|
|
12955
12964
|
moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());
|
|
@@ -12957,7 +12966,7 @@ class MoveColumns extends Module{
|
|
|
12957
12966
|
}
|
|
12958
12967
|
}
|
|
12959
12968
|
}
|
|
12960
|
-
|
|
12969
|
+
|
|
12961
12970
|
if(moveToCol){
|
|
12962
12971
|
nextCol = moveToCol.nextColumn();
|
|
12963
12972
|
nextColWidthLast = nextColWidth;
|
|
@@ -12968,7 +12977,7 @@ class MoveColumns extends Module{
|
|
|
12968
12977
|
}
|
|
12969
12978
|
}
|
|
12970
12979
|
}, {passive: true});
|
|
12971
|
-
|
|
12980
|
+
|
|
12972
12981
|
colEl.addEventListener("touchend", (e) => {
|
|
12973
12982
|
if(this.checkTimeout){
|
|
12974
12983
|
clearTimeout(this.checkTimeout);
|
|
@@ -12978,43 +12987,43 @@ class MoveColumns extends Module{
|
|
|
12978
12987
|
}
|
|
12979
12988
|
});
|
|
12980
12989
|
}
|
|
12981
|
-
|
|
12990
|
+
|
|
12982
12991
|
startMove(e, column){
|
|
12983
12992
|
var element = column.getElement(),
|
|
12984
12993
|
headerElement = this.table.columnManager.getElement(),
|
|
12985
12994
|
headersElement = this.table.columnManager.getHeadersElement();
|
|
12986
|
-
|
|
12995
|
+
|
|
12987
12996
|
this.moving = column;
|
|
12988
12997
|
this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
|
|
12989
|
-
|
|
12998
|
+
|
|
12990
12999
|
this.table.element.classList.add("tabulator-block-select");
|
|
12991
|
-
|
|
13000
|
+
|
|
12992
13001
|
//create placeholder
|
|
12993
13002
|
this.placeholderElement.style.width = column.getWidth() + "px";
|
|
12994
13003
|
this.placeholderElement.style.height = column.getHeight() + "px";
|
|
12995
|
-
|
|
13004
|
+
|
|
12996
13005
|
element.parentNode.insertBefore(this.placeholderElement, element);
|
|
12997
13006
|
element.parentNode.removeChild(element);
|
|
12998
|
-
|
|
13007
|
+
|
|
12999
13008
|
//create hover element
|
|
13000
13009
|
this.hoverElement = element.cloneNode(true);
|
|
13001
13010
|
this.hoverElement.classList.add("tabulator-moving");
|
|
13002
|
-
|
|
13011
|
+
|
|
13003
13012
|
this.table.columnManager.getElement().appendChild(this.hoverElement);
|
|
13004
|
-
|
|
13013
|
+
|
|
13005
13014
|
this.hoverElement.style.left = "0";
|
|
13006
13015
|
this.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + "px";
|
|
13007
|
-
|
|
13016
|
+
|
|
13008
13017
|
if(!this.touchMove){
|
|
13009
13018
|
this._bindMouseMove();
|
|
13010
|
-
|
|
13019
|
+
|
|
13011
13020
|
document.body.addEventListener("mousemove", this.moveHover);
|
|
13012
13021
|
document.body.addEventListener("mouseup", this.endMove);
|
|
13013
13022
|
}
|
|
13014
|
-
|
|
13023
|
+
|
|
13015
13024
|
this.moveHover(e);
|
|
13016
13025
|
}
|
|
13017
|
-
|
|
13026
|
+
|
|
13018
13027
|
_bindMouseMove(){
|
|
13019
13028
|
this.table.columnManager.columnsByIndex.forEach(function(column){
|
|
13020
13029
|
if(column.modules.moveColumn.mousemove){
|
|
@@ -13022,7 +13031,7 @@ class MoveColumns extends Module{
|
|
|
13022
13031
|
}
|
|
13023
13032
|
});
|
|
13024
13033
|
}
|
|
13025
|
-
|
|
13034
|
+
|
|
13026
13035
|
_unbindMouseMove(){
|
|
13027
13036
|
this.table.columnManager.columnsByIndex.forEach(function(column){
|
|
13028
13037
|
if(column.modules.moveColumn.mousemove){
|
|
@@ -13030,17 +13039,17 @@ class MoveColumns extends Module{
|
|
|
13030
13039
|
}
|
|
13031
13040
|
});
|
|
13032
13041
|
}
|
|
13033
|
-
|
|
13042
|
+
|
|
13034
13043
|
moveColumn(column, after){
|
|
13035
13044
|
var movingCells = this.moving.getCells();
|
|
13036
|
-
|
|
13045
|
+
|
|
13037
13046
|
this.toCol = column;
|
|
13038
13047
|
this.toColAfter = after;
|
|
13039
|
-
|
|
13048
|
+
|
|
13040
13049
|
if(after){
|
|
13041
13050
|
column.getCells().forEach(function(cell, i){
|
|
13042
13051
|
var cellEl = cell.getElement(true);
|
|
13043
|
-
|
|
13052
|
+
|
|
13044
13053
|
if(cellEl.parentNode && movingCells[i]){
|
|
13045
13054
|
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
|
|
13046
13055
|
}
|
|
@@ -13048,47 +13057,47 @@ class MoveColumns extends Module{
|
|
|
13048
13057
|
}else {
|
|
13049
13058
|
column.getCells().forEach(function(cell, i){
|
|
13050
13059
|
var cellEl = cell.getElement(true);
|
|
13051
|
-
|
|
13060
|
+
|
|
13052
13061
|
if(cellEl.parentNode && movingCells[i]){
|
|
13053
13062
|
cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
|
|
13054
13063
|
}
|
|
13055
13064
|
});
|
|
13056
13065
|
}
|
|
13057
13066
|
}
|
|
13058
|
-
|
|
13067
|
+
|
|
13059
13068
|
endMove(e){
|
|
13060
13069
|
if(e.which === 1 || this.touchMove){
|
|
13061
13070
|
this._unbindMouseMove();
|
|
13062
|
-
|
|
13071
|
+
|
|
13063
13072
|
this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);
|
|
13064
13073
|
this.placeholderElement.parentNode.removeChild(this.placeholderElement);
|
|
13065
13074
|
this.hoverElement.parentNode.removeChild(this.hoverElement);
|
|
13066
|
-
|
|
13075
|
+
|
|
13067
13076
|
this.table.element.classList.remove("tabulator-block-select");
|
|
13068
|
-
|
|
13077
|
+
|
|
13069
13078
|
if(this.toCol){
|
|
13070
13079
|
this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);
|
|
13071
13080
|
}
|
|
13072
|
-
|
|
13081
|
+
|
|
13073
13082
|
this.moving = false;
|
|
13074
13083
|
this.toCol = false;
|
|
13075
13084
|
this.toColAfter = false;
|
|
13076
|
-
|
|
13085
|
+
|
|
13077
13086
|
if(!this.touchMove){
|
|
13078
13087
|
document.body.removeEventListener("mousemove", this.moveHover);
|
|
13079
13088
|
document.body.removeEventListener("mouseup", this.endMove);
|
|
13080
13089
|
}
|
|
13081
13090
|
}
|
|
13082
13091
|
}
|
|
13083
|
-
|
|
13092
|
+
|
|
13084
13093
|
moveHover(e){
|
|
13085
13094
|
var columnHolder = this.table.columnManager.getElement(),
|
|
13086
13095
|
scrollLeft = columnHolder.scrollLeft,
|
|
13087
13096
|
xPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,
|
|
13088
13097
|
scrollPos;
|
|
13089
|
-
|
|
13098
|
+
|
|
13090
13099
|
this.hoverElement.style.left = (xPos - this.startX) + "px";
|
|
13091
|
-
|
|
13100
|
+
|
|
13092
13101
|
if(xPos - scrollLeft < this.autoScrollMargin){
|
|
13093
13102
|
if(!this.autoScrollTimeout){
|
|
13094
13103
|
this.autoScrollTimeout = setTimeout(() => {
|
|
@@ -13098,7 +13107,7 @@ class MoveColumns extends Module{
|
|
|
13098
13107
|
}, 1);
|
|
13099
13108
|
}
|
|
13100
13109
|
}
|
|
13101
|
-
|
|
13110
|
+
|
|
13102
13111
|
if(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){
|
|
13103
13112
|
if(!this.autoScrollTimeout){
|
|
13104
13113
|
this.autoScrollTimeout = setTimeout(() => {
|
|
@@ -14074,7 +14083,8 @@ class Page extends Module{
|
|
|
14074
14083
|
margin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);
|
|
14075
14084
|
|
|
14076
14085
|
if(diff < margin){
|
|
14077
|
-
this.nextPage()
|
|
14086
|
+
this.nextPage()
|
|
14087
|
+
.catch(() => {}); //consume the exception thrown when on the last page
|
|
14078
14088
|
}
|
|
14079
14089
|
}
|
|
14080
14090
|
}
|
|
@@ -16405,7 +16415,7 @@ class SelectRow extends Module{
|
|
|
16405
16415
|
this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
|
|
16406
16416
|
this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
|
|
16407
16417
|
|
|
16408
|
-
if(this.table.options.selectable && this.table.options.selectablePersistence){
|
|
16418
|
+
if(this.table.options.selectable && !this.table.options.selectablePersistence){
|
|
16409
16419
|
this.subscribe("data-refeshing", this.deselectRows.bind(this));
|
|
16410
16420
|
}
|
|
16411
16421
|
}
|
|
@@ -16666,6 +16676,7 @@ class SelectRow extends Module{
|
|
|
16666
16676
|
var self = this,
|
|
16667
16677
|
rowCount;
|
|
16668
16678
|
|
|
16679
|
+
console.trace("deselect");
|
|
16669
16680
|
if(typeof rows == "undefined"){
|
|
16670
16681
|
|
|
16671
16682
|
rowCount = self.selectedRows.length;
|
|
@@ -16883,8 +16894,9 @@ function datetime$1(a, b, aRow, bRow, column, dir, params){
|
|
|
16883
16894
|
emptyAlign = 0;
|
|
16884
16895
|
|
|
16885
16896
|
if(typeof DT != "undefined"){
|
|
16886
|
-
a = DT.fromFormat(a, format);
|
|
16887
|
-
b = DT.fromFormat(b, format);
|
|
16897
|
+
a = DT.fromFormat(String(a), format);
|
|
16898
|
+
b = DT.fromFormat(String(b), format);
|
|
16899
|
+
|
|
16888
16900
|
if(!a.isValid){
|
|
16889
16901
|
emptyAlign = !b.isValid ? 0 : -1;
|
|
16890
16902
|
}else if(!b.isValid){
|
|
@@ -17255,7 +17267,7 @@ class Sort extends Module{
|
|
|
17255
17267
|
if(this.table.options.sortMode === "remote"){
|
|
17256
17268
|
this.reloadData();
|
|
17257
17269
|
}else {
|
|
17258
|
-
this.refreshData();
|
|
17270
|
+
this.refreshData(true);
|
|
17259
17271
|
}
|
|
17260
17272
|
|
|
17261
17273
|
//TODO - Persist left position of row manager
|
|
@@ -17909,7 +17921,7 @@ var modules = /*#__PURE__*/Object.freeze({
|
|
|
17909
17921
|
ValidateModule: Validate
|
|
17910
17922
|
});
|
|
17911
17923
|
|
|
17912
|
-
var defaultOptions
|
|
17924
|
+
var defaultOptions = {
|
|
17913
17925
|
|
|
17914
17926
|
debugEventsExternal:false, //flag to console log events
|
|
17915
17927
|
debugEventsInternal:false, //flag to console log events
|
|
@@ -17971,10 +17983,10 @@ var defaultOptions$1 = {
|
|
|
17971
17983
|
};
|
|
17972
17984
|
|
|
17973
17985
|
class OptionsList {
|
|
17974
|
-
constructor(table, msgType){
|
|
17986
|
+
constructor(table, msgType, defaults = {}){
|
|
17975
17987
|
this.table = table;
|
|
17976
17988
|
this.msgType = msgType;
|
|
17977
|
-
this.registeredDefaults = {};
|
|
17989
|
+
this.registeredDefaults = Object.assign({}, defaults);
|
|
17978
17990
|
}
|
|
17979
17991
|
|
|
17980
17992
|
register(option, value){
|
|
@@ -18714,7 +18726,7 @@ class ColumnManager extends CoreFeature {
|
|
|
18714
18726
|
this.columnsByIndex = []; //columns by index
|
|
18715
18727
|
this.columnsByField = {}; //columns by field
|
|
18716
18728
|
this.scrollLeft = 0;
|
|
18717
|
-
this.optionsList = new OptionsList(this.table, "column definition");
|
|
18729
|
+
this.optionsList = new OptionsList(this.table, "column definition", defaultColumnOptions);
|
|
18718
18730
|
|
|
18719
18731
|
this.renderer = null;
|
|
18720
18732
|
}
|
|
@@ -21144,7 +21156,7 @@ class InteractionManager extends CoreFeature {
|
|
|
21144
21156
|
constructor (table){
|
|
21145
21157
|
super(table);
|
|
21146
21158
|
|
|
21147
|
-
this.el =
|
|
21159
|
+
this.el = null;
|
|
21148
21160
|
|
|
21149
21161
|
this.abortClasses = ["tabulator-headers", "tabulator-table"];
|
|
21150
21162
|
|
|
@@ -21169,7 +21181,10 @@ class InteractionManager extends CoreFeature {
|
|
|
21169
21181
|
"tabulator-group":"group",
|
|
21170
21182
|
"tabulator-col":"column",
|
|
21171
21183
|
};
|
|
21184
|
+
}
|
|
21172
21185
|
|
|
21186
|
+
initialize(){
|
|
21187
|
+
this.el = this.table.element;
|
|
21173
21188
|
this.buildListenerMap();
|
|
21174
21189
|
this.bindSubscriptionWatchers();
|
|
21175
21190
|
}
|
|
@@ -21347,7 +21362,7 @@ class InteractionManager extends CoreFeature {
|
|
|
21347
21362
|
}
|
|
21348
21363
|
}
|
|
21349
21364
|
|
|
21350
|
-
class
|
|
21365
|
+
class ComponentFunctionBinder{
|
|
21351
21366
|
|
|
21352
21367
|
constructor(table){
|
|
21353
21368
|
this.table = table;
|
|
@@ -22560,11 +22575,11 @@ class Tabulator {
|
|
|
22560
22575
|
this.interactionMonitor = false; //track user interaction
|
|
22561
22576
|
this.browser = ""; //hold current browser type
|
|
22562
22577
|
this.browserSlow = false; //handle reduced functionality for slower browsers
|
|
22563
|
-
this.browserMobile = false; //check if running on
|
|
22578
|
+
this.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance
|
|
22564
22579
|
this.rtl = false; //check if the table is in RTL mode
|
|
22565
22580
|
this.originalElement = null; //hold original table element if it has been replaced
|
|
22566
22581
|
|
|
22567
|
-
this.componentFunctionBinder = new
|
|
22582
|
+
this.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions
|
|
22568
22583
|
this.dataLoader = false; //bind component functions
|
|
22569
22584
|
|
|
22570
22585
|
this.modules = {}; //hold all modules bound to this table
|
|
@@ -22579,13 +22594,13 @@ class Tabulator {
|
|
|
22579
22594
|
|
|
22580
22595
|
this.initialzeCoreSystems(options);
|
|
22581
22596
|
|
|
22582
|
-
//delay table creation to allow event bindings
|
|
22597
|
+
//delay table creation to allow event bindings immediately after the constructor
|
|
22583
22598
|
setTimeout(() => {
|
|
22584
22599
|
this._create();
|
|
22585
22600
|
});
|
|
22586
22601
|
}
|
|
22587
22602
|
|
|
22588
|
-
TableRegistry.register(this); //register table for
|
|
22603
|
+
TableRegistry.register(this); //register table for inter-device communication
|
|
22589
22604
|
}
|
|
22590
22605
|
|
|
22591
22606
|
initializeElement(element){
|
|
@@ -22619,7 +22634,7 @@ class Tabulator {
|
|
|
22619
22634
|
|
|
22620
22635
|
this._clearObjectPointers();
|
|
22621
22636
|
|
|
22622
|
-
this.
|
|
22637
|
+
this._mapDeprecatedFunctionality();
|
|
22623
22638
|
|
|
22624
22639
|
this.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);
|
|
22625
22640
|
this.eventBus = new InternalEventBus(this.options.debugEventsInternal);
|
|
@@ -22632,8 +22647,8 @@ class Tabulator {
|
|
|
22632
22647
|
this.footerManager.initialize();
|
|
22633
22648
|
}
|
|
22634
22649
|
|
|
22635
|
-
//convert
|
|
22636
|
-
|
|
22650
|
+
//convert deprecated functionality to new functions
|
|
22651
|
+
_mapDeprecatedFunctionality(){
|
|
22637
22652
|
//all previously deprecated functionality removed in the 5.0 release
|
|
22638
22653
|
}
|
|
22639
22654
|
|
|
@@ -22654,7 +22669,7 @@ class Tabulator {
|
|
|
22654
22669
|
this.element.classList.remove("tabulator-block-select");
|
|
22655
22670
|
}
|
|
22656
22671
|
|
|
22657
|
-
//
|
|
22672
|
+
//create table
|
|
22658
22673
|
_create(){
|
|
22659
22674
|
this.externalEvents.dispatch("tableBuilding");
|
|
22660
22675
|
this.eventBus.dispatch("table-building");
|
|
@@ -22758,6 +22773,8 @@ class Tabulator {
|
|
|
22758
22773
|
var element = this.element,
|
|
22759
22774
|
options = this.options;
|
|
22760
22775
|
|
|
22776
|
+
this.interactionMonitor.initialize();
|
|
22777
|
+
|
|
22761
22778
|
this.columnManager.initialize();
|
|
22762
22779
|
this.rowManager.initialize();
|
|
22763
22780
|
|
|
@@ -22816,7 +22833,7 @@ class Tabulator {
|
|
|
22816
22833
|
destroy(){
|
|
22817
22834
|
var element = this.element;
|
|
22818
22835
|
|
|
22819
|
-
TableRegistry.deregister(this); //deregister table from
|
|
22836
|
+
TableRegistry.deregister(this); //deregister table from inter-device communication
|
|
22820
22837
|
|
|
22821
22838
|
this.eventBus.dispatch("table-destroy");
|
|
22822
22839
|
|
|
@@ -23169,7 +23186,7 @@ class Tabulator {
|
|
|
23169
23186
|
if(row){
|
|
23170
23187
|
return row.updateData(data)
|
|
23171
23188
|
.then(()=>{
|
|
23172
|
-
resolve(row.getComponent());
|
|
23189
|
+
return Promise.resolve(row.getComponent());
|
|
23173
23190
|
})
|
|
23174
23191
|
}else {
|
|
23175
23192
|
console.warn("Update Error - No matching row found:", index);
|
|
@@ -23200,11 +23217,7 @@ class Tabulator {
|
|
|
23200
23217
|
}
|
|
23201
23218
|
|
|
23202
23219
|
getRows(active){
|
|
23203
|
-
|
|
23204
|
-
return this.rowManager.getComponents(active);
|
|
23205
|
-
}else {
|
|
23206
|
-
console.warn("getRows failed - table not yet initialized. Please wait for the `tableBuilt` event before calling this function.");
|
|
23207
|
-
}
|
|
23220
|
+
return this.rowManager.getComponents(active);
|
|
23208
23221
|
}
|
|
23209
23222
|
|
|
23210
23223
|
//get position of row in table
|
|
@@ -23403,7 +23416,7 @@ class Tabulator {
|
|
|
23403
23416
|
}
|
|
23404
23417
|
|
|
23405
23418
|
//default setup options
|
|
23406
|
-
Tabulator.defaultOptions = defaultOptions
|
|
23419
|
+
Tabulator.defaultOptions = defaultOptions;
|
|
23407
23420
|
|
|
23408
23421
|
//bind modules and static functionality
|
|
23409
23422
|
new ModuleBinder(Tabulator);
|