tabulator-tables 5.2.2 → 5.2.5
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_bootstrap5.css +57 -32
- 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 +12 -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/js/tabulator.js +175 -199
- 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 +122 -152
- 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/CoreFeature.js +2 -2
- package/src/js/core/RowManager.js +3 -1
- package/src/js/core/cell/Cell.js +1 -2
- package/src/js/core/column/Column.js +1 -81
- package/src/js/core/rendering/Renderer.js +4 -0
- package/src/js/core/tools/DataLoader.js +3 -3
- package/src/js/core/tools/Popup.js +6 -0
- package/src/js/modules/DataTree/DataTree.js +17 -0
- package/src/js/modules/Download/defaults/downloaders/csv.js +2 -3
- package/src/js/modules/Download/defaults/downloaders/pdf.js +2 -3
- package/src/js/modules/Edit/List.js +3 -3
- package/src/js/modules/Export/Export.js +1 -2
- package/src/js/modules/Filter/Filter.js +1 -1
- package/src/js/modules/FrozenColumns/FrozenColumns.js +33 -41
- package/src/js/modules/GroupRows/GroupRows.js +4 -0
- package/src/js/modules/Interaction/Interaction.js +3 -3
- package/src/js/modules/MoveColumns/MoveColumns.js +1 -1
- package/src/js/modules/Page/Page.js +1 -2
- package/src/js/modules/Persistence/Persistence.js +1 -0
- package/src/js/modules/ResizeColumns/ResizeColumns.js +38 -7
- package/src/js/modules/Sort/Sort.js +2 -2
- package/src/js/modules/Validate/Validate.js +3 -3
- package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +61 -32
- package/src/scss/themes/bulma/tabulator_bulma.scss +47 -32
package/dist/js/tabulator_esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Tabulator v5.2.
|
|
1
|
+
/* Tabulator v5.2.5 (c) Oliver Folkerd 2022 */
|
|
2
2
|
class CoreFeature{
|
|
3
3
|
|
|
4
4
|
constructor(table){
|
|
@@ -9,8 +9,8 @@ class CoreFeature{
|
|
|
9
9
|
/////////////// DataLoad /////////////////
|
|
10
10
|
//////////////////////////////////////////
|
|
11
11
|
|
|
12
|
-
reloadData(data, silent){
|
|
13
|
-
return this.table.dataLoader.load(data, undefined, undefined, undefined, silent);
|
|
12
|
+
reloadData(data, silent, columnsChanged){
|
|
13
|
+
return this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
//////////////////////////////////////////
|
|
@@ -194,6 +194,8 @@ class Popup extends CoreFeature{
|
|
|
194
194
|
|
|
195
195
|
this.blurEvent = this.hide.bind(this, false);
|
|
196
196
|
this.escEvent = this._escapeCheck.bind(this);
|
|
197
|
+
|
|
198
|
+
this.destroyBinding = this.hide.bind(this, true);
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
_lookupContainer(){
|
|
@@ -311,6 +313,8 @@ class Popup extends CoreFeature{
|
|
|
311
313
|
this._fitToScreen(x, y, parentEl, parentOffset, position);
|
|
312
314
|
|
|
313
315
|
this.visible = true;
|
|
316
|
+
|
|
317
|
+
this.subscribe("table-destroy", this.destroyBinding);
|
|
314
318
|
|
|
315
319
|
return this;
|
|
316
320
|
}
|
|
@@ -406,6 +410,8 @@ class Popup extends CoreFeature{
|
|
|
406
410
|
if(this.blurCallback && !silent){
|
|
407
411
|
this.blurCallback();
|
|
408
412
|
}
|
|
413
|
+
|
|
414
|
+
this.unsubscribe("table-destroy", this.destroyBinding);
|
|
409
415
|
}
|
|
410
416
|
|
|
411
417
|
return this;
|
|
@@ -1564,7 +1570,6 @@ class Cell extends CoreFeature{
|
|
|
1564
1570
|
}
|
|
1565
1571
|
break;
|
|
1566
1572
|
case "undefined":
|
|
1567
|
-
case "null":
|
|
1568
1573
|
this.element.innerHTML = "";
|
|
1569
1574
|
break;
|
|
1570
1575
|
default:
|
|
@@ -2066,8 +2071,6 @@ class Column extends CoreFeature{
|
|
|
2066
2071
|
}
|
|
2067
2072
|
}
|
|
2068
2073
|
|
|
2069
|
-
this.contentElement = this._bindEvents();
|
|
2070
|
-
|
|
2071
2074
|
this.contentElement = this._buildColumnHeaderContent();
|
|
2072
2075
|
|
|
2073
2076
|
this.element.appendChild(this.contentElement);
|
|
@@ -2081,83 +2084,6 @@ class Column extends CoreFeature{
|
|
|
2081
2084
|
this.dispatch("column-init", this);
|
|
2082
2085
|
}
|
|
2083
2086
|
|
|
2084
|
-
_bindEvents(){
|
|
2085
|
-
var def = this.definition,
|
|
2086
|
-
dblTap, tapHold, tap;
|
|
2087
|
-
|
|
2088
|
-
//setup header click event bindings
|
|
2089
|
-
if(typeof(def.headerClick) == "function"){
|
|
2090
|
-
this.element.addEventListener("click", (e) => {def.headerClick(e, this.getComponent());});
|
|
2091
|
-
}
|
|
2092
|
-
|
|
2093
|
-
if(typeof(def.headerDblClick) == "function"){
|
|
2094
|
-
this.element.addEventListener("dblclick", (e) => {def.headerDblClick(e, this.getComponent());});
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
if(typeof(def.headerContext) == "function"){
|
|
2098
|
-
this.element.addEventListener("contextmenu", (e) => {def.headerContext(e, this.getComponent());});
|
|
2099
|
-
}
|
|
2100
|
-
|
|
2101
|
-
//setup header tap event bindings
|
|
2102
|
-
if(typeof(def.headerTap) == "function"){
|
|
2103
|
-
tap = false;
|
|
2104
|
-
|
|
2105
|
-
this.element.addEventListener("touchstart", (e) => {
|
|
2106
|
-
tap = true;
|
|
2107
|
-
}, {passive: true});
|
|
2108
|
-
|
|
2109
|
-
this.element.addEventListener("touchend", (e) => {
|
|
2110
|
-
if(tap){
|
|
2111
|
-
def.headerTap(e, this.getComponent());
|
|
2112
|
-
}
|
|
2113
|
-
|
|
2114
|
-
tap = false;
|
|
2115
|
-
});
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
if(typeof(def.headerDblTap) == "function"){
|
|
2119
|
-
dblTap = null;
|
|
2120
|
-
|
|
2121
|
-
this.element.addEventListener("touchend", (e) => {
|
|
2122
|
-
|
|
2123
|
-
if(dblTap){
|
|
2124
|
-
clearTimeout(dblTap);
|
|
2125
|
-
dblTap = null;
|
|
2126
|
-
|
|
2127
|
-
def.headerDblTap(e, this.getComponent());
|
|
2128
|
-
}else {
|
|
2129
|
-
|
|
2130
|
-
dblTap = setTimeout(() => {
|
|
2131
|
-
clearTimeout(dblTap);
|
|
2132
|
-
dblTap = null;
|
|
2133
|
-
}, 300);
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
});
|
|
2137
|
-
}
|
|
2138
|
-
|
|
2139
|
-
if(typeof(def.headerTapHold) == "function"){
|
|
2140
|
-
tapHold = null;
|
|
2141
|
-
|
|
2142
|
-
this.element.addEventListener("touchstart", (e) => {
|
|
2143
|
-
clearTimeout(tapHold);
|
|
2144
|
-
|
|
2145
|
-
tapHold = setTimeout(function(){
|
|
2146
|
-
clearTimeout(tapHold);
|
|
2147
|
-
tapHold = null;
|
|
2148
|
-
tap = false;
|
|
2149
|
-
def.headerTapHold(e, this.getComponent());
|
|
2150
|
-
}, 1000);
|
|
2151
|
-
|
|
2152
|
-
}, {passive: true});
|
|
2153
|
-
|
|
2154
|
-
this.element.addEventListener("touchend", (e) => {
|
|
2155
|
-
clearTimeout(tapHold);
|
|
2156
|
-
tapHold = null;
|
|
2157
|
-
});
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
2087
|
//build header element for header
|
|
2162
2088
|
_buildColumnHeader(){
|
|
2163
2089
|
var def = this.definition,
|
|
@@ -2284,7 +2210,6 @@ class Column extends CoreFeature{
|
|
|
2284
2210
|
}
|
|
2285
2211
|
break;
|
|
2286
2212
|
case "undefined":
|
|
2287
|
-
case "null":
|
|
2288
2213
|
el.innerHTML = "";
|
|
2289
2214
|
break;
|
|
2290
2215
|
default:
|
|
@@ -4138,11 +4063,24 @@ class DataTree extends Module{
|
|
|
4138
4063
|
this.subscribe("edit-cancelled", this.cellValueChanged.bind(this));
|
|
4139
4064
|
this.subscribe("column-moving-rows", this.columnMoving.bind(this));
|
|
4140
4065
|
this.subscribe("table-built", this.initializeElementField.bind(this));
|
|
4066
|
+
this.subscribe("table-redrawing", this.tableRedrawing.bind(this));
|
|
4141
4067
|
|
|
4142
4068
|
this.registerDisplayHandler(this.getRows.bind(this), 30);
|
|
4143
4069
|
}
|
|
4144
4070
|
}
|
|
4145
4071
|
|
|
4072
|
+
tableRedrawing(force){
|
|
4073
|
+
var rows;
|
|
4074
|
+
|
|
4075
|
+
if(force){
|
|
4076
|
+
rows = this.table.rowManager.getRows();
|
|
4077
|
+
|
|
4078
|
+
rows.forEach((row) => {
|
|
4079
|
+
this.reinitializeRowChildren(row);
|
|
4080
|
+
});
|
|
4081
|
+
}
|
|
4082
|
+
}
|
|
4083
|
+
|
|
4146
4084
|
initializeElementField(){
|
|
4147
4085
|
var firstCol = this.table.columnManager.getFirstVisibleColumn();
|
|
4148
4086
|
|
|
@@ -4435,6 +4373,10 @@ class DataTree extends Module{
|
|
|
4435
4373
|
return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;
|
|
4436
4374
|
}
|
|
4437
4375
|
|
|
4376
|
+
getTreeParentRoot(row){
|
|
4377
|
+
return row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4438
4380
|
getFilteredTreeChildren(row){
|
|
4439
4381
|
var config = row.modules.dataTree,
|
|
4440
4382
|
output = [], children;
|
|
@@ -4633,11 +4575,10 @@ function csv(list, options, setFileContents){
|
|
|
4633
4575
|
|
|
4634
4576
|
switch(typeof col.value){
|
|
4635
4577
|
case "object":
|
|
4636
|
-
col.value = JSON.stringify(col.value);
|
|
4578
|
+
col.value = col.value !== null ? JSON.stringify(col.value) : "";
|
|
4637
4579
|
break;
|
|
4638
4580
|
|
|
4639
4581
|
case "undefined":
|
|
4640
|
-
case "null":
|
|
4641
4582
|
col.value = "";
|
|
4642
4583
|
break;
|
|
4643
4584
|
}
|
|
@@ -4757,11 +4698,10 @@ function pdf(list, options, setFileContents){
|
|
|
4757
4698
|
if(col){
|
|
4758
4699
|
switch(typeof col.value){
|
|
4759
4700
|
case "object":
|
|
4760
|
-
col.value = JSON.stringify(col.value);
|
|
4701
|
+
col.value = col.value !== null ? JSON.stringify(col.value) : "";
|
|
4761
4702
|
break;
|
|
4762
4703
|
|
|
4763
4704
|
case "undefined":
|
|
4764
|
-
case "null":
|
|
4765
4705
|
col.value = "";
|
|
4766
4706
|
break;
|
|
4767
4707
|
}
|
|
@@ -5614,7 +5554,7 @@ class Edit{
|
|
|
5614
5554
|
this.initialValues = this.params.multiselect ? initialValue : [initialValue];
|
|
5615
5555
|
|
|
5616
5556
|
if(this.isFilter){
|
|
5617
|
-
this.input.value = this.initialValues.join(",");
|
|
5557
|
+
this.input.value = this.initialValues ? this.initialValues.join(",") : "";
|
|
5618
5558
|
this.headerFilterInitialListGen();
|
|
5619
5559
|
}
|
|
5620
5560
|
}
|
|
@@ -6019,7 +5959,7 @@ class Edit{
|
|
|
6019
5959
|
values = this._ajaxRequest(this.params.valuesURL, this.input.value);
|
|
6020
5960
|
}else {
|
|
6021
5961
|
if(typeof this.params.valuesLookup === "function"){
|
|
6022
|
-
values = this.params.valuesLookup(cell, this.input.value);
|
|
5962
|
+
values = this.params.valuesLookup(this.cell, this.input.value);
|
|
6023
5963
|
}else if(this.params.valuesLookup){
|
|
6024
5964
|
values = this._uniqueColumnValues(this.params.valuesLookupField);
|
|
6025
5965
|
}
|
|
@@ -8171,11 +8111,10 @@ class Export extends Module{
|
|
|
8171
8111
|
}else {
|
|
8172
8112
|
switch(typeof value){
|
|
8173
8113
|
case "object":
|
|
8174
|
-
value = JSON.stringify(value);
|
|
8114
|
+
value = value !== null ? JSON.stringify(value) : "";
|
|
8175
8115
|
break;
|
|
8176
8116
|
|
|
8177
8117
|
case "undefined":
|
|
8178
|
-
case "null":
|
|
8179
8118
|
value = "";
|
|
8180
8119
|
break;
|
|
8181
8120
|
|
|
@@ -8934,7 +8873,7 @@ class Filter extends Module{
|
|
|
8934
8873
|
refreshFilter(){
|
|
8935
8874
|
if(this.tableInitialized){
|
|
8936
8875
|
if(this.table.options.filterMode === "remote"){
|
|
8937
|
-
this.reloadData();
|
|
8876
|
+
this.reloadData(null, false, false);
|
|
8938
8877
|
}else {
|
|
8939
8878
|
this.refreshData(true);
|
|
8940
8879
|
}
|
|
@@ -10130,7 +10069,6 @@ class FrozenColumns extends Module{
|
|
|
10130
10069
|
this.rightPadding = 0;
|
|
10131
10070
|
this.initializationMode = "left";
|
|
10132
10071
|
this.active = false;
|
|
10133
|
-
this.scrollEndTimer = false;
|
|
10134
10072
|
this.blocked = true;
|
|
10135
10073
|
|
|
10136
10074
|
this.registerColumnOption("frozen");
|
|
@@ -10159,10 +10097,10 @@ class FrozenColumns extends Module{
|
|
|
10159
10097
|
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
10160
10098
|
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
10161
10099
|
this.subscribe("columns-loading", this.reset.bind(this));
|
|
10162
|
-
|
|
10100
|
+
|
|
10163
10101
|
this.subscribe("column-add", this.reinitializeColumns.bind(this));
|
|
10164
10102
|
this.subscribe("column-delete", this.reinitializeColumns.bind(this));
|
|
10165
|
-
|
|
10103
|
+
|
|
10166
10104
|
this.subscribe("table-redraw", this.layout.bind(this));
|
|
10167
10105
|
this.subscribe("layout-refreshing", this.blockLayout.bind(this));
|
|
10168
10106
|
this.subscribe("layout-refreshed", this.unblockLayout.bind(this));
|
|
@@ -10179,10 +10117,10 @@ class FrozenColumns extends Module{
|
|
|
10179
10117
|
layoutCell(cell){
|
|
10180
10118
|
this.layoutElement(cell.element, cell.column);
|
|
10181
10119
|
}
|
|
10182
|
-
|
|
10120
|
+
|
|
10183
10121
|
reinitializeColumns(){
|
|
10184
10122
|
this.reset();
|
|
10185
|
-
|
|
10123
|
+
|
|
10186
10124
|
this.table.columnManager.columnsByIndex.forEach((column) => {
|
|
10187
10125
|
this.initializeColumn(column);
|
|
10188
10126
|
});
|
|
@@ -10227,24 +10165,15 @@ class FrozenColumns extends Module{
|
|
|
10227
10165
|
|
|
10228
10166
|
//quick layout to smooth horizontal scrolling
|
|
10229
10167
|
scrollHorizontal(){
|
|
10230
|
-
var rows;
|
|
10231
10168
|
|
|
10232
|
-
if(this.active){
|
|
10233
|
-
clearTimeout(this.scrollEndTimer);
|
|
10234
|
-
|
|
10235
|
-
rows = this.table.rowManager.getVisibleRows();
|
|
10236
|
-
|
|
10169
|
+
if(this.active){
|
|
10237
10170
|
this.calcMargins(true);
|
|
10238
10171
|
|
|
10239
10172
|
this.layoutColumnPosition();
|
|
10240
10173
|
|
|
10241
10174
|
this.layoutCalcRows();
|
|
10242
10175
|
|
|
10243
|
-
|
|
10244
|
-
if(row.type === "row"){
|
|
10245
|
-
this.layoutRow(row);
|
|
10246
|
-
}
|
|
10247
|
-
});
|
|
10176
|
+
this.reinitializeRows();
|
|
10248
10177
|
}
|
|
10249
10178
|
}
|
|
10250
10179
|
|
|
@@ -10256,7 +10185,7 @@ class FrozenColumns extends Module{
|
|
|
10256
10185
|
this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px";
|
|
10257
10186
|
this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
|
|
10258
10187
|
}
|
|
10259
|
-
|
|
10188
|
+
|
|
10260
10189
|
//calculate right frozen columns
|
|
10261
10190
|
this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;
|
|
10262
10191
|
}
|
|
@@ -10303,10 +10232,11 @@ class FrozenColumns extends Module{
|
|
|
10303
10232
|
|
|
10304
10233
|
this.table.columnManager.headersElement.style.marginLeft = this.leftMargin;
|
|
10305
10234
|
this.table.columnManager.element.style.paddingRight = this.rightMargin;
|
|
10306
|
-
|
|
10235
|
+
|
|
10307
10236
|
this.leftColumns.forEach((column, i) => {
|
|
10308
|
-
column.modules.frozen.
|
|
10309
|
-
|
|
10237
|
+
column.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;
|
|
10238
|
+
column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
|
|
10239
|
+
|
|
10310
10240
|
if(column.visible){
|
|
10311
10241
|
leftMargin += column.getWidth();
|
|
10312
10242
|
}
|
|
@@ -10339,12 +10269,13 @@ class FrozenColumns extends Module{
|
|
|
10339
10269
|
});
|
|
10340
10270
|
|
|
10341
10271
|
this.rightColumns.forEach((column, i) => {
|
|
10342
|
-
|
|
10272
|
+
|
|
10343
10273
|
if(column.visible){
|
|
10344
10274
|
rightMargin += column.getWidth();
|
|
10345
10275
|
}
|
|
10346
|
-
|
|
10347
|
-
column.modules.frozen.
|
|
10276
|
+
|
|
10277
|
+
column.modules.frozen.marginValue = this.rightPadding - rightMargin;
|
|
10278
|
+
column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
|
|
10348
10279
|
|
|
10349
10280
|
if(i == this.rightColumns.length - 1){
|
|
10350
10281
|
column.modules.frozen.edge = true;
|
|
@@ -10372,36 +10303,35 @@ class FrozenColumns extends Module{
|
|
|
10372
10303
|
}
|
|
10373
10304
|
|
|
10374
10305
|
//layout columns appropriately
|
|
10375
|
-
layout(){
|
|
10376
|
-
var visibleRows = [],
|
|
10377
|
-
otherRows = [];
|
|
10378
|
-
|
|
10306
|
+
layout(){
|
|
10379
10307
|
if(this.active && !this.blocked){
|
|
10380
10308
|
//calculate row padding
|
|
10381
10309
|
this.calcMargins();
|
|
10382
|
-
|
|
10310
|
+
|
|
10383
10311
|
//calculate left columns
|
|
10384
10312
|
this.layoutColumnPosition();
|
|
10385
10313
|
|
|
10386
|
-
|
|
10387
|
-
otherRows = this.table.rowManager.getDisplayRows().filter(row => !visibleRows.includes(row));
|
|
10388
|
-
|
|
10389
|
-
otherRows.forEach((row) =>{
|
|
10390
|
-
row.deinitialize();
|
|
10391
|
-
});
|
|
10392
|
-
|
|
10393
|
-
visibleRows.forEach((row) =>{
|
|
10394
|
-
if(row.type === "row"){
|
|
10395
|
-
this.layoutRow(row);
|
|
10396
|
-
}
|
|
10397
|
-
});
|
|
10314
|
+
this.reinitializeRows();
|
|
10398
10315
|
|
|
10399
10316
|
this.layoutCalcRows();
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
10317
|
}
|
|
10403
10318
|
}
|
|
10404
10319
|
|
|
10320
|
+
reinitializeRows(){
|
|
10321
|
+
var visibleRows = this.table.rowManager.getVisibleRows();
|
|
10322
|
+
var otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));
|
|
10323
|
+
|
|
10324
|
+
otherRows.forEach((row) =>{
|
|
10325
|
+
row.deinitialize();
|
|
10326
|
+
});
|
|
10327
|
+
|
|
10328
|
+
visibleRows.forEach((row) =>{
|
|
10329
|
+
if(row.type === "row"){
|
|
10330
|
+
this.layoutRow(row);
|
|
10331
|
+
}
|
|
10332
|
+
});
|
|
10333
|
+
}
|
|
10334
|
+
|
|
10405
10335
|
layoutRow(row){
|
|
10406
10336
|
// console.trace("row")
|
|
10407
10337
|
var rowEl = row.getElement();
|
|
@@ -11682,6 +11612,10 @@ class GroupRows extends Module{
|
|
|
11682
11612
|
getRowGroup(row){
|
|
11683
11613
|
var match = false;
|
|
11684
11614
|
|
|
11615
|
+
if(this.options("dataTree")){
|
|
11616
|
+
row = this.table.modules.dataTree.getTreeParentRoot(row);
|
|
11617
|
+
}
|
|
11618
|
+
|
|
11685
11619
|
this.groupList.forEach((group) => {
|
|
11686
11620
|
var result = group.getRowGroup(row);
|
|
11687
11621
|
|
|
@@ -13417,7 +13351,7 @@ class MoveColumns extends Module{
|
|
|
13417
13351
|
config = {},
|
|
13418
13352
|
colEl;
|
|
13419
13353
|
|
|
13420
|
-
if(!column.modules.frozen){
|
|
13354
|
+
if(!column.modules.frozen && !column.isGroup){
|
|
13421
13355
|
colEl = column.getElement();
|
|
13422
13356
|
|
|
13423
13357
|
config.mousemove = function(e){
|
|
@@ -15138,7 +15072,6 @@ class Page extends Module{
|
|
|
15138
15072
|
}
|
|
15139
15073
|
break;
|
|
15140
15074
|
case "undefined":
|
|
15141
|
-
case "null":
|
|
15142
15075
|
this.pageCounterElement.innerHTML = "";
|
|
15143
15076
|
break;
|
|
15144
15077
|
default:
|
|
@@ -15880,6 +15813,7 @@ class Persistence extends Module{
|
|
|
15880
15813
|
if(this.config.columns === true || this.config.columns == undefined){
|
|
15881
15814
|
keys = Object.keys(colDef);
|
|
15882
15815
|
keys.push("width");
|
|
15816
|
+
keys.push("visible");
|
|
15883
15817
|
}else {
|
|
15884
15818
|
keys = this.config.columns;
|
|
15885
15819
|
}
|
|
@@ -16600,6 +16534,7 @@ class ResizeColumns extends Module{
|
|
|
16600
16534
|
|
|
16601
16535
|
this.subscribe("column-hide", this.deInitializeColumn.bind(this));
|
|
16602
16536
|
this.subscribe("column-show", this.columnLayoutUpdated.bind(this));
|
|
16537
|
+
this.subscribe("column-width", this.columnWidthUpdated.bind(this));
|
|
16603
16538
|
|
|
16604
16539
|
this.subscribe("column-delete", this.deInitializeComponent.bind(this));
|
|
16605
16540
|
this.subscribe("column-height", this.resizeHandle.bind(this));
|
|
@@ -16634,14 +16569,38 @@ class ResizeColumns extends Module{
|
|
|
16634
16569
|
}
|
|
16635
16570
|
}
|
|
16636
16571
|
|
|
16572
|
+
columnWidthUpdated(column){
|
|
16573
|
+
if(column.modules.frozen){
|
|
16574
|
+
if(this.table.modules.frozenColumns.leftColumns.includes(column)){
|
|
16575
|
+
this.table.modules.frozenColumns.leftColumns.forEach((col) => {
|
|
16576
|
+
this.reinitializeColumn(col);
|
|
16577
|
+
});
|
|
16578
|
+
}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){
|
|
16579
|
+
this.table.modules.frozenColumns.rightColumns.forEach((col) => {
|
|
16580
|
+
this.reinitializeColumn(col);
|
|
16581
|
+
});
|
|
16582
|
+
}
|
|
16583
|
+
}
|
|
16584
|
+
}
|
|
16585
|
+
|
|
16637
16586
|
reinitializeColumn(column){
|
|
16587
|
+
var frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + "px") : false;
|
|
16588
|
+
|
|
16638
16589
|
column.cells.forEach((cell) => {
|
|
16639
16590
|
if(cell.modules.resize && cell.modules.resize.handleEl){
|
|
16591
|
+
if(frozenOffset){
|
|
16592
|
+
cell.modules.resize.handleEl.style.left = frozenOffset;
|
|
16593
|
+
}
|
|
16594
|
+
|
|
16640
16595
|
cell.element.after(cell.modules.resize.handleEl);
|
|
16641
16596
|
}
|
|
16642
16597
|
});
|
|
16643
16598
|
|
|
16644
16599
|
if(column.modules.resize && column.modules.resize.handleEl){
|
|
16600
|
+
if(frozenOffset){
|
|
16601
|
+
column.modules.resize.handleEl.style.left = frozenOffset;
|
|
16602
|
+
}
|
|
16603
|
+
|
|
16645
16604
|
column.element.after(column.modules.resize.handleEl);
|
|
16646
16605
|
}
|
|
16647
16606
|
}
|
|
@@ -16690,9 +16649,14 @@ class ResizeColumns extends Module{
|
|
|
16690
16649
|
}
|
|
16691
16650
|
});
|
|
16692
16651
|
|
|
16652
|
+
if(column.modules.frozen){
|
|
16653
|
+
handle.style.position = "absolute";
|
|
16654
|
+
handle.style.left = column.modules.frozen.marginValue + column.getWidth() + "px";
|
|
16655
|
+
}
|
|
16656
|
+
|
|
16693
16657
|
config.handleEl = handle;
|
|
16694
16658
|
|
|
16695
|
-
if(element.parentNode){
|
|
16659
|
+
if(element.parentNode && column.visible){
|
|
16696
16660
|
element.after(handle);
|
|
16697
16661
|
}
|
|
16698
16662
|
}
|
|
@@ -16740,27 +16704,27 @@ class ResizeColumns extends Module{
|
|
|
16740
16704
|
startDiff = x - self.startX,
|
|
16741
16705
|
moveDiff = x - self.latestX,
|
|
16742
16706
|
blockedBefore, blockedAfter;
|
|
16743
|
-
|
|
16707
|
+
|
|
16744
16708
|
self.latestX = x;
|
|
16745
16709
|
|
|
16746
16710
|
if(self.table.rtl){
|
|
16747
16711
|
startDiff = -startDiff;
|
|
16748
16712
|
moveDiff = -moveDiff;
|
|
16749
16713
|
}
|
|
16750
|
-
|
|
16714
|
+
|
|
16751
16715
|
blockedBefore = column.width == column.minWidth || column.width == column.maxWidth;
|
|
16752
|
-
|
|
16716
|
+
|
|
16753
16717
|
column.setWidth(self.startWidth + startDiff);
|
|
16754
|
-
|
|
16718
|
+
|
|
16755
16719
|
blockedAfter = column.width == column.minWidth || column.width == column.maxWidth;
|
|
16756
|
-
|
|
16720
|
+
|
|
16757
16721
|
if(moveDiff < 0){
|
|
16758
16722
|
self.nextColumn = self.initialNextColumn;
|
|
16759
16723
|
}
|
|
16760
16724
|
|
|
16761
16725
|
if(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){
|
|
16762
16726
|
let colWidth = self.nextColumn.getWidth();
|
|
16763
|
-
|
|
16727
|
+
|
|
16764
16728
|
if(moveDiff > 0){
|
|
16765
16729
|
if(colWidth <= self.nextColumn.minWidth){
|
|
16766
16730
|
self.nextColumn = self.nextColumn.nextColumn();
|
|
@@ -18301,7 +18265,7 @@ class Sort extends Module{
|
|
|
18301
18265
|
|
|
18302
18266
|
refreshSort(){
|
|
18303
18267
|
if(this.table.options.sortMode === "remote"){
|
|
18304
|
-
this.reloadData();
|
|
18268
|
+
this.reloadData(null, false, false);
|
|
18305
18269
|
}else {
|
|
18306
18270
|
this.refreshData(true);
|
|
18307
18271
|
}
|
|
@@ -18474,7 +18438,7 @@ class Sort extends Module{
|
|
|
18474
18438
|
//set the column header sort direction
|
|
18475
18439
|
setColumnHeader(column, dir){
|
|
18476
18440
|
column.modules.sort.dir = dir;
|
|
18477
|
-
column.getElement().setAttribute("aria-sort", dir);
|
|
18441
|
+
column.getElement().setAttribute("aria-sort", dir === "asc" ? "ascending" : "descending");
|
|
18478
18442
|
}
|
|
18479
18443
|
|
|
18480
18444
|
//sort each item in sort list
|
|
@@ -18874,7 +18838,7 @@ class Validate extends Module{
|
|
|
18874
18838
|
var invalid = [];
|
|
18875
18839
|
|
|
18876
18840
|
column.cells.forEach((cell) => {
|
|
18877
|
-
if(
|
|
18841
|
+
if(this.cellValidate(cell) !== true){
|
|
18878
18842
|
invalid.push(cell.getComponent());
|
|
18879
18843
|
}
|
|
18880
18844
|
});
|
|
@@ -18890,7 +18854,7 @@ class Validate extends Module{
|
|
|
18890
18854
|
var invalid = [];
|
|
18891
18855
|
|
|
18892
18856
|
row.cells.forEach((cell) => {
|
|
18893
|
-
if(
|
|
18857
|
+
if(this.cellValidate(cell) !== true){
|
|
18894
18858
|
invalid.push(cell.getComponent());
|
|
18895
18859
|
}
|
|
18896
18860
|
});
|
|
@@ -19418,6 +19382,10 @@ class Renderer extends CoreFeature{
|
|
|
19418
19382
|
}
|
|
19419
19383
|
|
|
19420
19384
|
break;
|
|
19385
|
+
|
|
19386
|
+
case "top":
|
|
19387
|
+
this.elementVertical.scrollTop = rowEl.offsetTop;
|
|
19388
|
+
break;
|
|
19421
19389
|
}
|
|
19422
19390
|
|
|
19423
19391
|
resolve();
|
|
@@ -21375,7 +21343,7 @@ class RowManager extends CoreFeature{
|
|
|
21375
21343
|
|
|
21376
21344
|
el.classList.add("tabulator-tableholder");
|
|
21377
21345
|
el.setAttribute("tabindex", 0);
|
|
21378
|
-
el.setAttribute("role", "rowgroup");
|
|
21346
|
+
// el.setAttribute("role", "rowgroup");
|
|
21379
21347
|
|
|
21380
21348
|
return el;
|
|
21381
21349
|
}
|
|
@@ -22168,7 +22136,9 @@ class RowManager extends CoreFeature{
|
|
|
22168
22136
|
this.redrawBlockRenderInPosition = true;
|
|
22169
22137
|
}
|
|
22170
22138
|
}else {
|
|
22139
|
+
this.dispatchExternal("renderStarted");
|
|
22171
22140
|
this.renderer.rerenderRows(callback);
|
|
22141
|
+
this.dispatchExternal("renderComplete");
|
|
22172
22142
|
}
|
|
22173
22143
|
}
|
|
22174
22144
|
|
|
@@ -22848,7 +22818,7 @@ class DataLoader extends CoreFeature{
|
|
|
22848
22818
|
|
|
22849
22819
|
initialize(){}
|
|
22850
22820
|
|
|
22851
|
-
load(data, params, config, replace, silent){
|
|
22821
|
+
load(data, params, config, replace, silent, columnsChanged){
|
|
22852
22822
|
var requestNo = ++this.requestOrder;
|
|
22853
22823
|
|
|
22854
22824
|
this.dispatchExternal("dataLoading", data);
|
|
@@ -22884,7 +22854,7 @@ class DataLoader extends CoreFeature{
|
|
|
22884
22854
|
|
|
22885
22855
|
if(rowData !== false){
|
|
22886
22856
|
this.dispatchExternal("dataLoaded", rowData);
|
|
22887
|
-
this.table.rowManager.setData(rowData, replace, !replace);
|
|
22857
|
+
this.table.rowManager.setData(rowData, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
|
|
22888
22858
|
}
|
|
22889
22859
|
}else {
|
|
22890
22860
|
console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made");
|
|
@@ -22911,7 +22881,7 @@ class DataLoader extends CoreFeature{
|
|
|
22911
22881
|
data = [];
|
|
22912
22882
|
}
|
|
22913
22883
|
|
|
22914
|
-
this.table.rowManager.setData(data, replace, !replace);
|
|
22884
|
+
this.table.rowManager.setData(data, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
|
|
22915
22885
|
return Promise.resolve();
|
|
22916
22886
|
}
|
|
22917
22887
|
}
|