mn-angular-lib 1.0.71 → 1.0.72

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.71",
3
+ "version": "1.0.72",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.1.3",
6
6
  "@angular/core": "^21.1.3"
@@ -45,6 +45,42 @@
45
45
  to { opacity: 0; transform: scale(0.95); }
46
46
  }
47
47
 
48
+ @keyframes slideUpIn {
49
+ from {
50
+ opacity: 0;
51
+ transform: translateY(100%);
52
+ }
53
+ to {
54
+ opacity: 1;
55
+ transform: translateY(0);
56
+ }
57
+ }
58
+
59
+ @keyframes slideUpOut {
60
+ from {
61
+ opacity: 1;
62
+ transform: translateY(0);
63
+ }
64
+ to {
65
+ opacity: 0;
66
+ transform: translateY(100%);
67
+ }
68
+ }
69
+
70
+ /* Open animations — keyed by the same .anim-* host classes as the close animations
71
+ below, so mobile bottom-sheet overrides can target both in one place. */
72
+ :host(.anim-slide) .modal-container {
73
+ animation: slideIn 0.2s ease-in-out;
74
+ }
75
+
76
+ :host(.anim-fade) .modal-container {
77
+ animation: fadeIn 0.2s ease-in-out;
78
+ }
79
+
80
+ :host(.anim-zoom) .modal-container {
81
+ animation: zoomIn 0.2s ease-in-out;
82
+ }
83
+
48
84
  :host(.closing) .modal-backdrop {
49
85
  animation: fadeOut 0.15s ease-in-out forwards;
50
86
  }
@@ -60,3 +96,36 @@
60
96
  :host(.closing).anim-zoom .modal-container {
61
97
  animation: zoomOut 0.15s ease-in-out forwards;
62
98
  }
99
+
100
+ /* =========================
101
+ Mobile bottom sheet (< 640px), gated by the .mobile-sheet host class.
102
+ Anchors the modal to the bottom, makes it full-width with rounded top
103
+ corners, and overrides every open/close animation with a slide-up.
104
+ ========================= */
105
+ @media (max-width: 639.98px) {
106
+ :host(.mobile-sheet) {
107
+ align-items: flex-end;
108
+ }
109
+
110
+ :host(.mobile-sheet) .modal-container {
111
+ width: 100%;
112
+ max-width: 100%;
113
+ max-height: 92vh;
114
+ border-radius: 1rem 1rem 0 0;
115
+ animation: slideUpIn 0.25s ease-out;
116
+ }
117
+
118
+ /* Override whichever anim-* open animation was selected */
119
+ :host(.mobile-sheet).anim-slide .modal-container,
120
+ :host(.mobile-sheet).anim-fade .modal-container,
121
+ :host(.mobile-sheet).anim-zoom .modal-container {
122
+ animation: slideUpIn 0.25s ease-out;
123
+ }
124
+
125
+ :host(.mobile-sheet).closing .modal-container,
126
+ :host(.mobile-sheet).closing.anim-slide .modal-container,
127
+ :host(.mobile-sheet).closing.anim-fade .modal-container,
128
+ :host(.mobile-sheet).closing.anim-zoom .modal-container {
129
+ animation: slideUpOut 0.2s ease-in forwards;
130
+ }
131
+ }
@@ -3027,6 +3027,11 @@ type BaseModalConfig<TResult = unknown> = {
3027
3027
  i18n?: ModalI18nLabels;
3028
3028
  /** Animation configuration */
3029
3029
  animation?: AnimationOptions | AnimationOptions['type'];
3030
+ /**
3031
+ * Whether the modal renders as a bottom sheet on small screens (< 640px).
3032
+ * Defaults to true. Set to false to keep it a centered dialog on mobile.
3033
+ */
3034
+ mobileBottomSheet?: boolean;
3030
3035
  /** Custom component to render in the modal body */
3031
3036
  component?: Type<unknown>;
3032
3037
  /** Custom template to render in the modal body */
@@ -3255,6 +3260,11 @@ declare abstract class BaseModalBuilder<TConfig extends BaseModalConfig<TResult>
3255
3260
  template(template: TemplateRef<unknown>): this;
3256
3261
  inputs(inputs: ModalInputMap): this;
3257
3262
  animation(animation: AnimationOptions | AnimationOptions['type']): this;
3263
+ /**
3264
+ * Control whether the modal renders as a bottom sheet on small screens (< 640px).
3265
+ * Enabled by default; pass `false` to keep a centered dialog on mobile.
3266
+ */
3267
+ mobileBottomSheet(enabled?: boolean): this;
3258
3268
  /**
3259
3269
  * Add a custom body/content to the modal.
3260
3270
  */
@@ -3398,6 +3408,8 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
3398
3408
  asConfirmation(config: ModalConfig<TResult>): ConfirmationModalConfig;
3399
3409
  asCustom(config: ModalConfig<TResult>): CustomModalConfig;
3400
3410
  get hostClasses(): string;
3411
+ /** Whether this modal renders as a bottom sheet on small screens (default: true). */
3412
+ get isMobileSheet(): boolean;
3401
3413
  /** Triggers the closing animation. Deferred to avoid NG0100 when called during a CD cycle. */
3402
3414
  startClosing(): Promise<void>;
3403
3415
  onEscapeKey(event: Event): void;
@@ -3408,7 +3420,6 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
3408
3420
  get containerSizeClass(): string;
3409
3421
  get containerHeightStyle(): string | null;
3410
3422
  get showCloseButton(): boolean;
3411
- get animationClass(): string;
3412
3423
  get hasCustomFooterActions(): boolean;
3413
3424
  get leftFooterActions(): ModalFooterAction<TResult>[];
3414
3425
  get rightFooterActions(): ModalFooterAction<TResult>[];
@@ -3585,11 +3596,17 @@ declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy
3585
3596
  config: WizardModalConfig;
3586
3597
  modalRef: MnModalRef<WizardResult>;
3587
3598
  formBodies: QueryList<MnFormBodyComponent>;
3599
+ stepWrappers: QueryList<ElementRef<HTMLElement>>;
3588
3600
  currentStepId: ModalStepId;
3589
3601
  visitedStepIds: ModalStepId[];
3590
3602
  isCurrentStepValid: boolean;
3591
3603
  isCompleting: boolean;
3592
3604
  wizardErrors: Record<string, string>;
3605
+ /**
3606
+ * Min-height (px) for the step container, sized to the tallest step so the
3607
+ * modal does not jump when navigating between steps. Monotonic — only grows.
3608
+ */
3609
+ measuredMinHeight: number;
3593
3610
  private languageService;
3594
3611
  private static readonly DEFAULT_LABELS;
3595
3612
  private resolveLabel;
@@ -3607,8 +3624,15 @@ declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy
3607
3624
  private formBodiesSubscription?;
3608
3625
  ngOnInit(): void;
3609
3626
  ngAfterViewInit(): void;
3610
- ngOnDestroy(): void;
3611
3627
  isTextBody(step: WizardStepConfig): boolean;
3628
+ ngOnDestroy(): void;
3629
+ /**
3630
+ * Measures every step's natural height and records the tallest as
3631
+ * {@link measuredMinHeight}. Monotonic: the value only ever grows, so a
3632
+ * re-measure can never shrink the modal. Skipped when the modal has an
3633
+ * explicit height or is full-size (those are already fixed-height).
3634
+ */
3635
+ private measureTallestStep;
3612
3636
  /** Get visible steps (filtered by visibility condition) */
3613
3637
  get visibleSteps(): WizardStepConfig[];
3614
3638
  isStepVisible(step: WizardStepConfig): boolean;