mn-angular-lib 1.0.159 → 1.0.161

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.159",
3
+ "version": "1.0.161",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3",
@@ -13,6 +13,11 @@
13
13
  so this is a no-op outside the native shell. */
14
14
  padding-bottom: env(safe-area-inset-bottom);
15
15
 
16
+ /* Scrolling the sheet's own content to either end must not hand the remaining delta
17
+ to whatever is behind it. The component's guard blocks gestures that start outside
18
+ the sheet; this stops the ones that start inside it from chaining out. */
19
+ overscroll-behavior: contain;
20
+
16
21
  /* Defined resting floor so the keyboard-grow (min-height -> max) animates from a set
17
22
  value instead of jumping from `auto`. A consumer-supplied `minHeightPx` (inline
18
23
  style) overrides this without disturbing the transition. */
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Provider, TemplateRef, OnInit, EventEmitter, OnChanges, ElementRef, PipeTransform, OnDestroy, DoCheck, ChangeDetectorRef, Type, ComponentRef, AfterViewInit, QueryList, ViewContainerRef, SimpleChanges, Signal } from '@angular/core';
2
+ import { InjectionToken, Provider, TemplateRef, OnInit, EventEmitter, OnChanges, ElementRef, OnDestroy, PipeTransform, DoCheck, ChangeDetectorRef, Type, ComponentRef, AfterViewInit, QueryList, ViewContainerRef, SimpleChanges, Signal } from '@angular/core';
3
3
  export { TemplateRef, Type } from '@angular/core';
4
4
  import * as tailwind_variants from 'tailwind-variants';
5
5
  import { VariantProps } from 'tailwind-variants';
@@ -2886,8 +2886,8 @@ declare class MnMultiSelect implements OnInit {
2886
2886
  * card) used to leave the portalled panel floating at its stale coordinates.
2887
2887
  */
2888
2888
  private scrollCapture;
2889
- /** The bottom-sheet host currently moved into `document.body`, if any. */
2890
- private movedSheet;
2889
+ /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */
2890
+ private sheetHost;
2891
2891
  /**
2892
2892
  * The dropdown panel element, queried while it is rendered by the `@if` block.
2893
2893
  * The setter relocates the panel to `document.body` so that its `position: fixed`
@@ -2918,10 +2918,9 @@ declare class MnMultiSelect implements OnInit {
2918
2918
  private readonly builtInErrorMessages;
2919
2919
  constructor();
2920
2920
  /**
2921
- * The bottom-sheet host, read as an `ElementRef` so it can be relocated to
2922
- * `document.body` its `position: fixed` children (backdrop + container) must anchor
2923
- * to the viewport, not to any transformed/filtered ancestor of this component. On open
2924
- * its container height is captured as the sheet's `min-height` floor.
2921
+ * The bottom-sheet host, kept as a reference for outside-click tests. The sheet
2922
+ * relocates itself to `document.body`, so nothing is moved here. On open its
2923
+ * container height is captured as the sheet's `min-height` floor.
2925
2924
  */
2926
2925
  set sheetRef(ref: ElementRef<HTMLElement> | undefined);
2927
2926
  /**
@@ -3347,8 +3346,8 @@ declare class MnDropdown implements OnInit {
3347
3346
  private static readonly SHEET_MAX_WIDTH;
3348
3347
  /** The anchored popover panel currently moved into `document.body`, if any. */
3349
3348
  private movedPanel;
3350
- /** The bottom-sheet host currently moved into `document.body`, if any. */
3351
- private movedSheet;
3349
+ /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */
3350
+ private sheetHost;
3352
3351
  /** Whether the viewport is currently narrow enough for the sheet layout. */
3353
3352
  private isNarrowViewport;
3354
3353
  /** Live breakpoint match, so rotating the device re-evaluates the layout. */
