ngx-aur-mat-table 12.2.4 → 12.2.5

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.
@@ -995,19 +995,26 @@
995
995
  // we need this, in order to make pagination work with *ngIf
996
996
  NgxAurMatTableComponent.prototype.ngAfterViewInit = function () {
997
997
  var _this = this;
998
- this.tableDataSource.paginator = this.matPaginator;
998
+ this.initPaginator();
999
999
  this.initSortingDataAccessor();
1000
1000
  this.updateColumnOffsets();
1001
1001
  this.resizeColumnOffsetsObserver = new ResizeObserver(function () { return _this.updateColumnOffsets(); });
1002
1002
  this.resizeColumnOffsetsObserver.observe(this.table.nativeElement);
1003
1003
  };
1004
+ NgxAurMatTableComponent.prototype.initPaginator = function () {
1005
+ if (this.tableDataSource) {
1006
+ this.tableDataSource.paginator = this.matPaginator;
1007
+ }
1008
+ };
1004
1009
  NgxAurMatTableComponent.prototype.initSortingDataAccessor = function () {
1005
1010
  var _this = this;
1006
- this.tableDataSource.sort = this.matSort;
1007
- this.tableDataSource.sortingDataAccessor = function (data, key) {
1008
- var customSortFunction = _this.customSortFunctions.get(key);
1009
- return customSortFunction ? customSortFunction(data, key) : data[key];
1010
- };
1011
+ if (this.tableDataSource) {
1012
+ this.tableDataSource.sort = this.matSort;
1013
+ this.tableDataSource.sortingDataAccessor = function (data, key) {
1014
+ var customSortFunction = _this.customSortFunctions.get(key);
1015
+ return customSortFunction ? customSortFunction(data, key) : data[key];
1016
+ };
1017
+ }
1011
1018
  };
1012
1019
  NgxAurMatTableComponent.prototype.updateColumnOffsets = function () {
1013
1020
  var offsets = Array.from(this.table.nativeElement.querySelectorAll('th'))
@@ -1018,6 +1025,8 @@
1018
1025
  NgxAurMatTableComponent.prototype.prepareTableData = function () {
1019
1026
  this.initTable();
1020
1027
  this.initCustomSortFunctionsMap();
1028
+ this.initPaginator();
1029
+ this.initSortingDataAccessor();
1021
1030
  this.indexProvider = IndexProvider.create(this.tableConfig)
1022
1031
  .addIndexColumn(this.displayedColumns);
1023
1032
  this.rowActionsProvider = RowActionProvider.create(this.tableConfig)