tabulator-tables 5.3.4 → 5.4.0
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/Bundler.js +64 -38
- package/dist/css/tabulator.css +69 -19
- package/dist/css/tabulator.css.map +1 -1
- package/dist/css/tabulator.min.css +1 -1
- package/dist/css/tabulator.min.css.map +1 -1
- package/dist/css/tabulator_bootstrap3.css +69 -19
- 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 +69 -19
- 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 +69 -19
- 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 +69 -19
- 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/css/tabulator_materialize.css +69 -19
- package/dist/css/tabulator_materialize.css.map +1 -1
- package/dist/css/tabulator_materialize.min.css +1 -1
- package/dist/css/tabulator_materialize.min.css.map +1 -1
- package/dist/css/tabulator_midnight.css +69 -19
- package/dist/css/tabulator_midnight.css.map +1 -1
- package/dist/css/tabulator_midnight.min.css +1 -1
- package/dist/css/tabulator_midnight.min.css.map +1 -1
- package/dist/css/tabulator_modern.css +69 -19
- package/dist/css/tabulator_modern.css.map +1 -1
- package/dist/css/tabulator_modern.min.css +1 -1
- package/dist/css/tabulator_modern.min.css.map +1 -1
- package/dist/css/tabulator_semanticui.css +69 -19
- package/dist/css/tabulator_semanticui.css.map +1 -1
- package/dist/css/tabulator_semanticui.min.css +1 -1
- package/dist/css/tabulator_semanticui.min.css.map +1 -1
- package/dist/css/tabulator_simple.css +69 -19
- package/dist/css/tabulator_simple.css.map +1 -1
- package/dist/css/tabulator_simple.min.css +1 -1
- package/dist/css/tabulator_simple.min.css.map +1 -1
- package/dist/css/tabulator_site.css +69 -19
- package/dist/css/tabulator_site.css.map +1 -1
- package/dist/css/tabulator_site.min.css +1 -1
- package/dist/css/tabulator_site.min.css.map +1 -1
- package/dist/js/tabulator.js +25819 -27494
- 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 +696 -498
- 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 +3 -6
- package/src/js/core/ColumnManager.js +30 -15
- package/src/js/core/RowManager.js +26 -0
- package/src/js/core/column/Column.js +4 -0
- package/src/js/core/column/defaults/options.js +1 -0
- package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +76 -77
- package/src/js/core/row/Row.js +1 -1
- package/src/js/core/tools/InteractionMonitor.js +2 -0
- package/src/js/core/tools/Popup.js +98 -76
- package/src/js/modules/ColumnCalcs/ColumnCalcs.js +185 -146
- package/src/js/modules/Download/defaults/downloaders/xlsx.js +2 -1
- package/src/js/modules/Edit/Edit.js +13 -2
- package/src/js/modules/Format/Format.js +46 -40
- package/src/js/modules/Format/defaults/formatters/responsiveCollapse.js +9 -1
- package/src/js/modules/FrozenColumns/FrozenColumns.js +24 -57
- package/src/js/modules/FrozenRows/FrozenRows.js +1 -1
- package/src/js/modules/GroupRows/Group.js +20 -28
- package/src/js/modules/GroupRows/GroupComponent.js +1 -1
- package/src/js/modules/Interaction/Interaction.js +12 -0
- package/src/js/modules/Menu/Menu.js +31 -7
- package/src/js/modules/MoveColumns/MoveColumns.js +3 -3
- package/src/js/modules/Persistence/Persistence.js +1 -0
- package/src/js/modules/Popup/Popup.js +42 -4
- package/src/js/modules/ResizeColumns/ResizeColumns.js +25 -6
- package/src/js/modules/ResizeTable/ResizeTable.js +7 -8
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +21 -21
- package/src/js/modules/Sort/Sort.js +14 -2
- package/src/scss/tabulator.scss +92 -31
|
@@ -53,6 +53,7 @@ class Edit extends Module{
|
|
|
53
53
|
this.subscribe("column-layout", this.initializeColumnCheck.bind(this));
|
|
54
54
|
this.subscribe("column-delete", this.columnDeleteCheck.bind(this));
|
|
55
55
|
this.subscribe("row-deleting", this.rowDeleteCheck.bind(this));
|
|
56
|
+
this.subscribe("row-layout", this.rowEditableCheck.bind(this));
|
|
56
57
|
this.subscribe("data-refreshing", this.cancelEdit.bind(this));
|
|
57
58
|
|
|
58
59
|
this.subscribe("keybinding-nav-prev", this.navigatePrev.bind(this, undefined));
|
|
@@ -157,7 +158,7 @@ class Edit extends Module{
|
|
|
157
158
|
prevRow = this.table.rowManager.prevDisplayRow(cell.row, true);
|
|
158
159
|
|
|
159
160
|
if(prevRow){
|
|
160
|
-
nextCell = this.
|
|
161
|
+
nextCell = this.findPrevEditableCell(prevRow, prevRow.cells.length);
|
|
161
162
|
|
|
162
163
|
if(nextCell){
|
|
163
164
|
nextCell.getComponent().edit();
|
|
@@ -347,6 +348,14 @@ class Edit extends Module{
|
|
|
347
348
|
this.cancelEdit();
|
|
348
349
|
}
|
|
349
350
|
}
|
|
351
|
+
|
|
352
|
+
rowEditableCheck(row){
|
|
353
|
+
row.getCells().forEach((cell) => {
|
|
354
|
+
if(cell.column.modules.edit && typeof cell.column.modules.edit.check === "function"){
|
|
355
|
+
this.updateCellClass(cell);
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
350
359
|
|
|
351
360
|
//initialize column editor
|
|
352
361
|
initializeColumn(column){
|
|
@@ -531,7 +540,9 @@ class Edit extends Module{
|
|
|
531
540
|
if(cell.column.modules.edit){
|
|
532
541
|
switch(typeof cell.column.modules.edit.check){
|
|
533
542
|
case "function":
|
|
534
|
-
|
|
543
|
+
if(cell.row.initialized){
|
|
544
|
+
check = cell.column.modules.edit.check(cell.getComponent());
|
|
545
|
+
}
|
|
535
546
|
break;
|
|
536
547
|
|
|
537
548
|
case "string":
|
|
@@ -3,13 +3,13 @@ import Module from '../../core/Module.js';
|
|
|
3
3
|
import defaultFormatters from './defaults/formatters.js';
|
|
4
4
|
|
|
5
5
|
class Format extends Module{
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
constructor(table){
|
|
8
8
|
super(table);
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
this.registerColumnOption("formatter");
|
|
11
11
|
this.registerColumnOption("formatterParams");
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
this.registerColumnOption("formatterPrint");
|
|
14
14
|
this.registerColumnOption("formatterPrintParams");
|
|
15
15
|
this.registerColumnOption("formatterClipboard");
|
|
@@ -19,35 +19,35 @@ class Format extends Module{
|
|
|
19
19
|
this.registerColumnOption("titleFormatter");
|
|
20
20
|
this.registerColumnOption("titleFormatterParams");
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
initialize(){
|
|
24
24
|
this.subscribe("cell-format", this.formatValue.bind(this));
|
|
25
25
|
this.subscribe("cell-rendered", this.cellRendered.bind(this));
|
|
26
26
|
this.subscribe("column-layout", this.initializeColumn.bind(this));
|
|
27
27
|
this.subscribe("column-format", this.formatHeader.bind(this));
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
//initialize column formatter
|
|
31
31
|
initializeColumn(column){
|
|
32
32
|
column.modules.format = this.lookupFormatter(column, "");
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
if(typeof column.definition.formatterPrint !== "undefined"){
|
|
35
35
|
column.modules.format.print = this.lookupFormatter(column, "Print");
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
if(typeof column.definition.formatterClipboard !== "undefined"){
|
|
39
39
|
column.modules.format.clipboard = this.lookupFormatter(column, "Clipboard");
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
if(typeof column.definition.formatterHtmlOutput !== "undefined"){
|
|
43
43
|
column.modules.format.htmlOutput = this.lookupFormatter(column, "HtmlOutput");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
lookupFormatter(column, type){
|
|
48
48
|
var config = {params:column.definition["formatter" + type + "Params"] || {}},
|
|
49
49
|
formatter = column.definition["formatter" + type];
|
|
50
|
-
|
|
50
|
+
|
|
51
51
|
//set column formatter
|
|
52
52
|
switch(typeof formatter){
|
|
53
53
|
case "string":
|
|
@@ -58,97 +58,103 @@ class Format extends Module{
|
|
|
58
58
|
config.formatter = Format.formatters.plaintext;
|
|
59
59
|
}
|
|
60
60
|
break;
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
case "function":
|
|
63
63
|
config.formatter = formatter;
|
|
64
64
|
break;
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
default:
|
|
67
67
|
config.formatter = Format.formatters.plaintext;
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
return config;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
cellRendered(cell){
|
|
75
75
|
if(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){
|
|
76
76
|
cell.modules.format.renderedCallback();
|
|
77
77
|
cell.modules.format.rendered = true;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
//return a formatted value for a column header
|
|
82
82
|
formatHeader(column, title, el){
|
|
83
83
|
var formatter, params, onRendered, mockCell;
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
if(column.definition.titleFormatter){
|
|
86
86
|
formatter = this.getFormatter(column.definition.titleFormatter);
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
onRendered = (callback) => {
|
|
89
89
|
column.titleFormatterRendered = callback;
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
mockCell = {
|
|
93
93
|
getValue:function(){
|
|
94
94
|
return title;
|
|
95
95
|
},
|
|
96
96
|
getElement:function(){
|
|
97
97
|
return el;
|
|
98
|
+
},
|
|
99
|
+
getColumn:function(){
|
|
100
|
+
return column.getComponent();
|
|
101
|
+
},
|
|
102
|
+
getTable:() => {
|
|
103
|
+
return this.table;
|
|
98
104
|
}
|
|
99
105
|
};
|
|
100
|
-
|
|
106
|
+
|
|
101
107
|
params = column.definition.titleFormatterParams || {};
|
|
102
|
-
|
|
108
|
+
|
|
103
109
|
params = typeof params === "function" ? params() : params;
|
|
104
|
-
|
|
110
|
+
|
|
105
111
|
return formatter.call(this, mockCell, params, onRendered);
|
|
106
112
|
}else{
|
|
107
113
|
return title;
|
|
108
114
|
}
|
|
109
115
|
}
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
|
|
117
|
+
|
|
112
118
|
//return a formatted value for a cell
|
|
113
119
|
formatValue(cell){
|
|
114
120
|
var component = cell.getComponent(),
|
|
115
121
|
params = typeof cell.column.modules.format.params === "function" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;
|
|
116
|
-
|
|
122
|
+
|
|
117
123
|
function onRendered(callback){
|
|
118
124
|
if(!cell.modules.format){
|
|
119
125
|
cell.modules.format = {};
|
|
120
126
|
}
|
|
121
|
-
|
|
127
|
+
|
|
122
128
|
cell.modules.format.renderedCallback = callback;
|
|
123
129
|
cell.modules.format.rendered = false;
|
|
124
130
|
}
|
|
125
|
-
|
|
131
|
+
|
|
126
132
|
return cell.column.modules.format.formatter.call(this, component, params, onRendered);
|
|
127
133
|
}
|
|
128
|
-
|
|
134
|
+
|
|
129
135
|
formatExportValue(cell, type){
|
|
130
136
|
var formatter = cell.column.modules.format[type],
|
|
131
137
|
params;
|
|
132
|
-
|
|
138
|
+
|
|
133
139
|
if(formatter){
|
|
134
140
|
params = typeof formatter.params === "function" ? formatter.params(cell.getComponent()) : formatter.params;
|
|
135
|
-
|
|
141
|
+
|
|
136
142
|
function onRendered(callback){
|
|
137
143
|
if(!cell.modules.format){
|
|
138
144
|
cell.modules.format = {};
|
|
139
145
|
}
|
|
140
|
-
|
|
146
|
+
|
|
141
147
|
cell.modules.format.renderedCallback = callback;
|
|
142
148
|
cell.modules.format.rendered = false;
|
|
143
149
|
}
|
|
144
|
-
|
|
150
|
+
|
|
145
151
|
return formatter.formatter.call(this, cell.getComponent(), params, onRendered);
|
|
146
|
-
|
|
152
|
+
|
|
147
153
|
}else{
|
|
148
154
|
return this.formatValue(cell);
|
|
149
155
|
}
|
|
150
156
|
}
|
|
151
|
-
|
|
157
|
+
|
|
152
158
|
sanitizeHTML(value){
|
|
153
159
|
if(value){
|
|
154
160
|
var entityMap = {
|
|
@@ -161,7 +167,7 @@ class Format extends Module{
|
|
|
161
167
|
'`': '`',
|
|
162
168
|
'=': '='
|
|
163
169
|
};
|
|
164
|
-
|
|
170
|
+
|
|
165
171
|
return String(value).replace(/[&<>"'`=/]/g, function (s) {
|
|
166
172
|
return entityMap[s];
|
|
167
173
|
});
|
|
@@ -169,11 +175,11 @@ class Format extends Module{
|
|
|
169
175
|
return value;
|
|
170
176
|
}
|
|
171
177
|
}
|
|
172
|
-
|
|
178
|
+
|
|
173
179
|
emptyToSpace(value){
|
|
174
180
|
return value === null || typeof value === "undefined" || value === "" ? " " : value;
|
|
175
181
|
}
|
|
176
|
-
|
|
182
|
+
|
|
177
183
|
//get formatter for cell
|
|
178
184
|
getFormatter(formatter){
|
|
179
185
|
switch(typeof formatter){
|
|
@@ -185,16 +191,16 @@ class Format extends Module{
|
|
|
185
191
|
formatter = Format.formatters.plaintext;
|
|
186
192
|
}
|
|
187
193
|
break;
|
|
188
|
-
|
|
194
|
+
|
|
189
195
|
case "function":
|
|
190
|
-
|
|
196
|
+
//Custom formatter Function, do nothing
|
|
191
197
|
break;
|
|
192
|
-
|
|
198
|
+
|
|
193
199
|
default:
|
|
194
200
|
formatter = Format.formatters.plaintext;
|
|
195
201
|
break;
|
|
196
202
|
}
|
|
197
|
-
|
|
203
|
+
|
|
198
204
|
return formatter;
|
|
199
205
|
}
|
|
200
206
|
}
|
|
@@ -3,7 +3,15 @@ export default function(cell, formatterParams, onRendered){
|
|
|
3
3
|
config = cell.getRow()._row.modules.responsiveLayout;
|
|
4
4
|
|
|
5
5
|
el.classList.add("tabulator-responsive-collapse-toggle");
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
el.innerHTML = `<svg class='tabulator-responsive-collapse-toggle-open' viewbox="0 0 24 24">
|
|
8
|
+
<line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />
|
|
9
|
+
<line y1="7" x1="12" y2="17" x2="12" fill="none" stroke-width="3" stroke-linecap="round" />
|
|
10
|
+
</svg>
|
|
11
|
+
|
|
12
|
+
<svg class='tabulator-responsive-collapse-toggle-close' viewbox="0 0 24 24">
|
|
13
|
+
<line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />
|
|
14
|
+
</svg>`;
|
|
7
15
|
|
|
8
16
|
cell.getElement().classList.add("tabulator-row-handle");
|
|
9
17
|
|
|
@@ -7,9 +7,6 @@ class FrozenColumns extends Module{
|
|
|
7
7
|
|
|
8
8
|
this.leftColumns = [];
|
|
9
9
|
this.rightColumns = [];
|
|
10
|
-
this.leftMargin = 0;
|
|
11
|
-
this.rightMargin = 0;
|
|
12
|
-
this.rightPadding = 0;
|
|
13
10
|
this.initializationMode = "left";
|
|
14
11
|
this.active = false;
|
|
15
12
|
this.blocked = true;
|
|
@@ -22,13 +19,7 @@ class FrozenColumns extends Module{
|
|
|
22
19
|
this.initializationMode = "left";
|
|
23
20
|
this.leftColumns = [];
|
|
24
21
|
this.rightColumns = [];
|
|
25
|
-
this.leftMargin = 0;
|
|
26
|
-
this.rightMargin = 0;
|
|
27
|
-
this.rightMargin = 0;
|
|
28
22
|
this.active = false;
|
|
29
|
-
|
|
30
|
-
this.table.columnManager.headersElement.style.marginLeft = 0;
|
|
31
|
-
this.table.columnManager.element.style.paddingRight = 0;
|
|
32
23
|
}
|
|
33
24
|
|
|
34
25
|
initialize(){
|
|
@@ -37,8 +28,6 @@ class FrozenColumns extends Module{
|
|
|
37
28
|
this.subscribe("column-width", this.layout.bind(this));
|
|
38
29
|
this.subscribe("row-layout-after", this.layoutRow.bind(this));
|
|
39
30
|
this.subscribe("table-layout", this.layout.bind(this));
|
|
40
|
-
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
41
|
-
this.subscribe("scroll-horizontal", this.scrollHorizontal.bind(this));
|
|
42
31
|
this.subscribe("columns-loading", this.reset.bind(this));
|
|
43
32
|
|
|
44
33
|
this.subscribe("column-add", this.reinitializeColumns.bind(this));
|
|
@@ -47,6 +36,7 @@ class FrozenColumns extends Module{
|
|
|
47
36
|
this.subscribe("table-redraw", this.layout.bind(this));
|
|
48
37
|
this.subscribe("layout-refreshing", this.blockLayout.bind(this));
|
|
49
38
|
this.subscribe("layout-refreshed", this.unblockLayout.bind(this));
|
|
39
|
+
this.subscribe("scrollbar-vertical", this.adjustForScrollbar.bind(this));
|
|
50
40
|
}
|
|
51
41
|
|
|
52
42
|
blockLayout(){
|
|
@@ -106,32 +96,6 @@ class FrozenColumns extends Module{
|
|
|
106
96
|
}
|
|
107
97
|
}
|
|
108
98
|
|
|
109
|
-
//quick layout to smooth horizontal scrolling
|
|
110
|
-
scrollHorizontal(){
|
|
111
|
-
if(this.active){
|
|
112
|
-
this.calcMargins(true);
|
|
113
|
-
|
|
114
|
-
this.layoutColumnPosition();
|
|
115
|
-
|
|
116
|
-
this.layoutCalcRows();
|
|
117
|
-
|
|
118
|
-
this.reinitializeRows();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
//calculate margins for rows
|
|
123
|
-
calcMargins(scroll){
|
|
124
|
-
|
|
125
|
-
if(!scroll){
|
|
126
|
-
this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px";
|
|
127
|
-
this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px";
|
|
128
|
-
this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
//calculate right frozen columns
|
|
132
|
-
this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
99
|
//layout calculation rows
|
|
136
100
|
layoutCalcRows(){
|
|
137
101
|
if(this.table.modExists("columnCalcs")){
|
|
@@ -172,11 +136,8 @@ class FrozenColumns extends Module{
|
|
|
172
136
|
var leftMargin = 0;
|
|
173
137
|
var rightMargin = 0;
|
|
174
138
|
|
|
175
|
-
this.table.columnManager.headersElement.style.marginLeft = this.leftMargin;
|
|
176
|
-
this.table.columnManager.element.style.paddingRight = this.rightMargin;
|
|
177
|
-
|
|
178
139
|
this.leftColumns.forEach((column, i) => {
|
|
179
|
-
column.modules.frozen.marginValue = leftMargin
|
|
140
|
+
column.modules.frozen.marginValue = leftMargin;
|
|
180
141
|
column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
|
|
181
142
|
|
|
182
143
|
if(column.visible){
|
|
@@ -212,20 +173,19 @@ class FrozenColumns extends Module{
|
|
|
212
173
|
|
|
213
174
|
this.rightColumns.forEach((column, i) => {
|
|
214
175
|
|
|
176
|
+
column.modules.frozen.marginValue = rightMargin;
|
|
177
|
+
column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
|
|
178
|
+
|
|
215
179
|
if(column.visible){
|
|
216
180
|
rightMargin += column.getWidth();
|
|
217
181
|
}
|
|
218
182
|
|
|
219
|
-
column.modules.frozen.marginValue = this.rightPadding - rightMargin;
|
|
220
|
-
column.modules.frozen.margin = column.modules.frozen.marginValue + "px";
|
|
221
|
-
|
|
222
183
|
if(i == this.rightColumns.length - 1){
|
|
223
184
|
column.modules.frozen.edge = true;
|
|
224
185
|
}else{
|
|
225
186
|
column.modules.frozen.edge = false;
|
|
226
187
|
}
|
|
227
188
|
|
|
228
|
-
|
|
229
189
|
if(column.parent.isGroup){
|
|
230
190
|
this.layoutElement(this.getColGroupParentElement(column), column);
|
|
231
191
|
}else{
|
|
@@ -247,12 +207,10 @@ class FrozenColumns extends Module{
|
|
|
247
207
|
//layout columns appropriately
|
|
248
208
|
layout(){
|
|
249
209
|
if(this.active && !this.blocked){
|
|
250
|
-
|
|
251
|
-
this.calcMargins();
|
|
252
|
-
|
|
210
|
+
|
|
253
211
|
//calculate left columns
|
|
254
212
|
this.layoutColumnPosition();
|
|
255
|
-
|
|
213
|
+
|
|
256
214
|
this.reinitializeRows();
|
|
257
215
|
|
|
258
216
|
this.layoutCalcRows();
|
|
@@ -275,11 +233,6 @@ class FrozenColumns extends Module{
|
|
|
275
233
|
}
|
|
276
234
|
|
|
277
235
|
layoutRow(row){
|
|
278
|
-
// console.trace("row")
|
|
279
|
-
var rowEl = row.getElement();
|
|
280
|
-
|
|
281
|
-
rowEl.style.paddingLeft = this.leftMargin;
|
|
282
|
-
|
|
283
236
|
if(this.table.options.layout === "fitDataFill" && this.rightColumns.length){
|
|
284
237
|
this.table.rowManager.getTableElement().style.minWidth = "calc(100% - " + this.rightMargin + ")";
|
|
285
238
|
}
|
|
@@ -302,11 +255,19 @@ class FrozenColumns extends Module{
|
|
|
302
255
|
}
|
|
303
256
|
|
|
304
257
|
layoutElement(element, column){
|
|
258
|
+
var position;
|
|
305
259
|
|
|
306
260
|
if(column.modules.frozen){
|
|
307
|
-
element.style.position = "
|
|
308
|
-
|
|
309
|
-
|
|
261
|
+
element.style.position = "sticky";
|
|
262
|
+
|
|
263
|
+
if(this.table.rtl){
|
|
264
|
+
position = column.modules.frozen.position === "left" ? "right" : "left";
|
|
265
|
+
}else{
|
|
266
|
+
position = column.modules.frozen.position;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
element.style[position] = column.modules.frozen.margin;
|
|
270
|
+
|
|
310
271
|
element.classList.add("tabulator-frozen");
|
|
311
272
|
|
|
312
273
|
if(column.modules.frozen.edge){
|
|
@@ -314,6 +275,12 @@ class FrozenColumns extends Module{
|
|
|
314
275
|
}
|
|
315
276
|
}
|
|
316
277
|
}
|
|
278
|
+
|
|
279
|
+
adjustForScrollbar(width){
|
|
280
|
+
if(this.rightColumns.length){
|
|
281
|
+
this.table.columnManager.getContentsElement().style.width = "calc(100% - " + width + "px)";
|
|
282
|
+
}
|
|
283
|
+
}
|
|
317
284
|
|
|
318
285
|
_calcSpace(columns, index){
|
|
319
286
|
var width = 0;
|
|
@@ -24,7 +24,7 @@ class FrozenRows extends Module{
|
|
|
24
24
|
this.topElement.classList.add("tabulator-frozen-rows-holder");
|
|
25
25
|
|
|
26
26
|
// this.table.columnManager.element.append(this.topElement);
|
|
27
|
-
this.table.columnManager.
|
|
27
|
+
this.table.columnManager.getContentsElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);
|
|
28
28
|
|
|
29
29
|
this.subscribe("row-deleting", this.detachRow.bind(this));
|
|
30
30
|
this.subscribe("rows-visible", this.visibleRows.bind(this));
|
|
@@ -248,38 +248,41 @@ class Group{
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
getHeadersAndRows(
|
|
251
|
+
getHeadersAndRows(){
|
|
252
252
|
var output = [];
|
|
253
253
|
|
|
254
254
|
output.push(this);
|
|
255
255
|
|
|
256
256
|
this._visSet();
|
|
257
257
|
|
|
258
|
+
|
|
259
|
+
if(this.calcs.top){
|
|
260
|
+
this.calcs.top.detachElement();
|
|
261
|
+
this.calcs.top.deleteCells();
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if(this.calcs.bottom){
|
|
265
|
+
this.calcs.bottom.detachElement();
|
|
266
|
+
this.calcs.bottom.deleteCells();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
258
271
|
if(this.visible){
|
|
259
272
|
if(this.groupList.length){
|
|
260
273
|
this.groupList.forEach(function(group){
|
|
261
|
-
output = output.concat(group.getHeadersAndRows(
|
|
274
|
+
output = output.concat(group.getHeadersAndRows());
|
|
262
275
|
});
|
|
263
276
|
|
|
264
277
|
}else{
|
|
265
|
-
if(
|
|
266
|
-
if(this.calcs.top){
|
|
267
|
-
this.calcs.top.detachElement();
|
|
268
|
-
this.calcs.top.deleteCells();
|
|
269
|
-
}
|
|
270
|
-
|
|
278
|
+
if(this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){
|
|
271
279
|
this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);
|
|
272
280
|
output.push(this.calcs.top);
|
|
273
281
|
}
|
|
274
282
|
|
|
275
283
|
output = output.concat(this.rows);
|
|
276
284
|
|
|
277
|
-
if(
|
|
278
|
-
if(this.calcs.bottom){
|
|
279
|
-
this.calcs.bottom.detachElement();
|
|
280
|
-
this.calcs.bottom.deleteCells();
|
|
281
|
-
}
|
|
282
|
-
|
|
285
|
+
if(this.groupManager.table.options.columnCalcs != "table" && this.groupManager.table.modExists("columnCalcs") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){
|
|
283
286
|
this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);
|
|
284
287
|
output.push(this.calcs.bottom);
|
|
285
288
|
}
|
|
@@ -288,25 +291,14 @@ class Group{
|
|
|
288
291
|
if(!this.groupList.length && this.groupManager.table.options.columnCalcs != "table"){
|
|
289
292
|
|
|
290
293
|
if(this.groupManager.table.modExists("columnCalcs")){
|
|
291
|
-
|
|
292
|
-
if(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){
|
|
293
|
-
if(this.calcs.top){
|
|
294
|
-
this.calcs.top.detachElement();
|
|
295
|
-
this.calcs.top.deleteCells();
|
|
296
|
-
}
|
|
297
|
-
|
|
294
|
+
if(this.groupManager.table.modules.columnCalcs.hasTopCalcs()){
|
|
298
295
|
if(this.groupManager.table.options.groupClosedShowCalcs){
|
|
299
296
|
this.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);
|
|
300
297
|
output.push(this.calcs.top);
|
|
301
298
|
}
|
|
302
299
|
}
|
|
303
300
|
|
|
304
|
-
if(
|
|
305
|
-
if(this.calcs.bottom){
|
|
306
|
-
this.calcs.bottom.detachElement();
|
|
307
|
-
this.calcs.bottom.deleteCells();
|
|
308
|
-
}
|
|
309
|
-
|
|
301
|
+
if(this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){
|
|
310
302
|
if(this.groupManager.table.options.groupClosedShowCalcs){
|
|
311
303
|
this.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);
|
|
312
304
|
output.push(this.calcs.bottom);
|
|
@@ -417,7 +409,7 @@ class Group{
|
|
|
417
409
|
prev = rowEl;
|
|
418
410
|
});
|
|
419
411
|
}
|
|
420
|
-
|
|
412
|
+
|
|
421
413
|
this.groupManager.updateGroupRows(true);
|
|
422
414
|
}else{
|
|
423
415
|
this.groupManager.updateGroupRows(true);
|
|
@@ -18,6 +18,8 @@ class Interaction extends Module{
|
|
|
18
18
|
rowMouseOver:"row-mouseover",
|
|
19
19
|
rowMouseOut:"row-mouseout",
|
|
20
20
|
rowMouseMove:"row-mousemove",
|
|
21
|
+
rowMouseDown:"row-mousedown",
|
|
22
|
+
rowMouseUp:"row-mouseup",
|
|
21
23
|
rowTap:"row",
|
|
22
24
|
rowDblTap:"row",
|
|
23
25
|
rowTapHold:"row",
|
|
@@ -31,6 +33,8 @@ class Interaction extends Module{
|
|
|
31
33
|
cellMouseOver:"cell-mouseover",
|
|
32
34
|
cellMouseOut:"cell-mouseout",
|
|
33
35
|
cellMouseMove:"cell-mousemove",
|
|
36
|
+
cellMouseDown:"cell-mousedown",
|
|
37
|
+
cellMouseUp:"cell-mouseup",
|
|
34
38
|
cellTap:"cell",
|
|
35
39
|
cellDblTap:"cell",
|
|
36
40
|
cellTapHold:"cell",
|
|
@@ -44,6 +48,8 @@ class Interaction extends Module{
|
|
|
44
48
|
headerMouseOver:"column-mouseover",
|
|
45
49
|
headerMouseOut:"column-mouseout",
|
|
46
50
|
headerMouseMove:"column-mousemove",
|
|
51
|
+
headerMouseDown:"column-mousedown",
|
|
52
|
+
headerMouseUp:"column-mouseup",
|
|
47
53
|
headerTap:"column",
|
|
48
54
|
headerDblTap:"column",
|
|
49
55
|
headerTapHold:"column",
|
|
@@ -57,6 +63,8 @@ class Interaction extends Module{
|
|
|
57
63
|
groupMouseOver:"group-mouseover",
|
|
58
64
|
groupMouseOut:"group-mouseout",
|
|
59
65
|
groupMouseMove:"group-mousemove",
|
|
66
|
+
groupMouseDown:"group-mousedown",
|
|
67
|
+
groupMouseUp:"group-mouseup",
|
|
60
68
|
groupTap:"group",
|
|
61
69
|
groupDblTap:"group",
|
|
62
70
|
groupTapHold:"group",
|
|
@@ -99,6 +107,8 @@ class Interaction extends Module{
|
|
|
99
107
|
this.registerColumnOption("headerMouseOver");
|
|
100
108
|
this.registerColumnOption("headerMouseOut");
|
|
101
109
|
this.registerColumnOption("headerMouseMove");
|
|
110
|
+
this.registerColumnOption("headerMouseDown");
|
|
111
|
+
this.registerColumnOption("headerMouseUp");
|
|
102
112
|
this.registerColumnOption("headerTap");
|
|
103
113
|
this.registerColumnOption("headerDblTap");
|
|
104
114
|
this.registerColumnOption("headerTapHold");
|
|
@@ -111,6 +121,8 @@ class Interaction extends Module{
|
|
|
111
121
|
this.registerColumnOption("cellMouseOver");
|
|
112
122
|
this.registerColumnOption("cellMouseOut");
|
|
113
123
|
this.registerColumnOption("cellMouseMove");
|
|
124
|
+
this.registerColumnOption("cellMouseDown");
|
|
125
|
+
this.registerColumnOption("cellMouseUp");
|
|
114
126
|
this.registerColumnOption("cellTap");
|
|
115
127
|
this.registerColumnOption("cellDblTap");
|
|
116
128
|
this.registerColumnOption("cellTapHold");
|