mn-angular-lib 2.0.34 → 2.0.35

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