tabulator-tables 5.3.0 → 5.3.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/dist/css/tabulator_bootstrap3.css +1 -1
- 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 +4 -4
- 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_bootstrap5.css +4 -4
- 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/js/tabulator.js +304 -233
- 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 +456 -388
- 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 +18 -4
- package/src/js/core/Module.js +54 -23
- package/src/js/core/RowManager.js +83 -94
- package/src/js/core/Tabulator.js +2 -2
- package/src/js/core/column/Column.js +26 -2
- package/src/js/core/tools/InteractionMonitor.js +12 -9
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +1 -1
- package/src/js/modules/DataTree/DataTree.js +5 -11
- package/src/js/modules/Edit/List.js +1 -1
- package/src/js/modules/Filter/Filter.js +3 -0
- package/src/js/modules/GroupRows/Group.js +5 -9
- package/src/js/modules/GroupRows/GroupComponent.js +1 -1
- package/src/js/modules/GroupRows/GroupRows.js +217 -194
- package/src/js/modules/History/History.js +1 -1
- package/src/js/modules/Interaction/Interaction.js +3 -3
- package/src/js/modules/Layout/defaults/modes/fitColumns.js +4 -6
- package/src/js/modules/Page/Page.js +2 -12
- package/src/js/modules/Persistence/Persistence.js +3 -2
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -2
- package/src/js/modules/SelectRow/SelectRow.js +8 -4
- package/src/js/modules/Sort/Sort.js +4 -7
- package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +1 -1
- package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +1 -1
- package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +1 -1
|
@@ -128,7 +128,7 @@ class Interaction extends Module{
|
|
|
128
128
|
var range;
|
|
129
129
|
|
|
130
130
|
if(this.table.modExists("edit")){
|
|
131
|
-
if (this.table.modules.edit.currentCell ===
|
|
131
|
+
if (this.table.modules.edit.currentCell === cell){
|
|
132
132
|
return; //prevent instant selection of editor content
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -138,11 +138,11 @@ class Interaction extends Module{
|
|
|
138
138
|
try{
|
|
139
139
|
if (document.selection) { // IE
|
|
140
140
|
range = document.body.createTextRange();
|
|
141
|
-
range.moveToElementText(
|
|
141
|
+
range.moveToElementText(cell.getElement());
|
|
142
142
|
range.select();
|
|
143
143
|
} else if (window.getSelection) {
|
|
144
144
|
range = document.createRange();
|
|
145
|
-
range.selectNode(
|
|
145
|
+
range.selectNode(cell.getElement());
|
|
146
146
|
window.getSelection().removeAllRanges();
|
|
147
147
|
window.getSelection().addRange(range);
|
|
148
148
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//resize columns to fit
|
|
2
2
|
export default function(columns, forced){
|
|
3
|
-
var totalWidth = this.table.element.
|
|
3
|
+
var totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width
|
|
4
4
|
var fixedWidth = 0; //total width of columns with a defined width
|
|
5
5
|
var flexWidth = 0; //total width available to flexible columns
|
|
6
6
|
var flexGrowUnits = 0; //total number of widthGrow blocks across all columns
|
|
@@ -77,9 +77,7 @@ export default function(columns, forced){
|
|
|
77
77
|
|
|
78
78
|
nextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;
|
|
79
79
|
|
|
80
|
-
gap = remainingSpace
|
|
81
|
-
|
|
82
|
-
gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);
|
|
80
|
+
gap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);
|
|
83
81
|
}else{
|
|
84
82
|
gap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;
|
|
85
83
|
|
|
@@ -143,7 +141,7 @@ export default function(columns, forced){
|
|
|
143
141
|
|
|
144
142
|
//increase width of last column to account for rounding errors
|
|
145
143
|
if(flexColumns.length && gapFill > 0){
|
|
146
|
-
flexColumns[flexColumns.length-1].width +=
|
|
144
|
+
flexColumns[flexColumns.length-1].width += gapFill;
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
//calculate space for columns to be shrunk into
|
|
@@ -159,7 +157,7 @@ export default function(columns, forced){
|
|
|
159
157
|
}
|
|
160
158
|
|
|
161
159
|
//decrease width of last column to account for rounding errors
|
|
162
|
-
if(fixedShrinkColumns.length){
|
|
160
|
+
if(gapFill && fixedShrinkColumns.length){
|
|
163
161
|
fixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;
|
|
164
162
|
}
|
|
165
163
|
|
|
@@ -21,8 +21,6 @@ class Page extends Module{
|
|
|
21
21
|
|
|
22
22
|
this.remoteRowCountEstimate = null;
|
|
23
23
|
|
|
24
|
-
this.displayIndex = 0; //index in display pipeline
|
|
25
|
-
|
|
26
24
|
this.initialLoad = true;
|
|
27
25
|
this.dataChanging = false; //flag to check if data is being changed by this module
|
|
28
26
|
|
|
@@ -470,14 +468,6 @@ class Page extends Module{
|
|
|
470
468
|
this.dispatch("page-changed");
|
|
471
469
|
}
|
|
472
470
|
|
|
473
|
-
setDisplayIndex(index){
|
|
474
|
-
this.displayIndex = index;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
getDisplayIndex(){
|
|
478
|
-
return this.displayIndex;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
471
|
//calculate maximum page from number of rows
|
|
482
472
|
setMaxRows(rowCount){
|
|
483
473
|
if(!rowCount){
|
|
@@ -544,9 +534,9 @@ class Page extends Module{
|
|
|
544
534
|
}
|
|
545
535
|
|
|
546
536
|
setPageToRow(row){
|
|
547
|
-
var rows = this.
|
|
537
|
+
var rows = this.displayRows(-1);
|
|
548
538
|
var index = rows.indexOf(row);
|
|
549
|
-
|
|
539
|
+
|
|
550
540
|
if(index > -1){
|
|
551
541
|
var page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);
|
|
552
542
|
|
|
@@ -211,9 +211,10 @@ class Persistence extends Module{
|
|
|
211
211
|
keys.forEach((key)=>{
|
|
212
212
|
var props = Object.getOwnPropertyDescriptor(def, key);
|
|
213
213
|
var value = def[key];
|
|
214
|
+
|
|
214
215
|
if(props){
|
|
215
216
|
Object.defineProperty(def, key, {
|
|
216
|
-
set:
|
|
217
|
+
set: (newValue) => {
|
|
217
218
|
value = newValue;
|
|
218
219
|
|
|
219
220
|
if(!this.defWatcherBlock){
|
|
@@ -224,7 +225,7 @@ class Persistence extends Module{
|
|
|
224
225
|
props.set(newValue);
|
|
225
226
|
}
|
|
226
227
|
},
|
|
227
|
-
get:
|
|
228
|
+
get:() => {
|
|
228
229
|
if(props.get){
|
|
229
230
|
props.get();
|
|
230
231
|
}
|
|
@@ -33,8 +33,9 @@ class ResponsiveLayout extends Module{
|
|
|
33
33
|
this.subscribe("column-delete", this.initializeResponsivity.bind(this));
|
|
34
34
|
|
|
35
35
|
this.subscribe("table-redrawing", this.tableRedraw.bind(this));
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
if(this.table.options.responsiveLayout === "collapse"){
|
|
38
|
+
this.subscribe("row-data-changed", this.generateCollapsedRowContent.bind(this));
|
|
38
39
|
this.subscribe("row-init", this.initializeRow.bind(this));
|
|
39
40
|
this.subscribe("row-layout", this.layoutRow.bind(this));
|
|
40
41
|
}
|
|
@@ -341,4 +342,4 @@ class ResponsiveLayout extends Module{
|
|
|
341
342
|
|
|
342
343
|
ResponsiveLayout.moduleName = "responsiveLayout";
|
|
343
344
|
|
|
344
|
-
export default ResponsiveLayout;
|
|
345
|
+
export default ResponsiveLayout;
|
|
@@ -216,18 +216,22 @@ class SelectRow extends Module{
|
|
|
216
216
|
break;
|
|
217
217
|
|
|
218
218
|
case "string":
|
|
219
|
-
|
|
220
219
|
rowMatch = this.table.rowManager.findRow(rows);
|
|
221
220
|
|
|
222
221
|
if(rowMatch){
|
|
223
222
|
this._selectRow(rowMatch, true, true);
|
|
223
|
+
this._rowSelectionChanged();
|
|
224
224
|
}else{
|
|
225
|
-
this.table.rowManager.getRows(rows)
|
|
225
|
+
rowMatch = this.table.rowManager.getRows(rows);
|
|
226
|
+
|
|
227
|
+
rowMatch.forEach((row) => {
|
|
226
228
|
this._selectRow(row, true, true);
|
|
227
229
|
});
|
|
230
|
+
|
|
231
|
+
if(rowMatch.length){
|
|
232
|
+
this._rowSelectionChanged();
|
|
233
|
+
}
|
|
228
234
|
}
|
|
229
|
-
|
|
230
|
-
this._rowSelectionChanged();
|
|
231
235
|
break;
|
|
232
236
|
|
|
233
237
|
default:
|
|
@@ -169,7 +169,6 @@ class Sort extends Module{
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
|
|
173
172
|
if (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {
|
|
174
173
|
sorters = this.getSort();
|
|
175
174
|
|
|
@@ -180,11 +179,9 @@ class Sort extends Module{
|
|
|
180
179
|
if(match > -1){
|
|
181
180
|
sorters[match].dir = dir;
|
|
182
181
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
sorters.push(match);
|
|
187
|
-
}
|
|
182
|
+
match = sorters.splice(match, 1)[0];
|
|
183
|
+
if(dir != "none"){
|
|
184
|
+
sorters.push(match);
|
|
188
185
|
}
|
|
189
186
|
}else{
|
|
190
187
|
if(dir != "none"){
|
|
@@ -399,7 +396,7 @@ class Sort extends Module{
|
|
|
399
396
|
var sortEl = column.modules.sort.element,
|
|
400
397
|
arrowEl;
|
|
401
398
|
|
|
402
|
-
if(typeof this.table.options.headerSortElement === "function"){
|
|
399
|
+
if(column.definition.headerSort && typeof this.table.options.headerSortElement === "function"){
|
|
403
400
|
while(sortEl.firstChild) sortEl.removeChild(sortEl.firstChild);
|
|
404
401
|
|
|
405
402
|
arrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);
|