tabulator-tables 5.0.1 → 5.0.6
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/rollup.js +1 -1
- package/dist/css/tabulator_bootstrap3.css +9 -0
- 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 +0 -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_bulma.css +5 -1
- 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_semanticui.css +11 -2
- 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/js/tabulator.js +295 -176
- 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 +252 -153
- 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 +12 -12
- package/src/js/core/FooterManager.js +2 -2
- package/src/js/core/RowManager.js +6 -5
- package/src/js/core/Tabulator.js +64 -29
- package/src/js/core/column/Column.js +2 -2
- package/src/js/core/rendering/renderers/VirtualDomVertical.js +4 -0
- package/src/js/core/row/Row.js +4 -1
- package/src/js/core/tools/DataLoader.js +1 -1
- package/src/js/core/tools/ExternalEventBus.js +3 -2
- package/src/js/core/tools/Helpers.js +24 -7
- package/src/js/core/tools/InteractionMonitor.js +1 -0
- package/src/js/core/tools/ModuleBinder.js +1 -1
- package/src/js/modules/Accessor/Accessor.js +1 -1
- package/src/js/modules/Ajax/defaults/contentTypeFormatters.js +22 -1
- package/src/js/modules/DataTree/DataTree.js +1 -1
- package/src/js/modules/Edit/Edit.js +7 -6
- package/src/js/modules/Edit/defaults/editors/progress.js +2 -2
- package/src/js/modules/Filter/Filter.js +1 -1
- package/src/js/modules/Format/defaults/formatters/money.js +8 -1
- package/src/js/modules/FrozenColumns/FrozenColumns.js +21 -0
- package/src/js/modules/GroupRows/Group.js +2 -0
- package/src/js/modules/GroupRows/GroupRows.js +4 -6
- package/src/js/modules/History/defaults/redoers.js +1 -0
- package/src/js/modules/History/defaults/undoers.js +1 -0
- package/src/js/modules/HtmlTableImport/HtmlTableImport.js +4 -22
- package/src/js/modules/Page/Page.js +2 -2
- package/src/js/modules/ReactiveData/ReactiveData.js +28 -27
- package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +5 -1
- package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +9 -0
- package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +0 -4
- package/src/scss/themes/bulma/tabulator_bulma.scss +5 -1
- package/src/scss/themes/semanticui/tabulator_semanticui.scss +12 -7
|
@@ -330,14 +330,12 @@ class GroupRows extends Module{
|
|
|
330
330
|
getRows(rows){
|
|
331
331
|
if(this.groupIDLookups.length){
|
|
332
332
|
|
|
333
|
-
|
|
334
|
-
this.dispatchExternal("dataGrouping");
|
|
333
|
+
this.dispatchExternal("dataGrouping");
|
|
335
334
|
|
|
336
|
-
|
|
335
|
+
this.generateGroups(rows);
|
|
337
336
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}
|
|
337
|
+
if(this.subscribedExternal("dataGrouped")){
|
|
338
|
+
this.dispatchExternal("dataGrouped", this.getGroups(true));
|
|
341
339
|
}
|
|
342
340
|
|
|
343
341
|
return this.updateGroupRows();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Module from '../../core/Module.js';
|
|
2
|
+
import Column from '../../core/column/Column.js';
|
|
2
3
|
|
|
3
4
|
class HtmlTableImport extends Module{
|
|
4
5
|
|
|
@@ -10,17 +11,17 @@ class HtmlTableImport extends Module{
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
initialize(){
|
|
13
|
-
this.
|
|
14
|
+
this.tableElementCheck();
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
tableElementCheck(){
|
|
17
|
-
if(this.table.
|
|
18
|
+
if(this.table.originalElement && this.table.originalElement.tagName === "TABLE"){
|
|
18
19
|
this.parseTable();
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
parseTable(){
|
|
23
|
-
var element = this.table.
|
|
24
|
+
var element = this.table.originalElement,
|
|
24
25
|
options = this.table.options,
|
|
25
26
|
columns = options.columns,
|
|
26
27
|
headers = element.getElementsByTagName("th"),
|
|
@@ -65,28 +66,9 @@ class HtmlTableImport extends Module{
|
|
|
65
66
|
data.push(item);
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
//create new element
|
|
69
|
-
var newElement = document.createElement("div");
|
|
70
|
-
|
|
71
|
-
//transfer attributes to new element
|
|
72
|
-
var attributes = element.attributes;
|
|
73
|
-
|
|
74
|
-
// loop through attributes and apply them on div
|
|
75
|
-
|
|
76
|
-
for(var i in attributes){
|
|
77
|
-
if(typeof attributes[i] == "object"){
|
|
78
|
-
newElement.setAttribute(attributes[i].name, attributes[i].value);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// replace table with div element
|
|
83
|
-
element.parentNode.replaceChild(newElement, element);
|
|
84
|
-
|
|
85
69
|
options.data = data;
|
|
86
70
|
|
|
87
71
|
this.dispatchExternal("htmlImported");
|
|
88
|
-
|
|
89
|
-
this.table.element = newElement;
|
|
90
72
|
}
|
|
91
73
|
|
|
92
74
|
//extract tabulator attribute options
|
|
@@ -136,6 +136,8 @@ class Page extends Module{
|
|
|
136
136
|
|
|
137
137
|
this.table.rowManager.getTableElement().removeChild(testElRow);
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
this.generatePageSizeSelectList();
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
initialLoadComplete(){
|
|
@@ -395,8 +397,6 @@ class Page extends Module{
|
|
|
395
397
|
|
|
396
398
|
this.page = this.table.options.paginationInitialPage;
|
|
397
399
|
this.count = this.table.options.paginationButtonCount;
|
|
398
|
-
|
|
399
|
-
this.generatePageSizeSelectList();
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
//set default values
|
|
@@ -26,7 +26,8 @@ class ReactiveData extends Module{
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
watchData(data){
|
|
29
|
-
var
|
|
29
|
+
var self = this,
|
|
30
|
+
pushFunc, version;
|
|
30
31
|
|
|
31
32
|
this.currentVersion ++;
|
|
32
33
|
|
|
@@ -42,16 +43,16 @@ class ReactiveData extends Module{
|
|
|
42
43
|
Object.defineProperty(this.data, "push", {
|
|
43
44
|
enumerable: false,
|
|
44
45
|
configurable: true,
|
|
45
|
-
value: ()
|
|
46
|
+
value: function(){
|
|
46
47
|
var args = Array.from(arguments);
|
|
47
48
|
|
|
48
|
-
if(!
|
|
49
|
+
if(!self.blocked && version === self.currentVersion){
|
|
49
50
|
args.forEach((arg) => {
|
|
50
|
-
|
|
51
|
+
self.table.rowManager.addRowActual(arg, false);
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
return
|
|
55
|
+
return self.origFuncs.push.apply(data, arguments);
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
|
|
@@ -61,16 +62,16 @@ class ReactiveData extends Module{
|
|
|
61
62
|
Object.defineProperty(this.data, "unshift", {
|
|
62
63
|
enumerable: false,
|
|
63
64
|
configurable: true,
|
|
64
|
-
value: ()
|
|
65
|
+
value: function(){
|
|
65
66
|
var args = Array.from(arguments);
|
|
66
67
|
|
|
67
|
-
if(!
|
|
68
|
+
if(!self.blocked && version === self.currentVersion){
|
|
68
69
|
args.forEach((arg) => {
|
|
69
|
-
|
|
70
|
+
self.table.rowManager.addRowActual(arg, true);
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
return
|
|
74
|
+
return self.origFuncs.unshift.apply(data, arguments);
|
|
74
75
|
}
|
|
75
76
|
});
|
|
76
77
|
|
|
@@ -81,12 +82,12 @@ class ReactiveData extends Module{
|
|
|
81
82
|
Object.defineProperty(this.data, "shift", {
|
|
82
83
|
enumerable: false,
|
|
83
84
|
configurable: true,
|
|
84
|
-
value: ()
|
|
85
|
+
value: function(){
|
|
85
86
|
var row;
|
|
86
87
|
|
|
87
|
-
if(!
|
|
88
|
-
if(
|
|
89
|
-
row =
|
|
88
|
+
if(!self.blocked && version === self.currentVersion){
|
|
89
|
+
if(self.data.length){
|
|
90
|
+
row = self.table.rowManager.getRowFromDataObject(self.data[0]);
|
|
90
91
|
|
|
91
92
|
if(row){
|
|
92
93
|
row.deleteActual();
|
|
@@ -94,7 +95,7 @@ class ReactiveData extends Module{
|
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
return
|
|
98
|
+
return self.origFuncs.shift.call(data);
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
101
|
|
|
@@ -104,18 +105,18 @@ class ReactiveData extends Module{
|
|
|
104
105
|
Object.defineProperty(this.data, "pop", {
|
|
105
106
|
enumerable: false,
|
|
106
107
|
configurable: true,
|
|
107
|
-
value: ()
|
|
108
|
+
value: function(){
|
|
108
109
|
var row;
|
|
109
|
-
if(!
|
|
110
|
-
if(
|
|
111
|
-
row =
|
|
110
|
+
if(!self.blocked && version === self.currentVersion){
|
|
111
|
+
if(self.data.length){
|
|
112
|
+
row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);
|
|
112
113
|
|
|
113
114
|
if(row){
|
|
114
115
|
row.deleteActual();
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
|
-
return
|
|
119
|
+
return self.origFuncs.pop.call(data);
|
|
119
120
|
}
|
|
120
121
|
});
|
|
121
122
|
|
|
@@ -126,28 +127,28 @@ class ReactiveData extends Module{
|
|
|
126
127
|
Object.defineProperty(this.data, "splice", {
|
|
127
128
|
enumerable: false,
|
|
128
129
|
configurable: true,
|
|
129
|
-
value: ()
|
|
130
|
+
value: function(){
|
|
130
131
|
var args = Array.from(arguments),
|
|
131
132
|
start = args[0] < 0 ? data.length + args[0] : args[0],
|
|
132
133
|
end = args[1],
|
|
133
134
|
newRows = args[2] ? args.slice(2) : false,
|
|
134
135
|
startRow;
|
|
135
136
|
|
|
136
|
-
if(!
|
|
137
|
+
if(!self.blocked && version === self.currentVersion){
|
|
137
138
|
|
|
138
139
|
//add new rows
|
|
139
140
|
if(newRows){
|
|
140
|
-
startRow = data[start] ?
|
|
141
|
+
startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;
|
|
141
142
|
|
|
142
143
|
if(startRow){
|
|
143
144
|
newRows.forEach((rowData) => {
|
|
144
|
-
|
|
145
|
+
self.table.rowManager.addRowActual(rowData, true, startRow, true);
|
|
145
146
|
});
|
|
146
147
|
}else{
|
|
147
148
|
newRows = newRows.slice().reverse();
|
|
148
149
|
|
|
149
150
|
newRows.forEach((rowData) => {
|
|
150
|
-
|
|
151
|
+
self.table.rowManager.addRowActual(rowData, true, false, true);
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
154
|
}
|
|
@@ -157,7 +158,7 @@ class ReactiveData extends Module{
|
|
|
157
158
|
var oldRows = data.slice(start, typeof args[1] === "undefined" ? args[1] : start + end);
|
|
158
159
|
|
|
159
160
|
oldRows.forEach((rowData, i) => {
|
|
160
|
-
var row =
|
|
161
|
+
var row = self.table.rowManager.getRowFromDataObject(rowData);
|
|
161
162
|
|
|
162
163
|
if(row){
|
|
163
164
|
row.deleteActual(i !== oldRows.length - 1);
|
|
@@ -166,11 +167,11 @@ class ReactiveData extends Module{
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
if(newRows || end !== 0){
|
|
169
|
-
|
|
170
|
+
self.table.rowManager.reRenderInPosition();
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
|
|
173
|
-
return
|
|
174
|
+
return self.origFuncs.splice.apply(data, arguments);
|
|
174
175
|
}
|
|
175
176
|
});
|
|
176
177
|
}
|
|
@@ -290,10 +290,14 @@ class ResponsiveLayout extends Module{
|
|
|
290
290
|
},
|
|
291
291
|
};
|
|
292
292
|
|
|
293
|
+
function onRendered(callback){
|
|
294
|
+
callback();
|
|
295
|
+
}
|
|
296
|
+
|
|
293
297
|
output.push({
|
|
294
298
|
field: column.field,
|
|
295
299
|
title: column.definition.title,
|
|
296
|
-
value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params)
|
|
300
|
+
value: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)
|
|
297
301
|
});
|
|
298
302
|
}else{
|
|
299
303
|
output.push({
|
|
@@ -185,6 +185,15 @@ $footerActiveColor:#d00 !default; //footer bottom active text color
|
|
|
185
185
|
background-color:$rowHoverBackground !important;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
&.tabulator-selected{
|
|
189
|
+
background-color:$rowSelectedBackground !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&.tabulator-selected:hover{
|
|
193
|
+
background-color:$rowSelectedBackgroundHover !important;
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
}
|
|
196
|
+
|
|
188
197
|
.tabulator-cell{
|
|
189
198
|
padding:$cellPadding;
|
|
190
199
|
border-right:none;
|
|
@@ -445,10 +445,6 @@ $table-cell-padding-sm: 5px;
|
|
|
445
445
|
min-height:$textSize + ($cellPadding * 2);
|
|
446
446
|
border-bottom:1px solid $rowBorderColor;
|
|
447
447
|
|
|
448
|
-
&.tabulator-row-even{
|
|
449
|
-
background-color: transparent;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
448
|
.tabulator-cell{
|
|
453
449
|
padding:$cellPadding;
|
|
454
450
|
border-right:none;
|
|
@@ -204,8 +204,12 @@ $footerBorderColor:$grey-lighter !default; //footer border color
|
|
|
204
204
|
background-color: inherit;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
&.tabulator-selected{
|
|
208
|
+
background-color:$rowSelectedBackground !important;
|
|
209
|
+
}
|
|
210
|
+
|
|
207
211
|
&.tabulator-selected:hover{
|
|
208
|
-
background-color:darken($rowSelectedBackground, 10%);
|
|
212
|
+
background-color:darken($rowSelectedBackground, 10%) !important;
|
|
209
213
|
}
|
|
210
214
|
|
|
211
215
|
.tabulator-cell{
|
|
@@ -219,13 +219,9 @@ $footerActiveColor:#d00 !default; //footer bottom active text color
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
&.striped{
|
|
222
|
-
.tabulator-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
&:nth-child(even){
|
|
226
|
-
background-color: $basicTableStripedBackground !important;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
222
|
+
.tabulator-row{
|
|
223
|
+
&:nth-child(even){
|
|
224
|
+
background-color: $basicTableStripedBackground;
|
|
229
225
|
}
|
|
230
226
|
}
|
|
231
227
|
}
|
|
@@ -488,6 +484,15 @@ $footerActiveColor:#d00 !default; //footer bottom active text color
|
|
|
488
484
|
color: $activeColor !important;
|
|
489
485
|
}
|
|
490
486
|
|
|
487
|
+
&.tabulator-selected{
|
|
488
|
+
background-color:$rowSelectedBackground !important;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
&.tabulator-selected:hover{
|
|
492
|
+
background-color:$rowSelectedBackgroundHover !important;
|
|
493
|
+
cursor: pointer;
|
|
494
|
+
}
|
|
495
|
+
|
|
491
496
|
&.tabulator-moving{
|
|
492
497
|
pointer-events: none !important;
|
|
493
498
|
}
|