tabulator-tables 5.0.5 → 5.0.9

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.
Files changed (85) hide show
  1. package/bower.json +1 -1
  2. package/build/rollup.js +1 -1
  3. package/dist/css/tabulator.css +4 -0
  4. package/dist/css/tabulator.css.map +1 -1
  5. package/dist/css/tabulator.min.css +1 -1
  6. package/dist/css/tabulator.min.css.map +1 -1
  7. package/dist/css/tabulator_bootstrap3.css +4 -0
  8. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  9. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  10. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  11. package/dist/css/tabulator_bootstrap4.css +4 -0
  12. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  13. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  14. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  15. package/dist/css/tabulator_bulma.css +4 -0
  16. package/dist/css/tabulator_bulma.css.map +1 -1
  17. package/dist/css/tabulator_bulma.min.css +1 -1
  18. package/dist/css/tabulator_bulma.min.css.map +1 -1
  19. package/dist/css/tabulator_materialize.css +4 -0
  20. package/dist/css/tabulator_materialize.css.map +1 -1
  21. package/dist/css/tabulator_materialize.min.css +1 -1
  22. package/dist/css/tabulator_materialize.min.css.map +1 -1
  23. package/dist/css/tabulator_midnight.css +4 -0
  24. package/dist/css/tabulator_midnight.css.map +1 -1
  25. package/dist/css/tabulator_midnight.min.css +1 -1
  26. package/dist/css/tabulator_midnight.min.css.map +1 -1
  27. package/dist/css/tabulator_modern.css +4 -0
  28. package/dist/css/tabulator_modern.css.map +1 -1
  29. package/dist/css/tabulator_modern.min.css +1 -1
  30. package/dist/css/tabulator_modern.min.css.map +1 -1
  31. package/dist/css/tabulator_semanticui.css +4 -0
  32. package/dist/css/tabulator_semanticui.css.map +1 -1
  33. package/dist/css/tabulator_semanticui.min.css +1 -1
  34. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  35. package/dist/css/tabulator_simple.css +4 -0
  36. package/dist/css/tabulator_simple.css.map +1 -1
  37. package/dist/css/tabulator_simple.min.css +1 -1
  38. package/dist/css/tabulator_simple.min.css.map +1 -1
  39. package/dist/css/tabulator_site.css +4 -0
  40. package/dist/css/tabulator_site.css.map +1 -1
  41. package/dist/css/tabulator_site.min.css +1 -1
  42. package/dist/css/tabulator_site.min.css.map +1 -1
  43. package/dist/js/tabulator.js +412 -256
  44. package/dist/js/tabulator.js.map +1 -1
  45. package/dist/js/tabulator.min.js +2 -2
  46. package/dist/js/tabulator.min.js.map +1 -1
  47. package/dist/js/tabulator_esm.js +501 -351
  48. package/dist/js/tabulator_esm.js.map +1 -1
  49. package/dist/js/tabulator_esm.min.js +2 -2
  50. package/dist/js/tabulator_esm.min.js.map +1 -1
  51. package/package.json +1 -1
  52. package/src/js/core/ColumnManager.js +8 -7
  53. package/src/js/core/CoreFeature.js +1 -5
  54. package/src/js/core/RowManager.js +8 -2
  55. package/src/js/core/Tabulator.js +126 -100
  56. package/src/js/core/column/Column.js +1 -1
  57. package/src/js/core/defaults/options.js +1 -1
  58. package/src/js/core/rendering/Renderer.js +2 -1
  59. package/src/js/core/rendering/renderers/VirtualDomVertical.js +1 -1
  60. package/src/js/core/tools/{ComponentFuctionBinder.js → ComponentFunctionBinder.js} +1 -1
  61. package/src/js/core/tools/DataLoader.js +1 -1
  62. package/src/js/core/tools/InteractionMonitor.js +126 -49
  63. package/src/js/core/tools/OptionsList.js +2 -2
  64. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +14 -1
  65. package/src/js/modules/DataTree/DataTree.js +18 -9
  66. package/src/js/modules/Download/defaults/downloaders/pdf.js +0 -2
  67. package/src/js/modules/Download/defaults/downloaders/xlsx.js +3 -2
  68. package/src/js/modules/Edit/Edit.js +1 -8
  69. package/src/js/modules/Edit/defaults/editors/progress.js +2 -2
  70. package/src/js/modules/Export/Export.js +1 -1
  71. package/src/js/modules/Filter/Filter.js +9 -4
  72. package/src/js/modules/Format/defaults/formatters/datetime.js +2 -2
  73. package/src/js/modules/Format/defaults/formatters/datetimediff.js +1 -1
  74. package/src/js/modules/Format/defaults/formatters/money.js +8 -1
  75. package/src/js/modules/FrozenRows/FrozenRows.js +4 -1
  76. package/src/js/modules/GroupRows/Group.js +16 -6
  77. package/src/js/modules/GroupRows/GroupRows.js +41 -29
  78. package/src/js/modules/History/History.js +3 -1
  79. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +5 -7
  80. package/src/js/modules/MoveColumns/MoveColumns.js +64 -61
  81. package/src/js/modules/Page/Page.js +8 -10
  82. package/src/js/modules/SelectRow/SelectRow.js +5 -10
  83. package/src/js/modules/Sort/Sort.js +1 -1
  84. package/src/js/modules/Sort/defaults/sorters/datetime.js +3 -2
  85. package/src/scss/tabulator.scss +4 -0
