mn-angular-lib 2.0.11 → 2.0.13
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/bottom-sheet/src/mn-bottom-sheet/mn-bottom-sheet.component.css +5 -4
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +2 -2
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar.mjs +8 -5
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-collection.mjs +17 -5
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-forms.mjs +33 -3
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2 -2
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-tab.mjs +26 -2
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -1
- package/package.json +1 -1
- package/types/mn-angular-lib-collection.d.ts +17 -0
- package/types/mn-angular-lib-forms.d.ts +21 -0
- package/types/mn-angular-lib-modal-core.d.ts +2 -0
- package/types/mn-angular-lib-modal-ui.d.ts +2 -0
- package/types/mn-angular-lib-tab.d.ts +9 -0
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.mn-sheet-container {
|
|
11
|
-
/* Keep the last content clear of the iOS home indicator. The sheet
|
|
12
|
-
into the inset so it still reads as one continuous surface. env() is 0
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/* Keep the last content clear of the screen edge and of the iOS home indicator. The sheet
|
|
12
|
+
background extends into the inset so it still reads as one continuous surface. env() is 0
|
|
13
|
+
on the web, which used to leave a sheet's last row ("Uitloggen") on the very edge, so a
|
|
14
|
+
small base always applies on top of it. */
|
|
15
|
+
padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
|
|
15
16
|
|
|
16
17
|
/* Scrolling the sheet's own content to either end must not hand the remaining delta
|
|
17
18
|
to whatever is behind it. The component's guard blocks gestures that start outside
|
|
@@ -309,11 +309,11 @@ class MnBottomSheet {
|
|
|
309
309
|
window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
310
310
|
}
|
|
311
311
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MnBottomSheet, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
312
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: MnBottomSheet, isStandalone: true, selector: "mn-bottom-sheet", inputs: { showBackdrop: "showBackdrop", showGrabber: "showGrabber", dismissible: "dismissible", minHeightPx: "minHeightPx", maxHeightVh: "maxHeightVh", containerClass: "containerClass", ariaLabel: "ariaLabel", ariaLabelledby: "ariaLabelledby", growWithKeyboard: "growWithKeyboard", dismissGuard: "dismissGuard" }, outputs: { dismiss: "dismiss" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (showBackdrop) {\n <!-- Dims the page behind the sheet. Tapping it dismisses when the sheet is dismissible. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div (click)=\"onBackdropClick()\" class=\"mn-sheet-backdrop fixed inset-0 z-9998 bg-black/40\"></div>\n}\n\n<div\n #container\n [attr.aria-label]=\"ariaLabelledby ? null : (ariaLabel || null)\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [class.sheet-dragging]=\"isDraggingSheet\"\n [ngClass]=\"containerClass\"\n [style.--mn-sheet-max]=\"maxHeightVh + 'vh'\"\n [style.max-height.vh]=\"maxHeightVh\"\n [style.min-height.px]=\"minHeightPx\"\n [style.transform]=\"sheetDragY ? 'translateY(' + sheetDragY + 'px)' : null\"\n aria-modal=\"true\"\n class=\"mn-sheet-container fixed inset-x-0 bottom-0 z-9999 flex flex-col bg-base-100 border-t border-base-300 rounded-t-2xl shadow-lg\"\n role=\"dialog\"\n tabindex=\"-1\"\n>\n @if (showGrabber) {\n <!-- Drag handle for swipe-to-dismiss. The gesture is armed on the whole handle;\n drags starting on a control inside the projected content are ignored. -->\n <div\n (pointercancel)=\"onSheetPointerUp()\"\n (pointerdown)=\"onSheetPointerDown($event)\"\n (pointermove)=\"onSheetPointerMove($event)\"\n (pointerup)=\"onSheetPointerUp()\"\n class=\"flex justify-center pt-2 pb-1 touch-none cursor-grab shrink-0\"\n >\n <div class=\"h-1.5 w-10 rounded-full bg-base-300\"></div>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n", styles: [":host{--mn-sheet-ease: cubic-bezier(.32, .72, 0, 1);display:contents}.mn-sheet-container{padding-bottom:env(safe-area-inset-bottom);overscroll-behavior:contain;min-height:0;transition:transform .35s var(--mn-sheet-ease),min-height .25s var(--mn-sheet-ease);animation:mn-sheet-in .35s var(--mn-sheet-ease)}:host(.grow-with-keyboard):host-context(.mn-keyboard-open) .mn-sheet-container{min-height:var(--mn-sheet-max, 92vh)}.mn-sheet-container.sheet-dragging{transition:none}.mn-sheet-backdrop{animation:mn-sheet-backdrop-in .2s ease-out}:host(.is-dismissing) .mn-sheet-container{animation:none}@keyframes mn-sheet-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes mn-sheet-backdrop-in{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.mn-sheet-container,.mn-sheet-backdrop{animation-duration:.01ms!important;transition-duration:.01ms!important}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
312
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: MnBottomSheet, isStandalone: true, selector: "mn-bottom-sheet", inputs: { showBackdrop: "showBackdrop", showGrabber: "showGrabber", dismissible: "dismissible", minHeightPx: "minHeightPx", maxHeightVh: "maxHeightVh", containerClass: "containerClass", ariaLabel: "ariaLabel", ariaLabelledby: "ariaLabelledby", growWithKeyboard: "growWithKeyboard", dismissGuard: "dismissGuard" }, outputs: { dismiss: "dismiss" }, host: { properties: { "class": "this.hostClasses" } }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (showBackdrop) {\n <!-- Dims the page behind the sheet. Tapping it dismisses when the sheet is dismissible. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div (click)=\"onBackdropClick()\" class=\"mn-sheet-backdrop fixed inset-0 z-9998 bg-black/40\"></div>\n}\n\n<div\n #container\n [attr.aria-label]=\"ariaLabelledby ? null : (ariaLabel || null)\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [class.sheet-dragging]=\"isDraggingSheet\"\n [ngClass]=\"containerClass\"\n [style.--mn-sheet-max]=\"maxHeightVh + 'vh'\"\n [style.max-height.vh]=\"maxHeightVh\"\n [style.min-height.px]=\"minHeightPx\"\n [style.transform]=\"sheetDragY ? 'translateY(' + sheetDragY + 'px)' : null\"\n aria-modal=\"true\"\n class=\"mn-sheet-container fixed inset-x-0 bottom-0 z-9999 flex flex-col bg-base-100 border-t border-base-300 rounded-t-2xl shadow-lg\"\n role=\"dialog\"\n tabindex=\"-1\"\n>\n @if (showGrabber) {\n <!-- Drag handle for swipe-to-dismiss. The gesture is armed on the whole handle;\n drags starting on a control inside the projected content are ignored. -->\n <div\n (pointercancel)=\"onSheetPointerUp()\"\n (pointerdown)=\"onSheetPointerDown($event)\"\n (pointermove)=\"onSheetPointerMove($event)\"\n (pointerup)=\"onSheetPointerUp()\"\n class=\"flex justify-center pt-2 pb-1 touch-none cursor-grab shrink-0\"\n >\n <div class=\"h-1.5 w-10 rounded-full bg-base-300\"></div>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n", styles: [":host{--mn-sheet-ease: cubic-bezier(.32, .72, 0, 1);display:contents}.mn-sheet-container{padding-bottom:calc(.75rem + env(safe-area-inset-bottom));overscroll-behavior:contain;min-height:0;transition:transform .35s var(--mn-sheet-ease),min-height .25s var(--mn-sheet-ease);animation:mn-sheet-in .35s var(--mn-sheet-ease)}:host(.grow-with-keyboard):host-context(.mn-keyboard-open) .mn-sheet-container{min-height:var(--mn-sheet-max, 92vh)}.mn-sheet-container.sheet-dragging{transition:none}.mn-sheet-backdrop{animation:mn-sheet-backdrop-in .2s ease-out}:host(.is-dismissing) .mn-sheet-container{animation:none}@keyframes mn-sheet-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes mn-sheet-backdrop-in{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.mn-sheet-container,.mn-sheet-backdrop{animation-duration:.01ms!important;transition-duration:.01ms!important}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
313
313
|
}
|
|
314
314
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: MnBottomSheet, decorators: [{
|
|
315
315
|
type: Component,
|
|
316
|
-
args: [{ selector: 'mn-bottom-sheet', standalone: true, imports: [NgClass], template: "@if (showBackdrop) {\n <!-- Dims the page behind the sheet. Tapping it dismisses when the sheet is dismissible. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div (click)=\"onBackdropClick()\" class=\"mn-sheet-backdrop fixed inset-0 z-9998 bg-black/40\"></div>\n}\n\n<div\n #container\n [attr.aria-label]=\"ariaLabelledby ? null : (ariaLabel || null)\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [class.sheet-dragging]=\"isDraggingSheet\"\n [ngClass]=\"containerClass\"\n [style.--mn-sheet-max]=\"maxHeightVh + 'vh'\"\n [style.max-height.vh]=\"maxHeightVh\"\n [style.min-height.px]=\"minHeightPx\"\n [style.transform]=\"sheetDragY ? 'translateY(' + sheetDragY + 'px)' : null\"\n aria-modal=\"true\"\n class=\"mn-sheet-container fixed inset-x-0 bottom-0 z-9999 flex flex-col bg-base-100 border-t border-base-300 rounded-t-2xl shadow-lg\"\n role=\"dialog\"\n tabindex=\"-1\"\n>\n @if (showGrabber) {\n <!-- Drag handle for swipe-to-dismiss. The gesture is armed on the whole handle;\n drags starting on a control inside the projected content are ignored. -->\n <div\n (pointercancel)=\"onSheetPointerUp()\"\n (pointerdown)=\"onSheetPointerDown($event)\"\n (pointermove)=\"onSheetPointerMove($event)\"\n (pointerup)=\"onSheetPointerUp()\"\n class=\"flex justify-center pt-2 pb-1 touch-none cursor-grab shrink-0\"\n >\n <div class=\"h-1.5 w-10 rounded-full bg-base-300\"></div>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n", styles: [":host{--mn-sheet-ease: cubic-bezier(.32, .72, 0, 1);display:contents}.mn-sheet-container{padding-bottom:env(safe-area-inset-bottom);overscroll-behavior:contain;min-height:0;transition:transform .35s var(--mn-sheet-ease),min-height .25s var(--mn-sheet-ease);animation:mn-sheet-in .35s var(--mn-sheet-ease)}:host(.grow-with-keyboard):host-context(.mn-keyboard-open) .mn-sheet-container{min-height:var(--mn-sheet-max, 92vh)}.mn-sheet-container.sheet-dragging{transition:none}.mn-sheet-backdrop{animation:mn-sheet-backdrop-in .2s ease-out}:host(.is-dismissing) .mn-sheet-container{animation:none}@keyframes mn-sheet-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes mn-sheet-backdrop-in{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.mn-sheet-container,.mn-sheet-backdrop{animation-duration:.01ms!important;transition-duration:.01ms!important}}\n"] }]
|
|
316
|
+
args: [{ selector: 'mn-bottom-sheet', standalone: true, imports: [NgClass], template: "@if (showBackdrop) {\n <!-- Dims the page behind the sheet. Tapping it dismisses when the sheet is dismissible. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div (click)=\"onBackdropClick()\" class=\"mn-sheet-backdrop fixed inset-0 z-9998 bg-black/40\"></div>\n}\n\n<div\n #container\n [attr.aria-label]=\"ariaLabelledby ? null : (ariaLabel || null)\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [class.sheet-dragging]=\"isDraggingSheet\"\n [ngClass]=\"containerClass\"\n [style.--mn-sheet-max]=\"maxHeightVh + 'vh'\"\n [style.max-height.vh]=\"maxHeightVh\"\n [style.min-height.px]=\"minHeightPx\"\n [style.transform]=\"sheetDragY ? 'translateY(' + sheetDragY + 'px)' : null\"\n aria-modal=\"true\"\n class=\"mn-sheet-container fixed inset-x-0 bottom-0 z-9999 flex flex-col bg-base-100 border-t border-base-300 rounded-t-2xl shadow-lg\"\n role=\"dialog\"\n tabindex=\"-1\"\n>\n @if (showGrabber) {\n <!-- Drag handle for swipe-to-dismiss. The gesture is armed on the whole handle;\n drags starting on a control inside the projected content are ignored. -->\n <div\n (pointercancel)=\"onSheetPointerUp()\"\n (pointerdown)=\"onSheetPointerDown($event)\"\n (pointermove)=\"onSheetPointerMove($event)\"\n (pointerup)=\"onSheetPointerUp()\"\n class=\"flex justify-center pt-2 pb-1 touch-none cursor-grab shrink-0\"\n >\n <div class=\"h-1.5 w-10 rounded-full bg-base-300\"></div>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n", styles: [":host{--mn-sheet-ease: cubic-bezier(.32, .72, 0, 1);display:contents}.mn-sheet-container{padding-bottom:calc(.75rem + env(safe-area-inset-bottom));overscroll-behavior:contain;min-height:0;transition:transform .35s var(--mn-sheet-ease),min-height .25s var(--mn-sheet-ease);animation:mn-sheet-in .35s var(--mn-sheet-ease)}:host(.grow-with-keyboard):host-context(.mn-keyboard-open) .mn-sheet-container{min-height:var(--mn-sheet-max, 92vh)}.mn-sheet-container.sheet-dragging{transition:none}.mn-sheet-backdrop{animation:mn-sheet-backdrop-in .2s ease-out}:host(.is-dismissing) .mn-sheet-container{animation:none}@keyframes mn-sheet-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes mn-sheet-backdrop-in{0%{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.mn-sheet-container,.mn-sheet-backdrop{animation-duration:.01ms!important;transition-duration:.01ms!important}}\n"] }]
|
|
317
317
|
}], propDecorators: { showBackdrop: [{
|
|
318
318
|
type: Input
|
|
319
319
|
}], showGrabber: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mn-angular-lib-bottom-sheet.mjs","sources":["../../../projects/mn-angular-lib/bottom-sheet/src/mn-bottom-sheet/mn-bottom-sheet.component.ts","../../../projects/mn-angular-lib/bottom-sheet/src/mn-bottom-sheet/mn-bottom-sheet.component.html","../../../projects/mn-angular-lib/bottom-sheet/public-api.ts","../../../projects/mn-angular-lib/bottom-sheet/mn-angular-lib-bottom-sheet.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n viewChild,\n} from '@angular/core';\nimport { NgClass } from '@angular/common';\n\n/**\n * A viewport-anchored bottom sheet — the mobile presentation shared by the modal\n * shell and the multi-select dropdown.\n *\n * It owns only the sheet *chrome and gestures*: a bottom-anchored, full-width,\n * rounded-top surface with an optional dimming backdrop and drag grabber, a\n * slide-up entrance, swipe/flick-to-dismiss, and a promise-based slide-down exit.\n * It is deliberately presentational: the body is projected via `<ng-content>`, and\n * dismissal is reported through {@link dismiss} for the host to act on (run a close\n * guard, tear down its overlay, …) rather than being handled here.\n *\n * Positioning is `position: fixed` against the viewport, so the host relocates itself\n * to `document.body` on init and blocks scrolling behind it while open. Both are\n * unconditional: rendering viewport-fixed chrome in place made correctness depend on\n * where a consumer happened to write the tag. A `transform`/`filter`/`contain`\n * ancestor becomes the containing block and pushes the sheet to the middle of the\n * screen — which a *stacked* modal did to its own sheet — and, because `position:\n * fixed` moves where an element paints but not where it sits in the DOM, a gesture on\n * the backdrop still scrolled whichever ancestor was the scroll container.\n *\n * The multi-select and dropdown used to do the relocating themselves; that is why the\n * behaviour reads as new here but is not new to them.\n */\n@Component({\n selector: 'mn-bottom-sheet',\n standalone: true,\n imports: [NgClass],\n templateUrl: './mn-bottom-sheet.component.html',\n styleUrl: './mn-bottom-sheet.component.css',\n})\nexport class MnBottomSheet implements OnInit, OnDestroy {\n /** Tailwind's `sm` breakpoint — at or below this the swipe gesture is armed.\n * Kept in step with the same constant in the modal shell and multi-select. */\n private static readonly SHEET_MAX_WIDTH = 639.98;\n /** Drag distance (px) past which a release dismisses regardless of speed. */\n private static readonly SWIPE_DISMISS_THRESHOLD = 150;\n /** Downward release speed (px/ms) above which a short drag still dismisses — a \"flick\". */\n private static readonly FLICK_VELOCITY = 0.5;\n /** Minimum drag distance (px) a flick must cover, so an incidental fast tap never dismisses. */\n private static readonly FLICK_MIN_DISTANCE = 32;\n /** Upper bound for the exit wait if no `transitionend` fires (e.g. animation suppressed). */\n private static readonly CLOSE_FALLBACK_MS = 700;\n /** Whether to render the dimming backdrop behind the sheet (default: true).\n * A host that already paints its own backdrop (the modal shell) sets this false. */\n @Input() showBackdrop = true;\n /** Whether to render the drag grabber handle that arms swipe-to-dismiss (default: true). */\n @Input() showGrabber = true;\n /** Whether the sheet can be dismissed by the user via swipe/flick or backdrop tap\n * (default: true). When false the gestures are inert and the backdrop is non-closing. */\n @Input() dismissible = true;\n /** Optional `min-height` floor (px) for the container, so filtering its content\n * shorter cannot shrink the sheet mid-interaction. Null leaves it content-sized. */\n @Input() minHeightPx: number | null = null;\n /** Cap on the sheet height as a fraction of the viewport, in vh (default: 80). */\n @Input() maxHeightVh = 80;\n /** Extra class(es) applied to the sheet container, so a host can attach the hooks\n * its own CSS depends on (e.g. the modal shell's `modal-container`). */\n @Input() containerClass = '';\n /** Accessible name for the sheet dialog. */\n @Input() ariaLabel?: string;\n /** Id of the element that labels this dialog (takes precedence over `ariaLabel`). */\n @Input() ariaLabelledby?: string;\n /**\n * When true, the sheet grows to its `maxHeightVh` while the host app marks the soft\n * keyboard open (a `.mn-keyboard-open` class on a document ancestor), guaranteeing\n * scroll room to lift a focused field above an overlaying keyboard. Off by default so\n * a keyboard opened over an unrelated sheet (a multi-select search) does not resize it.\n */\n @Input() growWithKeyboard = false;\n /**\n * Optional async gate consulted before a user-initiated dismissal (swipe/flick/backdrop\n * tap) is committed. Resolving false aborts the dismissal and springs the sheet back —\n * used by the modal to run its close guard (e.g. an unsaved-changes prompt). A\n * programmatic {@link startClosing} bypasses it.\n */\n @Input() dismissGuard?: () => boolean | Promise<boolean>;\n /**\n * Emitted once the user has dismissed the sheet — after the slide-down exit has\n * finished, so the host can remove the sheet from the DOM without cutting the\n * animation short. The host decides what dismissal means (close, run a guard, …).\n */\n @Output() dismiss = new EventEmitter<void>();\n /** Current downward drag offset (px) applied to the sheet while swiping. */\n sheetDragY = 0;\n /** True while the user is actively dragging the grabber (disables the snap transition). */\n isDraggingSheet = false;\n /** True once a dismissal has committed — the sheet glides off-screen via its transition. */\n isDismissing = false;\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n /** The sheet container element, used to measure its height and drive the exit. */\n private readonly containerRef = viewChild<ElementRef<HTMLElement>>('container');\n private dragStartY = 0;\n\n /** The two most recent (y, timestamp) pointer samples, for estimating flick velocity.\n * `t` uses the event timestamp (monotonic), so no wall-clock is read. */\n private lastSample: { y: number; t: number } | null = null;\n private prevSample: { y: number; t: number } | null = null;\n\n /** In-flight exit animation, so a swipe-dismiss and a follow-up programmatic\n * {@link startClosing} share one glide instead of re-triggering it. */\n private exitPromise: Promise<void> | null = null;\n\n /** The host node once moved to `document.body`, so it is only detached if we moved it. */\n private portalledHost: HTMLElement | null = null;\n\n /** Blocks scroll gestures aimed at anything behind the sheet, while it is open. */\n private scrollGuard: ((event: Event) => void) | null = null;\n\n /** Moves the host out to `document.body` and stops the page behind scrolling. */\n ngOnInit(): void {\n if (typeof document === 'undefined') return;\n const host = this.el.nativeElement;\n document.body.appendChild(host);\n this.portalledHost = host;\n this.lockScroll();\n }\n\n /**\n * Stops pointer scrolling behind the sheet for as long as it is open.\n *\n * Cancels the gesture rather than setting `overflow: hidden` on `document.body`: an\n * app whose scroll container is a layout element (a `<main>`, a drawer body) leaves\n * `body` unscrollable, so locking it there is a no-op and the page still slides about\n * under the sheet. Cancelling `wheel` and `touchmove` before anything acts on them\n * holds regardless of which element does the scrolling.\n *\n * Gestures that begin inside the sheet are let through so its own content still\n * scrolls; `overscroll-behavior: contain` keeps those from chaining out at the ends.\n *\n * Pointer input only. Page Down and the arrows still reach the page behind when focus\n * is left there — closing that needs either a key filter or moving focus into the\n * sheet, and neither belongs in this change.\n */\n private lockScroll(): void {\n const guard = (event: Event): void => {\n const target = event.target as Node | null;\n const container = this.containerRef()?.nativeElement;\n if (container && target && container.contains(target)) return;\n // Only cancellable events can be stopped; a passive listener elsewhere in the\n // chain would otherwise log a console error for a no-op preventDefault.\n if (event.cancelable) event.preventDefault();\n };\n // Capture phase, so the gesture is cancelled before any scroller sees it.\n document.addEventListener('wheel', guard, { capture: true, passive: false });\n document.addEventListener('touchmove', guard, { capture: true, passive: false });\n this.scrollGuard = guard;\n }\n\n /** Releases the scroll guard. Idempotent. */\n private unlockScroll(): void {\n if (!this.scrollGuard) return;\n document.removeEventListener('wheel', this.scrollGuard, { capture: true });\n document.removeEventListener('touchmove', this.scrollGuard, { capture: true });\n this.scrollGuard = null;\n }\n\n /**\n * Detaches the relocated host.\n *\n * Angular tears a view down by removing the nodes it created from their parent; a\n * host we moved to `body` is no longer among the parent's children, so without\n * this the sheet would outlive the view that declared it.\n */\n ngOnDestroy(): void {\n this.unlockScroll();\n this.portalledHost?.remove();\n this.portalledHost = null;\n }\n\n @HostBinding('class') get hostClasses(): string {\n return (\n `mn-bottom-sheet${this.isDismissing ? ' is-dismissing' : ''}` +\n `${this.growWithKeyboard ? ' grow-with-keyboard' : ''}`\n );\n }\n\n /** Whether the viewport is currently narrow enough for the sheet to accept a swipe. */\n private get isNarrow(): boolean {\n return typeof window === 'undefined' || window.innerWidth <= MnBottomSheet.SHEET_MAX_WIDTH;\n }\n\n onSheetPointerDown(event: PointerEvent): void {\n if (!this.dismissible || !this.isNarrow) return;\n // Don't hijack drags that begin on an interactive control inside the sheet.\n if ((event.target as HTMLElement).closest('button, input, textarea, select, a')) return;\n this.isDraggingSheet = true;\n this.dragStartY = event.clientY;\n // Seed the velocity window so a fast flick that releases on the first move still measures.\n this.lastSample = { y: event.clientY, t: event.timeStamp };\n this.prevSample = this.lastSample;\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n onSheetPointerMove(event: PointerEvent): void {\n if (!this.isDraggingSheet) return;\n // Only track downward movement.\n this.sheetDragY = Math.max(0, event.clientY - this.dragStartY);\n this.prevSample = this.lastSample;\n this.lastSample = { y: event.clientY, t: event.timeStamp };\n }\n\n onSheetPointerUp(): void {\n if (!this.isDraggingSheet) return;\n this.isDraggingSheet = false;\n\n if (this.shouldDismiss()) {\n void this.attemptDismiss();\n } else {\n this.snapBack();\n }\n\n this.lastSample = null;\n this.prevSample = null;\n }\n\n onBackdropClick(): void {\n void this.attemptDismiss();\n }\n\n /**\n * Plays the slide-down exit and resolves once it has finished. Exposed so a host that\n * dismisses the sheet programmatically (not via a gesture) can await the same exit\n * before tearing the sheet down. Idempotent: a swipe-dismiss already in flight and a\n * subsequent programmatic close share the one glide rather than restarting it.\n */\n startClosing(): Promise<void> {\n return this.playExit();\n }\n\n /**\n * Runs the optional {@link dismissGuard}, then either commits the dismissal (glide out\n * + emit) or springs the sheet back if the guard rejects. A non-dismissible sheet never\n * gets here from a gesture, but the guard is still short-circuited defensively.\n */\n private async attemptDismiss(): Promise<void> {\n if (!this.dismissible) return;\n if (this.dismissGuard) {\n const allowed = await this.dismissGuard();\n if (!allowed) {\n this.snapBack();\n this.cdr.detectChanges();\n return;\n }\n }\n this.commitDismiss();\n }\n\n /** Whether the release should dismiss: a long-enough drag OR a fast downward flick. */\n private shouldDismiss(): boolean {\n if (this.sheetDragY > MnBottomSheet.SWIPE_DISMISS_THRESHOLD) {\n return true;\n }\n return (\n this.releaseVelocity() > MnBottomSheet.FLICK_VELOCITY &&\n this.sheetDragY > MnBottomSheet.FLICK_MIN_DISTANCE\n );\n }\n\n /** Downward release speed (px/ms) from the last two pointer samples; 0 when unusable. */\n private releaseVelocity(): number {\n if (!this.lastSample || !this.prevSample) return 0;\n const dt = this.lastSample.t - this.prevSample.t;\n if (dt <= 0) return 0;\n return (this.lastSample.y - this.prevSample.y) / dt;\n }\n\n /** Springs the sheet back to its resting position after a drag that didn't dismiss. */\n private snapBack(): void {\n this.sheetDragY = 0;\n }\n\n /**\n * Commits a dismissal: glides the sheet the rest of the way off-screen, then emits\n * {@link dismiss} once the exit animation settles. Continuing the gesture (rather than\n * snapping back to 0 first) keeps a swipe feeling like one unbroken motion.\n */\n private commitDismiss(): void {\n void this.playExit().then(() => this.dismiss.emit());\n }\n\n /** Commits the exit animation exactly once and returns the shared in-flight promise.\n * Short-circuits under reduced motion and falls back to a timeout if no event fires. */\n private playExit(): Promise<void> {\n if (this.exitPromise) return this.exitPromise;\n this.isDismissing = true;\n this.sheetDragY = window.innerHeight;\n this.cdr.detectChanges();\n this.exitPromise = this.awaitExit();\n return this.exitPromise;\n }\n\n /** Waits for the container's exit transition to end, with a reduced-motion short-circuit\n * and a fallback timeout so it always resolves. */\n private awaitExit(): Promise<void> {\n return new Promise((resolve) => {\n if (this.prefersReducedMotion()) {\n resolve();\n return;\n }\n const container =\n this.containerRef()?.nativeElement ??\n this.el.nativeElement.querySelector<HTMLElement>('.mn-sheet-container');\n if (!container) {\n resolve();\n return;\n }\n let settled = false;\n const done = (event?: Event): void => {\n // Ignore end events bubbling up from descendant transitions.\n if (event && event.target !== container) return;\n if (settled) return;\n settled = true;\n container.removeEventListener('transitionend', done);\n clearTimeout(fallback);\n resolve();\n };\n container.addEventListener('transitionend', done);\n const fallback = setTimeout(done, MnBottomSheet.CLOSE_FALLBACK_MS);\n });\n }\n\n private prefersReducedMotion(): boolean {\n return (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n }\n}\n","@if (showBackdrop) {\n <!-- Dims the page behind the sheet. Tapping it dismisses when the sheet is dismissible. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div (click)=\"onBackdropClick()\" class=\"mn-sheet-backdrop fixed inset-0 z-9998 bg-black/40\"></div>\n}\n\n<div\n #container\n [attr.aria-label]=\"ariaLabelledby ? null : (ariaLabel || null)\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [class.sheet-dragging]=\"isDraggingSheet\"\n [ngClass]=\"containerClass\"\n [style.--mn-sheet-max]=\"maxHeightVh + 'vh'\"\n [style.max-height.vh]=\"maxHeightVh\"\n [style.min-height.px]=\"minHeightPx\"\n [style.transform]=\"sheetDragY ? 'translateY(' + sheetDragY + 'px)' : null\"\n aria-modal=\"true\"\n class=\"mn-sheet-container fixed inset-x-0 bottom-0 z-9999 flex flex-col bg-base-100 border-t border-base-300 rounded-t-2xl shadow-lg\"\n role=\"dialog\"\n tabindex=\"-1\"\n>\n @if (showGrabber) {\n <!-- Drag handle for swipe-to-dismiss. The gesture is armed on the whole handle;\n drags starting on a control inside the projected content are ignored. -->\n <div\n (pointercancel)=\"onSheetPointerUp()\"\n (pointerdown)=\"onSheetPointerDown($event)\"\n (pointermove)=\"onSheetPointerMove($event)\"\n (pointerup)=\"onSheetPointerUp()\"\n class=\"flex justify-center pt-2 pb-1 touch-none cursor-grab shrink-0\"\n >\n <div class=\"h-1.5 w-10 rounded-full bg-base-300\"></div>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n","/**\n * Public API of the `mn-angular-lib/bottom-sheet` entry point: the bottom sheet.\n *\n * Each entry point is its own module in the published package, so a consumer's bundler\n * splits it into the chunk that uses it instead of loading the whole library at startup.\n * The root `mn-angular-lib` entry re-exports every entry point.\n */\nexport * from './src/mn-bottom-sheet';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAeA;;;;;;;;;;;;;;;;;;;;;;AAsBG;MAQU,aAAa,CAAA;AACxB;AAC+E;AACvE,IAAA,OAAgB,eAAe,GAAG,MAAM;;AAExC,IAAA,OAAgB,uBAAuB,GAAG,GAAG;;AAE7C,IAAA,OAAgB,cAAc,GAAG,GAAG;;AAEpC,IAAA,OAAgB,kBAAkB,GAAG,EAAE;;AAEvC,IAAA,OAAgB,iBAAiB,GAAG,GAAG;AAC/C;AACqF;IAC5E,YAAY,GAAG,IAAI;;IAEnB,WAAW,GAAG,IAAI;AAC3B;AAC0F;IACjF,WAAW,GAAG,IAAI;AAC3B;AACqF;IAC5E,WAAW,GAAkB,IAAI;;IAEjC,WAAW,GAAG,EAAE;AACzB;AACyE;IAChE,cAAc,GAAG,EAAE;;AAEnB,IAAA,SAAS;;AAET,IAAA,cAAc;AACvB;;;;;AAKG;IACM,gBAAgB,GAAG,KAAK;AACjC;;;;;AAKG;AACM,IAAA,YAAY;AACrB;;;;AAIG;AACO,IAAA,OAAO,GAAG,IAAI,YAAY,EAAQ;;IAE5C,UAAU,GAAG,CAAC;;IAEd,eAAe,GAAG,KAAK;;IAEvB,YAAY,GAAG,KAAK;AACH,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC/B,IAAA,EAAE,GAAG,MAAM,CAA0B,UAAU,CAAC;;IAEhD,YAAY,GAAG,SAAS,CAA0B,WAAW;qFAAC;IACvE,UAAU,GAAG,CAAC;AAEtB;AAC0E;IAClE,UAAU,GAAoC,IAAI;IAClD,UAAU,GAAoC,IAAI;AAE1D;AACwE;IAChE,WAAW,GAAyB,I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ts","../../../projects/mn-angular-lib/bottom-sheet/src/mn-bottom-sheet/mn-bottom-sheet.component.html","../../../projects/mn-angular-lib/bottom-sheet/public-api.ts","../../../projects/mn-angular-lib/bottom-sheet/mn-angular-lib-bottom-sheet.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n viewChild,\n} from '@angular/core';\nimport { NgClass } from '@angular/common';\n\n/**\n * A viewport-anchored bottom sheet — the mobile presentation shared by the modal\n * shell and the multi-select dropdown.\n *\n * It owns only the sheet *chrome and gestures*: a bottom-anchored, full-width,\n * rounded-top surface with an optional dimming backdrop and drag grabber, a\n * slide-up entrance, swipe/flick-to-dismiss, and a promise-based slide-down exit.\n * It is deliberately presentational: the body is projected via `<ng-content>`, and\n * dismissal is reported through {@link dismiss} for the host to act on (run a close\n * guard, tear down its overlay, …) rather than being handled here.\n *\n * Positioning is `position: fixed` against the viewport, so the host relocates itself\n * to `document.body` on init and blocks scrolling behind it while open. Both are\n * unconditional: rendering viewport-fixed chrome in place made correctness depend on\n * where a consumer happened to write the tag. A `transform`/`filter`/`contain`\n * ancestor becomes the containing block and pushes the sheet to the middle of the\n * screen — which a *stacked* modal did to its own sheet — and, because `position:\n * fixed` moves where an element paints but not where it sits in the DOM, a gesture on\n * the backdrop still scrolled whichever ancestor was the scroll container.\n *\n * The multi-select and dropdown used to do the relocating themselves; that is why the\n * behaviour reads as new here but is not new to them.\n */\n@Component({\n selector: 'mn-bottom-sheet',\n standalone: true,\n imports: [NgClass],\n templateUrl: './mn-bottom-sheet.component.html',\n styleUrl: './mn-bottom-sheet.component.css',\n})\nexport class MnBottomSheet implements OnInit, OnDestroy {\n /** Tailwind's `sm` breakpoint — at or below this the swipe gesture is armed.\n * Kept in step with the same constant in the modal shell and multi-select. */\n private static readonly SHEET_MAX_WIDTH = 639.98;\n /** Drag distance (px) past which a release dismisses regardless of speed. */\n private static readonly SWIPE_DISMISS_THRESHOLD = 150;\n /** Downward release speed (px/ms) above which a short drag still dismisses — a \"flick\". */\n private static readonly FLICK_VELOCITY = 0.5;\n /** Minimum drag distance (px) a flick must cover, so an incidental fast tap never dismisses. */\n private static readonly FLICK_MIN_DISTANCE = 32;\n /** Upper bound for the exit wait if no `transitionend` fires (e.g. animation suppressed). */\n private static readonly CLOSE_FALLBACK_MS = 700;\n /** Whether to render the dimming backdrop behind the sheet (default: true).\n * A host that already paints its own backdrop (the modal shell) sets this false. */\n @Input() showBackdrop = true;\n /** Whether to render the drag grabber handle that arms swipe-to-dismiss (default: true). */\n @Input() showGrabber = true;\n /** Whether the sheet can be dismissed by the user via swipe/flick or backdrop tap\n * (default: true). When false the gestures are inert and the backdrop is non-closing. */\n @Input() dismissible = true;\n /** Optional `min-height` floor (px) for the container, so filtering its content\n * shorter cannot shrink the sheet mid-interaction. Null leaves it content-sized. */\n @Input() minHeightPx: number | null = null;\n /** Cap on the sheet height as a fraction of the viewport, in vh (default: 80). */\n @Input() maxHeightVh = 80;\n /** Extra class(es) applied to the sheet container, so a host can attach the hooks\n * its own CSS depends on (e.g. the modal shell's `modal-container`). */\n @Input() containerClass = '';\n /** Accessible name for the sheet dialog. */\n @Input() ariaLabel?: string;\n /** Id of the element that labels this dialog (takes precedence over `ariaLabel`). */\n @Input() ariaLabelledby?: string;\n /**\n * When true, the sheet grows to its `maxHeightVh` while the host app marks the soft\n * keyboard open (a `.mn-keyboard-open` class on a document ancestor), guaranteeing\n * scroll room to lift a focused field above an overlaying keyboard. Off by default so\n * a keyboard opened over an unrelated sheet (a multi-select search) does not resize it.\n */\n @Input() growWithKeyboard = false;\n /**\n * Optional async gate consulted before a user-initiated dismissal (swipe/flick/backdrop\n * tap) is committed. Resolving false aborts the dismissal and springs the sheet back —\n * used by the modal to run its close guard (e.g. an unsaved-changes prompt). A\n * programmatic {@link startClosing} bypasses it.\n */\n @Input() dismissGuard?: () => boolean | Promise<boolean>;\n /**\n * Emitted once the user has dismissed the sheet — after the slide-down exit has\n * finished, so the host can remove the sheet from the DOM without cutting the\n * animation short. The host decides what dismissal means (close, run a guard, …).\n */\n @Output() dismiss = new EventEmitter<void>();\n /** Current downward drag offset (px) applied to the sheet while swiping. */\n sheetDragY = 0;\n /** True while the user is actively dragging the grabber (disables the snap transition). */\n isDraggingSheet = false;\n /** True once a dismissal has committed — the sheet glides off-screen via its transition. */\n isDismissing = false;\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n /** The sheet container element, used to measure its height and drive the exit. */\n private readonly containerRef = viewChild<ElementRef<HTMLElement>>('container');\n private dragStartY = 0;\n\n /** The two most recent (y, timestamp) pointer samples, for estimating flick velocity.\n * `t` uses the event timestamp (monotonic), so no wall-clock is read. */\n private lastSample: { y: number; t: number } | null = null;\n private prevSample: { y: number; t: number } | null = null;\n\n /** In-flight exit animation, so a swipe-dismiss and a follow-up programmatic\n * {@link startClosing} share one glide instead of re-triggering it. */\n private exitPromise: Promise<void> | null = null;\n\n /** The host node once moved to `document.body`, so it is only detached if we moved it. */\n private portalledHost: HTMLElement | null = null;\n\n /** Blocks scroll gestures aimed at anything behind the sheet, while it is open. */\n private scrollGuard: ((event: Event) => void) | null = null;\n\n /** Moves the host out to `document.body` and stops the page behind scrolling. */\n ngOnInit(): void {\n if (typeof document === 'undefined') return;\n const host = this.el.nativeElement;\n document.body.appendChild(host);\n this.portalledHost = host;\n this.lockScroll();\n }\n\n /**\n * Stops pointer scrolling behind the sheet for as long as it is open.\n *\n * Cancels the gesture rather than setting `overflow: hidden` on `document.body`: an\n * app whose scroll container is a layout element (a `<main>`, a drawer body) leaves\n * `body` unscrollable, so locking it there is a no-op and the page still slides about\n * under the sheet. Cancelling `wheel` and `touchmove` before anything acts on them\n * holds regardless of which element does the scrolling.\n *\n * Gestures that begin inside the sheet are let through so its own content still\n * scrolls; `overscroll-behavior: contain` keeps those from chaining out at the ends.\n *\n * Pointer input only. Page Down and the arrows still reach the page behind when focus\n * is left there — closing that needs either a key filter or moving focus into the\n * sheet, and neither belongs in this change.\n */\n private lockScroll(): void {\n const guard = (event: Event): void => {\n const target = event.target as Node | null;\n const container = this.containerRef()?.nativeElement;\n if (container && target && container.contains(target)) return;\n // Only cancellable events can be stopped; a passive listener elsewhere in the\n // chain would otherwise log a console error for a no-op preventDefault.\n if (event.cancelable) event.preventDefault();\n };\n // Capture phase, so the gesture is cancelled before any scroller sees it.\n document.addEventListener('wheel', guard, { capture: true, passive: false });\n document.addEventListener('touchmove', guard, { capture: true, passive: false });\n this.scrollGuard = guard;\n }\n\n /** Releases the scroll guard. Idempotent. */\n private unlockScroll(): void {\n if (!this.scrollGuard) return;\n document.removeEventListener('wheel', this.scrollGuard, { capture: true });\n document.removeEventListener('touchmove', this.scrollGuard, { capture: true });\n this.scrollGuard = null;\n }\n\n /**\n * Detaches the relocated host.\n *\n * Angular tears a view down by removing the nodes it created from their parent; a\n * host we moved to `body` is no longer among the parent's children, so without\n * this the sheet would outlive the view that declared it.\n */\n ngOnDestroy(): void {\n this.unlockScroll();\n this.portalledHost?.remove();\n this.portalledHost = null;\n }\n\n @HostBinding('class') get hostClasses(): string {\n return (\n `mn-bottom-sheet${this.isDismissing ? ' is-dismissing' : ''}` +\n `${this.growWithKeyboard ? ' grow-with-keyboard' : ''}`\n );\n }\n\n /** Whether the viewport is currently narrow enough for the sheet to accept a swipe. */\n private get isNarrow(): boolean {\n return typeof window === 'undefined' || window.innerWidth <= MnBottomSheet.SHEET_MAX_WIDTH;\n }\n\n onSheetPointerDown(event: PointerEvent): void {\n if (!this.dismissible || !this.isNarrow) return;\n // Don't hijack drags that begin on an interactive control inside the sheet.\n if ((event.target as HTMLElement).closest('button, input, textarea, select, a')) return;\n this.isDraggingSheet = true;\n this.dragStartY = event.clientY;\n // Seed the velocity window so a fast flick that releases on the first move still measures.\n this.lastSample = { y: event.clientY, t: event.timeStamp };\n this.prevSample = this.lastSample;\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n onSheetPointerMove(event: PointerEvent): void {\n if (!this.isDraggingSheet) return;\n // Only track downward movement.\n this.sheetDragY = Math.max(0, event.clientY - this.dragStartY);\n this.prevSample = this.lastSample;\n this.lastSample = { y: event.clientY, t: event.timeStamp };\n }\n\n onSheetPointerUp(): void {\n if (!this.isDraggingSheet) return;\n this.isDraggingSheet = false;\n\n if (this.shouldDismiss()) {\n void this.attemptDismiss();\n } else {\n this.snapBack();\n }\n\n this.lastSample = null;\n this.prevSample = null;\n }\n\n onBackdropClick(): void {\n void this.attemptDismiss();\n }\n\n /**\n * Plays the slide-down exit and resolves once it has finished. Exposed so a host that\n * dismisses the sheet programmatically (not via a gesture) can await the same exit\n * before tearing the sheet down. Idempotent: a swipe-dismiss already in flight and a\n * subsequent programmatic close share the one glide rather than restarting it.\n */\n startClosing(): Promise<void> {\n return this.playExit();\n }\n\n /**\n * Runs the optional {@link dismissGuard}, then either commits the dismissal (glide out\n * + emit) or springs the sheet back if the guard rejects. A non-dismissible sheet never\n * gets here from a gesture, but the guard is still short-circuited defensively.\n */\n private async attemptDismiss(): Promise<void> {\n if (!this.dismissible) return;\n if (this.dismissGuard) {\n const allowed = await this.dismissGuard();\n if (!allowed) {\n this.snapBack();\n this.cdr.detectChanges();\n return;\n }\n }\n this.commitDismiss();\n }\n\n /** Whether the release should dismiss: a long-enough drag OR a fast downward flick. */\n private shouldDismiss(): boolean {\n if (this.sheetDragY > MnBottomSheet.SWIPE_DISMISS_THRESHOLD) {\n return true;\n }\n return (\n this.releaseVelocity() > MnBottomSheet.FLICK_VELOCITY &&\n this.sheetDragY > MnBottomSheet.FLICK_MIN_DISTANCE\n );\n }\n\n /** Downward release speed (px/ms) from the last two pointer samples; 0 when unusable. */\n private releaseVelocity(): number {\n if (!this.lastSample || !this.prevSample) return 0;\n const dt = this.lastSample.t - this.prevSample.t;\n if (dt <= 0) return 0;\n return (this.lastSample.y - this.prevSample.y) / dt;\n }\n\n /** Springs the sheet back to its resting position after a drag that didn't dismiss. */\n private snapBack(): void {\n this.sheetDragY = 0;\n }\n\n /**\n * Commits a dismissal: glides the sheet the rest of the way off-screen, then emits\n * {@link dismiss} once the exit animation settles. Continuing the gesture (rather than\n * snapping back to 0 first) keeps a swipe feeling like one unbroken motion.\n */\n private commitDismiss(): void {\n void this.playExit().then(() => this.dismiss.emit());\n }\n\n /** Commits the exit animation exactly once and returns the shared in-flight promise.\n * Short-circuits under reduced motion and falls back to a timeout if no event fires. */\n private playExit(): Promise<void> {\n if (this.exitPromise) return this.exitPromise;\n this.isDismissing = true;\n this.sheetDragY = window.innerHeight;\n this.cdr.detectChanges();\n this.exitPromise = this.awaitExit();\n return this.exitPromise;\n }\n\n /** Waits for the container's exit transition to end, with a reduced-motion short-circuit\n * and a fallback timeout so it always resolves. */\n private awaitExit(): Promise<void> {\n return new Promise((resolve) => {\n if (this.prefersReducedMotion()) {\n resolve();\n return;\n }\n const container =\n this.containerRef()?.nativeElement ??\n this.el.nativeElement.querySelector<HTMLElement>('.mn-sheet-container');\n if (!container) {\n resolve();\n return;\n }\n let settled = false;\n const done = (event?: Event): void => {\n // Ignore end events bubbling up from descendant transitions.\n if (event && event.target !== container) return;\n if (settled) return;\n settled = true;\n container.removeEventListener('transitionend', done);\n clearTimeout(fallback);\n resolve();\n };\n container.addEventListener('transitionend', done);\n const fallback = setTimeout(done, MnBottomSheet.CLOSE_FALLBACK_MS);\n });\n }\n\n private prefersReducedMotion(): boolean {\n return (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n }\n}\n","@if (showBackdrop) {\n <!-- Dims the page behind the sheet. Tapping it dismisses when the sheet is dismissible. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div (click)=\"onBackdropClick()\" class=\"mn-sheet-backdrop fixed inset-0 z-9998 bg-black/40\"></div>\n}\n\n<div\n #container\n [attr.aria-label]=\"ariaLabelledby ? null : (ariaLabel || null)\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n [class.sheet-dragging]=\"isDraggingSheet\"\n [ngClass]=\"containerClass\"\n [style.--mn-sheet-max]=\"maxHeightVh + 'vh'\"\n [style.max-height.vh]=\"maxHeightVh\"\n [style.min-height.px]=\"minHeightPx\"\n [style.transform]=\"sheetDragY ? 'translateY(' + sheetDragY + 'px)' : null\"\n aria-modal=\"true\"\n class=\"mn-sheet-container fixed inset-x-0 bottom-0 z-9999 flex flex-col bg-base-100 border-t border-base-300 rounded-t-2xl shadow-lg\"\n role=\"dialog\"\n tabindex=\"-1\"\n>\n @if (showGrabber) {\n <!-- Drag handle for swipe-to-dismiss. The gesture is armed on the whole handle;\n drags starting on a control inside the projected content are ignored. -->\n <div\n (pointercancel)=\"onSheetPointerUp()\"\n (pointerdown)=\"onSheetPointerDown($event)\"\n (pointermove)=\"onSheetPointerMove($event)\"\n (pointerup)=\"onSheetPointerUp()\"\n class=\"flex justify-center pt-2 pb-1 touch-none cursor-grab shrink-0\"\n >\n <div class=\"h-1.5 w-10 rounded-full bg-base-300\"></div>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n","/**\n * Public API of the `mn-angular-lib/bottom-sheet` entry point: the bottom sheet.\n *\n * Each entry point is its own module in the published package, so a consumer's bundler\n * splits it into the chunk that uses it instead of loading the whole library at startup.\n * The root `mn-angular-lib` entry re-exports every entry point.\n */\nexport * from './src/mn-bottom-sheet';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAeA;;;;;;;;;;;;;;;;;;;;;;AAsBG;MAQU,aAAa,CAAA;AACxB;AAC+E;AACvE,IAAA,OAAgB,eAAe,GAAG,MAAM;;AAExC,IAAA,OAAgB,uBAAuB,GAAG,GAAG;;AAE7C,IAAA,OAAgB,cAAc,GAAG,GAAG;;AAEpC,IAAA,OAAgB,kBAAkB,GAAG,EAAE;;AAEvC,IAAA,OA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AA,IAAA,EAAA,WAAA,EAAA,IAAA,EDIY,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIN,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,UAAA,EACf,IAAI,EAAA,OAAA,EACP,CAAC,OAAO,CAAC,EAAA,QAAA,EAAA,4kDAAA,EAAA,MAAA,EAAA,CAAA,o4BAAA,CAAA,EAAA;;sBAkBjB;;sBAEA;;sBAGA;;sBAGA;;sBAEA;;sBAGA;;sBAEA;;sBAEA;;sBAOA;;sBAOA;;sBAMA;4DAUkE,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA;sBA+E7E,WAAW;uBAAC,OAAO;;;AEzLtB;;;;;;AAMG;;ACNH;;AAEG;;"}
|
|
@@ -138,11 +138,11 @@ class CalendarMonthComponent {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CalendarMonthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
141
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CalendarMonthComponent, isStandalone: true, selector: "mn-calendar-month", inputs: { focusDay: "focusDay", eventsChanged: "eventsChanged", focusDayChanged: "focusDayChanged", config: "config" }, outputs: { dayClicked: "dayClicked" }, ngImport: i0, template: "<!-- Month grid. Cells are grouped by space rather than boxed by borders, in\n keeping with the date-selector-bar: no rules, soft rounded cells, a hover\n wash, and today marked by a tinted number alone (no circle). -->\n<!-- Rows are a compact fixed height rather than stretched to fill the container:\n a month with few events shouldn't leave each cell mostly empty. The panel\n scrolls if the grid is taller than the space it's given. -->\n<div [attr.aria-label]=\"monthViewLabel\" class=\"w-full flex flex-col\" role=\"grid\">\n <div class=\"grid grid-cols-7 pb-2\">\n @for (day of weekdayLabels; track day) {\n <div class=\"pl-2 text-left text-[11px] font-semibold uppercase tracking-wide opacity-45\" role=\"columnheader\">{{ day }}</div>\n }\n </div>\n <div class=\"grid grid-cols-7 gap-1 auto-rows-[minmax(92px,auto)]\">\n @for (item of monthItems; track item.date.getTime()) {\n <div\n class=\"flex flex-col gap-1 min-h-0 overflow-hidden rounded-xl p-1.5 cursor-pointer transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none\"\n [class.opacity-40]=\"!item.isCurrentMonth\"\n (keyup.enter)=\"onDayClick(item.date)\"\n (click)=\"onDayClick(item.date)\"\n tabindex=\"0\"\n role=\"gridcell\"\n [attr.aria-label]=\"item.date.toDateString()\">\n <span class=\"text-[13px] font-bold leading-none tabular-nums\" [class.text-primary]=\"item.isToday\">{{ item.dayNumber }}</span>\n <div class=\"flex flex-col gap-0.5 min-h-0\">\n @for (event of item.events.slice(0, 3); track $index) {\n <div\n class=\"flex items-center overflow-hidden rounded-md border-l-[3px] px-1.5 py-0.5 text-[11px] leading-tight\"\n [style.background-color]=\"event.color.
|
|
141
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CalendarMonthComponent, isStandalone: true, selector: "mn-calendar-month", inputs: { focusDay: "focusDay", eventsChanged: "eventsChanged", focusDayChanged: "focusDayChanged", config: "config" }, outputs: { dayClicked: "dayClicked" }, ngImport: i0, template: "<!-- Month grid. Cells are grouped by space rather than boxed by borders, in\n keeping with the date-selector-bar: no rules, soft rounded cells, a hover\n wash, and today marked by a tinted number alone (no circle). -->\n<!-- Rows are a compact fixed height rather than stretched to fill the container:\n a month with few events shouldn't leave each cell mostly empty. The panel\n scrolls if the grid is taller than the space it's given. -->\n<div [attr.aria-label]=\"monthViewLabel\" class=\"w-full flex flex-col\" role=\"grid\">\n <div class=\"grid grid-cols-7 pb-2\">\n @for (day of weekdayLabels; track day) {\n <div class=\"pl-2 text-left text-[11px] font-semibold uppercase tracking-wide opacity-45\" role=\"columnheader\">{{ day }}</div>\n }\n </div>\n <div class=\"grid grid-cols-7 gap-1 auto-rows-[minmax(92px,auto)]\">\n @for (item of monthItems; track item.date.getTime()) {\n <div\n class=\"flex flex-col gap-1 min-h-0 overflow-hidden rounded-xl p-1.5 cursor-pointer transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none\"\n [class.opacity-40]=\"!item.isCurrentMonth\"\n (keyup.enter)=\"onDayClick(item.date)\"\n (click)=\"onDayClick(item.date)\"\n tabindex=\"0\"\n role=\"gridcell\"\n [attr.aria-label]=\"item.date.toDateString()\">\n <span class=\"text-[13px] font-bold leading-none tabular-nums\" [class.text-primary]=\"item.isToday\">{{ item.dayNumber }}</span>\n <div class=\"flex flex-col gap-0.5 min-h-0\">\n @for (event of item.events.slice(0, 3); track $index) {\n <div\n class=\"flex items-center overflow-hidden rounded-md border-l-[3px] px-1.5 py-0.5 text-[11px] leading-tight\"\n [style.background-color]=\"'color-mix(in oklab, ' + event.color.primaryColor + ' 18%, var(--color-base-100, #fff))'\"\n [style.border-left-color]=\"event.color.primaryColor\"\n [style.color]=\"event.color.primaryColor\"\n [title]=\"event.title\">\n <span class=\"truncate font-semibold\">{{ event.title }}</span>\n </div>\n }\n <!-- Overflow indicator. Styled as a pill that lights up on hover so it\n reads as actionable; the whole cell already navigates to the Day\n view for this date on click / Enter, where every event is listed. -->\n @if (item.events.length > 3) {\n <span class=\"mt-0.5 inline-flex w-fit items-center rounded-md px-1.5 py-0.5 text-[10.5px] font-semibold opacity-60 transition-colors hover:bg-base-300 hover:opacity-100 motion-reduce:transition-none\">\n +{{ item.events.length - 3 }} {{ moreEventsLabel }}\n </span>\n }\n </div>\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
142
142
|
}
|
|
143
143
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CalendarMonthComponent, decorators: [{
|
|
144
144
|
type: Component,
|
|
145
|
-
args: [{ selector: 'mn-calendar-month', standalone: true, imports: [CommonModule], template: "<!-- Month grid. Cells are grouped by space rather than boxed by borders, in\n keeping with the date-selector-bar: no rules, soft rounded cells, a hover\n wash, and today marked by a tinted number alone (no circle). -->\n<!-- Rows are a compact fixed height rather than stretched to fill the container:\n a month with few events shouldn't leave each cell mostly empty. The panel\n scrolls if the grid is taller than the space it's given. -->\n<div [attr.aria-label]=\"monthViewLabel\" class=\"w-full flex flex-col\" role=\"grid\">\n <div class=\"grid grid-cols-7 pb-2\">\n @for (day of weekdayLabels; track day) {\n <div class=\"pl-2 text-left text-[11px] font-semibold uppercase tracking-wide opacity-45\" role=\"columnheader\">{{ day }}</div>\n }\n </div>\n <div class=\"grid grid-cols-7 gap-1 auto-rows-[minmax(92px,auto)]\">\n @for (item of monthItems; track item.date.getTime()) {\n <div\n class=\"flex flex-col gap-1 min-h-0 overflow-hidden rounded-xl p-1.5 cursor-pointer transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none\"\n [class.opacity-40]=\"!item.isCurrentMonth\"\n (keyup.enter)=\"onDayClick(item.date)\"\n (click)=\"onDayClick(item.date)\"\n tabindex=\"0\"\n role=\"gridcell\"\n [attr.aria-label]=\"item.date.toDateString()\">\n <span class=\"text-[13px] font-bold leading-none tabular-nums\" [class.text-primary]=\"item.isToday\">{{ item.dayNumber }}</span>\n <div class=\"flex flex-col gap-0.5 min-h-0\">\n @for (event of item.events.slice(0, 3); track $index) {\n <div\n class=\"flex items-center overflow-hidden rounded-md border-l-[3px] px-1.5 py-0.5 text-[11px] leading-tight\"\n [style.background-color]=\"event.color.
|
|
145
|
+
args: [{ selector: 'mn-calendar-month', standalone: true, imports: [CommonModule], template: "<!-- Month grid. Cells are grouped by space rather than boxed by borders, in\n keeping with the date-selector-bar: no rules, soft rounded cells, a hover\n wash, and today marked by a tinted number alone (no circle). -->\n<!-- Rows are a compact fixed height rather than stretched to fill the container:\n a month with few events shouldn't leave each cell mostly empty. The panel\n scrolls if the grid is taller than the space it's given. -->\n<div [attr.aria-label]=\"monthViewLabel\" class=\"w-full flex flex-col\" role=\"grid\">\n <div class=\"grid grid-cols-7 pb-2\">\n @for (day of weekdayLabels; track day) {\n <div class=\"pl-2 text-left text-[11px] font-semibold uppercase tracking-wide opacity-45\" role=\"columnheader\">{{ day }}</div>\n }\n </div>\n <div class=\"grid grid-cols-7 gap-1 auto-rows-[minmax(92px,auto)]\">\n @for (item of monthItems; track item.date.getTime()) {\n <div\n class=\"flex flex-col gap-1 min-h-0 overflow-hidden rounded-xl p-1.5 cursor-pointer transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none\"\n [class.opacity-40]=\"!item.isCurrentMonth\"\n (keyup.enter)=\"onDayClick(item.date)\"\n (click)=\"onDayClick(item.date)\"\n tabindex=\"0\"\n role=\"gridcell\"\n [attr.aria-label]=\"item.date.toDateString()\">\n <span class=\"text-[13px] font-bold leading-none tabular-nums\" [class.text-primary]=\"item.isToday\">{{ item.dayNumber }}</span>\n <div class=\"flex flex-col gap-0.5 min-h-0\">\n @for (event of item.events.slice(0, 3); track $index) {\n <div\n class=\"flex items-center overflow-hidden rounded-md border-l-[3px] px-1.5 py-0.5 text-[11px] leading-tight\"\n [style.background-color]=\"'color-mix(in oklab, ' + event.color.primaryColor + ' 18%, var(--color-base-100, #fff))'\"\n [style.border-left-color]=\"event.color.primaryColor\"\n [style.color]=\"event.color.primaryColor\"\n [title]=\"event.title\">\n <span class=\"truncate font-semibold\">{{ event.title }}</span>\n </div>\n }\n <!-- Overflow indicator. Styled as a pill that lights up on hover so it\n reads as actionable; the whole cell already navigates to the Day\n view for this date on click / Enter, where every event is listed. -->\n @if (item.events.length > 3) {\n <span class=\"mt-0.5 inline-flex w-fit items-center rounded-md px-1.5 py-0.5 text-[10.5px] font-semibold opacity-60 transition-colors hover:bg-base-300 hover:opacity-100 motion-reduce:transition-none\">\n +{{ item.events.length - 3 }} {{ moreEventsLabel }}\n </span>\n }\n </div>\n </div>\n }\n </div>\n</div>\n" }]
|
|
146
146
|
}], ctorParameters: () => [], propDecorators: { focusDay: [{
|
|
147
147
|
type: Input
|
|
148
148
|
}], eventsChanged: [{
|
|
@@ -182,11 +182,11 @@ class CalendarEventDefaultComponent {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CalendarEventDefaultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
185
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CalendarEventDefaultComponent, isStandalone: true, selector: "mn-calendar-event-default", ngImport: i0, template: "<!-- The shared event chip: a colored spine and a tinted fill from the event's own\n colours, so it reads the same in week, day and month. Text inherits the\n event's primary colour, keeping it legible on either theme. -->\n<div class=\"h-full overflow-hidden cursor-pointer rounded-lg border-l-[3px] px-2 py-1 text-xs\"\n [style.background-color]=\"event.color.
|
|
185
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: CalendarEventDefaultComponent, isStandalone: true, selector: "mn-calendar-event-default", ngImport: i0, template: "<!-- The shared event chip: a colored spine and a tinted fill from the event's own\n colours, so it reads the same in week, day and month. Text inherits the\n event's primary colour, keeping it legible on either theme. The fill mixes that\n colour into the page surface, so it darkens with a dark theme instead of staying\n a light pastel. -->\n<div class=\"h-full overflow-hidden cursor-pointer rounded-lg border-l-[3px] px-2 py-1 text-xs\"\n [style.background-color]=\"'color-mix(in oklab, ' + event.color.primaryColor + ' 18%, var(--color-base-100, #fff))'\"\n [style.border-left-color]=\"event.color.primaryColor\"\n [style.color]=\"event.color.primaryColor\">\n <div class=\"truncate font-semibold\">{{ event.title }}</div>\n <div class=\"truncate text-[11px] opacity-85\">{{ formattedTime }}</div>\n @if (event.description) {\n <div class=\"truncate text-[11px] opacity-75\">{{ event.description }}</div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
186
186
|
}
|
|
187
187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: CalendarEventDefaultComponent, decorators: [{
|
|
188
188
|
type: Component,
|
|
189
|
-
args: [{ selector: 'mn-calendar-event-default', standalone: true, imports: [CommonModule], template: "<!-- The shared event chip: a colored spine and a tinted fill from the event's own\n colours, so it reads the same in week, day and month. Text inherits the\n event's primary colour, keeping it legible on either theme. -->\n<div class=\"h-full overflow-hidden cursor-pointer rounded-lg border-l-[3px] px-2 py-1 text-xs\"\n [style.background-color]=\"event.color.
|
|
189
|
+
args: [{ selector: 'mn-calendar-event-default', standalone: true, imports: [CommonModule], template: "<!-- The shared event chip: a colored spine and a tinted fill from the event's own\n colours, so it reads the same in week, day and month. Text inherits the\n event's primary colour, keeping it legible on either theme. The fill mixes that\n colour into the page surface, so it darkens with a dark theme instead of staying\n a light pastel. -->\n<div class=\"h-full overflow-hidden cursor-pointer rounded-lg border-l-[3px] px-2 py-1 text-xs\"\n [style.background-color]=\"'color-mix(in oklab, ' + event.color.primaryColor + ' 18%, var(--color-base-100, #fff))'\"\n [style.border-left-color]=\"event.color.primaryColor\"\n [style.color]=\"event.color.primaryColor\">\n <div class=\"truncate font-semibold\">{{ event.title }}</div>\n <div class=\"truncate text-[11px] opacity-85\">{{ formattedTime }}</div>\n @if (event.description) {\n <div class=\"truncate text-[11px] opacity-75\">{{ event.description }}</div>\n }\n</div>\n" }]
|
|
190
190
|
}], ctorParameters: () => [] });
|
|
191
191
|
|
|
192
192
|
/**
|
|
@@ -439,10 +439,13 @@ class CalendarWeekComponent {
|
|
|
439
439
|
this.dayColumnMap.push({ subColumns: maxSubCols, startCol: currentCol });
|
|
440
440
|
currentCol += maxSubCols;
|
|
441
441
|
}
|
|
442
|
+
// Each overlap column gets at least 0.8 of a day: a day with two overlapping events grows
|
|
443
|
+
// to 1.6 days instead of splitting one day in two, which left ~40px blocks reading "V…".
|
|
442
444
|
const parts = [];
|
|
443
445
|
for (const day of this.dayColumnMap) {
|
|
446
|
+
const share = Math.max(1 / day.subColumns, 0.8);
|
|
444
447
|
for (let j = 0; j < day.subColumns; j++) {
|
|
445
|
-
parts.push(`${
|
|
448
|
+
parts.push(`${share}fr`);
|
|
446
449
|
}
|
|
447
450
|
}
|
|
448
451
|
this.gridTemplateColumns = parts.join(' ');
|