mn-angular-lib 1.0.81 → 1.0.83

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.81",
3
+ "version": "1.0.83",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3"
@@ -2451,6 +2451,13 @@ declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>>
2451
2451
  loadingMoreRows: boolean;
2452
2452
  currentPage: number;
2453
2453
  pageSize: number;
2454
+ /**
2455
+ * Measured pixel height of the body container, applied as a `min-height` floor
2456
+ * while a server reload is in flight so the container can't collapse when the
2457
+ * data rows are swapped for skeletons. Released in {@link ngDoCheck} the moment
2458
+ * `isDataLoading` clears. `0` means no lock.
2459
+ */
2460
+ lockedMinHeight: number;
2454
2461
  protected readonly cdr: ChangeDetectorRef;
2455
2462
  protected readonly lang: MnLanguageService;
2456
2463
  /** Prefix used in validation error messages, e.g. `MnList`. Overridden by subclasses. */
@@ -2474,9 +2481,15 @@ declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>>
2474
2481
  /** Page-size options formatted for mn-select. */
2475
2482
  get pageSizeSelectOptions(): MnSelectOption<number>[];
2476
2483
  get visiblePages(): number[];
2477
- get skeletonRows(): number[];
2484
+ /**
2485
+ * Body container wrapping the skeleton/data swap region, used to measure its
2486
+ * height for {@link lockBodyHeight}. Implemented by each component with a
2487
+ * `@ViewChild('collectionBody')` so the template reference resolves there.
2488
+ */
2489
+ protected abstract collectionBody?: ElementRef<HTMLElement>;
2478
2490
  /** The toolbar template whose identity is watched in change detection. */
2479
2491
  protected abstract get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
2492
+ get skeletonRows(): number[];
2480
2493
  ngOnInit(): void;
2481
2494
  ngDoCheck(): void;
2482
2495
  ngOnDestroy(): void;
@@ -2495,6 +2508,13 @@ declare abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>>
2495
2508
  * Subclasses override to resolve their own keys; call `super` to keep these.
2496
2509
  */
2497
2510
  protected resolveTranslationKeys(): void;
2511
+ /**
2512
+ * Captures the body container's current height into {@link lockedMinHeight} so it
2513
+ * holds while a server reload swaps the data rows for skeletons. Must be called
2514
+ * while the old rows are still rendered (before delegating to the consumer), and
2515
+ * only locks when rows are present — the first load has nothing to preserve.
2516
+ */
2517
+ protected lockBodyHeight(): void;
2498
2518
  protected applyPagination(): void;
2499
2519
  /** Client-side search filtering shared by list and grid. */
2500
2520
  protected applySearchFilter(items: T[]): T[];
@@ -2641,6 +2661,7 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
2641
2661
  columnFilters: ColumnFilterState;
2642
2662
  protected readonly componentName = "MnTable";
2643
2663
  protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
2664
+ protected collectionBody?: ElementRef<HTMLElement>;
2644
2665
  /** Updates a column filter value and re-applies filtering. */
2645
2666
  onColumnFilter(columnKey: string, value: string): void;
2646
2667
  /** Filter options formatted for mn-select for a given column. */
@@ -4115,6 +4136,7 @@ declare class MnList<T = unknown> extends MnSelectableCollectionBase<T, ListData
4115
4136
  get skeletonLines(): Partial<MnSkeletonProps>[];
4116
4137
  onItemClick(item: T): void;
4117
4138
  protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
4139
+ protected collectionBody?: ElementRef<HTMLElement>;
4118
4140
  protected applyFilter(searchForItems: boolean): void;
4119
4141
  static ɵfac: i0.ɵɵFactoryDeclaration<MnList<any>, never>;
4120
4142
  static ɵcmp: i0.ɵɵComponentDeclaration<MnList<any>, "mn-list", never, {}, { "itemClick": "itemClick"; }, never, never, true, never>;
@@ -4190,6 +4212,7 @@ declare class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>>
4190
4212
  /** Skeleton lines for the default/lines placeholder; null when a custom template is used. */
4191
4213
  get skeletonLines(): Partial<MnSkeletonProps>[];
4192
4214
  protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
4215
+ protected collectionBody?: ElementRef<HTMLElement>;
4193
4216
  onItemClick(item: T): void;
4194
4217
  protected applyFilter(searchForItems: boolean): void;
4195
4218
  static ɵfac: i0.ɵɵFactoryDeclaration<MnGrid<any>, never>;
@@ -4933,6 +4956,15 @@ type MnTabDataSource = {
4933
4956
  items: MnTabItem[];
4934
4957
  /** Index of the tab that should be active by default. */
4935
4958
  defaultActive: number;
4959
+ /** When true, the tab bar renders a loading skeleton instead of the real tabs. */
4960
+ isDataLoading?: boolean;
4961
+ /**
4962
+ * Number of placeholder tabs to render while {@link isDataLoading} is true.
4963
+ * Defaults to the number of known `items`, falling back to 3 when no items are
4964
+ * known yet. Set this only when the real tabs are not yet known at load time
4965
+ * (e.g. tabs that depend on data being fetched) to predict the final count.
4966
+ */
4967
+ skeletonCount?: number;
4936
4968
  };
4937
4969
 
4938
4970
  /**
@@ -4956,6 +4988,11 @@ declare class MnTabComponent implements OnInit {
4956
4988
  activeChange: EventEmitter<MnTabItem>;
4957
4989
  /** The currently active tab item. */
4958
4990
  currentActive?: MnTabItem;
4991
+ /**
4992
+ * Index array sizing the loading skeleton: `skeletonCount` when provided,
4993
+ * otherwise the number of known items, falling back to a default when none.
4994
+ */
4995
+ get skeletonTabs(): number[];
4959
4996
  /** Initializes the default active tab based on the data source configuration. */
4960
4997
  ngOnInit(): void;
4961
4998
  /**