tabulator-tables 5.2.7 → 5.3.2

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 (214) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.js +28 -0
  3. package/.github/workflows/bad-files-check.yml +39 -0
  4. package/.github/workflows/lint-and-test.yml +31 -0
  5. package/README.md +3 -3
  6. package/bower.json +1 -1
  7. package/build/Bundler.js +77 -77
  8. package/dist/css/tabulator.css +12 -7
  9. package/dist/css/tabulator.css.map +1 -1
  10. package/dist/css/tabulator.min.css +1 -1
  11. package/dist/css/tabulator.min.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap3.css +12 -7
  13. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  14. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  15. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  16. package/dist/css/tabulator_bootstrap4.css +12 -7
  17. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  18. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  19. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  20. package/dist/css/tabulator_bootstrap5.css +12 -7
  21. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  22. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  23. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  24. package/dist/css/tabulator_bulma.css +12 -7
  25. package/dist/css/tabulator_bulma.css.map +1 -1
  26. package/dist/css/tabulator_bulma.min.css +1 -1
  27. package/dist/css/tabulator_bulma.min.css.map +1 -1
  28. package/dist/css/tabulator_materialize.css +12 -7
  29. package/dist/css/tabulator_materialize.css.map +1 -1
  30. package/dist/css/tabulator_materialize.min.css +1 -1
  31. package/dist/css/tabulator_materialize.min.css.map +1 -1
  32. package/dist/css/tabulator_midnight.css +12 -7
  33. package/dist/css/tabulator_midnight.css.map +1 -1
  34. package/dist/css/tabulator_midnight.min.css +1 -1
  35. package/dist/css/tabulator_midnight.min.css.map +1 -1
  36. package/dist/css/tabulator_modern.css +12 -7
  37. package/dist/css/tabulator_modern.css.map +1 -1
  38. package/dist/css/tabulator_modern.min.css +1 -1
  39. package/dist/css/tabulator_modern.min.css.map +1 -1
  40. package/dist/css/tabulator_semanticui.css +12 -7
  41. package/dist/css/tabulator_semanticui.css.map +1 -1
  42. package/dist/css/tabulator_semanticui.min.css +1 -1
  43. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  44. package/dist/css/tabulator_simple.css +12 -7
  45. package/dist/css/tabulator_simple.css.map +1 -1
  46. package/dist/css/tabulator_simple.min.css +1 -1
  47. package/dist/css/tabulator_simple.min.css.map +1 -1
  48. package/dist/css/tabulator_site.css +12 -7
  49. package/dist/css/tabulator_site.css.map +1 -1
  50. package/dist/css/tabulator_site.min.css +1 -1
  51. package/dist/css/tabulator_site.min.css.map +1 -1
  52. package/dist/js/jquery_wrapper.js +37 -37
  53. package/dist/js/tabulator.js +1551 -793
  54. package/dist/js/tabulator.js.map +1 -1
  55. package/dist/js/tabulator.min.js +2 -2
  56. package/dist/js/tabulator.min.js.map +1 -1
  57. package/dist/js/tabulator_esm.js +4300 -3581
  58. package/dist/js/tabulator_esm.js.map +1 -1
  59. package/dist/js/tabulator_esm.min.js +2 -2
  60. package/dist/js/tabulator_esm.min.js.map +1 -1
  61. package/package.json +4 -1
  62. package/src/js/builds/jquery_wrapper.js +37 -37
  63. package/src/js/core/ColumnManager.js +270 -232
  64. package/src/js/core/CoreFeature.js +16 -2
  65. package/src/js/core/FooterManager.js +10 -10
  66. package/src/js/core/Module.js +8 -8
  67. package/src/js/core/RowManager.js +139 -156
  68. package/src/js/core/Tabulator.js +88 -74
  69. package/src/js/core/TabulatorFull.js +1 -1
  70. package/src/js/core/cell/Cell.js +15 -16
  71. package/src/js/core/cell/CellComponent.js +2 -2
  72. package/src/js/core/column/Column.js +81 -68
  73. package/src/js/core/column/ColumnComponent.js +4 -4
  74. package/src/js/core/column/defaults/options.js +1 -1
  75. package/src/js/core/defaults/options.js +4 -2
  76. package/src/js/core/rendering/Renderer.js +19 -19
  77. package/src/js/core/rendering/renderers/BasicHorizontal.js +1 -2
  78. package/src/js/core/rendering/renderers/BasicVertical.js +1 -1
  79. package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +42 -58
  80. package/src/js/core/rendering/renderers/VirtualDomVertical.js +31 -22
  81. package/src/js/core/row/Row.js +32 -8
  82. package/src/js/core/row/RowComponent.js +8 -4
  83. package/src/js/core/tools/Alert.js +44 -45
  84. package/src/js/core/tools/ComponentFunctionBinder.js +4 -2
  85. package/src/js/core/tools/DataLoader.js +3 -3
  86. package/src/js/core/tools/DeprecationAdvisor.js +47 -0
  87. package/src/js/core/tools/ExternalEventBus.js +5 -5
  88. package/src/js/core/tools/InteractionMonitor.js +41 -39
  89. package/src/js/core/tools/InternalEventBus.js +5 -5
  90. package/src/js/core/tools/ModuleBinder.js +6 -6
  91. package/src/js/core/tools/OptionsList.js +4 -4
  92. package/src/js/core/tools/Popup.js +211 -202
  93. package/src/js/modules/Accessor/Accessor.js +16 -16
  94. package/src/js/modules/Accessor/defaults/accessors.js +1 -1
  95. package/src/js/modules/Ajax/Ajax.js +7 -7
  96. package/src/js/modules/Ajax/defaults/loaderPromise.js +19 -19
  97. package/src/js/modules/Ajax/defaults/urlGenerator.js +1 -1
  98. package/src/js/modules/Clipboard/Clipboard.js +23 -23
  99. package/src/js/modules/Clipboard/defaults/pasteParsers.js +0 -2
  100. package/src/js/modules/ColumnCalcs/CalcComponent.js +2 -2
  101. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +55 -51
  102. package/src/js/modules/ColumnCalcs/defaults/calculations.js +1 -1
  103. package/src/js/modules/DataTree/DataTree.js +24 -15
  104. package/src/js/modules/Download/Download.js +15 -8
  105. package/src/js/modules/Download/defaults/downloaders/csv.js +28 -28
  106. package/src/js/modules/Download/defaults/downloaders/html.js +2 -2
  107. package/src/js/modules/Download/defaults/downloaders/json.js +14 -14
  108. package/src/js/modules/Download/defaults/downloaders/jsonLines.js +1 -1
  109. package/src/js/modules/Download/defaults/downloaders/pdf.js +17 -19
  110. package/src/js/modules/Download/defaults/downloaders/xlsx.js +2 -2
  111. package/src/js/modules/Edit/Edit.js +219 -201
  112. package/src/js/modules/Edit/List.js +1026 -1006
  113. package/src/js/modules/Edit/defaults/editors/autocomplete.js +3 -3
  114. package/src/js/modules/Edit/defaults/editors/date.js +110 -0
  115. package/src/js/modules/Edit/defaults/editors/datetime.js +97 -0
  116. package/src/js/modules/Edit/defaults/editors/input.js +7 -7
  117. package/src/js/modules/Edit/defaults/editors/list.js +2 -2
  118. package/src/js/modules/Edit/defaults/editors/number.js +12 -12
  119. package/src/js/modules/Edit/defaults/editors/progress.js +11 -11
  120. package/src/js/modules/Edit/defaults/editors/range.js +5 -5
  121. package/src/js/modules/Edit/defaults/editors/select.js +3 -3
  122. package/src/js/modules/Edit/defaults/editors/star.js +9 -9
  123. package/src/js/modules/Edit/defaults/editors/textarea.js +97 -92
  124. package/src/js/modules/Edit/defaults/editors/tickCross.js +1 -3
  125. package/src/js/modules/Edit/defaults/editors/time.js +98 -0
  126. package/src/js/modules/Edit/defaults/editors.js +8 -2
  127. package/src/js/modules/Edit/inputMask.js +19 -26
  128. package/src/js/modules/Export/Export.js +69 -65
  129. package/src/js/modules/Filter/Filter.js +88 -95
  130. package/src/js/modules/Format/Format.js +24 -26
  131. package/src/js/modules/Format/defaults/formatters/buttonCross.js +1 -1
  132. package/src/js/modules/Format/defaults/formatters/buttonTick.js +1 -1
  133. package/src/js/modules/Format/defaults/formatters/color.js +1 -1
  134. package/src/js/modules/Format/defaults/formatters/datetime.js +7 -7
  135. package/src/js/modules/Format/defaults/formatters/datetimediff.js +7 -7
  136. package/src/js/modules/Format/defaults/formatters/handle.js +1 -1
  137. package/src/js/modules/Format/defaults/formatters/html.js +1 -1
  138. package/src/js/modules/Format/defaults/formatters/image.js +9 -9
  139. package/src/js/modules/Format/defaults/formatters/link.js +10 -10
  140. package/src/js/modules/Format/defaults/formatters/lookup.js +1 -1
  141. package/src/js/modules/Format/defaults/formatters/money.js +1 -1
  142. package/src/js/modules/Format/defaults/formatters/plaintext.js +1 -1
  143. package/src/js/modules/Format/defaults/formatters/progress.js +41 -42
  144. package/src/js/modules/Format/defaults/formatters/responsiveCollapse.js +3 -3
  145. package/src/js/modules/Format/defaults/formatters/rowSelection.js +1 -1
  146. package/src/js/modules/Format/defaults/formatters/rownum.js +9 -2
  147. package/src/js/modules/Format/defaults/formatters/star.js +1 -1
  148. package/src/js/modules/Format/defaults/formatters/textarea.js +1 -1
  149. package/src/js/modules/Format/defaults/formatters/tickCross.js +1 -1
  150. package/src/js/modules/Format/defaults/formatters/traffic.js +14 -14
  151. package/src/js/modules/FrozenColumns/FrozenColumns.js +6 -8
  152. package/src/js/modules/FrozenRows/FrozenRows.js +37 -7
  153. package/src/js/modules/GroupRows/Group.js +7 -7
  154. package/src/js/modules/GroupRows/GroupComponent.js +2 -2
  155. package/src/js/modules/GroupRows/GroupRows.js +34 -11
  156. package/src/js/modules/History/History.js +2 -2
  157. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +3 -6
  158. package/src/js/modules/Import/Import.js +158 -159
  159. package/src/js/modules/Import/defaults/importers/array.js +5 -0
  160. package/src/js/modules/Import/defaults/importers/csv.js +49 -49
  161. package/src/js/modules/Import/defaults/importers/json.js +6 -6
  162. package/src/js/modules/Import/defaults/importers.js +2 -0
  163. package/src/js/modules/Interaction/Interaction.js +42 -43
  164. package/src/js/modules/Keybindings/Keybindings.js +14 -14
  165. package/src/js/modules/Keybindings/defaults/actions.js +1 -2
  166. package/src/js/modules/Layout/Layout.js +4 -5
  167. package/src/js/modules/Layout/defaults/modes/fitColumns.js +13 -16
  168. package/src/js/modules/Layout/defaults/modes/fitData.js +6 -4
  169. package/src/js/modules/Layout/defaults/modes/fitDataGeneral.js +2 -2
  170. package/src/js/modules/Layout/defaults/modes/fitDataStretch.js +2 -2
  171. package/src/js/modules/Localize/Localize.js +7 -7
  172. package/src/js/modules/Menu/Menu.js +8 -11
  173. package/src/js/modules/MoveColumns/MoveColumns.js +3 -6
  174. package/src/js/modules/MoveRows/MoveRows.js +30 -36
  175. package/src/js/modules/Mutator/Mutator.js +9 -9
  176. package/src/js/modules/Page/Page.js +73 -80
  177. package/src/js/modules/Page/defaults/pageCounters/pages.js +2 -2
  178. package/src/js/modules/Page/defaults/pageCounters/rows.js +1 -1
  179. package/src/js/modules/Persistence/Persistence.js +40 -44
  180. package/src/js/modules/Persistence/defaults/readers.js +1 -1
  181. package/src/js/modules/Popup/Popup.js +4 -5
  182. package/src/js/modules/Print/Print.js +2 -2
  183. package/src/js/modules/ReactiveData/ReactiveData.js +178 -115
  184. package/src/js/modules/ResizeColumns/ResizeColumns.js +3 -3
  185. package/src/js/modules/ResizeRows/ResizeRows.js +1 -1
  186. package/src/js/modules/ResizeTable/ResizeTable.js +77 -46
  187. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -5
  188. package/src/js/modules/SelectRow/SelectRow.js +26 -28
  189. package/src/js/modules/Sort/Sort.js +113 -85
  190. package/src/js/modules/Sort/defaults/sorters/alphanum.js +1 -1
  191. package/src/js/modules/Sort/defaults/sorters/array.js +24 -28
  192. package/src/js/modules/Sort/defaults/sorters/boolean.js +1 -1
  193. package/src/js/modules/Sort/defaults/sorters/date.js +1 -1
  194. package/src/js/modules/Sort/defaults/sorters/datetime.js +13 -13
  195. package/src/js/modules/Sort/defaults/sorters/exists.js +1 -1
  196. package/src/js/modules/Sort/defaults/sorters/number.js +1 -1
  197. package/src/js/modules/Sort/defaults/sorters/string.js +7 -7
  198. package/src/js/modules/Sort/defaults/sorters/time.js +1 -1
  199. package/src/js/modules/Tooltip/Tooltip.js +5 -7
  200. package/src/js/modules/Validate/Validate.js +10 -13
  201. package/src/js/modules/Validate/defaults/validators.js +8 -3
  202. package/src/scss/tabulator.scss +28 -17
  203. package/src/scss/themes/bootstrap/functions4.scss +1 -1
  204. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +8 -8
  205. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +8 -8
  206. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +8 -8
  207. package/src/scss/themes/bulma/tabulator_bulma.scss +7 -7
  208. package/src/scss/themes/materialize/tabulator_materialize.scss +6 -6
  209. package/src/scss/themes/materialize/variables.scss +1 -1
  210. package/src/scss/themes/semanticui/tabulator_semanticui.scss +7 -7
  211. package/src/scss/themes/tabulator_midnight.scss +7 -7
  212. package/src/scss/themes/tabulator_modern.scss +14 -14
  213. package/src/scss/themes/tabulator_simple.scss +8 -8
  214. package/src/scss/themes/tabulator_site.scss +15 -15
