tabulator-tables 5.2.6 → 5.3.1

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 (216) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.js +28 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -0
  4. package/.github/workflows/bad-files-check.yml +39 -0
  5. package/.github/workflows/lint-and-test.yml +31 -0
  6. package/README.md +18 -6
  7. package/bower.json +1 -1
  8. package/build/Bundler.js +77 -77
  9. package/dist/css/tabulator.css +12 -7
  10. package/dist/css/tabulator.css.map +1 -1
  11. package/dist/css/tabulator.min.css +1 -1
  12. package/dist/css/tabulator.min.css.map +1 -1
  13. package/dist/css/tabulator_bootstrap3.css +12 -7
  14. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  15. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  16. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  17. package/dist/css/tabulator_bootstrap4.css +12 -7
  18. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  19. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  20. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  21. package/dist/css/tabulator_bootstrap5.css +51 -46
  22. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  23. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  24. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  25. package/dist/css/tabulator_bulma.css +12 -7
  26. package/dist/css/tabulator_bulma.css.map +1 -1
  27. package/dist/css/tabulator_bulma.min.css +1 -1
  28. package/dist/css/tabulator_bulma.min.css.map +1 -1
  29. package/dist/css/tabulator_materialize.css +12 -7
  30. package/dist/css/tabulator_materialize.css.map +1 -1
  31. package/dist/css/tabulator_materialize.min.css +1 -1
  32. package/dist/css/tabulator_materialize.min.css.map +1 -1
  33. package/dist/css/tabulator_midnight.css +12 -7
  34. package/dist/css/tabulator_midnight.css.map +1 -1
  35. package/dist/css/tabulator_midnight.min.css +1 -1
  36. package/dist/css/tabulator_midnight.min.css.map +1 -1
  37. package/dist/css/tabulator_modern.css +12 -7
  38. package/dist/css/tabulator_modern.css.map +1 -1
  39. package/dist/css/tabulator_modern.min.css +1 -1
  40. package/dist/css/tabulator_modern.min.css.map +1 -1
  41. package/dist/css/tabulator_semanticui.css +12 -7
  42. package/dist/css/tabulator_semanticui.css.map +1 -1
  43. package/dist/css/tabulator_semanticui.min.css +1 -1
  44. package/dist/css/tabulator_semanticui.min.css.map +1 -1
  45. package/dist/css/tabulator_simple.css +12 -7
  46. package/dist/css/tabulator_simple.css.map +1 -1
  47. package/dist/css/tabulator_simple.min.css +1 -1
  48. package/dist/css/tabulator_simple.min.css.map +1 -1
  49. package/dist/css/tabulator_site.css +12 -7
  50. package/dist/css/tabulator_site.css.map +1 -1
  51. package/dist/css/tabulator_site.min.css +1 -1
  52. package/dist/css/tabulator_site.min.css.map +1 -1
  53. package/dist/js/jquery_wrapper.js +37 -37
  54. package/dist/js/tabulator.js +1506 -706
  55. package/dist/js/tabulator.js.map +1 -1
  56. package/dist/js/tabulator.min.js +2 -2
  57. package/dist/js/tabulator.min.js.map +1 -1
  58. package/dist/js/tabulator_esm.js +4226 -3460
  59. package/dist/js/tabulator_esm.js.map +1 -1
  60. package/dist/js/tabulator_esm.min.js +2 -2
  61. package/dist/js/tabulator_esm.min.js.map +1 -1
  62. package/package.json +4 -1
  63. package/src/js/builds/jquery_wrapper.js +37 -37
  64. package/src/js/core/ColumnManager.js +270 -232
  65. package/src/js/core/CoreFeature.js +16 -2
  66. package/src/js/core/FooterManager.js +10 -10
  67. package/src/js/core/Module.js +8 -8
  68. package/src/js/core/RowManager.js +81 -88
  69. package/src/js/core/Tabulator.js +89 -72
  70. package/src/js/core/TabulatorFull.js +1 -1
  71. package/src/js/core/cell/Cell.js +15 -16
  72. package/src/js/core/cell/CellComponent.js +2 -2
  73. package/src/js/core/column/Column.js +81 -68
  74. package/src/js/core/column/ColumnComponent.js +4 -4
  75. package/src/js/core/column/defaults/options.js +1 -1
  76. package/src/js/core/defaults/options.js +4 -2
  77. package/src/js/core/rendering/Renderer.js +19 -19
  78. package/src/js/core/rendering/renderers/BasicHorizontal.js +1 -2
  79. package/src/js/core/rendering/renderers/BasicVertical.js +1 -1
  80. package/src/js/core/rendering/renderers/VirtualDomHorizontal.js +42 -58
  81. package/src/js/core/rendering/renderers/VirtualDomVertical.js +31 -22
  82. package/src/js/core/row/Row.js +32 -8
  83. package/src/js/core/row/RowComponent.js +8 -4
  84. package/src/js/core/tools/Alert.js +44 -45
  85. package/src/js/core/tools/ComponentFunctionBinder.js +4 -2
  86. package/src/js/core/tools/DataLoader.js +3 -3
  87. package/src/js/core/tools/DeprecationAdvisor.js +47 -0
  88. package/src/js/core/tools/ExternalEventBus.js +5 -5
  89. package/src/js/core/tools/InteractionMonitor.js +34 -33
  90. package/src/js/core/tools/InternalEventBus.js +5 -5
  91. package/src/js/core/tools/ModuleBinder.js +6 -6
  92. package/src/js/core/tools/OptionsList.js +4 -4
  93. package/src/js/core/tools/Popup.js +215 -189
  94. package/src/js/modules/Accessor/Accessor.js +16 -16
  95. package/src/js/modules/Accessor/defaults/accessors.js +1 -1
  96. package/src/js/modules/Ajax/Ajax.js +7 -7
  97. package/src/js/modules/Ajax/defaults/loaderPromise.js +19 -19
  98. package/src/js/modules/Ajax/defaults/urlGenerator.js +1 -1
  99. package/src/js/modules/Clipboard/Clipboard.js +23 -23
  100. package/src/js/modules/Clipboard/defaults/pasteParsers.js +0 -2
  101. package/src/js/modules/ColumnCalcs/CalcComponent.js +2 -2
  102. package/src/js/modules/ColumnCalcs/ColumnCalcs.js +55 -51
  103. package/src/js/modules/ColumnCalcs/defaults/calculations.js +1 -1
  104. package/src/js/modules/DataTree/DataTree.js +24 -15
  105. package/src/js/modules/Download/Download.js +15 -8
  106. package/src/js/modules/Download/defaults/downloaders/csv.js +28 -28
  107. package/src/js/modules/Download/defaults/downloaders/html.js +2 -2
  108. package/src/js/modules/Download/defaults/downloaders/json.js +14 -14
  109. package/src/js/modules/Download/defaults/downloaders/jsonLines.js +1 -1
  110. package/src/js/modules/Download/defaults/downloaders/pdf.js +17 -19
  111. package/src/js/modules/Download/defaults/downloaders/xlsx.js +2 -2
  112. package/src/js/modules/Edit/Edit.js +219 -201
  113. package/src/js/modules/Edit/List.js +1026 -991
  114. package/src/js/modules/Edit/defaults/editors/autocomplete.js +3 -3
  115. package/src/js/modules/Edit/defaults/editors/date.js +110 -0
  116. package/src/js/modules/Edit/defaults/editors/datetime.js +97 -0
  117. package/src/js/modules/Edit/defaults/editors/input.js +7 -7
  118. package/src/js/modules/Edit/defaults/editors/list.js +2 -2
  119. package/src/js/modules/Edit/defaults/editors/number.js +12 -12
  120. package/src/js/modules/Edit/defaults/editors/progress.js +11 -11
  121. package/src/js/modules/Edit/defaults/editors/range.js +5 -5
  122. package/src/js/modules/Edit/defaults/editors/select.js +3 -3
  123. package/src/js/modules/Edit/defaults/editors/star.js +9 -9
  124. package/src/js/modules/Edit/defaults/editors/textarea.js +97 -92
  125. package/src/js/modules/Edit/defaults/editors/tickCross.js +1 -3
  126. package/src/js/modules/Edit/defaults/editors/time.js +98 -0
  127. package/src/js/modules/Edit/defaults/editors.js +8 -2
  128. package/src/js/modules/Edit/inputMask.js +19 -26
  129. package/src/js/modules/Export/Export.js +69 -65
  130. package/src/js/modules/Filter/Filter.js +88 -95
  131. package/src/js/modules/Format/Format.js +24 -26
  132. package/src/js/modules/Format/defaults/formatters/buttonCross.js +1 -1
  133. package/src/js/modules/Format/defaults/formatters/buttonTick.js +1 -1
  134. package/src/js/modules/Format/defaults/formatters/color.js +1 -1
  135. package/src/js/modules/Format/defaults/formatters/datetime.js +7 -7
  136. package/src/js/modules/Format/defaults/formatters/datetimediff.js +7 -7
  137. package/src/js/modules/Format/defaults/formatters/handle.js +1 -1
  138. package/src/js/modules/Format/defaults/formatters/html.js +1 -1
  139. package/src/js/modules/Format/defaults/formatters/image.js +9 -9
  140. package/src/js/modules/Format/defaults/formatters/link.js +10 -10
  141. package/src/js/modules/Format/defaults/formatters/lookup.js +1 -1
  142. package/src/js/modules/Format/defaults/formatters/money.js +1 -1
  143. package/src/js/modules/Format/defaults/formatters/plaintext.js +1 -1
  144. package/src/js/modules/Format/defaults/formatters/progress.js +41 -42
  145. package/src/js/modules/Format/defaults/formatters/responsiveCollapse.js +3 -3
  146. package/src/js/modules/Format/defaults/formatters/rowSelection.js +1 -1
  147. package/src/js/modules/Format/defaults/formatters/rownum.js +9 -2
  148. package/src/js/modules/Format/defaults/formatters/star.js +1 -1
  149. package/src/js/modules/Format/defaults/formatters/textarea.js +1 -1
  150. package/src/js/modules/Format/defaults/formatters/tickCross.js +1 -1
  151. package/src/js/modules/Format/defaults/formatters/traffic.js +14 -14
  152. package/src/js/modules/FrozenColumns/FrozenColumns.js +6 -8
  153. package/src/js/modules/FrozenRows/FrozenRows.js +37 -7
  154. package/src/js/modules/GroupRows/Group.js +7 -7
  155. package/src/js/modules/GroupRows/GroupComponent.js +2 -2
  156. package/src/js/modules/GroupRows/GroupRows.js +34 -11
  157. package/src/js/modules/History/History.js +2 -2
  158. package/src/js/modules/HtmlTableImport/HtmlTableImport.js +3 -6
  159. package/src/js/modules/Import/Import.js +158 -159
  160. package/src/js/modules/Import/defaults/importers/array.js +5 -0
  161. package/src/js/modules/Import/defaults/importers/csv.js +49 -49
  162. package/src/js/modules/Import/defaults/importers/json.js +6 -6
  163. package/src/js/modules/Import/defaults/importers.js +2 -0
  164. package/src/js/modules/Interaction/Interaction.js +41 -42
  165. package/src/js/modules/Keybindings/Keybindings.js +14 -14
  166. package/src/js/modules/Keybindings/defaults/actions.js +1 -2
  167. package/src/js/modules/Layout/Layout.js +4 -5
  168. package/src/js/modules/Layout/defaults/modes/fitColumns.js +13 -16
  169. package/src/js/modules/Layout/defaults/modes/fitData.js +6 -4
  170. package/src/js/modules/Layout/defaults/modes/fitDataGeneral.js +2 -2
  171. package/src/js/modules/Layout/defaults/modes/fitDataStretch.js +2 -2
  172. package/src/js/modules/Localize/Localize.js +7 -7
  173. package/src/js/modules/Menu/Menu.js +8 -11
  174. package/src/js/modules/MoveColumns/MoveColumns.js +3 -6
  175. package/src/js/modules/MoveRows/MoveRows.js +30 -36
  176. package/src/js/modules/Mutator/Mutator.js +9 -9
  177. package/src/js/modules/Page/Page.js +73 -80
  178. package/src/js/modules/Page/defaults/pageCounters/pages.js +2 -2
  179. package/src/js/modules/Page/defaults/pageCounters/rows.js +1 -1
  180. package/src/js/modules/Persistence/Persistence.js +40 -44
  181. package/src/js/modules/Persistence/defaults/readers.js +1 -1
  182. package/src/js/modules/Popup/Popup.js +4 -5
  183. package/src/js/modules/Print/Print.js +2 -2
  184. package/src/js/modules/ReactiveData/ReactiveData.js +178 -115
  185. package/src/js/modules/ResizeColumns/ResizeColumns.js +3 -3
  186. package/src/js/modules/ResizeRows/ResizeRows.js +1 -1
  187. package/src/js/modules/ResizeTable/ResizeTable.js +77 -46
  188. package/src/js/modules/ResponsiveLayout/ResponsiveLayout.js +3 -5
  189. package/src/js/modules/SelectRow/SelectRow.js +26 -28
  190. package/src/js/modules/Sort/Sort.js +110 -79
  191. package/src/js/modules/Sort/defaults/sorters/alphanum.js +1 -1
  192. package/src/js/modules/Sort/defaults/sorters/array.js +24 -28
  193. package/src/js/modules/Sort/defaults/sorters/boolean.js +1 -1
  194. package/src/js/modules/Sort/defaults/sorters/date.js +1 -1
  195. package/src/js/modules/Sort/defaults/sorters/datetime.js +13 -13
  196. package/src/js/modules/Sort/defaults/sorters/exists.js +1 -1
  197. package/src/js/modules/Sort/defaults/sorters/number.js +1 -1
  198. package/src/js/modules/Sort/defaults/sorters/string.js +7 -7
  199. package/src/js/modules/Sort/defaults/sorters/time.js +1 -1
  200. package/src/js/modules/Tooltip/Tooltip.js +5 -7
  201. package/src/js/modules/Validate/Validate.js +10 -13
  202. package/src/js/modules/Validate/defaults/validators.js +8 -3
  203. package/src/scss/tabulator.scss +28 -17
  204. package/src/scss/themes/bootstrap/functions4.scss +1 -1
  205. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +8 -8
  206. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +8 -8
  207. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +25 -25
  208. package/src/scss/themes/bootstrap/variables5.scss +4 -4
  209. package/src/scss/themes/bulma/tabulator_bulma.scss +7 -7
  210. package/src/scss/themes/materialize/tabulator_materialize.scss +6 -6
  211. package/src/scss/themes/materialize/variables.scss +1 -1
  212. package/src/scss/themes/semanticui/tabulator_semanticui.scss +7 -7
  213. package/src/scss/themes/tabulator_midnight.scss +7 -7
  214. package/src/scss/themes/tabulator_modern.scss +14 -14
  215. package/src/scss/themes/tabulator_simple.scss +8 -8
  216. package/src/scss/themes/tabulator_site.scss +15 -15
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.2.6 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.3.1 (c) Oliver Folkerd 2022 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -258,8 +258,12 @@
258
258
  //flag to console log events
259
259
  debugInvalidOptions: true,
260
260
  //allow toggling of invalid option warnings
261
+ debugInvalidComponentFuncs: true,
262
+ //allow toggling of invalid component warnings
261
263
  debugInitialization: true,
262
- //allow toggling of invalid option warnings
264
+ //allow toggling of pre initialization function call warnings
265
+ debugDeprecation: true,
266
+ //allow toggling of deprecation warnings
263
267
  height: false,
264
268
  //height of tabulator
265
269
  minHeight: false,
@@ -377,8 +381,8 @@
377
381
  }
378
382
  }, {
379
383
  key: "layoutRefresh",
380
- value: function layoutRefresh() {
381
- return this.table.modules.layout.layout();
384
+ value: function layoutRefresh(force) {
385
+ return this.table.modules.layout.layout(force);
382
386
  } //////////////////////////////////////////
383
387
  /////////////// Event Bus ////////////////
384
388
  //////////////////////////////////////////
@@ -466,6 +470,24 @@
466
470
 
467
471
  return this.table.options[key];
468
472
  } //////////////////////////////////////////
473
+ /////////// Deprecation Checks ///////////
474
+ //////////////////////////////////////////
475
+
476
+ }, {
477
+ key: "deprecationCheck",
478
+ value: function deprecationCheck(oldOption, newOption) {
479
+ return this.table.deprecationAdvisor.check(oldOption, newOption);
480
+ }
481
+ }, {
482
+ key: "deprecationCheckMsg",
483
+ value: function deprecationCheckMsg(oldOption, msg) {
484
+ return this.table.deprecationAdvisor.checkMsg(oldOption, msg);
485
+ }
486
+ }, {
487
+ key: "deprecationMsg",
488
+ value: function deprecationMsg(msg) {
489
+ return this.table.deprecationAdvisor.msg(msg);
490
+ } //////////////////////////////////////////
469
491
  //////////////// Modules /////////////////
470
492
  //////////////////////////////////////////
471
493
 
@@ -647,7 +669,7 @@
647
669
  result = this._column.setWidth(width);
648
670
  }
649
671
 
650
- this._column.table.columnManager.renderer.rerenderColumns(true);
672
+ this._column.table.columnManager.rerenderColumns(true);
651
673
 
652
674
  return result;
653
675
  }
@@ -819,7 +841,6 @@
819
841
  this.element = document.createElement('div');
820
842
  this.element.className = "tabulator-cell";
821
843
  this.element.setAttribute("role", "gridcell");
822
- this.element = this.element;
823
844
  }
824
845
  }, {
825
846
  key: "_configureCell",
@@ -1142,16 +1163,16 @@
1142
1163
 
1143
1164
  _this.width = null; //column width
1144
1165
 
1145
- _this.widthStyled = ""; //column width prestyled to improve render efficiency
1166
+ _this.widthStyled = ""; //column width pre-styled to improve render efficiency
1146
1167
 
1147
1168
  _this.maxWidth = null; //column maximum width
1148
1169
 
1149
- _this.maxWidthStyled = ""; //column maximum prestyled to improve render efficiency
1170
+ _this.maxWidthStyled = ""; //column maximum pre-styled to improve render efficiency
1150
1171
 
1151
1172
  _this.maxInitialWidth = null;
1152
1173
  _this.minWidth = null; //column minimum width
1153
1174
 
1154
- _this.minWidthStyled = ""; //column minimum prestyled to improve render efficiency
1175
+ _this.minWidthStyled = ""; //column minimum pre-styled to improve render efficiency
1155
1176
 
1156
1177
  _this.widthFixed = false; //user has specified a width for this column
1157
1178
 
@@ -1175,8 +1196,6 @@
1175
1196
 
1176
1197
  _this._initialize();
1177
1198
 
1178
- _this.bindModuleColumns();
1179
-
1180
1199
  return _this;
1181
1200
  }
1182
1201
 
@@ -1187,6 +1206,17 @@
1187
1206
  el.classList.add("tabulator-col");
1188
1207
  el.setAttribute("role", "columnheader");
1189
1208
  el.setAttribute("aria-sort", "none");
1209
+
1210
+ switch (this.table.options.columnHeaderVertAlign) {
1211
+ case "middle":
1212
+ el.style.justifyContent = "center";
1213
+ break;
1214
+
1215
+ case "bottom":
1216
+ el.style.justifyContent = "flex-end";
1217
+ break;
1218
+ }
1219
+
1190
1220
  return el;
1191
1221
  }
1192
1222
  }, {
@@ -1253,10 +1283,6 @@
1253
1283
  } else {
1254
1284
  this.registerColumnPosition(this);
1255
1285
  }
1256
- }
1257
- }, {
1258
- key: "_mapDepricatedFunctionality",
1259
- value: function _mapDepricatedFunctionality() {//all previously deprecated functionality removed in the 5.0 release
1260
1286
  } //build header element
1261
1287
 
1262
1288
  }, {
@@ -1293,8 +1319,7 @@
1293
1319
  value: function _buildColumnHeader() {
1294
1320
  var _this3 = this;
1295
1321
 
1296
- var def = this.definition,
1297
- table = this.table;
1322
+ var def = this.definition;
1298
1323
  this.dispatch("column-layout", this); //set column visibility
1299
1324
 
1300
1325
  if (typeof def.visible != "undefined") {
@@ -1303,12 +1328,12 @@
1303
1328
  } else {
1304
1329
  this.hide(true);
1305
1330
  }
1306
- } //asign additional css classes to column header
1331
+ } //assign additional css classes to column header
1307
1332
 
1308
1333
 
1309
1334
  if (def.cssClass) {
1310
- var classeNames = def.cssClass.split(" ");
1311
- classeNames.forEach(function (className) {
1335
+ var classNames = def.cssClass.split(" ");
1336
+ classNames.forEach(function (className) {
1312
1337
  _this3.element.classList.add(className);
1313
1338
  });
1314
1339
  }
@@ -1328,7 +1353,7 @@
1328
1353
  this.setMaxWidth(parseInt(def.maxWidth));
1329
1354
  }
1330
1355
 
1331
- this.reinitializeWidth(); //set orizontal text alignment
1356
+ this.reinitializeWidth(); //set horizontal text alignment
1332
1357
 
1333
1358
  this.hozAlign = this.definition.hozAlign;
1334
1359
  this.vertAlign = this.definition.vertAlign;
@@ -1337,8 +1362,6 @@
1337
1362
  }, {
1338
1363
  key: "_buildColumnHeaderContent",
1339
1364
  value: function _buildColumnHeaderContent() {
1340
- var def = this.definition,
1341
- table = this.table;
1342
1365
  var contentElement = document.createElement("div");
1343
1366
  contentElement.classList.add("tabulator-col-content");
1344
1367
  this.titleHolderElement = document.createElement("div");
@@ -1428,8 +1451,8 @@
1428
1451
  this.element.setAttribute("aria-title", this.definition.title); //asign additional css classes to column header
1429
1452
 
1430
1453
  if (this.definition.cssClass) {
1431
- var classeNames = this.definition.cssClass.split(" ");
1432
- classeNames.forEach(function (className) {
1454
+ var classNames = this.definition.cssClass.split(" ");
1455
+ classNames.forEach(function (className) {
1433
1456
  _this5.element.classList.add(className);
1434
1457
  });
1435
1458
  }
@@ -1520,20 +1543,19 @@
1520
1543
  if (this.isGroup) {
1521
1544
  this.groupElement.style.minHeight = parentHeight - this.contentElement.offsetHeight + "px";
1522
1545
  } //vertically align cell contents
1546
+ // if(!this.isGroup && alignment !== "top"){
1547
+ // if(alignment === "bottom"){
1548
+ // this.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + "px";
1549
+ // }else{
1550
+ // this.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + "px";
1551
+ // }
1552
+ // }
1523
1553
 
1524
1554
 
1525
- if (!this.isGroup && alignment !== "top") {
1526
- if (alignment === "bottom") {
1527
- this.element.style.paddingTop = this.element.clientHeight - this.contentElement.offsetHeight + "px";
1528
- } else {
1529
- this.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) / 2 + "px";
1530
- }
1531
- }
1532
-
1533
1555
  this.columns.forEach(function (column) {
1534
1556
  column.verticalAlign(alignment);
1535
1557
  });
1536
- } //clear vertical alignmenet
1558
+ } //clear vertical alignment
1537
1559
 
1538
1560
  }, {
1539
1561
  key: "clearVerticalAlign",
@@ -1546,22 +1568,14 @@
1546
1568
  column.clearVerticalAlign();
1547
1569
  });
1548
1570
  this.dispatch("column-height", this, "");
1549
- }
1550
- }, {
1551
- key: "bindModuleColumns",
1552
- value: function bindModuleColumns() {
1553
- //check if rownum formatter is being used on a column
1554
- if (this.definition.formatter == "rownum") {
1555
- this.table.rowManager.rowNumColumn = this;
1556
- }
1557
- } //// Retreive Column Information ////
1571
+ } //// Retrieve Column Information ////
1558
1572
  //return column header element
1559
1573
 
1560
1574
  }, {
1561
1575
  key: "getElement",
1562
1576
  value: function getElement() {
1563
1577
  return this.element;
1564
- } //return colunm group element
1578
+ } //return column group element
1565
1579
 
1566
1580
  }, {
1567
1581
  key: "getGroupElement",
@@ -1610,15 +1624,26 @@
1610
1624
 
1611
1625
  }, {
1612
1626
  key: "getColumns",
1613
- value: function getColumns() {
1614
- return this.columns;
1627
+ value: function getColumns(traverse) {
1628
+ var columns = [];
1629
+
1630
+ if (traverse) {
1631
+ this.columns.forEach(function (column) {
1632
+ columns.push(column);
1633
+ columns = columns.concat(column.getColumns(true));
1634
+ });
1635
+ } else {
1636
+ columns = this.columns;
1637
+ }
1638
+
1639
+ return columns;
1615
1640
  } //return all columns in a group
1616
1641
 
1617
1642
  }, {
1618
1643
  key: "getCells",
1619
1644
  value: function getCells() {
1620
1645
  return this.cells;
1621
- } //retreive the top column in a group of columns
1646
+ } //retrieve the top column in a group of columns
1622
1647
 
1623
1648
  }, {
1624
1649
  key: "getTopColumn",
@@ -1694,7 +1719,7 @@
1694
1719
  }
1695
1720
 
1696
1721
  if (!this.silent) {
1697
- this.table.columnManager.renderer.rerenderColumns();
1722
+ this.table.columnManager.rerenderColumns();
1698
1723
  }
1699
1724
  }
1700
1725
  } //hide column
@@ -1725,7 +1750,7 @@
1725
1750
  }
1726
1751
 
1727
1752
  if (!this.silent) {
1728
- this.table.columnManager.renderer.rerenderColumns();
1753
+ this.table.columnManager.rerenderColumns();
1729
1754
  }
1730
1755
  }
1731
1756
  }
