mn-angular-lib 1.0.70 → 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.70",
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
+ }
@@ -1731,6 +1731,7 @@ declare class MnDatetime implements OnInit {
1731
1731
  setDisabledState(isDisabled: boolean): void;
1732
1732
  handleInput(raw: string): void;
1733
1733
  handleBlur(): void;
1734
+ handleClick(input: HTMLInputElement): void;
1734
1735
  get control(): _angular_forms.AbstractControl<any, any, any> | null;
1735
1736
  get showError(): boolean;
1736
1737
  private pickErrorKey;
@@ -3026,6 +3027,11 @@ type BaseModalConfig<TResult = unknown> = {
3026
3027
  i18n?: ModalI18nLabels;
3027
3028
  /** Animation configuration */
3028
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;
3029
3035
  /** Custom component to render in the modal body */
3030
3036
  component?: Type<unknown>;
3031
3037
  /** Custom template to render in the modal body */
@@ -3254,6 +3260,11 @@ declare abstract class BaseModalBuilder<TConfig extends BaseModalConfig<TResult>
3254
3260
  template(template: TemplateRef<unknown>): this;
3255
3261
  inputs(inputs: ModalInputMap): this;
3256
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;
3257
3268
  /**
3258
3269
  * Add a custom body/content to the modal.
3259
3270
  */
@@ -3397,6 +3408,8 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
3397
3408
  asConfirmation(config: ModalConfig<TResult>): ConfirmationModalConfig;
3398
3409
  asCustom(config: ModalConfig<TResult>): CustomModalConfig;
3399
3410
  get hostClasses(): string;
3411
+ /** Whether this modal renders as a bottom sheet on small screens (default: true). */
3412
+ get isMobileSheet(): boolean;
3400
3413
  /** Triggers the closing animation. Deferred to avoid NG0100 when called during a CD cycle. */
3401
3414
  startClosing(): Promise<void>;
3402
3415
  onEscapeKey(event: Event): void;
@@ -3407,7 +3420,6 @@ declare class MnModalShellComponent<TResult = unknown> implements OnInit, AfterV
3407
3420
  get containerSizeClass(): string;
3408
3421
  get containerHeightStyle(): string | null;
3409
3422
  get showCloseButton(): boolean;
3410
- get animationClass(): string;
3411
3423
  get hasCustomFooterActions(): boolean;
3412
3424
  get leftFooterActions(): ModalFooterAction<TResult>[];
3413
3425
  get rightFooterActions(): ModalFooterAction<TResult>[];
@@ -3584,11 +3596,17 @@ declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy
3584
3596
  config: WizardModalConfig;
3585
3597
  modalRef: MnModalRef<WizardResult>;
3586
3598
  formBodies: QueryList<MnFormBodyComponent>;
3599
+ stepWrappers: QueryList<ElementRef<HTMLElement>>;
3587
3600
  currentStepId: ModalStepId;
3588
3601
  visitedStepIds: ModalStepId[];
3589
3602
  isCurrentStepValid: boolean;
3590
3603
  isCompleting: boolean;
3591
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;
3592
3610
  private languageService;
3593
3611
  private static readonly DEFAULT_LABELS;
3594
3612
  private resolveLabel;
@@ -3606,8 +3624,15 @@ declare class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy
3606
3624
  private formBodiesSubscription?;
3607
3625
  ngOnInit(): void;
3608
3626
  ngAfterViewInit(): void;
3609
- ngOnDestroy(): void;
3610
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;
3611
3636
  /** Get visible steps (filtered by visibility condition) */
3612
3637
  get visibleSteps(): WizardStepConfig[];
3613
3638
  isStepVisible(step: WizardStepConfig): boolean;