mn-angular-lib 0.0.61 → 0.0.62

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.
@@ -3321,10 +3321,25 @@ class MnTable {
3321
3321
  dataSubscription;
3322
3322
  searchSubject = new Subject();
3323
3323
  searchSubscription;
3324
+ /** Tracks the previous toolbar template reference for change detection. */
3325
+ previousToolbarTemplate;
3326
+ /**
3327
+ * Checks for changes to dataSource properties that are not covered
3328
+ * by Angular's default change detection (e.g. toolbarTemplate).
3329
+ */
3330
+ ngDoCheck() {
3331
+ const currentTemplate = this.dataSource?.toolbarTemplate;
3332
+ if (currentTemplate !== this.previousToolbarTemplate) {
3333
+ this.previousToolbarTemplate = currentTemplate;
3334
+ this.cdr.markForCheck();
3335
+ }
3336
+ }
3324
3337
  ngOnInit() {
3325
3338
  this.currentSort = this.dataSource.defaultSort ?? null;
3326
- this.filteredItems = this.dataSource.dataRows.value;
3327
- this.dataSubscription = this.dataSource.dataRows.subscribe(() => {
3339
+ this.applyFilterAndSort(false);
3340
+ // Skip the initial BehaviorSubject emission (already handled above)
3341
+ // to avoid triggering markForCheck during the first change detection cycle.
3342
+ this.dataSubscription = this.dataSource.dataRows.pipe(skip(1)).subscribe(() => {
3328
3343
  this.applyFilterAndSort(false);
3329
3344
  this.cdr.markForCheck();
3330
3345
  });