@@ -1841,6 +1866,11 @@
1841
1866
  }, {
1842
1867
  key: "setMinWidth",
1843
1868
  value: function setMinWidth(minWidth) {
1869
+ if (this.maxWidth && minWidth > this.maxWidth) {
1870
+ minWidth = this.maxWidth;
1871
+ console.warn("the minWidth (" + minWidth + "px) for column '" + this.field + "' cannot be bigger that its maxWidth (" + this.maxWidthStyled + ")");
1872
+ }
1873
+
1844
1874
  this.minWidth = minWidth;
1845
1875
  this.minWidthStyled = minWidth ? minWidth + "px" : "";
1846
1876
  this.element.style.minWidth = this.minWidthStyled;
@@ -1851,6 +1881,11 @@
1851
1881
  }, {
1852
1882
  key: "setMaxWidth",
1853
1883
  value: function setMaxWidth(maxWidth) {
1884
+ if (this.minWidth && maxWidth < this.minWidth) {
1885
+ maxWidth = this.minWidth;
1886
+ console.warn("the maxWidth (" + maxWidth + "px) for column '" + this.field + "' cannot be smaller that its minWidth (" + this.minWidthStyled + ")");
1887
+ }
1888
+
1854
1889
  this.maxWidth = maxWidth;
1855
1890
  this.maxWidthStyled = maxWidth ? maxWidth + "px" : "";
1856
1891
  this.element.style.maxWidth = this.maxWidthStyled;
@@ -1864,7 +1899,6 @@
1864
1899
  var _this6 = this;
1865
1900
 
1866
1901
  return new Promise(function (resolve, reject) {
1867
-
1868
1902
  if (_this6.isGroup) {
1869
1903
  _this6.columns.forEach(function (column) {
1870
1904
  column["delete"]();
@@ -1894,7 +1928,7 @@
1894
1928
 
1895
1929
  _this6.table.columnManager.deregisterColumn(_this6);
1896
1930
 
1897
- _this6.table.columnManager.renderer.rerenderColumns(true);
1931
+ _this6.table.columnManager.rerenderColumns(true);
1898
1932
 
1899
1933
  resolve();
1900
1934
  });
@@ -2005,7 +2039,7 @@
2005
2039
  definition = Object.assign(definition, updates);
2006
2040
  return this.table.columnManager.addColumn(definition, false, this).then(function (column) {
2007
2041
  if (definition.field == _this7.field) {
2008
- _this7.field = false; //cleair field name to prevent deletion of duplicate column from arrays
2042
+ _this7.field = false; //clear field name to prevent deletion of duplicate column from arrays
2009
2043
  }
2010
2044
 
2011
2045
  return _this7["delete"]().then(function () {
@@ -2144,16 +2178,16 @@
2144
2178
  }
2145
2179
  }
2146
2180
 
2147
- for (var key in output) {
2148
- if (key in userOptions) {
2149
- output[key] = userOptions[key];
2181
+ for (var _key in output) {
2182
+ if (_key in userOptions) {
2183
+ output[_key] = userOptions[_key];
2150
2184
  } else {
2151
- if (Array.isArray(output[key])) {
2152
- output[key] = Object.assign([], output[key]);
2153
- } else if (_typeof(output[key]) === "object" && output[key] !== null) {
2154
- output[key] = Object.assign({}, output[key]);
2155
- } else if (typeof output[key] === "undefined") {
2156
- delete output[key];
2185
+ if (Array.isArray(output[_key])) {
2186
+ output[_key] = Object.assign([], output[_key]);
2187
+ } else if (_typeof(output[_key]) === "object" && output[_key] !== null) {
2188
+ output[_key] = Object.assign({}, output[_key]);
2189
+ } else if (typeof output[_key] === "undefined") {
2190
+ delete output[_key];
2157
2191
  }
2158
2192
  }
2159
2193
  }
@@ -2179,7 +2213,7 @@
2179
2213
  _this.elementVertical = table.rowManager.element;
2180
2214
  _this.elementHorizontal = table.columnManager.element;
2181
2215
  _this.tableElement = table.rowManager.tableElement;
2182
- _this.verticalFillMode = "fit"; // used by row manager to determin how to size the render area ("fit" - fits container to the contents, "fill" - fills the contianer without resizing it)
2216
+ _this.verticalFillMode = "fit"; // used by row manager to determine how to size the render area ("fit" - fits container to the contents, "fill" - fills the container without resizing it)
2183
2217
 
2184
2218
  return _this;
2185
2219
  } ///////////////////////////////////
@@ -2237,11 +2271,11 @@
2237
2271
  }
2238
2272
  }, {
2239
2273
  key: "scrollRows",
2240
- value: function scrollRows(top, dir) {//handle vertical scolling
2274
+ value: function scrollRows(top, dir) {//handle vertical scrolling
2241
2275
  }
2242
2276
  }, {
2243
2277
  key: "resize",
2244
- value: function resize() {//container has rezied, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)
2278
+ value: function resize() {//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)
2245
2279
  }
2246
2280
  }, {
2247
2281
  key: "scrollToRow",
@@ -2249,7 +2283,7 @@
2249
2283
  }
2250
2284
  }, {
2251
2285
  key: "scrollToRowNearestTop",
2252
- value: function scrollToRowNearestTop(row) {//determine weather the row is nearest the top or bottom of the table, retur true for top or false for bottom
2286
+ value: function scrollToRowNearestTop(row) {//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom
2253
2287
  }
2254
2288
  }, {
2255
2289
  key: "visibleRows",
@@ -2378,18 +2412,18 @@
2378
2412
  return Renderer;
2379
2413
  }(CoreFeature);
2380
2414
 
2381
- var BaiscHorizontal = /*#__PURE__*/function (_Renderer) {
2382
- _inherits(BaiscHorizontal, _Renderer);
2415
+ var BasicHorizontal = /*#__PURE__*/function (_Renderer) {
2416
+ _inherits(BasicHorizontal, _Renderer);
2383
2417
 
2384
- var _super = _createSuper(BaiscHorizontal);
2418
+ var _super = _createSuper(BasicHorizontal);
2385
2419
 
2386
- function BaiscHorizontal(table) {
2387
- _classCallCheck(this, BaiscHorizontal);
2420
+ function BasicHorizontal(table) {
2421
+ _classCallCheck(this, BasicHorizontal);
2388
2422
 
2389
2423
  return _super.call(this, table);
2390
2424
  }
2391
2425
 
2392
- _createClass(BaiscHorizontal, [{
2426
+ _createClass(BasicHorizontal, [{
2393
2427
  key: "renderRowCells",
2394
2428
  value: function renderRowCells(row) {
2395
2429
  row.cells.forEach(function (cell) {
@@ -2406,7 +2440,7 @@
2406
2440
  }
2407
2441
  }]);
2408
2442
 
2409
- return BaiscHorizontal;
2443
+ return BasicHorizontal;
2410
2444
  }(Renderer);
2411
2445
 
2412
2446
  var VirtualDomHorizontal = /*#__PURE__*/function (_Renderer) {
@@ -2645,8 +2679,6 @@
2645
2679
  var _this3 = this;
2646
2680
 
2647
2681
  var change = false,
2648
- collsWidth = 0,
2649
- colEnd = 0,
2650
2682
  row,
2651
2683
  rowEl;
2652
2684
 
@@ -2657,34 +2689,25 @@
2657
2689
  }
2658
2690
  });
2659
2691
 
2660
- if (change) {
2661
- if (change && this.table.rowManager.getDisplayRows().length) {
2662
- this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;
2663
- var row = this.chain("rows-sample", [1], [], function () {
2664
- return _this3.table.rowManager.getDisplayRows();
2665
- })[0];
2666
-
2667
- if (row) {
2668
- rowEl = row.getElement();
2669
- row.generateCells();
2670
- this.tableElement.appendChild(rowEl);
2671
-
2672
- for (var colEnd = 0; colEnd < row.cells.length; colEnd++) {
2673
- var cell = row.cells[colEnd];
2674
- rowEl.appendChild(cell.getElement());
2675
- cell.column.reinitializeWidth();
2676
- collsWidth += cell.column.getWidth(); // if(collsWidth > this.vDomScrollPosRight){
2677
- // break;
2678
- // }
2679
- }
2680
-
2681
- rowEl.parentNode.removeChild(rowEl); // this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));
2682
- // for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){
2683
- // this.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);
2684
- // }
2692
+ if (change && this.table.rowManager.getDisplayRows().length) {
2693
+ this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;
2694
+ row = this.chain("rows-sample", [1], [], function () {
2695
+ return _this3.table.rowManager.getDisplayRows();
2696
+ })[0];
2685
2697
 
2686
- this.rerenderColumns(false, true);
2698
+ if (row) {
2699
+ rowEl = row.getElement();
2700
+ row.generateCells();
2701
+ this.tableElement.appendChild(rowEl);
2702
+
2703
+ for (var colEnd = 0; colEnd < row.cells.length; colEnd++) {
2704
+ var cell = row.cells[colEnd];
2705
+ rowEl.appendChild(cell.getElement());
2706
+ cell.column.reinitializeWidth();
2687
2707
  }
2708
+
2709
+ rowEl.parentNode.removeChild(rowEl);
2710
+ this.rerenderColumns(false, true);
2688
2711
  }
2689
2712
  }
2690
2713
  } else {
@@ -2765,7 +2788,8 @@
2765
2788
  value: function addColRight() {
2766
2789
  var _this6 = this;
2767
2790
 
2768
- var changes = false;
2791
+ var changes = false,
2792
+ working = true;
2769
2793
 
2770
2794
  var _loop = function _loop() {
2771
2795
  var column = _this6.columns[_this6.rightCol + 1];
@@ -2792,17 +2816,15 @@
2792
2816
  _this6.vDomPadRight -= column.getWidth();
2793
2817
  }
2794
2818
  } else {
2795
- return "break";
2819
+ working = false;
2796
2820
  }
2797
2821
  } else {
2798
- return "break";
2822
+ working = false;
2799
2823
  }
2800
2824
  };
2801
2825
 
2802
- while (true) {
2803
- var _ret = _loop();
2804
-
2805
- if (_ret === "break") break;
2826
+ while (working) {
2827
+ _loop();
2806
2828
  }
2807
2829
 
2808
2830
  if (changes) {
@@ -2814,7 +2836,8 @@
2814
2836
  value: function addColLeft() {
2815
2837
  var _this7 = this;
2816
2838
 
2817
- var changes = false;
2839
+ var changes = false,
2840
+ working = true;
2818
2841
 
2819
2842
  var _loop2 = function _loop2() {
2820
2843
  var column = _this7.columns[_this7.leftCol - 1];
@@ -2847,17 +2870,15 @@
2847
2870
  _this7.vDomPadRight -= diff;
2848
2871
  }
2849
2872
  } else {
2850
- return "break";
2873
+ working = false;
2851
2874
  }
2852
2875
  } else {
2853
- return "break";
2876
+ working = false;
2854
2877
  }
2855
2878
  };
2856
2879
 
2857
- while (true) {
2858
- var _ret2 = _loop2();
2859
-
2860
- if (_ret2 === "break") break;
2880
+ while (working) {
2881
+ _loop2();
2861
2882
  }
2862
2883
 
2863
2884
  if (changes) {
@@ -2869,7 +2890,8 @@
2869
2890
  value: function removeColRight() {
2870
2891
  var _this8 = this;
2871
2892
 
2872
- var changes = false;
2893
+ var changes = false,
2894
+ working = true;
2873
2895
 
2874
2896
  var _loop3 = function _loop3() {
2875
2897
  var column = _this8.columns[_this8.rightCol];
@@ -2893,17 +2915,15 @@
2893
2915
  _this8.vDomPadRight += column.getWidth();
2894
2916
  _this8.rightCol--;
2895
2917
  } else {
2896
- return "break";
2918
+ working = false;
2897
2919
  }
2898
2920
  } else {
2899
- return "break";
2921
+ working = false;
2900
2922
  }
2901
2923
  };
2902
2924
 
2903
- while (true) {
2904
- var _ret3 = _loop3();
2905
-
2906
- if (_ret3 === "break") break;
2925
+ while (working) {
2926
+ _loop3();
2907
2927
  }
2908
2928
 
2909
2929
  if (changes) {
@@ -2915,7 +2935,8 @@
2915
2935
  value: function removeColLeft() {
2916
2936
  var _this9 = this;
2917
2937
 
2918
- var changes = false;
2938
+ var changes = false,
2939
+ working = true;
2919
2940
 
2920
2941
  var _loop4 = function _loop4() {
2921
2942
  var column = _this9.columns[_this9.leftCol];
@@ -2939,17 +2960,15 @@
2939
2960
  _this9.vDomPadLeft += column.getWidth();
2940
2961
  _this9.leftCol++;
2941
2962
  } else {
2942
- return "break";
2963
+ working = false;
2943
2964
  }
2944
2965
  } else {
2945
- return "break";
2966
+ working = false;
2946
2967
  }
2947
2968
  };
2948
2969
 
2949
- while (true) {
2950
- var _ret4 = _loop4();
2951
-
2952
- if (_ret4 === "break") break;
2970
+ while (working) {
2971
+ _loop4();
2953
2972
  }
2954
2973
 
2955
2974
  if (changes) {
@@ -3040,6 +3059,10 @@
3040
3059
 
3041
3060
  _this.scrollLeft = 0;
3042
3061
  _this.optionsList = new OptionsList(_this.table, "column definition", defaultColumnOptions);
3062
+ _this.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing
3063
+
3064
+ _this.redrawBlockUpdate = null; //store latest redraw update only status
3065
+
3043
3066
  _this.renderer = null;
3044
3067
  return _this;
3045
3068
  } ////////////// Setup Functions /////////////////
@@ -3060,7 +3083,7 @@
3060
3083
  var renderClass;
3061
3084
  var renderers = {
3062
3085
  "virtual": VirtualDomHorizontal,
3063
- "basic": BaiscHorizontal
3086
+ "basic": BasicHorizontal
3064
3087
  };
3065
3088
 
3066
3089
  if (typeof this.table.options.renderHorizontal === "string") {
@@ -3073,7 +3096,7 @@
3073
3096
  this.renderer = new renderClass(this.table, this.element, this.tableElement);
3074
3097
  this.renderer.initialize();
3075
3098
  } else {
3076
- console.error("Unable to find matching renderer:", table.options.renderHorizontal);
3099
+ console.error("Unable to find matching renderer:", this.table.options.renderHorizontal);
3077
3100
  }
3078
3101
  }
3079
3102
  }, {
@@ -3238,7 +3261,7 @@
3238
3261
  this._reIndexColumns();
3239
3262
 
3240
3263
  this.dispatch("columns-loaded");
3241
- this.renderer.rerenderColumns(false, true);
3264
+ this.rerenderColumns(false, true);
3242
3265
  this.redraw(true);
3243
3266
  }
3244
3267
  }, {
@@ -3300,24 +3323,30 @@
3300
3323
  var _this3 = this;
3301
3324
 
3302
3325
  var minHeight = 0;
3303
- this.columns.forEach(function (column) {
3304
- var height;
3305
- column.clearVerticalAlign();
3306
- height = column.getHeight();
3307
3326
 
3308
- if (height > minHeight) {
3309
- minHeight = height;
3310
- }
3311
- });
3312
- this.columns.forEach(function (column) {
3313
- column.verticalAlign(_this3.table.options.columnHeaderVertAlign, minHeight);
3314
- });
3315
- this.table.rowManager.adjustTableSize();
3327
+ if (!this.redrawBlock) {
3328
+ this.columns.forEach(function (column) {
3329
+ column.clearVerticalAlign();
3330
+ });
3331
+ this.columns.forEach(function (column) {
3332
+ var height = column.getHeight();
3333
+
3334
+ if (height > minHeight) {
3335
+ minHeight = height;
3336
+ }
3337
+ });
3338
+ this.columns.forEach(function (column) {
3339
+ column.verticalAlign(_this3.table.options.columnHeaderVertAlign, minHeight);
3340
+ });
3341
+ this.table.rowManager.adjustTableSize();
3342
+ }
3316
3343
  } //////////////// Column Details /////////////////
3317
3344
 
3318
3345
  }, {
3319
3346
  key: "findColumn",
3320
3347
  value: function findColumn(subject) {
3348
+ var columns;
3349
+
3321
3350
  if (_typeof(subject) == "object") {
3322
3351
  if (subject instanceof Column) {
3323
3352
  //subject is column element
@@ -3326,8 +3355,13 @@
3326
3355
  //subject is public column component
3327
3356
  return subject._getSelf() || false;
3328
3357
  } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) {
3329
- //subject is a HTML element of the column header
3330
- var match = this.columns.find(function (column) {
3358
+ columns = [];
3359
+ this.columns.forEach(function (column) {
3360
+ columns.push(column);
3361
+ columns = columns.concat(column.getColumns(true));
3362
+ }); //subject is a HTML element of the column header
3363
+
3364
+ var match = columns.find(function (column) {
3331
3365
  return column.element === subject;
3332
3366
  });
3333
3367
  return match || false;
@@ -3367,7 +3401,7 @@
3367
3401
  }
3368
3402
  }, {
3369
3403
  key: "getFirstVisibleColumn",
3370
- value: function getFirstVisibleColumn(index) {
3404
+ value: function getFirstVisibleColumn() {
3371
3405
  var index = this.columnsByIndex.findIndex(function (col) {
3372
3406
  return col.visible;
3373
3407
  });
@@ -3390,7 +3424,7 @@
3390
3424
  key: "getRealColumns",
3391
3425
  value: function getRealColumns() {
3392
3426
  return this.columnsByIndex;
3393
- } //travers across columns and call action
3427
+ } //traverse across columns and call action
3394
3428
 
3395
3429
  }, {
3396
3430
  key: "traverse",
@@ -3398,7 +3432,7 @@
3398
3432
  this.columnsByIndex.forEach(function (column, i) {
3399
3433
  callback(column, i);
3400
3434
  });
3401
- } //get defintions of actual columns
3435
+ } //get definitions of actual columns
3402
3436
 
3403
3437
  }, {
3404
3438
  key: "getDefinitions",
@@ -3466,7 +3500,7 @@
3466
3500
 
3467
3501
  this._moveColumnInArray(this.columnsByIndex, from, to, after, true);
3468
3502
 
3469
- this.renderer.rerenderColumns(true);
3503
+ this.rerenderColumns(true);
3470
3504
  this.dispatch("column-moved", from, to, after);
3471
3505
 
3472
3506
  if (this.subscribedExternal("columnMoved")) {
@@ -3625,7 +3659,7 @@
3625
3659
 
3626
3660
  _this6.table.rowManager.reinitialize();
3627
3661
 
3628
- _this6.renderer.rerenderColumns();
3662
+ _this6.rerenderColumns();
3629
3663
 
3630
3664
  resolve(column);
3631
3665
  });
@@ -3657,6 +3691,30 @@
3657
3691
 
3658
3692
  this.verticalAlignHeaders();
3659
3693
  this.redraw();
3694
+ }
3695
+ }, {
3696
+ key: "rerenderColumns",
3697
+ value: function rerenderColumns(update, silent) {
3698
+ if (!this.redrawBlock) {
3699
+ this.renderer.rerenderColumns(update, silent);
3700
+ } else {
3701
+ if (update === false || update === true && this.redrawBlockUpdate === null) {
3702
+ this.redrawBlockUpdate = update;
3703
+ }
3704
+ }
3705
+ }
3706
+ }, {
3707
+ key: "blockRedraw",
3708
+ value: function blockRedraw() {
3709
+ this.redrawBlock = true;
3710
+ this.redrawBlockUpdate = null;
3711
+ }
3712
+ }, {
3713
+ key: "restoreRedraw",
3714
+ value: function restoreRedraw() {
3715
+ this.redrawBlock = false;
3716
+ this.verticalAlignHeaders();
3717
+ this.renderer.rerenderColumns(this.redrawBlockUpdate);
3660
3718
  } //redraw columns
3661
3719
 
3662
3720
  }, {
@@ -3672,7 +3730,7 @@
3672
3730
  }
3673
3731
 
3674
3732
  if (!this.confirm("table-redrawing", force)) {
3675
- this.layoutRefresh();
3733
+ this.layoutRefresh(force);
3676
3734
  }
3677
3735
 
3678
3736
  this.dispatch("table-redraw", force);
@@ -3684,7 +3742,7 @@
3684
3742
  }(CoreFeature);
3685
3743
 
3686
3744
  //public row object
3687
- var RowComponent$1 = /*#__PURE__*/function () {
3745
+ var RowComponent = /*#__PURE__*/function () {
3688
3746
  function RowComponent(row) {
3689
3747
  _classCallCheck(this, RowComponent);
3690
3748
 
@@ -3735,8 +3793,13 @@
3735
3793
  }
3736
3794
  }, {
3737
3795
  key: "getPosition",
3738
- value: function getPosition(active) {
3739
- return this._row.table.rowManager.getRowPosition(this._row, active);
3796
+ value: function getPosition() {
3797
+ return this._row.getPosition();
3798
+ }
3799
+ }, {
3800
+ key: "watchPosition",
3801
+ value: function watchPosition(callback) {
3802
+ return this._row.watchPosition(callback);
3740
3803
  }
3741
3804
  }, {
3742
3805
  key: "delete",
@@ -3820,7 +3883,7 @@
3820
3883
  _this.cells = [];
3821
3884
  _this.height = 0; //hold element height
3822
3885
 
3823
- _this.heightStyled = ""; //hold element height prestyled to improve render efficiency
3886
+ _this.heightStyled = ""; //hold element height pre-styled to improve render efficiency
3824
3887
 
3825
3888
  _this.manualHeight = false; //user has manually set row height
3826
3889
 
@@ -3830,6 +3893,9 @@
3830
3893
 
3831
3894
  _this.heightInitialized = false; //element has resized cells to fit
3832
3895
 
3896
+ _this.position = 0; //store position of element in row list
3897
+
3898
+ _this.positionWatchers = [];
3833
3899
  _this.component = null;
3834
3900
  _this.created = false;
3835
3901
 
@@ -4075,8 +4141,8 @@
4075
4141
  _this2.dispatch("row-data-save-after", _this2); //update affected cells only
4076
4142
 
4077
4143
 
4078
- for (var attrname in updatedData) {
4079
- var columns = _this2.table.columnManager.getColumnsByFieldRoot(attrname);
4144
+ for (var _attrname in updatedData) {
4145
+ var columns = _this2.table.columnManager.getColumnsByFieldRoot(_attrname);
4080
4146
 
4081
4147
  columns.forEach(function (column) {
4082
4148
  var cell = _this2.getCell(column.getField());
@@ -4202,8 +4268,7 @@
4202
4268
  }, {
4203
4269
  key: "deleteActual",
4204
4270
  value: function deleteActual(blockRedraw) {
4205
- var index = this.table.rowManager.getRowIndex(this);
4206
- this.detatchModules();
4271
+ this.detachModules();
4207
4272
  this.table.rowManager.deleteRow(this, blockRedraw);
4208
4273
  this.deleteCells();
4209
4274
  this.initialized = false;
@@ -4212,8 +4277,8 @@
4212
4277
  this.dispatch("row-deleted", this);
4213
4278
  }
4214
4279
  }, {
4215
- key: "detatchModules",
4216
- value: function detatchModules() {
4280
+ key: "detachModules",
4281
+ value: function detachModules() {
4217
4282
  this.dispatch("row-deleting", this);
4218
4283
  }
4219
4284
  }, {
@@ -4228,7 +4293,7 @@
4228
4293
  }, {
4229
4294
  key: "wipe",
4230
4295
  value: function wipe() {
4231
- this.detatchModules();
4296
+ this.detachModules();
4232
4297
  this.deleteCells();
4233
4298
 
4234
4299
  if (this.element) {
@@ -4244,6 +4309,34 @@
4244
4309
  this.element = false;
4245
4310
  this.modules = {};
4246
4311
  }
4312
+ }, {
4313
+ key: "isDisplayed",
4314
+ value: function isDisplayed() {
4315
+ return this.table.rowManager.getDisplayRows().includes(this);
4316
+ }
4317
+ }, {
4318
+ key: "getPosition",
4319
+ value: function getPosition() {
4320
+ return this.isDisplayed() ? this.position : false;
4321
+ }
4322
+ }, {
4323
+ key: "setPosition",
4324
+ value: function setPosition(position) {
4325
+ var _this3 = this;
4326
+
4327
+ if (position != this.position) {
4328
+ this.position = position;
4329
+ this.positionWatchers.forEach(function (callback) {
4330
+ callback(_this3.position);
4331
+ });
4332
+ }
4333
+ }
4334
+ }, {
4335
+ key: "watchPosition",
4336
+ value: function watchPosition(callback) {
4337
+ this.positionWatchers.push(callback);
4338
+ callback(this.position);
4339
+ }
4247
4340
  }, {
4248
4341
  key: "getGroup",
4249
4342
  value: function getGroup() {
@@ -4254,7 +4347,7 @@
4254
4347
  key: "getComponent",
4255
4348
  value: function getComponent() {
4256
4349
  if (!this.component) {
4257
- this.component = new RowComponent$1(this);
4350
+ this.component = new RowComponent(this);
4258
4351
  }
4259
4352
 
4260
4353
  return this.component;
@@ -4264,15 +4357,15 @@
4264
4357
  return Row;
4265
4358
  }(CoreFeature);
4266
4359
 
4267
- var BaiscVertical = /*#__PURE__*/function (_Renderer) {
4268
- _inherits(BaiscVertical, _Renderer);
4360
+ var BasicVertical = /*#__PURE__*/function (_Renderer) {
4361
+ _inherits(BasicVertical, _Renderer);
4269
4362
 
4270
- var _super = _createSuper(BaiscVertical);
4363
+ var _super = _createSuper(BasicVertical);
4271
4364
 
4272
- function BaiscVertical(table) {
4365
+ function BasicVertical(table) {
4273
4366
  var _this;
4274
4367
 
4275
- _classCallCheck(this, BaiscVertical);
4368
+ _classCallCheck(this, BasicVertical);
4276
4369
 
4277
4370
  _this = _super.call(this, table);
4278
4371
  _this.verticalFillMode = "fill";
@@ -4283,7 +4376,7 @@
4283
4376
  return _this;
4284
4377
  }
4285
4378
 
4286
- _createClass(BaiscVertical, [{
4379
+ _createClass(BasicVertical, [{
4287
4380
  key: "clearRows",
4288
4381
  value: function clearRows() {
4289
4382
  var element = this.tableElement; // element.children.detach();
@@ -4352,7 +4445,7 @@
4352
4445
  }
4353
4446
  }]);
4354
4447
 
4355
- return BaiscVertical;
4448
+ return BasicVertical;
4356
4449
  }(Renderer);
4357
4450
 
4358
4451
  var VirtualDomVertical = /*#__PURE__*/function (_Renderer) {
@@ -4373,7 +4466,7 @@
4373
4466
 
4374
4467
  _this.vDomTop = 0; //hold position for first rendered row in the virtual DOM
4375
4468
 
4376
- _this.vDomBottom = 0; //hold possition for last rendered row in the virtual DOM
4469
+ _this.vDomBottom = 0; //hold position for last rendered row in the virtual DOM
4377
4470
 
4378
4471
  _this.vDomScrollPosTop = 0; //last scroll position of the vDom top;
4379
4472
 
@@ -4462,7 +4555,13 @@
4462
4555
  callback();
4463
4556
  }
4464
4557
 
4465
- this._virtualRenderFill(topRow === false ? this.rows.length - 1 : topRow, true, topOffset || 0);
4558
+ if (this.rows().length) {
4559
+ this._virtualRenderFill(topRow === false ? this.rows.length - 1 : topRow, true, topOffset || 0);
4560
+ } else {
4561
+ this.clear();
4562
+
4563
+ this.table.rowManager._showPlaceholder();
4564
+ }
4466
4565
 
4467
4566
  this.scrollColumns(left);
4468
4567
  }
@@ -4656,7 +4755,7 @@
4656
4755
  }
4657
4756
 
4658
4757
  if (!position) {
4659
- this.vDomTopPad = 0; //adjust rowheight to match average of rendered elements
4758
+ this.vDomTopPad = 0; //adjust row height to match average of rendered elements
4660
4759
 
4661
4760
  this.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);
4662
4761
  this.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom - 1);
@@ -4692,9 +4791,10 @@
4692
4791
  addedRows = [],
4693
4792
  paddingAdjust = 0,
4694
4793
  index = this.vDomTop - 1,
4695
- i = 0;
4794
+ i = 0,
4795
+ working = true;
4696
4796
 
4697
- while (true) {
4797
+ while (working) {
4698
4798
  if (this.vDomTop) {
4699
4799
  var row = rows[index],
4700
4800
  rowHeight = void 0,
@@ -4728,13 +4828,13 @@
4728
4828
  index--;
4729
4829
  i++;
4730
4830
  } else {
4731
- break;
4831
+ working = false;
4732
4832
  }
4733
4833
  } else {
4734
- break;
4834
+ working = false;
4735
4835
  }
4736
4836
  } else {
4737
- break;
4837
+ working = false;
4738
4838
  }
4739
4839
  }
4740
4840
 
@@ -4766,9 +4866,10 @@
4766
4866
  value: function _removeTopRow(rows, fillableSpace) {
4767
4867
  var removableRows = [],
4768
4868
  paddingAdjust = 0,
4769
- i = 0;
4869
+ i = 0,
4870
+ working = true;
4770
4871
 
4771
- while (true) {
4872
+ while (working) {
4772
4873
  var row = rows[this.vDomTop],
4773
4874
  rowHeight = void 0;
4774
4875
 
@@ -4782,10 +4883,10 @@
4782
4883
  removableRows.push(row);
4783
4884
  i++;
4784
4885
  } else {
4785
- break;
4886
+ working = false;
4786
4887
  }
4787
4888
  } else {
4788
- break;
4889
+ working = false;
4789
4890
  }
4790
4891
  }
4791
4892
 
@@ -4812,9 +4913,10 @@
4812
4913
  addedRows = [],
4813
4914
  paddingAdjust = 0,
4814
4915
  index = this.vDomBottom + 1,
4815
- i = 0;
4916
+ i = 0,
4917
+ working = true;
4816
4918
 
4817
- while (true) {
4919
+ while (working) {
4818
4920
  var row = rows[index],
4819
4921
  rowHeight = void 0,
4820
4922
  initialized = void 0;
@@ -4847,10 +4949,10 @@
4847
4949
  index++;
4848
4950
  i++;
4849
4951
  } else {
4850
- break;
4952
+ working = false;
4851
4953
  }
4852
4954
  } else {
4853
- break;
4955
+ working = false;
4854
4956
  }
4855
4957
  }
4856
4958
 
@@ -4878,9 +4980,10 @@
4878
4980
  value: function _removeBottomRow(rows, fillableSpace) {
4879
4981
  var removableRows = [],
4880
4982
  paddingAdjust = 0,
4881
- i = 0;
4983
+ i = 0,
4984
+ working = true;
4882
4985
 
4883
- while (true) {
4986
+ while (working) {
4884
4987
  var row = rows[this.vDomBottom],
4885
4988
  rowHeight = void 0;
4886
4989
 
@@ -4894,10 +4997,10 @@
4894
4997
  removableRows.push(row);
4895
4998
  i++;
4896
4999
  } else {
4897
- break;
5000
+ working = false;
4898
5001
  }
4899
5002
  } else {
4900
- break;
5003
+ working = false;
4901
5004
  }
4902
5005
  }
4903
5006
 
@@ -5000,8 +5103,6 @@
5000
5103
 
5001
5104
  _this.scrollTop = 0;
5002
5105
  _this.scrollLeft = 0;
5003
- _this.rowNumColumn = false; //hold column component for row number column
5004
-
5005
5106
  _this.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing
5006
5107
 
5007
5108
  _this.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed
@@ -5060,16 +5161,6 @@
5060
5161
  key: "getTableElement",
5061
5162
  value: function getTableElement() {
5062
5163
  return this.tableElement;
5063
- } //return position of row in table
5064
-
5065
- }, {
5066
- key: "getRowPosition",
5067
- value: function getRowPosition(row, active) {
5068
- if (active) {
5069
- return this.activeRows.indexOf(row);
5070
- } else {
5071
- return this.rows.indexOf(row);
5072
- }
5073
5164
  }
5074
5165
  }, {
5075
5166
  key: "initialize",
@@ -5120,7 +5211,7 @@
5120
5211
  if (subject instanceof Row) {
5121
5212
  //subject is row element
5122
5213
  return subject;
5123
- } else if (subject instanceof RowComponent$1) {
5214
+ } else if (subject instanceof RowComponent) {
5124
5215
  //subject is public row component
5125
5216
  return subject._getSelf() || false;
5126
5217
  } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) {
@@ -5129,8 +5220,10 @@
5129
5220
  return row.getElement() === subject;
5130
5221
  });
5131
5222
  return match || false;
5223
+ } else if (subject === null) {
5224
+ return false;
5132
5225
  }
5133
- } else if (typeof subject == "undefined" || subject === null) {
5226
+ } else if (typeof subject == "undefined") {
5134
5227
  return false;
5135
5228
  } else {
5136
5229
  //subject should be treated as the index of the row
@@ -5154,12 +5247,10 @@
5154
5247
  }
5155
5248
  }, {
5156
5249
  key: "getRowFromPosition",
5157
- value: function getRowFromPosition(position, active) {
5158
- if (active) {
5159
- return this.activeRows[position];
5160
- } else {
5161
- return this.rows[position];
5162
- }
5250
+ value: function getRowFromPosition(position) {
5251
+ return this.getDisplayRows().find(function (row) {
5252
+ return row.getPosition() === position && row.isDisplayed();
5253
+ });
5163
5254
  }
5164
5255
  }, {
5165
5256
  key: "scrollToRow",
@@ -5263,7 +5354,7 @@
5263
5354
  this.reRenderInPosition();
5264
5355
  }
5265
5356
 
5266
- this.regenerateRowNumbers();
5357
+ this.regenerateRowPositions();
5267
5358
  this.dispatchExternal("rowDeleted", row.getComponent());
5268
5359
 
5269
5360
  if (!this.displayRowsCount) {
@@ -5294,8 +5385,6 @@
5294
5385
  data = [data];
5295
5386
  }
5296
5387
 
5297
- data.length - 1;
5298
-
5299
5388
  if (typeof index == "undefined" && pos || typeof index !== "undefined" && !pos) {
5300
5389
  data.reverse();
5301
5390
  }
@@ -5310,7 +5399,7 @@
5310
5399
 
5311
5400
  _this6.refreshActiveData(false, false, true);
5312
5401
 
5313
- _this6.regenerateRowNumbers();
5402
+ _this6.regenerateRowPositions();
5314
5403
 
5315
5404
  if (rows.length) {
5316
5405
  _this6._clearPlaceholder();
@@ -5413,7 +5502,7 @@
5413
5502
  value: function moveRow(from, to, after) {
5414
5503
  this.dispatch("row-move", from, to, after);
5415
5504
  this.moveRowActual(from, to, after);
5416
- this.regenerateRowNumbers();
5505
+ this.regenerateRowPositions();
5417
5506
  this.dispatch("row-moved", from, to, after);
5418
5507
  this.dispatchExternal("rowMoved", from.getComponent());
5419
5508
  }
@@ -5690,7 +5779,7 @@
5690
5779
 
5691
5780
 
5692
5781
  switch (stage) {
5693
- case "all": //handle case where alldata needs refreshing
5782
+ case "all": //handle case where all data needs refreshing
5694
5783
 
5695
5784
  case "dataPipeline":
5696
5785
  for (var i = index; i < this.dataPipeline.length; i++) {
@@ -5699,7 +5788,6 @@
5699
5788
  }
5700
5789
 
5701
5790
  this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);
5702
- this.regenerateRowNumbers();
5703
5791
 
5704
5792
  case "display":
5705
5793
  index = 0;
@@ -5712,23 +5800,23 @@
5712
5800
  this.setDisplayRows(_result || this.getDisplayRows(_i - 1).slice(0), _i);
5713
5801
  }
5714
5802
 
5803
+ case "end":
5804
+ //case to handle scenario when trying to skip past end stage
5805
+ this.regenerateRowPositions();
5715
5806
  }
5716
- } //regenerate row numbers for row number formatter if in use
5807
+ } //regenerate row positions
5717
5808
 
5718
5809
  }, {
5719
- key: "regenerateRowNumbers",
5720
- value: function regenerateRowNumbers() {
5721
- var _this8 = this;
5722
-
5723
- if (this.rowNumColumn) {
5724
- this.activeRows.forEach(function (row) {
5725
- var cell = row.getCell(_this8.rowNumColumn);
5726
-
5727
- if (cell) {
5728
- cell._generateContents();
5729
- }
5730
- });
5731
- }
5810
+ key: "regenerateRowPositions",
5811
+ value: function regenerateRowPositions() {
5812
+ var rows = this.getDisplayRows();
5813
+ var index = 1;
5814
+ rows.forEach(function (row) {
5815
+ if (row.type === "row") {
5816
+ row.setPosition(index);
5817
+ index++;
5818
+ }
5819
+ });
5732
5820
  }
5733
5821
  }, {
5734
5822
  key: "setActiveRows",
@@ -5788,7 +5876,7 @@
5788
5876
  }
5789
5877
 
5790
5878
  return rows;
5791
- } //repeat action accross display rows
5879
+ } //repeat action across display rows
5792
5880
 
5793
5881
  }, {
5794
5882
  key: "displayRowIterator",
@@ -5836,6 +5924,11 @@
5836
5924
  } else {
5837
5925
  this.dispatchExternal("renderStarted");
5838
5926
  this.renderer.rerenderRows(callback);
5927
+
5928
+ if (!this.fixedHeight) {
5929
+ this.adjustTableSize();
5930
+ }
5931
+
5839
5932
  this.dispatchExternal("renderComplete");
5840
5933
  }
5841
5934
  }
@@ -5845,7 +5938,7 @@
5845
5938
  var renderClass;
5846
5939
  var renderers = {
5847
5940
  "virtual": VirtualDomVertical,
5848
- "basic": BaiscVertical
5941
+ "basic": BasicVertical
5849
5942
  };
5850
5943
 
5851
5944
  if (typeof this.table.options.renderVertical === "string") {
@@ -5855,6 +5948,7 @@
5855
5948
  }
5856
5949
 
5857
5950
  if (renderClass) {
5951
+ this.renderMode = this.table.options.renderVertical;
5858
5952
  this.renderer = new renderClass(this.table, this.element, this.tableElement);
5859
5953
  this.renderer.initialize();
5860
5954
 
@@ -5864,7 +5958,7 @@
5864
5958
  this.fixedHeight = false;
5865
5959
  }
5866
5960
  } else {
5867
- console.error("Unable to find matching renderer:", table.options.renderVertical);
5961
+ console.error("Unable to find matching renderer:", this.table.options.renderVertical);
5868
5962
  }
5869
5963
  }
5870
5964
  }, {
@@ -5885,7 +5979,7 @@
5885
5979
 
5886
5980
  if (this.firstRender) {
5887
5981
  this.firstRender = false;
5888
- this.layoutRefresh();
5982
+ this.layoutRefresh(true);
5889
5983
  }
5890
5984
  } else {
5891
5985
  this.renderEmptyScroll();
@@ -5917,12 +6011,12 @@
5917
6011
  }, {
5918
6012
  key: "_clearTable",
5919
6013
  value: function _clearTable() {
5920
- var element = this.tableElement;
5921
-
5922
6014
  this._clearPlaceholder();
5923
6015
 
5924
6016
  this.scrollTop = 0;
5925
- this.scrollLeft = 0;
6017
+ this.scrollLeft = 0; // clear empty table placeholder min
6018
+
6019
+ this.tableElement.style.minWidth = "";
5926
6020
  this.renderer.clearRows();
5927
6021
  }
5928
6022
  }, {
@@ -5976,13 +6070,15 @@
5976
6070
  }, {
5977
6071
  key: "adjustTableSize",
5978
6072
  value: function adjustTableSize() {
5979
- var initialHeight = this.element.clientHeight;
6073
+ var initialHeight = this.element.clientHeight,
6074
+ minHeight;
5980
6075
 
5981
6076
  if (this.renderer.verticalFillMode === "fill") {
5982
6077
  var 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));
5983
6078
 
5984
6079
  if (this.fixedHeight) {
5985
- this.element.style.minHeight = "calc(100% - " + otherHeight + "px)";
6080
+ minHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + "px";
6081
+ this.element.style.minHeight = minHeight || "calc(100% - " + otherHeight + "px)";
5986
6082
  this.element.style.height = "calc(100% - " + otherHeight + "px)";
5987
6083
  this.element.style.maxHeight = "calc(100% - " + otherHeight + "px)";
5988
6084
  } else {
@@ -6003,7 +6099,7 @@
6003
6099
  }
6004
6100
 
6005
6101
  this._positionPlaceholder();
6006
- } //renitialize all rows
6102
+ } //reinitialize all rows
6007
6103
 
6008
6104
  }, {
6009
6105
  key: "reinitialize",
@@ -6420,7 +6516,10 @@
6420
6516
  try {
6421
6517
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
6422
6518
  var target = _step3.value;
6423
- targets[this.componentMap[target]] = el;
6519
+
6520
+ if (!targets[this.componentMap[target]]) {
6521
+ targets[this.componentMap[target]] = el;
6522
+ }
6424
6523
  }
6425
6524
  } catch (err) {
6426
6525
  _iterator3.e(err);
@@ -6579,7 +6678,9 @@
6579
6678
  return this.bindings[type][name].bind(null, component);
6580
6679
  } else {
6581
6680
  if (name !== "then" && typeof name === "string" && !name.startsWith("_")) {
6582
- console.error("The " + type + " component does not have a " + name + " function, have you checked that you have the correct Tabulator module installed?");
6681
+ if (this.table.options.debugInvalidComponentFuncs) {
6682
+ console.error("The " + type + " component does not have a " + name + " function, have you checked that you have the correct Tabulator module installed?");
6683
+ }
6583
6684
  }
6584
6685
  }
6585
6686
  }
@@ -6748,7 +6849,7 @@
6748
6849
  this.subscriptionNotifiers[key].push(callback);
6749
6850
 
6750
6851
  if (this.subscribed(key)) {
6751
- this._notifiySubscriptionChange(key, true);
6852
+ this._notifySubscriptionChange(key, true);
6752
6853
  }
6753
6854
  }
6754
6855
  }, {
@@ -6760,7 +6861,7 @@
6760
6861
 
6761
6862
  this.events[key].push(callback);
6762
6863
 
6763
- this._notifiySubscriptionChange(key, true);
6864
+ this._notifySubscriptionChange(key, true);
6764
6865
  }
6765
6866
  }, {
6766
6867
  key: "unsubscribe",
@@ -6787,7 +6888,7 @@
6787
6888
  return;
6788
6889
  }
6789
6890
 
6790
- this._notifiySubscriptionChange(key, false);
6891
+ this._notifySubscriptionChange(key, false);
6791
6892
  }
6792
6893
  }, {
6793
6894
  key: "subscribed",
@@ -6795,8 +6896,8 @@
6795
6896
  return this.events[key] && this.events[key].length;
6796
6897
  }
6797
6898
  }, {
6798
- key: "_notifiySubscriptionChange",
6799
- value: function _notifiySubscriptionChange(key, subscribed) {
6899
+ key: "_notifySubscriptionChange",
6900
+ value: function _notifySubscriptionChange(key, subscribed) {
6800
6901
  var notifiers = this.subscriptionNotifiers[key];
6801
6902
 
6802
6903
  if (notifiers) {
@@ -6868,7 +6969,7 @@
6868
6969
  this.subscriptionNotifiers[key].push(callback);
6869
6970
 
6870
6971
  if (this.subscribed(key)) {
6871
- this._notifiySubscriptionChange(key, true);
6972
+ this._notifySubscriptionChange(key, true);
6872
6973
  }
6873
6974
  }
6874
6975
  }, {
@@ -6888,7 +6989,7 @@
6888
6989
  return a.priority - b.priority;
6889
6990
  });
6890
6991
 
6891
- this._notifiySubscriptionChange(key, true);
6992
+ this._notifySubscriptionChange(key, true);
6892
6993
  }
6893
6994
  }, {
6894
6995
  key: "unsubscribe",
@@ -6913,7 +7014,7 @@
6913
7014
  return;
6914
7015
  }
