tabulator-tables 5.3.2 → 5.3.3

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 (35) hide show
  1. package/bower.json +1 -1
  2. package/dist/css/tabulator_bootstrap3.css +1 -1
  3. package/dist/css/tabulator_bootstrap3.css.map +1 -1
  4. package/dist/css/tabulator_bootstrap3.min.css +1 -1
  5. package/dist/css/tabulator_bootstrap3.min.css.map +1 -1
  6. package/dist/css/tabulator_bootstrap4.css +4 -4
  7. package/dist/css/tabulator_bootstrap4.css.map +1 -1
  8. package/dist/css/tabulator_bootstrap4.min.css +1 -1
  9. package/dist/css/tabulator_bootstrap4.min.css.map +1 -1
  10. package/dist/css/tabulator_bootstrap5.css +4 -4
  11. package/dist/css/tabulator_bootstrap5.css.map +1 -1
  12. package/dist/css/tabulator_bootstrap5.min.css +1 -1
  13. package/dist/css/tabulator_bootstrap5.min.css.map +1 -1
  14. package/dist/js/tabulator.js +151 -133
  15. package/dist/js/tabulator.js.map +1 -1
  16. package/dist/js/tabulator.min.js +2 -2
  17. package/dist/js/tabulator.min.js.map +1 -1
  18. package/dist/js/tabulator_esm.js +297 -283
  19. package/dist/js/tabulator_esm.js.map +1 -1
  20. package/dist/js/tabulator_esm.min.js +2 -2
  21. package/dist/js/tabulator_esm.min.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/js/core/ColumnManager.js +5 -1
  24. package/src/js/core/Module.js +54 -23
  25. package/src/js/core/RowManager.js +20 -23
  26. package/src/js/modules/DataTree/DataTree.js +0 -10
  27. package/src/js/modules/GroupRows/Group.js +3 -7
  28. package/src/js/modules/GroupRows/GroupComponent.js +1 -1
  29. package/src/js/modules/GroupRows/GroupRows.js +200 -199
  30. package/src/js/modules/Page/Page.js +2 -12
  31. package/src/js/modules/Persistence/Persistence.js +3 -2
  32. package/src/js/modules/SelectRow/SelectRow.js +8 -4
  33. package/src/scss/themes/bootstrap/tabulator_bootstrap3.scss +1 -1
  34. package/src/scss/themes/bootstrap/tabulator_bootstrap4.scss +1 -1
  35. package/src/scss/themes/bootstrap/tabulator_bootstrap5.scss +1 -1
