tabulator-tables 5.1.1 → 5.1.4
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/js/tabulator.js +233 -148
- 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 +551 -485
- package/dist/js/tabulator_esm.js.map +1 -1
- package/dist/js/tabulator_esm.min.js +2 -2
- package/dist/js/tabulator_esm.min.js.map +1 -1
- package/package.json +5 -2
- package/src/js/core/FooterManager.js +2 -4
- package/src/js/core/RowManager.js +0 -6
- package/src/js/core/Tabulator.js +13 -30
- package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +1 -1
- package/src/js/core/row/Row.js +2 -2
- package/src/js/core/tools/InteractionMonitor.js +1 -1
- package/src/js/core/tools/ModuleBinder.js +15 -3
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +9 -4
- package/src/js/modules/Export/Export.js +5 -4
- package/src/js/modules/Filter/Filter.js +4 -3
- package/src/js/modules/Format/defaults/formatters/rowSelection.js +19 -1
- package/src/js/modules/Format/defaults/formatters/rownum.js +1 -1
- package/src/js/modules/FrozenColumns/FrozenColumns.js +101 -83
- package/src/js/modules/GroupRows/Group.js +144 -142
- package/src/js/modules/Layout/Layout.js +1 -0
- package/src/js/modules/Page/Page.js +6 -3
- package/src/js/modules/Page/defaults/pageCounters/rows.js +21 -13
- package/src/js/modules/Persistence/Persistence.js +6 -4
- package/src/js/modules/Persistence/defaults/readers.js +3 -3
- package/src/js/modules/ResizeColumns/ResizeColumns.js +61 -51
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +1 -1
- package/src/js/modules/SelectRow/SelectRow.js +132 -128
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tabulator-tables",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "Interactive table generation JavaScript library",
|
|
5
5
|
"style": "dist/css/tabulator.css",
|
|
6
6
|
"main": "dist/js/tabulator.js",
|
|
7
7
|
"module": "dist/js/tabulator_esm.js",
|
|
8
|
-
"sideEffects":
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css",
|
|
10
|
+
"**/*.scss"
|
|
11
|
+
],
|
|
9
12
|
"scripts": {
|
|
10
13
|
"build": "rollup -c build/rollup.js",
|
|
11
14
|
"dev": "rollup -c build/rollup.js -w --environment TARGET:dev",
|
|
@@ -10,8 +10,6 @@ export default class FooterManager extends CoreFeature{
|
|
|
10
10
|
this.containerElement = this.createContainerElement(); //containing element
|
|
11
11
|
this.external = false;
|
|
12
12
|
this.links = [];
|
|
13
|
-
|
|
14
|
-
this.initializeElement();
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
initialize(){
|
|
@@ -43,10 +41,10 @@ export default class FooterManager extends CoreFeature{
|
|
|
43
41
|
switch(typeof this.table.options.footerElement){
|
|
44
42
|
case "string":
|
|
45
43
|
if(this.table.options.footerElement[0] === "<"){
|
|
46
|
-
this.
|
|
44
|
+
this.containerElement.innerHTML = this.table.options.footerElement;
|
|
47
45
|
}else{
|
|
48
46
|
this.external = true;
|
|
49
|
-
this.
|
|
47
|
+
this.containerElement = document.querySelector(this.table.options.footerElement);
|
|
50
48
|
}
|
|
51
49
|
break;
|
|
52
50
|
|
|
@@ -1054,12 +1054,6 @@ export default class RowManager extends CoreFeature{
|
|
|
1054
1054
|
if(!force){
|
|
1055
1055
|
this.reRenderInPosition();
|
|
1056
1056
|
this.scrollHorizontal(left);
|
|
1057
|
-
|
|
1058
|
-
if(!this.displayRowsCount){
|
|
1059
|
-
if(this.table.options.placeholder){
|
|
1060
|
-
this.getElement().appendChild(this.table.options.placeholder);
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
1057
|
}else{
|
|
1064
1058
|
this.renderTable();
|
|
1065
1059
|
}
|
package/src/js/core/Tabulator.js
CHANGED
|
@@ -41,8 +41,8 @@ class Tabulator {
|
|
|
41
41
|
this.dataLoader = false; //bind component functions
|
|
42
42
|
|
|
43
43
|
this.modules = {}; //hold all modules bound to this table
|
|
44
|
-
this.modulesCore =
|
|
45
|
-
this.modulesRegular =
|
|
44
|
+
this.modulesCore = []; //hold core modules bound to this table (for initialization purposes)
|
|
45
|
+
this.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)
|
|
46
46
|
|
|
47
47
|
this.optionsList = new OptionsList(this, "table constructor");
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ class Tabulator {
|
|
|
50
50
|
|
|
51
51
|
if(this.initializeElement(element)){
|
|
52
52
|
|
|
53
|
-
this.
|
|
53
|
+
this.initializeCoreSystems(options);
|
|
54
54
|
|
|
55
55
|
//delay table creation to allow event bindings immediately after the constructor
|
|
56
56
|
setTimeout(() => {
|
|
@@ -80,7 +80,7 @@ class Tabulator {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
initializeCoreSystems(options){
|
|
84
84
|
this.columnManager = new ColumnManager(this);
|
|
85
85
|
this.rowManager = new RowManager(this);
|
|
86
86
|
this.footerManager = new FooterManager(this);
|
|
@@ -100,8 +100,8 @@ class Tabulator {
|
|
|
100
100
|
this.interactionMonitor = new InteractionMonitor(this);
|
|
101
101
|
|
|
102
102
|
this.dataLoader.initialize();
|
|
103
|
-
this.columnManager.initialize();
|
|
104
|
-
this.rowManager.initialize();
|
|
103
|
+
// this.columnManager.initialize();
|
|
104
|
+
// this.rowManager.initialize();
|
|
105
105
|
this.footerManager.initialize();
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -171,7 +171,7 @@ class Tabulator {
|
|
|
171
171
|
_clearObjectPointers(){
|
|
172
172
|
this.options.columns = this.options.columns.slice(0);
|
|
173
173
|
|
|
174
|
-
if(this.options.data && !this.options.reactiveData){
|
|
174
|
+
if(Array.isArray(this.options.data) && !this.options.reactiveData){
|
|
175
175
|
this.options.data = this.options.data.slice(0);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
@@ -240,24 +240,9 @@ class Tabulator {
|
|
|
240
240
|
this._detectBrowser();
|
|
241
241
|
|
|
242
242
|
//initialize core modules
|
|
243
|
-
|
|
244
|
-
let mod = this.modulesCore[key];
|
|
245
|
-
|
|
243
|
+
this.modulesCore.forEach((mod) => {
|
|
246
244
|
mod.initialize();
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
//configure placeholder element
|
|
250
|
-
if(typeof options.placeholder == "string"){
|
|
251
|
-
var el = document.createElement("div");
|
|
252
|
-
el.classList.add("tabulator-placeholder");
|
|
253
|
-
|
|
254
|
-
var span = document.createElement("span");
|
|
255
|
-
span.innerHTML = options.placeholder;
|
|
256
|
-
|
|
257
|
-
el.appendChild(span);
|
|
258
|
-
|
|
259
|
-
options.placeholder = el;
|
|
260
|
-
}
|
|
245
|
+
})
|
|
261
246
|
|
|
262
247
|
//build table elements
|
|
263
248
|
element.appendChild(this.columnManager.getElement());
|
|
@@ -273,11 +258,9 @@ class Tabulator {
|
|
|
273
258
|
}
|
|
274
259
|
|
|
275
260
|
//initialize regular modules
|
|
276
|
-
|
|
277
|
-
let mod = this.modulesRegular[key];
|
|
278
|
-
|
|
261
|
+
this.modulesRegular.forEach((mod) => {
|
|
279
262
|
mod.initialize();
|
|
280
|
-
}
|
|
263
|
+
});
|
|
281
264
|
|
|
282
265
|
this.columnManager.setColumns(options.columns);
|
|
283
266
|
|
|
@@ -327,7 +310,7 @@ class Tabulator {
|
|
|
327
310
|
this.browserSlow = false;
|
|
328
311
|
}
|
|
329
312
|
|
|
330
|
-
this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.
|
|
313
|
+
this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.slice(0,4));
|
|
331
314
|
}
|
|
332
315
|
|
|
333
316
|
////////////////// Data Handling //////////////////
|
|
@@ -838,4 +821,4 @@ Tabulator.defaultOptions = defaultOptions;
|
|
|
838
821
|
//bind modules and static functionality
|
|
839
822
|
new ModuleBinder(Tabulator);
|
|
840
823
|
|
|
841
|
-
export default Tabulator;
|
|
824
|
+
export default Tabulator;
|
|
@@ -215,7 +215,7 @@ export default class VirtualDomHorizontal extends Renderer{
|
|
|
215
215
|
this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.window;
|
|
216
216
|
|
|
217
217
|
var row = this.chain("rows-sample", [1], [], () => {
|
|
218
|
-
return this.table.rowManager.getDisplayRows()
|
|
218
|
+
return this.table.rowManager.getDisplayRows();
|
|
219
219
|
})[0];
|
|
220
220
|
|
|
221
221
|
if(row){
|
package/src/js/core/row/Row.js
CHANGED
|
@@ -76,6 +76,8 @@ export default class Row extends CoreFeature{
|
|
|
76
76
|
|
|
77
77
|
this.generateCells();
|
|
78
78
|
|
|
79
|
+
this.initialized = true;
|
|
80
|
+
|
|
79
81
|
this.table.columnManager.renderer.renderRowCells(this);
|
|
80
82
|
|
|
81
83
|
if(force){
|
|
@@ -84,8 +86,6 @@ export default class Row extends CoreFeature{
|
|
|
84
86
|
|
|
85
87
|
this.dispatch("row-layout", this);
|
|
86
88
|
|
|
87
|
-
this.initialized = true;
|
|
88
|
-
|
|
89
89
|
if(this.table.options.rowFormatter){
|
|
90
90
|
this.table.options.rowFormatter(this.getComponent());
|
|
91
91
|
}
|
|
@@ -255,7 +255,7 @@ export default class InteractionManager extends CoreFeature {
|
|
|
255
255
|
return row.getElement() === target;
|
|
256
256
|
});
|
|
257
257
|
|
|
258
|
-
if(targets["row"].parentNode && targets["row"].parentNode.closest(".tabulator-row")){
|
|
258
|
+
if(targets["row"] && targets["row"].parentNode && targets["row"].parentNode.closest(".tabulator-row")){
|
|
259
259
|
targets[key] = false;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -56,19 +56,31 @@ export default class ModuleBinder {
|
|
|
56
56
|
|
|
57
57
|
//ensure that module are bound to instantiated function
|
|
58
58
|
tabulator.prototype.bindModules = function(){
|
|
59
|
+
var orderedMods = [],
|
|
60
|
+
unOrderedMods = [];
|
|
61
|
+
|
|
59
62
|
this.modules = {};
|
|
60
63
|
|
|
61
64
|
for(var name in tabulator.moduleBindings){
|
|
62
65
|
let mod = tabulator.moduleBindings[name];
|
|
66
|
+
let module = new mod(this);
|
|
63
67
|
|
|
64
|
-
this.modules[name] =
|
|
68
|
+
this.modules[name] = module;
|
|
65
69
|
|
|
66
70
|
if(mod.prototype.moduleCore){
|
|
67
|
-
this.modulesCore
|
|
71
|
+
this.modulesCore.push(module);
|
|
68
72
|
}else{
|
|
69
|
-
|
|
73
|
+
if(mod.moduleInitOrder){
|
|
74
|
+
orderedMods.push(module);
|
|
75
|
+
}else{
|
|
76
|
+
unOrderedMods.push(module);
|
|
77
|
+
}
|
|
70
78
|
}
|
|
71
79
|
}
|
|
80
|
+
|
|
81
|
+
orderedMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);
|
|
82
|
+
|
|
83
|
+
this.modulesRegular = orderedMods.concat(unOrderedMods);
|
|
72
84
|
}
|
|
73
85
|
}
|
|
74
86
|
|
|
@@ -51,7 +51,7 @@ class ColumnCalcs extends Module{
|
|
|
51
51
|
this.subscribe("row-added", this.rowsUpdated.bind(this));
|
|
52
52
|
this.subscribe("column-moved", this.recalcActiveRows.bind(this));
|
|
53
53
|
this.subscribe("column-add", this.recalcActiveRows.bind(this));
|
|
54
|
-
this.subscribe("data-refreshed", this.
|
|
54
|
+
this.subscribe("data-refreshed", this.recalcActiveRowsRefresh.bind(this));
|
|
55
55
|
this.subscribe("table-redraw", this.tableRedraw.bind(this));
|
|
56
56
|
this.subscribe("rows-visible", this.visibleRows.bind(this));
|
|
57
57
|
|
|
@@ -99,6 +99,14 @@ class ColumnCalcs extends Module{
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
recalcActiveRowsRefresh(){
|
|
103
|
+
if(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){
|
|
104
|
+
this.recalcAll();
|
|
105
|
+
}else{
|
|
106
|
+
this.recalcActiveRows();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
102
110
|
recalcActiveRows(){
|
|
103
111
|
this.recalc(this.table.rowManager.activeRows);
|
|
104
112
|
}
|
|
@@ -106,7 +114,6 @@ class ColumnCalcs extends Module{
|
|
|
106
114
|
cellValueChanged(cell){
|
|
107
115
|
if(cell.column.definition.topCalc || cell.column.definition.bottomCalc){
|
|
108
116
|
if(this.table.options.groupBy){
|
|
109
|
-
|
|
110
117
|
if(this.table.options.columnCalcs == "table" || this.table.options.columnCalcs == "both"){
|
|
111
118
|
this.recalcActiveRows();
|
|
112
119
|
}
|
|
@@ -114,7 +121,6 @@ class ColumnCalcs extends Module{
|
|
|
114
121
|
if(this.table.options.columnCalcs != "table"){
|
|
115
122
|
this.recalcRowGroup(cell.row);
|
|
116
123
|
}
|
|
117
|
-
|
|
118
124
|
}else{
|
|
119
125
|
this.recalcActiveRows();
|
|
120
126
|
}
|
|
@@ -286,7 +292,6 @@ class ColumnCalcs extends Module{
|
|
|
286
292
|
|
|
287
293
|
if(this.table.options.groupBy && this.table.options.columnCalcs !== "table"){
|
|
288
294
|
|
|
289
|
-
|
|
290
295
|
var groups = this.table.modules.groupRows.getChildGroups();
|
|
291
296
|
|
|
292
297
|
groups.forEach((group) => {
|
|
@@ -208,7 +208,8 @@ class Export extends Module{
|
|
|
208
208
|
|
|
209
209
|
header.forEach((col) => {
|
|
210
210
|
if(col){
|
|
211
|
-
|
|
211
|
+
let title = typeof col.title === "undefined" ? "" : col.title;
|
|
212
|
+
columns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));
|
|
212
213
|
}else{
|
|
213
214
|
columns.push(null);
|
|
214
215
|
}
|
|
@@ -466,10 +467,10 @@ class Export extends Module{
|
|
|
466
467
|
rowEl.classList.add("tabulator-print-table-row");
|
|
467
468
|
|
|
468
469
|
row.columns.forEach((col) => {
|
|
469
|
-
|
|
470
470
|
if(col){
|
|
471
471
|
var cellEl = document.createElement("td"),
|
|
472
472
|
column = col.component._column,
|
|
473
|
+
index = this.table.columnManager.findColumnIndex(column),
|
|
473
474
|
value = col.value;
|
|
474
475
|
|
|
475
476
|
var cellWrapper = {
|
|
@@ -528,8 +529,8 @@ class Export extends Module{
|
|
|
528
529
|
cellEl.innerHTML = value;
|
|
529
530
|
}
|
|
530
531
|
|
|
531
|
-
if(styles.firstCell){
|
|
532
|
-
this.mapElementStyles(styles.firstCell, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size"]);
|
|
532
|
+
if(styles.styleCells[index] || styles.firstCell){
|
|
533
|
+
this.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "text-align"]);
|
|
533
534
|
|
|
534
535
|
if(column.definition.align){
|
|
535
536
|
cellEl.style.textAlign = column.definition.align;
|
|
@@ -416,7 +416,9 @@ class Filter extends Module{
|
|
|
416
416
|
editorElement.addEventListener("focus", (e) => {
|
|
417
417
|
var left = this.table.columnManager.element.scrollLeft;
|
|
418
418
|
|
|
419
|
-
|
|
419
|
+
var headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);
|
|
420
|
+
|
|
421
|
+
if(left !== headerPos){
|
|
420
422
|
this.table.rowManager.scrollHorizontal(left);
|
|
421
423
|
this.table.columnManager.scrollHorizontal(left);
|
|
422
424
|
}
|
|
@@ -595,12 +597,11 @@ class Filter extends Module{
|
|
|
595
597
|
}
|
|
596
598
|
|
|
597
599
|
field.forEach((filter) => {
|
|
598
|
-
|
|
599
600
|
filter = this.findFilter(filter);
|
|
600
601
|
|
|
601
602
|
if(filter){
|
|
602
603
|
this.filterList.push(filter);
|
|
603
|
-
|
|
604
|
+
changed = true;
|
|
604
605
|
}
|
|
605
606
|
});
|
|
606
607
|
|
|
@@ -2,9 +2,12 @@ import RowComponent from '../../../../core/row/RowComponent.js';
|
|
|
2
2
|
|
|
3
3
|
export default function(cell, formatterParams, onRendered){
|
|
4
4
|
var checkbox = document.createElement("input");
|
|
5
|
+
var blocked = false;
|
|
5
6
|
|
|
6
7
|
checkbox.type = 'checkbox';
|
|
7
8
|
|
|
9
|
+
checkbox.setAttribute("aria-label", "Select Row");
|
|
10
|
+
|
|
8
11
|
if(this.table.modExists("selectRow", true)){
|
|
9
12
|
|
|
10
13
|
checkbox.addEventListener("click", (e) => {
|
|
@@ -17,9 +20,24 @@ export default function(cell, formatterParams, onRendered){
|
|
|
17
20
|
if(row instanceof RowComponent){
|
|
18
21
|
|
|
19
22
|
checkbox.addEventListener("change", (e) => {
|
|
20
|
-
|
|
23
|
+
if(this.table.options.selectableRangeMode === "click"){
|
|
24
|
+
if(!blocked){
|
|
25
|
+
row.toggleSelect();
|
|
26
|
+
}else{
|
|
27
|
+
blocked = false;
|
|
28
|
+
}
|
|
29
|
+
}else{
|
|
30
|
+
row.toggleSelect();
|
|
31
|
+
}
|
|
21
32
|
});
|
|
22
33
|
|
|
34
|
+
if(this.table.options.selectableRangeMode === "click"){
|
|
35
|
+
checkbox.addEventListener("click", (e) => {
|
|
36
|
+
blocked = true;
|
|
37
|
+
this.table.modules.selectRow.handleComplexRowClick(row._row, e);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
23
41
|
checkbox.checked = row.isSelected && row.isSelected();
|
|
24
42
|
this.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);
|
|
25
43
|
}else{
|