@@ -49,8 +49,8 @@ export default class CoreFeature{
49
49
  return this.table.modules.layout.getMode();
50
50
  }
51
51
 
52
- layoutRefresh(){
53
- return this.table.modules.layout.layout();
52
+ layoutRefresh(force){
53
+ return this.table.modules.layout.layout(force);
54
54
  }
55
55
 
56
56
 
@@ -114,7 +114,21 @@ export default class CoreFeature{
114
114
  return this.table.options[key];
115
115
  }
116
116
 
117
+ //////////////////////////////////////////
118
+ /////////// Deprecation Checks ///////////
119
+ //////////////////////////////////////////
120
+
121
+ deprecationCheck(oldOption, newOption){
122
+ return this.table.deprecationAdvisor.check(oldOption, newOption);
123
+ }
117
124
 
125
+ deprecationCheckMsg(oldOption, msg){
126
+ return this.table.deprecationAdvisor.checkMsg(oldOption, msg);
127
+ }
128
+
129
+ deprecationMsg(msg){
130
+ return this.table.deprecationAdvisor.msg(msg);
131
+ }
118
132
  //////////////////////////////////////////
119
133
  //////////////// Modules /////////////////
120
134
  //////////////////////////////////////////
@@ -39,17 +39,17 @@ export default class FooterManager extends CoreFeature{
39
39
 
40
40
  switch(typeof this.table.options.footerElement){
41
41
  case "string":
42
- if(this.table.options.footerElement[0] === "<"){
43
- this.containerElement.innerHTML = this.table.options.footerElement;
44
- }else{
45
- this.external = true;
46
- this.containerElement = document.querySelector(this.table.options.footerElement);
47
- }
48
- break;
42
+ if(this.table.options.footerElement[0] === "<"){
43
+ this.containerElement.innerHTML = this.table.options.footerElement;
44
+ }else{
45
+ this.external = true;
46
+ this.containerElement = document.querySelector(this.table.options.footerElement);
47
+ }
48
+ break;
49
49
 
50
50
  default:
51
- this.element = this.table.options.footerElement;
52
- break;
51
+ this.element = this.table.options.footerElement;
52
+ break;
53
53
  }
54
54
  }
55
55
  }