@@ -45,6 +45,34 @@ class GroupRows extends Module{
45
45
 
46
46
  //initialize group configuration
47
47
  initialize(){
48
+ if(this.table.options.groupBy){
49
+
50
+ this.configureGroupSetup();
51
+
52
+ if(this.table.options.groupUpdateOnCellEdit){
53
+ this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
54
+ this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
55
+ }
56
+
57
+ this.subscribe("row-deleting", this.rowDeleting.bind(this));
58
+ this.subscribe("row-deleted", this.rowsUpdated.bind(this));
59
+ this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
60
+ this.subscribe("rows-wipe", this.wipe.bind(this));
61
+ this.subscribe("rows-added", this.rowsUpdated.bind(this));
62
+ this.subscribe("row-moving", this.rowMoving.bind(this));
63
+ this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
64
+
65
+ this.subscribe("rows-sample", this.rowSample.bind(this));
66
+
67
+ this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
68
+
69
+ this.registerDisplayHandler(this.displayHandler, 20);
70
+
71
+ this.initialized = true;
72
+ }
73
+ }
74
+
75
+ configureGroupSetup(){
48
76
  if(this.table.options.groupBy){
49
77
  var groupBy = this.table.options.groupBy,
50
78
  startOpen = this.table.options.groupStartOpen,
@@ -133,27 +161,6 @@ class GroupRows extends Module{
133
161
  if(groupHeader){
134
162
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
135
163
  }
136
-
137
- if(this.table.options.groupUpdateOnCellEdit){
138
- this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
139
- this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
140
- }
141
-
142
- this.subscribe("row-deleting", this.rowDeleting.bind(this));
143
- this.subscribe("row-deleted", this.rowsUpdated.bind(this));
144
- this.subscribe("scroll-horizontal", this.scrollHeaders.bind(this));
145
- this.subscribe("rows-wipe", this.wipe.bind(this));
146
- this.subscribe("rows-added", this.rowsUpdated.bind(this));
147
- this.subscribe("row-moving", this.rowMoving.bind(this));
148
- this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
149
-
150
- this.subscribe("rows-sample", this.rowSample.bind(this));
151
-
152
- this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
153
-
154
- this.registerDisplayHandler(this.displayHandler, 20);
155
-
156
- this.initialized = true;
157
164
  }
158
165
  }
159
166
 
@@ -218,23 +225,28 @@ class GroupRows extends Module{
218
225
 
219
226
  setGroupBy(groups){
220
227
  this.table.options.groupBy = groups;
221
- this.initialize();
222
- this.refreshData(false, "display");
228
+ if(!this.initialized){
229
+ this.initialize();
230
+ }else{
231
+ this.configureGroupSetup();
232
+ }
233
+
234
+ this.refreshData();
223
235
 
224
236
  this.trackChanges();
225
237
  }
226
238
 
227
239
  setGroupValues(groupValues){
228
240
  this.table.options.groupValues = groupValues;
229
- this.initialize();
230
- this.refreshData(false, "display");
241
+ this.configureGroupSetup();
242
+ this.refreshData();
231
243
 
232
244
  this.trackChanges();
233
245
  }
234
246
 
235
247
  setGroupStartOpen(values){
236
248
  this.table.options.groupStartOpen = values;
237
- this.initialize();
249
+ this.configureGroupSetup();
238
250
 
239
251
  if(this.table.options.groupBy){
240
252
  this.refreshData();
@@ -247,7 +259,7 @@ class GroupRows extends Module{
247
259
 
248
260
  setGroupHeader(values){
249
261
  this.table.options.groupHeader = values;
250
- this.initialize();
262
+ this.configureGroupSetup();
251
263
 
252
264
  if(this.table.options.groupBy){
253
265
  this.refreshData();
@@ -328,7 +340,7 @@ class GroupRows extends Module{
328
340
 
329
341
  //return appropriate rows with group headers
330
342
  getRows(rows){
331
- if(this.groupIDLookups.length){
343
+ if(this.table.options.groupBy && this.groupIDLookups.length){
332
344
 
333
345
  this.dispatchExternal("dataGrouping");
334
346
 
@@ -443,7 +455,7 @@ class GroupRows extends Module{
443
455
  var oldGroups = this.groups;
444
456
 
445
457
  this.groups = {};
446
- this.groupList =[];
458
+ this.groupList = [];
447
459
 
448
460
  if(this.allowedValues && this.allowedValues[0]){
449
461
  this.allowedValues[0].forEach((value) => {
@@ -1,4 +1,6 @@
1
1
  import Module from '../../core/Module.js';
2
+ import Row from '../../core/row/Row.js';
3
+ import Cell from '../../core/cell/Cell.js';
2
4
 
3
5
  import defaultUndoers from './defaults/undoers.js';
4
6
  import defaultRedoers from './defaults/redoers.js';
@@ -58,7 +60,7 @@ class History extends Module{
58
60
  }
59
61
  }
60
62
 
61
- this.history.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
63
+ this.action("rowDelete", row, {data:row.getData(), pos:!index, index:index});
62
64
  }
63
65
 
64
66
  cellUpdated(cell){
@@ -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
 
@@ -34,7 +35,7 @@ class HtmlTableImport extends Module{
34
35
 
35
36
  rows = rows ? rows.getElementsByTagName("tr") : [];
36
37
 
37
- //check for tablator inline options
38
+ //check for Tabulator inline options
38
39
  this._extractOptions(element, options);
39
40
 
40
41
  if(headers.length){
@@ -73,7 +74,7 @@ class HtmlTableImport extends Module{
73
74
  //extract tabulator attribute options
74
75
  _extractOptions(element, options, defaultOptions){
75
76
  var attributes = element.attributes;
76
- var optionsArr = defaultOptions ? Object.assign([], defaultOptions) : Object.keys(options);
77
+ var optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);
77
78
  var optionsList = {};
78
79
 
79
80
  optionsArr.forEach((item) => {
@@ -140,11 +141,8 @@ class HtmlTableImport extends Module{
140
141
  col.width = width;
141
142
  }
142
143
 
143
- //check for tablator inline options
144
- attributes = header.attributes;
145
-
146
- // //check for tablator inline options
147
- this._extractOptions(header, col, Column.prototype.defaultOptionList);
144
+ //check for Tabulator inline options
145
+ this._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);
148
146
 
149
147
  this.fieldIndex[index] = col.field;
150
148
 
@@ -2,10 +2,10 @@ import Module from '../../core/Module.js';
2
2
  import Helpers from '../../core/tools/Helpers.js';
3
3
 
4
4
  class MoveColumns extends Module{
5
-
5
+
6
6
  constructor(table){
7
7
  super(table);
8
-
8
+
9
9
  this.placeholderElement = this.createPlaceholderElement();
10
10
  this.hoverElement = false; //floating column header element
11
11
  this.checkTimeout = false; //click check timeout holder
@@ -18,35 +18,36 @@ class MoveColumns extends Module{
18
18
  this.autoScrollStep = 5; //auto scroll distance in pixels
19
19
  this.autoScrollTimeout = false; //auto scroll timeout
20
20
  this.touchMove = false;
21
-
21
+
22
22
  this.moveHover = this.moveHover.bind(this);
23
23
  this.endMove = this.endMove.bind(this);
24
-
24
+
25
25
  this.registerTableOption("movableColumns", false); //enable movable columns
26
26
  }
27
-
27
+
28
28
  createPlaceholderElement(){
29
29
  var el = document.createElement("div");
30
-
30
+
31
31
  el.classList.add("tabulator-col");
32
32
  el.classList.add("tabulator-col-placeholder");
33
-
33
+
34
34
  return el;
35
35
  }
36
-
36
+
37
37
  initialize(){
38
- this.subscribe("column-init", this.initializeColumn.bind(this));
38
+ if(this.table.options.movableColumns){
39
+ this.subscribe("column-init", this.initializeColumn.bind(this));
40
+ }
39
41
  }
40
-
42
+
41
43
  initializeColumn(column){
42
44
  var self = this,
43
45
  config = {},
44
46
  colEl;
45
-
47
+
46
48
  if(!column.modules.frozen){
47
-
48
49
  colEl = column.getElement();
49
-
50
+
50
51
  config.mousemove = function(e){
51
52
  if(column.parent === self.moving.parent){
52
53
  if((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){
@@ -62,7 +63,7 @@ class MoveColumns extends Module{
62
63
  }
63
64
  }
64
65
  }.bind(self);
65
-
66
+
66
67
  colEl.addEventListener("mousedown", function(e){
67
68
  self.touchMove = false;
68
69
  if(e.which === 1){
@@ -71,7 +72,7 @@ class MoveColumns extends Module{
71
72
  }, self.checkPeriod);
72
73
  }
73
74
  });
74
-
75
+
75
76
  colEl.addEventListener("mouseup", function(e){
76
77
  if(e.which === 1){
77
78
  if(self.checkTimeout){
@@ -79,19 +80,19 @@ class MoveColumns extends Module{
79
80
  }
80
81
  }
81
82
  });
82
-
83
+
83
84
  self.bindTouchEvents(column);
84
85
  }
85
-
86
+
86
87
  column.modules.moveColumn = config;
87
88
  }
88
-
89
+
89
90
  bindTouchEvents(column){
90
91
  var colEl = column.getElement(),
91
92
  startXMove = false, //shifting center position of the cell
92
93
  dir = false,
93
94
  currentCol, nextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;
94
-
95
+
95
96
  colEl.addEventListener("touchstart", (e) => {
96
97
  this.checkTimeout = setTimeout(() => {
97
98
  this.touchMove = true;
@@ -103,27 +104,27 @@ class MoveColumns extends Module{
103
104
  nextColWidthLast = 0;
104
105
  prevColWidthLast = 0;
105
106
  startXMove = false;
106
-
107
+
107
108
  this.startMove(e, column);
108
109
  }, this.checkPeriod);
109
110
  }, {passive: true});
110
-
111
+
111
112
  colEl.addEventListener("touchmove", (e) => {
112
113
  var halfCol, diff, moveToCol;
113
-
114
+
114
115
  if(this.moving){
115
116
  this.moveHover(e);
116
-
117
+
117
118
  if(!startXMove){
118
119
  startXMove = e.touches[0].pageX;
119
120
  }
120
-
121
+
121
122
  diff = e.touches[0].pageX - startXMove;
122
-
123
+
123
124
  if(diff > 0){
124
125
  if(nextCol && diff - nextColWidthLast > nextColWidth){
125
126
  moveToCol = nextCol;
126
-
127
+
127
128
  if(moveToCol !== column){
128
129
  startXMove = e.touches[0].pageX;
129
130
  moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);
@@ -133,7 +134,7 @@ class MoveColumns extends Module{
133
134
  }else{
134
135
  if(prevCol && -diff - prevColWidthLast > prevColWidth){
135
136
  moveToCol = prevCol;
136
-
137
+
137
138
  if(moveToCol !== column){
138
139
  startXMove = e.touches[0].pageX;
139
140
  moveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());
@@ -141,7 +142,7 @@ class MoveColumns extends Module{
141
142
  }
142
143
  }
143
144
  }
144
-
145
+
145
146
  if(moveToCol){
146
147
  currentCol = moveToCol;
147
148
  nextCol = moveToCol.nextColumn();
@@ -153,7 +154,7 @@ class MoveColumns extends Module{
153
154
  }
154
155
  }
155
156
  }, {passive: true});
156
-
157
+
157
158
  colEl.addEventListener("touchend", (e) => {
158
159
  if(this.checkTimeout){
159
160
  clearTimeout(this.checkTimeout);
@@ -163,41 +164,43 @@ class MoveColumns extends Module{
163
164
  }
164
165
  });
165
166
  }
166
-
167
+
167
168
  startMove(e, column){
168
- var element = column.getElement();
169
-
169
+ var element = column.getElement(),
170
+ headerElement = this.table.columnManager.getElement(),
171
+ headersElement = this.table.columnManager.getHeadersElement();
172
+
170
173
  this.moving = column;
171
174
  this.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;
172
-
175
+
173
176
  this.table.element.classList.add("tabulator-block-select");
174
-
177
+
175
178
  //create placeholder
176
179
  this.placeholderElement.style.width = column.getWidth() + "px";
177
180
  this.placeholderElement.style.height = column.getHeight() + "px";
178
-
181
+
179
182
  element.parentNode.insertBefore(this.placeholderElement, element);
180
183
  element.parentNode.removeChild(element);
181
-
184
+
182
185
  //create hover element
183
186
  this.hoverElement = element.cloneNode(true);
184
187
  this.hoverElement.classList.add("tabulator-moving");
185
-
188
+
186
189
  this.table.columnManager.getElement().appendChild(this.hoverElement);
187
-
190
+
188
191
  this.hoverElement.style.left = "0";
189
- this.hoverElement.style.bottom = "0";
190
-
192
+ this.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + "px";
193
+
191
194
  if(!this.touchMove){
192
195
  this._bindMouseMove();
193
-
196
+
194
197
  document.body.addEventListener("mousemove", this.moveHover);
195
198
  document.body.addEventListener("mouseup", this.endMove);
196
199
  }
197
-
200
+
198
201
  this.moveHover(e);
199
202
  }
200
-
203
+
201
204
  _bindMouseMove(){
202
205
  this.table.columnManager.columnsByIndex.forEach(function(column){
203
206
  if(column.modules.moveColumn.mousemove){
@@ -205,7 +208,7 @@ class MoveColumns extends Module{
205
208
  }
206
209
  });
207
210
  }
208
-
211
+
209
212
  _unbindMouseMove(){
210
213
  this.table.columnManager.columnsByIndex.forEach(function(column){
211
214
  if(column.modules.moveColumn.mousemove){
@@ -213,65 +216,65 @@ class MoveColumns extends Module{
213
216
  }
214
217
  });
215
218
  }
216
-
219
+
217
220
  moveColumn(column, after){
218
221
  var movingCells = this.moving.getCells();
219
-
222
+
220
223
  this.toCol = column;
221
224
  this.toColAfter = after;
222
-
225
+
223
226
  if(after){
224
227
  column.getCells().forEach(function(cell, i){
225
228
  var cellEl = cell.getElement(true);
226
-
227
- if(cellEl.parentNode){
229
+
230
+ if(cellEl.parentNode && movingCells[i]){
228
231
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);
229
232
  }
230
233
  });
231
234
  }else{
232
235
  column.getCells().forEach(function(cell, i){
233
236
  var cellEl = cell.getElement(true);
234
-
235
- if(cellEl.parentNode){
237
+
238
+ if(cellEl.parentNode && movingCells[i]){
236
239
  cellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);
237
240
  }
238
241
  });
239
242
  }
240
243
  }
241
-
244
+
242
245
  endMove(e){
243
246
  if(e.which === 1 || this.touchMove){
244
247
  this._unbindMouseMove();
245
-
248
+
246
249
  this.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);
247
250
  this.placeholderElement.parentNode.removeChild(this.placeholderElement);
248
251
  this.hoverElement.parentNode.removeChild(this.hoverElement);
249
-
252
+
250
253
  this.table.element.classList.remove("tabulator-block-select");
251
-
254
+
252
255
  if(this.toCol){
253
256
  this.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);
254
257
  }
255
-
258
+
256
259
  this.moving = false;
257
260
  this.toCol = false;
258
261
  this.toColAfter = false;
259
-
262
+
260
263
  if(!this.touchMove){
261
264
  document.body.removeEventListener("mousemove", this.moveHover);
262
265
  document.body.removeEventListener("mouseup", this.endMove);
263
266
  }
264
267
  }
265
268
  }
266
-
269
+
267
270
  moveHover(e){
268
271
  var columnHolder = this.table.columnManager.getElement(),
269
272
  scrollLeft = columnHolder.scrollLeft,
270
273
  xPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,
271
274
  scrollPos;
272
-
275
+
273
276
  this.hoverElement.style.left = (xPos - this.startX) + "px";
274
-
277
+
275
278
  if(xPos - scrollLeft < this.autoScrollMargin){
276
279
  if(!this.autoScrollTimeout){
277
280
  this.autoScrollTimeout = setTimeout(() => {
@@ -281,7 +284,7 @@ class MoveColumns extends Module{
281
284
  }, 1);
282
285
  }
283
286
  }
284
-
287
+
285
288
  if(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){
286
289
  if(!this.autoScrollTimeout){
287
290
  this.autoScrollTimeout = setTimeout(() => {
@@ -22,13 +22,10 @@ class Page extends Module{
22
22
 
23
23
  this.pageSizes = [];
24
24
 
25
- this.dataReceivedNames = {}; //TODO - remove once pagimation update is complete
26
- this.dataSentNames = {}; //TODO - remove once pagimation update is complete
27
-
28
25
  this.registerTableOption("pagination", false); //set pagination type
29
26
  this.registerTableOption("paginationMode", "local"); //local or remote pagination
30
27
  this.registerTableOption("paginationSize", false); //set number of rows to a page
31
- this.registerTableOption("paginationInitialPage", 1); //initail page to show on load
28
+ this.registerTableOption("paginationInitialPage", 1); //initial page to show on load
32
29
  this.registerTableOption("paginationButtonCount", 5); // set count of page button
33
30
  this.registerTableOption("paginationSizeSelector", false); //add pagination size selector element
34
31
  this.registerTableOption("paginationElement", false); //element to hold pagination numbers
@@ -77,10 +74,10 @@ class Page extends Module{
77
74
  this.createElements();
78
75
  this.initializePaginator();
79
76
  }else if(this.table.options.progressiveLoad){
80
-
81
77
  this.subscribe("data-params", this.remotePageParams.bind(this));
82
78
  this.subscribe("data-loaded", this._parseRemoteData.bind(this));
83
79
  this.subscribe("table-built", this.calculatePageSizes.bind(this));
80
+ this.subscribe("data-processed", this.initialLoadComplete.bind(this));
84
81
 
85
82
  this.initializeProgressive(this.table.options.progressiveLoad)
86
83
 
@@ -198,7 +195,8 @@ class Page extends Module{
198
195
  margin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);
199
196
 
200
197
  if(diff < margin){
201
- this.nextPage();
198
+ this.nextPage()
199
+ .catch(() => {}); //consume the exception thrown when on the last page
202
200
  }
203
201
  }
204
202
  }
@@ -443,7 +441,7 @@ class Page extends Module{
443
441
  }
444
442
  }
445
443
 
446
- //set the maxmum page
444
+ //set the maximum page
447
445
  setMaxPage(max){
448
446
 
449
447
  max = parseInt(max);
@@ -704,7 +702,7 @@ class Page extends Module{
704
702
  var left, data, margin;
705
703
 
706
704
  if(typeof data.last_page === "undefined"){
707
- console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.last_page + "' property");
705
+ console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").last_page || "last_page") + "' property");
708
706
  }
709
707
 
710
708
  if(data.data){
@@ -728,7 +726,7 @@ class Page extends Module{
728
726
  break;
729
727
 
730
728
  case "progressive_scroll":
731
- data = this.table.rowManager.getData().concat(data.data);
729
+ data = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);
732
730
 
733
731
  this.table.rowManager.setData(data, this.page !== 1, this.page == 1);
734
732
 
@@ -751,7 +749,7 @@ class Page extends Module{
751
749
  }
752
750
 
753
751
  }else{
754
- console.warn("Remote Pagination Error - Server response missing '" + this.dataReceivedNames.data + "' property");
752
+ console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").data || "data") + "' property");
755
753
  }
756
754
 
757
755
  return data.data;
@@ -35,9 +35,9 @@ class SelectRow extends Module{
35
35
  this.subscribe("row-init", this.initializeRow.bind(this));
36
36
  this.subscribe("row-deleting", this.rowDeleted.bind(this));
37
37
  this.subscribe("rows-wipe", this.clearSelectionData.bind(this));
38
- this.subscribe("rows-retrieve", this.clearSelectionData.bind(this));
38
+ this.subscribe("rows-retrieve", this.rowRetrieve.bind(this));
39
39
 
40
- if(this.table.options.selectable && this.table.options.selectablePersistence){
40
+ if(this.table.options.selectable && !this.table.options.selectablePersistence){
41
41
  this.subscribe("data-refeshing", this.deselectRows.bind(this));
42
42
  }
43
43
  }
@@ -51,7 +51,6 @@ class SelectRow extends Module{
51
51
  this._deselectRow(row, true);
52
52
  }
53
53
 
54
-
55
54
  clearSelectionData(silent){
56
55
  this.selecting = false;
57
56
  this.lastClickedRow = false;
@@ -278,9 +277,7 @@ class SelectRow extends Module{
278
277
  this.childRowSelection(row, true);
279
278
  }
280
279
 
281
- if(!silent){
282
- this.dispatchExternal("rowSelected", row.getComponent());
283
- }
280
+ this.dispatchExternal("rowSelected", row.getComponent());
284
281
 
285
282
  this._rowSelectionChanged(silent);
286
283
  }
@@ -299,7 +296,7 @@ class SelectRow extends Module{
299
296
  deselectRows(rows, silent){
300
297
  var self = this,
301
298
  rowCount;
302
-
299
+
303
300
  if(typeof rows == "undefined"){
304
301
 
305
302
  rowCount = self.selectedRows.length;
@@ -351,9 +348,7 @@ class SelectRow extends Module{
351
348
  this.childRowSelection(row, false);
352
349
  }
353
350
 
354
- if(!silent){
355
- this.dispatchExternal("rowDeselected", row.getComponent());
356
- }
351
+ this.dispatchExternal("rowDeselected", row.getComponent());
357
352
 
358
353
  self._rowSelectionChanged(silent);
359
354
  }
@@ -206,7 +206,7 @@ class Sort extends Module{
206
206
  if(this.table.options.sortMode === "remote"){
207
207
  this.reloadData();
208
208
  }else{
209
- this.refreshData()
209
+ this.refreshData(true);
210
210
  }
211
211
 
212
212
  //TODO - Persist left position of row manager
@@ -6,8 +6,9 @@ export default function(a, b, aRow, bRow, column, dir, params){
6
6
  emptyAlign = 0;
7
7
 
8
8
  if(typeof DT != "undefined"){
9
- a = DT.fromFormat(a, format);
10
- b = DT.fromFormat(b, format);
9
+ a = DT.fromFormat(String(a), format);
10
+ b = DT.fromFormat(String(b), format);
11
+
11
12
  if(!a.isValid){
12
13
  emptyAlign = !b.isValid ? 0 : -1;
13
14
  }else if(!b.isValid){
@@ -1129,6 +1129,10 @@ $footerActiveColor:#d00 !default; //footer bottom active text color
1129
1129
  left:8px;
1130
1130
  right:initial;
1131
1131
  }
1132
+
1133
+ .tabulator-col-sorter{
1134
+ position: initial;
1135
+ }
1132
1136
  }
1133
1137
  }
1134
1138
  }