mn-angular-lib 1.0.97 → 1.0.99
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.
|
@@ -6783,16 +6783,15 @@ class MnModalShellComponent {
|
|
|
6783
6783
|
/** True while the user is actively dragging the grabber (disables snap transition). */
|
|
6784
6784
|
isDraggingSheet = false;
|
|
6785
6785
|
prevSample = null;
|
|
6786
|
-
/** True when this modal is currently presented as a bottom sheet (mobile config AND a
|
|
6787
|
-
* mobile-width viewport). Gates the swipe gesture and the open/drag haptics. */
|
|
6788
|
-
get isSheetViewport() {
|
|
6789
|
-
return this.isMobileSheet
|
|
6790
|
-
&& typeof window !== 'undefined'
|
|
6791
|
-
&& window.innerWidth <= MnModalShellComponent.SHEET_MAX_WIDTH;
|
|
6792
|
-
}
|
|
6793
6786
|
get hostClasses() {
|
|
6794
6787
|
const size = this.config.sizeWidth || ModalSize.MD;
|
|
6795
|
-
|
|
6788
|
+
// `closing` is intentionally NOT derived here. startClosing() adds the
|
|
6789
|
+
// `.closing` class imperatively (classList.add) for reliable, zoneless-safe
|
|
6790
|
+
// application. Deriving it from `isClosing` in this getter as well makes the
|
|
6791
|
+
// host class string flip value after the view has been checked, which throws
|
|
6792
|
+
// NG0100 (ExpressionChangedAfterItHasBeenCheckedError) in dev. Angular's class
|
|
6793
|
+
// binding only manages the tokens it emits, so it leaves the imperatively
|
|
6794
|
+
// added `.closing` untouched.
|
|
6796
6795
|
const animType = typeof this.config.animation === 'string'
|
|
6797
6796
|
? this.config.animation
|
|
6798
6797
|
: this.config.animation?.type || 'slide';
|
|
@@ -6800,7 +6799,7 @@ class MnModalShellComponent {
|
|
|
6800
6799
|
const stacked = this.isStacked ? ' is-stacked' : '';
|
|
6801
6800
|
const mobileSheet = this.isMobileSheet ? ' mobile-sheet' : '';
|
|
6802
6801
|
const swiping = this.swipeDismissing ? ' swipe-dismissing' : '';
|
|
6803
|
-
return `modal-shell modal-${size}${
|
|
6802
|
+
return `modal-shell modal-${size}${animation}${stacked}${mobileSheet}${swiping}`;
|
|
6804
6803
|
}
|
|
6805
6804
|
dragStartY = 0;
|
|
6806
6805
|
/** Whether the sheet can be dismissed at all (drives whether the swipe is armed). */
|
|
@@ -6817,10 +6816,6 @@ class MnModalShellComponent {
|
|
|
6817
6816
|
if (container) {
|
|
6818
6817
|
container.focus();
|
|
6819
6818
|
}
|
|
6820
|
-
// A light tick as the sheet slides up, matching native sheet presentation.
|
|
6821
|
-
if (this.isSheetViewport) {
|
|
6822
|
-
this.haptics?.impact('light');
|
|
6823
|
-
}
|
|
6824
6819
|
}
|
|
6825
6820
|
onSheetPointerDown(event) {
|
|
6826
6821
|
if (!this.isMobileSheet || !this.canClose)
|
|
@@ -6891,11 +6886,8 @@ class MnModalShellComponent {
|
|
|
6891
6886
|
return 0;
|
|
6892
6887
|
return (this.lastSample.y - this.prevSample.y) / dt;
|
|
6893
6888
|
}
|
|
6894
|
-
/** Springs the sheet back to
|
|
6889
|
+
/** Springs the sheet back to its resting position after a drag that didn't dismiss. */
|
|
6895
6890
|
snapBack() {
|
|
6896
|
-
if (this.sheetDragY > 0) {
|
|
6897
|
-
this.haptics?.impact('light');
|
|
6898
|
-
}
|
|
6899
6891
|
this.sheetDragY = 0;
|
|
6900
6892
|
}
|
|
6901
6893
|
/** Attempts to dismiss the modal. Resolves true if it was actually dismissed,
|