tabulator-tables 5.1.3 → 5.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.1.3 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.1.6 (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) :
@@ -2542,9 +2542,11 @@
2542
2542
  _this.vDomPadLeft = 0;
2543
2543
  _this.vDomPadRight = 0;
2544
2544
  _this.fitDataColAvg = 0;
2545
- _this.window = 200; //pixel margin to make column visible before it is shown on screen
2545
+ _this.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen
2546
2546
 
2547
+ _this.visibleRows = null;
2547
2548
  _this.initialized = false;
2549
+ _this.isFitData = false;
2548
2550
  _this.columns = [];
2549
2551
  return _this;
2550
2552
  }
@@ -2553,6 +2555,8 @@
2553
2555
  key: "initialize",
2554
2556
  value: function initialize() {
2555
2557
  this.compatibilityCheck();
2558
+ this.layoutCheck();
2559
+ this.vertScrollListen();
2556
2560
  }
2557
2561
  }, {
2558
2562
  key: "compatibilityCheck",
@@ -2591,6 +2595,20 @@
2591
2595
 
2592
2596
 
2593
2597
  return ok;
2598
+ }
2599
+ }, {
2600
+ key: "layoutCheck",
2601
+ value: function layoutCheck() {
2602
+ this.isFitData = this.options("layout").startsWith('fitData');
2603
+ }
2604
+ }, {
2605
+ key: "vertScrollListen",
2606
+ value: function vertScrollListen() {
2607
+ var _this2 = this;
2608
+
2609
+ this.subscribe("scroll-vertical", function () {
2610
+ _this2.visibleRows = null;
2611
+ });
2594
2612
  } //////////////////////////////////////
2595
2613
  ///////// Public Functions ///////////
2596
2614
  //////////////////////////////////////
@@ -2605,29 +2623,45 @@
2605
2623
  value: function scrollColumns(left, dir) {
2606
2624
  if (this.scrollLeft != left) {
2607
2625
  this.scrollLeft = left;
2608
- this.scroll(left - (this.vDomScrollPosLeft + this.window));
2626
+ this.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));
2609
2627
  }
2610
2628
  }