@@ -1,4 +1,4 @@
1
- /* Tabulator v5.3.2 (c) Oliver Folkerd 2022 */
1
+ /* Tabulator v5.3.3 (c) Oliver Folkerd 2022 */
2
2
  class CoreFeature{
3
3
 
4
4
  constructor(table){
@@ -469,90 +469,121 @@ class Popup extends CoreFeature{
469
469
  }
470
470
 
471
471
  class Module extends CoreFeature{
472
-
472
+
473
473
  constructor(table, name){
474
474
  super(table);
475
-
475
+
476
476
  this._handler = null;
477
477
  }
478
-
478
+
479
479
  initialize(){
480
480
  // setup module when table is initialized, to be overridden in module
481
481
  }
482
-
483
-
482
+
483
+
484
484
  ///////////////////////////////////
485
485
  ////// Options Registration ///////
486
486
  ///////////////////////////////////
487
-
487
+
488
488
  registerTableOption(key, value){
489
489
  this.table.optionsList.register(key, value);
490
490
  }
491
-
491
+
492
492
  registerColumnOption(key, value){
493
493
  this.table.columnManager.optionsList.register(key, value);
494
494
  }
495
-
495
+
496
496
  ///////////////////////////////////
497
497
  /// Public Function Registration ///
498
498
  ///////////////////////////////////
499
-
499
+
500
500
  registerTableFunction(name, func){
501
501
  if(typeof this.table[name] === "undefined"){
502
502
  this.table[name] = (...args) => {
503
503
  this.table.initGuard(name);
504
-
504
+
505
505
  return func(...args);
506
506
  };
507
507
  }else {
508
508
  console.warn("Unable to bind table function, name already in use", name);
509
509
  }
510
510
  }
511
-
511
+
512
512
  registerComponentFunction(component, func, handler){
513
513
  return this.table.componentFunctionBinder.bind(component, func, handler);
514
514
  }
515
-
515
+
516
516
  ///////////////////////////////////
517
517
  ////////// Data Pipeline //////////
518
518
  ///////////////////////////////////
519
-
519
+
520
520
  registerDataHandler(handler, priority){
521
521
  this.table.rowManager.registerDataPipelineHandler(handler, priority);
522
522
  this._handler = handler;
523
523
  }
524
-
524
+
525
525
  registerDisplayHandler(handler, priority){
526
526
  this.table.rowManager.registerDisplayPipelineHandler(handler, priority);
527
527
  this._handler = handler;
528
528
  }
529
+
530
+ displayRows(adjust){
531
+ var index = this.table.rowManager.displayRows.length - 1,
532
+ lookupIndex;
533
+
534
+ if(this._handler){
535
+ lookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {
536
+ return item.handler === this._handler;
537
+ });
538
+
539
+ if(lookupIndex > -1){
540
+ index = lookupIndex;
541
+ }
542
+ }
543
+
544
+ if(adjust){
545
+ index = index + adjust;
546
+ }
529
547
 
548
+ if(this._handler){
549
+ if(index > -1){
550
+ return this.table.rowManager.getDisplayRows(index);
551
+ }else {
552
+ return this.activeRows();
553
+ }
554
+ }
555
+ }
556
+
557
+ activeRows(){
558
+ return this.table.rowManager.activeRows;
559
+ }
560
+
530
561
  refreshData(renderInPosition, handler){
531
562
  if(!handler){
532
563
  handler = this._handler;
533
564
  }
534
-
565
+
535
566
  if(handler){
536
567
  this.table.rowManager.refreshActiveData(handler, false, renderInPosition);
537
568
  }
538
569
  }
539
-
570
+
540
571
  ///////////////////////////////////
541
572
  //////// Footer Management ////////
542
573
  ///////////////////////////////////
543
-
574
+
544
575
  footerAppend(element){
545
576
  return this.table.footerManager.append(element);
546
577
  }
547
-
578
+
548
579
  footerPrepend(element){
549
580
  return this.table.footerManager.prepend(element);
550
581
  }
551
-
582
+
552
583
  footerRemove(element){
553
584
  return this.table.footerManager.remove(element);
554
585
  }
555
-
586
+
556
587
  ///////////////////////////////////
557
588
  //////// Popups Management ////////
558
589
  ///////////////////////////////////
@@ -560,15 +591,15 @@ class Module extends CoreFeature{
560
591
  popup(menuEl, menuContainer){
561
592
  return new Popup(this.table, menuEl, menuContainer);
562
593
  }
563
-
594
+
564
595
  ///////////////////////////////////
565
596
  //////// Alert Management ////////
566
597
  ///////////////////////////////////
567
-
598
+
568
599
  alert(content, type){
569
600
  return this.table.alertManager.alert(content, type);
570
601
  }
571
-
602
+
572
603
  clearAlert(){
573
604
  return this.table.alertManager.clear();
574
605
  }
@@ -4043,8 +4074,6 @@ class DataTree extends Module{
4043
4074
 
4044
4075
  this.startOpen = function(){};
4045
4076
 
4046
- this.displayIndex = 0;
4047
-
4048
4077
  this.registerTableOption("dataTree", false); //enable data tree
4049
4078
  this.registerTableOption("dataTreeFilter", true); //filter child rows
4050
4079
  this.registerTableOption("dataTreeSort", true); //sort child rows
@@ -4320,14 +4349,6 @@ class DataTree extends Module{
4320
4349
  }
4321
4350
  }
4322
4351
 
4323
- setDisplayIndex (index) {
4324
- this.displayIndex = index;
4325
- }
4326
-
4327
- getDisplayIndex () {
4328
- return this.displayIndex;
4329
- }
4330
-
4331
4352
  getRows(rows){
4332
4353
  var output = [];
4333
4354
 
@@ -11063,7 +11084,7 @@ class GroupComponent {
11063
11084
  }
11064
11085
 
11065
11086
  isVisible(){
11066
- return this._group.visible;
11087
+ return this._group._visible;
11067
11088
  }
11068
11089
 
11069
11090
  show(){
@@ -11465,9 +11486,7 @@ class Group{
11465
11486
  });
11466
11487
  }
11467
11488
 
11468
- this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
11469
-
11470
- this.groupManager.checkBasicModeGroupHeaderWidth();
11489
+ this.groupManager.updateGroupRows(true);
11471
11490
 
11472
11491
  }else {
11473
11492
  this.groupManager.updateGroupRows(true);
@@ -11505,10 +11524,8 @@ class Group{
11505
11524
  prev = rowEl;
11506
11525
  });
11507
11526
  }
11508
-
11509
- this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());
11510
-
11511
- this.groupManager.checkBasicModeGroupHeaderWidth();
11527
+
11528
+ this.groupManager.updateGroupRows(true);
11512
11529
  }else {
11513
11530
  this.groupManager.updateGroupRows(true);
11514
11531
  }
@@ -11690,20 +11707,19 @@ class Group{
11690
11707
  }
11691
11708
 