6915
7016
 
6916
- this._notifiySubscriptionChange(key, false);
7017
+ this._notifySubscriptionChange(key, false);
6917
7018
  }
6918
7019
  }, {
6919
7020
  key: "subscribed",
@@ -6962,8 +7063,8 @@
6962
7063
  return confirmed;
6963
7064
  }
6964
7065
  }, {
6965
- key: "_notifiySubscriptionChange",
6966
- value: function _notifiySubscriptionChange(key, subscribed) {
7066
+ key: "_notifySubscriptionChange",
7067
+ value: function _notifySubscriptionChange(key, subscribed) {
6967
7068
  var notifiers = this.subscriptionNotifiers[key];
6968
7069
 
6969
7070
  if (notifiers) {
@@ -6982,7 +7083,7 @@
6982
7083
 
6983
7084
  if (this.events[key]) {
6984
7085
  this.events[key].forEach(function (subscriber) {
6985
- var callResult = subscriber.callback.apply(_this3, args);
7086
+ subscriber.callback.apply(_this3, args);
6986
7087
  });
6987
7088
  }
6988
7089
  }
@@ -7036,6 +7137,68 @@
7036
7137
  return InternalEventBus;
7037
7138
  }();
7038
7139
 
7140
+ var DeprecationAdvisor = /*#__PURE__*/function (_CoreFeature) {
7141
+ _inherits(DeprecationAdvisor, _CoreFeature);
7142
+
7143
+ var _super = _createSuper(DeprecationAdvisor);
7144
+
7145
+ function DeprecationAdvisor(table) {
7146
+ _classCallCheck(this, DeprecationAdvisor);
7147
+
7148
+ return _super.call(this, table);
7149
+ }
7150
+
7151
+ _createClass(DeprecationAdvisor, [{
7152
+ key: "_warnUser",
7153
+ value: function _warnUser() {
7154
+ if (this.options("debugDeprecation")) {
7155
+ var _console;
7156
+
7157
+ (_console = console).warn.apply(_console, arguments);
7158
+ }
7159
+ }
7160
+ }, {
7161
+ key: "check",
7162
+ value: function check(oldOption, newOption) {
7163
+ var msg = "";
7164
+
7165
+ if (typeof this.options(oldOption) !== "undefined") {
7166
+ msg = "Deprecated Setup Option - Use of the %c" + oldOption + "%c option is now deprecated";
7167
+
7168
+ if (newOption) {
7169
+ msg = msg + ", Please use the %c" + newOption + "%c option instead";
7170
+
7171
+ this._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');
7172
+ } else {
7173
+ this._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');
7174
+ }
7175
+
7176
+ return false;
7177
+ } else {
7178
+ return true;
7179
+ }
7180
+ }
7181
+ }, {
7182
+ key: "checkMsg",
7183
+ value: function checkMsg(oldOption, msg) {
7184
+ if (typeof this.options(oldOption) !== "undefined") {
7185
+ this._warnUser("%cDeprecated Setup Option - Use of the %c" + oldOption + " %c option is now deprecated, " + msg, 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');
7186
+
7187
+ return false;
7188
+ } else {
7189
+ return true;
7190
+ }
7191
+ }
7192
+ }, {
7193
+ key: "msg",
7194
+ value: function msg(_msg) {
7195
+ this._warnUser(_msg);
7196
+ }
7197
+ }]);
7198
+
7199
+ return DeprecationAdvisor;
7200
+ }(CoreFeature);
7201
+
7039
7202
  var TableRegistry = /*#__PURE__*/function () {
7040
7203
  function TableRegistry() {
7041
7204
  _classCallCheck(this, TableRegistry);
@@ -7126,16 +7289,24 @@
7126
7289
  _this.blurCallback = null;
7127
7290
  _this.renderedCallback = null;
7128
7291
  _this.visible = false;
7292
+ _this.hideable = true;
7129
7293
 
7130
7294
  _this.element.classList.add("tabulator-popup-container");
7131
7295
 
7132
7296
  _this.blurEvent = _this.hide.bind(_assertThisInitialized(_this), false);
7133
7297
  _this.escEvent = _this._escapeCheck.bind(_assertThisInitialized(_this));
7134
- _this.destroyBinding = _this.hide.bind(_assertThisInitialized(_this), true);
7298
+ _this.destroyBinding = _this.tableDestroyed;
7299
+ _this.destroyed = false;
7135
7300
  return _this;
7136
7301
  }
7137
7302
 
7138
7303
  _createClass(Popup, [{
7304
+ key: "tableDestroyed",
7305
+ value: function tableDestroyed() {
7306
+ this.destroyed = true;
7307
+ this.hide(true);
7308
+ }
7309
+ }, {
7139
7310
  key: "_lookupContainer",
7140
7311
  value: function _lookupContainer() {
7141
7312
  var container = this.table.options.popupContainer;
@@ -7233,6 +7404,10 @@
7233
7404
  value: function show(origin, position) {
7234
7405
  var x, y, parentEl, parentOffset, coords;
7235
7406
 
7407
+ if (this.destroyed || this.table.destroyed) {
7408
+ return this;
7409
+ }
7410
+
7236
7411
  if (origin instanceof HTMLElement) {
7237
7412
  parentEl = origin;
7238
7413
  coords = this.elementPositionCoords(origin, position);
@@ -7265,6 +7440,9 @@
7265
7440
 
7266
7441
  this.visible = true;
7267
7442
  this.subscribe("table-destroy", this.destroyBinding);
7443
+ this.element.addEventListener("mousedown", function (e) {
7444
+ e.stopPropagation();
7445
+ });
7268
7446
  return this;
7269
7447
  }
7270
7448
  }, {
@@ -7320,6 +7498,7 @@
7320
7498
 
7321
7499
  document.body.addEventListener("click", _this2.blurEvent);
7322
7500
  document.body.addEventListener("contextmenu", _this2.blurEvent);
7501
+ document.body.addEventListener("mousedown", _this2.blurEvent);
7323
7502
  window.addEventListener("resize", _this2.blurEvent);
7324
7503
  document.body.addEventListener("keydown", _this2.escEvent);
7325
7504
  }, 100);
@@ -7335,16 +7514,27 @@
7335
7514
  this.hide();
7336
7515
  }
7337
7516
  }
7517
+ }, {
7518
+ key: "blockHide",
7519
+ value: function blockHide() {
7520
+ this.hideable = false;
7521
+ }
7522
+ }, {
7523
+ key: "restoreHide",
7524
+ value: function restoreHide() {
7525
+ this.hideable = true;
7526
+ }
7338
7527
  }, {
7339
7528
  key: "hide",
7340
7529
  value: function hide() {
7341
7530
  var silent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
7342
7531
 
7343
- if (this.visible) {
7532
+ if (this.visible && this.hideable) {
7344
7533
  if (this.blurable) {
7345
7534
  document.body.removeEventListener("keydown", this.escEvent);
7346
7535
  document.body.removeEventListener("click", this.blurEvent);
7347
7536
  document.body.removeEventListener("contextmenu", this.blurEvent);
7537
+ document.body.removeEventListener("mousedown", this.blurEvent);
7348
7538
  window.removeEventListener("resize", this.blurEvent);
7349
7539
  this.table.rowManager.element.removeEventListener("scroll", this.blurEvent);
7350
7540
  this.unsubscribe("cell-editing", this.blurEvent);
@@ -7405,7 +7595,7 @@
7405
7595
 
7406
7596
  _createClass(Module, [{
7407
7597
  key: "initialize",
7408
- value: function initialize() {// setup module when table is initialized, to be overriden in module
7598
+ value: function initialize() {// setup module when table is initialized, to be overridden in module
7409
7599
  } ///////////////////////////////////
7410
7600
  ////// Options Registration ///////
7411
7601
  ///////////////////////////////////
@@ -7514,8 +7704,10 @@
7514
7704
  }(CoreFeature);
7515
7705
 
7516
7706
  //resize columns to fit data they contain
7517
- function fitData (columns) {
7518
- this.table.columnManager.renderer.reinitializeColumnWidths(columns);
7707
+ function fitData (columns, forced) {
7708
+ if (forced) {
7709
+ this.table.columnManager.renderer.reinitializeColumnWidths(columns);
7710
+ }
7519
7711
 
7520
7712
  if (this.table.options.responsiveLayout && this.table.modExists("responsiveLayout", true)) {
7521
7713
  this.table.modules.responsiveLayout.update();
@@ -7523,7 +7715,7 @@
7523
7715
  }
7524
7716
 
7525
7717
  //resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable
7526
- function fitDataGeneral (columns) {
7718
+ function fitDataGeneral (columns, forced) {
7527
7719
  columns.forEach(function (column) {
7528
7720
  column.reinitializeWidth();
7529
7721
  });
@@ -7534,7 +7726,7 @@
7534
7726
  }
7535
7727
 
7536
7728
  //resize columns to fit data the contain and stretch last column to fill table
7537
- function fitDataStretch (columns) {
7729
+ function fitDataStretch (columns, forced) {
7538
7730
  var _this = this;
7539
7731
 
7540
7732
  var colsWidth = 0,
@@ -7576,14 +7768,14 @@
7576
7768
  }
7577
7769
 
7578
7770
  //resize columns to fit
7579
- function fitColumns (columns) {
7580
- var totalWidth = this.table.element.clientWidth; //table element width
7771
+ function fitColumns (columns, forced) {
7772
+ var totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width
7581
7773
 
7582
7774
  var fixedWidth = 0; //total width of columns with a defined width
7583
7775
 
7584
7776
  var flexWidth = 0; //total width available to flexible columns
7585
7777
 
7586
- var flexGrowUnits = 0; //total number of widthGrow blocks accross all columns
7778
+ var flexGrowUnits = 0; //total number of widthGrow blocks across all columns
7587
7779
 
7588
7780
  var flexColWidth = 0; //desired width of flexible columns
7589
7781
 
@@ -7591,7 +7783,7 @@
7591
7783
 
7592
7784
  var fixedShrinkColumns = []; //array of fixed width columns that can shrink
7593
7785
 
7594
- var flexShrinkUnits = 0; //total number of widthShrink blocks accross all columns
7786
+ var flexShrinkUnits = 0; //total number of widthShrink blocks across all columns
7595
7787
 
7596
7788
  var overflowWidth = 0; //horizontal overflow width
7597
7789
 
@@ -7660,8 +7852,7 @@
7660
7852
  });
7661
7853
  remainingSpace = freeSpace - oversizeSpace;
7662
7854
  nextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace;
7663
- gap = remainingSpace - nextColWidth * changeUnits;
7664
- gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);
7855
+ gap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);
7665
7856
  } else {
7666
7857
  gap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace;
7667
7858
  undersizeCols.forEach(function (column) {
@@ -7713,11 +7904,11 @@
7713
7904
 
7714
7905
  flexColWidth = Math.floor(flexWidth / flexGrowUnits); //generate column widths
7715
7906
 
7716
- var gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false); //increase width of last column to account for rounding errors
7907
+ gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false); //increase width of last column to account for rounding errors
7717
7908
 
7718
7909
  if (flexColumns.length && gapFill > 0) {
7719
- flexColumns[flexColumns.length - 1].width += +gapFill;
7720
- } //caculate space for columns to be shrunk into
7910
+ flexColumns[flexColumns.length - 1].width += gapFill;
7911
+ } //calculate space for columns to be shrunk into
7721
7912
 
7722
7913
 
7723
7914
  flexColumns.forEach(function (col) {
@@ -7730,7 +7921,7 @@
7730
7921
  } //decrease width of last column to account for rounding errors
7731
7922
 
7732
7923
 
7733
- if (fixedShrinkColumns.length) {
7924
+ if (gapFill && fixedShrinkColumns.length) {
7734
7925
  fixedShrinkColumns[fixedShrinkColumns.length - 1].width -= gapFill;
7735
7926
  }
7736
7927
 
@@ -7799,9 +7990,9 @@
7799
7990
 
7800
7991
  }, {
7801
7992
  key: "layout",
7802
- value: function layout() {
7993
+ value: function layout(dataChanged) {
7803
7994
  this.dispatch("layout-refreshing");
7804
- Layout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex);
7995
+ Layout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);
7805
7996
  this.dispatch("layout-refreshed");
7806
7997
  }
7807
7998
  }]);
@@ -7895,7 +8086,7 @@
7895
8086
  this.registerTableFunction("setLocale", this.setLocale.bind(this));
7896
8087
  this.registerTableFunction("getLocale", this.getLocale.bind(this));
7897
8088
  this.registerTableFunction("getLang", this.getLang.bind(this));
7898
- } //set header placehoder
8089
+ } //set header placeholder
7899
8090
 
7900
8091
  }, {
7901
8092
  key: "setHeaderFilterPlaceholder",
@@ -7937,7 +8128,7 @@
7937
8128
  }, {
7938
8129
  key: "setLocale",
7939
8130
  value: function setLocale(desiredLocale) {
7940
- desiredLocale = desiredLocale || "default"; //fill in any matching languge values
8131
+ desiredLocale = desiredLocale || "default"; //fill in any matching language values
7941
8132
 
7942
8133
  function traverseLang(trans, path) {
7943
8134
  for (var prop in trans) {
@@ -7951,7 +8142,7 @@
7951
8142
  path[prop] = trans[prop];
7952
8143
  }
7953
8144
  }
7954
- } //determing correct locale to load
8145
+ } //determining correct locale to load
7955
8146
 
7956
8147
 
7957
8148
  if (desiredLocale === true && navigator.language) {
@@ -8002,8 +8193,8 @@
8002
8193
  }, {
8003
8194
  key: "getText",
8004
8195
  value: function getText(path, value) {
8005
- var path = value ? path + "|" + value : path,
8006
- pathArray = path.split("|"),
8196
+ var fillPath = value ? path + "|" + value : path,
8197
+ pathArray = fillPath.split("|"),
8007
8198
  text = this._getLangElement(pathArray, this.locale); // if(text === false){
8008
8199
  // console.warn("Localization Error - Matching localized text not found for given path: ", path);
8009
8200
  // }
@@ -8041,7 +8232,7 @@
8041
8232
 
8042
8233
  this.bindings[path].push(callback);
8043
8234
  callback(this.getText(path), this.lang);
8044
- } //itterate through bindings and trigger updates
8235
+ } //iterate through bindings and trigger updates
8045
8236
 
8046
8237
  }, {
8047
8238
  key: "_executeBindings",
@@ -8139,7 +8330,7 @@
8139
8330
  function ModuleBinder(tabulator, modules) {
8140
8331
  _classCallCheck(this, ModuleBinder);
8141
8332
 
8142
- this.bindStaticFuctionality(tabulator);
8333
+ this.bindStaticFunctionality(tabulator);
8143
8334
  this.bindModules(tabulator, coreModules, true);
8144
8335
 
8145
8336
  if (modules) {
@@ -8148,8 +8339,8 @@
8148
8339
  }
8149
8340
 
8150
8341
  _createClass(ModuleBinder, [{
8151
- key: "bindStaticFuctionality",
8152
- value: function bindStaticFuctionality(tabulator) {
8342
+ key: "bindStaticFunctionality",
8343
+ value: function bindStaticFunctionality(tabulator) {
8153
8344
  tabulator.moduleBindings = {};
8154
8345
 
8155
8346
  tabulator.extendModule = function (name, property, values) {
@@ -8370,8 +8561,10 @@
8370
8561
 
8371
8562
  this.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)
8372
8563
 
8564
+ this.deprecationAdvisor = new DeprecationAdvisor(this);
8373
8565
  this.optionsList = new OptionsList(this, "table constructor");
8374
8566
  this.initialized = false;
8567
+ this.destroyed = false;
8375
8568
 
8376
8569
  if (this.initializeElement(element)) {
8377
8570
  this.initializeCoreSystems(options); //delay table creation to allow event bindings immediately after the constructor
@@ -8598,6 +8791,7 @@
8598
8791
  key: "destroy",
8599
8792
  value: function destroy() {
8600
8793
  var element = this.element;
8794
+ this.destroyed = true;
8601
8795
  TableRegistry.deregister(this); //deregister table from inter-device communication
8602
8796
 
8603
8797
  this.eventBus.dispatch("table-destroy"); //clear row data
@@ -8614,6 +8808,7 @@
8614
8808
  }
8615
8809
 
8616
8810
  element.classList.remove("tabulator");
8811
+ this.externalEvents.dispatch("tableDestroyed");
8617
8812
  }
8618
8813
  }, {
8619
8814
  key: "_detectBrowser",
@@ -8634,7 +8829,7 @@
8634
8829
  this.browserSlow = false;
8635
8830
  }
8636
8831
 
8637
- this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(ua.slice(0, 4));
8832
+ this.browserMobile = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ua.slice(0, 4));
8638
8833
  }
8639
8834
  }, {
8640
8835
  key: "initGuard",
@@ -8664,14 +8859,20 @@
8664
8859
  key: "blockRedraw",
8665
8860
  value: function blockRedraw() {
8666
8861
  this.initGuard();
8667
- return this.rowManager.blockRedraw();
8862
+ this.eventBus.dispatch("redraw-blocking");
8863
+ this.rowManager.blockRedraw();
8864
+ this.columnManager.blockRedraw();
8865
+ this.eventBus.dispatch("redraw-blocked");
8668
8866
  } //restore table redrawing
8669
8867
 
8670
8868
  }, {
8671
8869
  key: "restoreRedraw",
8672
8870
  value: function restoreRedraw() {
8673
8871
  this.initGuard();
8674
- return this.rowManager.restoreRedraw();
8872
+ this.eventBus.dispatch("redraw-restoring");
8873
+ this.rowManager.restoreRedraw();
8874
+ this.columnManager.restoreRedraw();
8875
+ this.eventBus.dispatch("redraw-restored");
8675
8876
  } //load data
8676
8877
 
8677
8878
  }, {
@@ -8834,8 +9035,8 @@
8834
9035
 
8835
9036
  }, {
8836
9037
  key: "getRowFromPosition",
8837
- value: function getRowFromPosition(position, active) {
8838
- var row = this.rowManager.getRowFromPosition(position, active);
9038
+ value: function getRowFromPosition(position) {
9039
+ var row = this.rowManager.getRowFromPosition(position);
8839
9040
 
8840
9041
  if (row) {
8841
9042
  return row.getComponent();
@@ -8871,7 +9072,6 @@
8871
9072
  } else {
8872
9073
  console.error("Delete Error - No matching row found:", item);
8873
9074
  return Promise.reject("Delete Error - No matching row found");
8874
- break;
8875
9075
  }
8876
9076
  } //sort rows into correct order to ensure smooth delete from table
8877
9077
 
@@ -8904,7 +9104,7 @@
8904
9104
  return this.rowManager.addRows(data, pos, index).then(function (rows) {
8905
9105
  return rows[0].getComponent();
8906
9106
  });
8907
- } //update a row if it exitsts otherwise create it
9107
+ } //update a row if it exists otherwise create it
8908
9108
 
8909
9109
  }, {
8910
9110
  key: "updateOrAddRow",
@@ -8979,11 +9179,11 @@
8979
9179
 
8980
9180
  }, {
8981
9181
  key: "getRowPosition",
8982
- value: function getRowPosition(index, active) {
9182
+ value: function getRowPosition(index) {
8983
9183
  var row = this.rowManager.findRow(index);
8984
9184
 
8985
9185
  if (row) {
8986
- return this.rowManager.getRowPosition(row, active);
9186
+ return row.getPosition();
8987
9187
  } else {
8988
9188
  console.warn("Position Error - No matching row found:", index);
8989
9189
  return false;
@@ -9163,8 +9363,8 @@
9163
9363
  value: function dispatchEvent() {
9164
9364
  var _this$externalEvents;
9165
9365
 
9166
- var args = Array.from(arguments),
9167
- key = args.shift();
9366
+ var args = Array.from(arguments);
9367
+ args.shift();
9168
9368
 
9169
9369
  (_this$externalEvents = this.externalEvents).dispatch.apply(_this$externalEvents, arguments);
9170
9370
  } //////////////////// Alerts ///////////////////
@@ -9216,7 +9416,7 @@
9216
9416
 
9217
9417
  new ModuleBinder(Tabulator);
9218
9418
 
9219
- var defautlAccessors = {};
9419
+ var defaultAccessors = {};
9220
9420
 
9221
9421
  var Accessor = /*#__PURE__*/function (_Module) {
9222
9422
  _inherits(Accessor, _Module);
@@ -9324,7 +9524,7 @@
9324
9524
 
9325
9525
  var data = Helpers.deepClone(row.data || {});
9326
9526
  this.table.columnManager.traverse(function (column) {
9327
- var value, accessor, params, colCompnent;
9527
+ var value, accessor, params, colComponent;
9328
9528
 
9329
9529
  if (column.modules.accessor) {
9330
9530
  accessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;
@@ -9333,9 +9533,9 @@
9333
9533
  value = column.getFieldValue(data);
9334
9534
 
9335
9535
  if (value != "undefined") {
9336
- colCompnent = column.getComponent();
9337
- params = typeof accessor.params === "function" ? accessor.params(value, data, type, colCompnent, rowComponent) : accessor.params;
9338
- column.setFieldValue(data, accessor.accessor(value, data, type, params, colCompnent, rowComponent));
9536
+ colComponent = column.getComponent();
9537
+ params = typeof accessor.params === "function" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;
9538
+ column.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));
9339
9539
  }
9340
9540
  }
9341
9541
  }
@@ -9349,7 +9549,7 @@
9349
9549
 
9350
9550
 
9351
9551
  Accessor.moduleName = "accessor";
9352
- Accessor.accessors = defautlAccessors;
9552
+ Accessor.accessors = defaultAccessors;
9353
9553
 
9354
9554
  var defaultConfig = {
9355
9555
  method: "GET"
@@ -9720,7 +9920,7 @@
9720
9920
  });
9721
9921
 
9722
9922
  if (data.length && !(data.length === 1 && data[0].length < 2)) {
9723
-
9923
+ //check if headers are present by title
9724
9924
  data[0].forEach(function (value) {
9725
9925
  var column = columns.find(function (column) {
9726
9926
  return value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();
@@ -9804,7 +10004,7 @@
9804
10004
  _this.registerTableOption("clipboardCopyConfig", false); //clipboard config
9805
10005
 
9806
10006
 
9807
- _this.registerTableOption("clipboardCopyFormatter", false); //DEPRICATED - REMOVE in 5.0
10007
+ _this.registerTableOption("clipboardCopyFormatter", false); //DEPRECATED - REMOVE in 5.0
9808
10008
 
9809
10009
 
9810
10010
  _this.registerTableOption("clipboardCopyRowRange", "active"); //restrict clipboard to visible rows only
@@ -9845,9 +10045,8 @@
9845
10045
  plain = _this2.table.options.clipboardCopyFormatter("plain", plain);
9846
10046
  }
9847
10047
  } else {
9848
- var list = _this2.table.modules["export"].generateExportList(_this2.table.options.clipboardCopyConfig, _this2.table.options.clipboardCopyStyled, _this2.rowRange, "clipboard");
9849
-
9850
- html = _this2.table.modules["export"].genereateHTMLTable(list);
10048
+ list = _this2.table.modules["export"].generateExportList(_this2.table.options.clipboardCopyConfig, _this2.table.options.clipboardCopyStyled, _this2.rowRange, "clipboard");
10049
+ html = _this2.table.modules["export"].generateHTMLTable(list);
9851
10050
  plain = html ? _this2.generatePlainContent(list) : "";
9852
10051
 
9853
10052
  if (_this2.table.options.clipboardCopyFormatter) {
@@ -9936,7 +10135,7 @@
9936
10135
  }, {
9937
10136
  key: "copy",
9938
10137
  value: function copy(range, internal) {
9939
- var range, sel, textRange;
10138
+ var sel, textRange;
9940
10139
  this.blocked = false;
9941
10140
  this.customSelection = false;
9942
10141
 
@@ -10322,7 +10521,7 @@
10322
10521
  key: "rowsUpdated",
10323
10522
  value: function rowsUpdated(row) {
10324
10523
  if (this.table.options.groupBy) {
10325
- this.recalcRowGroup(this);
10524
+ this.recalcRowGroup(row);
10326
10525
  } else {
10327
10526
  this.recalcActiveRows();
10328
10527
  }
@@ -10472,23 +10671,27 @@
10472
10671
  key: "scrollHorizontal",
10473
10672
  value: function scrollHorizontal(left) {
10474
10673
  if (this.botInitialized && this.botRow) {
10475
- this.botRow.getElement().style.marginLeft = -left + "px";
10674
+ if (this.table.rtl) {
10675
+ this.botRow.getElement().style.marginRight = left + "px";
10676
+ } else {
10677
+ this.botRow.getElement().style.marginLeft = -left + "px";
10678
+ }
10476
10679
  }
10477
10680
  }
10478
10681
  }, {
10479
10682
  key: "recalc",
10480
10683
  value: function recalc(rows) {
10481
- var row;
10684
+ var data, row;
10482
10685
 
10483
10686
  if (this.topInitialized || this.botInitialized) {
10484
- this.rowsToData(rows);
10687
+ data = this.rowsToData(rows);
10485
10688
 
10486
10689
  if (this.topInitialized) {
10487
10690
  if (this.topRow) {
10488
10691
  this.topRow.deleteCells();
10489
10692
  }
10490
10693
 
10491
- row = this.generateRow("top", this.rowsToData(rows));
10694
+ row = this.generateRow("top", data);
10492
10695
  this.topRow = row;
10493
10696
 
10494
10697
  while (this.topElement.firstChild) {
@@ -10504,7 +10707,7 @@
10504
10707
  this.botRow.deleteCells();
10505
10708
  }
10506
10709
 
10507
- row = this.generateRow("bottom", this.rowsToData(rows));
10710
+ row = this.generateRow("bottom", data);
10508
10711
  this.botRow = row;
10509
10712
 
10510
10713
  while (this.botElement.firstChild) {
@@ -10648,7 +10851,7 @@
10648
10851
  formatter: _this4.table.modules.format.getFormatter("plaintext"),
10649
10852
  params: {}
10650
10853
  };
10651
- } //ensure css class defintion is replicated to calculation cell
10854
+ } //ensure css class definition is replicated to calculation cell
10652
10855
 
10653
10856
 
10654
10857
  _this4.genColumn.definition.cssClass = column.definition.cssClass; //generate cell and assign to correct column
@@ -10821,7 +11024,7 @@
10821
11024
  _this.registerTableOption("dataTreeChildColumnCalcs", false); //include visible data tree rows in column calculations
10822
11025
 
10823
11026
 
10824
- _this.registerTableOption("dataTreeSelectPropagate", false); //seleccting a parent row selects its children
11027
+ _this.registerTableOption("dataTreeSelectPropagate", false); //selecting a parent row selects its children
10825
11028
  //register component functions
10826
11029
 
10827
11030
 
@@ -10851,6 +11054,10 @@
10851
11054
  this.field = options.dataTreeChildField;
10852
11055
  this.indent = options.dataTreeChildIndent;
10853
11056
 
11057
+ if (this.options("movableRows")) {
11058
+ console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior");
11059
+ }
11060
+
10854
11061
  if (options.dataTreeBranchElement) {
10855
11062
  if (options.dataTreeBranchElement === true) {
10856
11063
  this.branchEl = document.createElement("div");
@@ -11068,8 +11275,8 @@
11068
11275
  var _this4 = this;
11069
11276
 
11070
11277
  var config = row.modules.dataTree,
11071
- el = el || row.getCells()[0].getElement(),
11072
11278
  oldControl = config.controlEl;
11279
+ el = el || row.getCells()[0].getElement();
11073
11280
 
11074
11281
  if (config.children !== false) {
11075
11282
  if (config.open) {
@@ -11247,7 +11454,7 @@
11247
11454
  }, {
11248
11455
  key: "getTreeParentRoot",
11249
11456
  value: function getTreeParentRoot(row) {
11250
- return row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;
11457
+ return row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;
11251
11458
  }
11252
11459
  }, {
11253
11460
  key: "getFilteredTreeChildren",
@@ -11357,8 +11564,10 @@
11357
11564
  match = match.data;
11358
11565
  }
11359
11566
  }
11567
+ } else if (subject === null) {
11568
+ match = false;
11360
11569
  }
11361
- } else if (typeof subject == "undefined" || subject === null) {
11570
+ } else if (typeof subject == "undefined") {
11362
11571
  match = false;
11363
11572
  } else {
11364
11573
  //subject should be treated as the index of the row
@@ -11423,8 +11632,10 @@
11423
11632
 
11424
11633
  DataTree.moduleName = "dataTree";
11425
11634
 
11426
- function csv (list, options, setFileContents) {
11427
- var delimiter = options && options.delimiter ? options.delimiter : ",",
11635
+ function csv (list) {
11636
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11637
+ var setFileContents = arguments.length > 2 ? arguments[2] : undefined;
11638
+ var delimiter = options.delimiter ? options.delimiter : ",",
11428
11639
  fileContents = [],
11429
11640
  headers = [];
11430
11641
  list.forEach(function (row) {
@@ -11512,7 +11723,9 @@
11512
11723
  setFileContents(fileContents, "application/json");
11513
11724
  }
11514
11725
 
11515
- function pdf (list, options, setFileContents) {
11726
+ function pdf (list) {
11727
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11728
+ var setFileContents = arguments.length > 2 ? arguments[2] : undefined;
11516
11729
  var header = [],
11517
11730
  body = [],
11518
11731
  autoTableParams = {},
@@ -11529,7 +11742,7 @@
11529
11742
  fillColor: 232
11530
11743
  },
11531
11744
  jsPDFParams = options.jsPDF || {},
11532
- title = options && options.title ? options.title : "";
11745
+ title = options.title ? options.title : "";
11533
11746
 
11534
11747
  if (!jsPDFParams.orientation) {
11535
11748
  jsPDFParams.orientation = options.orientation || "landscape";
@@ -11541,7 +11754,6 @@
11541
11754
 
11542
11755
 
11543
11756
  list.forEach(function (row) {
11544
-
11545
11757
  switch (row.type) {
11546
11758
  case "header":
11547
11759
  header.push(parseRow(row));
@@ -11596,7 +11808,7 @@
11596
11808
 
11597
11809
  var doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables
11598
11810
 
11599
- if (options && options.autoTable) {
11811
+ if (options.autoTable) {
11600
11812
  if (typeof options.autoTable === "function") {
11601
11813
  autoTableParams = options.autoTable(doc) || {};
11602
11814
  } else {
@@ -11614,7 +11826,7 @@
11614
11826
  autoTableParams.body = body;
11615
11827
  doc.autoTable(autoTableParams);
11616
11828
 
11617
- if (options && options.documentProcessing) {
11829
+ if (options.documentProcessing) {
11618
11830
  options.documentProcessing(doc);
11619
11831
  }
11620
11832
 
@@ -11739,7 +11951,7 @@
11739
11951
 
11740
11952
  function html (list, options, setFileContents) {
11741
11953
  if (this.modExists("export", true)) {
11742
- setFileContents(this.modules["export"].genereateHTMLTable(list), "text/html");
11954
+ setFileContents(this.modules["export"].generateHTMLTable(list), "text/html");
11743
11955
  }
11744
11956
  }
11745
11957
 
@@ -11794,11 +12006,16 @@
11794
12006
 
11795
12007
  _this = _super.call(this, table);
11796
12008
 
11797
- _this.registerTableOption("downloadReady", function (data, blob) {
11798
- return blob;
12009
+ _this.registerTableOption("downloadEncoder", function (data, mimeType) {
12010
+ return new Blob([data], {
12011
+ type: mimeType
12012
+ });
11799
12013
  }); //function to manipulate download data
11800
12014
 
11801
12015
 
12016
+ _this.registerTableOption("downloadReady", undefined); //warn of function deprecation
12017
+
12018
+
11802
12019
  _this.registerTableOption("downloadConfig", {}); //download config
11803
12020
 
11804
12021
 
@@ -11815,8 +12032,14 @@
11815
12032
  _createClass(Download, [{
11816
12033
  key: "initialize",
11817
12034
  value: function initialize() {
12035
+ this.deprecatedOptionsCheck();
11818
12036
  this.registerTableFunction("download", this.download.bind(this));
11819
12037
  this.registerTableFunction("downloadToTab", this.downloadToTab.bind(this));
12038
+ }
12039
+ }, {
12040
+ key: "deprecatedOptionsCheck",
12041
+ value: function deprecatedOptionsCheck() {
12042
+ this.deprecationCheck("downloadReady", "downloadEncoder");
11820
12043
  } ///////////////////////////////////
11821
12044
  ///////// Table Functions /////////
11822
12045
  ///////////////////////////////////
@@ -11890,16 +12113,14 @@
11890
12113
  key: "triggerDownload",
11891
12114
  value: function triggerDownload(data, mime, type, filename, newTab) {
11892
12115
  var element = document.createElement('a'),
11893
- blob = new Blob([data], {
11894
- type: mime
11895
- }),
11896
- filename = filename || "Tabulator." + (typeof type === "function" ? "txt" : type);
11897
- blob = this.table.options.downloadReady(data, blob);
12116
+ blob = this.table.options.downloadEncoder(data, mime);
11898
12117
 
11899
12118
  if (blob) {
11900
12119
  if (newTab) {
11901
12120
  window.open(window.URL.createObjectURL(blob));
11902
12121
  } else {
12122
+ filename = filename || "Tabulator." + (typeof type === "function" ? "txt" : type);
12123
+
11903
12124
  if (navigator.msSaveOrOpenBlob) {
11904
12125
  navigator.msSaveOrOpenBlob(blob, filename);
11905
12126
  } else {
@@ -12088,7 +12309,6 @@
12088
12309
  var cellValue = cell.getValue(),
12089
12310
  vertNav = editorParams.verticalNavigation || "hybrid",
12090
12311
  value = String(cellValue !== null && typeof cellValue !== "undefined" ? cellValue : ""),
12091
- count = (value.match(/(?:\r\n|\r|\n)/g) || []).length + 1,
12092
12312
  input = document.createElement("textarea"),
12093
12313
  scrollHeight = 0; //create and style input
12094
12314
 
@@ -12155,6 +12375,13 @@
12155
12375
  });
12156
12376
  input.addEventListener("keydown", function (e) {
12157
12377
  switch (e.keyCode) {
12378
+ case 13:
12379
+ if (e.shiftKey && editorParams.shiftEnterSubmit) {
12380
+ onChange();
12381
+ }
12382
+
12383
+ break;
12384
+
12158
12385
  case 27:
12159
12386
  cancel();
12160
12387
  break;
@@ -12377,6 +12604,302 @@
12377
12604
  return input;
12378
12605
  }
12379
12606
 
12607
+ //input element
12608
+ function date (cell, onRendered, success, cancel, editorParams) {
12609
+ var inputFormat = editorParams.format,
12610
+ DT = inputFormat ? window.DateTime || luxon.DateTime : null; //create and style input
12611
+
12612
+ var cellValue = cell.getValue(),
12613
+ input = document.createElement("input");
12614
+
12615
+ function convertDate(value) {
12616
+ var newDatetime;
12617
+
12618
+ if (DT.isDateTime(value)) {
12619
+ newDatetime = value;
12620
+ } else if (inputFormat === "iso") {
12621
+ newDatetime = DT.fromISO(String(value));
12622
+ } else {
12623
+ newDatetime = DT.fromFormat(String(value), inputFormat);
12624
+ }
12625
+
12626
+ return newDatetime.toFormat("yyyy-MM-dd");
12627
+ }
12628
+
12629
+ input.type = "date";
12630
+ input.style.padding = "4px";
12631
+ input.style.width = "100%";
12632
+ input.style.boxSizing = "border-box";
12633
+
12634
+ if (editorParams.max) {
12635
+ input.setAttribute("max", inputFormat ? convertDate(editorParams.max) : editorParams.max);
12636
+ }
12637
+
12638
+ if (editorParams.min) {
12639
+ input.setAttribute("min", inputFormat ? convertDate(editorParams.min) : editorParams.min);
12640
+ }
12641
+
12642
+ if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") {
12643
+ for (var key in editorParams.elementAttributes) {
12644
+ if (key.charAt(0) == "+") {
12645
+ key = key.slice(1);
12646
+ input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
12647
+ } else {
12648
+ input.setAttribute(key, editorParams.elementAttributes[key]);
12649
+ }
12650
+ }
12651
+ }
12652
+
12653
+ cellValue = typeof cellValue !== "undefined" ? cellValue : "";
12654
+
12655
+ if (inputFormat) {
12656
+ if (DT) {
12657
+ cellValue = convertDate(cellValue);
12658
+ } else {
12659
+ console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js");
12660
+ }
12661
+ }
12662
+
12663
+ input.value = cellValue;
12664
+ onRendered(function () {
12665
+ input.focus({
12666
+ preventScroll: true
12667
+ });
12668
+ input.style.height = "100%";
12669
+
12670
+ if (editorParams.selectContents) {
12671
+ input.select();
12672
+ }
12673
+ });
12674
+
12675
+ function onChange(e) {
12676
+ var value = input.value;
12677
+
12678
+ if ((cellValue === null || typeof cellValue === "undefined") && value !== "" || value !== cellValue) {
12679
+ if (value && inputFormat) {
12680
+ value = DT.fromFormat(String(value), "yyyy-MM-dd").toFormat(inputFormat);
12681
+ }
12682
+
12683
+ if (success(value)) {
12684
+ cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
12685
+ }
12686
+ } else {
12687
+ cancel();
12688
+ }
12689
+ } //submit new value on blur or change
12690
+
12691
+
12692
+ input.addEventListener("change", onChange);
12693
+ input.addEventListener("blur", onChange); //submit new value on enter
12694
+
12695
+ input.addEventListener("keydown", function (e) {
12696
+ switch (e.keyCode) {
12697
+ // case 9:
12698
+ case 13:
12699
+ onChange();
12700
+ break;
12701
+
12702
+ case 27:
12703
+ cancel();
12704
+ break;
12705
+
12706
+ case 35:
12707
+ case 36:
12708
+ e.stopPropagation();
12709
+ break;
12710
+ }
12711
+ });
12712
+ return input;
12713
+ }
12714
+
12715
+ //input element
12716
+ function time (cell, onRendered, success, cancel, editorParams) {
12717
+ var inputFormat = editorParams.format,
12718
+ DT = inputFormat ? window.DateTime || luxon.DateTime : null,
12719
+ newDatetime; //create and style input
12720
+
12721
+ var cellValue = cell.getValue(),
12722
+ input = document.createElement("input");
12723
+ input.type = "time";
12724
+ input.style.padding = "4px";
12725
+ input.style.width = "100%";
12726
+ input.style.boxSizing = "border-box";
12727
+
12728
+ if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") {
12729
+ for (var key in editorParams.elementAttributes) {
12730
+ if (key.charAt(0) == "+") {
12731
+ key = key.slice(1);
12732
+ input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
12733
+ } else {
12734
+ input.setAttribute(key, editorParams.elementAttributes[key]);
12735
+ }
12736
+ }
12737
+ }
12738
+
12739
+ cellValue = typeof cellValue !== "undefined" ? cellValue : "";
12740
+
12741
+ if (inputFormat) {
12742
+ if (DT) {
12743
+ if (DT.isDateTime(cellValue)) {
12744
+ newDatetime = cellValue;
12745
+ } else if (inputFormat === "iso") {
12746
+ newDatetime = DT.fromISO(String(cellValue));
12747
+ } else {
12748
+ newDatetime = DT.fromFormat(String(cellValue), inputFormat);
12749
+ }
12750
+
12751
+ cellValue = newDatetime.toFormat("hh:mm");
12752
+ } else {
12753
+ console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js");
12754
+ }
12755
+ }
12756
+
12757
+ input.value = cellValue;
12758
+ onRendered(function () {
12759
+ input.focus({
12760
+ preventScroll: true
12761
+ });
12762
+ input.style.height = "100%";
12763
+
12764
+ if (editorParams.selectContents) {
12765
+ input.select();
12766
+ }
12767
+ });
12768
+
12769
+ function onChange(e) {
12770
+ var value = input.value;
12771
+
12772
+ if ((cellValue === null || typeof cellValue === "undefined") && value !== "" || value !== cellValue) {
12773
+ if (value && inputFormat) {
12774
+ value = DT.fromFormat(String(value), "hh:mm").toFormat(inputFormat);
12775
+ }
12776
+
12777
+ if (success(value)) {
12778
+ cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
12779
+ }
12780
+ } else {
12781
+ cancel();
12782
+ }
12783
+ } //submit new value on blur or change
12784
+
12785
+
12786
+ input.addEventListener("change", onChange);
12787
+ input.addEventListener("blur", onChange); //submit new value on enter
12788
+
12789
+ input.addEventListener("keydown", function (e) {
12790
+ switch (e.keyCode) {
12791
+ // case 9:
12792
+ case 13:
12793
+ onChange();
12794
+ break;
12795
+
12796
+ case 27:
12797
+ cancel();
12798
+ break;
12799
+
12800
+ case 35:
12801
+ case 36:
12802
+ e.stopPropagation();
12803
+ break;
12804
+ }
12805
+ });
12806
+ return input;
12807
+ }
12808
+
12809
+ //input element
12810
+ function datetime (cell, onRendered, success, cancel, editorParams) {
12811
+ var inputFormat = editorParams.format,
12812
+ DT = inputFormat ? window.DateTime || luxon.DateTime : null,
12813
+ newDatetime; //create and style input
12814
+
12815
+ var cellValue = cell.getValue(),
12816
+ input = document.createElement("input");
12817
+ input.type = "datetime-local";
12818
+ input.style.padding = "4px";
12819
+ input.style.width = "100%";
12820
+ input.style.boxSizing = "border-box";
12821
+
12822
+ if (editorParams.elementAttributes && _typeof(editorParams.elementAttributes) == "object") {
12823
+ for (var key in editorParams.elementAttributes) {
12824
+ if (key.charAt(0) == "+") {
12825
+ key = key.slice(1);
12826
+ input.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes["+" + key]);
12827
+ } else {
12828
+ input.setAttribute(key, editorParams.elementAttributes[key]);
12829
+ }
12830
+ }
12831
+ }
12832
+
12833
+ cellValue = typeof cellValue !== "undefined" ? cellValue : "";
12834
+
12835
+ if (inputFormat) {
12836
+ if (DT) {
12837
+ if (DT.isDateTime(cellValue)) {
12838
+ newDatetime = cellValue;
12839
+ } else if (inputFormat === "iso") {
12840
+ newDatetime = DT.fromISO(String(cellValue));
12841
+ } else {
12842
+ newDatetime = DT.fromFormat(String(cellValue), inputFormat);
12843
+ }
12844
+
12845
+ cellValue = newDatetime.toFormat("yyyy-MM-dd") + "T" + newDatetime.toFormat("hh:mm");
12846
+ } else {
12847
+ console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js");
12848
+ }
12849
+ }
12850
+
12851
+ input.value = cellValue;
12852
+ onRendered(function () {
12853
+ input.focus({
12854
+ preventScroll: true
12855
+ });
12856
+ input.style.height = "100%";
12857
+
12858
+ if (editorParams.selectContents) {
12859
+ input.select();
12860
+ }
12861
+ });
12862
+
12863
+ function onChange(e) {
12864
+ var value = input.value;
12865
+
12866
+ if ((cellValue === null || typeof cellValue === "undefined") && value !== "" || value !== cellValue) {
12867
+ if (value && inputFormat) {
12868
+ value = DT.fromISO(String(value)).toFormat(inputFormat);
12869
+ }
12870
+
12871
+ if (success(value)) {
12872
+ cellValue = input.value; //persist value if successfully validated incase editor is used as header filter
12873
+ }
12874
+ } else {
12875
+ cancel();
12876
+ }
12877
+ } //submit new value on blur or change
12878
+
12879
+
12880
+ input.addEventListener("change", onChange);
12881
+ input.addEventListener("blur", onChange); //submit new value on enter
12882
+
12883
+ input.addEventListener("keydown", function (e) {
12884
+ switch (e.keyCode) {
12885
+ // case 9:
12886
+ case 13:
12887
+ onChange();
12888
+ break;
12889
+
12890
+ case 27:
12891
+ cancel();
12892
+ break;
12893
+
12894
+ case 35:
12895
+ case 36:
12896
+ e.stopPropagation();
12897
+ break;
12898
+ }
12899
+ });
12900
+ return input;
12901
+ }
12902
+
12380
12903
  var Edit = /*#__PURE__*/function () {
12381
12904
  function Edit(editor, cell, onRendered, success, cancel, editorParams) {
12382
12905
  _classCallCheck(this, Edit);
@@ -12399,13 +12922,14 @@
12399
12922
  this.values = [];
12400
12923
  this.popup = null;
12401
12924
  this.listIteration = 0;
12925
+ this.lastAction = "";
12402
12926
  this.blurable = true;
12403
12927
  this.actions = {
12404
12928
  success: success,
12405
12929
  cancel: cancel
12406
12930
  };
12407
12931
 
12408
- this._deprecationCheck();
12932
+ this._deprecatedOptionsCheck();
12409
12933
 
12410
12934
  this._initializeValue();
12411
12935
 
@@ -12413,22 +12937,22 @@
12413
12937
  }
12414
12938
 
12415
12939
  _createClass(Edit, [{
12416
- key: "_deprecationCheck",
12417
- value: function _deprecationCheck() {
12940
+ key: "_deprecatedOptionsCheck",
12941
+ value: function _deprecatedOptionsCheck() {
12418
12942
  if (this.params.listItemFormatter) {
12419
- console.warn("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options");
12943
+ this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options");
12420
12944
  }
12421
12945
 
12422
12946
  if (this.params.sortValuesList) {
12423
- console.warn("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options");
12947
+ this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options");
12424
12948
  }
12425
12949
 
12426
12950
  if (this.params.searchFunc) {
12427
- console.warn("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options");
12951
+ this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options");
12428
12952
  }
12429
12953
 
12430
12954
  if (this.params.searchingPlaceholder) {
12431
- console.warn("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options");
12955
+ this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options");
12432
12956
  }
12433
12957
  }
12434
12958
  }, {
@@ -12464,6 +12988,7 @@
12464
12988
  setTimeout(function () {
12465
12989
  cellEl.removeEventListener("click", clickStop);
12466
12990
  }, 1000);
12991
+ this.input.addEventListener("mousedown", this._preventPopupBlur.bind(this));
12467
12992
  }
12468
12993
  }, {
12469
12994
  key: "_createListElement",
@@ -12582,7 +13107,7 @@
12582
13107
  }
12583
13108
  }
12584
13109
 
12585
- if (params.filterRemote && !(typeof params.valuesLookup === "function" || _typeof(params.valuesURL))) {
13110
+ if (params.filterRemote && !(typeof params.valuesLookup === "function" || params.valuesURL)) {
12586
13111
  params.filterRemote = false;
12587
13112
  console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source");
12588
13113
  }
@@ -12632,8 +13157,12 @@
12632
13157
  }, {
12633
13158
  key: "_inputBlur",
12634
13159
  value: function _inputBlur(e) {
12635
- if (this.blurable && this.popup) {
12636
- this.popup.hide();
13160
+ if (this.blurable) {
13161
+ if (this.popup) {
13162
+ this.popup.hide();
13163
+ } else {
13164
+ this._resolveValue(true);
13165
+ }
12637
13166
  }
12638
13167
  }
12639
13168
  }, {
@@ -12717,12 +13246,29 @@
12717
13246
 
12718
13247
  }
12719
13248
  }
13249
+ }, {
13250
+ key: "_preventPopupBlur",
13251
+ value: function _preventPopupBlur() {
13252
+ var _this2 = this;
13253
+
13254
+ if (this.popup) {
13255
+ this.popup.blockHide();
13256
+ }
13257
+
13258
+ setTimeout(function () {
13259
+ if (_this2.popup) {
13260
+ _this2.popup.restoreHide();
13261
+ }
13262
+ }, 10);
13263
+ }
12720
13264
  }, {
12721
13265
  key: "_preventBlur",
12722
13266
  value: function _preventBlur() {
13267
+ var _this3 = this;
13268
+
12723
13269
  this.blurable = false;
12724
13270
  setTimeout(function () {
12725
- this.blurable = true;
13271
+ _this3.blurable = true;
12726
13272
  }, 10);
12727
13273
  } //////////////////////////////////////
12728
13274
  //////// Keyboard Navigation /////////
@@ -12772,10 +13318,12 @@
12772
13318
  }, {
12773
13319
  key: "_keyEnter",
12774
13320
  value: function _keyEnter(e) {
12775
- if (this.focusedItem) {
12776
- this._chooseItem(this.focusedItem);
13321
+ if (this.params.autocomplete && this.lastAction === "typing") {
13322
+ this._resolveValue(true);
12777
13323
  } else {
12778
- this._cancel();
13324
+ if (this.focusedItem) {
13325
+ this._chooseItem(this.focusedItem);
13326
+ }
12779
13327
  }
12780
13328
  }
12781
13329
  }, {
@@ -12808,18 +13356,19 @@
12808
13356
  value: function _keyAutoCompLetter(e) {
12809
13357
  this._filter();
12810
13358
 
13359
+ this.lastAction = "typing";
12811
13360
  this.typing = true;
12812
13361
  }
12813
13362
  }, {
12814
13363
  key: "_scrollToValue",
12815
13364
  value: function _scrollToValue(_char) {
12816
- var _this2 = this;
13365
+ var _this4 = this;
12817
13366
 
12818
13367
  clearTimeout(this.filterTimeout);
12819
13368
  var character = String.fromCharCode(_char).toLowerCase();
12820
13369
  this.filterTerm += character.toLowerCase();
12821
13370
  var match = this.displayItems.find(function (item) {
12822
- return typeof item.label !== "undefined" && item.label.toLowerCase().startsWith(_this2.filterTerm);
13371
+ return typeof item.label !== "undefined" && item.label.toLowerCase().startsWith(_this4.filterTerm);
12823
13372
  });
12824
13373
 
12825
13374
  if (match) {
@@ -12827,12 +13376,14 @@
12827
13376
  }
12828
13377
 
12829
13378
  this.filterTimeout = setTimeout(function () {
12830
- _this2.filterTerm = "";
13379
+ _this4.filterTerm = "";
12831
13380
  }, 800);
12832
13381
  }
12833
13382
  }, {
12834
13383
  key: "_focusItem",
12835
13384
  value: function _focusItem(item) {
13385
+ this.lastAction = "focus";
13386
+
12836
13387
  if (this.focusedItem && this.focusedItem.element) {
12837
13388
  this.focusedItem.element.classList.remove("focused");
12838
13389
  }
@@ -12875,10 +13426,10 @@
12875
13426
  }, {
12876
13427
  key: "_generateOptions",
12877
13428
  value: function _generateOptions(silent) {
12878
- var _this3 = this;
13429
+ var _this5 = this;
12879
13430
 
12880
13431
  var values = [];
12881
- var itteration = ++this.listIteration;
13432
+ var iteration = ++this.listIteration;
12882
13433
  this.filtered = false;
12883
13434
 
12884
13435
  if (this.params.values) {
@@ -12899,10 +13450,10 @@
12899
13450
  }
12900
13451
 
12901
13452
  return values.then().then(function (responseValues) {
12902
- if (_this3.listIteration === itteration) {
12903
- return _this3._parseList(responseValues);
13453
+ if (_this5.listIteration === iteration) {
13454
+ return _this5._parseList(responseValues);
12904
13455
  } else {
12905
- return Promise.reject(itteration);
13456
+ return Promise.reject(iteration);
12906
13457
  }
12907
13458
  });
12908
13459
  } else {
@@ -12915,7 +13466,7 @@
12915
13466
  var placeholder = document.createElement("div");
12916
13467
 
12917
13468
  if (typeof contents === "function") {
12918
- contents = contents(cell.getComponent(), this.listEl);
13469
+ contents = contents(this.cell.getComponent(), this.listEl);
12919
13470
  }
12920
13471
 
12921
13472
  if (contents) {
@@ -12986,7 +13537,7 @@
12986
13537
  }, {
12987
13538
  key: "_parseList",
12988
13539
  value: function _parseList(inputValues) {
12989
- var _this4 = this;
13540
+ var _this6 = this;
12990
13541
 
12991
13542
  var data = [];
12992
13543
 
@@ -13011,8 +13562,15 @@
13011
13562
  };
13012
13563
  }
13013
13564
 
13014
- _this4._parseListItem(value, data, 0);
13015
- });
13565
+ _this6._parseListItem(value, data, 0);
13566
+ });
13567
+
13568
+ if (!this.currentItems.length && this.params.freetext) {
13569
+ this.input.value = this.initialValues;
13570
+ this.typing = true;
13571
+ this.lastAction = "typing";
13572
+ }
13573
+
13016
13574
  this.data = data;
13017
13575
  return data;
13018
13576
  }
@@ -13046,7 +13604,7 @@
13046
13604
  }, {
13047
13605
  key: "_parseListGroup",
13048
13606
  value: function _parseListGroup(option, level) {
13049
- var _this5 = this;
13607
+ var _this7 = this;
13050
13608
 
13051
13609
  var item = {
13052
13610
  label: option.label,
@@ -13060,7 +13618,7 @@
13060
13618
  original: option
13061
13619
  };
13062
13620
  option.options.forEach(function (child) {
13063
- _this5._parseListItem(child, item.options, level);
13621
+ _this7._parseListItem(child, item.options, level);
13064
13622
  });
13065
13623
  return item;
13066
13624
  }
@@ -13080,14 +13638,14 @@
13080
13638
  }, {
13081
13639
  key: "_sortGroup",
13082
13640
  value: function _sortGroup(sorter, options) {
13083
- var _this6 = this;
13641
+ var _this8 = this;
13084
13642
 
13085
13643
  options.sort(function (a, b) {
13086
13644
  return sorter(a.label, b.label, a.value, b.value, a.original, b.original);
13087
13645
  });
13088
13646
  options.forEach(function (option) {
13089
13647
  if (option.group) {
13090
- _this6._sortGroup(sorter, option.options);
13648
+ _this8._sortGroup(sorter, option.options);
13091
13649
  }
13092
13650
  });
13093
13651
  }
@@ -13146,15 +13704,15 @@
13146
13704
  }, {
13147
13705
  key: "_filterOptions",
13148
13706
  value: function _filterOptions() {
13149
- var _this7 = this;
13707
+ var _this9 = this;
13150
13708
 
13151
- var filterFunc = this.params.filterFunc || this._defaultFilterFunc;
13152
- var term = this.input.value;
13709
+ var filterFunc = this.params.filterFunc || this._defaultFilterFunc,
13710
+ term = this.input.value;
13153
13711
 
13154
13712
  if (term) {
13155
13713
  this.filtered = true;
13156
13714
  this.data.forEach(function (item) {
13157
- _this7._filterItem(filterFunc, term, item);
13715
+ _this9._filterItem(filterFunc, term, item);
13158
13716
  });
13159
13717
  } else {
13160
13718
  this.filtered = false;
@@ -13165,7 +13723,7 @@
13165
13723
  }, {
13166
13724
  key: "_filterItem",
13167
13725
  value: function _filterItem(func, term, item) {
13168
- var _this8 = this;
13726
+ var _this10 = this;
13169
13727
 
13170
13728
  var matches = false;
13171
13729
 
@@ -13173,7 +13731,7 @@
13173
13731
  item.visible = func(term, item.label, item.value, item.original);
13174
13732
  } else {
13175
13733
  item.options.forEach(function (option) {
13176
- if (_this8._filterItem(func, term, option)) {
13734
+ if (_this10._filterItem(func, term, option)) {
13177
13735
  matches = true;
13178
13736
  }
13179
13737
  });
@@ -13185,10 +13743,10 @@
13185
13743
  }, {
13186
13744
  key: "_defaultFilterFunc",
13187
13745
  value: function _defaultFilterFunc(term, label, value, item) {
13188
- var term = String(term).toLowerCase();
13746
+ term = String(term).toLowerCase();
13189
13747
 
13190
- if (label !== null || typeof label !== "undefined") {
13191
- if (String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase(term).indexOf() > -1) {
13748
+ if (label !== null && typeof label !== "undefined") {
13749
+ if (String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1) {
13192
13750
  return true;
13193
13751
  }
13194
13752
  }
@@ -13210,12 +13768,12 @@
13210
13768
  }, {
13211
13769
  key: "_buildList",
13212
13770
  value: function _buildList(data) {
13213
- var _this9 = this;
13771
+ var _this11 = this;
13214
13772
 
13215
13773
  this._clearList();
13216
13774
 
13217
13775
  data.forEach(function (option) {
13218
- _this9._buildItem(option);
13776
+ _this11._buildItem(option);
13219
13777
  });
13220
13778
 
13221
13779
  if (!this.displayItems.length) {
@@ -13225,7 +13783,7 @@
13225
13783
  }, {
13226
13784
  key: "_buildItem",
13227
13785
  value: function _buildItem(item) {
13228
- var _this10 = this;
13786
+ var _this12 = this;
13229
13787
 
13230
13788
  var el = item.element,
13231
13789
  contents;
@@ -13277,7 +13835,7 @@
13277
13835
 
13278
13836
  if (item.group) {
13279
13837
  item.options.forEach(function (option) {
13280
- _this10._buildItem(option);
13838
+ _this12._buildItem(option);
13281
13839
  });
13282
13840
  } else {
13283
13841
  this.displayItems.push(item);
@@ -13287,14 +13845,17 @@
13287
13845
  }, {
13288
13846
  key: "_showList",
13289
13847
  value: function _showList() {
13848
+ var _this13 = this;
13849
+
13290
13850
  var startVis = this.popup && this.popup.isVisible();
13291
13851
 
13292
13852
  if (this.input.parentNode) {
13293
13853
  if (this.params.autocomplete && this.input.value === "" && !this.params.listOnEmpty) {
13294
13854
  if (this.popup) {
13295
13855
  this.popup.hide(true);
13296
- return;
13297
13856
  }
13857
+
13858
+ return;
13298
13859
  }
13299
13860
 
13300
13861
  this._setListWidth();
@@ -13306,7 +13867,9 @@
13306
13867
  this.popup.show(this.cell.getElement(), "bottom");
13307
13868
 
13308
13869
  if (!startVis) {
13309
- this.popup.hideOnBlur(this._resolveValue.bind(this, true));
13870
+ setTimeout(function () {
13871
+ _this13.popup.hideOnBlur(_this13._resolveValue.bind(_this13, true));
13872
+ }, 10);
13310
13873
  }
13311
13874
  }
13312
13875
  }
@@ -13348,13 +13911,13 @@
13348
13911
  }, {
13349
13912
  key: "_clearChoices",
13350
13913
  value: function _clearChoices() {
13351
- var _this11 = this;
13914
+ var _this14 = this;
13352
13915
 
13353
13916
  this.typing = true;
13354
13917
  this.currentItems.forEach(function (item) {
13355
13918
  item.selected = false;
13356
13919
 
13357
- _this11._styleItem(item);
13920
+ _this14._styleItem(item);
13358
13921
  });
13359
13922
  this.currentItems = [];
13360
13923
  this.focusedItem = null;
@@ -13399,7 +13962,10 @@
13399
13962
  key: "_resolveValue",
13400
13963
  value: function _resolveValue(blur) {
13401
13964
  var output, initialValue;
13402
- this.popup.hide(true);
13965
+
13966
+ if (this.popup) {
13967
+ this.popup.hide(true);
13968
+ }
13403
13969
 
13404
13970
  if (this.params.multiselect) {
13405
13971
  output = this.currentItems.map(function (item) {
@@ -13435,7 +14001,8 @@
13435
14001
  this.actions.success(output);
13436
14002
 
13437
14003
  if (this.isFilter) {
13438
- this.initialValues = output && !Array.isArray[output] ? [output] : output;
14004
+ this.initialValues = output && !Array.isArray(output) ? [output] : output;
14005
+ this.currentItems = [];
13439
14006
  }
13440
14007
  }
13441
14008
  }]);
@@ -13444,7 +14011,7 @@
13444
14011
  }();
13445
14012
 
13446
14013
  function select (cell, onRendered, success, cancel, editorParams) {
13447
- console.warn("The select editor has been deprecated, please use the new list editor");
14014
+ this.deprecationMsg("The select editor has been deprecated, please use the new list editor");
13448
14015
  var list = new Edit(this, cell, onRendered, success, cancel, editorParams);
13449
14016
  return list.input;
13450
14017
  }
@@ -13455,7 +14022,7 @@
13455
14022
  }
13456
14023
 
13457
14024
  function autocomplete (cell, onRendered, success, cancel, editorParams) {
13458
- console.warn("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam");
14025
+ this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam");
13459
14026
  editorParams.autocomplete = true;
13460
14027
  var list = new Edit(this, cell, onRendered, success, cancel, editorParams);
13461
14028
  return list.input;
@@ -13764,8 +14331,6 @@
13764
14331
  checkedValue = editorParams.trueValue;
13765
14332
  } else if (falseValueSet && !checkedValue) {
13766
14333
  checkedValue = editorParams.falseValue;
13767
- } else {
13768
- checkedValue = checkedValue;
13769
14334
  }
13770
14335
 
13771
14336
  if (tristate) {
@@ -13816,6 +14381,9 @@
13816
14381
  textarea: textarea,
13817
14382
  number: number,
13818
14383
  range: range,
14384
+ date: date,
14385
+ time: time,
14386
+ datetime: datetime,
13819
14387
  select: select,
13820
14388
  list: list,
13821
14389
  autocomplete: autocomplete,
@@ -13837,7 +14405,7 @@
13837
14405
  _this = _super.call(this, table);
13838
14406
  _this.currentCell = false; //hold currently editing cell
13839
14407
 
13840
- _this.mouseClick = false; //hold mousedown state to prevent click binding being overriden by editor opening
14408
+ _this.mouseClick = false; //hold mousedown state to prevent click binding being overridden by editor opening
13841
14409
 
13842
14410
  _this.recursionBlock = false; //prevent focus recursion
13843
14411
 
@@ -13873,7 +14441,7 @@
13873
14441
 
13874
14442
  _this.registerTableFunction("navigateDown", _this.navigateDown.bind(_assertThisInitialized(_this)));
13875
14443
 
13876
- _this.registerComponentFunction("cell", "isEdited", _this.cellisEdited.bind(_assertThisInitialized(_this)));
14444
+ _this.registerComponentFunction("cell", "isEdited", _this.cellIsEdited.bind(_assertThisInitialized(_this)));
13877
14445
 
13878
14446
  _this.registerComponentFunction("cell", "clearEdited", _this.clearEdited.bind(_assertThisInitialized(_this)));
13879
14447
 
@@ -13901,6 +14469,7 @@
13901
14469
  value: function initialize() {
13902
14470
  this.subscribe("cell-init", this.bindEditor.bind(this));
13903
14471
  this.subscribe("cell-delete", this.clearEdited.bind(this));
14472
+ this.subscribe("cell-value-changed", this.updateCellClass.bind(this));
13904
14473
  this.subscribe("column-layout", this.initializeColumnCheck.bind(this));
13905
14474
  this.subscribe("column-delete", this.columnDeleteCheck.bind(this));
13906
14475
  this.subscribe("row-deleting", this.rowDeleteCheck.bind(this));
@@ -13949,8 +14518,8 @@
13949
14518
  ///////////////////////////////////
13950
14519
 
13951
14520
  }, {
13952
- key: "cellisEdited",
13953
- value: function cellisEdited(cell) {
14521
+ key: "cellIsEdited",
14522
+ value: function cellIsEdited(cell) {
13954
14523
  return !!cell.modules.edit && cell.modules.edit.edited;
13955
14524
  }
13956
14525
  }, {
@@ -13965,6 +14534,15 @@
13965
14534
  ///////// Table Functions /////////
13966
14535
  ///////////////////////////////////
13967
14536
 
14537
+ }, {
14538
+ key: "updateCellClass",
14539
+ value: function updateCellClass(cell) {
14540
+ if (this.allowEdit(cell)) {
14541
+ cell.getElement().classList.add("tabulator-editable");
14542
+ } else {
14543
+ cell.getElement().classList.remove("tabulator-editable");
14544
+ }
14545
+ }
13968
14546
  }, {
13969
14547
  key: "clearCellEdited",
13970
14548
  value: function clearCellEdited(cells) {
@@ -14148,11 +14726,7 @@
14148
14726
  var cell = row.cells[i];
14149
14727
 
14150
14728
  if (cell.column.modules.edit && Helpers.elVisible(cell.getElement())) {
14151
- var allowEdit = true;
14152
-
14153
- if (typeof cell.column.modules.edit.check == "function") {
14154
- allowEdit = cell.column.modules.edit.check(cell.getComponent());
14155
- }
14729
+ var allowEdit = this.allowEdit(cell);
14156
14730
 
14157
14731
  if (allowEdit) {
14158
14732
  nextCell = cell;
@@ -14171,13 +14745,10 @@
14171
14745
 
14172
14746
  if (index > 0) {
14173
14747
  for (var i = index - 1; i >= 0; i--) {
14174
- var cell = row.cells[i],
14175
- allowEdit = true;
14748
+ var cell = row.cells[i];
14176
14749
 
14177
14750
  if (cell.column.modules.edit && Helpers.elVisible(cell.getElement())) {
14178
- if (typeof cell.column.modules.edit.check == "function") {
14179
- allowEdit = cell.column.modules.edit.check(cell.getComponent());
14180
- }
14751
+ var allowEdit = this.allowEdit(cell);
14181
14752
 
14182
14753
  if (allowEdit) {
14183
14754
  prevCell = cell;
@@ -14280,7 +14851,8 @@
14280
14851
  cellEl.removeChild(cellEl.firstChild);
14281
14852
  }
14282
14853
 
14283
- cell.row.getElement().classList.remove("tabulator-row-editing");
14854
+ cell.row.getElement().classList.remove("tabulator-editing");
14855
+ cell.table.element.classList.remove("tabulator-editing");
14284
14856
  }
14285
14857
  }
14286
14858
  }, {
@@ -14312,6 +14884,7 @@
14312
14884
  if (cell.column.modules.edit) {
14313
14885
  var self = this,
14314
14886
  element = cell.getElement(true);
14887
+ this.updateCellClass(cell);
14315
14888
  element.setAttribute("tabindex", 0);
14316
14889
  element.addEventListener("click", function (e) {
14317
14890
  if (!element.classList.contains("tabulator-editing")) {
@@ -14359,8 +14932,7 @@
14359
14932
  if (this.table.rowManager.getRenderMode() == "virtual") {
14360
14933
  var topEdge = this.table.rowManager.element.scrollTop,
14361
14934
  bottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,
14362
- rowEl = cell.row.getElement(),
14363
- offset = rowEl.offsetTop;
14935
+ rowEl = cell.row.getElement();
14364
14936
 
14365
14937
  if (rowEl.offsetTop < topEdge) {
14366
14938
  this.table.rowManager.element.scrollTop -= topEdge - rowEl.offsetTop;
@@ -14372,8 +14944,7 @@
14372
14944
 
14373
14945
  var leftEdge = this.table.rowManager.element.scrollLeft,
14374
14946
  rightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,
14375
- cellEl = cell.getElement(),
14376
- offset = cellEl.offsetLeft;
14947
+ cellEl = cell.getElement();
14377
14948
 
14378
14949
  if (this.table.modExists("frozenColumns")) {
14379
14950
  leftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);
@@ -14394,6 +14965,29 @@
14394
14965
  }
14395
14966
  }
14396
14967
  }
14968
+ }, {
14969
+ key: "allowEdit",
14970
+ value: function allowEdit(cell) {
14971
+ var check = cell.column.modules.edit ? true : false;
14972
+
14973
+ if (cell.column.modules.edit) {
14974
+ switch (_typeof(cell.column.modules.edit.check)) {
14975
+ case "function":
14976
+ check = cell.column.modules.edit.check(cell.getComponent());
14977
+ break;
14978
+
14979
+ case "string":
14980
+ check = !!cell.row.data[cell.column.modules.edit.check];
14981
+ break;
14982
+
14983
+ case "boolean":
14984
+ check = cell.column.modules.edit.check;
14985
+ break;
14986
+ }
14987
+ }
14988
+
14989
+ return check;
14990
+ }
14397
14991
  }, {
14398
14992
  key: "edit",
14399
14993
  value: function edit(cell, e, forceEdit) {
@@ -14459,15 +15053,7 @@
14459
15053
  e.stopPropagation();
14460
15054
  }
14461
15055
 
14462
- switch (_typeof(cell.column.modules.edit.check)) {
14463
- case "function":
14464
- allowEdit = cell.column.modules.edit.check(cell.getComponent());
14465
- break;
14466
-
14467
- case "boolean":
14468
- allowEdit = cell.column.modules.edit.check;
14469
- break;
14470
- }
15056
+ allowEdit = this.allowEdit(cell);
14471
15057
 
14472
15058
  if (allowEdit || forceEdit) {
14473
15059
  self.cancelEdit();
@@ -14495,7 +15081,8 @@
14495
15081
  if (cellEditor !== false) {
14496
15082
  if (cellEditor instanceof Node) {
14497
15083
  element.classList.add("tabulator-editing");
14498
- cell.row.getElement().classList.add("tabulator-row-editing");
15084
+ cell.row.getElement().classList.add("tabulator-editing");
15085
+ cell.table.element.classList.add("tabulator-editing");
14499
15086
 
14500
15087
  while (element.firstChild) {
14501
15088
  element.removeChild(element.firstChild);
@@ -14602,7 +15189,7 @@
14602
15189
  _this.cloneTableStyle = true;
14603
15190
  _this.colVisProp = "";
14604
15191
 
14605
- _this.registerTableOption("htmlOutputConfig", false); //html outypu config
15192
+ _this.registerTableOption("htmlOutputConfig", false); //html output config
14606
15193
 
14607
15194
 
14608
15195
  _this.registerColumnOption("htmlOutput");
@@ -14634,10 +15221,10 @@
14634
15221
  return headers.concat(body);
14635
15222
  }
14636
15223
  }, {
14637
- key: "genereateTable",
14638
- value: function genereateTable(config, style, range, colVisProp) {
15224
+ key: "generateTable",
15225
+ value: function generateTable(config, style, range, colVisProp) {
14639
15226
  var list = this.generateExportList(config, style, range, colVisProp);
14640
- return this.genereateTableElement(list);
15227
+ return this.generateTableElement(list);
14641
15228
  }
14642
15229
  }, {
14643
15230
  key: "rowLookup",
@@ -14745,7 +15332,13 @@
14745
15332
  }, {
14746
15333
  key: "columnVisCheck",
14747
15334
  value: function columnVisCheck(column) {
14748
- return column.definition[this.colVisProp] !== false && (column.visible || !column.visible && column.definition[this.colVisProp]);
15335
+ var visProp = column.definition[this.colVisProp];
15336
+
15337
+ if (typeof visProp === "function") {
15338
+ visProp = visProp.call(this.table, column.getComponent());
15339
+ }
15340
+
15341
+ return visProp !== false && (column.visible || !column.visible && visProp);
14749
15342
  }
14750
15343
  }, {
14751
15344
  key: "headersToExportRows",
@@ -14765,17 +15358,17 @@
14765
15358
  headers[level].push(column);
14766
15359
 
14767
15360
  if (column.height > 1) {
14768
- for (var _i = 1; _i < column.height; _i++) {
14769
- if (typeof headers[level + _i] === "undefined") {
14770
- headers[level + _i] = [];
15361
+ for (var i = 1; i < column.height; i++) {
15362
+ if (typeof headers[level + i] === "undefined") {
15363
+ headers[level + i] = [];
14771
15364
  }
14772
15365
 
14773
- headers[level + _i].push(false);
15366
+ headers[level + i].push(false);
14774
15367
  }
14775
15368
  }
14776
15369
 
14777
15370
  if (column.width > 1) {
14778
- for (var _i2 = 1; _i2 < column.width; _i2++) {
15371
+ for (var _i = 1; _i < column.width; _i++) {
14779
15372
  headers[level].push(false);
14780
15373
  }
14781
15374
  }
@@ -14785,7 +15378,7 @@
14785
15378
  parseColumnGroup(subGroup, level + 1);
14786
15379
  });
14787
15380
  }
14788
- } //calculate maximum header debth
15381
+ } //calculate maximum header depth
14789
15382
 
14790
15383
 
14791
15384
  columns.forEach(function (column) {
@@ -14876,8 +15469,8 @@
14876
15469
  return exportRows;
14877
15470
  }
14878
15471
  }, {
14879
- key: "genereateTableElement",
14880
- value: function genereateTableElement(list) {
15472
+ key: "generateTableElement",
15473
+ value: function generateTableElement(list) {
14881
15474
  var _this6 = this;
14882
15475
 
14883
15476
  var table = document.createElement("table"),
@@ -14907,21 +15500,23 @@
14907
15500
  }
14908
15501
 
14909
15502
  list.forEach(function (row, i) {
15503
+ var rowEl;
15504
+
14910
15505
  switch (row.type) {
14911
15506
  case "header":
14912
- headerEl.appendChild(_this6.genereateHeaderElement(row, setup, styles));
15507
+ headerEl.appendChild(_this6.generateHeaderElement(row, setup, styles));
14913
15508
  break;
14914
15509
 
14915
15510
  case "group":
14916
- bodyEl.appendChild(_this6.genereateGroupElement(row, setup, styles));
15511
+ bodyEl.appendChild(_this6.generateGroupElement(row, setup, styles));
14917
15512
  break;
14918
15513
 
14919
15514
  case "calc":
14920
- bodyEl.appendChild(_this6.genereateCalcElement(row, setup, styles));
15515
+ bodyEl.appendChild(_this6.generateCalcElement(row, setup, styles));
14921
15516
  break;
14922
15517
 
14923
15518
  case "row":
14924
- var rowEl = _this6.genereateRowElement(row, setup, styles);
15519
+ rowEl = _this6.generateRowElement(row, setup, styles);
14925
15520
 
14926
15521
  _this6.mapElementStyles(i % 2 && styles.evenRow ? styles.evenRow : styles.oddRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]);
14927
15522
 
@@ -14960,8 +15555,8 @@
14960
15555
  return styles;
14961
15556
  }
14962
15557
  }, {
14963
- key: "genereateHeaderElement",
14964
- value: function genereateHeaderElement(row, setup, styles) {
15558
+ key: "generateHeaderElement",
15559
+ value: function generateHeaderElement(row, setup, styles) {
14965
15560
  var _this7 = this;
14966
15561
 
14967
15562
  var rowEl = document.createElement("tr");
@@ -15003,8 +15598,8 @@
15003
15598
  return rowEl;
15004
15599
  }
15005
15600
  }, {
15006
- key: "genereateGroupElement",
15007
- value: function genereateGroupElement(row, setup, styles) {
15601
+ key: "generateGroupElement",
15602
+ value: function generateGroupElement(row, setup, styles) {
15008
15603
  var rowEl = document.createElement("tr"),
15009
15604
  cellEl = document.createElement("td"),
15010
15605
  group = row.columns[0];
@@ -15013,9 +15608,7 @@
15013
15608
  if (setup.groupHeader && setup.groupHeader[row.indent]) {
15014
15609
  group.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);
15015
15610
  } else {
15016
- if (setup.groupHeader === false) {
15017
- group.value = group.value;
15018
- } else {
15611
+ if (setup.groupHeader !== false) {
15019
15612
  group.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);
15020
15613
  }
15021
15614
  }
@@ -15035,26 +15628,27 @@
15035
15628
  return rowEl;
15036
15629
  }
15037
15630
  }, {
15038
- key: "genereateCalcElement",
15039
- value: function genereateCalcElement(row, setup, styles) {
15040
- var rowEl = this.genereateRowElement(row, setup, styles);
15631
+ key: "generateCalcElement",
15632
+ value: function generateCalcElement(row, setup, styles) {
15633
+ var rowEl = this.generateRowElement(row, setup, styles);
15041
15634
  rowEl.classList.add("tabulator-print-table-calcs");
15042
15635
  this.mapElementStyles(styles.calcRow, rowEl, ["border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "background-color"]);
15043
15636
  return rowEl;
15044
15637
  }
15045
15638
  }, {
15046
- key: "genereateRowElement",
15047
- value: function genereateRowElement(row, setup, styles) {
15639
+ key: "generateRowElement",
15640
+ value: function generateRowElement(row, setup, styles) {
15048
15641
  var _this8 = this;
15049
15642
 
15050
15643
  var rowEl = document.createElement("tr");
15051
15644
  rowEl.classList.add("tabulator-print-table-row");
15052
- row.columns.forEach(function (col) {
15645
+ row.columns.forEach(function (col, i) {
15053
15646
  if (col) {
15054
15647
  var cellEl = document.createElement("td"),
15055
15648
  column = col.component._column,
15056
15649
  index = _this8.table.columnManager.findColumnIndex(column),
15057
- value = col.value;
15650
+ value = col.value,
15651
+ cellStyle;
15058
15652
 
15059
15653
  var cellWrapper = {
15060
15654
  modules: {},
@@ -15097,9 +15691,6 @@
15097
15691
  case "undefined":
15098
15692
  value = "";
15099
15693
  break;
15100
-
15101
- default:
15102
- value = value;
15103
15694
  }
15104
15695
  }
15105
15696
 
@@ -15109,8 +15700,10 @@
15109
15700
  cellEl.innerHTML = value;
15110
15701
  }
15111
15702
 
15112
- if (styles.styleCells[index] || styles.firstCell) {
15113
- _this8.mapElementStyles(styles.styleCells[index] || styles.firstCell, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "text-align"]);
15703
+ cellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;
15704
+
15705
+ if (cellStyle) {
15706
+ _this8.mapElementStyles(cellStyle, cellEl, ["padding-top", "padding-left", "padding-right", "padding-bottom", "border-top", "border-left", "border-right", "border-bottom", "color", "font-weight", "font-family", "font-size", "text-align"]);
15114
15707
 
15115
15708
  if (column.definition.align) {
15116
15709
  cellEl.style.textAlign = column.definition.align;
@@ -15143,17 +15736,17 @@
15143
15736
  return rowEl;
15144
15737
  }
15145
15738
  }, {
15146
- key: "genereateHTMLTable",
15147
- value: function genereateHTMLTable(list) {
15739
+ key: "generateHTMLTable",
15740
+ value: function generateHTMLTable(list) {
15148
15741
  var holder = document.createElement("div");
15149
- holder.appendChild(this.genereateTableElement(list));
15742
+ holder.appendChild(this.generateTableElement(list));
15150
15743
  return holder.innerHTML;
15151
15744
  }
15152
15745
  }, {
15153
15746
  key: "getHtml",
15154
15747
  value: function getHtml(visible, style, config, colVisProp) {
15155
15748
  var list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || "htmlOutput");
15156
- return this.genereateHTMLTable(list);
15749
+ return this.generateHTMLTable(list);
15157
15750
  }
15158
15751
  }, {
15159
15752
  key: "mapElementStyles",
@@ -15525,8 +16118,7 @@
15525
16118
  key: "initializeColumn",
15526
16119
  value: function initializeColumn(column, value) {
15527
16120
  var self = this,
15528
- field = column.getField();
15529
- //handle successfull value change
16121
+ field = column.getField(); //handle successfully value change
15530
16122
 
15531
16123
  function success(value) {
15532
16124
  var filterType = column.modules.filter.tagType == "input" && column.modules.filter.attrType == "text" || column.modules.filter.tagType == "textarea" ? "partial" : "match",
@@ -15597,8 +16189,7 @@
15597
16189
  self.headerFilters[field] = {
15598
16190
  value: value,
15599
16191
  func: filterFunc,
15600
- type: type,
15601
- params: {}
16192
+ type: type
15602
16193
  };
15603
16194
  } else {
15604
16195
  delete self.headerFilters[field];
@@ -15651,7 +16242,7 @@
15651
16242
  if (field) {
15652
16243
  //set empty value function
15653
16244
  column.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function (value) {
15654
- return !value && value !== "0" && value !== 0;
16245
+ return !value && value !== 0;
15655
16246
  };
15656
16247
 
15657
16248
  filterElement = document.createElement("div");
@@ -15711,6 +16302,9 @@
15711
16302
  getColumn: function getColumn() {
15712
16303
  return column.getComponent();
15713
16304
  },
16305
+ getTable: function getTable() {
16306
+ return _this3.table;
16307
+ },
15714
16308
  getRow: function getRow() {
15715
16309
  return {
15716
16310
  normalizeHeight: function normalizeHeight() {}
@@ -15732,16 +16326,9 @@
15732
16326
  } //set Placeholder Text
15733
16327
 
15734
16328
 
15735
- if (field) {
15736
- self.langBind("headerFilters|columns|" + column.definition.field, function (value) {
15737
- editorElement.setAttribute("placeholder", typeof value !== "undefined" && value ? value : self.langText("headerFilters|default"));
15738
- });
15739
- } else {
15740
- self.langBind("headerFilters|default", function (value) {
15741
- editorElement.setAttribute("placeholder", value);
15742
- });
15743
- } //focus on element on click
15744
-
16329
+ self.langBind("headerFilters|columns|" + column.definition.field, function (value) {
16330
+ editorElement.setAttribute("placeholder", typeof value !== "undefined" && value ? value : self.langText("headerFilters|default"));
16331
+ }); //focus on element on click
15745
16332
 
15746
16333
  editorElement.addEventListener("click", function (e) {
15747
16334
  e.stopPropagation();
@@ -15789,7 +16376,7 @@
15789
16376
  if (column.modules.filter.attrType == "text" && this.table.browser !== "ie") {
15790
16377
  editorElement.setAttribute("type", "search"); // editorElement.off("change blur"); //prevent blur from triggering filter and preventing selection click
15791
16378
  }
15792
- } //prevent input and select elements from propegating click to column sorters etc
16379
+ } //prevent input and select elements from propagating click to column sorters etc
15793
16380
 
15794
16381
 
15795
16382
  if (column.modules.filter.tagType == "input" || column.modules.filter.tagType == "select" || column.modules.filter.tagType == "textarea") {
@@ -15829,7 +16416,7 @@
15829
16416
  column.modules.filter.headerElement.style.display = '';
15830
16417
  }
15831
16418
  });
15832
- } //programatically set focus of header filter
16419
+ } //programmatically set focus of header filter
15833
16420
 
15834
16421
  }, {
15835
16422
  key: "setHeaderFilterFocus",
@@ -15849,7 +16436,7 @@
15849
16436
  } else {
15850
16437
  console.warn("Column Filter Error - No header filter set on column:", column.getField());
15851
16438
  }
15852
- } //programatically set value of header filter
16439
+ } //programmatically set value of header filter
15853
16440
 
15854
16441
  }, {
15855
16442
  key: "setHeaderFilterValue",
@@ -16447,7 +17034,7 @@
16447
17034
  }
16448
17035
  }
16449
17036
 
16450
- function datetime (cell, formatterParams, onRendered) {
17037
+ function datetime$1 (cell, formatterParams, onRendered) {
16451
17038
  var DT = window.DateTime || luxon.DateTime;
16452
17039
  var inputFormat = formatterParams.inputFormat || "yyyy-MM-dd HH:mm:ss";
16453
17040
  var outputFormat = formatterParams.outputFormat || "dd/MM/yyyy HH:mm:ss";
@@ -16616,19 +17203,20 @@
16616
17203
  return el;
16617
17204
  }
16618
17205
 
16619
- function progress$1 (cell, formatterParams, onRendered) {
17206
+ function progress$1 (cell) {
17207
+ var formatterParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17208
+ var onRendered = arguments.length > 2 ? arguments[2] : undefined;
16620
17209
  //progress bar
16621
17210
  var value = this.sanitizeHTML(cell.getValue()) || 0,
16622
17211
  element = cell.getElement(),
16623
- max = formatterParams && formatterParams.max ? formatterParams.max : 100,
16624
- min = formatterParams && formatterParams.min ? formatterParams.min : 0,
16625
- legendAlign = formatterParams && formatterParams.legendAlign ? formatterParams.legendAlign : "center",
17212
+ max = formatterParams.max ? formatterParams.max : 100,
17213
+ min = formatterParams.min ? formatterParams.min : 0,
17214
+ legendAlign = formatterParams.legendAlign ? formatterParams.legendAlign : "center",
16626
17215
  percent,
16627
17216
  percentValue,
16628
17217
  color,
16629
17218
  legend,
16630
- legendColor;
16631
- //make sure value is in range
17219
+ legendColor; //make sure value is in range
16632
17220
 
16633
17221
  percentValue = parseFloat(value) <= max ? parseFloat(value) : max;
16634
17222
  percentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min; //workout percentage
@@ -16689,11 +17277,13 @@
16689
17277
 
16690
17278
  case "object":
16691
17279
  if (Array.isArray(formatterParams.legendColor)) {
16692
- var unit = 100 / formatterParams.legendColor.length;
16693
- var index = Math.floor(percentValue / unit);
16694
- index = Math.min(index, formatterParams.legendColor.length - 1);
16695
- index = Math.max(index, 0);
16696
- legendColor = formatterParams.legendColor[index];
17280
+ var _unit = 100 / formatterParams.legendColor.length;
17281
+
17282
+ var _index = Math.floor(percentValue / _unit);
17283
+
17284
+ _index = Math.min(_index, formatterParams.legendColor.length - 1);
17285
+ _index = Math.max(_index, 0);
17286
+ legendColor = formatterParams.legendColor[_index];
16697
17287
  }
16698
17288
 
16699
17289
  break;
@@ -16707,7 +17297,6 @@
16707
17297
  element.setAttribute("aria-label", percentValue);
16708
17298
  var barEl = document.createElement("div");
16709
17299
  barEl.style.display = "inline-block";
16710
- barEl.style.position = "absolute";
16711
17300
  barEl.style.width = percentValue + "%";
16712
17301
  barEl.style.backgroundColor = color;
16713
17302
  barEl.style.height = "100%";
@@ -16766,7 +17355,12 @@
16766
17355
  }
16767
17356
 
16768
17357
  function rownum (cell, formatterParams, onRendered) {
16769
- return this.table.rowManager.activeRows.indexOf(cell.getRow()._getSelf()) + 1 || "";
17358
+ var content = document.createElement("span");
17359
+ var row = cell.getRow();
17360
+ row.watchPosition(function (position) {
17361
+ content.innerText = position;
17362
+ });
17363
+ return content;
16770
17364
  }
16771
17365
 
16772
17366
  function handle (cell, formatterParams, onRendered) {
@@ -16800,6 +17394,7 @@
16800
17394
  el.addEventListener("click", function (e) {
16801
17395
  e.stopImmediatePropagation();
16802
17396
  toggleList(!config.open);
17397
+ cell.getTable().rowManager.adjustTableSize();
16803
17398
  });
16804
17399
  toggleList(config.open);
16805
17400
  return el;
@@ -16821,7 +17416,7 @@
16821
17416
  if (typeof cell.getRow == 'function') {
16822
17417
  var row = cell.getRow();
16823
17418
 
16824
- if (row instanceof RowComponent$1) {
17419
+ if (row instanceof RowComponent) {
16825
17420
  checkbox.addEventListener("change", function (e) {
16826
17421
  if (_this.table.options.selectableRangeMode === "click") {
16827
17422
  if (!blocked) {
@@ -16870,7 +17465,7 @@
16870
17465
  link: link,
16871
17466
  image: image,
16872
17467
  tickCross: tickCross$1,
16873
- datetime: datetime,
17468
+ datetime: datetime$1,
16874
17469
  datetimediff: datetimediff,
16875
17470
  lookup: lookup,
16876
17471
  star: star$1,
@@ -17046,7 +17641,7 @@
17046
17641
  cell.modules.format.rendered = false;
17047
17642
  };
17048
17643
 
17049
- params = typeof formatter.params === "function" ? formatter.params(component) : formatter.params;
17644
+ params = typeof formatter.params === "function" ? formatter.params(cell.getComponent()) : formatter.params;
17050
17645
  return formatter.formatter.call(this, cell.getComponent(), params, onRendered);
17051
17646
  } else {
17052
17647
  return this.formatValue(cell);
@@ -17066,7 +17661,7 @@
17066
17661
  '`': '&#x60;',
17067
17662
  '=': '&#x3D;'
17068
17663
  };
17069
- return String(value).replace(/[&<>"'`=\/]/g, function (s) {
17664
+ return String(value).replace(/[&<>"'`=/]/g, function (s) {
17070
17665
  return entityMap[s];
17071
17666
  });
17072
17667
  } else {
@@ -17082,8 +17677,6 @@
17082
17677
  }, {
17083
17678
  key: "getFormatter",
17084
17679
  value: function getFormatter(formatter) {
17085
- var formatter;
17086
-
17087
17680
  switch (_typeof(formatter)) {
17088
17681
  case "string":
17089
17682
  if (Format.formatters[formatter]) {
@@ -17096,7 +17689,7 @@
17096
17689
  break;
17097
17690
 
17098
17691
  case "function":
17099
- formatter = formatter;
17692
+ //Custom formatter Function, do nothing
17100
17693
  break;
17101
17694
 
17102
17695
  default:
@@ -17239,7 +17832,6 @@
17239
17832
  }, {
17240
17833
  key: "scrollHorizontal",
17241
17834
  value: function scrollHorizontal() {
17242
-
17243
17835
  if (this.active) {
17244
17836
  this.calcMargins(true);
17245
17837
  this.layoutColumnPosition();
@@ -17293,7 +17885,7 @@
17293
17885
  }
17294
17886
 
17295
17887
  if (group.groupList && group.groupList.length) {
17296
- _this3.layoutGroupCalcs(group.groupList && group.groupList);
17888
+ _this3.layoutGroupCalcs(group.groupList);
17297
17889
  }
17298
17890
  });
17299
17891
  } //calculate column positions and layout headers
@@ -17394,7 +17986,7 @@
17394
17986
  value: function reinitializeRows() {
17395
17987
  var _this5 = this;
17396
17988
 
17397
- var visibleRows = this.table.rowManager.getVisibleRows();
17989
+ var visibleRows = this.table.rowManager.getVisibleRows(true);
17398
17990
  var otherRows = this.table.rowManager.getRows().filter(function (row) {
17399
17991
  return !visibleRows.includes(row);
17400
17992
  });
@@ -17486,7 +18078,14 @@
17486
18078
 
17487
18079
  _this.registerComponentFunction("row", "unfreeze", _this.unfreezeRow.bind(_assertThisInitialized(_this)));
17488
18080
 
17489
- _this.registerComponentFunction("row", "isFrozen", _this.isRowFrozen.bind(_assertThisInitialized(_this)));
18081
+ _this.registerComponentFunction("row", "isFrozen", _this.isRowFrozen.bind(_assertThisInitialized(_this))); //register table options
18082
+
18083
+
18084
+ _this.registerTableOption("frozenRowsField", "id"); //field to choose frozen rows by
18085
+
18086
+
18087
+ _this.registerTableOption("frozenRows", false); //holder for frozen row identifiers
18088
+
17490
18089
 
17491
18090
  return _this;
17492
18091
  }
@@ -17501,6 +18100,40 @@
17501
18100
  this.subscribe("row-deleting", this.detachRow.bind(this));
17502
18101
  this.subscribe("rows-visible", this.visibleRows.bind(this));
17503
18102
  this.registerDisplayHandler(this.getRows.bind(this), 10);
18103
+
18104
+ if (this.table.options.frozenRows) {
18105
+ this.subscribe("data-processed", this.initializeRows.bind(this));
18106
+ this.subscribe("row-added", this.initializeRow.bind(this));
18107
+ }
18108
+ }
18109
+ }, {
18110
+ key: "initializeRows",
18111
+ value: function initializeRows() {
18112
+ var _this2 = this;
18113
+
18114
+ this.table.rowManager.getRows().forEach(function (row) {
18115
+ _this2.initializeRow(row);
18116
+ });
18117
+ }
18118
+ }, {
18119
+ key: "initializeRow",
18120
+ value: function initializeRow(row) {
18121
+ var frozenRows = this.table.options.frozenRows,
18122
+ rowType = _typeof(frozenRows);
18123
+
18124
+ if (rowType === "number") {
18125
+ if (row.getPosition() && row.getPosition() + this.rows.length <= frozenRows) {
18126
+ this.freezeRow(row);
18127
+ }
18128
+ } else if (rowType === "function") {
18129
+ if (frozenRows.call(this.table, row.getComponent())) {
18130
+ this.freezeRow(row);
18131
+ }
18132
+ } else if (Array.isArray(frozenRows)) {
18133
+ if (frozenRows.includes(row.data[this.options("frozenRowsField")])) {
18134
+ this.freezeRow(row);
18135
+ }
18136
+ }
17504
18137
  }
17505
18138
  }, {
17506
18139
  key: "isRowFrozen",
@@ -17554,8 +18187,6 @@
17554
18187
  }, {
17555
18188
  key: "unfreezeRow",
17556
18189
  value: function unfreezeRow(row) {
17557
- var index = this.rows.indexOf(row);
17558
-
17559
18190
  if (row.modules.frozen) {
17560
18191
  row.modules.frozen = false;
17561
18192
  this.detachRow(row);
@@ -17587,10 +18218,10 @@
17587
18218
  }, {
17588
18219
  key: "styleRows",
17589
18220
  value: function styleRows(row) {
17590
- var _this2 = this;
18221
+ var _this3 = this;
17591
18222
 
17592
18223
  this.rows.forEach(function (row, i) {
17593
- _this2.table.rowManager.styleRow(row, i);
18224
+ _this3.table.rowManager.styleRow(row, i);
17594
18225
  });
17595
18226
  }
17596
18227
  }]);
@@ -17862,7 +18493,7 @@
17862
18493
  }
17863
18494
  }, {
17864
18495
  key: "getRowIndex",
17865
- value: function getRowIndex(row) {} //update row data to match grouping contraints
18496
+ value: function getRowIndex(row) {} //update row data to match grouping constraints
17866
18497
 
17867
18498
  }, {
17868
18499
  key: "conformRowData",
@@ -18044,7 +18675,7 @@
18044
18675
  value: function hide() {
18045
18676
  this.visible = false;
18046
18677
 
18047
- if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) {
18678
+ if (this.groupManager.table.rowManager.getRenderMode() == "basic" && !this.groupManager.table.options.pagination) {
18048
18679
  this.element.classList.remove("tabulator-group-visible");
18049
18680
 
18050
18681
  if (this.groupList.length) {
@@ -18062,7 +18693,7 @@
18062
18693
  }
18063
18694
 
18064
18695
  this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
18065
- this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();
18696
+ this.groupManager.checkBasicModeGroupHeaderWidth();
18066
18697
  } else {
18067
18698
  this.groupManager.updateGroupRows(true);
18068
18699
  }
@@ -18074,7 +18705,7 @@
18074
18705
  value: function show() {
18075
18706
  this.visible = true;
18076
18707
 
18077
- if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) {
18708
+ if (this.groupManager.table.rowManager.getRenderMode() == "basic" && !this.groupManager.table.options.pagination) {
18078
18709
  this.element.classList.add("tabulator-group-visible");
18079
18710
  var prev = this.generateElement();
18080
18711
 
@@ -18098,7 +18729,7 @@
18098
18729
  }
18099
18730
 
18100
18731
  this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
18101
- this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();
18732
+ this.groupManager.checkBasicModeGroupHeaderWidth();
18102
18733
  } else {
18103
18734
  this.groupManager.updateGroupRows(true);
18104
18735
  }
@@ -18151,10 +18782,10 @@
18151
18782
  }
18152
18783
  }, {
18153
18784
  key: "getRows",
18154
- value: function getRows(compoment) {
18785
+ value: function getRows(component) {
18155
18786
  var output = [];
18156
18787
  this.rows.forEach(function (row) {
18157
- output.push(compoment ? row.getComponent() : row);
18788
+ output.push(component ? row.getComponent() : row);
18158
18789
  });
18159
18790
  return output;
18160
18791
  }
@@ -18425,7 +19056,7 @@
18425
19056
  });
18426
19057
  this.groupIDLookups = [];
18427
19058
 
18428
- if (Array.isArray(groupBy) || groupBy) {
19059
+ if (Array.isArray(groupBy)) {
18429
19060
  if (this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both") {
18430
19061
  this.table.modules.columnCalcs.removeCalcs();
18431
19062
  }
@@ -18487,6 +19118,9 @@
18487
19118
  if (groupHeader) {
18488
19119
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
18489
19120
  }
19121
+ } else {
19122
+ this.groupList = [];
19123
+ this.groups = {};
18490
19124
  }
18491
19125
  }
18492
19126
  }, {
@@ -18551,10 +19185,9 @@
18551
19185
 
18552
19186
  if (!this.initialized) {
18553
19187
  this.initialize();
18554
- } else {
18555
- this.configureGroupSetup();
18556
19188
  }
18557
19189
 
19190
+ this.configureGroupSetup();
18558
19191
  this.refreshData();
18559
19192
  this.trackChanges();
18560
19193
  }
@@ -18838,9 +19471,9 @@
18838
19471
  var oldRowGroup = row.modules.group,
18839
19472
  oldGroupPath = oldRowGroup.getPath(),
18840
19473
  newGroupPath = this.getExpectedPath(row),
18841
- samePath = true; // figure out if new group path is the same as old group path
19474
+ samePath; // figure out if new group path is the same as old group path
18842
19475
 
18843
- var samePath = oldGroupPath.length == newGroupPath.length && oldGroupPath.every(function (element, index) {
19476
+ samePath = oldGroupPath.length == newGroupPath.length && oldGroupPath.every(function (element, index) {
18844
19477
  return element === newGroupPath[index];
18845
19478
  }); // refresh if they new path and old path aren't the same (aka the row's groupings have changed)
18846
19479
 
@@ -18902,6 +19535,30 @@
18902
19535
  }
18903
19536
  }
18904
19537
  }
19538
+ }, {
19539
+ key: "checkBasicModeGroupHeaderWidth",
19540
+ value: function checkBasicModeGroupHeaderWidth() {
19541
+ var _this6 = this;
19542
+
19543
+ var element = this.table.rowManager.tableElement,
19544
+ onlyGroupHeaders = true;
19545
+ this.table.rowManager.getDisplayRows().forEach(function (row, index) {
19546
+ _this6.table.rowManager.styleRow(row, index);
19547
+
19548
+ element.appendChild(row.getElement());
19549
+ row.initialize(true);
19550
+
19551
+ if (row.type !== "group") {
19552
+ onlyGroupHeaders = false;
19553
+ }
19554
+ });
19555
+
19556
+ if (onlyGroupHeaders) {
19557
+ element.style.minWidth = this.table.columnManager.getWidth() + "px";
19558
+ } else {
19559
+ element.style.minWidth = "";
19560
+ }
19561
+ }
18905
19562
  }]);
18906
19563
 
18907
19564
  return GroupRows;
@@ -18997,8 +19654,8 @@
18997
19654
  key: "rowMoved",
18998
19655
  value: function rowMoved(from, to, after) {
18999
19656
  this.action("rowMove", from, {
19000
- posFrom: this.table.rowManager.getRowPosition(from),
19001
- posTo: this.table.rowManager.getRowPosition(to),
19657
+ posFrom: from.getPosition(),
19658
+ posTo: to.getPosition(),
19002
19659
  to: to,
19003
19660
  after: after
19004
19661
  });
@@ -19018,7 +19675,7 @@
19018
19675
  var index, rows;
19019
19676
 
19020
19677
  if (this.table.options.groupBy) {
19021
- rows = row.getComponent().getGroup().rows;
19678
+ rows = row.getComponent().getGroup()._getSelf().rows;
19022
19679
  index = rows.indexOf(row);
19023
19680
 
19024
19681
  if (index) {
@@ -19185,7 +19842,6 @@
19185
19842
  value: function parseTable() {
19186
19843
  var element = this.table.originalElement,
19187
19844
  options = this.table.options,
19188
- columns = options.columns,
19189
19845
  headers = element.getElementsByTagName("th"),
19190
19846
  rows = element.getElementsByTagName("tbody")[0],
19191
19847
  data = [];
@@ -19205,7 +19861,7 @@
19205
19861
  for (var index = 0; index < rows.length; index++) {
19206
19862
  var row = rows[index],
19207
19863
  cells = row.getElementsByTagName("td"),
19208
- item = {}; //create index if the dont exist in table
19864
+ item = {}; //create index if the don't exist in table
19209
19865
 
19210
19866
  if (!this.hasIndex) {
19211
19867
  item[options.index] = index;
@@ -19411,9 +20067,14 @@
19411
20067
  }
19412
20068
  }
19413
20069
 
20070
+ function arrayImporter(input) {
20071
+ return input;
20072
+ }
20073
+
19414
20074
  var defaultImporters = {
19415
20075
  csv: csvImporter,
19416
- json: json$1
20076
+ json: json$1,
20077
+ array: arrayImporter
19417
20078
  };
19418
20079
 
19419
20080
  var Import = /*#__PURE__*/function (_Module) {
@@ -19448,7 +20109,7 @@
19448
20109
  }, {
19449
20110
  key: "loadDataCheck",
19450
20111
  value: function loadDataCheck(data) {
19451
- return typeof data === "string";
20112
+ return this.table.options.importFormat && (typeof data === "string" || Array.isArray(data) && data.length && Array.isArray(data));
19452
20113
  }
19453
20114
  }, {
19454
20115
  key: "loadData",
@@ -19759,6 +20420,8 @@
19759
20420
  }, {
19760
20421
  key: "cellContentsSelectionFixer",
19761
20422
  value: function cellContentsSelectionFixer(e, cell) {
20423
+ var range;
20424
+
19762
20425
  if (this.table.modExists("edit")) {
19763
20426
  if (this.table.modules.edit.currentCell === this) {
19764
20427
  return; //prevent instant selection of editor content
@@ -19770,12 +20433,12 @@
19770
20433
  try {
19771
20434
  if (document.selection) {
19772
20435
  // IE
19773
- var range = document.body.createTextRange();
19774
- range.moveToElementText(this.element);
20436
+ range = document.body.createTextRange();
20437
+ range.moveToElementText(cell.getElement());
19775
20438
  range.select();
19776
20439
  } else if (window.getSelection) {
19777
- var range = document.createRange();
19778
- range.selectNode(this.element);
20440
+ range = document.createRange();
20441
+ range.selectNode(cell.getElement());
19779
20442
  window.getSelection().removeAllRanges();
19780
20443
  window.getSelection().addRange(range);
19781
20444
  }
@@ -19791,7 +20454,6 @@
19791
20454
  }, {
19792
20455
  key: "subscriptionChanged",
19793
20456
  value: function subscriptionChanged(key, added) {
19794
-
19795
20457
  if (added) {
19796
20458
  if (!this.subscribers[key]) {
19797
20459
  if (this.eventMap[key].includes("-")) {
@@ -19829,7 +20491,7 @@
19829
20491
  }, {
19830
20492
  key: "unsubscribeTouchEvents",
19831
20493
  value: function unsubscribeTouchEvents(key) {
19832
- var notouch = true,
20494
+ var noTouch = true,
19833
20495
  type = this.eventMap[key];
19834
20496
 
19835
20497
  if (this.subscribers[key] && !this.subscribedExternal(key)) {
@@ -19838,12 +20500,12 @@
19838
20500
  for (var i in this.eventMap) {
19839
20501
  if (this.eventMap[i] === type) {
19840
20502
  if (this.subscribers[i]) {
19841
- notouch = false;
20503
+ noTouch = false;
19842
20504
  }
19843
20505
  }
19844
20506
  }
19845
20507
 
19846
- if (notouch) {
20508
+ if (noTouch) {
19847
20509
  this.unsubscribe(type + "-touchstart", this.touchSubscribers[type + "-touchstart"]);
19848
20510
  this.unsubscribe(type + "-touchend", this.touchSubscribers[type + "-touchend"]);
19849
20511
  delete this.touchSubscribers[type + "-touchstart"];
@@ -19969,8 +20631,7 @@
19969
20631
  },
19970
20632
  scrollPageUp: function scrollPageUp(e) {
19971
20633
  var rowManager = this.table.rowManager,
19972
- newPos = rowManager.scrollTop - rowManager.element.clientHeight,
19973
- scrollMax = rowManager.element.scrollHeight;
20634
+ newPos = rowManager.scrollTop - rowManager.element.clientHeight;
19974
20635
  e.preventDefault();
19975
20636
 
19976
20637
  if (rowManager.displayRowsCount) {
@@ -20305,16 +20966,15 @@
20305
20966
  _createClass(Menu, [{
20306
20967
  key: "initialize",
20307
20968
  value: function initialize() {
20308
- this.deprecationCheck();
20969
+ this.deprecatedOptionsCheck();
20309
20970
  this.initializeRowWatchers();
20310
20971
  this.initializeGroupWatchers();
20311
20972
  this.subscribe("column-init", this.initializeColumn.bind(this));
20312
20973
  }
20313
20974
  }, {
20314
- key: "deprecationCheck",
20315
- value: function deprecationCheck() {
20316
- if (typeof this.table.options.menuContainer !== "undefined") {
20317
- console.warn("Use of the menuContainer option is now deprecated. Please use the popupContainer option instead");
20975
+ key: "deprecatedOptionsCheck",
20976
+ value: function deprecatedOptionsCheck() {
20977
+ if (!this.deprecationCheck("menuContainer", "popupContainer")) {
20318
20978
  this.table.options.popupContainer = this.table.options.menuContainer;
20319
20979
  }
20320
20980
  }
@@ -20580,7 +21240,7 @@
20580
21240
 
20581
21241
  _this.toCol = false; //destination column
20582
21242
 
20583
- _this.toColAfter = false; //position of moving column relative to the desitnation column
21243
+ _this.toColAfter = false; //position of moving column relative to the destination column
20584
21244
 
20585
21245
  _this.startX = 0; //starting position within header element
20586
21246
 
@@ -20669,7 +21329,8 @@
20669
21329
 
20670
21330
  var colEl = column.getElement(),
20671
21331
  startXMove = false,
20672
- nextCol,
21332
+ //shifting center position of the cell
21333
+ nextCol,
20673
21334
  prevCol,
20674
21335
  nextColWidth,
20675
21336
  prevColWidth,
@@ -20907,7 +21568,7 @@
20907
21568
 
20908
21569
  _this.toRow = false; //destination row
20909
21570
 
20910
- _this.toRowAfter = false; //position of moving row relative to the desitnation row
21571
+ _this.toRowAfter = false; //position of moving row relative to the destination row
20911
21572
 
20912
21573
  _this.hasHandle = false; //row has handle instead of fully movable row
20913
21574
 
@@ -20969,24 +21630,25 @@
20969
21630
  key: "initializeGroupHeader",
20970
21631
  value: function initializeGroupHeader(group) {
20971
21632
  var self = this,
20972
- config = {};
20973
- //inter table drag drop
21633
+ config = {}; //inter table drag drop
20974
21634
 
20975
21635
  config.mouseup = function (e) {
20976
- self.tableRowDrop(e, row);
21636
+ self.tableRowDrop(e, group);
20977
21637
  }.bind(self); //same table drag drop
20978
21638
 
20979
21639
 
20980
21640
  config.mousemove = function (e) {
21641
+ var rowEl;
21642
+
20981
21643
  if (e.pageY - Helpers.elOffset(group.element).top + self.table.rowManager.element.scrollTop > group.getHeight() / 2) {
20982
21644
  if (self.toRow !== group || !self.toRowAfter) {
20983
- var rowEl = group.getElement();
21645
+ rowEl = group.getElement();
20984
21646
  rowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);
20985
21647
  self.moveRow(group, true);
20986
21648
  }
20987
21649
  } else {
20988
21650
  if (self.toRow !== group || self.toRowAfter) {
20989
- var rowEl = group.getElement();
21651
+ rowEl = group.getElement();
20990
21652
 
20991
21653
  if (rowEl.previousSibling) {
20992
21654
  rowEl.parentNode.insertBefore(self.placeholderElement, rowEl);
@@ -21083,7 +21745,8 @@
21083
21745
  var _this2 = this;
21084
21746
 
21085
21747
  var startYMove = false,
21086
- nextRow,
21748
+ //shifting center position of the cell
21749
+ nextRow,
21087
21750
  prevRow,
21088
21751
  nextRowHeight,
21089
21752
  prevRowHeight,
@@ -21298,7 +21961,7 @@
21298
21961
  var rowHolder = this.table.rowManager.getElement(),
21299
21962
  scrollTop = rowHolder.scrollTop,
21300
21963
  yPos = (this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top + scrollTop;
21301
- this.hoverElement.style.top = yPos - this.startY + "px";
21964
+ this.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + "px";
21302
21965
  }
21303
21966
  }, {
21304
21967
  key: "moveHoverConnections",
@@ -21391,7 +22054,7 @@
21391
22054
  console.warn("Move Row Error - Table cannot accept connection, already connected to table:", this.connectedTable);
21392
22055
  return false;
21393
22056
  }
21394
- } //close incomming connection
22057
+ } //close incoming connection
21395
22058
 
21396
22059
  }, {
21397
22060
  key: "disconnect",
@@ -21428,7 +22091,7 @@
21428
22091
  }
21429
22092
 
21430
22093
  if (sender) {
21431
- sender.call(this, this.moving.getComponent(), row ? row.getComponent() : undefined, table);
22094
+ sender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);
21432
22095
  } else {
21433
22096
  if (this.table.options.movableRowsSender) {
21434
22097
  console.warn("Mover Row Error - no matching sender found:", this.table.options.movableRowsSender);
@@ -21542,7 +22205,7 @@
21542
22205
  _classCallCheck(this, Mutator);
21543
22206
 
21544
22207
  _this = _super.call(this, table);
21545
- _this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of muatation types
22208
+ _this.allowedTypes = ["", "data", "edit", "clipboard"]; //list of mutation types
21546
22209
 
21547
22210
  _this.enabled = true;
21548
22211
 
@@ -21919,12 +22582,12 @@
21919
22582
  key: "rowAddingPosition",
21920
22583
  value: function rowAddingPosition(row, top) {
21921
22584
  var rowManager = this.table.rowManager,
21922
- dispRows = rowManager.getDisplayRows(),
22585
+ displayRows = rowManager.getDisplayRows(),
21923
22586
  index;
21924
22587
 
21925
22588
  if (top) {
21926
- if (dispRows.length) {
21927
- index = dispRows[0];
22589
+ if (displayRows.length) {
22590
+ index = displayRows[0];
21928
22591
  } else {
21929
22592
  if (rowManager.activeRows.length) {
21930
22593
  index = rowManager.activeRows[rowManager.activeRows.length - 1];
@@ -21932,9 +22595,9 @@
21932
22595
  }
21933
22596
  }
21934
22597
  } else {
21935
- if (dispRows.length) {
21936
- index = dispRows[dispRows.length - 1];
21937
- top = dispRows.length < this.size ? false : true;
22598
+ if (displayRows.length) {
22599
+ index = displayRows[displayRows.length - 1];
22600
+ top = displayRows.length < this.size ? false : true;
21938
22601
  }
21939
22602
  }
21940
22603
 
@@ -22235,7 +22898,7 @@
22235
22898
  this.element.appendChild(this.nextBut);
22236
22899
  this.element.appendChild(this.lastBut);
22237
22900
 
22238
- if (!this.table.options.paginationElement && !hidden) {
22901
+ if (!this.table.options.paginationElement) {
22239
22902
  if (this.table.options.paginationCounter) {
22240
22903
 
22241
22904
  if (this.table.options.paginationCounterElement) {
@@ -22629,7 +23292,7 @@
22629
23292
  value: function _parseRemoteData(data) {
22630
23293
  var _this6 = this;
22631
23294
 
22632
- var data, margin;
23295
+ var margin;
22633
23296
 
22634
23297
  if (typeof data.last_page === "undefined") {
22635
23298
  console.warn("Remote Pagination Error - Server response missing '" + (this.options("dataReceiveParams").last_page || "last_page") + "' property");
@@ -22709,7 +23372,7 @@
22709
23372
 
22710
23373
  Page.pageCounters = defaultPageCounters;
22711
23374
 
22712
- // read peristence information from storage
23375
+ // read persistance information from storage
22713
23376
  var defaultReaders = {
22714
23377
  local: function local(id, type) {
22715
23378
  var data = localStorage.getItem(id + "-" + type);
@@ -22807,7 +23470,7 @@
22807
23470
  //determine persistent layout storage type
22808
23471
  var mode = this.table.options.persistenceMode,
22809
23472
  id = this.table.options.persistenceID,
22810
- retreivedData;
23473
+ retrievedData;
22811
23474
  this.mode = mode !== true ? mode : this.localStorageTest() ? "local" : "cookie";
22812
23475
 
22813
23476
  if (this.table.options.persistenceReaderFunc) {
@@ -22857,34 +23520,34 @@
22857
23520
  }; //load pagination data if needed
22858
23521
 
22859
23522
  if (this.config.page) {
22860
- retreivedData = this.retreiveData("page");
23523
+ retrievedData = this.retrieveData("page");
22861
23524
 
22862
- if (retreivedData) {
22863
- if (typeof retreivedData.paginationSize !== "undefined" && (this.config.page === true || this.config.page.size)) {
22864
- this.table.options.paginationSize = retreivedData.paginationSize;
23525
+ if (retrievedData) {
23526
+ if (typeof retrievedData.paginationSize !== "undefined" && (this.config.page === true || this.config.page.size)) {
23527
+ this.table.options.paginationSize = retrievedData.paginationSize;
22865
23528
  }
22866
23529
 
22867
- if (typeof retreivedData.paginationInitialPage !== "undefined" && (this.config.page === true || this.config.page.page)) {
22868
- this.table.options.paginationInitialPage = retreivedData.paginationInitialPage;
23530
+ if (typeof retrievedData.paginationInitialPage !== "undefined" && (this.config.page === true || this.config.page.page)) {
23531
+ this.table.options.paginationInitialPage = retrievedData.paginationInitialPage;
22869
23532
  }
22870
23533
  }
22871
23534
  } //load group data if needed
22872
23535
 
22873
23536
 
22874
23537
  if (this.config.group) {
22875
- retreivedData = this.retreiveData("group");
23538
+ retrievedData = this.retrieveData("group");
22876
23539
 
22877
- if (retreivedData) {
22878
- if (typeof retreivedData.groupBy !== "undefined" && (this.config.group === true || this.config.group.groupBy)) {
22879
- this.table.options.groupBy = retreivedData.groupBy;
23540
+ if (retrievedData) {
23541
+ if (typeof retrievedData.groupBy !== "undefined" && (this.config.group === true || this.config.group.groupBy)) {
23542
+ this.table.options.groupBy = retrievedData.groupBy;
22880
23543
  }
22881
23544
 
22882
- if (typeof retreivedData.groupStartOpen !== "undefined" && (this.config.group === true || this.config.group.groupStartOpen)) {
22883
- this.table.options.groupStartOpen = retreivedData.groupStartOpen;
23545
+ if (typeof retrievedData.groupStartOpen !== "undefined" && (this.config.group === true || this.config.group.groupStartOpen)) {
23546
+ this.table.options.groupStartOpen = retrievedData.groupStartOpen;
22884
23547
  }
22885
23548
 
22886
- if (typeof retreivedData.groupHeader !== "undefined" && (this.config.group === true || this.config.group.groupHeader)) {
22887
- this.table.options.groupHeader = retreivedData.groupHeader;
23549
+ if (typeof retrievedData.groupHeader !== "undefined" && (this.config.group === true || this.config.group.groupHeader)) {
23550
+ this.table.options.groupHeader = retrievedData.groupHeader;
22888
23551
  }
22889
23552
  }
22890
23553
  }
@@ -22920,9 +23583,7 @@
22920
23583
  }, {
22921
23584
  key: "tableBuilt",
22922
23585
  value: function tableBuilt() {
22923
- var options = this.table.options,
22924
- sorters,
22925
- filters;
23586
+ var sorters, filters;
22926
23587
 
22927
23588
  if (this.config.sort) {
22928
23589
  sorters = this.load("sort");
@@ -23007,18 +23668,18 @@
23007
23668
  }, {
23008
23669
  key: "load",
23009
23670
  value: function load(type, current) {
23010
- var data = this.retreiveData(type);
23671
+ var data = this.retrieveData(type);
23011
23672
 
23012
23673
  if (current) {
23013
23674
  data = data ? this.mergeDefinition(current, data) : current;
23014
23675
  }
23015
23676
 
23016
23677
  return data;
23017
- } //retreive data from memory
23678
+ } //retrieve data from memory
23018
23679
 
23019
23680
  }, {
23020
- key: "retreiveData",
23021
- value: function retreiveData(type) {
23681
+ key: "retrieveData",
23682
+ value: function retrieveData(type) {
23022
23683
  return this.readFunc ? this.readFunc(this.id, type) : false;
23023
23684
  } //merge old and new column definitions
23024
23685
 
@@ -23504,7 +24165,7 @@
23504
24165
  if (!this.manualBlock) {
23505
24166
  this.element = document.createElement("div");
23506
24167
  this.element.classList.add("tabulator-print-table");
23507
- this.element.appendChild(this.table.modules["export"].genereateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, "print"));
24168
+ this.element.appendChild(this.table.modules["export"].generateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, "print"));
23508
24169
  this.table.element.style.display = "none";
23509
24170
  this.table.element.parentNode.insertBefore(this.element, this.table.element);
23510
24171
  }
@@ -23526,7 +24187,7 @@
23526
24187
  scrollY = window.scrollY,
23527
24188
  headerEl = document.createElement("div"),
23528
24189
  footerEl = document.createElement("div"),
23529
- tableEl = this.table.modules["export"].genereateTable(typeof config != "undefined" ? config : this.table.options.printConfig, typeof style != "undefined" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, "print"),
24190
+ tableEl = this.table.modules["export"].generateTable(typeof config != "undefined" ? config : this.table.options.printConfig, typeof style != "undefined" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, "print"),
23530
24191
  headerContent,
23531
24192
  footerContent;
23532
24193
  this.manualBlock = true;
@@ -23608,10 +24269,10 @@
23608
24269
  key: "initialize",
23609
24270
  value: function initialize() {
23610
24271
  if (this.table.options.reactiveData) {
23611
- this.subscribe("cell-value-save-before", this.block.bind(this));
23612
- this.subscribe("cell-value-save-after", this.unblock.bind(this));
23613
- this.subscribe("row-data-save-before", this.block.bind(this));
23614
- this.subscribe("row-data-save-after", this.unblock.bind(this));
24272
+ this.subscribe("cell-value-save-before", this.block.bind(this, "cellsave"));
24273
+ this.subscribe("cell-value-save-after", this.unblock.bind(this, "cellsave"));
24274
+ this.subscribe("row-data-save-before", this.block.bind(this, "rowsave"));
24275
+ this.subscribe("row-data-save-after", this.unblock.bind(this, "rowsave"));
23615
24276
  this.subscribe("row-data-init-after", this.watchRow.bind(this));
23616
24277
  this.subscribe("data-processing", this.watchData.bind(this));
23617
24278
  this.subscribe("table-destroy", this.unwatchData.bind(this));
@@ -23632,15 +24293,19 @@
23632
24293
  enumerable: false,
23633
24294
  configurable: true,
23634
24295
  value: function value() {
23635
- var args = Array.from(arguments);
24296
+ var args = Array.from(arguments),
24297
+ result;
23636
24298
 
23637
24299
  if (!self.blocked && version === self.currentVersion) {
24300
+ self.block("data-push");
23638
24301
  args.forEach(function (arg) {
23639
24302
  self.table.rowManager.addRowActual(arg, false);
23640
24303
  });
24304
+ result = self.origFuncs.push.apply(data, arguments);
24305
+ self.unblock("data-push");
23641
24306
  }
23642
24307
 
23643
- return self.origFuncs.push.apply(data, arguments);
24308
+ return result;
23644
24309
  }
23645
24310
  }); //override array unshift function
23646
24311
 
@@ -23649,15 +24314,19 @@
23649
24314
  enumerable: false,
23650
24315
  configurable: true,
23651
24316
  value: function value() {
23652
- var args = Array.from(arguments);
24317
+ var args = Array.from(arguments),
24318
+ result;
23653
24319
 
23654
24320
  if (!self.blocked && version === self.currentVersion) {
24321
+ self.block("data-unshift");
23655
24322
  args.forEach(function (arg) {
23656
24323
  self.table.rowManager.addRowActual(arg, true);
23657
24324
  });
24325
+ result = self.origFuncs.unshift.apply(data, arguments);
24326
+ self.unblock("data-unshift");
23658
24327
  }
23659
24328
 
23660
- return self.origFuncs.unshift.apply(data, arguments);
24329
+ return result;
23661
24330
  }
23662
24331
  }); //override array shift function
23663
24332
 
@@ -23666,9 +24335,11 @@
23666
24335
  enumerable: false,
23667
24336
  configurable: true,
23668
24337
  value: function value() {
23669
- var row;
24338
+ var row, result;
23670
24339
 
23671
24340
  if (!self.blocked && version === self.currentVersion) {
24341
+ self.block("data-shift");
24342
+
23672
24343
  if (self.data.length) {
23673
24344
  row = self.table.rowManager.getRowFromDataObject(self.data[0]);
23674
24345
 
@@ -23676,9 +24347,12 @@
23676
24347
  row.deleteActual();
23677
24348
  }
23678
24349
  }
24350
+
24351
+ result = self.origFuncs.shift.call(data);
24352
+ self.unblock("data-shift");
23679
24353
  }
23680
24354
 
23681
- return self.origFuncs.shift.call(data);
24355
+ return result;
23682
24356
  }
23683
24357
  }); //override array pop function
23684
24358
 
@@ -23687,9 +24361,11 @@
23687
24361
  enumerable: false,
23688
24362
  configurable: true,
23689
24363
  value: function value() {
23690
- var row;
24364
+ var row, result;
23691
24365
 
23692
24366
  if (!self.blocked && version === self.currentVersion) {
24367
+ self.block("data-pop");
24368
+
23693
24369
  if (self.data.length) {
23694
24370
  row = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);
23695
24371
 
@@ -23697,9 +24373,12 @@
23697
24373
  row.deleteActual();
23698
24374
  }
23699
24375
  }
24376
+
24377
+ result = self.origFuncs.pop.call(data);
24378
+ self.unblock("data-pop");
23700
24379
  }
23701
24380
 
23702
- return self.origFuncs.pop.call(data);
24381
+ return result;
23703
24382
  }
23704
24383
  }); //override array splice function
23705
24384
 
@@ -23712,10 +24391,12 @@
23712
24391
  start = args[0] < 0 ? data.length + args[0] : args[0],
23713
24392
  end = args[1],
23714
24393
  newRows = args[2] ? args.slice(2) : false,
23715
- startRow;
24394
+ startRow,
24395
+ result;
23716
24396
 
23717
24397
  if (!self.blocked && version === self.currentVersion) {
23718
- //add new rows
24398
+ self.block("data-splice"); //add new rows
24399
+
23719
24400
  if (newRows) {
23720
24401
  startRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;
23721
24402
 
@@ -23746,9 +24427,12 @@
23746
24427
  if (newRows || end !== 0) {
23747
24428
  self.table.rowManager.reRenderInPosition();
23748
24429
  }
24430
+
24431
+ result = self.origFuncs.splice.apply(data, arguments);
24432
+ self.unblock("data-splice");
23749
24433
  }
23750
24434
 
23751
- return self.origFuncs.splice.apply(data, arguments);
24435
+ return result;
23752
24436
  }
23753
24437
  });
23754
24438
  }
@@ -23770,7 +24454,6 @@
23770
24454
  key: "watchRow",
23771
24455
  value: function watchRow(row) {
23772
24456
  var data = row.getData();
23773
- this.blocked = true;
23774
24457
 
23775
24458
  for (var key in data) {
23776
24459
  this.watchKey(row, data, key);
@@ -23779,21 +24462,16 @@
23779
24462
  if (this.table.options.dataTree) {
23780
24463
  this.watchTreeChildren(row);
23781
24464
  }
23782
-
23783
- this.blocked = false;
23784
24465
  }
23785
24466
  }, {
23786
24467
  key: "watchTreeChildren",
23787
24468
  value: function watchTreeChildren(row) {
23788
- var _arguments = arguments;
23789
- var childField = row.getData()[this.table.options.dataTreeChildField],
23790
- origFuncs = {};
24469
+ var _arguments = arguments,
24470
+ _this2 = this;
23791
24471
 
23792
- function rebuildTree() {
23793
- this.table.modules.dataTree.initializeRow(row);
23794
- this.table.modules.dataTree.layoutRow(row);
23795
- this.table.rowManager.refreshActiveData("tree", false, true);
23796
- }
24472
+ var self = this,
24473
+ childField = row.getData()[this.table.options.dataTreeChildField],
24474
+ origFuncs = {};
23797
24475
 
23798
24476
  if (childField) {
23799
24477
  origFuncs.push = childField.push;
@@ -23801,8 +24479,15 @@
23801
24479
  enumerable: false,
23802
24480
  configurable: true,
23803
24481
  value: function value() {
23804
- var result = origFuncs.push.apply(childField, _arguments);
23805
- rebuildTree();
24482
+ if (!self.blocked) {
24483
+ self.block("tree-push");
24484
+ var result = origFuncs.push.apply(childField, _arguments);
24485
+
24486
+ _this2.rebuildTree(row);
24487
+
24488
+ self.unblock("tree-push");
24489
+ }
24490
+
23806
24491
  return result;
23807
24492
  }
23808
24493
  });
@@ -23811,8 +24496,15 @@
23811
24496
  enumerable: false,
23812
24497
  configurable: true,
23813
24498
  value: function value() {
23814
- var result = origFuncs.unshift.apply(childField, _arguments);
23815
- rebuildTree();
24499
+ if (!self.blocked) {
24500
+ self.block("tree-unshift");
24501
+ var result = origFuncs.unshift.apply(childField, _arguments);
24502
+
24503
+ _this2.rebuildTree(row);
24504
+
24505
+ self.unblock("tree-unshift");
24506
+ }
24507
+
23816
24508
  return result;
23817
24509
  }
23818
24510
  });
@@ -23821,8 +24513,15 @@
23821
24513
  enumerable: false,
23822
24514
  configurable: true,
23823
24515
  value: function value() {
23824
- var result = origFuncs.shift.call(childField);
23825
- rebuildTree();
24516
+ if (!self.blocked) {
24517
+ self.block("tree-shift");
24518
+ var result = origFuncs.shift.call(childField);
24519
+
24520
+ _this2.rebuildTree(row);
24521
+
24522
+ self.unblock("tree-shift");
24523
+ }
24524
+
23826
24525
  return result;
23827
24526
  }
23828
24527
  });
@@ -23831,8 +24530,15 @@
23831
24530
  enumerable: false,
23832
24531
  configurable: true,
23833
24532
  value: function value() {
23834
- var result = origFuncs.pop.call(childField);
23835
- rebuildTree();
24533
+ if (!self.blocked) {
24534
+ self.block("tree-pop");
24535
+ var result = origFuncs.pop.call(childField);
24536
+
24537
+ _this2.rebuildTree(row);
24538
+
24539
+ self.unblock("tree-pop");
24540
+ }
24541
+
23836
24542
  return result;
23837
24543
  }
23838
24544
  });
@@ -23841,29 +24547,44 @@
23841
24547
  enumerable: false,
23842
24548
  configurable: true,
23843
24549
  value: function value() {
23844
- var result = origFuncs.splice.apply(childField, _arguments);
23845
- rebuildTree();
24550
+ if (!self.blocked) {
24551
+ self.block("tree-splice");
24552
+ var result = origFuncs.splice.apply(childField, _arguments);
24553
+
24554
+ _this2.rebuildTree(row);
24555
+
24556
+ self.unblock("tree-splice");
24557
+ }
24558
+
23846
24559
  return result;
23847
24560
  }
23848
24561
  });
23849
24562
  }
23850
24563
  }
24564
+ }, {
24565
+ key: "rebuildTree",
24566
+ value: function rebuildTree(row) {
24567
+ this.table.modules.dataTree.initializeRow(row);
24568
+ this.table.modules.dataTree.layoutRow(row);
24569
+ this.table.rowManager.refreshActiveData("tree", false, true);
24570
+ }
23851
24571
  }, {
23852
24572
  key: "watchKey",
23853
24573
  value: function watchKey(row, data, key) {
23854
- var _this2 = this;
23855
-
23856
- var props = Object.getOwnPropertyDescriptor(data, key),
24574
+ var self = this,
24575
+ props = Object.getOwnPropertyDescriptor(data, key),
23857
24576
  value = data[key],
23858
24577
  version = this.currentVersion;
23859
24578
  Object.defineProperty(data, key, {
23860
24579
  set: function set(newValue) {
23861
24580
  value = newValue;
23862
24581
 
23863
- if (!_this2.blocked && version === _this2.currentVersion) {
24582
+ if (!self.blocked && version === self.currentVersion) {
24583
+ self.block("key");
23864
24584
  var update = {};
23865
24585
  update[key] = newValue;
23866
24586
  row.updateData(update);
24587
+ self.unblock("key");
23867
24588
  }
23868
24589
 
23869
24590
  if (props.set) {
@@ -23892,13 +24613,17 @@
23892
24613
  }
23893
24614
  }, {
23894
24615
  key: "block",
23895
- value: function block() {
23896
- this.blocked = true;
24616
+ value: function block(key) {
24617
+ if (!this.blocked) {
24618
+ this.blocked = key;
24619
+ }
23897
24620
  }
23898
24621
  }, {
23899
24622
  key: "unblock",
23900
- value: function unblock() {
23901
- this.blocked = false;
24623
+ value: function unblock(key) {
24624
+ if (this.blocked === key) {
24625
+ this.blocked = false;
24626
+ }
23902
24627
  }
23903
24628
  }]);
23904
24629
 
@@ -24157,7 +24882,7 @@
24157
24882
  }
24158
24883
  }
24159
24884
 
24160
- self.table.columnManager.renderer.rerenderColumns(true);
24885
+ self.table.columnManager.rerenderColumns(true);
24161
24886
 
24162
24887
  if (!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight) {
24163
24888
  column.checkCellHeights();
@@ -24186,7 +24911,7 @@
24186
24911
  }
24187
24912
  }
24188
24913
 
24189
- e.stopPropagation(); //prevent resize from interfereing with movable columns
24914
+ e.stopPropagation(); //prevent resize from interfering with movable columns
24190
24915
  //block editor from taking action while resizing is taking place
24191
24916
 
24192
24917
  if (self.startColumn.modules.edit) {
@@ -24307,7 +25032,7 @@
24307
25032
  self.dispatchExternal("rowResized", row.getComponent());
24308
25033
  }
24309
25034
 
24310
- e.stopPropagation(); //prevent resize from interfereing with movable columns
25035
+ e.stopPropagation(); //prevent resize from interfering with movable columns
24311
25036
  //block editor from taking action while resizing is taking place
24312
25037
  // if(self.startColumn.modules.edit){
24313
25038
  // self.startColumn.modules.edit.blocked = true;
@@ -24341,13 +25066,17 @@
24341
25066
 
24342
25067
  _this = _super.call(this, table);
24343
25068
  _this.binding = false;
24344
- _this.observer = false;
25069
+ _this.visibilityObserver = false;
25070
+ _this.resizeObserver = false;
24345
25071
  _this.containerObserver = false;
24346
25072
  _this.tableHeight = 0;
24347
25073
  _this.tableWidth = 0;
24348
25074
  _this.containerHeight = 0;
24349
25075
  _this.containerWidth = 0;
24350
25076
  _this.autoResize = false;
25077
+ _this.visible = false;
25078
+ _this.initialized = false;
25079
+ _this.initialRedraw = false;
24351
25080
 
24352
25081
  _this.registerTableOption("autoResize", true); //auto resize table
24353
25082
 
@@ -24371,9 +25100,10 @@
24371
25100
  this.containerWidth = table.element.parentNode.clientWidth;
24372
25101
  }
24373
25102
 
24374
- if (typeof ResizeObserver !== "undefined" && table.rowManager.getRenderMode() === "virtual") {
25103
+ if (typeof IntersectionObserver !== "undefined" && typeof ResizeObserver !== "undefined" && table.rowManager.getRenderMode() === "virtual") {
25104
+ this.initializeVisibilityObserver();
24375
25105
  this.autoResize = true;
24376
- this.observer = new ResizeObserver(function (entry) {
25106
+ this.resizeObserver = new ResizeObserver(function (entry) {
24377
25107
  if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) {
24378
25108
  var nodeHeight = Math.floor(entry[0].contentRect.height);
24379
25109
  var nodeWidth = Math.floor(entry[0].contentRect.width);
@@ -24387,13 +25117,11 @@
24387
25117
  _this2.containerWidth = table.element.parentNode.clientWidth;
24388
25118
  }
24389
25119
 
24390
- _this2.table.columnManager.renderer.rerenderColumns(true);
24391
-
24392
- table.redraw();
25120
+ _this2.redrawTable();
24393
25121
  }
24394
25122
  }
24395
25123
  });
24396
- this.observer.observe(table.element);
25124
+ this.resizeObserver.observe(table.element);
24397
25125
  tableStyle = window.getComputedStyle(table.element);
24398
25126
 
24399
25127
  if (this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue("max-height") || tableStyle.getPropertyValue("min-height"))) {
@@ -24409,8 +25137,7 @@
24409
25137
  _this2.tableWidth = table.element.clientWidth;
24410
25138
  }
24411
25139
 
24412
- table.columnManager.renderer.rerenderColumns(true);
24413
- table.redraw();
25140
+ _this2.redrawTable();
24414
25141
  }
24415
25142
  });
24416
25143
  this.containerObserver.observe(this.table.element.parentNode);
@@ -24420,7 +25147,7 @@
24420
25147
  } else {
24421
25148
  this.binding = function () {
24422
25149
  if (!table.browserMobile || table.browserMobile && !table.modules.edit.currentCell) {
24423
- table.columnManager.renderer.rerenderColumns(true);
25150
+ table.columnManager.rerenderColumns(true);
24424
25151
  table.redraw();
24425
25152
  }
24426
25153
  };
@@ -24431,6 +25158,35 @@
24431
25158
  this.subscribe("table-destroy", this.clearBindings.bind(this));
24432
25159
  }
24433
25160
  }
25161
+ }, {
25162
+ key: "initializeVisibilityObserver",
25163
+ value: function initializeVisibilityObserver() {
25164
+ var _this3 = this;
25165
+
25166
+ this.visibilityObserver = new IntersectionObserver(function (entries) {
25167
+ _this3.visible = entries[0].isIntersecting;
25168
+
25169
+ if (!_this3.initialized) {
25170
+ _this3.initialized = true;
25171
+ _this3.initialRedraw = !_this3.visible;
25172
+ }
25173
+
25174
+ if (_this3.visible) {
25175
+ _this3.redrawTable(_this3.initialRedraw);
25176
+
25177
+ _this3.initialRedraw = false;
25178
+ }
25179
+ });
25180
+ this.visibilityObserver.observe(this.table.element);
25181
+ }
25182
+ }, {
25183
+ key: "redrawTable",
25184
+ value: function redrawTable(force) {
25185
+ if (this.initialized && this.visible) {
25186
+ this.table.columnManager.rerenderColumns(true);
25187
+ this.table.redraw(force);
25188
+ }
25189
+ }
24434
25190
  }, {
24435
25191
  key: "tableResized",
24436
25192
  value: function tableResized() {
@@ -24443,8 +25199,12 @@
24443
25199
  window.removeEventListener("resize", this.binding);
24444
25200
  }
24445
25201
 
24446
- if (this.observer) {
24447
- this.observer.unobserve(this.table.element);
25202
+ if (this.resizeObserver) {
25203
+ this.resizeObserver.unobserve(this.table.element);
25204
+ }
25205
+
25206
+ if (this.visibilityObserver) {
25207
+ this.visibilityObserver.unobserve(this.table.element);
24448
25208
  }
24449
25209
 
24450
25210
  if (this.containerObserver) {
@@ -24498,7 +25258,6 @@
24498
25258
  _createClass(ResponsiveLayout, [{
24499
25259
  key: "initialize",
24500
25260
  value: function initialize() {
24501
-
24502
25261
  if (this.table.options.responsiveLayout) {
24503
25262
  this.subscribe("column-layout", this.initializeColumn.bind(this));
24504
25263
  this.subscribe("column-show", this.updateColumnVisibility.bind(this));
@@ -24510,6 +25269,7 @@
24510
25269
  this.subscribe("table-redrawing", this.tableRedraw.bind(this));
24511
25270
 
24512
25271
  if (this.table.options.responsiveLayout === "collapse") {
25272
+ this.subscribe("row-data-changed", this.generateCollapsedRowContent.bind(this));
24513
25273
  this.subscribe("row-init", this.initializeRow.bind(this));
24514
25274
  this.subscribe("row-layout", this.layoutRow.bind(this));
24515
25275
  }
@@ -24866,7 +25626,7 @@
24866
25626
 
24867
25627
  _this.registerTableOption("selectableCheck", function (data, row) {
24868
25628
  return true;
24869
- }); //check wheather row is selectable
25629
+ }); //check whether row is selectable
24870
25630
 
24871
25631
 
24872
25632
  _this.registerTableFunction("selectRow", _this.selectRows.bind(_assertThisInitialized(_this)));
@@ -25112,7 +25872,7 @@
25112
25872
  }, {
25113
25873
  key: "_selectRow",
25114
25874
  value: function _selectRow(rowInfo, silent, force) {
25115
-
25875
+ //handle max row count
25116
25876
  if (!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force) {
25117
25877
  if (this.selectedRows.length >= this.table.options.selectable) {
25118
25878
  if (this.table.options.selectableRollingSelection) {
@@ -25403,27 +26163,27 @@
25403
26163
  }
25404
26164
 
25405
26165
  //sort datetime
25406
- function datetime$1 (a, b, aRow, bRow, column, dir, params) {
26166
+ function datetime$2 (a, b, aRow, bRow, column, dir, params) {
25407
26167
  var DT = window.DateTime || luxon.DateTime;
25408
26168
  var format = params.format || "dd/MM/yyyy HH:mm:ss",
25409
26169
  alignEmptyValues = params.alignEmptyValues,
25410
26170
  emptyAlign = 0;
25411
26171
 
25412
26172
  if (typeof DT != "undefined") {
25413
- if (DT.isDateTime(a)) {
25414
- a = a;
25415
- } else if (format === "iso") {
25416
- a = DT.fromISO(String(a));
25417
- } else {
25418
- a = DT.fromFormat(String(a), format);
26173
+ if (!DT.isDateTime(a)) {
26174
+ if (format === "iso") {
26175
+ a = DT.fromISO(String(a));
26176
+ } else {
26177
+ a = DT.fromFormat(String(a), format);
26178
+ }
25419
26179
  }
25420
26180
 
25421
- if (DT.isDateTime(b)) {
25422
- b = b;
25423
- } else if (format === "iso") {
25424
- b = DT.fromISO(String(b));
25425
- } else {
25426
- b = DT.fromFormat(String(b), format);
26181
+ if (!DT.isDateTime(b)) {
26182
+ if (format === "iso") {
26183
+ b = DT.fromISO(String(b));
26184
+ } else {
26185
+ b = DT.fromFormat(String(b), format);
26186
+ }
25427
26187
  }
25428
26188
 
25429
26189
  if (!a.isValid) {
@@ -25446,20 +26206,20 @@
25446
26206
  }
25447
26207
  }
25448
26208
 
25449
- function date (a, b, aRow, bRow, column, dir, params) {
26209
+ function date$1 (a, b, aRow, bRow, column, dir, params) {
25450
26210
  if (!params.format) {
25451
26211
  params.format = "dd/MM/yyyy";
25452
26212
  }
25453
26213
 
25454
- return datetime$1.call(this, a, b, aRow, bRow, column, dir, params);
26214
+ return datetime$2.call(this, a, b, aRow, bRow, column, dir, params);
25455
26215
  }
25456
26216
 
25457
- function time (a, b, aRow, bRow, column, dir, params) {
26217
+ function time$1 (a, b, aRow, bRow, column, dir, params) {
25458
26218
  if (!params.format) {
25459
26219
  params.format = "HH:mm";
25460
26220
  }
25461
26221
 
25462
- return datetime$1.call(this, a, b, aRow, bRow, column, dir, params);
26222
+ return datetime$2.call(this, a, b, aRow, bRow, column, dir, params);
25463
26223
  }
25464
26224
 
25465
26225
  //sort booleans
@@ -25471,45 +26231,49 @@
25471
26231
 
25472
26232
  //sort if element contains any data
25473
26233
  function array (a, b, aRow, bRow, column, dir, params) {
25474
- var el1 = 0;
25475
- var el2 = 0;
25476
- var type = params.type || "length";
25477
- var alignEmptyValues = params.alignEmptyValues;
25478
- var emptyAlign = 0;
26234
+ var type = params.type || "length",
26235
+ alignEmptyValues = params.alignEmptyValues,
26236
+ emptyAlign = 0;
25479
26237
 
25480
26238
  function calc(value) {
26239
+ var result;
26240
+
25481
26241
  switch (type) {
25482
26242
  case "length":
25483
- return value.length;
26243
+ result = value.length;
26244
+ break;
25484
26245
 
25485
26246
  case "sum":
25486
- return value.reduce(function (c, d) {
26247
+ result = value.reduce(function (c, d) {
25487
26248
  return c + d;
25488
26249
  });
26250
+ break;
25489
26251
 
25490
26252
  case "max":
25491
- return Math.max.apply(null, value);
26253
+ result = Math.max.apply(null, value);
26254
+ break;
25492
26255
 
25493
26256
  case "min":
25494
- return Math.min.apply(null, value);
26257
+ result = Math.min.apply(null, value);
26258
+ break;
25495
26259
 
25496
26260
  case "avg":
25497
- return value.reduce(function (c, d) {
26261
+ result = value.reduce(function (c, d) {
25498
26262
  return c + d;
25499
26263
  }) / value.length;
26264
+ break;
25500
26265
  }
26266
+
26267
+ return result;
25501
26268
  } //handle non array values
25502
26269
 
25503
26270
 
25504
26271
  if (!Array.isArray(a)) {
25505
- alignEmptyValues = !Array.isArray(b) ? 0 : -1;
26272
+ emptyAlign = !Array.isArray(b) ? 0 : -1;
25506
26273
  } else if (!Array.isArray(b)) {
25507
- alignEmptyValues = 1;
26274
+ emptyAlign = 1;
25508
26275
  } else {
25509
- //compare valid values
25510
- el1 = a ? calc(a) : 0;
25511
- el2 = b ? calc(b) : 0;
25512
- return el1 - el2;
26276
+ return calc(b) - calc(a);
25513
26277
  } //fix empty values in position
25514
26278
 
25515
26279
 
@@ -25581,9 +26345,9 @@
25581
26345
  var defaultSorters = {
25582
26346
  number: number$1,
25583
26347
  string: string,
25584
- date: date,
25585
- time: time,
25586
- datetime: datetime$1,
26348
+ date: date$1,
26349
+ time: time$1,
26350
+ datetime: datetime$2,
25587
26351
  "boolean": _boolean,
25588
26352
  array: array,
25589
26353
  exists: exists,
@@ -25723,15 +26487,23 @@
25723
26487
  arrowEl = document.createElement("div");
25724
26488
  arrowEl.classList.add("tabulator-col-sorter");
25725
26489
 
25726
- if (_typeof(this.table.options.headerSortElement) == "object") {
25727
- arrowEl.appendChild(this.table.options.headerSortElement);
25728
- } else {
25729
- arrowEl.innerHTML = this.table.options.headerSortElement;
26490
+ switch (this.table.options.headerSortElement) {
26491
+ case "function":
26492
+ //do nothing
26493
+ break;
26494
+
26495
+ case "object":
26496
+ arrowEl.appendChild(this.table.options.headerSortElement);
26497
+ break;
26498
+
26499
+ default:
26500
+ arrowEl.innerHTML = this.table.options.headerSortElement;
25730
26501
  } //create sorter arrow
25731
26502
 
25732
26503
 
25733
26504
  column.titleHolderElement.appendChild(arrowEl);
25734
- column.modules.sort.element = arrowEl; //sort on click
26505
+ column.modules.sort.element = arrowEl;
26506
+ this.setColumnHeaderSortIcon(column, "none"); //sort on click
25735
26507
 
25736
26508
  colEl.addEventListener("click", function (e) {
25737
26509
  var dir = "",
@@ -25937,19 +26709,23 @@
25937
26709
  if (this.table.options.sortMode !== "remote") {
25938
26710
  //build list of valid sorters and trigger column specific callbacks before sort begins
25939
26711
  sortList.forEach(function (item, i) {
25940
- var sortObj = item.column.modules.sort;
26712
+ var sortObj;
26713
+
26714
+ if (item.column) {
26715
+ sortObj = item.column.modules.sort;
26716
+
26717
+ if (sortObj) {
26718
+ //if no sorter has been defined, take a guess
26719
+ if (!sortObj.sorter) {
26720
+ sortObj.sorter = self.findSorter(item.column);
26721
+ }
25941
26722
 
25942
- if (item.column && sortObj) {
25943
- //if no sorter has been defined, take a guess
25944
- if (!sortObj.sorter) {
25945
- sortObj.sorter = self.findSorter(item.column);
26723
+ item.params = typeof sortObj.params === "function" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;
26724
+ sortListActual.push(item);
25946
26725
  }
25947
26726
 
25948
- item.params = typeof sortObj.params === "function" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;
25949
- sortListActual.push(item);
26727
+ self.setColumnHeader(item.column, item.dir);
25950
26728
  }
25951
-
25952
- self.setColumnHeader(item.column, item.dir);
25953
26729
  }); //sort data
25954
26730
 
25955
26731
  if (sortListActual.length) {
@@ -25974,10 +26750,14 @@
25974
26750
  }, {
25975
26751
  key: "clearColumnHeaders",
25976
26752
  value: function clearColumnHeaders() {
26753
+ var _this3 = this;
26754
+
25977
26755
  this.table.columnManager.getRealColumns().forEach(function (column) {
25978
26756
  if (column.modules.sort) {
25979
26757
  column.modules.sort.dir = "none";
25980
26758
  column.getElement().setAttribute("aria-sort", "none");
26759
+
26760
+ _this3.setColumnHeaderSortIcon(column, "none");
25981
26761
  }
25982
26762
  });
25983
26763
  } //set the column header sort direction
@@ -25987,12 +26767,33 @@
25987
26767
  value: function setColumnHeader(column, dir) {
25988
26768
  column.modules.sort.dir = dir;
25989
26769
  column.getElement().setAttribute("aria-sort", dir === "asc" ? "ascending" : "descending");
26770
+ this.setColumnHeaderSortIcon(column, dir);
26771
+ }
26772
+ }, {
26773
+ key: "setColumnHeaderSortIcon",
26774
+ value: function setColumnHeaderSortIcon(column, dir) {
26775
+ var sortEl = column.modules.sort.element,
26776
+ arrowEl;
26777
+
26778
+ if (typeof this.table.options.headerSortElement === "function") {
26779
+ while (sortEl.firstChild) {
26780
+ sortEl.removeChild(sortEl.firstChild);
26781
+ }
26782
+
26783
+ arrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);
26784
+
26785
+ if (_typeof(arrowEl) === "object") {
26786
+ sortEl.appendChild(arrowEl);
26787
+ } else {
26788
+ sortEl.innerHTML = arrowEl;
26789
+ }
26790
+ }
25990
26791
  } //sort each item in sort list
25991
26792
 
25992
26793
  }, {
25993
26794
  key: "_sortItems",
25994
26795
  value: function _sortItems(data, sortList) {
25995
- var _this3 = this;
26796
+ var _this4 = this;
25996
26797
 
25997
26798
  var sorterCount = sortList.length - 1;
25998
26799
  data.sort(function (a, b) {
@@ -26000,7 +26801,7 @@
26000
26801
 
26001
26802
  for (var i = sorterCount; i >= 0; i--) {
26002
26803
  var sortItem = sortList[i];
26003
- result = _this3._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);
26804
+ result = _this4._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);
26004
26805
 
26005
26806
  if (result !== 0) {
26006
26807
  break;
@@ -26064,15 +26865,13 @@
26064
26865
  _createClass(Tooltip, [{
26065
26866
  key: "initialize",
26066
26867
  value: function initialize() {
26067
- this.deprecationCheck();
26868
+ this.deprecatedOptionsCheck();
26068
26869
  this.subscribe("column-init", this.initializeColumn.bind(this));
26069
26870
  }
26070
26871
  }, {
26071
- key: "deprecationCheck",
26072
- value: function deprecationCheck() {
26073
- if (typeof this.table.options.tooltipGenerationMode !== "undefined") {
26074
- console.warn("Use of the tooltipGenerationMode option is now deprecated. This option is no longer needed as tooltips are always generated on hover now");
26075
- }
26872
+ key: "deprecatedOptionsCheck",
26873
+ value: function deprecatedOptionsCheck() {
26874
+ this.deprecationCheckMsg("tooltipGenerationMode", "This option is no longer needed as tooltips are always generated on hover now");
26076
26875
  }
26077
26876
  }, {
26078
26877
  key: "initializeColumn",
@@ -26153,7 +26952,7 @@
26153
26952
  contentsEl.innerHTML = tooltip;
26154
26953
  }
26155
26954
 
26156
- if (tooltip || tooltip === 0 || tooltip === "0" || tooltip === false) {
26955
+ if (tooltip || tooltip === 0 || tooltip === false) {
26157
26956
  contentsEl.classList.add("tabulator-tooltip");
26158
26957
  contentsEl.addEventListener("mousemove", function (e) {
26159
26958
  return e.preventDefault();
@@ -26188,7 +26987,7 @@
26188
26987
  }
26189
26988
 
26190
26989
  value = Number(value);
26191
- return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
26990
+ return !isNaN(value) && isFinite(value) && Math.floor(value) === value;
26192
26991
  },
26193
26992
  //is float
26194
26993
  "float": function float(cell, value, parameters) {
@@ -26197,7 +26996,7 @@
26197
26996
  }
26198
26997
 
26199
26998
  value = Number(value);
26200
- return typeof value === 'number' && isFinite(value) && value % 1 !== 0;
26999
+ return !isNaN(value) && isFinite(value) && value % 1 !== 0;
26201
27000
  },
26202
27001
  //must be a number
26203
27002
  numeric: function numeric(cell, value, parameters) {
@@ -26273,7 +27072,7 @@
26273
27072
  parameters = parameters.split("|");
26274
27073
  }
26275
27074
 
26276
- return value === "" || parameters.indexOf(value) > -1;
27075
+ return parameters.indexOf(value) > -1;
26277
27076
  },
26278
27077
  //must match provided regex
26279
27078
  regex: function regex(cell, value, parameters) {
@@ -26681,7 +27480,8 @@
26681
27480
  }
26682
27481
 
26683
27482
  return TabulatorFull;
26684
- }(Tabulator);
27483
+ }(Tabulator); //bind modules and static functionality
27484
+
26685
27485
 
26686
27486
  new ModuleBinder(TabulatorFull, modules);
26687
27487