mn-angular-lib 2.0.34 → 2.0.36
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/fesm2022/mn-angular-lib-alert.mjs +515 -527
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +264 -357
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-button.mjs +819 -382
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar-core.mjs +240 -365
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar.mjs +1691 -1545
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-collection.mjs +2367 -2796
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-core.mjs +693 -1241
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-display.mjs +679 -712
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-forms.mjs +3671 -4647
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-keyboard.mjs +221 -190
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-core.mjs +711 -896
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2089 -2035
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal.mjs +76 -121
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +289 -277
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-segmented.mjs +189 -241
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-tab.mjs +409 -642
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -1
- package/fesm2022/mn-angular-lib.mjs +16 -29
- package/package.json +1 -1
- package/types/mn-angular-lib-alert.d.ts +239 -241
- package/types/mn-angular-lib-bottom-sheet.d.ts +190 -150
- package/types/mn-angular-lib-button.d.ts +319 -317
- package/types/mn-angular-lib-calendar-core.d.ts +199 -209
- package/types/mn-angular-lib-calendar.d.ts +656 -511
- package/types/mn-angular-lib-collection.d.ts +1649 -1585
- package/types/mn-angular-lib-core.d.ts +524 -535
- package/types/mn-angular-lib-display.d.ts +946 -886
- package/types/mn-angular-lib-forms.d.ts +3012 -3013
- package/types/mn-angular-lib-keyboard.d.ts +125 -85
- package/types/mn-angular-lib-modal-core.d.ts +978 -994
- package/types/mn-angular-lib-modal-ui.d.ts +541 -493
- package/types/mn-angular-lib-modal.d.ts +24 -27
- package/types/mn-angular-lib-rich-text-editor.d.ts +131 -98
- package/types/mn-angular-lib-segmented.d.ts +354 -341
- package/types/mn-angular-lib-tab.d.ts +345 -336
- package/types/mn-angular-lib.d.ts +16 -16
- package/fesm2022/mn-angular-lib.mjs.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EventEmitter, OnDestroy, OnInit } from "@angular/core";
|
|
4
3
|
/**
|
|
5
4
|
* A viewport-anchored bottom sheet — the mobile presentation shared by the modal
|
|
6
5
|
* shell and the multi-select dropdown.
|
|
@@ -24,150 +23,191 @@ import { OnInit, OnDestroy, EventEmitter } from '@angular/core';
|
|
|
24
23
|
* The multi-select and dropdown used to do the relocating themselves; that is why the
|
|
25
24
|
* behaviour reads as new here but is not new to them.
|
|
26
25
|
*/
|
|
27
|
-
declare class MnBottomSheet implements OnInit, OnDestroy {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
26
|
+
export declare class MnBottomSheet implements OnInit, OnDestroy {
|
|
27
|
+
/** Tailwind's `sm` breakpoint — at or below this the swipe gesture is armed.
|
|
28
|
+
* Kept in step with the same constant in the modal shell and multi-select. */
|
|
29
|
+
private static readonly SHEET_MAX_WIDTH;
|
|
30
|
+
/** Drag distance (px) past which a release dismisses regardless of speed. */
|
|
31
|
+
private static readonly SWIPE_DISMISS_THRESHOLD;
|
|
32
|
+
/** Downward release speed (px/ms) above which a short drag still dismisses — a "flick". */
|
|
33
|
+
private static readonly FLICK_VELOCITY;
|
|
34
|
+
/** Minimum drag distance (px) a flick must cover, so an incidental fast tap never dismisses. */
|
|
35
|
+
private static readonly FLICK_MIN_DISTANCE;
|
|
36
|
+
/** Upper bound for the exit wait if no `transitionend` fires (e.g. animation suppressed). */
|
|
37
|
+
private static readonly CLOSE_FALLBACK_MS;
|
|
38
|
+
/** Whether to render the dimming backdrop behind the sheet (default: true).
|
|
39
|
+
* A host that already paints its own backdrop (the modal shell) sets this false. */
|
|
40
|
+
showBackdrop: boolean;
|
|
41
|
+
/** Whether to render the drag grabber handle that arms swipe-to-dismiss (default: true). */
|
|
42
|
+
showGrabber: boolean;
|
|
43
|
+
/** Whether the sheet can be dismissed by the user via swipe/flick or backdrop tap
|
|
44
|
+
* (default: true). When false the gestures are inert and the backdrop is non-closing. */
|
|
45
|
+
dismissible: boolean;
|
|
46
|
+
/** Optional `min-height` floor (px) for the container, so filtering its content
|
|
47
|
+
* shorter cannot shrink the sheet mid-interaction. Null leaves it content-sized. */
|
|
48
|
+
minHeightPx: number | null;
|
|
49
|
+
/** Cap on the sheet height as a fraction of the viewport, in vh (default: 80). */
|
|
50
|
+
maxHeightVh: number;
|
|
51
|
+
/** Extra class(es) applied to the sheet container, so a host can attach the hooks
|
|
52
|
+
* its own CSS depends on (e.g. the modal shell's `modal-container`). */
|
|
53
|
+
containerClass: string;
|
|
54
|
+
/** Accessible name for the sheet dialog. */
|
|
55
|
+
ariaLabel?: string;
|
|
56
|
+
/** Id of the element that labels this dialog (takes precedence over `ariaLabel`). */
|
|
57
|
+
ariaLabelledby?: string;
|
|
58
|
+
/**
|
|
59
|
+
* When true, the sheet grows to its `maxHeightVh` while the host app marks the soft
|
|
60
|
+
* keyboard open (a `.mn-keyboard-open` class on a document ancestor), guaranteeing
|
|
61
|
+
* scroll room to lift a focused field above an overlaying keyboard. Off by default so
|
|
62
|
+
* a keyboard opened over an unrelated sheet (a multi-select search) does not resize it.
|
|
63
|
+
*/
|
|
64
|
+
growWithKeyboard: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Optional async gate consulted before a user-initiated dismissal (swipe/flick/backdrop
|
|
67
|
+
* tap) is committed. Resolving false aborts the dismissal and springs the sheet back —
|
|
68
|
+
* used by the modal to run its close guard (e.g. an unsaved-changes prompt). A
|
|
69
|
+
* programmatic {@link startClosing} bypasses it.
|
|
70
|
+
*/
|
|
71
|
+
dismissGuard?: () => boolean | Promise<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Emitted once the user has dismissed the sheet — after the slide-down exit has
|
|
74
|
+
* finished, so the host can remove the sheet from the DOM without cutting the
|
|
75
|
+
* animation short. The host decides what dismissal means (close, run a guard, …).
|
|
76
|
+
*/
|
|
77
|
+
dismiss: EventEmitter<void>;
|
|
78
|
+
/** Current downward drag offset (px) applied to the sheet while swiping. */
|
|
79
|
+
sheetDragY: number;
|
|
80
|
+
/** True while the user is actively dragging the grabber (disables the snap transition). */
|
|
81
|
+
isDraggingSheet: boolean;
|
|
82
|
+
/** True once a dismissal has committed — the sheet glides off-screen via its transition. */
|
|
83
|
+
isDismissing: boolean;
|
|
84
|
+
private readonly cdr;
|
|
85
|
+
private readonly el;
|
|
86
|
+
/** The sheet container element, used to measure its height and drive the exit. */
|
|
87
|
+
private readonly containerRef;
|
|
88
|
+
private dragStartY;
|
|
89
|
+
/** The two most recent (y, timestamp) pointer samples, for estimating flick velocity.
|
|
90
|
+
* `t` uses the event timestamp (monotonic), so no wall-clock is read. */
|
|
91
|
+
private lastSample;
|
|
92
|
+
private prevSample;
|
|
93
|
+
/** In-flight exit animation, so a swipe-dismiss and a follow-up programmatic
|
|
94
|
+
* {@link startClosing} share one glide instead of re-triggering it. */
|
|
95
|
+
private exitPromise;
|
|
96
|
+
/** The host node once moved to `document.body`, so it is only detached if we moved it. */
|
|
97
|
+
private portalledHost;
|
|
98
|
+
/** Blocks scroll gestures aimed at anything behind the sheet, while it is open. */
|
|
99
|
+
private scrollGuard;
|
|
100
|
+
/** Moves the host out to `document.body` and stops the page behind scrolling. */
|
|
101
|
+
ngOnInit(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Stops pointer scrolling behind the sheet for as long as it is open.
|
|
104
|
+
*
|
|
105
|
+
* Cancels the gesture rather than setting `overflow: hidden` on `document.body`: an
|
|
106
|
+
* app whose scroll container is a layout element (a `<main>`, a drawer body) leaves
|
|
107
|
+
* `body` unscrollable, so locking it there is a no-op and the page still slides about
|
|
108
|
+
* under the sheet. Cancelling `wheel` and `touchmove` before anything acts on them
|
|
109
|
+
* holds regardless of which element does the scrolling.
|
|
110
|
+
*
|
|
111
|
+
* Gestures that begin inside the sheet are let through so its own content still
|
|
112
|
+
* scrolls; `overscroll-behavior: contain` keeps those from chaining out at the ends.
|
|
113
|
+
*
|
|
114
|
+
* Pointer input only. Page Down and the arrows still reach the page behind when focus
|
|
115
|
+
* is left there — closing that needs either a key filter or moving focus into the
|
|
116
|
+
* sheet, and neither belongs in this change.
|
|
117
|
+
*/
|
|
118
|
+
private lockScroll;
|
|
119
|
+
/** Releases the scroll guard. Idempotent. */
|
|
120
|
+
private unlockScroll;
|
|
121
|
+
/**
|
|
122
|
+
* Detaches the relocated host.
|
|
123
|
+
*
|
|
124
|
+
* Angular tears a view down by removing the nodes it created from their parent; a
|
|
125
|
+
* host we moved to `body` is no longer among the parent's children, so without
|
|
126
|
+
* this the sheet would outlive the view that declared it.
|
|
127
|
+
*/
|
|
128
|
+
ngOnDestroy(): void;
|
|
129
|
+
get hostClasses(): string;
|
|
130
|
+
/** Whether the viewport is currently narrow enough for the sheet to accept a swipe. */
|
|
131
|
+
private get isNarrow();
|
|
132
|
+
onSheetPointerDown(event: PointerEvent): void;
|
|
133
|
+
onSheetPointerMove(event: PointerEvent): void;
|
|
134
|
+
onSheetPointerUp(): void;
|
|
135
|
+
onBackdropClick(): void;
|
|
136
|
+
/**
|
|
137
|
+
* Plays the slide-down exit and resolves once it has finished. Exposed so a host that
|
|
138
|
+
* dismisses the sheet programmatically (not via a gesture) can await the same exit
|
|
139
|
+
* before tearing the sheet down. Idempotent: a swipe-dismiss already in flight and a
|
|
140
|
+
* subsequent programmatic close share the one glide rather than restarting it.
|
|
141
|
+
*/
|
|
142
|
+
startClosing(): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Runs the optional {@link dismissGuard}, then either commits the dismissal (glide out
|
|
145
|
+
* + emit) or springs the sheet back if the guard rejects. A non-dismissible sheet never
|
|
146
|
+
* gets here from a gesture, but the guard is still short-circuited defensively.
|
|
147
|
+
*/
|
|
148
|
+
private attemptDismiss;
|
|
149
|
+
/** Whether the release should dismiss: a long-enough drag OR a fast downward flick. */
|
|
150
|
+
private shouldDismiss;
|
|
151
|
+
/** Downward release speed (px/ms) from the last two pointer samples; 0 when unusable. */
|
|
152
|
+
private releaseVelocity;
|
|
153
|
+
/** Springs the sheet back to its resting position after a drag that didn't dismiss. */
|
|
154
|
+
private snapBack;
|
|
155
|
+
/**
|
|
156
|
+
* Commits a dismissal: glides the sheet the rest of the way off-screen, then emits
|
|
157
|
+
* {@link dismiss} once the exit animation settles. Continuing the gesture (rather than
|
|
158
|
+
* snapping back to 0 first) keeps a swipe feeling like one unbroken motion.
|
|
159
|
+
*/
|
|
160
|
+
private commitDismiss;
|
|
161
|
+
/** Commits the exit animation exactly once and returns the shared in-flight promise.
|
|
162
|
+
* Short-circuits under reduced motion and falls back to a timeout if no event fires. */
|
|
163
|
+
private playExit;
|
|
164
|
+
/** Waits for the container's exit transition to end, with a reduced-motion short-circuit
|
|
165
|
+
* and a fallback timeout so it always resolves. */
|
|
166
|
+
private awaitExit;
|
|
167
|
+
private prefersReducedMotion;
|
|
168
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MnBottomSheet, never>;
|
|
169
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MnBottomSheet, "mn-bottom-sheet", never, {
|
|
170
|
+
"showBackdrop": {
|
|
171
|
+
"alias": "showBackdrop";
|
|
172
|
+
"required": false;
|
|
173
|
+
};
|
|
174
|
+
"showGrabber": {
|
|
175
|
+
"alias": "showGrabber";
|
|
176
|
+
"required": false;
|
|
177
|
+
};
|
|
178
|
+
"dismissible": {
|
|
179
|
+
"alias": "dismissible";
|
|
180
|
+
"required": false;
|
|
181
|
+
};
|
|
182
|
+
"minHeightPx": {
|
|
183
|
+
"alias": "minHeightPx";
|
|
184
|
+
"required": false;
|
|
185
|
+
};
|
|
186
|
+
"maxHeightVh": {
|
|
187
|
+
"alias": "maxHeightVh";
|
|
188
|
+
"required": false;
|
|
189
|
+
};
|
|
190
|
+
"containerClass": {
|
|
191
|
+
"alias": "containerClass";
|
|
192
|
+
"required": false;
|
|
193
|
+
};
|
|
194
|
+
"ariaLabel": {
|
|
195
|
+
"alias": "ariaLabel";
|
|
196
|
+
"required": false;
|
|
197
|
+
};
|
|
198
|
+
"ariaLabelledby": {
|
|
199
|
+
"alias": "ariaLabelledby";
|
|
200
|
+
"required": false;
|
|
201
|
+
};
|
|
202
|
+
"growWithKeyboard": {
|
|
203
|
+
"alias": "growWithKeyboard";
|
|
204
|
+
"required": false;
|
|
205
|
+
};
|
|
206
|
+
"dismissGuard": {
|
|
207
|
+
"alias": "dismissGuard";
|
|
208
|
+
"required": false;
|
|
209
|
+
};
|
|
210
|
+
}, {
|
|
211
|
+
"dismiss": "dismiss";
|
|
212
|
+
}, never, ["*"], true, never>;
|
|
213
|
+
}
|