@rxap/material-table-system 13.0.0-next.4 → 13.0.0-next.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.
@@ -572,20 +572,22 @@ class TableDataSourceDirective {
572
572
  }
573
573
  ngOnInit() {
574
574
  const tableFilter = this._tableFilter ?? this.tableFilter ?? undefined;
575
- if (this.sourceMethod) {
576
- if (this.adapterFactory) {
577
- this.method = this.adapterFactory(this.sourceMethod, this.paginator, this.matSort, tableFilter, this.parameters);
575
+ if (!this.dataSource) {
576
+ if (this.sourceDataSource) {
577
+ this.dataSource = this.sourceDataSource;
578
578
  }
579
- else {
580
- this.method = this.sourceMethod;
579
+ else if (this.sourceMethod) {
580
+ if (this.adapterFactory) {
581
+ this.method = this.adapterFactory(this.sourceMethod, this.paginator, this.matSort, tableFilter, this.parameters);
582
+ }
583
+ else {
584
+ this.method = this.sourceMethod;
585
+ }
586
+ this.dataSource = new DynamicTableDataSource(this.method, this.paginator, this.matSort, tableFilter, this.parameters, this.method.metadata ?? { id: this.id });
587
+ }
588
+ if (!this.dataSource) {
589
+ throw new Error('The TABLE_DATA_SOURCE and TABLE_METHOD token are not defined!');
581
590
  }
582
- this.dataSource = new DynamicTableDataSource(this.method, this.paginator, this.matSort, tableFilter, this.parameters, this.method.metadata ?? { id: this.id });
583
- }
584
- else if (this.sourceDataSource) {
585
- this.dataSource = this.sourceDataSource;
586
- }
587
- else if (!this.dataSource) {
588
- throw new Error('The TABLE_DATA_SOURCE and TABLE_METHOD token are not defined!');
589
591
  }
590
592
  this.dataSource.paginator = this.paginator;
591
593
  this.dataSource.sort = this.matSort ?? undefined;