@@ -97,6 +97,6 @@ export default class FooterManager extends CoreFeature{
97
97
  }
98
98
 
99
99
  redraw(){
100
- this.dispatch("footer-redraw")
100
+ this.dispatch("footer-redraw");
101
101
  }
102
102
  }
@@ -10,7 +10,7 @@ class Module extends CoreFeature{
10
10
  }
11
11
 
12
12
  initialize(){
13
- // setup module when table is initialized, to be overriden in module
13
+ // setup module when table is initialized, to be overridden in module
14
14
  }
15
15
 
16
16
 
@@ -36,9 +36,9 @@ class Module extends CoreFeature{
36
36
  this.table.initGuard(name);
37
37
 
38
38
  return func(...args);
39
- }
39
+ };
40
40
  }else{
41
- console.warn("Unable to bind table function, name already in use", name)
41
+ console.warn("Unable to bind table function, name already in use", name);
42
42
  }
43
43
  }
44
44
 
@@ -51,12 +51,12 @@ class Module extends CoreFeature{
51
51
  ///////////////////////////////////
52
52
 
53
53
  registerDataHandler(handler, priority){
54
- this.table.rowManager.registerDataPipelineHandler(handler, priority)
54
+ this.table.rowManager.registerDataPipelineHandler(handler, priority);
55
55
  this._handler = handler;
56
56
  }
57
57
 
58
58
  registerDisplayHandler(handler, priority){
59
- this.table.rowManager.registerDisplayPipelineHandler(handler, priority)
59
+ this.table.rowManager.registerDisplayPipelineHandler(handler, priority);
60
60
  this._handler = handler;
61
61
  }
62
62
 
@@ -75,15 +75,15 @@ class Module extends CoreFeature{
75
75
  ///////////////////////////////////
76
76
 
77
77
  footerAppend(element){
78
- return this.table.footerManager.append(element)
78
+ return this.table.footerManager.append(element);
79
79
  }
80
80
 
81
81
  footerPrepend(element){
82
- return this.table.footerManager.prepend(element)
82
+ return this.table.footerManager.prepend(element);
83
83
  }
84
84
 
85
85
  footerRemove(element){
86
- return this.table.footerManager.remove(element)
86
+ return this.table.footerManager.remove(element);
87
87
  }
88
88
 
89
89
  ///////////////////////////////////
@@ -32,8 +32,6 @@ export default class RowManager extends CoreFeature{
32
32
  this.scrollTop = 0;
33
33
  this.scrollLeft = 0;
34
34
 
35
- this.rowNumColumn = false; //hold column component for row number column
36
-
37
35
  this.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing
38
36
  this.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed
39
37
  this.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed
@@ -92,17 +90,8 @@ export default class RowManager extends CoreFeature{
92
90
  return this.tableElement;
93
91
  }
94
92
 
95
- //return position of row in table
96
- getRowPosition(row, active){
97
- if(active){
98
- return this.activeRows.indexOf(row);
99
- }else{
100
- return this.rows.indexOf(row);
101
- }
102
- }
103
-
104
93
  initialize(){
105
- this.initializePlaceholder()
94
+ this.initializePlaceholder();
106
95
  this.initializeRenderer();
107
96
 
108
97
  //initialize manager
@@ -123,7 +112,7 @@ export default class RowManager extends CoreFeature{
123
112
 
124
113
  this.dispatch("scroll-horizontal", left, leftDir);
125
114
  this.dispatchExternal("scrollHorizontal", left, leftDir);
126
-
115
+
127
116
  this._positionPlaceholder();
128
117
  }
129
118
 
@@ -155,8 +144,10 @@ export default class RowManager extends CoreFeature{
155
144
  });
156
145
 
157
146
  return match || false;
147
+ }else if(subject === null){
148
+ return false;
158
149
  }
159
- }else if(typeof subject == "undefined" || subject === null){
150
+ }else if(typeof subject == "undefined"){
160
151
  return false;
161
152
  }else{
162
153
  //subject should be treated as the index of the row
@@ -179,12 +170,10 @@ export default class RowManager extends CoreFeature{
179
170
  return match || false;
180
171
  }
181
172
 
182
- getRowFromPosition(position, active){
183
- if(active){
184
- return this.activeRows[position];
185
- }else{
186
- return this.rows[position];
187
- }
173
+ getRowFromPosition(position){
174
+ return this.getDisplayRows().find((row) => {
175
+ return row.getPosition() === position && row.isDisplayed();
176
+ });
188
177
  }
189
178
 
190
179
  scrollToRow(row, position, ifVisible){
@@ -284,7 +273,7 @@ export default class RowManager extends CoreFeature{
284
273
  this.reRenderInPosition();
285
274
  }
286
275
 
287
- this.regenerateRowNumbers();
276
+ this.regenerateRowPositions();
288
277
 
289
278
  this.dispatchExternal("rowDeleted", row.getComponent());
290
279
 
@@ -304,8 +293,7 @@ export default class RowManager extends CoreFeature{
304
293
 
305
294
  //add multiple rows
306
295
  addRows(data, pos, index){
307
- var length = 0,
308
- rows = [];
296
+ var rows = [];
309
297
 
310
298
  return new Promise((resolve, reject) => {
311
299
  pos = this.findAddRowPos(pos);
@@ -314,8 +302,6 @@ export default class RowManager extends CoreFeature{
314
302
  data = [data];
315
303
  }
316
304
 
317
- length = data.length - 1;
318
-
319
305
  if((typeof index == "undefined" && pos) || (typeof index !== "undefined" && !pos)){
320
306
  data.reverse();
321
307
  }
@@ -328,7 +314,7 @@ export default class RowManager extends CoreFeature{
328
314
 
329
315
  this.refreshActiveData(false, false, true);
330
316
 
331
- this.regenerateRowNumbers();
317
+ this.regenerateRowPositions();
332
318
 
333
319
  if(rows.length){
334
320
  this._clearPlaceholder();
@@ -434,7 +420,7 @@ export default class RowManager extends CoreFeature{
434
420
 
435
421
  this.moveRowActual(from, to, after);
436
422
 
437
- this.regenerateRowNumbers();
423
+ this.regenerateRowPositions();
438
424
 
439
425
  this.dispatch("row-moved", from, to, after);
440
426
  this.dispatchExternal("rowMoved", from.getComponent());
@@ -591,23 +577,23 @@ export default class RowManager extends CoreFeature{
591
577
 
592
578
  registerDataPipelineHandler(handler, priority){
593
579
  if(typeof priority !== "undefined"){
594
- this.dataPipeline.push({handler, priority})
580
+ this.dataPipeline.push({handler, priority});
595
581
  this.dataPipeline.sort((a, b) => {
596
582
  return a.priority - b.priority;
597
583
  });
598
584
  }else{
599
- console.error("Data pipeline handlers must have a priority in order to be registered")
585
+ console.error("Data pipeline handlers must have a priority in order to be registered");
600
586
  }
601
587
  }
602
588
 
603
589
  registerDisplayPipelineHandler(handler, priority){
604
590
  if(typeof priority !== "undefined"){
605
- this.displayPipeline.push({handler, priority})
591
+ this.displayPipeline.push({handler, priority});
606
592
  this.displayPipeline.sort((a, b) => {
607
593
  return a.priority - b.priority;
608
594
  });
609
595
  }else{
610
- console.error("Display pipeline handlers must have a priority in order to be registered")
596
+ console.error("Display pipeline handlers must have a priority in order to be registered");
611
597
  }
612
598
  }
613
599
 
@@ -616,84 +602,84 @@ export default class RowManager extends CoreFeature{
616
602
  var table = this.table,
617
603
  stage = "",
618
604
  index = 0,
619
- cascadeOrder = ["all", "dataPipeline", "display", "displayPipeline", "end"],
620
- displayIndex;
605
+ cascadeOrder = ["all", "dataPipeline", "display", "displayPipeline", "end"];
621
606
 
622
-
623
- if(typeof handler === "function"){
624
- index = this.dataPipeline.findIndex((item) => {
625
- return item.handler === handler;
626
- });
627
-
628
- if(index > -1){
629
- stage = "dataPipeline";
630
-
631
- if(skipStage){
632
- if(index == this.dataPipeline.length - 1){
633
- stage = "display";
634
- }else{
635
- index++;
636
- }
637
- }
638
- }else{
639
- index = this.displayPipeline.findIndex((item) => {
607
+ if(!this.table.destroyed){
608
+ if(typeof handler === "function"){
609
+ index = this.dataPipeline.findIndex((item) => {
640
610
  return item.handler === handler;
641
611
  });
642
612
 
643
613
  if(index > -1){
644
- stage = "displayPipeline";
614
+ stage = "dataPipeline";
645
615
 
646
616
  if(skipStage){
647
- if(index == this.displayPipeline.length - 1){
648
- stage = "end";
617
+ if(index == this.dataPipeline.length - 1){
618
+ stage = "display";
649
619
  }else{
650
620
  index++;
651
621
  }
652
622
  }
653
623
  }else{
654
- console.error("Unable to refresh data, invalid handler provided", handler)
655
- return;
624
+ index = this.displayPipeline.findIndex((item) => {
625
+ return item.handler === handler;
626
+ });
627
+
628
+ if(index > -1){
629
+ stage = "displayPipeline";
630
+
631
+ if(skipStage){
632
+ if(index == this.displayPipeline.length - 1){
633
+ stage = "end";
634
+ }else{
635
+ index++;
636
+ }
637
+ }
638
+ }else{
639
+ console.error("Unable to refresh data, invalid handler provided", handler);
640
+ return;
641
+ }
656
642
  }
657
- }
658
- }else{
659
- stage = handler || "all";
660
- index = 0;
661
- }
662
-
663
- if(this.redrawBlock){
664
- if(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){
665
- this.redrawBlockRestoreConfig = {
666
- handler: handler,
667
- skipStage: skipStage,
668
- renderInPosition: renderInPosition,
669
- stage:stage,
670
- index:index,
671
- };
643
+ }else{
644
+ stage = handler || "all";
645
+ index = 0;
672
646
  }
673
647
 
674
- return;
675
- }else{
676
- if(Helpers.elVisible(this.element)){
677
- if(renderInPosition){
678
- this.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));
648
+ if(this.redrawBlock){
649
+ if(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){
650
+ this.redrawBlockRestoreConfig = {
651
+ handler: handler,
652
+ skipStage: skipStage,
653
+ renderInPosition: renderInPosition,
654
+ stage:stage,
655
+ index:index,
656
+ };
657
+ }
658
+
659
+ return;
660
+ }else{
661
+ if(Helpers.elVisible(this.element)){
662
+ if(renderInPosition){
663
+ this.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));
664
+ }else{
665
+ this.refreshPipelines(handler, stage, index, renderInPosition);
666
+
667
+ if(!handler){
668
+ this.table.columnManager.renderer.renderColumns();
669
+ }
670
+
671
+ this.renderTable();
672
+
673
+ if(table.options.layoutColumnsOnNewData){
674
+ this.table.columnManager.redraw(true);
675
+ }
676
+ }
679
677
  }else{
680
678
  this.refreshPipelines(handler, stage, index, renderInPosition);
681
-
682
- if(!handler){
683
- this.table.columnManager.renderer.renderColumns();
684
- }
685
-
686
- this.renderTable();
687
-
688
- if(table.options.layoutColumnsOnNewData){
689
- this.table.columnManager.redraw(true);
690
- }
691
679
  }
692
- }else{
693
- this.refreshPipelines(handler, stage, index, renderInPosition);
680
+
681
+ this.dispatch("data-refreshed");
694
682
  }
695
-
696
- this.dispatch("data-refreshed");
697
683
  }
698
684
  }
699
685
 
@@ -707,47 +693,46 @@ export default class RowManager extends CoreFeature{
707
693
  //cascade through data refresh stages
708
694
  switch(stage){
709
695
  case "all":
710
- //handle case where alldata needs refreshing
696
+ //handle case where all data needs refreshing
711
697
 
712
698
  case "dataPipeline":
713
699
 
714
- for(let i = index; i < this.dataPipeline.length; i++){
715
- let result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));
700
+ for(let i = index; i < this.dataPipeline.length; i++){
701
+ let result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));
702
+
703
+ this.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);
704
+ }
705
+
706
+ this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);
716
707
 
717
- this.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);
718
- }
719
-
720
- this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);
721
-
722
- this.regenerateRowNumbers();
723
-
724
708
  case "display":
725
- index = 0;
726
- this.resetDisplayRows();
727
-
728
- case "displayPipeline":
729
- for(let i = index; i < this.displayPipeline.length; i++){
730
- let result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);
709
+ index = 0;
710
+ this.resetDisplayRows();
731
711
 
732
- this.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);
733
- }
712
+ case "displayPipeline":
713
+ for(let i = index; i < this.displayPipeline.length; i++){
714
+ let result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);
715
+
716
+ this.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);
717
+ }
734
718
 
735
719
  case "end":
736
- //case to handle scenario when trying to skip past end stage
720
+ //case to handle scenario when trying to skip past end stage
721
+ this.regenerateRowPositions();
737
722
  }
738
723
  }
739
724
 
740
- //regenerate row numbers for row number formatter if in use
741
- regenerateRowNumbers(){
742
- if(this.rowNumColumn){
743
- this.activeRows.forEach((row) => {
744
- var cell = row.getCell(this.rowNumColumn);
745
-
746
- if(cell){
747
- cell._generateContents();
748
- }
749
- });
750
- }
725
+ //regenerate row positions
726
+ regenerateRowPositions(){
727
+ var rows = this.getDisplayRows();
728
+ var index = 1;
729
+
730
+ rows.forEach((row) => {
731
+ if (row.type === "row"){
732
+ row.setPosition(index);
733
+ index++;
734
+ }
735
+ });
751
736
  }
752
737
 
753
738
  setActiveRows(activeRows){
@@ -770,22 +755,11 @@ export default class RowManager extends CoreFeature{
770
755
 
771
756
  //set display row pipeline data
772
757
  setDisplayRows(displayRows, index){
773
-
774
- var output = true;
775
-
776
- if(index && typeof this.displayRows[index] != "undefined"){
777
- this.displayRows[index] = displayRows;
778
- output = true;
779
- }else{
780
- this.displayRows.push(displayRows)
781
- output = index = this.displayRows.length -1;
782
- }
783
-
758
+ this.displayRows[index] = displayRows;
759
+
784
760
  if(index == this.displayRows.length -1){
785
761
  this.displayRowsCount = this.displayRows[this.displayRows.length -1].length;
786
762
  }
787
-
788
- return output;
789
763
  }
790
764
 
791
765
  getDisplayRows(index){
@@ -806,7 +780,7 @@ export default class RowManager extends CoreFeature{
806
780
  return rows;
807
781
  }
808
782
 
809
- //repeat action accross display rows
783
+ //repeat action across display rows
810
784
  displayRowIterator(callback){
811
785
  this.activeRowsPipeline.forEach(callback);
812
786
  this.displayRows.forEach(callback);
@@ -820,19 +794,19 @@ export default class RowManager extends CoreFeature{
820
794
 
821
795
  switch(type){
822
796
  case "active":
823
- rows = this.activeRows;
824
- break;
797
+ rows = this.activeRows;
798
+ break;
825
799
 
826
800
  case "display":
827
- rows = this.table.rowManager.getDisplayRows();
828
- break;
829
-
801
+ rows = this.table.rowManager.getDisplayRows();
802
+ break;
803
+
830
804
  case "visible":
831
- rows = this.getVisibleRows(false, true);
832
- break;
833
-
805
+ rows = this.getVisibleRows(false, true);
806
+ break;
807
+
834
808
  default:
835
- rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
809
+ rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
836
810
  }
837
811
 
838
812
  return rows;
@@ -849,7 +823,13 @@ export default class RowManager extends CoreFeature{
849
823
  }
850
824
  }else{
851
825
  this.dispatchExternal("renderStarted");
826
+
852
827
  this.renderer.rerenderRows(callback);
828
+
829
+ if(!this.fixedHeight){
830
+ this.adjustTableSize();
831
+ }
832
+
853
833
  this.dispatchExternal("renderComplete");
854
834
  }
855
835
  }
@@ -869,6 +849,8 @@ export default class RowManager extends CoreFeature{
869
849
  }
870
850
 
871
851
  if(renderClass){
852
+ this.renderMode = this.table.options.renderVertical;
853
+
872
854
  this.renderer = new renderClass(this.table, this.element, this.tableElement);
873
855
  this.renderer.initialize();
874
856
 
@@ -878,7 +860,7 @@ export default class RowManager extends CoreFeature{
878
860
  this.fixedHeight = false;
879
861
  }
880
862
  }else{
881
- console.error("Unable to find matching renderer:", table.options.renderVertical);
863
+ console.error("Unable to find matching renderer:", this.table.options.renderVertical);
882
864
  }
883
865
  }
884
866
 
@@ -898,7 +880,7 @@ export default class RowManager extends CoreFeature{
898
880
 
899
881
  if(this.firstRender){
900
882
  this.firstRender = false;
901
- this.layoutRefresh();
883
+ this.layoutRefresh(true);
902
884
  }
903
885
  }else{
904
886
  this.renderEmptyScroll();
@@ -928,13 +910,14 @@ export default class RowManager extends CoreFeature{
928
910
  }
929
911
  }
930
912
 
931
- _clearTable(){
932
- var element = this.tableElement;
933
-
913
+ _clearTable(){
934
914
  this._clearPlaceholder();
935
915
 
936
916
  this.scrollTop = 0;
937
917
  this.scrollLeft = 0;
918
+
919
+ // clear empty table placeholder min
920
+ this.tableElement.style.minWidth = "";
938
921
 
939
922
  this.renderer.clearRows();
940
923
  }
@@ -983,14 +966,15 @@ export default class RowManager extends CoreFeature{
983
966
 
984
967
  //adjust the height of the table holder to fit in the Tabulator element
985
968
  adjustTableSize(){
986
- var initialHeight = this.element.clientHeight,
987
- modExists;
969
+ var initialHeight = this.element.clientHeight, minHeight;
988
970
 
989
971
  if(this.renderer.verticalFillMode === "fill"){
990
972
  let otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));
991
973
 
992
974
  if(this.fixedHeight){
993
- this.element.style.minHeight = "calc(100% - " + otherHeight + "px)";
975
+ minHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + "px";
976
+
977
+ this.element.style.minHeight = minHeight || "calc(100% - " + otherHeight + "px)";
994
978
  this.element.style.height = "calc(100% - " + otherHeight + "px)";
995
979
  this.element.style.maxHeight = "calc(100% - " + otherHeight + "px)";
996
980
  }else{
@@ -1010,11 +994,11 @@ export default class RowManager extends CoreFeature{
1010
994
  }
1011
995
  }
1012
996
  }
1013
-
997
+
1014
998
  this._positionPlaceholder();
1015
999
  }
1016
1000
 
1017
- //renitialize all rows
1001
+ //reinitialize all rows
1018
1002
  reinitialize(){
1019
1003
  this.rows.forEach(function(row){
1020
1004
  row.reinitialize(true);
@@ -1032,7 +1016,7 @@ export default class RowManager extends CoreFeature{
1032
1016
  this.redrawBlock = false;
1033
1017
 
1034
1018
  if(this.redrawBlockRestoreConfig){
1035
- this.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition)
1019
+ this.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);
1036
1020
 
1037
1021
  this.redrawBlockRestoreConfig = false;
1038
1022
  }else{
@@ -1046,8 +1030,7 @@ export default class RowManager extends CoreFeature{
1046
1030
 
1047
1031
  //redraw table
1048
1032
  redraw (force){
1049
- var pos = 0,
1050
- left = this.scrollLeft;
1033
+ var left = this.scrollLeft;
1051
1034
 
1052
1035
  this.adjustTableSize();
1053
1036