mn-angular-lib 1.0.92 → 1.0.93

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mn-angular-lib",
3
- "version": "1.0.92",
3
+ "version": "1.0.93",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3"
@@ -5464,7 +5464,7 @@ type MnTabDataSource = {
5464
5464
  * Tab component that renders a horizontal tab bar.
5465
5465
  * Supports translation keys for labels via MnTranslatePipe.
5466
5466
  */
5467
- declare class MnTabComponent implements OnInit {
5467
+ declare class MnTabComponent implements DoCheck {
5468
5468
  /** Data source containing tab items and default active index. */
5469
5469
  dataSource: MnTabDataSource;
5470
5470
  /**
@@ -5486,18 +5486,32 @@ declare class MnTabComponent implements OnInit {
5486
5486
  * otherwise the number of known items, falling back to a default when none.
5487
5487
  */
5488
5488
  get skeletonTabs(): number[];
5489
- /** Initializes the default active tab based on the data source configuration. */
5490
- ngOnInit(): void;
5491
5489
  /**
5492
- * Returns the resolved badge value for a tab item, supporting both plain numbers and Signal<number>.
5493
- * @param item - The tab item whose badge to resolve.
5490
+ * Re-resolves the active tab on every change-detection pass.
5491
+ *
5492
+ * The data source is often populated or rebuilt asynchronously (tabs that
5493
+ * depend on fetched data or permissions). Resolving the active tab only once
5494
+ * at init would leave {@link currentActive} pointing at a stale item — the
5495
+ * tab bar would then highlight nothing and swallow the first click — so the
5496
+ * selection is kept in sync with whatever the data source currently holds.
5494
5497
  */
5495
- getBadge(item: MnTabItem): number | undefined;
5498
+ ngDoCheck(): void;
5496
5499
  /**
5497
5500
  * Sets the given tab item as active, invoking deactivate/activate callbacks.
5498
5501
  * @param item - The tab item to activate.
5499
5502
  */
5500
5503
  setActive(item: MnTabItem): void;
5504
+ /**
5505
+ * Returns the resolved badge value for a tab item, supporting both plain numbers and Signal<number>.
5506
+ * @param item - The tab item whose badge to resolve.
5507
+ */
5508
+ getBadge(item: MnTabItem): number | undefined;
5509
+ /**
5510
+ * Ensures {@link currentActive} references a tab that still exists in the data
5511
+ * source, falling back to the configured default tab when the current
5512
+ * selection is missing or stale (e.g. after the items array is replaced).
5513
+ */
5514
+ private syncActiveTab;
5501
5515
  static ɵfac: i0.ɵɵFactoryDeclaration<MnTabComponent, never>;
5502
5516
  static ɵcmp: i0.ɵɵComponentDeclaration<MnTabComponent, "mn-tab", never, { "dataSource": { "alias": "dataSource"; "required": false; }; "scrollable": { "alias": "scrollable"; "required": false; }; "justified": { "alias": "justified"; "required": false; }; }, { "activeChange": "activeChange"; }, never, never, true, never>;
5503
5517
  }