11692
11709
  class GroupRows extends Module{
11693
-
11710
+
11694
11711
  constructor(table){
11695
11712
  super(table);
11696
-
11713
+
11697
11714
  this.groupIDLookups = false; //enable table grouping and set field to group by
11698
11715
  this.startOpen = [function(){return false;}]; //starting state of group
11699
11716
  this.headerGenerator = [function(){return "";}];
11700
11717
  this.groupList = []; //ordered list of groups
11701
11718
  this.allowedValues = false;
11702
11719
  this.groups = {}; //hold row groups
11703
- this.displayIndex = 0; //index in display pipeline
11704
-
11720
+
11705
11721
  this.displayHandler = this.getRows.bind(this);
11706
-
11722
+
11707
11723
  //register table options
11708
11724
  this.registerTableOption("groupBy", false); //enable table grouping and set field to group by
11709
11725
  this.registerTableOption("groupStartOpen", true); //starting state of group
@@ -11716,7 +11732,7 @@ class GroupRows extends Module{
11716
11732
  this.registerTableOption("groupHeaderDownload", null);
11717
11733
  this.registerTableOption("groupToggleElement", "arrow");
11718
11734
  this.registerTableOption("groupClosedShowCalcs", false);
11719
-
11735
+
11720
11736
  //register table functions
11721
11737
  this.registerTableFunction("setGroupBy", this.setGroupBy.bind(this));
11722
11738
  this.registerTableFunction("setGroupValues", this.setGroupValues.bind(this));
@@ -11724,11 +11740,11 @@ class GroupRows extends Module{
11724
11740
  this.registerTableFunction("setGroupHeader", this.setGroupHeader.bind(this));
11725
11741
  this.registerTableFunction("getGroups", this.userGetGroups.bind(this));
11726
11742
  this.registerTableFunction("getGroupedData", this.userGetGroupedData.bind(this));
11727
-
11743
+
11728
11744
  //register component functions
11729
11745
  this.registerComponentFunction("row", "getGroup", this.rowGetGroup.bind(this));
11730
11746
  }
11731
-
11747
+
11732
11748
  //initialize group configuration
11733
11749
  initialize(){
11734
11750
  if(this.table.options.groupBy){
@@ -11736,7 +11752,7 @@ class GroupRows extends Module{
11736
11752
  this.subscribe("cell-value-updated", this.cellUpdated.bind(this));
11737
11753
  this.subscribe("row-data-changed", this.reassignRowToGroup.bind(this), 0);
11738
11754
  }
11739
-
11755
+
11740
11756
  this.subscribe("table-built", this.configureGroupSetup.bind(this));
11741
11757
 
11742
11758
  this.subscribe("row-deleting", this.rowDeleting.bind(this));
@@ -11746,73 +11762,73 @@ class GroupRows extends Module{
11746
11762
  this.subscribe("rows-added", this.rowsUpdated.bind(this));
11747
11763
  this.subscribe("row-moving", this.rowMoving.bind(this));
11748
11764
  this.subscribe("row-adding-index", this.rowAddingIndex.bind(this));
11749
-
11765
+
11750
11766
  this.subscribe("rows-sample", this.rowSample.bind(this));
11751
-
11767
+
11752
11768
  this.subscribe("render-virtual-fill", this.virtualRenderFill.bind(this));
11753
-
11769
+
11754
11770
  this.registerDisplayHandler(this.displayHandler, 20);
11755
-
11771
+
11756
11772
  this.initialized = true;
11757
11773
  }
11758
11774
  }
11759
-
11775
+
11760
11776
  configureGroupSetup(){
11761
11777
  if(this.table.options.groupBy){
11762
11778
  var groupBy = this.table.options.groupBy,
11763
11779
  startOpen = this.table.options.groupStartOpen,
11764
11780
  groupHeader = this.table.options.groupHeader;
11765
-
11781
+
11766
11782
  this.allowedValues = this.table.options.groupValues;
11767
-
11783
+
11768
11784
  if(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){
11769
11785
  console.warn("Error creating group headers, groupHeader array is shorter than groupBy array");
11770
11786
  }
11771
-
11787
+
11772
11788
  this.headerGenerator = [function(){return "";}];
11773
11789
  this.startOpen = [function(){return false;}]; //starting state of group
11774
-
11790
+
11775
11791
  this.langBind("groups|item", (langValue, lang) => {
11776
11792
  this.headerGenerator[0] = (value, count, data) => { //header layout function
11777
11793
  return (typeof value === "undefined" ? "" : value) + "<span>(" + count + " " + ((count === 1) ? langValue : lang.groups.items) + ")</span>";
11778
11794
  };
11779
11795
  });
11780
-
11796
+
11781
11797
  this.groupIDLookups = [];
11782
-
11798
+
11783
11799
  if(Array.isArray(groupBy)){
11784
11800
  if(this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "table" && this.table.options.columnCalcs != "both"){
11785
11801
  this.table.modules.columnCalcs.removeCalcs();
11786
11802
  }
11787
11803
  }else {
11788
11804
  if(this.table.modExists("columnCalcs") && this.table.options.columnCalcs != "group"){
11789
-
11805
+
11790
11806
  var cols = this.table.columnManager.getRealColumns();
11791
-
11807
+
11792
11808
  cols.forEach((col) => {
11793
11809
  if(col.definition.topCalc){
11794
11810
  this.table.modules.columnCalcs.initializeTopRow();
11795
11811
  }
11796
-
11812
+
11797
11813
  if(col.definition.bottomCalc){
11798
11814
  this.table.modules.columnCalcs.initializeBottomRow();
11799
11815
  }
11800
11816
  });
11801
11817
  }
11802
11818
  }
11803
-
11819
+
11804
11820
  if(!Array.isArray(groupBy)){
11805
11821
  groupBy = [groupBy];
11806
11822
  }
11807
-
11823
+
11808
11824
  groupBy.forEach((group, i) => {
11809
11825
  var lookupFunc, column;
11810
-
11826
+
11811
11827
  if(typeof group == "function"){
11812
11828
  lookupFunc = group;
11813
11829
  }else {
11814
11830
  column = this.table.columnManager.getColumnByField(group);
11815
-
11831
+
11816
11832
  if(column){
11817
11833
  lookupFunc = function(data){
11818
11834
  return column.getFieldValue(data);
@@ -11823,25 +11839,25 @@ class GroupRows extends Module{
11823
11839
  };
11824
11840
  }
11825
11841
  }
11826
-
11842
+
11827
11843
  this.groupIDLookups.push({
11828
11844
  field: typeof group === "function" ? false : group,
11829
11845
  func:lookupFunc,
11830
11846
  values:this.allowedValues ? this.allowedValues[i] : false,
11831
11847
  });
11832
11848
  });
11833
-
11849
+
11834
11850
  if(startOpen){
11835
11851
  if(!Array.isArray(startOpen)){
11836
11852
  startOpen = [startOpen];
11837
11853
  }
11838
-
11854
+
11839
11855
  startOpen.forEach((level) => {
11840
11856
  });
11841
-
11857
+
11842
11858
  this.startOpen = startOpen;
11843
11859
  }
11844
-
11860
+
11845
11861
  if(groupHeader){
11846
11862
  this.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];
11847
11863
  }
@@ -11850,218 +11866,216 @@ class GroupRows extends Module{
11850
11866
  this.groups = {};
11851
11867
  }
11852
11868
  }
11853
-
11869
+
11854
11870
  rowSample(rows, prevValue){
11855
- var group = this.getGroups(false)[0];
11856
-
11857
- prevValue.push(group.getRows(false)[0]);
11858
-
11871
+ if(this.table.options.groupBy){
11872
+ var group = this.getGroups(false)[0];
11873
+
11874
+ prevValue.push(group.getRows(false)[0]);
11875
+ }
11876
+
11859
11877
  return prevValue;
11860
11878
  }
11861
-
11879
+
11862
11880
  virtualRenderFill(){
11863
11881
  var el = this.table.rowManager.tableElement;
11864
11882
  var rows = this.table.rowManager.getVisibleRows();
11865
-
11866
- rows = rows.filter((row) => {
11867
- return row.type !== "group";
11868
- });
11869
-
11870
- el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : "";
11871
-
11872
- // if(this.table.options.groupBy){
11873
- // if(this.layoutMode() != "fitDataFill" && rowsCount == this.table.modules.groupRows.countGroups()){
11874
- // el.style.minWidth = this.table.columnManager.getWidth() + "px";
11875
- // }
11876
- // }
11883
+
11884
+ if(this.table.options.groupBy){
11885
+ rows = rows.filter((row) => {
11886
+ return row.type !== "group";
11887
+ });
11888
+
11889
+ el.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + "px" : "";
11890
+ }else {
11891
+ return rows;
11892
+ }
11877
11893
  }
11878
-
11894
+
11879
11895
  rowAddingIndex(row, index, top){
11880
- this.assignRowToGroup(row);
11881
-
11882
- var groupRows = row.modules.group.rows;
11883
-
11884
- if(groupRows.length > 1){
11885
- if(!index || (index && groupRows.indexOf(index) == -1)){
11886
- if(top){
11887
- if(groupRows[0] !== row){
11888
- index = groupRows[0];
11889
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
11896
+ if(this.table.options.groupBy){
11897
+ this.assignRowToGroup(row);
11898
+
11899
+ var groupRows = row.modules.group.rows;
11900
+
11901
+ if(groupRows.length > 1){
11902
+ if(!index || (index && groupRows.indexOf(index) == -1)){
11903
+ if(top){
11904
+ if(groupRows[0] !== row){
11905
+ index = groupRows[0];
11906
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
11907
+ }
11908
+ }else {
11909
+ if(groupRows[groupRows.length -1] !== row){
11910
+ index = groupRows[groupRows.length -1];
11911
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
11912
+ }
11890
11913
  }
11891
11914
  }else {
11892
- if(groupRows[groupRows.length -1] !== row){
11893
- index = groupRows[groupRows.length -1];
11894
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
11895
- }
11915
+ this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
11896
11916
  }
11897
- }else {
11898
- this.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);
11899
11917
  }
11918
+
11919
+ return index;
11900
11920
  }
11901
-
11902
- return index;
11903
11921
  }
11904
-
11922
+
11905
11923
  trackChanges(){
11906
11924
  this.dispatch("group-changed");
11907
11925
  }
11908
-
11926
+
11909
11927
  ///////////////////////////////////
11910
11928
  ///////// Table Functions /////////
11911
11929
  ///////////////////////////////////
11912
-
11930
+
11913
11931
  setGroupBy(groups){
11914
11932
  this.table.options.groupBy = groups;
11915
-
11933
+
11916
11934
  if(!this.initialized){
11917
11935
  this.initialize();
11918
11936
  }
11919
-
11937
+
11920
11938
  this.configureGroupSetup();
11921
-
11939
+
11922
11940
  this.refreshData();
11923
-
11941
+
11924
11942
  this.trackChanges();
11925
11943
  }
11926
-
11944
+
11927
11945
  setGroupValues(groupValues){
11928
11946
  this.table.options.groupValues = groupValues;
11929
11947
  this.configureGroupSetup();
11930
11948
  this.refreshData();
11931
-
11949
+
11932
11950
  this.trackChanges();
11933
11951
  }
11934
-
11952
+
11935
11953
  setGroupStartOpen(values){
11936
11954
  this.table.options.groupStartOpen = values;
11937
11955
  this.configureGroupSetup();
11938
-
11956
+
11939
11957
  if(this.table.options.groupBy){
11940
11958
  this.refreshData();
11941
-
11959
+
11942
11960
  this.trackChanges();
11943
11961
  }else {
11944
11962
  console.warn("Grouping Update - cant refresh view, no groups have been set");
11945
11963
  }
11946
11964
  }
11947
-
11965
+
11948
11966
  setGroupHeader(values){
11949
11967
  this.table.options.groupHeader = values;
11950
11968
  this.configureGroupSetup();
11951
-
11969
+
11952
11970
  if(this.table.options.groupBy){
11953
11971
  this.refreshData();
11954
-
11972
+
11955
11973
  this.trackChanges();
11956
11974
  }else {
11957
11975
  console.warn("Grouping Update - cant refresh view, no groups have been set");
11958
11976
  }
11959
11977
  }
11960
-
11978
+
11961
11979
  userGetGroups(values){
11962
11980
  return this.getGroups(true);
11963
11981
  }
11964
-
11982
+
11965
11983
  // get grouped table data in the same format as getData()
11966
11984
  userGetGroupedData(){
11967
11985
  return this.table.options.groupBy ?
11968
- this.getGroupedData() : this.getData();
11986
+ this.getGroupedData() : this.getData();
11969
11987
  }
11970
-
11971
-
11988
+
11989
+
11972
11990
  ///////////////////////////////////////
11973
11991
  ///////// Component Functions /////////
11974
11992
  ///////////////////////////////////////
11975
-
11993
+
11976
11994
  rowGetGroup(row){
11977
11995
  return row.modules.group ? row.modules.group.getComponent() : false;
11978
11996
  }
11979
-
11997
+
11980
11998
  ///////////////////////////////////
11981
11999
  ///////// Internal Logic //////////
11982
12000
  ///////////////////////////////////
11983
-
12001
+
11984
12002
  rowMoving(from, to, after){
11985
- if(!after && to instanceof Group){
11986
- to = this.table.rowManager.prevDisplayRow(from) || to;
11987
- }
11988
-
11989
- var toGroup = to instanceof Group ? to : to.modules.group;
11990
- var fromGroup = from instanceof Group ? from : from.modules.group;
11991
-
11992
- if(toGroup === fromGroup){
11993
- this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
11994
- }else {
11995
- if(fromGroup){
11996
- fromGroup.removeRow(from);
12003
+ if(this.table.options.groupBy){
12004
+ if(!after && to instanceof Group){
12005
+ to = this.table.rowManager.prevDisplayRow(from) || to;
12006
+ }
12007
+
12008
+ var toGroup = to instanceof Group ? to : to.modules.group;
12009
+ var fromGroup = from instanceof Group ? from : from.modules.group;
12010
+
12011
+ if(toGroup === fromGroup){
12012
+ this.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);
12013
+ }else {
12014
+ if(fromGroup){
12015
+ fromGroup.removeRow(from);
12016
+ }
12017
+
12018
+ toGroup.insertRow(from, to, after);
11997
12019
  }
11998
-
11999
- toGroup.insertRow(from, to, after);
12000
12020
  }
12001
12021
  }
12002
-
12003
-
12022
+
12023
+
12004
12024
  rowDeleting(row){
12005
12025
  //remove from group
12006
- if(row.modules.group){
12026
+ if(this.table.options.groupBy && row.modules.group){
12007
12027
  row.modules.group.removeRow(row);
12008
12028
  }
12009
12029
  }
12010
-
12011
-
12030
+
12012
12031
  rowsUpdated(row){
12013
- this.updateGroupRows(true);
12032
+ if(this.table.options.groupBy){
12033
+ this.updateGroupRows(true);
12034
+ }
12014
12035
  }
12015
-
12036
+
12016
12037
  cellUpdated(cell){
12017
- this.reassignRowToGroup(cell.row);
12018
- }
12019
-
12020
-
12021
- setDisplayIndex(index){
12022
- this.displayIndex = index;
12023
- }
12024
-
12025
- getDisplayIndex(){
12026
- return this.displayIndex;
12038
+ if(this.table.options.groupBy){
12039
+ this.reassignRowToGroup(cell.row);
12040
+ }
12027
12041
  }
12028
-
12042
+
12029
12043
  //return appropriate rows with group headers
12030
12044
  getRows(rows){
12031
12045
  if(this.table.options.groupBy && this.groupIDLookups.length){
12032
-
12046
+
12033
12047
  this.dispatchExternal("dataGrouping");
12034
-
12048
+
12035
12049
  this.generateGroups(rows);
12036
-
12050
+
12037
12051
  if(this.subscribedExternal("dataGrouped")){
12038
12052
  this.dispatchExternal("dataGrouped", this.getGroups(true));
12039
12053
  }
12040
-
12054
+
12041
12055
  return this.updateGroupRows();
12042
-
12056
+
12043
12057
  }else {
12044
12058
  return rows.slice(0);
12045
12059
  }
12046
12060
  }
12047
-
12061
+
12048
12062
  getGroups(component){
12049
12063
  var groupComponents = [];
12050
-
12064
+
12051
12065
  this.groupList.forEach(function(group){
12052
12066
  groupComponents.push(component ? group.getComponent() : group);
12053
12067
  });
12054
-
12068
+
12055
12069
  return groupComponents;
12056
12070
  }
12057
-
12071
+
12058
12072
  getChildGroups(group){
12059
12073
  var groupComponents = [];
12060
-
12074
+
12061
12075
  if(!group){
12062
12076
  group = this;
12063
12077
  }
12064
-
12078
+
12065
12079
  group.groupList.forEach((child) => {
12066
12080
  if(child.groupList.length){
12067
12081
  groupComponents = groupComponents.concat(this.getChildGroups(child));
@@ -12069,91 +12083,93 @@ class GroupRows extends Module{
12069
12083
  groupComponents.push(child);
12070
12084
  }
12071
12085
  });
12072
-
12086
+
12073
12087
  return groupComponents;
12074
12088
  }
12075
-
12089
+
12076
12090
  wipe(){
12077
- this.groupList.forEach(function(group){
12078
- group.wipe();
12079
- });
12091
+ if(this.table.options.groupBy){
12092
+ this.groupList.forEach(function(group){
12093
+ group.wipe();
12094
+ });
12095
+ }
12080
12096
  }
12081
-
12097
+
12082
12098
  pullGroupListData(groupList) {
12083
12099
  var groupListData = [];
12084
-
12100
+
12085
12101
  groupList.forEach((group) => {
12086
12102
  var groupHeader = {};
12087
12103
  groupHeader.level = 0;
12088
12104
  groupHeader.rowCount = 0;
12089
12105
  groupHeader.headerContent = "";
12090
12106
  var childData = [];
12091
-
12107
+
12092
12108
  if (group.hasSubGroups) {
12093
12109
  childData = this.pullGroupListData(group.groupList);
12094
-
12110
+
12095
12111
  groupHeader.level = group.level;
12096
12112
  groupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers
12097
12113
  groupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);
12098
-
12114
+
12099
12115
  groupListData.push(groupHeader);
12100
12116
  groupListData = groupListData.concat(childData);
12101
12117
  }
12102
-
12118
+
12103
12119
  else {
12104
12120
  groupHeader.level = group.level;
12105
12121
  groupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);
12106
12122
  groupHeader.rowCount = group.getRows().length;
12107
-
12123
+
12108
12124
  groupListData.push(groupHeader);
12109
-
12125
+
12110
12126
  group.getRows().forEach((row) => {
12111
12127
  groupListData.push(row.getData("data"));
12112
12128
  });
12113
12129
  }
12114
12130
  });
12115
-
12131
+
12116
12132
  return groupListData;
12117
12133
  }
12118
-
12134
+
12119
12135
  getGroupedData(){
12120
-
12136
+
12121
12137
  return this.pullGroupListData(this.groupList);
12122
12138
  }
12123
-
12139
+
12124
12140
  getRowGroup(row){
12125
12141
  var match = false;
12126
-
12142
+
12127
12143
  if(this.options("dataTree")){
12128
12144
  row = this.table.modules.dataTree.getTreeParentRoot(row);
12129
12145
  }
12130
-
12146
+
12131
12147
  this.groupList.forEach((group) => {
12132
12148
  var result = group.getRowGroup(row);
12133
-
12149
+
12134
12150
  if(result){
12135
12151
  match = result;
12136
12152
  }
12137
12153
  });
12138
-
12154
+
12139
12155
  return match;
12140
12156
  }
12141
-
12157
+
12142
12158
  countGroups(){
12143
12159
  return this.groupList.length;
12144
12160
  }
12145
-
12161
+
12146
12162
  generateGroups(rows){
12147
12163
  var oldGroups = this.groups;
12148
-
12164
+
12149
12165
  this.groups = {};
12150
12166
  this.groupList = [];
12151
-
12167
+
12152
12168
  if(this.allowedValues && this.allowedValues[0]){
12153
12169
  this.allowedValues[0].forEach((value) => {
12154
12170
  this.createGroup(value, 0, oldGroups);
12155
12171
  });
12156
-
12172
+
12157
12173
  rows.forEach((row) => {
12158
12174
  this.assignRowToExistingGroup(row, oldGroups);
12159
12175
  });
@@ -12163,53 +12179,53 @@ class GroupRows extends Module{
12163
12179
  });
12164
12180
  }
12165
12181
  }
12166
-
12182
+
12167
12183
  createGroup(groupID, level, oldGroups){
12168
12184
  var groupKey = level + "_" + groupID,
12169
12185
  group;
12170
-
12186
+
12171
12187
  oldGroups = oldGroups || [];
12172
-
12188
+
12173
12189
  group = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);
12174
-
12190
+
12175
12191
  this.groups[groupKey] = group;
12176
12192
  this.groupList.push(group);
12177
12193
  }
12178
-
12194
+
12179
12195
  assignRowToExistingGroup(row, oldGroups){
12180
12196
  var groupID = this.groupIDLookups[0].func(row.getData()),
12181
12197
  groupKey = "0_" + groupID;
12182
-
12198
+
12183
12199
  if(this.groups[groupKey]){
12184
12200
  this.groups[groupKey].addRow(row);
12185
12201
  }
12186
12202
  }
12187
-
12203
+
12188
12204
  assignRowToGroup(row, oldGroups){
12189
12205
  var groupID = this.groupIDLookups[0].func(row.getData()),
12190
12206
  newGroupNeeded = !this.groups["0_" + groupID];
12191
-
12207
+
12192
12208
  if(newGroupNeeded){
12193
12209
  this.createGroup(groupID, 0, oldGroups);
12194
12210
  }
12195
-
12211
+
12196
12212
  this.groups["0_" + groupID].addRow(row);
12197
-
12213
+
12198
12214
  return !newGroupNeeded;
12199
12215
  }
12200
-
12216
+
12201
12217
  reassignRowToGroup(row){
12202
12218
  if(row.type === "row"){
12203
12219
  var oldRowGroup = row.modules.group,
12204
12220
  oldGroupPath = oldRowGroup.getPath(),
12205
12221
  newGroupPath = this.getExpectedPath(row),
12206
12222
  samePath;
12207
-
12223
+
12208
12224
  // figure out if new group path is the same as old group path
12209
12225
  samePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {
12210
12226
  return element === newGroupPath[index];
12211
12227
  });
12212
-
12228
+
12213
12229
  // refresh if they new path and old path aren't the same (aka the row's groupings have changed)
12214
12230
  if(!samePath) {
12215
12231
  oldRowGroup.removeRow(row);
@@ -12218,79 +12234,81 @@ class GroupRows extends Module{
12218
12234
  }
12219
12235
  }
12220
12236
  }
12221
-
12237
+
12222
12238
  getExpectedPath(row) {
12223
12239
  var groupPath = [], rowData = row.getData();
12224
-
12240
+
12225
12241
  this.groupIDLookups.forEach((groupId) => {
12226
12242
  groupPath.push(groupId.func(rowData));
12227
12243
  });
12228
-
12244
+
12229
12245
  return groupPath;
12230
12246
  }
12231
-
12247
+
12232
12248
  updateGroupRows(force){
12233
12249
  var output = [];
12234
-
12250
+
12235
12251
  this.groupList.forEach((group) => {
12236
12252
  output = output.concat(group.getHeadersAndRows());
12237
12253
  });
12238
-
12254
+
12239
12255
  if(force){
12240
12256
  this.refreshData(true, this.displayHandler);
12241
12257
  }
12242
-
12258
+
12243
12259
  return output;
12244
12260
  }
12245
-
12261
+
12246
12262
  scrollHeaders(left){
12247
- if(this.table.options.renderHorizontal === "virtual"){
12248
- left -= this.table.columnManager.renderer.vDomPadLeft;
12263
+ if(this.table.options.groupBy){
12264
+ if(this.table.options.renderHorizontal === "virtual"){
12265
+ left -= this.table.columnManager.renderer.vDomPadLeft;
12266
+ }
12267
+
12268
+ left = left + "px";
12269
+
12270
+ this.groupList.forEach((group) => {
12271
+ group.scrollHeader(left);
12272
+ });
12249
12273
  }
12250
-
12251
- left = left + "px";
12252
-
12253
- this.groupList.forEach((group) => {
12254
- group.scrollHeader(left);
12255
- });
12256
12274
  }
12257
-
12275
+
12258
12276
  removeGroup(group){
12259
12277
  var groupKey = group.level + "_" + group.key,
12260
12278
  index;
12261
-
12279
+
12262
12280
  if(this.groups[groupKey]){
12263
12281
  delete this.groups[groupKey];
12264
-
12282
+
12265
12283
  index = this.groupList.indexOf(group);
12266
-
12284
+
12267
12285
  if(index > -1){
12268
12286
  this.groupList.splice(index, 1);
12269
12287
  }
12270
12288
  }
12271
12289
  }
12272
-
12290
+
12273
12291
  checkBasicModeGroupHeaderWidth(){
12274
12292
  var element = this.table.rowManager.tableElement,
12275
12293
  onlyGroupHeaders = true;
12276
-
12294
+
12277
12295
  this.table.rowManager.getDisplayRows().forEach((row, index) =>{
12278
12296
  this.table.rowManager.styleRow(row, index);
12279
12297
  element.appendChild(row.getElement());
12280
12298
  row.initialize(true);
12281
-
12299
+
12282
12300
  if(row.type !== "group"){
12283
12301
  onlyGroupHeaders = false;
12284
12302
  }
12285
12303
  });
12286
-
12304
+
12287
12305
  if(onlyGroupHeaders){
12288
12306
  element.style.minWidth = this.table.columnManager.getWidth() + "px";
12289
12307
  }else {
12290
12308
  element.style.minWidth = "";
12291
12309
  }
12292
12310
  }
12293
-
12311
+
12294
12312
  }
12295
12313
 
12296
12314
  GroupRows.moduleName = "groupRows";
@@ -15028,8 +15046,6 @@ class Page extends Module{
15028
15046
 
15029
15047
  this.remoteRowCountEstimate = null;
15030
15048
 
15031
- this.displayIndex = 0; //index in display pipeline
15032
-
15033
15049
  this.initialLoad = true;
15034
15050
  this.dataChanging = false; //flag to check if data is being changed by this module
15035
15051
 
@@ -15475,14 +15491,6 @@ class Page extends Module{
15475
15491
  this.dispatch("page-changed");
15476
15492
  }
15477
15493
 
15478
- setDisplayIndex(index){
15479
- this.displayIndex = index;
15480
- }
15481
-
15482
- getDisplayIndex(){
15483
- return this.displayIndex;
15484
- }
15485
-
15486
15494
  //calculate maximum page from number of rows
15487
15495
  setMaxRows(rowCount){
15488
15496
  if(!rowCount){
@@ -15549,9 +15557,9 @@ class Page extends Module{
15549
15557
  }
15550
15558
 
15551
15559
  setPageToRow(row){
15552
- var rows = this.table.rowManager.getDisplayRows(this.displayIndex - 1);
15560
+ var rows = this.displayRows(-1);
15553
15561
  var index = rows.indexOf(row);
15554
-
15562
+
15555
15563
  if(index > -1){
15556
15564
  var page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);
15557
15565
 
@@ -16144,9 +16152,10 @@ class Persistence extends Module{
16144
16152
  keys.forEach((key)=>{
16145
16153
  var props = Object.getOwnPropertyDescriptor(def, key);
16146
16154
  var value = def[key];
16155
+
16147
16156
  if(props){
16148
16157
  Object.defineProperty(def, key, {
16149
- set: function(newValue){
16158
+ set: (newValue) => {
16150
16159
  value = newValue;
16151
16160
 
16152
16161
  if(!this.defWatcherBlock){
@@ -16157,7 +16166,7 @@ class Persistence extends Module{
16157
16166
  props.set(newValue);
16158
16167
  }
16159
16168
  },
16160
- get:function(){
16169
+ get:() => {
16161
16170
  if(props.get){
16162
16171
  props.get();
16163
16172
  }
@@ -18214,18 +18223,22 @@ class SelectRow extends Module{
18214
18223
  break;
18215
18224
 
18216
18225
  case "string":
18217
-
18218
18226
  rowMatch = this.table.rowManager.findRow(rows);
18219
18227
 
18220
18228
  if(rowMatch){
18221
18229
  this._selectRow(rowMatch, true, true);
18230
+ this._rowSelectionChanged();
18222
18231
  }else {
18223
- this.table.rowManager.getRows(rows).forEach((row) => {
18232
+ rowMatch = this.table.rowManager.getRows(rows);
18233
+
18234
+ rowMatch.forEach((row) => {
18224
18235
  this._selectRow(row, true, true);
18225
18236
  });
18237
+
18238
+ if(rowMatch.length){
18239
+ this._rowSelectionChanged();
18240
+ }
18226
18241
  }
18227
-
18228
- this._rowSelectionChanged();
18229
18242
  break;
18230
18243
 
18231
18244
  default:
@@ -20914,6 +20927,8 @@ class ColumnManager extends CoreFeature {
20914
20927
  var minHeight = 0;
20915
20928
 
20916
20929
  if(!this.redrawBlock){
20930
+
20931
+ this.element.style.height="";
20917
20932
 
20918
20933
  this.columns.forEach((column) => {
20919
20934
  column.clearVerticalAlign();
@@ -20926,7 +20941,9 @@ class ColumnManager extends CoreFeature {
20926
20941
  minHeight = height;
20927
20942
  }
20928
20943
  });
20929
-
20944
+
20945
+ this.element.style.height = minHeight + "px";
20946
+
20930
20947
  this.columns.forEach((column) => {
20931
20948
  column.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);
20932
20949
  });
@@ -22739,10 +22756,6 @@ class RowManager extends CoreFeature{
22739
22756
  this.displayRowsCount = this.displayRows[0].length;
22740
22757
  }
22741
22758
 
22742
- getNextDisplayIndex(){
22743
- return this.displayRows.length;
22744
- }
22745
-
22746
22759
  //set display row pipeline data
22747
22760
  setDisplayRows(displayRows, index){
22748
22761
  this.displayRows[index] = displayRows;
@@ -22780,23 +22793,24 @@ class RowManager extends CoreFeature{
22780
22793
 
22781
22794
  //return only actual rows (not group headers etc)
22782
22795
  getRows(type){
22783
- var rows;
22784
-
22785
- switch(type){
22786
- case "active":
22787
- rows = this.activeRows;
22788
- break;
22789
-
22790
- case "display":
22791
- rows = this.table.rowManager.getDisplayRows();
22792
- break;
22793
-
22794
- case "visible":
22795
- rows = this.getVisibleRows(false, true);
22796
- break;
22796
+ var rows = [];
22797
+
22798
+ if(!type){
22799
+ rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
22800
+ }else {
22801
+ switch(type){
22802
+ case "active":
22803
+ rows = this.activeRows;
22804
+ break;
22797
22805
 
22798
- default:
22799
- rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows;
22806
+ case "display":
22807
+ rows = this.table.rowManager.getDisplayRows();
22808
+ break;
22809
+
22810
+ case "visible":
22811
+ rows = this.getVisibleRows(false, true);
22812
+ break;
22813
+ }
22800
22814
  }
22801
22815
 
22802
22816
  return rows;
@@ -22905,9 +22919,6 @@ class RowManager extends CoreFeature{
22905
22919
 
22906
22920
  this.scrollTop = 0;
22907
22921
  this.scrollLeft = 0;
22908
-
22909
- // clear empty table placeholder min
22910
- this.tableElement.style.minWidth = "";
22911
22922
 
22912
22923
  this.renderer.clearRows();
22913
22924
  }
@@ -22924,6 +22935,9 @@ class RowManager extends CoreFeature{
22924
22935
  _clearPlaceholder(){
22925
22936
  if(this.placeholder && this.placeholder.parentNode){
22926
22937
  this.placeholder.parentNode.removeChild(this.placeholder);
22938
+
22939
+ // clear empty table placeholder min
22940
+ this.tableElement.style.minWidth = "";
22927
22941
  }
22928
22942
  }
22929
22943