2629
+ }, {
2630
+ key: "calcWindowBuffer",
2631
+ value: function calcWindowBuffer() {
2632
+ var buffer = this.elementVertical.clientWidth;
2633
+ this.table.columnManager.columnsByIndex.forEach(function (column) {
2634
+ if (column.visible) {
2635
+ var width = column.getWidth();
2636
+
2637
+ if (width > buffer) {
2638
+ buffer = width;
2639
+ }
2640
+ }
2641
+ });
2642
+ this.windowBuffer = buffer * 2;
2643
+ }
2611
2644
  }, {
2612
2645
  key: "rerenderColumns",
2613
2646
  value: function rerenderColumns(update, blockRedraw) {
2614
- var _this2 = this;
2647
+ var _this3 = this;
2615
2648
 
2616
2649
  var old = {
2617
2650
  cols: this.columns,
2618
2651
  leftCol: this.leftCol,
2619
2652
  rightCol: this.rightCol
2620
- };
2653
+ },
2654
+ colPos = 0;
2621
2655
 
2622
2656
  if (update && !this.initialized) {
2623
2657
  return;
2624
2658
  }
2625
2659
 
2626
2660
  this.clear();
2661
+ this.calcWindowBuffer();
2627
2662
  this.scrollLeft = this.elementVertical.scrollLeft;
2628
- this.vDomScrollPosLeft = this.scrollLeft - this.window;
2629
- this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.window;
2630
- var colPos = 0;
2663
+ this.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;
2664
+ this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;
2631
2665
  this.table.columnManager.columnsByIndex.forEach(function (column) {
2632
2666
  var config = {};
2633
2667
 
@@ -2637,26 +2671,26 @@
2637
2671
  config.rightPos = colPos + width;
2638
2672
  config.width = width;
2639
2673
 
2640
- if (_this2.options("layout") === "fitData") {
2674
+ if (_this3.isFitData) {
2641
2675
  config.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;
2642
2676
  }
2643
2677
 
2644
- if (colPos + width > _this2.vDomScrollPosLeft && colPos < _this2.vDomScrollPosRight) {
2678
+ if (colPos + width > _this3.vDomScrollPosLeft && colPos < _this3.vDomScrollPosRight) {
2645
2679
  //column is visible
2646
- if (_this2.leftCol == -1) {
2647
- _this2.leftCol = _this2.columns.length;
2648
- _this2.vDomPadLeft = colPos;
2680
+ if (_this3.leftCol == -1) {
2681
+ _this3.leftCol = _this3.columns.length;
2682
+ _this3.vDomPadLeft = colPos;
2649
2683
  }
2650
2684
 
2651
- _this2.rightCol = _this2.columns.length;
2685
+ _this3.rightCol = _this3.columns.length;
2652
2686
  } else {
2653
2687
  // column is hidden
2654
- if (_this2.leftCol !== -1) {
2655
- _this2.vDomPadRight += width;
2688
+ if (_this3.leftCol !== -1) {
2689
+ _this3.vDomPadRight += width;
2656
2690
  }
2657
2691
  }
2658
2692
 
2659
- _this2.columns.push(column);
2693
+ _this3.columns.push(column);
2660
2694
 
2661
2695
  column.modules.vdomHoz = config;
2662
2696
  colPos += width;
@@ -2720,7 +2754,7 @@
2720
2754
  }, {
2721
2755
  key: "dataChange",
2722
2756
  value: function dataChange() {
2723
- var _this3 = this;
2757
+ var _this4 = this;
2724
2758
 
2725
2759
  var change = false,
2726
2760
  collsWidth = 0,
@@ -2728,7 +2762,7 @@
2728
2762
  row,
2729
2763
  rowEl;
2730
2764
 
2731
- if (this.options("layout") === "fitData") {
2765
+ if (this.isFitData) {
2732
2766
  this.table.columnManager.columnsByIndex.forEach(function (column) {
2733
2767
  if (!column.definition.width && column.visible) {
2734
2768
  change = true;
@@ -2737,9 +2771,9 @@
2737
2771
 
2738
2772
  if (change) {
2739
2773
  if (change && this.table.rowManager.getDisplayRows().length) {
2740
- this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.window;
2774
+ this.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;
2741
2775
  var row = this.chain("rows-sample", [1], [], function () {
2742
- return _this3.table.rowManager.getDisplayRows()[0];
2776
+ return _this4.table.rowManager.getDisplayRows();
2743
2777
  })[0];
2744
2778
 
2745
2779
  if (row) {
@@ -2751,19 +2785,15 @@
2751
2785
  var cell = row.cells[colEnd];
2752
2786
  rowEl.appendChild(cell.getElement());
2753
2787
  cell.column.reinitializeWidth();
2754
- collsWidth += cell.column.getWidth();
2755
-
2756
- if (collsWidth > this.vDomScrollPosRight) {
2757
- break;
2758
- }
2788
+ collsWidth += cell.column.getWidth(); // if(collsWidth > this.vDomScrollPosRight){
2789
+ // break;
2790
+ // }
2759
2791
  }
2760
2792
 
2761
- rowEl.parentNode.removeChild(rowEl);
2762
- this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));
2763
-
2764
- for (colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++) {
2765
- this.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);
2766
- }
2793
+ rowEl.parentNode.removeChild(rowEl); // this.fitDataColAvg = Math.floor(collsWidth / (colEnd + 1));
2794
+ // for(colEnd; colEnd < this.table.columnManager.columnsByIndex.length; colEnd++){
2795
+ // this.table.columnManager.columnsByIndex[colEnd].setWidth(this.fitDataColAvg);
2796
+ // }
2767
2797
 
2768
2798
  this.rerenderColumns(false, true);
2769
2799
  }
@@ -2779,7 +2809,7 @@
2779
2809
  }, {
2780
2810
  key: "reinitChanged",
2781
2811
  value: function reinitChanged(old) {
2782
- var _this4 = this;
2812
+ var _this5 = this;
2783
2813
 
2784
2814
  var match = true;
2785
2815
 
@@ -2788,7 +2818,7 @@
2788
2818
  }
2789
2819
 
2790
2820
  old.cols.forEach(function (col, i) {
2791
- if (col !== _this4.columns[i]) {
2821
+ if (col !== _this5.columns[i]) {
2792
2822
  match = false;
2793
2823
  }
2794
2824
  });
@@ -2797,20 +2827,29 @@
2797
2827
  }, {
2798
2828
  key: "reinitializeRows",
2799
2829
  value: function reinitializeRows() {
2800
- var _this5 = this;
2830
+ var _this6 = this;
2801
2831
 
2802
- var rows = this.table.rowManager.getVisibleRows();
2832
+ var rows = this.getVisibleRows();
2803
2833
  rows.forEach(function (row) {
2804
- _this5.reinitializeRow(row, true);
2834
+ _this6.reinitializeRow(row, true);
2805
2835
  });
2806
2836
  }
2837
+ }, {
2838
+ key: "getVisibleRows",
2839
+ value: function getVisibleRows() {
2840
+ if (!this.visibleRows) {
2841
+ this.visibleRows = this.table.rowManager.getVisibleRows();
2842
+ }
2843
+
2844
+ return this.visibleRows;
2845
+ }
2807
2846
  }, {
2808
2847
  key: "scroll",
2809
2848
  value: function scroll(diff) {
2810
2849
  this.vDomScrollPosLeft += diff;
2811
2850
  this.vDomScrollPosRight += diff;
2812
2851
 
2813
- if (diff > this.elementVertical.clientWidth * .8) {
2852
+ if (Math.abs(diff) > this.windowBuffer / 2) {
2814
2853
  this.rerenderColumns();
2815
2854
  } else {
2816
2855
  if (diff > 0) {
@@ -2836,117 +2875,197 @@
2836
2875
  }, {
2837
2876
  key: "addColRight",
2838
2877
  value: function addColRight() {
2839
- var column = this.columns[this.rightCol + 1],
2840
- rows;
2878
+ var _this7 = this;
2841
2879
 
2842
- if (column && column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight) {
2843
- rows = this.table.rowManager.getVisibleRows();
2844
- rows.forEach(function (row) {
2845
- if (row.type !== "group") {
2846
- var cell = row.getCell(column);
2847
- row.getElement().appendChild(cell.getElement());
2848
- cell.cellRendered();
2849
- }
2850
- });
2851
- this.fitDataColActualWidthCheck(column);
2852
- this.rightCol++; // Don't move this below the >= check below
2880
+ var changes = false;
2881
+
2882
+ var _loop = function _loop() {
2883
+ var column = _this7.columns[_this7.rightCol + 1];
2884
+
2885
+ if (column) {
2886
+ if (column.modules.vdomHoz.leftPos <= _this7.vDomScrollPosRight) {
2887
+ changes = true;
2888
+
2889
+ _this7.getVisibleRows().forEach(function (row) {
2890
+ if (row.type !== "group") {
2891
+ var cell = row.getCell(column);
2892
+ row.getElement().appendChild(cell.getElement());
2893
+ cell.cellRendered();
2894
+ }
2895
+ });
2896
+
2897
+ _this7.fitDataColActualWidthCheck(column);
2898
+
2899
+ _this7.rightCol++; // Don't move this below the >= check below
2853
2900
 
2854
- if (this.rightCol >= this.columns.length - 1) {
2855
- this.vDomPadRight = 0;
2901
+ if (_this7.rightCol >= _this7.columns.length - 1) {
2902
+ _this7.vDomPadRight = 0;
2903
+ } else {
2904
+ _this7.vDomPadRight -= column.getWidth();
2905
+ }
2906
+ } else {
2907
+ return "break";
2908
+ }
2856
2909
  } else {
2857
- this.vDomPadRight -= column.getWidth();
2910
+ return "break";
2858
2911
  }
2912
+ };
2859
2913
 
2914
+ while (true) {
2915
+ var _ret = _loop();
2916
+
2917
+ if (_ret === "break") break;
2918
+ }
2919
+
2920
+ if (changes) {
2860
2921
  this.tableElement.style.paddingRight = this.vDomPadRight + "px";
2861
- this.addColRight();
2862
2922
  }
2863
2923
  }
2864
2924
  }, {
2865
2925
  key: "addColLeft",
2866
2926
  value: function addColLeft() {
2867
- var column = this.columns[this.leftCol - 1],
2868
- rows;
2927
+ var _this8 = this;
2869
2928
 
2870
- if (column && column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft) {
2871
- var rows = this.table.rowManager.getVisibleRows();
2872
- rows.forEach(function (row) {
2873
- if (row.type !== "group") {
2874
- var cell = row.getCell(column);
2875
- row.getElement().prepend(cell.getElement());
2876
- cell.cellRendered();
2877
- }
2878
- });
2879
- this.fitDataColActualWidthCheck(column);
2880
- this.leftCol--; // don't move this below the <= check below
2929
+ var changes = false;
2930
+
2931
+ var _loop2 = function _loop2() {
2932
+ var column = _this8.columns[_this8.leftCol - 1];
2933
+
2934
+ if (column) {
2935
+ if (column.modules.vdomHoz.rightPos >= _this8.vDomScrollPosLeft) {
2936
+ changes = true;
2937
+
2938
+ _this8.getVisibleRows().forEach(function (row) {
2939
+ if (row.type !== "group") {
2940
+ var cell = row.getCell(column);
2941
+ row.getElement().prepend(cell.getElement());
2942
+ cell.cellRendered();
2943
+ }
2944
+ });
2945
+
2946
+ _this8.leftCol--; // don't move this below the <= check below
2881
2947
 
2882
- if (this.leftCol <= 0) {
2883
- // replicating logic in addColRight
2884
- this.vDomPadLeft = 0;
2948
+ if (_this8.leftCol <= 0) {
2949
+ // replicating logic in addColRight
2950
+ _this8.vDomPadLeft = 0;
2951
+ } else {
2952
+ _this8.vDomPadLeft -= column.getWidth();
2953
+ }
2954
+
2955
+ var diff = _this8.fitDataColActualWidthCheck(column);
2956
+
2957
+ if (diff) {
2958
+ _this8.scrollLeft = _this8.elementVertical.scrollLeft = _this8.elementVertical.scrollLeft + diff;
2959
+ _this8.vDomPadRight -= diff;
2960
+ }
2961
+ } else {
2962
+ return "break";
2963
+ }
2885
2964
  } else {
2886
- this.vDomPadLeft -= column.getWidth();
2965
+ return "break";
2887
2966
  }
2967
+ };
2968
+
2969
+ while (true) {
2970
+ var _ret2 = _loop2();
2888
2971
 
2972
+ if (_ret2 === "break") break;
2973
+ }
2974
+
2975
+ if (changes) {
2889
2976
  this.tableElement.style.paddingLeft = this.vDomPadLeft + "px";
2890
- this.addColLeft();
2891
2977
  }
2892
2978
  }
2893
2979
  }, {
2894
2980
  key: "removeColRight",
2895
- value: function removeColRight(column) {
2896
- var column = this.columns[this.rightCol],
2897
- rows;
2981
+ value: function removeColRight() {
2982
+ var _this9 = this;
2898
2983
 
2899
- if (column && column.modules.vdomHoz.leftPos > this.vDomScrollPosRight) {
2900
- rows = this.table.rowManager.getVisibleRows();
2901
- column.modules.vdomHoz.visible = false;
2902
- rows.forEach(function (row) {
2903
- if (row.type !== "group") {
2904
- var cell = row.getCell(column);
2984
+ var changes = false;
2905
2985
 
2906
- try {
2907
- row.getElement().removeChild(cell.getElement());
2908
- } catch (ex) {
2909
- console.warn("Could not removeColRight", ex.message);
2910
- }
2986
+ var _loop3 = function _loop3() {
2987
+ var column = _this9.columns[_this9.rightCol];
2988
+
2989
+ if (column) {
2990
+ if (column.modules.vdomHoz.leftPos > _this9.vDomScrollPosRight) {
2991
+ changes = true;
2992
+
2993
+ _this9.getVisibleRows().forEach(function (row) {
2994
+ if (row.type !== "group") {
2995
+ var cell = row.getCell(column);
2996
+
2997
+ try {
2998
+ row.getElement().removeChild(cell.getElement());
2999
+ } catch (ex) {
3000
+ console.warn("Could not removeColRight", ex.message);
3001
+ }
3002
+ }
3003
+ });
3004
+
3005
+ _this9.vDomPadRight += column.getWidth();
3006
+ _this9.rightCol--;
3007
+ } else {
3008
+ return "break";
2911
3009
  }
2912
- });
2913
- this.vDomPadRight += column.getWidth();
3010
+ } else {
3011
+ return "break";
3012
+ }
3013
+ };
3014
+
3015
+ while (true) {
3016
+ var _ret3 = _loop3();
3017
+
3018
+ if (_ret3 === "break") break;
3019
+ }
3020
+
3021
+ if (changes) {
2914
3022
  this.tableElement.style.paddingRight = this.vDomPadRight + "px";
2915
- this.rightCol--;
2916
- this.removeColRight();
2917
3023
  }
2918
3024
  }
2919
3025
  }, {
2920
3026
  key: "removeColLeft",
2921
3027
  value: function removeColLeft() {
2922
- var column = this.columns[this.leftCol],
2923
- rows;
3028
+ var _this10 = this;
2924
3029
 
2925
- if (column && column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft) {
2926
- rows = this.table.rowManager.getVisibleRows();
2927
- rows.forEach(function (row) {
2928
- var cell, el;
3030
+ var changes = false;
2929
3031
 
2930
- if (row.type !== "group") {
2931
- cell = row.getCell(column);
3032
+ var _loop4 = function _loop4() {
3033
+ var column = _this10.columns[_this10.leftCol];
2932
3034
 
2933
- if (cell) {
2934
- el = cell.getElement();
3035
+ if (column) {
3036
+ if (column.modules.vdomHoz.rightPos < _this10.vDomScrollPosLeft) {
3037
+ changes = true;
3038
+
3039
+ _this10.getVisibleRows().forEach(function (row) {
3040
+ if (row.type !== "group") {
3041
+ var cell = row.getCell(column);
2935
3042
 
2936
- if (el.parentNode) {
2937
3043
  try {
2938
- row.getElement().removeChild(el);
3044
+ row.getElement().removeChild(cell.getElement());
2939
3045
  } catch (ex) {
2940
3046
  console.warn("Could not removeColLeft", ex.message);
2941
3047
  }
2942
3048
  }
2943
- }
3049
+ });
3050
+
3051
+ _this10.vDomPadLeft += column.getWidth();
3052
+ _this10.leftCol++;
3053
+ } else {
3054
+ return "break";
2944
3055
  }
2945
- });
2946
- this.vDomPadLeft += column.getWidth();
3056
+ } else {
3057
+ return "break";
3058
+ }
3059
+ };
3060
+
3061
+ while (true) {
3062
+ var _ret4 = _loop4();
3063
+
3064
+ if (_ret4 === "break") break;
3065
+ }
3066
+
3067
+ if (changes) {
2947
3068
  this.tableElement.style.paddingLeft = this.vDomPadLeft + "px";
2948
- this.leftCol++;
2949
- this.removeColLeft();
2950
3069
  }
2951
3070
  }
2952
3071
  }, {
@@ -2962,11 +3081,13 @@
2962
3081
  if (widthDiff) {
2963
3082
  column.modules.vdomHoz.rightPos += widthDiff;
2964
3083
  column.modules.vdomHoz.width = newWidth;
2965
- this.colPositionAdjust(this.rightCol + 2, this.columns.length, widthDiff);
3084
+ this.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);
2966
3085
  }
2967
3086
 
2968
3087
  column.modules.vdomHoz.fitDataCheck = false;
2969
3088
  }
3089
+
3090
+ return widthDiff;
2970
3091
  }
2971
3092
  }, {
2972
3093
  key: "initializeRow",
@@ -3884,6 +4005,7 @@
3884
4005
 
3885
4006
  this.dispatch("row-layout-before", this);
3886
4007
  this.generateCells();
4008
+ this.initialized = true;
3887
4009
  this.table.columnManager.renderer.renderRowCells(this);
3888
4010
 
3889
4011
  if (force) {
@@ -3891,7 +4013,6 @@
3891
4013
  }
3892
4014
 
3893
4015
  this.dispatch("row-layout", this);
3894
- this.initialized = true;
3895
4016
 
3896
4017
  if (this.table.options.rowFormatter) {
3897
4018
  this.table.options.rowFormatter(this.getComponent());
@@ -6099,7 +6220,7 @@
6099
6220
  this.containerElement.innerHTML = this.table.options.footerElement;
6100
6221
  } else {
6101
6222
  this.external = true;
6102
- this.element = document.querySelector(this.table.options.footerElement);
6223
+ this.containerElement = document.querySelector(this.table.options.footerElement);
6103
6224
  }
6104
6225
 
6105
6226
  break;
@@ -6458,7 +6579,7 @@
6458
6579
  return row.getElement() === target;
6459
6580
  });
6460
6581
 
6461
- if (targets["row"].parentNode && targets["row"].parentNode.closest(".tabulator-row")) {
6582
+ if (targets["row"] && targets["row"].parentNode && targets["row"].parentNode.closest(".tabulator-row")) {
6462
6583
  targets[key] = false;
6463
6584
  }
6464
6585
  }
@@ -8140,7 +8261,7 @@
8140
8261
  value: function _clearObjectPointers() {
8141
8262
  this.options.columns = this.options.columns.slice(0);
8142
8263
 
8143
- if (this.options.data && !this.options.reactiveData) {
8264
+ if (Array.isArray(this.options.data) && !this.options.reactiveData) {
8144
8265
  this.options.data = this.options.data.slice(0);
8145
8266
  }
8146
8267
  } //build tabulator element
@@ -14560,7 +14681,9 @@
14560
14681
  if (col) {
14561
14682
  var cellEl = document.createElement("td"),
14562
14683
  column = col.component._column,
14684
+ index = _this8.table.columnManager.findColumnIndex(column),
14563
14685
  value = col.value;
14686
+
14564
14687
  var cellWrapper = {
14565
14688
  modules: {},
14566
14689
  getValue: function getValue() {
@@ -14615,8 +14738,8 @@
14615
14738
  cellEl.innerHTML = value;
14616
14739
  }
14617
14740
 
14618
- if (styles.firstCell) {
14619
- _this8.mapElementStyles(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"]);
14741
+ if (styles.styleCells[index] || styles.firstCell) {
14742
+ _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"]);
14620
14743
 
14621
14744
  if (column.definition.align) {
14622
14745
  cellEl.style.textAlign = column.definition.align;
@@ -15253,8 +15376,9 @@
15253
15376
  });
15254
15377
  editorElement.addEventListener("focus", function (e) {
15255
15378
  var left = _this3.table.columnManager.element.scrollLeft;
15379
+ var headerPos = _this3.table.rowManager.element.scrollLeft + parseInt(_this3.table.columnManager.element.style.marginLeft);
15256
15380
 
15257
- if (left !== _this3.table.rowManager.element.scrollLeft) {
15381
+ if (left !== headerPos) {
15258
15382
  _this3.table.rowManager.scrollHorizontal(left);
15259
15383
 
15260
15384
  _this3.table.columnManager.scrollHorizontal(left);
@@ -16281,6 +16405,7 @@
16281
16405
  var checkbox = document.createElement("input");
16282
16406
  var blocked = false;
16283
16407
  checkbox.type = 'checkbox';
16408
+ checkbox.setAttribute("aria-label", "Select Row");
16284
16409
 
16285
16410
  if (this.table.modExists("selectRow", true)) {
16286
16411
  checkbox.addEventListener("click", function (e) {
@@ -16702,13 +16827,9 @@
16702
16827
  var rows;
16703
16828
 
16704
16829
  if (this.active) {
16705
- clearTimeout(this.scrollEndTimer); //layout all rows after scroll is complete
16706
-
16707
- this.scrollEndTimer = setTimeout(function () {
16708
- _this2.layout();
16709
- }, 100);
16830
+ clearTimeout(this.scrollEndTimer);
16710
16831
  rows = this.table.rowManager.getVisibleRows();
16711
- this.calcMargins();
16832
+ this.calcMargins(true);
16712
16833
  this.layoutColumnPosition();
16713
16834
  this.layoutCalcRows();
16714
16835
  rows.forEach(function (row) {
@@ -16716,17 +16837,18 @@
16716
16837
  _this2.layoutRow(row);
16717
16838
  }
16718
16839
  });
16719
- this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
16720
16840
  }
16721
16841
  } //calculate margins for rows
16722
16842
 
16723
16843
  }, {
16724
16844
  key: "calcMargins",
16725
- value: function calcMargins() {
16726
- this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px";
16727
- this.table.columnManager.headersElement.style.marginLeft = this.leftMargin;
16728
- this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px";
16729
- this.table.columnManager.element.style.paddingRight = this.rightMargin; //calculate right frozen columns
16845
+ value: function calcMargins(scroll) {
16846
+ if (!scroll) {
16847
+ this.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + "px";
16848
+ this.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + "px";
16849
+ this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
16850
+ } //calculate right frozen columns
16851
+
16730
16852
 
16731
16853
  this.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;
16732
16854
  } //layout calculation rows
@@ -16774,8 +16896,16 @@
16774
16896
  var _this4 = this;
16775
16897
 
16776
16898
  var leftParents = [];
16899
+ var leftMargin = 0;
16900
+ var rightMargin = 0;
16901
+ this.table.columnManager.headersElement.style.marginLeft = this.leftMargin;
16902
+ this.table.columnManager.element.style.paddingRight = this.rightMargin;
16777
16903
  this.leftColumns.forEach(function (column, i) {
16778
- column.modules.frozen.margin = _this4._calcSpace(_this4.leftColumns, i) + _this4.table.columnManager.scrollLeft + "px";
16904
+ column.modules.frozen.margin = leftMargin + _this4.table.columnManager.scrollLeft + "px";
16905
+
16906
+ if (column.visible) {
16907
+ leftMargin += column.getWidth();
16908
+ }
16779
16909
 
16780
16910
  if (i == _this4.leftColumns.length - 1) {
16781
16911
  column.modules.frozen.edge = true;
@@ -16806,7 +16936,11 @@
16806
16936
  }
16807
16937
  });
16808
16938
  this.rightColumns.forEach(function (column, i) {
16809
- column.modules.frozen.margin = _this4.rightPadding - _this4._calcSpace(_this4.rightColumns, i + 1) + "px";
16939
+ if (column.visible) {
16940
+ rightMargin += column.getWidth();
16941
+ }
16942
+
16943
+ column.modules.frozen.margin = _this4.rightPadding - rightMargin + "px";
16810
16944
 
16811
16945
  if (i == _this4.rightColumns.length - 1) {
16812
16946
  column.modules.frozen.edge = true;
@@ -16849,7 +16983,6 @@
16849
16983
  this.layoutCalcRows(); //calculate left columns
16850
16984
 
16851
16985
  this.layoutColumnPosition(true);
16852
- this.table.rowManager.tableElement.style.marginRight = this.rightMargin;
16853
16986
  }
16854
16987
  }
16855
16988
  }, {
@@ -20049,13 +20182,11 @@
20049
20182
  } //move menu to start on bottom edge if it is too close to the edge of the screen
20050
20183
 
20051
20184
 
20052
- if (y + element.offsetHeight >= this.menuContainer.offsetHeight) {
20053
- element.style.top = "";
20054
-
20185
+ if (y + element.offsetHeight > this.menuContainer.offsetHeight) {
20055
20186
  if (parentEl) {
20056
- element.style.bottom = this.menuContainer.offsetHeight - parentOffset.top - parentEl.offsetHeight - 1 + "px";
20187
+ element.style.top = parseInt(element.style.top) - element.offsetHeight + parentEl.offsetHeight + 1 + "px";
20057
20188
  } else {
20058
- element.style.bottom = this.menuContainer.offsetHeight - y + "px";
20189
+ element.style.top = parseInt(element.style.top) - element.offsetHeight + "px";
20059
20190
  }
20060
20191
  }
20061
20192
  }
@@ -21243,19 +21374,28 @@
21243
21374
  this.table.modules.localize.langBind("pagination|counter|showing", function (value) {
21244
21375
  showingEl.innerHTML = value;
21245
21376
  });
21246
- valueEl.innerHTML = " " + currentRow + "-" + Math.min(currentRow + pageSize - 1, totalRows) + " ";
21247
21377
  this.table.modules.localize.langBind("pagination|counter|of", function (value) {
21248
21378
  ofEl.innerHTML = value;
21249
21379
  });
21250
- totalEl.innerHTML = " " + totalRows + " ";
21251
21380
  this.table.modules.localize.langBind("pagination|counter|rows", function (value) {
21252
21381
  rowsEl.innerHTML = value;
21253
21382
  });
21254
- el.appendChild(showingEl);
21255
- el.appendChild(valueEl);
21256
- el.appendChild(ofEl);
21257
- el.appendChild(totalEl);
21258
- el.appendChild(rowsEl);
21383
+
21384
+ if (totalRows) {
21385
+ valueEl.innerHTML = " " + currentRow + "-" + Math.min(currentRow + pageSize - 1, totalRows) + " ";
21386
+ totalEl.innerHTML = " " + totalRows + " ";
21387
+ el.appendChild(showingEl);
21388
+ el.appendChild(valueEl);
21389
+ el.appendChild(ofEl);
21390
+ el.appendChild(totalEl);
21391
+ el.appendChild(rowsEl);
21392
+ } else {
21393
+ valueEl.innerHTML = " 0 ";
21394
+ el.appendChild(showingEl);
21395
+ el.appendChild(valueEl);
21396
+ el.appendChild(rowsEl);
21397
+ }
21398
+
21259
21399
  return el;
21260
21400
  }
21261
21401
 
@@ -21892,17 +22032,17 @@
21892
22032
  }
21893
22033
  }, {
21894
22034
  key: "_setPageCounter",
21895
- value: function _setPageCounter(totalRows) {
21896
- var content, currentRow;
22035
+ value: function _setPageCounter(totalRows, size, currentRow) {
22036
+ var content;
21897
22037
 
21898
22038
  if (this.pageCounter) {
21899
- currentRow = (this.page - 1) * this.size + 1;
21900
-
21901
22039
  if (this.mode === "remote") {
22040
+ size = this.size;
22041
+ currentRow = (this.page - 1) * this.size + 1;
21902
22042
  totalRows = this.remoteRowCountEstimate;
21903
22043
  }
21904
22044
 
21905
- content = this.pageCounter.call(this, this.size, currentRow, this.page, totalRows, this.max);
22045
+ content = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);
21906
22046
 
21907
22047
  switch (_typeof(content)) {
21908
22048
  case "object":
@@ -22050,7 +22190,14 @@
22050
22190
  }, {
22051
22191
  key: "getRows",
22052
22192
  value: function getRows(data) {
22053
- var output, start, end;
22193
+ var actualRowPageSize = 0,
22194
+ output,
22195
+ start,
22196
+ end,
22197
+ actualStartRow;
22198
+ var actualRows = data.filter(function (row) {
22199
+ return row.type === "row";
22200
+ });
22054
22201
 
22055
22202
  if (this.mode == "local") {
22056
22203
  output = [];
@@ -22067,18 +22214,28 @@
22067
22214
  this._setPageButtons();
22068
22215
 
22069
22216
  for (var i = start; i < end; i++) {
22070
- if (data[i]) {
22071
- output.push(data[i]);
22217
+ var row = data[i];
22218
+
22219
+ if (row) {
22220
+ output.push(row);
22221
+
22222
+ if (row.type === "row") {
22223
+ if (!actualStartRow) {
22224
+ actualStartRow = row;
22225
+ }
22226
+
22227
+ actualRowPageSize++;
22228
+ }
22072
22229
  }
22073
22230
  }
22074
22231
 
22075
- this._setPageCounter(data.length);
22232
+ this._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? actualRows.indexOf(actualStartRow) + 1 : 0);
22076
22233
 
22077
22234
  return output;
22078
22235
  } else {
22079
22236
  this._setPageButtons();
22080
22237
 
22081
- this._setPageCounter(data.length);
22238
+ this._setPageCounter(actualRows.length);
22082
22239
 
22083
22240
  return data.slice(0);
22084
22241
  }
@@ -22177,7 +22334,7 @@
22177
22334
  }, {
22178
22335
  key: "footerRedraw",
22179
22336
  value: function footerRedraw() {
22180
- var footer = this.table.footerManager.element;
22337
+ var footer = this.table.footerManager.containerElement;
22181
22338
 
22182
22339
  if (Math.ceil(footer.clientWidth) - footer.scrollWidth < 0) {
22183
22340
  this.pagesElement.style.display = 'none';
@@ -24353,7 +24510,9 @@
24353
24510
  self._deselectRow(self.selectedRows[0], true);
24354
24511
  }
24355
24512
 
24356
- self._rowSelectionChanged(silent);
24513
+ if (rowCount) {
24514
+ self._rowSelectionChanged(silent);
24515
+ }
24357
24516
  } else {
24358
24517
  if (Array.isArray(rows)) {
24359
24518
  rows.forEach(function (row) {