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/package.json
CHANGED
|
@@ -8,8 +8,8 @@ export default class CoreFeature{
|
|
|
8
8
|
/////////////// DataLoad /////////////////
|
|
9
9
|
//////////////////////////////////////////
|
|
10
10
|
|
|
11
|
-
reloadData(data, silent){
|
|
12
|
-
return this.table.dataLoader.load(data, undefined, undefined, undefined, silent);
|
|
11
|
+
reloadData(data, silent, columnsChanged){
|
|
12
|
+
return this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
//////////////////////////////////////////
|
|
@@ -51,7 +51,7 @@ export default class RowManager extends CoreFeature{
|
|
|
51
51
|
|
|
52
52
|
el.classList.add("tabulator-tableholder");
|
|
53
53
|
el.setAttribute("tabindex", 0);
|
|
54
|
-
el.setAttribute("role", "rowgroup");
|
|
54
|
+
// el.setAttribute("role", "rowgroup");
|
|
55
55
|
|
|
56
56
|
return el;
|
|
57
57
|
}
|
|
@@ -848,7 +848,9 @@ export default class RowManager extends CoreFeature{
|
|
|
848
848
|
this.redrawBlockRenderInPosition = true;
|
|
849
849
|
}
|
|
850
850
|
}else{
|
|
851
|
+
this.dispatchExternal("renderStarted");
|
|
851
852
|
this.renderer.rerenderRows(callback);
|
|
853
|
+
this.dispatchExternal("renderComplete");
|
|
852
854
|
}
|
|
853
855
|
}
|
|
854
856
|
|
package/src/js/core/cell/Cell.js
CHANGED
|
@@ -118,7 +118,6 @@ export default class Cell extends CoreFeature{
|
|
|
118
118
|
}
|
|
119
119
|
break;
|
|
120
120
|
case "undefined":
|
|
121
|
-
case "null":
|
|
122
121
|
this.element.innerHTML = "";
|
|
123
122
|
break;
|
|
124
123
|
default:
|
|
@@ -294,4 +293,4 @@ export default class Cell extends CoreFeature{
|
|
|
294
293
|
|
|
295
294
|
return this.component;
|
|
296
295
|
}
|
|
297
|
-
}
|
|
296
|
+
}
|
|
@@ -158,8 +158,6 @@ class Column extends CoreFeature{
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
this.contentElement = this._bindEvents();
|
|
162
|
-
|
|
163
161
|
this.contentElement = this._buildColumnHeaderContent();
|
|
164
162
|
|
|
165
163
|
this.element.appendChild(this.contentElement);
|
|
@@ -173,83 +171,6 @@ class Column extends CoreFeature{
|
|
|
173
171
|
this.dispatch("column-init", this);
|
|
174
172
|
}
|
|
175
173
|
|
|
176
|
-
_bindEvents(){
|
|
177
|
-
var def = this.definition,
|
|
178
|
-
dblTap, tapHold, tap;
|
|
179
|
-
|
|
180
|
-
//setup header click event bindings
|
|
181
|
-
if(typeof(def.headerClick) == "function"){
|
|
182
|
-
this.element.addEventListener("click", (e) => {def.headerClick(e, this.getComponent());});
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if(typeof(def.headerDblClick) == "function"){
|
|
186
|
-
this.element.addEventListener("dblclick", (e) => {def.headerDblClick(e, this.getComponent());});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if(typeof(def.headerContext) == "function"){
|
|
190
|
-
this.element.addEventListener("contextmenu", (e) => {def.headerContext(e, this.getComponent());});
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
//setup header tap event bindings
|
|
194
|
-
if(typeof(def.headerTap) == "function"){
|
|
195
|
-
tap = false;
|
|
196
|
-
|
|
197
|
-
this.element.addEventListener("touchstart", (e) => {
|
|
198
|
-
tap = true;
|
|
199
|
-
}, {passive: true});
|
|
200
|
-
|
|
201
|
-
this.element.addEventListener("touchend", (e) => {
|
|
202
|
-
if(tap){
|
|
203
|
-
def.headerTap(e, this.getComponent());
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
tap = false;
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if(typeof(def.headerDblTap) == "function"){
|
|
211
|
-
dblTap = null;
|
|
212
|
-
|
|
213
|
-
this.element.addEventListener("touchend", (e) => {
|
|
214
|
-
|
|
215
|
-
if(dblTap){
|
|
216
|
-
clearTimeout(dblTap);
|
|
217
|
-
dblTap = null;
|
|
218
|
-
|
|
219
|
-
def.headerDblTap(e, this.getComponent());
|
|
220
|
-
}else{
|
|
221
|
-
|
|
222
|
-
dblTap = setTimeout(() => {
|
|
223
|
-
clearTimeout(dblTap);
|
|
224
|
-
dblTap = null;
|
|
225
|
-
}, 300);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if(typeof(def.headerTapHold) == "function"){
|
|
232
|
-
tapHold = null;
|
|
233
|
-
|
|
234
|
-
this.element.addEventListener("touchstart", (e) => {
|
|
235
|
-
clearTimeout(tapHold);
|
|
236
|
-
|
|
237
|
-
tapHold = setTimeout(function(){
|
|
238
|
-
clearTimeout(tapHold);
|
|
239
|
-
tapHold = null;
|
|
240
|
-
tap = false;
|
|
241
|
-
def.headerTapHold(e, this.getComponent());
|
|
242
|
-
}, 1000);
|
|
243
|
-
|
|
244
|
-
}, {passive: true});
|
|
245
|
-
|
|
246
|
-
this.element.addEventListener("touchend", (e) => {
|
|
247
|
-
clearTimeout(tapHold);
|
|
248
|
-
tapHold = null;
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
174
|
//build header element for header
|
|
254
175
|
_buildColumnHeader(){
|
|
255
176
|
var def = this.definition,
|
|
@@ -377,7 +298,6 @@ class Column extends CoreFeature{
|
|
|
377
298
|
}
|
|
378
299
|
break;
|
|
379
300
|
case "undefined":
|
|
380
|
-
case "null":
|
|
381
301
|
el.innerHTML = "";
|
|
382
302
|
break;
|
|
383
303
|
default:
|
|
@@ -999,4 +919,4 @@ class Column extends CoreFeature{
|
|
|
999
919
|
|
|
1000
920
|
Column.defaultOptionList = defaultOptions;
|
|
1001
921
|
|
|
1002
|
-
export default Column;
|
|
922
|
+
export default Column;
|
|
@@ -10,7 +10,7 @@ export default class DataLoader extends CoreFeature{
|
|
|
10
10
|
|
|
11
11
|
initialize(){}
|
|
12
12
|
|
|
13
|
-
load(data, params, config, replace, silent){
|
|
13
|
+
load(data, params, config, replace, silent, columnsChanged){
|
|
14
14
|
var requestNo = ++this.requestOrder;
|
|
15
15
|
|
|
16
16
|
this.dispatchExternal("dataLoading", data);
|
|
@@ -46,7 +46,7 @@ export default class DataLoader extends CoreFeature{
|
|
|
46
46
|
|
|
47
47
|
if(rowData !== false){
|
|
48
48
|
this.dispatchExternal("dataLoaded", rowData);
|
|
49
|
-
this.table.rowManager.setData(rowData, replace, !replace);
|
|
49
|
+
this.table.rowManager.setData(rowData, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
|
|
50
50
|
}
|
|
51
51
|
}else{
|
|
52
52
|
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");
|
|
@@ -73,7 +73,7 @@ export default class DataLoader extends CoreFeature{
|
|
|
73
73
|
data = [];
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
this.table.rowManager.setData(data, replace, !replace);
|
|
76
|
+
this.table.rowManager.setData(data, replace, typeof columnsChanged === "undefined" ? !replace : columnsChanged);
|
|
77
77
|
return Promise.resolve();
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -22,6 +22,8 @@ export default class Popup extends CoreFeature{
|
|
|
22
22
|
|
|
23
23
|
this.blurEvent = this.hide.bind(this, false);
|
|
24
24
|
this.escEvent = this._escapeCheck.bind(this);
|
|
25
|
+
|
|
26
|
+
this.destroyBinding = this.hide.bind(this, true);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
_lookupContainer(){
|
|
@@ -139,6 +141,8 @@ export default class Popup extends CoreFeature{
|
|
|
139
141
|
this._fitToScreen(x, y, parentEl, parentOffset, position);
|
|
140
142
|
|
|
141
143
|
this.visible = true;
|
|
144
|
+
|
|
145
|
+
this.subscribe("table-destroy", this.destroyBinding);
|
|
142
146
|
|
|
143
147
|
return this;
|
|
144
148
|
}
|
|
@@ -234,6 +238,8 @@ export default class Popup extends CoreFeature{
|
|
|
234
238
|
if(this.blurCallback && !silent){
|
|
235
239
|
this.blurCallback();
|
|
236
240
|
}
|
|
241
|
+
|
|
242
|
+
this.unsubscribe("table-destroy", this.destroyBinding);
|
|
237
243
|
}
|
|
238
244
|
|
|
239
245
|
return this;
|
|
@@ -122,11 +122,24 @@ class DataTree extends Module{
|
|
|
122
122
|
this.subscribe("edit-cancelled", this.cellValueChanged.bind(this));
|
|
123
123
|
this.subscribe("column-moving-rows", this.columnMoving.bind(this));
|
|
124
124
|
this.subscribe("table-built", this.initializeElementField.bind(this));
|
|
125
|
+
this.subscribe("table-redrawing", this.tableRedrawing.bind(this));
|
|
125
126
|
|
|
126
127
|
this.registerDisplayHandler(this.getRows.bind(this), 30);
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
|
|
131
|
+
tableRedrawing(force){
|
|
132
|
+
var rows;
|
|
133
|
+
|
|
134
|
+
if(force){
|
|
135
|
+
rows = this.table.rowManager.getRows();
|
|
136
|
+
|
|
137
|
+
rows.forEach((row) => {
|
|
138
|
+
this.reinitializeRowChildren(row);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
130
143
|
initializeElementField(){
|
|
131
144
|
var firstCol = this.table.columnManager.getFirstVisibleColumn();
|
|
132
145
|
|
|
@@ -419,6 +432,10 @@ class DataTree extends Module{
|
|
|
419
432
|
return row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;
|
|
420
433
|
}
|
|
421
434
|
|
|
435
|
+
getTreeParentRoot(row){
|
|
436
|
+
return row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;
|
|
437
|
+
}
|
|
438
|
+
|
|
422
439
|
getFilteredTreeChildren(row){
|
|
423
440
|
var config = row.modules.dataTree,
|
|
424
441
|
output = [], children;
|
|
@@ -30,11 +30,10 @@ export default function(list, options, setFileContents){
|
|
|
30
30
|
|
|
31
31
|
switch(typeof col.value){
|
|
32
32
|
case "object":
|
|
33
|
-
col.value = JSON.stringify(col.value);
|
|
33
|
+
col.value = col.value !== null ? JSON.stringify(col.value) : "";
|
|
34
34
|
break;
|
|
35
35
|
|
|
36
36
|
case "undefined":
|
|
37
|
-
case "null":
|
|
38
37
|
col.value = "";
|
|
39
38
|
break;
|
|
40
39
|
}
|
|
@@ -59,4 +58,4 @@ export default function(list, options, setFileContents){
|
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
setFileContents(fileContents, "text/csv");
|
|
62
|
-
};
|
|
61
|
+
};
|
|
@@ -57,11 +57,10 @@ export default function(list, options, setFileContents){
|
|
|
57
57
|
if(col){
|
|
58
58
|
switch(typeof col.value){
|
|
59
59
|
case "object":
|
|
60
|
-
col.value = JSON.stringify(col.value);
|
|
60
|
+
col.value = col.value !== null ? JSON.stringify(col.value) : "";
|
|
61
61
|
break;
|
|
62
62
|
|
|
63
63
|
case "undefined":
|
|
64
|
-
case "null":
|
|
65
64
|
col.value = "";
|
|
66
65
|
break;
|
|
67
66
|
}
|
|
@@ -111,4 +110,4 @@ export default function(list, options, setFileContents){
|
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
setFileContents(doc.output("arraybuffer"), "application/pdf");
|
|
114
|
-
};
|
|
113
|
+
};
|
|
@@ -70,7 +70,7 @@ export default class Edit{
|
|
|
70
70
|
this.initialValues = this.params.multiselect ? initialValue : [initialValue];
|
|
71
71
|
|
|
72
72
|
if(this.isFilter){
|
|
73
|
-
this.input.value = this.initialValues.join(",");
|
|
73
|
+
this.input.value = this.initialValues ? this.initialValues.join(",") : "";
|
|
74
74
|
this.headerFilterInitialListGen();
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -475,7 +475,7 @@ export default class Edit{
|
|
|
475
475
|
values = this._ajaxRequest(this.params.valuesURL, this.input.value);
|
|
476
476
|
}else{
|
|
477
477
|
if(typeof this.params.valuesLookup === "function"){
|
|
478
|
-
values = this.params.valuesLookup(cell, this.input.value);
|
|
478
|
+
values = this.params.valuesLookup(this.cell, this.input.value);
|
|
479
479
|
}else if(this.params.valuesLookup){
|
|
480
480
|
values = this._uniqueColumnValues(this.params.valuesLookupField);
|
|
481
481
|
}
|
|
@@ -994,4 +994,4 @@ export default class Edit{
|
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
|
|
997
|
-
}
|
|
997
|
+
}
|
|
@@ -510,11 +510,10 @@ class Export extends Module{
|
|
|
510
510
|
}else{
|
|
511
511
|
switch(typeof value){
|
|
512
512
|
case "object":
|
|
513
|
-
value = JSON.stringify(value);
|
|
513
|
+
value = value !== null ? JSON.stringify(value) : "";
|
|
514
514
|
break;
|
|
515
515
|
|
|
516
516
|
case "undefined":
|
|
517
|
-
case "null":
|
|
518
517
|
value = "";
|
|
519
518
|
break;
|
|
520
519
|
|
|
@@ -12,7 +12,6 @@ class FrozenColumns extends Module{
|
|
|
12
12
|
this.rightPadding = 0;
|
|
13
13
|
this.initializationMode = "left";
|
|
14
14
|
this.active = false;
|
|
15
|
-
this.scrollEndTimer = false;
|
|
16
15
|
this.blocked = true;
|
|
17
16
|
|
|
18
17
|
this.registerColumnOption("frozen");
|
|
@@ -41,10 +40,10 @@ class FrozenColumns extends Module{
|
|
|
41
40
|
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
42
41
|
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
43
42
|
this.subscribe("columns-loading", this.reset.bind(this));
|
|
44
|
-
|
|
43
|
+
|
|
45
44
|
this.subscribe("column-add", this.reinitializeColumns.bind(this));
|
|
46
45
|
this.subscribe("column-delete", this.reinitializeColumns.bind(this));
|
|
47
|
-
|
|
46
|
+
|
|
48
47
|
this.subscribe("table-redraw", this.layout.bind(this));
|
|
49
48
|
this.subscribe("layout-refreshing", this.blockLayout.bind(this));
|
|
50
49
|
this.subscribe("layout-refreshed", this.unblockLayout.bind(this));
|
|
@@ -61,10 +60,10 @@ class FrozenColumns extends Module{
|
|
|
61
60
|
layoutCell(cell){
|
|
62
61
|
this.layoutElement(cell.element, cell.column)
|
|
63
62
|
}
|
|
64
|
-
|
|
63
|
+
|
|
65
64
|
reinitializeColumns(){
|
|
66
65
|
this.reset();
|
|
67
|
-
|
|
66
|
+
|
|
68
67
|
this.table.columnManager.columnsByIndex.forEach((column) => {
|
|
69
68
|
this.initializeColumn(column);
|
|
70
69
|
});
|
|
@@ -111,22 +110,14 @@ class FrozenColumns extends Module{
|
|
|
111
110
|
scrollHorizontal(){
|
|
112
111
|
var rows;
|
|
113
112
|
|
|
114
|
-
if(this.active){
|
|
115
|
-
clearTimeout(this.scrollEndTimer);
|
|
116
|
-
|
|
117
|
-
rows = this.table.rowManager.getVisibleRows();
|
|
118
|
-
|
|
113
|
+
if(this.active){
|
|
119
114
|
this.calcMargins(true);
|
|
120
115
|
|
|
121
116
|
this.layoutColumnPosition();
|
|
122
117
|
|
|
123
118
|
this.layoutCalcRows();
|
|
124
119
|
|
|
125
|
-
|
|
126
|
-
if(row.type === "row"){
|
|
127
|
-
this.layoutRow(row);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
120
|
+
this.reinitializeRows();
|
|
130
121
|
}
|
|
131
122
|
}
|
|
132
123
|
|
|
@@ -138,7 +129,7 @@ class FrozenColumns extends Module{
|
|
|
138
129
|
this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px";
|
|
139
130
|
this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
|
|
140
131
|
}
|
|
141
|
-
|
|
132
|
+
|
|
142
133
|
//calculate right frozen columns
|
|
143
134
|
this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;
|
|
144
135
|
}
|
|
@@ -185,10 +176,11 @@ class FrozenColumns extends Module{
|
|
|
185
176
|
|
|
186
177
|
this.table.columnManager.headersElement.style.marginLeft = this.leftMargin;
|
|
187
178
|
this.table.columnManager.element.style.paddingRight = this.rightMargin;
|
|
188
|
-
|
|
179
|
+
|
|
189
180
|
this.leftColumns.forEach((column, i) => {
|
|
190
|
-
column.modules.frozen.
|
|
191
|
-
|
|
181
|
+
column.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;
|
|
182
|
+
column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
|
|
183
|
+
|
|
192
184
|
if(column.visible){
|
|
193
185
|
leftMargin += column.getWidth();
|
|
194
186
|
}
|
|
@@ -221,12 +213,13 @@ class FrozenColumns extends Module{
|
|
|
221
213
|
});
|
|
222
214
|
|
|
223
215
|
this.rightColumns.forEach((column, i) => {
|
|
224
|
-
|
|
216
|
+
|
|
225
217
|
if(column.visible){
|
|
226
218
|
rightMargin += column.getWidth();
|
|
227
219
|
}
|
|
228
|
-
|
|
229
|
-
column.modules.frozen.
|
|
220
|
+
|
|
221
|
+
column.modules.frozen.marginValue = this.rightPadding - rightMargin;
|
|
222
|
+
column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
|
|
230
223
|
|
|
231
224
|
if(i == this.rightColumns.length - 1){
|
|
232
225
|
column.modules.frozen.edge = true;
|
|
@@ -254,36 +247,35 @@ class FrozenColumns extends Module{
|
|
|
254
247
|
}
|
|
255
248
|
|
|
256
249
|
//layout columns appropriately
|
|
257
|
-
layout(){
|
|
258
|
-
var visibleRows = [],
|
|
259
|
-
otherRows = [];
|
|
260
|
-
|
|
250
|
+
layout(){
|
|
261
251
|
if(this.active && !this.blocked){
|
|
262
252
|
//calculate row padding
|
|
263
253
|
this.calcMargins();
|
|
264
|
-
|
|
254
|
+
|
|
265
255
|
//calculate left columns
|
|
266
256
|
this.layoutColumnPosition();
|
|
267
257
|
|
|
268
|
-
|
|
269
|
-
otherRows = this.table.rowManager.getDisplayRows().filter(row => !visibleRows.includes(row));
|
|
270
|
-
|
|
271
|
-
otherRows.forEach((row) =>{
|
|
272
|
-
row.deinitialize();
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
visibleRows.forEach((row) =>{
|
|
276
|
-
if(row.type === "row"){
|
|
277
|
-
this.layoutRow(row);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
258
|
+
this.reinitializeRows();
|
|
280
259
|
|
|
281
260
|
this.layoutCalcRows();
|
|
282
|
-
|
|
283
|
-
|
|
284
261
|
}
|
|
285
262
|
}
|
|
286
263
|
|
|
264
|
+
reinitializeRows(){
|
|
265
|
+
var visibleRows = this.table.rowManager.getVisibleRows();
|
|
266
|
+
var otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));
|
|
267
|
+
|
|
268
|
+
otherRows.forEach((row) =>{
|
|
269
|
+
row.deinitialize();
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
visibleRows.forEach((row) =>{
|
|
273
|
+
if(row.type === "row"){
|
|
274
|
+
this.layoutRow(row);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
287
279
|
layoutRow(row){
|
|
288
280
|
// console.trace("row")
|
|
289
281
|
var rowEl = row.getElement();
|
|
@@ -436,6 +436,10 @@ class GroupRows extends Module{
|
|
|
436
436
|
getRowGroup(row){
|
|
437
437
|
var match = false;
|
|
438
438
|
|
|
439
|
+
if(this.options("dataTree")){
|
|
440
|
+
row = this.table.modules.dataTree.getTreeParentRoot(row);
|
|
441
|
+
}
|
|
442
|
+
|
|
439
443
|
this.groupList.forEach((group) => {
|
|
440
444
|
var result = group.getRowGroup(row);
|
|
441
445
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Module from '../../core/Module.js';
|
|
2
2
|
import Helpers from '../../core/tools/Helpers.js';
|
|
3
3
|
|
|
4
|
-
import Cell from '../../core/cell/Cell';
|
|
5
|
-
import Column from '../../core/column/Column';
|
|
4
|
+
import Cell from '../../core/cell/Cell.js';
|
|
5
|
+
import Column from '../../core/column/Column.js';
|
|
6
6
|
|
|
7
7
|
class Interaction extends Module{
|
|
8
8
|
|
|
@@ -311,4 +311,4 @@ class Interaction extends Module{
|
|
|
311
311
|
|
|
312
312
|
Interaction.moduleName = "interaction";
|
|
313
313
|
|
|
314
|
-
export default Interaction;
|
|
314
|
+
export default Interaction;
|
|
@@ -609,7 +609,6 @@ class Page extends Module{
|
|
|
609
609
|
}
|
|
610
610
|
break;
|
|
611
611
|
case "undefined":
|
|
612
|
-
case "null":
|
|
613
612
|
this.pageCounterElement.innerHTML = "";
|
|
614
613
|
break;
|
|
615
614
|
default:
|
|
@@ -895,4 +894,4 @@ Page.moduleName = "page";
|
|
|
895
894
|
//load defaults
|
|
896
895
|
Page.pageCounters = defaultPageCounters;
|
|
897
896
|
|
|
898
|
-
export default Page;
|
|
897
|
+
export default Page;
|
|
@@ -33,6 +33,7 @@ class ResizeColumns extends Module{
|
|
|
33
33
|
|
|
34
34
|
this.subscribe("column-hide", this.deInitializeColumn.bind(this));
|
|
35
35
|
this.subscribe("column-show", this.columnLayoutUpdated.bind(this));
|
|
36
|
+
this.subscribe("column-width", this.columnWidthUpdated.bind(this));
|
|
36
37
|
|
|
37
38
|
this.subscribe("column-delete", this.deInitializeComponent.bind(this));
|
|
38
39
|
this.subscribe("column-height", this.resizeHandle.bind(this));
|
|
@@ -67,14 +68,39 @@ class ResizeColumns extends Module{
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
columnWidthUpdated(column){
|
|
72
|
+
if(column.modules.frozen){
|
|
73
|
+
if(this.table.modules.frozenColumns.leftColumns.includes(column)){
|
|
74
|
+
this.table.modules.frozenColumns.leftColumns.forEach((col) => {
|
|
75
|
+
this.reinitializeColumn(col);
|
|
76
|
+
});
|
|
77
|
+
}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){
|
|
78
|
+
this.table.modules.frozenColumns.rightColumns.forEach((col) => {
|
|
79
|
+
this.reinitializeColumn(col);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
70
85
|
reinitializeColumn(column){
|
|
86
|
+
var frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + "px") : false;
|
|
87
|
+
;
|
|
88
|
+
|
|
71
89
|
column.cells.forEach((cell) => {
|
|
72
90
|
if(cell.modules.resize && cell.modules.resize.handleEl){
|
|
91
|
+
if(frozenOffset){
|
|
92
|
+
cell.modules.resize.handleEl.style.left = frozenOffset;
|
|
93
|
+
}
|
|
94
|
+
|
|
73
95
|
cell.element.after(cell.modules.resize.handleEl);
|
|
74
96
|
}
|
|
75
97
|
});
|
|
76
98
|
|
|
77
99
|
if(column.modules.resize && column.modules.resize.handleEl){
|
|
100
|
+
if(frozenOffset){
|
|
101
|
+
column.modules.resize.handleEl.style.left = frozenOffset;
|
|
102
|
+
}
|
|
103
|
+
|
|
78
104
|
column.element.after(column.modules.resize.handleEl);
|
|
79
105
|
}
|
|
80
106
|
}
|
|
@@ -123,9 +149,14 @@ class ResizeColumns extends Module{
|
|
|
123
149
|
}
|
|
124
150
|
});
|
|
125
151
|
|
|
152
|
+
if(column.modules.frozen){
|
|
153
|
+
handle.style.position = "absolute";
|
|
154
|
+
handle.style.left = column.modules.frozen.marginValue + column.getWidth() + "px";
|
|
155
|
+
}
|
|
156
|
+
|
|
126
157
|
config.handleEl = handle;
|
|
127
158
|
|
|
128
|
-
if(element.parentNode){
|
|
159
|
+
if(element.parentNode && column.visible){
|
|
129
160
|
element.after(handle);
|
|
130
161
|
}
|
|
131
162
|
}
|
|
@@ -173,27 +204,27 @@ class ResizeColumns extends Module{
|
|
|
173
204
|
startDiff = x - self.startX,
|
|
174
205
|
moveDiff = x - self.latestX,
|
|
175
206
|
blockedBefore, blockedAfter;
|
|
176
|
-
|
|
207
|
+
|
|
177
208
|
self.latestX = x;
|
|
178
209
|
|
|
179
210
|
if(self.table.rtl){
|
|
180
211
|
startDiff = -startDiff;
|
|
181
212
|
moveDiff = -moveDiff;
|
|
182
213
|
}
|
|
183
|
-
|
|
214
|
+
|
|
184
215
|
blockedBefore = column.width == column.minWidth || column.width == column.maxWidth;
|
|
185
|
-
|
|
216
|
+
|
|
186
217
|
column.setWidth(self.startWidth + startDiff);
|
|
187
|
-
|
|
218
|
+
|
|
188
219
|
blockedAfter = column.width == column.minWidth || column.width == column.maxWidth;
|
|
189
|
-
|
|
220
|
+
|
|
190
221
|
if(moveDiff < 0){
|
|
191
222
|
self.nextColumn = self.initialNextColumn;
|
|
192
223
|
}
|
|
193
224
|
|
|
194
225
|
if(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){
|
|
195
226
|
let colWidth = self.nextColumn.getWidth();
|
|
196
|
-
|
|
227
|
+
|
|
197
228
|
if(moveDiff > 0){
|
|
198
229
|
if(colWidth <= self.nextColumn.minWidth){
|
|
199
230
|
self.nextColumn = self.nextColumn.nextColumn();
|
|
@@ -204,7 +204,7 @@ class Sort extends Module{
|
|
|
204
204
|
|
|
205
205
|
refreshSort(){
|
|
206
206
|
if(this.table.options.sortMode === "remote"){
|
|
207
|
-
this.reloadData();
|
|
207
|
+
this.reloadData(null, false, false);
|
|
208
208
|
}else{
|
|
209
209
|
this.refreshData(true);
|
|
210
210
|
}
|
|
@@ -378,7 +378,7 @@ class Sort extends Module{
|
|
|
378
378
|
//set the column header sort direction
|
|
379
379
|
setColumnHeader(column, dir){
|
|
380
380
|
column.modules.sort.dir = dir;
|
|
381
|
-
column.getElement().setAttribute("aria-sort", dir);
|
|
381
|
+
column.getElement().setAttribute("aria-sort", dir === "asc" ? "ascending" : "descending");
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
//sort each item in sort list
|