@@ -3536,12 +3535,19 @@ declare class MnDropdown implements OnInit {
3536
3535
  * dismissal is reported through {@link dismiss} for the host to act on (run a close
3537
3536
  * guard, tear down its overlay, …) rather than being handled here.
3538
3537
  *
3539
- * Positioning is `position: fixed` against the viewport, so a consumer whose sheet
3540
- * lives inside a `transform`/`filter` ancestor (which would otherwise become the
3541
- * containing block) must relocate this host to `document.body` as the
3542
- * multi-select does with its portal helper.
3538
+ * Positioning is `position: fixed` against the viewport, so the host relocates itself
3539
+ * to `document.body` on init and blocks scrolling behind it while open. Both are
3540
+ * unconditional: rendering viewport-fixed chrome in place made correctness depend on
3541
+ * where a consumer happened to write the tag. A `transform`/`filter`/`contain`
3542
+ * ancestor becomes the containing block and pushes the sheet to the middle of the
3543
+ * screen — which a *stacked* modal did to its own sheet — and, because `position:
3544
+ * fixed` moves where an element paints but not where it sits in the DOM, a gesture on
3545
+ * the backdrop still scrolled whichever ancestor was the scroll container.
3546
+ *
3547
+ * The multi-select and dropdown used to do the relocating themselves; that is why the
3548
+ * behaviour reads as new here but is not new to them.
3543
3549
  */
3544
- declare class MnBottomSheet {
3550
+ declare class MnBottomSheet implements OnInit, OnDestroy {
3545
3551
  /** Tailwind's `sm` breakpoint — at or below this the swipe gesture is armed.
3546
3552
  * Kept in step with the same constant in the modal shell and multi-select. */
3547
3553
  private static readonly SHEET_MAX_WIDTH;
@@ -3611,6 +3617,39 @@ declare class MnBottomSheet {
3611
3617
  /** In-flight exit animation, so a swipe-dismiss and a follow-up programmatic
3612
3618
  * {@link startClosing} share one glide instead of re-triggering it. */
3613
3619
  private exitPromise;
3620
+ /** The host node once moved to `document.body`, so it is only detached if we moved it. */
3621
+ private portalledHost;
3622
+ /** Blocks scroll gestures aimed at anything behind the sheet, while it is open. */
3623
+ private scrollGuard;
3624
+ /** Moves the host out to `document.body` and stops the page behind scrolling. */
3625
+ ngOnInit(): void;
3626
+ /**
3627
+ * Stops pointer scrolling behind the sheet for as long as it is open.
3628
+ *
3629
+ * Cancels the gesture rather than setting `overflow: hidden` on `document.body`: an
3630
+ * app whose scroll container is a layout element (a `<main>`, a drawer body) leaves
3631
+ * `body` unscrollable, so locking it there is a no-op and the page still slides about
3632
+ * under the sheet. Cancelling `wheel` and `touchmove` before anything acts on them
3633
+ * holds regardless of which element does the scrolling.
3634
+ *
3635
+ * Gestures that begin inside the sheet are let through so its own content still
3636
+ * scrolls; `overscroll-behavior: contain` keeps those from chaining out at the ends.
3637
+ *
3638
+ * Pointer input only. Page Down and the arrows still reach the page behind when focus
3639
+ * is left there — closing that needs either a key filter or moving focus into the
3640
+ * sheet, and neither belongs in this change.
3641
+ */
3642
+ private lockScroll;
3643
+ /** Releases the scroll guard. Idempotent. */
3644
+ private unlockScroll;
3645
+ /**
3646
+ * Detaches the relocated host.
3647
+ *
3648
+ * Angular tears a view down by removing the nodes it created from their parent; a
3649
+ * host we moved to `body` is no longer among the parent's children, so without
3650
+ * this the sheet would outlive the view that declared it.
3651
+ */
3652
+ ngOnDestroy(): void;
3614
3653
  get hostClasses(): string;
3615
3654
  /** Whether the viewport is currently narrow enough for the sheet to accept a swipe. */
3616
3655
  private get isNarrow();
@@ -5008,8 +5047,10 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
5008
5047
  * button and a stacked filter panel.
5009
5048
  */
5010
5049
  protected filtersCollapsed: boolean;
5011
- /** Whether the small-screen filter panel is currently expanded. */
5050
+ /** Whether the small-screen filter bottom sheet is currently open. */
5012
5051
  protected filtersPanelOpen: boolean;
5052
+ /** Small-screen filter sheet, held so the close button can play its exit. */
5053
+ protected filtersSheet?: MnBottomSheet;
5013
5054
  protected readonly componentName = "MnTable";
5014
5055
  protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;
5015
5056
  protected collectionBody?: ElementRef<HTMLElement>;
@@ -5068,12 +5109,16 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
5068
5109
  get hasColumnFilters(): boolean;
5069
5110
  /** Label for the "clear all filters" action in the small-screen panel. */
5070
5111
  get clearFiltersButtonLabel(): string;
5112
+ /** Accessible label for the filter sheet's close button. */
5113
+ get filtersCloseLabel(): string;
5071
5114
  /** Heading for the selection summary, with the count filled in. */
5072
5115
  get selectionSummaryTitle(): string;
5073
5116
  /** Label for the summary's clear-everything action. */
5074
5117
  get selectionClearAllLabel(): string;
5075
- /** Opens/closes the stacked filter panel shown on small screens. */
5076
- toggleFiltersPanel(): void;
5118
+ /** Opens the small-screen filter bottom sheet. */
5119
+ openFiltersPanel(): void;
5120
+ /** Plays the sheet's slide-down exit, then unmounts it. */
5121
+ closeFiltersPanel(): Promise<void>;
5077
5122
  private readonly baseTableClasses;
5078
5123
  /**
5079
5124
  * Column widths measured from the automatic layout and pinned, keyed by column