mn-angular-lib 1.0.177 → 1.0.179
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 +535 -0
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +356 -0
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-button.mjs +382 -0
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-calendar-core.mjs +377 -0
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-calendar.mjs +1513 -0
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-collection.mjs +2277 -0
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-core.mjs +1232 -0
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-display.mjs +728 -0
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-forms.mjs +4260 -0
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-keyboard.mjs +195 -0
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal-core.mjs +945 -0
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2016 -0
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal.mjs +126 -0
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +275 -0
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-segmented.mjs +246 -0
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-tab.mjs +573 -0
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -0
- package/fesm2022/mn-angular-lib.mjs +21 -15509
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +66 -1
- package/src/lib/styles/index.css +2 -2
- package/types/mn-angular-lib-alert.d.ts +258 -0
- package/types/mn-angular-lib-bottom-sheet.d.ts +173 -0
- package/types/mn-angular-lib-button.d.ts +318 -0
- package/types/mn-angular-lib-calendar-core.d.ts +378 -0
- package/types/mn-angular-lib-calendar.d.ts +636 -0
- package/types/mn-angular-lib-collection.d.ts +1550 -0
- package/types/mn-angular-lib-core.d.ts +756 -0
- package/types/mn-angular-lib-display.d.ts +1075 -0
- package/types/mn-angular-lib-forms.d.ts +3235 -0
- package/types/mn-angular-lib-keyboard.d.ts +128 -0
- package/types/mn-angular-lib-modal-core.d.ts +1130 -0
- package/types/mn-angular-lib-modal-ui.d.ts +492 -0
- package/types/mn-angular-lib-modal.d.ts +27 -0
- package/types/mn-angular-lib-rich-text-editor.d.ts +157 -0
- package/types/mn-angular-lib-segmented.d.ts +395 -0
- package/types/mn-angular-lib-tab.d.ts +313 -0
- package/types/mn-angular-lib.d.ts +16 -10816
- /package/{src/lib/features → alert/src}/mn-alert/mn-alert-outlet/mn-alert-outlet.css +0 -0
- /package/{src/lib/features → bottom-sheet/src}/mn-bottom-sheet/mn-bottom-sheet.component.css +0 -0
- /package/{src/lib/features → button/src}/mn-skeleton/mn-skeleton.css +0 -0
- /package/{src/lib/features → collection/src}/mn-list/mn-list.component.css +0 -0
- /package/{src/lib/features → forms/src}/mn-checkbox/mn-checkbox.css +0 -0
- /package/{src/lib/features → forms/src}/mn-dropdown/mn-dropdown.css +0 -0
- /package/{src/lib/features → forms/src}/mn-multi-select/mn-multi-select.css +0 -0
- /package/{src/lib/features → keyboard/src}/mn-keyboard/mn-keyboard.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-form-body/mn-form-body.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-wizard-body/mn-wizard-body.component.css +0 -0
- /package/{src/lib/features → rich-text-editor/src}/mn-rich-text-editor/mn-rich-text-editor.component.css +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mn-angular-lib.mjs","sources":["../../../projects/mn-angular-lib/src/lib/features/mn-alert/mn-alert.tokens.ts","../../../projects/mn-angular-lib/src/lib/features/mn-alert/mn-alert.providers.ts","../../../projects/mn-angular-lib/src/lib/features/mn-alert/mn-alert.store.ts","../../../projects/mn-angular-lib/src/lib/features/mn-alert/mn-alert.service.ts","../../../projects/mn-angular-lib/src/lib/features/mn-alert/mn-alertVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-button/mn-buttonVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-button/mn-button.ts","../../../projects/mn-angular-lib/src/lib/features/mn-button/mn-button.html","../../../projects/mn-angular-lib/src/lib/language/mn-language.types.ts","../../../projects/mn-angular-lib/src/lib/language/mn-language.service.ts","../../../projects/mn-angular-lib/src/lib/language/mn-language.providers.ts","../../../projects/mn-angular-lib/src/lib/language/mn-translate.pipe.ts","../../../projects/mn-angular-lib/src/lib/features/mn-alert/mn-alert-outlet/mn-alert-outlet.ts","../../../projects/mn-angular-lib/src/lib/features/mn-alert/mn-alert-outlet/mn-alert-outlet.html","../../../projects/mn-angular-lib/src/lib/features/mn-badge/mn-badgeVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-badge/mn-badge.ts","../../../projects/mn-angular-lib/src/lib/features/mn-badge/mn-badge.html","../../../projects/mn-angular-lib/src/lib/features/mn-input-field/mn-input-field-adapters.ts","../../../projects/mn-angular-lib/src/lib/features/mn-input-field/mn-input-fieldVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-error-message/mn-error-message.ts","../../../projects/mn-angular-lib/src/lib/features/mn-error-message/mn-error-message.html","../../../projects/mn-angular-lib/src/lib/config/mn-config.types.ts","../../../projects/mn-angular-lib/src/lib/config/mn-config.service.ts","../../../projects/mn-angular-lib/src/lib/config/mn-config.providers.ts","../../../projects/mn-angular-lib/src/lib/context/mn-context.tokens.ts","../../../projects/mn-angular-lib/src/lib/config/mn-component-config.providers.ts","../../../projects/mn-angular-lib/src/lib/context/mn-section.directive.ts","../../../projects/mn-angular-lib/src/lib/context/mn-instance.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-input-field/mn-input-field.ts","../../../projects/mn-angular-lib/src/lib/features/mn-input-field/mn-input-field.html","../../../projects/mn-angular-lib/src/lib/features/mn-dual-horizontal-image/mn-dual-horizontal-image.ts","../../../projects/mn-angular-lib/src/lib/features/mn-dual-horizontal-image/mn-dual-horizontal-image.html","../../../projects/mn-angular-lib/src/lib/features/mn-information-card/mn-information-cardVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-information-card/mn-information-card.ts","../../../projects/mn-angular-lib/src/lib/features/mn-information-card/mn-information-card.html","../../../projects/mn-angular-lib/src/lib/features/mn-textarea/mn-textareaVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-textarea/mn-textarea.ts","../../../projects/mn-angular-lib/src/lib/features/mn-textarea/mn-textarea.html","../../../projects/mn-angular-lib/src/lib/features/mn-file-input/mn-file-inputVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-file-input/mn-file-input.ts","../../../projects/mn-angular-lib/src/lib/features/mn-file-input/mn-file-input.html","../../../projects/mn-angular-lib/src/lib/features/mn-checkbox/mn-checkboxVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-checkbox/mn-checkbox.ts","../../../projects/mn-angular-lib/src/lib/features/mn-checkbox/mn-checkbox.html","../../../projects/mn-angular-lib/src/lib/features/mn-datetime/mn-datetimeVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-datetime/mn-datetime.ts","../../../projects/mn-angular-lib/src/lib/features/mn-datetime/mn-datetime.html","../../../projects/mn-angular-lib/src/lib/features/mn-date-selector-bar/mn-date-selector-bar.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-date-selector-bar/mn-date-selector-bar.component.html","../../../projects/mn-angular-lib/src/lib/shared/anchored-panel-placement.ts","../../../projects/mn-angular-lib/src/lib/shared/listbox-navigation.ts","../../../projects/mn-angular-lib/src/lib/features/mn-multi-select/mn-multi-selectVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-bottom-sheet/mn-bottom-sheet.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-bottom-sheet/mn-bottom-sheet.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-multi-select/mn-multi-select.ts","../../../projects/mn-angular-lib/src/lib/features/mn-multi-select/mn-multi-select.html","../../../projects/mn-angular-lib/src/lib/features/mn-dropdown/mn-dropdownVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-dropdown/mn-dropdown.ts","../../../projects/mn-angular-lib/src/lib/features/mn-dropdown/mn-dropdown.html","../../../projects/mn-angular-lib/src/lib/features/mn-keyboard/mn-keyboard.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-keyboard/mn-keyboard.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-select/mn-selectVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-select/mn-select.ts","../../../projects/mn-angular-lib/src/lib/features/mn-select/mn-select.html","../../../projects/mn-angular-lib/src/lib/features/mn-modal/mn-modal.types.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/mn-modal-action-icons.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/mn-modal-haptics.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/form-layout.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/step.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/base-modal.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/wizard-modal.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/form-modal.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/confirmation-modal.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/custom-modal.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/builder/modal.builder.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/mn-modal-ref.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-form-body/mn-custom-field-host.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-table/mn-table.types.ts","../../../projects/mn-angular-lib/src/lib/features/mn-table/mn-table-filter.util.ts","../../../projects/mn-angular-lib/src/lib/features/mn-skeleton/mn-skeletonVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-skeleton/mn-skeleton.ts","../../../projects/mn-angular-lib/src/lib/features/mn-skeleton/mn-skeleton.html","../../../projects/mn-angular-lib/src/lib/features/mn-table/mn-hidden-below.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-table/mn-show-above.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-table/mn-show-below.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-collection/mn-collection.types.ts","../../../projects/mn-angular-lib/src/lib/features/mn-collection/mn-collection-base.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-collection/mn-selectable-collection-base.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-collection/mn-collection-pagination.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-collection/mn-collection-pagination.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-table/mn-table.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-table/mn-table.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-custom-body-host/mn-custom-body-host.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-form-body/mn-form-body.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-form-body/mn-form-body.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-footer-actions/mn-footer-actions.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-wizard-body/mn-wizard-body.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-wizard-body/mn-wizard-body.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-modal-shell/mn-modal-shell.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/components/mn-modal-shell/mn-modal-shell.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-modal/mn-modal.service.ts","../../../projects/mn-angular-lib/src/lib/features/mn-modal/index.ts","../../../projects/mn-angular-lib/src/lib/features/mn-list/mn-list.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-list/mn-list.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-grid/mn-grid.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-grid/mn-grid.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/models/calendar-config.model.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/services/default-calendar-date-formatter.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-month/calendar-month.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-month/calendar-month.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/services/calendar-event-layout.service.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/utils/calendar-utils.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/services/calendar-date-formatter.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-event-default/calendar-event-default.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-event-default/calendar-event-default.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-event/calendar-event.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-event/calendar-event.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-week/calendar-week.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-week/calendar-week.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-day/calendar-day.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-day/calendar-day.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/upcoming-event-row/upcoming-event-row.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/upcoming-event-row/upcoming-event-row.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/upcoming-events/upcoming-events.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/upcoming-events/upcoming-events.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-view/calendar-view.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/components/calendar-view/calendar-view.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-calendar/index.ts","../../../projects/mn-angular-lib/src/lib/features/mn-tab/mn-tab.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-tab/mn-tab.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-rich-text-editor/mn-rich-text-editor.component.ts","../../../projects/mn-angular-lib/src/lib/features/mn-rich-text-editor/mn-rich-text-editor.component.html","../../../projects/mn-angular-lib/src/lib/features/mn-icon/mn-iconVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-icon/mn-icon-map.ts","../../../projects/mn-angular-lib/src/lib/features/mn-icon/mn-icon.ts","../../../projects/mn-angular-lib/src/lib/features/mn-icon/mn-icon.html","../../../projects/mn-angular-lib/src/lib/features/mn-icon/mn-icon-attributes.directive.ts","../../../projects/mn-angular-lib/src/lib/features/mn-breadcrumbs/mn-breadcrumbsVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-breadcrumbs/mn-breadcrumbs.ts","../../../projects/mn-angular-lib/src/lib/features/mn-breadcrumbs/mn-breadcrumbs.html","../../../projects/mn-angular-lib/src/lib/features/mn-segmented/mn-segmentedVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-segmented/mn-segmented.ts","../../../projects/mn-angular-lib/src/lib/features/mn-segmented/mn-segmented.html","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-icon-chipVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-icon-chip.ts","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-icon-chip.html","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-cardVariants.ts","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-card.ts","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-card.html","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-stat-tile.ts","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-stat-tile.html","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-proportion-bar.ts","../../../projects/mn-angular-lib/src/lib/features/mn-card/mn-proportion-bar.html","../../../projects/mn-angular-lib/src/lib/shared/crud/crud.tokens.ts","../../../projects/mn-angular-lib/src/lib/shared/crud/crud.service.ts","../../../projects/mn-angular-lib/src/lib/shared/http/mn-http.service.ts","../../../projects/mn-angular-lib/src/lib/preview/mn-preview-listener.ts","../../../projects/mn-angular-lib/src/public-api.ts","../../../projects/mn-angular-lib/src/mn-angular-lib.ts"],"sourcesContent":["// projects/mn-angular-lib/src/lib/mn-mn-alert/mn-mn-alert.tokens.ts\nimport {InjectionToken} from '@angular/core';\nimport {MnAlert} from './mn-alert.types';\n\nexport type MnAlertKind = 'success' | 'info' | 'warning' | 'error' | 'default';\n\nexport type MnAlertConfig = {\n durations?: Partial<Record<MnAlertKind, number | null>>;\n cssClasses?: Partial<Record<MnAlertKind, string>>;\n icons?: Partial<Record<MnAlertKind, unknown>>;\n fallbackDuration?: number | null;\n /**\n * How many alerts may be on screen at once. Showing one past this cap drops the oldest\n * alert still visible, so a burst of alerts never grows into an unreadable stack.\n */\n maxVisible?: number;\n finalize?: (a: MnAlert) => MnAlert;\n}\n\nexport const MN_ALERT_CONFIG = new InjectionToken<MnAlertConfig>('MN_ALERT_CONFIG');\n\nexport const DEFAULT_MN_ALERT_CONFIG: Required<MnAlertConfig> = {\n durations: { success: 3000, info: 4000, warning: 5000, error: 7000, default: 4000 },\n cssClasses: {\n success: 'mn-alert-success',\n info: 'mn-alert-info',\n warning: 'mn-alert-warning',\n error: 'mn-alert-error',\n default: 'alert'\n },\n icons: {},\n fallbackDuration: 4000,\n maxVisible: 3,\n finalize: (a) => a\n};\n","// projects/mn-angular-lib/src/lib/mn-mn-alert/mn-mn-alert.providers.ts\nimport { Provider } from '@angular/core';\nimport { MN_ALERT_CONFIG, MnAlertConfig, DEFAULT_MN_ALERT_CONFIG } from './mn-alert.tokens';\n\nexport function provideMnAlerts(config: MnAlertConfig = {}): Provider {\n const merged: MnAlertConfig = {\n ...DEFAULT_MN_ALERT_CONFIG,\n ...config,\n durations: { ...DEFAULT_MN_ALERT_CONFIG.durations, ...(config.durations ?? {}) },\n cssClasses: { ...DEFAULT_MN_ALERT_CONFIG.cssClasses, ...(config.cssClasses ?? {}) },\n icons: { ...DEFAULT_MN_ALERT_CONFIG.icons, ...(config.icons ?? {}) }\n };\n return { provide: MN_ALERT_CONFIG, useValue: merged };\n}\n","import {inject, Injectable} from '@angular/core';\nimport {BehaviorSubject} from 'rxjs';\nimport {MnAlert, MnAlertId} from './mn-alert.types';\nimport {DEFAULT_MN_ALERT_CONFIG, MN_ALERT_CONFIG, MnAlertConfig} from './mn-alert.tokens';\n\nlet COUNTER = 0;\nconst uid = () => `mn_${++COUNTER}`;\n\n@Injectable({ providedIn: 'root' })\nexport class MnAlertStore {\n private readonly _alerts$ = new BehaviorSubject<MnAlert[]>([]);\n readonly alerts$ = this._alerts$.asObservable();\n\n /** Host configuration, when the app provided one. Only `maxVisible` is read here — the\n * per-kind durations are resolved by {@link MnAlertService} before an alert reaches the store. */\n private readonly cfg = inject<MnAlertConfig | null>(MN_ALERT_CONFIG, {optional: true});\n\n /** In-flight auto-dismiss timers keyed by alert id, so an alert that leaves early (dismissed\n * by hand, or pushed out by the visible cap) never fires a stale timeout later. */\n private readonly timers = new Map<MnAlertId, ReturnType<typeof setTimeout>>();\n\n /** How many alerts stay on screen at once; showing more drops the oldest ones. */\n private get maxVisible(): number {\n const configured = this.cfg?.maxVisible;\n return typeof configured === 'number' && configured > 0\n ? configured\n : DEFAULT_MN_ALERT_CONFIG.maxVisible;\n }\n\n show(partial: Omit<MnAlert, 'id'>): MnAlertId {\n // Ensure every alert has a numeric duration: use provided or fall back to per-kind default\n const computedDuration = (partial as {\n duration?: number\n }).duration ?? (DEFAULT_MN_ALERT_CONFIG.durations as Record<string, number>)[(partial as {\n kind?: string\n }).kind ?? ''] ?? DEFAULT_MN_ALERT_CONFIG.fallbackDuration;\n const a: MnAlert = { id: uid(), ...partial, duration: computedDuration } as MnAlert;\n\n // Newest alert last; anything beyond the cap is trimmed off the front (the oldest still\n // visible), so a burst of alerts scrolls rather than piling up.\n const queued = [...this._alerts$.value, a];\n const overflow = queued.length - this.maxVisible;\n if (overflow > 0) {\n queued.splice(0, overflow).forEach(dropped => this.clearTimer(dropped.id));\n }\n this._alerts$.next(queued);\n\n if (typeof a.duration === 'number' && a.duration > 0) {\n this.timers.set(a.id, setTimeout(() => this.dismiss(a.id), a.duration));\n }\n return a.id;\n }\n\n dismiss(id: MnAlertId) {\n const list = this._alerts$.value;\n if (list.some(x => x.id === id)) {\n this.clearTimer(id);\n this._alerts$.next(list.filter(x => x.id !== id));\n }\n }\n\n clear() {\n this.timers.forEach(t => clearTimeout(t));\n this.timers.clear();\n this._alerts$.next([]);\n }\n\n private clearTimer(id: MnAlertId) {\n const timer = this.timers.get(id);\n if (timer !== undefined) {\n clearTimeout(timer);\n this.timers.delete(id);\n }\n }\n}\n","// projects/mn-angular-lib/src/lib/mn-mn-alert/mn-mn-alert.service.ts\nimport {Injectable, inject} from '@angular/core';\nimport { MnAlertStore } from './mn-alert.store';\nimport { MnAlert, MnAlertId } from './mn-alert.types';\nimport { MN_ALERT_CONFIG, DEFAULT_MN_ALERT_CONFIG, MnAlertConfig, MnAlertKind } from './mn-alert.tokens';\nimport { MnAlertVariants } from './mn-alertVariants';\n\nexport type MnShowInput = {\n title: string;\n subTitle?: string;\n duration?: number;\n icon?: unknown;\n cssClass?: string;\n meta?: Record<string, unknown>;\n kind: MnAlertKind;\n variant?: MnAlertVariants['variant'];\n}\n\n@Injectable({ providedIn: 'root' })\nexport class MnAlertService {\n private readonly store = inject(MnAlertStore);\n\n private readonly cfg: Required<MnAlertConfig>;\n private readonly userDurations?: Partial<Record<MnAlertKind, number | null>>;\n private readonly hasUserDurations: boolean;\n\n constructor() {\n const cfg = inject<MnAlertConfig | null>(MN_ALERT_CONFIG, {optional: true});\n\n this.userDurations = cfg?.durations;\n this.hasUserDurations = !!cfg?.durations;\n this.cfg = {\n ...DEFAULT_MN_ALERT_CONFIG,\n ...(cfg ?? {}),\n // Do not pre-merge durations; keep defaults separate and use logic in kind()\n durations: DEFAULT_MN_ALERT_CONFIG.durations,\n cssClasses: { ...DEFAULT_MN_ALERT_CONFIG.cssClasses, ...(cfg?.cssClasses ?? {}) },\n icons: { ...DEFAULT_MN_ALERT_CONFIG.icons, ...(cfg?.icons ?? {}) }\n };\n }\n\n show(input: MnShowInput): MnAlertId {\n // Always ensure a numeric duration is set\n let duration = input.duration;\n if (duration == null) {\n // Prefer user defaultDuration if provided and not null, otherwise use library per-kind default\n const userDefault = this.cfg.fallbackDuration;\n if (typeof userDefault === 'number') {\n duration = userDefault;\n } else {\n duration = DEFAULT_MN_ALERT_CONFIG.durations[input.kind as keyof typeof DEFAULT_MN_ALERT_CONFIG.durations] as number;\n }\n }\n\n const a: Omit<MnAlert, 'id'> = {\n title: input.title,\n subTitle: input.subTitle,\n duration,\n icon: input.icon,\n cssClass: input.cssClass,\n meta: input.meta,\n kind: input.kind,\n variant: input.variant\n };\n return this.store.show(this.cfg.finalize(a as MnAlert));\n }\n\n success(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n return this.kind('success', title, subTitle, extra);\n }\n info(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n return this.kind('info', title, subTitle, extra);\n }\n warning(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n return this.kind('warning', title, subTitle, extra);\n }\n error(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n return this.kind('error', title, subTitle, extra);\n }\n\n dismiss(id: MnAlertId) { this.store.dismiss(id); }\n clear() { this.store.clear(); }\n\n private kind(kind: MnAlertKind, title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n let duration: number | null | undefined = extra?.duration;\n\n if (duration == null) {\n if (this.hasUserDurations) {\n const userDur = this.userDurations?.[kind];\n if (typeof userDur === 'number') {\n duration = userDur;\n } else {\n // userDur is undefined or null -> fallback to user defaultDuration if numeric\n if (typeof this.cfg.fallbackDuration === 'number') {\n duration = this.cfg.fallbackDuration;\n } else {\n duration = this.cfg.durations[kind as keyof typeof this.cfg.durations];\n }\n }\n } else {\n // No user durations provided at all; use library defaults per kind\n duration = this.cfg.durations[kind as keyof typeof this.cfg.durations];\n }\n }\n\n const cssClass = extra?.cssClass ?? this.cfg.cssClasses[kind];\n const icon = (extra?.icon ?? this.cfg.icons[kind]) as unknown;\n const variant = extra?.variant;\n\n return this.show({ title, subTitle, duration: duration as number, cssClass, icon, meta: extra?.meta , kind: kind, variant});\n }\n}\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnAlertVariants = tv({\n base: 'flex items-start gap-3 p-4 border rounded-xl shadow-sm transition-all duration-300 w-full ',\n variants: {\n kind: {\n success: 'bg-success/10 border-success/30 text-success',\n info: 'bg-info/10 border-info/30 text-info',\n warning: 'bg-warning/10 border-warning/30 text-warning',\n error: 'bg-error/10 border-error/30 text-error',\n default: 'bg-base-100 border-base-300 text-base-content',\n accent: 'bg-accent/10 border-accent/30 text-accent',\n },\n variant: {\n fill: '',\n outline: 'bg-base-200 border-2',\n soft: 'border-none shadow-none',\n }\n },\n compoundVariants: [\n {\n kind: 'success',\n variant: 'fill',\n class: 'bg-success border-success text-success-content'\n },\n {\n kind: 'info',\n variant: 'fill',\n class: 'bg-info border-info text-info-content'\n },\n {\n kind: 'warning',\n variant: 'fill',\n class: 'bg-warning border-warning text-warning-content'\n },\n {\n kind: 'error',\n variant: 'fill',\n class: 'bg-error border-error text-error-content'\n },\n {\n kind: 'accent',\n variant: 'fill',\n class: 'bg-accent border-accent text-accent-content'\n },\n ],\n defaultVariants: {\n kind: 'info',\n variant: 'soft'\n }\n});\n\nexport type MnAlertVariants = VariantProps<typeof mnAlertVariants>;\n","import {tv, type VariantProps} from 'tailwind-variants';\n\nexport const mnButtonVariants = tv({\n base: 'inline-flex items-center justify-center hover:cursor-pointer transition-all duration-300 ease-in-out',\n variants: {\n size: {\n sm: 'px-2 py-1 text-sm',\n md: 'px-3 py-1.5 text-base',\n lg: 'px-4 py-2 text-lg',\n },\n\n variant: {\n fill: '',\n outline: 'bg-transparent border',\n text: 'bg-transparent',\n textUnderline: 'bg-transparent underline underline-offset-2',\n // Transparent button that only reveals a subtle surface on hover — the idiomatic\n // icon-button look. Colors resolved via compoundVariants.\n ghost: 'bg-transparent',\n },\n\n // Intentionally empty; resolved via compoundVariants\n color: {\n primary: '',\n secondary: '',\n danger: '',\n warning: '',\n success: '',\n accent: '',\n gray: '',\n },\n\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n // A pill. Also what a fully-rounded container (e.g. a segmented track)\n // hands its segments, since there is no tighter step below it.\n full: 'rounded-full',\n },\n // Icon-button shape. `circle`/`square` drop the text padding and make the button a\n // fixed square sized off `size` (see compoundVariants), overriding `borderRadius`.\n // `default` leaves a normal text button untouched.\n shape: {\n default: '',\n circle: 'p-0 shrink-0 rounded-full',\n square: 'p-0 shrink-0 rounded-md',\n },\n disabled: {\n true: 'opacity-50 pointer-events-none',\n },\n // Busy state: dim and block interaction like `disabled`, and hint the wait cursor.\n // The spinner itself is rendered in the template (see mn-button.html).\n loading: {\n true: 'opacity-50 pointer-events-none cursor-wait',\n },\n wrap: {\n true: 'whitespace-normal',\n false: 'whitespace-nowrap',\n },\n hover: {\n true: '',\n },\n },\n\n compoundVariants: [\n // Fill — base\n { variant: 'fill', color: 'primary', class: 'bg-primary text-primary-content border border-primary' },\n { variant: 'fill', color: 'secondary', class: 'bg-secondary text-secondary-content border border-secondary' },\n { variant: 'fill', color: 'danger', class: 'bg-error text-error-content border border-error' },\n { variant: 'fill', color: 'warning', class: 'bg-warning text-warning-content border border-warning' },\n { variant: 'fill', color: 'success', class: 'bg-success text-success-content border border-success' },\n { variant: 'fill', color: 'accent', class: 'bg-accent text-accent-content border border-accent' },\n { variant: 'fill', color: 'gray', class: 'bg-base-content/10 text-base-content/70 border border-base-content/10' },\n // Fill — hover\n { variant: 'fill', color: 'primary', hover: true, class: 'hover:brightness-60' },\n { variant: 'fill', color: 'secondary', hover: true, class: 'hover:brightness-60' },\n { variant: 'fill', color: 'danger', hover: true, class: 'hover:brightness-60' },\n { variant: 'fill', color: 'warning', hover: true, class: 'hover:brightness-60' },\n { variant: 'fill', color: 'success', hover: true, class: 'hover:brightness-60' },\n { variant: 'fill', color: 'accent', hover: true, class: 'hover:brightness-60' },\n { variant: 'fill', color: 'gray', hover: true, class: 'hover:bg-base-content/20' },\n // Outline — base\n { variant: 'outline', color: 'primary', class: 'border-primary text-primary' },\n { variant: 'outline', color: 'secondary', class: 'border-secondary text-secondary' },\n { variant: 'outline', color: 'danger', class: 'border-error text-error' },\n { variant: 'outline', color: 'warning', class: 'border-warning text-warning' },\n { variant: 'outline', color: 'success', class: 'border-success text-success' },\n { variant: 'outline', color: 'accent', class: 'border-accent text-accent' },\n { variant: 'outline', color: 'gray', class: 'border-base-content/70 text-base-content/70' },\n // Outline — hover\n { variant: 'outline', color: 'primary', hover: true, class: 'hover:bg-primary/10' },\n { variant: 'outline', color: 'secondary', hover: true, class: 'hover:bg-secondary/10' },\n { variant: 'outline', color: 'danger', hover: true, class: 'hover:bg-error/10' },\n { variant: 'outline', color: 'warning', hover: true, class: 'hover:bg-warning/10' },\n { variant: 'outline', color: 'success', hover: true, class: 'hover:bg-success/10' },\n { variant: 'outline', color: 'accent', hover: true, class: 'hover:bg-accent/10' },\n { variant: 'outline', color: 'gray', hover: true, class: 'hover:bg-base-content/10' },\n // Text — base\n { variant: 'text', color: 'primary', class: 'text-primary' },\n { variant: 'text', color: 'secondary', class: 'text-secondary' },\n { variant: 'text', color: 'danger', class: 'text-error' },\n { variant: 'text', color: 'warning', class: 'text-warning' },\n { variant: 'text', color: 'success', class: 'text-success' },\n { variant: 'text', color: 'accent', class: 'text-accent' },\n { variant: 'text', color: 'gray', class: 'text-base-content/70' },\n // Text — hover\n { variant: 'text', color: 'primary', hover: true, class: 'hover:bg-primary/10' },\n { variant: 'text', color: 'secondary', hover: true, class: 'hover:bg-secondary/10' },\n { variant: 'text', color: 'danger', hover: true, class: 'hover:bg-error/10' },\n { variant: 'text', color: 'warning', hover: true, class: 'hover:bg-warning/10' },\n { variant: 'text', color: 'success', hover: true, class: 'hover:bg-success/10' },\n { variant: 'text', color: 'accent', hover: true, class: 'hover:bg-accent/10' },\n { variant: 'text', color: 'gray', hover: true, class: 'hover:bg-base-content/10' },\n // Text Underline — base\n { variant: 'textUnderline', color: 'primary', class: 'text-primary underline underline-offset-2' },\n { variant: 'textUnderline', color: 'secondary', class: 'text-secondary underline underline-offset-2' },\n { variant: 'textUnderline', color: 'danger', class: 'text-error underline underline-offset-2' },\n { variant: 'textUnderline', color: 'warning', class: 'text-warning underline underline-offset-2' },\n { variant: 'textUnderline', color: 'success', class: 'text-success underline underline-offset-2' },\n { variant: 'textUnderline', color: 'accent', class: 'text-accent underline underline-offset-2' },\n { variant: 'textUnderline', color: 'gray', class: 'text-base-content/70 underline underline-offset-2' },\n // Text Underline — hover\n { variant: 'textUnderline', color: 'primary', hover: true, class: 'hover:bg-primary/10' },\n { variant: 'textUnderline', color: 'secondary', hover: true, class: 'hover:bg-secondary/10' },\n { variant: 'textUnderline', color: 'danger', hover: true, class: 'hover:bg-error/10' },\n { variant: 'textUnderline', color: 'warning', hover: true, class: 'hover:bg-warning/10' },\n { variant: 'textUnderline', color: 'success', hover: true, class: 'hover:bg-success/10' },\n { variant: 'textUnderline', color: 'accent', hover: true, class: 'hover:bg-accent/10' },\n { variant: 'textUnderline', color: 'gray', hover: true, class: 'hover:bg-base-content/10' },\n // Ghost — base (transparent, colored text/icon)\n {variant: 'ghost', color: 'primary', class: 'text-primary'},\n {variant: 'ghost', color: 'secondary', class: 'text-secondary'},\n {variant: 'ghost', color: 'danger', class: 'text-error'},\n {variant: 'ghost', color: 'warning', class: 'text-warning'},\n {variant: 'ghost', color: 'success', class: 'text-success'},\n {variant: 'ghost', color: 'accent', class: 'text-accent'},\n {variant: 'ghost', color: 'gray', class: 'text-base-content'},\n // Ghost — hover (reveal a subtle surface in the button's own hue)\n {variant: 'ghost', color: 'primary', hover: true, class: 'hover:bg-primary/10'},\n {variant: 'ghost', color: 'secondary', hover: true, class: 'hover:bg-secondary/10'},\n {variant: 'ghost', color: 'danger', hover: true, class: 'hover:bg-error/10'},\n {variant: 'ghost', color: 'warning', hover: true, class: 'hover:bg-warning/10'},\n {variant: 'ghost', color: 'success', hover: true, class: 'hover:bg-success/10'},\n {variant: 'ghost', color: 'accent', hover: true, class: 'hover:bg-accent/10'},\n {variant: 'ghost', color: 'gray', hover: true, class: 'hover:bg-base-content/10'},\n // Icon-button square sizing — applies to both circle and square shapes, sized off `size`.\n {shape: 'circle', size: 'sm', class: 'h-8 w-8'},\n {shape: 'circle', size: 'md', class: 'h-10 w-10'},\n {shape: 'circle', size: 'lg', class: 'h-12 w-12'},\n {shape: 'square', size: 'sm', class: 'h-8 w-8'},\n {shape: 'square', size: 'md', class: 'h-10 w-10'},\n {shape: 'square', size: 'lg', class: 'h-12 w-12'},\n ],\n\n defaultVariants: {\n size: 'md',\n variant: 'fill',\n color: 'primary',\n borderRadius: 'lg',\n shape: 'default',\n disabled: false,\n loading: false,\n wrap: false,\n hover: true,\n },\n});\n\nexport type MnButtonVariants = VariantProps<typeof mnButtonVariants>;\n","import {Component, HostBinding, Input} from '@angular/core';\nimport {MnButtonTypes} from './mn-buttonTypes';\nimport {mnButtonVariants} from './mn-buttonVariants';\n\n@Component({\n selector: 'button[mnButton], a[mnButton]',\n standalone: true,\n templateUrl: './mn-button.html',\n})\nexport class MnButton {\n @Input() data: Partial<MnButtonTypes> = {};\n\n // A loading button is treated as non-interactive: it blocks clicks and is unfocusable,\n // Bind the computed classes to the host element\n @HostBinding('class')\n get hostClasses(): string {\n return mnButtonVariants({\n size: this.data.size,\n variant: this.data.variant,\n color: this.data.color,\n borderRadius: this.data.borderRadius,\n shape: this.data.shape,\n disabled: this.data.disabled,\n loading: this.data.loading,\n wrap: this.data.wrap,\n hover: this.data.hover,\n });\n }\n\n // Signals assistive tech that the control is busy while a loading action runs.\n @HostBinding('attr.aria-busy')\n get ariaBusy() {\n return this.data.loading ? 'true' : null;\n }\n // For accessibility (works for both <button> and <a>)\n @HostBinding('attr.aria-disabled')\n get ariaDisabled() {\n return this.data.disabled ? 'true' : null;\n }\n\n // Only meaningful for <button>. For <a> it does nothing semantically.\n @HostBinding('attr.disabled')\n get disabledAttr() {\n return this.isBlocked ? '' : null;\n }\n\n // Make disabled/loading anchors unfocusable + prevent activation\n @HostBinding('attr.tabindex')\n get tabIndex() {\n return this.isBlocked ? '-1' : null;\n }\n\n // so an in-flight action cannot be triggered a second time.\n private get isBlocked(): boolean {\n return !!(this.data.disabled || this.data.loading);\n }\n\n}\n","@if (data.loading) {\n <span\n aria-hidden=\"true\"\n class=\"inline-block h-4 w-4 shrink-0 mr-2 animate-spin rounded-full border-2 border-current border-r-transparent\"\n ></span>\n}\n<ng-content></ng-content>\n","/**\n * A marker object used in config values to indicate that the value\n * should be resolved via the MnLanguageService.\n *\n * Example in mn-config.json5:\n * label: { $translate: \"form.email.label\" }\n */\nexport type MnTranslatable = {\n $translate: string;\n params?: Record<string, string | number>;\n}\n\n/**\n * A config value that is either a plain value or a translatable marker.\n */\nexport type MnConfigValue<T = string> = T | MnTranslatable;\n\n/**\n * Translations for a single locale, as a tree of keys.\n *\n * Both shapes resolve through the same dotted lookup: a bundle may nest\n * (`{ form: { email: { label } } }`), flatten (`{ \"form.email.label\": … }`), or mix the two.\n */\nexport type MnTranslationMap = { [key: string]: string | MnTranslationMap };\n\n/**\n * All loaded translations keyed by locale code (e.g. \"en\", \"nl\", \"de\").\n */\nexport type MnTranslations = Record<string, MnTranslationMap>;\n\n/**\n * Configuration for the language provider.\n */\nexport type MnLanguageConfig = {\n /** URL pattern for loading translation files. Use `{locale}` as placeholder. e.g. \"assets/i18n/{locale}.json\" */\n urlPattern: string;\n /** The default/fallback locale. */\n defaultLocale: string;\n /** Locales to preload at bootstrap. */\n preload?: string[];\n /**\n * Optional mapping of domain hostnames to locale codes.\n * When set, the service will use the current domain to determine the initial locale.\n * Example: { \"example.nl\": \"nl\", \"example.de\": \"de\", \"example.com\": \"en\" }\n */\n domainLocaleMap?: Record<string, string>;\n /** Whether to enable debug logging. */\n debug?: boolean;\n}\n\n/**\n * Type guard: checks whether a value is a translatable marker object.\n */\nexport function isTranslatable(value: unknown): value is MnTranslatable {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as Record<string, unknown>)['$translate'] === 'string'\n );\n}\n","import {ApplicationRef, inject, Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {BehaviorSubject, firstValueFrom, Observable} from 'rxjs';\nimport {MnTranslationMap, MnTranslations} from './mn-language.types';\n\n/**\n * Key suffix per CLDR plural category.\n *\n * Only `one` earns a suffix: every locale shipped so far (`en`, `nl`) has exactly the two\n * categories `one` and `other`, and `other` keeps the bare key. A locale with `few`/`many`\n * (Polish, Russian, Arabic) resolves those to the plural until an entry is added here —\n * adding one is the whole change, since the lookup is category-driven already.\n */\nconst PLURAL_SUFFIX: Partial<Record<Intl.LDMLPluralRule, string>> = {\n one: 'One',\n};\n\n/** Params key whose presence turns a translation into a plural-aware lookup. */\nconst COUNT_PARAM = 'count';\n\n@Injectable({ providedIn: 'root' })\nexport class MnLanguageService {\n private readonly http = inject(HttpClient);\n private readonly appRef = inject(ApplicationRef);\n\n private _translations: MnTranslations = {};\n private _locale$ = new BehaviorSubject<string>('en');\n private _urlPattern: string | null = null;\n private _debug = false;\n\n /**\n * `Intl.PluralRules` per locale. Cached because {@link translate} runs on every change\n * detection through the impure `mnTranslate` pipe, and constructing one is not cheap.\n */\n private readonly _pluralRules = new Map<string, Intl.PluralRules | null>();\n\n /** Observable of the current active locale. */\n readonly locale$: Observable<string> = this._locale$.asObservable();\n\n /** Current active locale. */\n get locale(): string {\n return this._locale$.value;\n }\n\n /**\n * Enable or disable debug logging.\n */\n setDebug(enabled: boolean): void {\n this._debug = enabled;\n if (enabled) {\n console.log(`[MnLanguage] Debug mode enabled`);\n }\n }\n\n /**\n * Configure the URL pattern used to fetch translation files.\n * Use `{locale}` as placeholder, e.g. `\"assets/i18n/{locale}.json\"`.\n */\n configure(urlPattern: string): void {\n if (this._debug) {\n console.log(`[MnLanguage] Configured urlPattern: ${urlPattern}`);\n }\n this._urlPattern = urlPattern;\n }\n\n /**\n * Load translations for a locale from the configured URL pattern.\n * If translations are already loaded for this locale, this is a no-op.\n */\n async loadLocale(locale: string): Promise<void> {\n if (this._translations[locale]) return;\n\n if (!this._urlPattern) {\n console.warn(`[MnLanguage] No URL pattern configured. Call configure() or use provideMnLanguage().`);\n return;\n }\n\n const url = this._urlPattern.replace('{locale}', locale);\n if (this._debug) {\n console.log(`[MnLanguage] Loading locale \"${locale}\" from ${url}`);\n }\n\n try {\n const map = await firstValueFrom(\n this.http.get<MnTranslationMap>(url)\n );\n this._translations[locale] = map ?? {};\n if (this._debug) {\n console.log(`[MnLanguage] Loaded locale \"${locale}\"`, this._translations[locale]);\n }\n } catch (err) {\n console.warn(`[MnLanguage] Failed to load translations from ${url}`, err);\n this._translations[locale] = {};\n }\n }\n\n /**\n * Switch the active locale. Loads translations if not yet loaded.\n */\n async setLocale(locale: string): Promise<void> {\n if (this._debug) {\n console.log(`[MnLanguage] Setting locale to \"${locale}\"`);\n }\n await this.loadLocale(locale);\n this._locale$.next(locale);\n this.appRef.tick();\n }\n\n /**\n * Register translations for a locale directly from code (no HTTP needed).\n */\n registerTranslations(locale: string, translations: MnTranslationMap): void {\n this._translations[locale] = {\n ...(this._translations[locale] ?? {}),\n ...translations,\n };\n }\n\n /**\n * Translate a key using the current locale, with optional parameter interpolation.\n * Falls back to the key itself if no translation is found.\n *\n * Interpolation replaces `{{paramName}}` with the provided value.\n *\n * A `count` param additionally selects the wording that agrees with it: the key is\n * resolved against its CLDR plural category first (`key` + `One`/`Two`/`Few`/`Many`/\n * `Zero`), falling back to `key` when that sibling is undefined. Nothing has to opt in —\n * a key with no sibling behaves exactly as before.\n *\n * ```ts\n * // 'shift.asked' → '{{count}} members are notified'\n * // 'shift.askedOne' → '{{count}} member is notified'\n * lang.translate('shift.asked', { count: 3 }); // 3 members are notified\n * lang.translate('shift.asked', { count: 1 }); // 1 member is notified\n * ```\n */\n translate(key: string, params?: Record<string, string | number>): string {\n const map = this._translations[this.locale] ?? {};\n let value = this.getValueFromMap(map, this.resolvePluralKey(map, key, params));\n\n if (value === undefined) {\n if (this._debug) {\n console.warn(`[MnLanguage] Missing translation for key: \"${key}\" in locale: \"${this.locale}\"`);\n }\n return key;\n }\n\n if (params) {\n for (const [paramKey, paramValue] of Object.entries(params)) {\n value = value.replace(new RegExp(`\\\\{\\\\{${paramKey}\\\\}\\\\}`, 'g'), String(paramValue));\n }\n }\n\n return value;\n }\n\n /**\n * Picks the wording that agrees with a `count` param.\n *\n * A key carrying a count resolves against its CLDR plural category first, so\n * `askedMessage` + `askedMessageOne` render \"3 leden krijgen bericht\" and \"1 lid krijgt\n * bericht\" off the same call. Both languages change the verb as well as the noun, which\n * is why each form is a whole sentence under its own key rather than a swapped noun.\n *\n * Falls back to `key` whenever the sibling is undefined, so a key that never needed a\n * plural — or an app that has not written one yet — behaves exactly as it did before.\n * @param map The active locale's translations.\n * @param key The dot-notated translation key.\n * @param params The interpolation values, inspected for `count`.\n * @returns The key to look up: the plural sibling, or `key` itself.\n */\n private resolvePluralKey(\n map: MnTranslationMap,\n key: string,\n params?: Record<string, string | number>,\n ): string {\n const raw = params?.[COUNT_PARAM];\n if (raw === undefined) return key;\n\n // A count off a JSON payload arrives as a string often enough that comparing it\n // strictly would silently pick the plural for a count of one.\n const count = Number(raw);\n if (!Number.isFinite(count)) return key;\n\n const suffix = PLURAL_SUFFIX[this.pluralCategory(count)];\n if (suffix === undefined) return key;\n\n const variant = key + suffix;\n return this.getValueFromMap(map, variant) !== undefined ? variant : key;\n }\n\n /**\n * The CLDR plural category of a count in the active locale.\n * @param count The count being quoted.\n * @returns The category, falling back to English rules for an unusable locale.\n */\n private pluralCategory(count: number): Intl.LDMLPluralRule {\n if (!this._pluralRules.has(this.locale)) {\n try {\n this._pluralRules.set(this.locale, new Intl.PluralRules(this.locale));\n } catch {\n // An unknown or malformed locale tag: fall back rather than break every string.\n this._pluralRules.set(this.locale, null);\n }\n }\n const rules = this._pluralRules.get(this.locale);\n if (!rules) return count === 1 ? 'one' : 'other';\n return rules.select(count);\n }\n\n /**\n * Helper to retrieve a value from a potentially nested translation map using a dot-notated key.\n */\n private getValueFromMap(map: MnTranslationMap, key: string): string | undefined {\n // A flattened bundle holds the dotted key verbatim; a nested one is walked below.\n const direct = map[key];\n if (typeof direct === 'string') return direct;\n\n const parts = key.split('.');\n let current: MnTranslationMap | string | undefined = map;\n\n for (const part of parts) {\n if (current === null || typeof current !== 'object') return undefined;\n current = current[part];\n }\n\n return typeof current === 'string' ? current : undefined;\n }\n\n /**\n * Translate a key **only if it is defined**, returning `undefined` otherwise.\n *\n * {@link translate} deliberately returns the key itself when it is missing, which\n * makes it unusable for a library's own default labels: a consumer that never\n * defined `mnCollection.rowsPerPage` would see that raw string in their UI. This\n * lets a caller try a conventional key and fall back to a readable English default\n * when the app has not translated it, so components ship translatable strings\n * without forcing every consumer to define them.\n *\n * @param key The dot-notated translation key.\n * @param params Optional `{{name}}` interpolation values.\n * @returns The translation, or `undefined` when the key is not defined.\n */\n translateIfPresent(key: string, params?: Record<string, string | number>): string | undefined {\n const map = this._translations[this.locale] ?? {};\n if (this.getValueFromMap(map, key) === undefined) return undefined;\n return this.translate(key, params);\n }\n\n /**\n * Shorthand alias for `translate`.\n */\n t(key: string, params?: Record<string, string | number>): string {\n return this.translate(key, params);\n }\n\n /**\n * Resolve the effective default locale from a domain-to-locale map.\n * Matches `window.location.hostname` against the map keys.\n * Returns the mapped locale, or the provided fallback if no match is found.\n */\n resolveLocaleForDomain(domainLocaleMap: Record<string, string> | undefined, fallback: string): string {\n if (!domainLocaleMap || typeof window === 'undefined') return fallback;\n const hostname = window.location.hostname;\n return domainLocaleMap[hostname] ?? fallback;\n }\n}\n","import { APP_INITIALIZER, Provider } from '@angular/core';\nimport { MnLanguageService } from './mn-language.service';\nimport { MnLanguageConfig } from './mn-language.types';\n\n/**\n * Provides an APP_INITIALIZER that configures the MnLanguageService and\n * preloads the requested locales during application bootstrap.\n *\n * Usage in app.config.ts:\n * ...provideMnLanguage({\n * urlPattern: 'assets/i18n/{locale}.json',\n * defaultLocale: 'en',\n * preload: ['en', 'nl'],\n * })\n */\nexport function provideMnLanguage(config: MnLanguageConfig): Provider[] {\n return [\n {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: (svc: MnLanguageService) => async () => {\n if (config.debug) {\n svc.setDebug(true);\n }\n svc.configure(config.urlPattern);\n\n const effectiveLocale = svc.resolveLocaleForDomain(config.domainLocaleMap, config.defaultLocale);\n const localesToLoad = config.preload ?? [effectiveLocale];\n await Promise.all(localesToLoad.map(l => svc.loadLocale(l)));\n await svc.setLocale(effectiveLocale);\n },\n deps: [MnLanguageService],\n },\n ];\n}\n","import {Pipe, PipeTransform, inject} from '@angular/core';\nimport { MnLanguageService } from './mn-language.service';\n\n/**\n * Pipe that translates a key via MnLanguageService.\n *\n * Usage in templates:\n * {{ 'form.email.label' | mnTranslate }}\n * {{ 'greeting' | mnTranslate:{ name: 'World' } }}\n *\n * Note: This pipe is impure so it re-evaluates when the locale changes.\n */\n@Pipe({\n name: 'mnTranslate',\n standalone: true,\n pure: false,\n})\nexport class MnTranslatePipe implements PipeTransform {\n private readonly lang = inject(MnLanguageService);\n\n\n transform(key: string, params?: Record<string, string | number>): string {\n return this.lang.translate(key, params);\n }\n}\n","import {ChangeDetectionStrategy, Component, DestroyRef, inject, Input, signal, TemplateRef,} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {CommonModule} from '@angular/common';\nimport {MnAlertStore} from '../mn-alert.store';\nimport {MnAlert, MnAlertId} from '../mn-alert.types';\nimport {mnAlertVariants} from '../mn-alertVariants';\nimport {MnButton} from '../../mn-button/mn-button';\nimport {MnLanguageService} from '../../../language';\n\nexport type MnAlertTemplateContext = {\n $implicit: MnAlert;\n alert: MnAlert;\n dismiss: () => void;\n}\n\n/**\n * A view-owned wrapper around a single {@link MnAlert}. The store's list is the source\n * of truth for which alerts *exist*; this outlet mirrors it into `views` so a removed\n * alert can play a leave animation (swipe-fling or fade + height-collapse) before its\n * node is actually dropped, rather than vanishing instantly.\n */\ntype MnAlertView = {\n alert: MnAlert;\n /** True once the alert has left the store — the node is animating out and will be removed. */\n leaving: boolean;\n /** True while the user is actively dragging this card (disables the snap transition). */\n dragging: boolean;\n /** Live drag offset (px) along the active swipe axis while swiping. */\n drag: number;\n /** Final offset (px) along the swipe axis the card flings to when a swipe dismisses it. */\n fling: number;\n};\n\n@Component({\n selector: 'mn-alert-outlet',\n standalone: true,\n imports: [CommonModule, MnButton],\n templateUrl: './mn-alert-outlet.html',\n styleUrl: './mn-alert-outlet.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MnAlertOutletComponent {\n private readonly lang = inject(MnLanguageService);\n private readonly store = inject(MnAlertStore);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Drag distance (px) past which a release dismisses regardless of speed. */\n private static readonly SWIPE_DISMISS_THRESHOLD = 96;\n /** Release speed (px/ms) above which a short drag still dismisses — a \"flick\". */\n private static readonly FLICK_VELOCITY = 0.4;\n /** Minimum drag distance (px) a flick must cover, so an incidental fast tap never dismisses. */\n private static readonly FLICK_MIN_DISTANCE = 24;\n /** Upper bound for the leave wait; kept a touch longer than the CSS exit so removal never\n * preempts the animation. Mirrored by the `--mn-alert-exit` duration in the stylesheet. */\n private static readonly EXIT_MS = 320;\n /** Opacity floor a card fades to at the dismiss threshold, for drag feedback. */\n private static readonly DRAG_OPACITY_FLOOR = 0.35;\n\n /**\n * How the dismiss swipe is oriented:\n * - `'auto'` (default) matches the host platform's convention — Apple platforms\n * (iOS/iPadOS/macOS) flick a top banner *upward*, so we swipe vertically; Android (and\n * every other platform) dismisses toasts *to the right*, so we swipe horizontally.\n *\n * Either axis is one-directional: only an upward (vertical) or rightward (horizontal)\n * drag dismisses; dragging the opposite way springs the card back.\n * - `'vertical'` / `'horizontal'` force the axis regardless of platform. Useful when the\n * host can't be sniffed reliably (e.g. Chrome DevTools *Responsive* mode does not spoof\n * the user agent, so `'auto'` there resolves to the desktop/Android horizontal axis).\n */\n @Input() swipeAxis: 'auto' | 'vertical' | 'horizontal' = 'auto';\n\n /** Whether the running device is an Apple platform. Sniffed once from `navigator` at\n * construction (the UA is read at page load and does not change mid-session). */\n private readonly isApple = this.detectApple();\n\n /** The resolved swipe axis: the explicit {@link swipeAxis} override, or the platform\n * default when left on `'auto'`. */\n private get vertical(): boolean {\n if (this.swipeAxis === 'vertical') return true;\n if (this.swipeAxis === 'horizontal') return false;\n return this.isApple;\n }\n\n /**\n * Accessible name for this control. Resolved through the conventional\n * `mnAlert.close` key so an app can translate it, falling back to English when the\n * key is not defined rather than leaking the raw key into the UI.\n */\n get closeLabel(): string {\n return this.lang.translateIfPresent('mnAlert.close') ?? 'Close';\n }\n\n @Input() template?: TemplateRef<MnAlertTemplateContext>;\n\n /** The view-layer mirror of the store's alerts, retaining alerts mid-leave. A signal so\n * writes from the (external) store subscription and leave timers schedule change\n * detection in a zoneless app. */\n readonly views = signal<MnAlertView[]>([]);\n\n /**\n * `touch-action` for the swipe wrapper: reserve the swipe axis for our gesture while\n * leaving the cross-axis to the browser. Vertical swipe (Apple) claims the Y axis\n * (`pan-x`); horizontal swipe (Android/other) claims the X axis (`pan-y`).\n */\n get touchAction(): string {\n return this.vertical ? 'pan-x' : 'pan-y';\n }\n\n /** In-flight leave-removal timers, keyed by alert id, cleared on destroy so a fired\n * timer never touches a torn-down view. */\n private readonly exitTimers = new Map<MnAlertId, ReturnType<typeof setTimeout>>();\n\n /** The single active swipe, or null. Only one card is dragged at a time. `startCoord`\n * and the samples are taken along the active axis (Y when vertical, else X). */\n private activeDrag: {\n view: MnAlertView;\n startCoord: number;\n lastSample: { c: number; t: number };\n prevSample: { c: number; t: number };\n } | null = null;\n\n constructor() {\n this.store.alerts$\n .pipe(takeUntilDestroyed())\n .subscribe(alerts => this.sync(alerts));\n\n this.destroyRef.onDestroy(() => {\n this.exitTimers.forEach(t => clearTimeout(t));\n this.exitTimers.clear();\n });\n }\n\n trackById = (_: number, v: MnAlertView) => v.alert.id;\n\n getAlertClasses(a: MnAlert) {\n return mnAlertVariants({kind: a.kind, variant: a.variant});\n }\n\n /**\n * The lifetime (ms) to run the countdown bar over, or null when no bar should show: an alert\n * that never auto-dismisses has nothing to count down, and one already leaving would only\n * restart the animation mid-exit.\n */\n countdownDuration(v: MnAlertView): number | null {\n if (v.leaving) return null;\n const duration = v.alert.duration;\n return typeof duration === 'number' && duration > 0 ? duration : null;\n }\n\n contextFor(a: MnAlert) {\n return {\n $implicit: a,\n alert: a,\n dismiss: () => this.dismissAlert(a.id)\n } as const;\n }\n\n /** Dismisses via the store; the store's removal is turned into a leave animation by\n * {@link sync}. Used by the close button and the custom-template `dismiss` context. */\n dismissAlert(id: MnAlertId) {\n this.store.dismiss(id);\n }\n\n // =========================\n // Store → view reconciliation\n // =========================\n\n /** Reconciles the view list against the store: appends new alerts, updates the alert\n * reference for still-present ones, and marks vanished ones as leaving (they stay in the\n * list, animating out, until their removal timer fires). */\n private sync(alerts: MnAlert[]): void {\n const current = this.views();\n const existing = new Set(current.map(v => v.alert.id));\n const storeById = new Map(alerts.map(a => [a.id, a]));\n\n const next: MnAlertView[] = [];\n for (const v of current) {\n const fresh = storeById.get(v.alert.id);\n if (fresh) {\n v.alert = fresh;\n } else if (!v.leaving) {\n this.beginLeave(v);\n }\n next.push(v);\n }\n for (const a of alerts) {\n if (!existing.has(a.id)) {\n next.push({alert: a, leaving: false, dragging: false, drag: 0, fling: 0});\n }\n }\n this.views.set(next);\n }\n\n /** Flags a view as leaving and schedules its removal once the exit animation has run.\n * Idempotent: a card already leaving (e.g. flung by a swipe) is left untouched, so a\n * synchronous store re-emit cannot overwrite the swipe direction with the default fade. */\n private beginLeave(v: MnAlertView, fling?: number): void {\n if (v.leaving) return;\n v.leaving = true;\n v.dragging = false;\n if (fling !== undefined) v.fling = fling;\n\n const delay = this.prefersReducedMotion() ? 0 : MnAlertOutletComponent.EXIT_MS;\n const timer = setTimeout(() => this.removeView(v.alert.id), delay);\n this.exitTimers.set(v.alert.id, timer);\n }\n\n private removeView(id: MnAlertId): void {\n const timer = this.exitTimers.get(id);\n if (timer) {\n clearTimeout(timer);\n this.exitTimers.delete(id);\n }\n this.views.update(list => list.filter(v => v.alert.id !== id));\n }\n\n // =========================\n // Swipe-to-dismiss\n // =========================\n\n onPointerDown(event: PointerEvent, v: MnAlertView): void {\n if (v.leaving) return;\n // Don't hijack a press that begins on an interactive control inside the alert.\n if ((event.target as HTMLElement).closest('button, a, input, textarea, select')) return;\n if (event.button !== undefined && event.button !== 0) return;\n\n const coord = this.axisCoord(event);\n this.activeDrag = {\n view: v,\n startCoord: coord,\n lastSample: {c: coord, t: event.timeStamp},\n prevSample: {c: coord, t: event.timeStamp},\n };\n v.dragging = true;\n (event.currentTarget as HTMLElement).setPointerCapture?.(event.pointerId);\n }\n\n onPointerMove(event: PointerEvent, v: MnAlertView): void {\n const drag = this.activeDrag;\n if (!drag || drag.view !== v) return;\n const delta = this.axisCoord(event) - drag.startCoord;\n // Dismissal is one-directional: vertical (Apple) tracks upward only (clamp ≤ 0),\n // horizontal (Android/other) tracks rightward only (clamp ≥ 0). A drag the other way\n // rests at 0 and springs back.\n v.drag = this.vertical ? Math.min(0, delta) : Math.max(0, delta);\n drag.prevSample = drag.lastSample;\n drag.lastSample = {c: this.axisCoord(event), t: event.timeStamp};\n }\n\n onPointerUp(event: PointerEvent, v: MnAlertView): void {\n const drag = this.activeDrag;\n if (!drag || drag.view !== v) return;\n this.activeDrag = null;\n v.dragging = false;\n\n if (this.shouldDismiss(drag, v)) {\n // Fling the card the rest of the way off its edge, then dismiss through the store.\n // Vertical flings upward (off the top); horizontal flings rightward (off the right).\n const extent = this.viewportExtent() + Math.abs(v.drag);\n const fling = this.vertical ? -extent : extent;\n this.beginLeave(v, fling);\n this.store.dismiss(v.alert.id);\n } else {\n // Snap back to rest; the wrapper's transition eases the offset → 0.\n v.drag = 0;\n }\n // Notify: pointerup is template-bound (schedules CD), but the leave/snap mutations live\n // on the view object — re-set the signal so the new transform is reflected reliably.\n this.views.update(list => [...list]);\n }\n\n private shouldDismiss(\n drag: NonNullable<typeof this.activeDrag>,\n v: MnAlertView\n ): boolean {\n if (Math.abs(v.drag) > MnAlertOutletComponent.SWIPE_DISMISS_THRESHOLD) return true;\n const dt = drag.lastSample.t - drag.prevSample.t;\n const velocity = dt > 0 ? Math.abs(drag.lastSample.c - drag.prevSample.c) / dt : 0;\n return velocity > MnAlertOutletComponent.FLICK_VELOCITY\n && Math.abs(v.drag) > MnAlertOutletComponent.FLICK_MIN_DISTANCE;\n }\n\n // =========================\n // Template style helpers\n // =========================\n\n /** Offset transform for a card: the fling target while leaving via swipe, otherwise the\n * live drag offset, translated along the active axis. Returns null when neither applies,\n * letting the stylesheet own the default (fade-in-place) leave. */\n itemTransform(v: MnAlertView): string | null {\n if (v.leaving) {\n return v.fling !== 0 ? this.translate(v.fling) : null;\n }\n return v.drag !== 0 ? this.translate(v.drag) : null;\n }\n\n /** Fades a card toward a floor as it is dragged toward the dismiss threshold. Null (CSS\n * owns opacity) when at rest or leaving. */\n itemOpacity(v: MnAlertView): number | null {\n if (v.leaving || !v.dragging || v.drag === 0) return null;\n const progress = Math.min(Math.abs(v.drag) / MnAlertOutletComponent.SWIPE_DISMISS_THRESHOLD, 1);\n return 1 - progress * (1 - MnAlertOutletComponent.DRAG_OPACITY_FLOOR);\n }\n\n private translate(px: number): string {\n return this.vertical ? `translateY(${px}px)` : `translateX(${px}px)`;\n }\n\n private axisCoord(event: PointerEvent): number {\n return this.vertical ? event.clientY : event.clientX;\n }\n\n private viewportExtent(): number {\n if (typeof window === 'undefined') return 400;\n return this.vertical ? window.innerHeight : window.innerWidth;\n }\n\n /** Whether the current device runs an Apple OS (iOS/iPadOS/macOS). iPadOS 13+ masquerades\n * as a Mac, so it is caught by the touch-capable-Mac branch. */\n private detectApple(): boolean {\n if (typeof navigator === 'undefined') return false;\n const ua = navigator.userAgent ?? '';\n const platform = navigator.platform ?? '';\n const isIOS = /iP(hone|ad|od)/.test(platform) || /iPad|iPhone|iPod/.test(ua);\n const isTouchMac = /Mac/.test(platform + ' ' + ua)\n && typeof document !== 'undefined' && 'ontouchend' in document;\n const isMac = /Mac/.test(ua);\n return isIOS || isTouchMac || isMac;\n }\n\n private prefersReducedMotion(): boolean {\n return typeof window !== 'undefined'\n && typeof window.matchMedia === 'function'\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n}\n","<!-- The stack is a polite live region so every toast is announced; an error toast upgrades itself to an alert. -->\n<div aria-live=\"polite\" role=\"status\" class=\"fixed top-4 left-0 right-0 z-[9999] flex flex-col w-full px-2 sm:px-0 sm:left-auto sm:right-4 sm:max-w-sm\">\n @for (v of views(); track trackById($index, v)) {\n <div\n class=\"mn-alert-item\"\n [attr.role]=\"v.alert.kind === 'error' ? 'alert' : null\"\n [class.dragging]=\"v.dragging\"\n [class.leaving]=\"v.leaving\"\n [style.touch-action]=\"touchAction\"\n [style.transform]=\"itemTransform(v)\"\n [style.opacity]=\"itemOpacity(v)\"\n (pointerdown)=\"onPointerDown($event, v)\"\n (pointermove)=\"onPointerMove($event, v)\"\n (pointerup)=\"onPointerUp($event, v)\"\n (pointercancel)=\"onPointerUp($event, v)\"\n >\n <div class=\"mn-alert-inner\">\n @if (template) {\n <ng-container\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"contextFor(v.alert)\">\n </ng-container>\n } @else {\n <div [class.extra]=\"v.alert.cssClass\" [class]=\"getAlertClasses(v.alert)\" class=\"relative overflow-hidden\">\n <div class=\"flex-1 min-w-0 pr-8\">\n <h4 class=\"font-semibold text-sm\">{{ v.alert.title }}</h4>\n @if (v.alert.subTitle) {\n <p class=\"text-sm mt-1 opacity-90 leading-tight\">{{ v.alert.subTitle }}</p>\n }\n </div>\n <button\n [attr.aria-label]=\"closeLabel\"\n mnButton\n [data]=\"{ size: 'md', variant: 'text' }\"\n (click)=\"dismissAlert(v.alert.id)\"\n class=\"absolute top-2 right-2 shrink-0 !text-current hover:!bg-current/10\"\n type=\"button\"\n >\n ×\n </button>\n @if (countdownDuration(v); as ms) {\n <span aria-hidden=\"true\" class=\"mn-alert-progress\">\n <span [style.animation-duration.ms]=\"ms\" class=\"mn-alert-progress-bar\"></span>\n </span>\n }\n </div>\n }\n </div>\n </div>\n }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnBadgeVariants = tv({\n base: 'inline-flex items-center rounded-md border font-semibold',\n variants: {\n size: {\n sm: 'px-1.5 py-0.5 text-xs',\n md: 'px-2 py-0.5 text-sm',\n lg: 'px-2.5 py-1 text-base',\n xl: 'px-3 py-1.5 text-lg',\n },\n\n variant: {\n default: '',\n fill: '',\n },\n\n wrap: {\n true: 'whitespace-normal',\n false: 'whitespace-nowrap',\n },\n\n color: {\n primary: '',\n secondary: '',\n danger: '',\n warning: '',\n success: '',\n accent: '',\n lightgray: '',\n },\n },\n\n compoundVariants: [\n // Default (tinted). A 10% wash with a 40% border, and the text in `--color-<colour>-text`\n // when the consuming app defines one (the darker/lighter shade it uses for readable coloured\n // text), falling back to the base colour otherwise. The former 20% wash with the base colour\n // as text sat at 2–4:1 on both light and dark grounds, under the WCAG AA 4.5:1 minimum.\n { variant: 'default', color: 'primary', class: 'bg-primary/10 border-primary/40 text-(--color-primary-text,var(--color-primary))' },\n { variant: 'default', color: 'secondary', class: 'bg-secondary/10 border-secondary/40 text-(--color-secondary-text,var(--color-secondary))' },\n { variant: 'default', color: 'danger', class: 'bg-error/10 border-error/40 text-(--color-error-text,var(--color-error))' },\n { variant: 'default', color: 'warning', class: 'bg-warning/10 border-warning/40 text-(--color-warning-text,var(--color-warning))' },\n { variant: 'default', color: 'success', class: 'bg-success/10 border-success/40 text-(--color-success-text,var(--color-success))' },\n { variant: 'default', color: 'accent', class: 'bg-accent/10 border-accent/40 text-(--color-accent-text,var(--color-accent))' },\n { variant: 'default', color: 'lightgray', class: 'bg-base-content/10 border-base-content/70 text-base-content/70' },\n // Fill (solid)\n { variant: 'fill', color: 'primary', class: 'bg-primary border-primary text-primary-content' },\n { variant: 'fill', color: 'secondary', class: 'bg-secondary border-secondary text-secondary-content' },\n { variant: 'fill', color: 'danger', class: 'bg-error border-error text-error-content' },\n { variant: 'fill', color: 'warning', class: 'bg-warning border-warning text-warning-content' },\n { variant: 'fill', color: 'success', class: 'bg-success border-success text-success-content' },\n { variant: 'fill', color: 'accent', class: 'bg-accent border-accent text-accent-content' },\n { variant: 'fill', color: 'lightgray', class: 'bg-base-content/70 border-base-content/70 text-base-100' },\n ],\n\n defaultVariants: {\n size: 'md',\n variant: 'default',\n color: 'primary',\n wrap: false,\n },\n});\n\nexport type MnBadgeVariants = VariantProps<typeof mnBadgeVariants>;\n","import { Component, HostBinding, Input } from '@angular/core';\nimport { MnBadgeTypes } from './mn-badgeTypes';\nimport { mnBadgeVariants } from './mn-badgeVariants';\n\n@Component({\n selector: 'span[mnBadge]',\n standalone: true,\n templateUrl: './mn-badge.html',\n})\nexport class MnBadge {\n @Input() data: Partial<MnBadgeTypes> = {};\n\n @HostBinding('class')\n get hostClasses(): string {\n return mnBadgeVariants({\n size: this.data.size,\n variant: this.data.variant,\n color: this.data.color,\n wrap: this.data.wrap,\n });\n }\n}\n","<ng-content></ng-content>\n","/**\n * MnInputField Adapters\n *\n * This module implements the Adapter Pattern to handle type-specific behavior\n * for different HTML input types in the MnInputField component.\n *\n * The adapter pattern allows the component to support multiple input types\n * (text, number, date, time, etc.) without coupling the component logic to\n * type-specific implementations. Each adapter handles:\n * - Parsing: converting raw string input to the appropriate data type\n * - Formatting: converting typed values back to string for display\n * - Attributes: providing type-specific DOM attributes (min, max, step, inputmode)\n * - Validation: implementing type-specific validation rules\n *\n * This approach keeps the component code clean and makes it easy to add\n * support for new input types by creating new adapters.\n */\n\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\nimport { MnInputDateTimeProps, MnInputProps, MnInputType } from './mn-input-fieldTypes';\n\n/**\n * DOM attributes that can be dynamically set on input elements.\n * These attributes are type-specific and provided by adapters.\n */\nexport type MnDomAttrs = {\n /** Minimum value for date/time/number inputs */\n min?: string | null;\n /** Maximum value for date/time/number inputs */\n max?: string | null;\n /** Step increment for number/date/time inputs */\n step?: string | null;\n /** Mobile keyboard hint (e.g., 'decimal' for number inputs) */\n inputmode?: string | null;\n};\n\n/**\n * Adapter interface for handling input type-specific behavior.\n *\n * Each adapter implementation defines how to handle a specific input type\n * (or group of related types) throughout the component lifecycle.\n *\n * @template TOut - The output type after parsing (e.g., string | null, number | null)\n */\nexport type MnInputAdapter<TOut = string | null> = {\n /**\n * Parses the raw string value from the input element into the typed value\n * that will be sent to the FormControl.\n *\n * @param raw - Raw string value from the input element\n * @returns Typed value to store in the FormControl\n *\n * @example\n * // Text adapter\n * parse('hello') // => 'hello'\n * parse('') // => null\n *\n * // Number adapter\n * parse('42') // => 42\n * parse('') // => null\n * parse('abc') // => null\n */\n parse(raw: string): TOut;\n\n /**\n * Formats the typed value from the FormControl into a string\n * that will be displayed in the input element.\n *\n * @param val - Typed value from the FormControl\n * @returns String representation for the input element's value attribute\n *\n * @example\n * // Text adapter\n * format('hello') // => 'hello'\n * format(null) // => ''\n *\n * // Number adapter\n * format(42) // => '42'\n * format(null) // => ''\n */\n format(val: unknown): string;\n\n /**\n * Returns type-specific DOM attributes for the input element.\n * These attributes are applied dynamically based on the input type and props.\n *\n * @param props - Input field properties\n * @returns Object containing DOM attributes (min, max, step, inputmode)\n *\n * @example\n * // Date adapter with date range\n * attrs({ startDate: '2024-01-01', endDate: '2024-12-31' })\n * // => { min: '2024-01-01', max: '2024-12-31' }\n *\n * // Number adapter\n * attrs({}) // => { inputmode: 'decimal' }\n */\n attrs(props: MnInputProps): MnDomAttrs;\n\n /**\n * Performs type-specific validation on the current input value.\n * This validation runs in addition to Angular's built-in validators.\n *\n * @param props - Input field properties (may contain validation constraints)\n * @param control - The AbstractControl being validated\n * @param currentRaw - Current raw string value from the input element\n * @returns ValidationErrors object if invalid, null if valid\n *\n * @example\n * // Date adapter validation\n * validate(props, control, '2024-06-15')\n * // Returns { mnMin: { min: '2024-07-01', actual: '2024-06-15' } }\n * // if startDate is '2024-07-01'\n */\n validate(props: MnInputProps, control: AbstractControl, currentRaw: string | null): ValidationErrors | null;\n\n /**\n * Applies a mask to the raw input value.\n */\n applyMask?(value: string, mask: string): string;\n}\n\n/**\n * Utility function to convert empty strings to null.\n * This is a common pattern for optional form fields where empty input\n * should be treated as \"no value\" rather than an empty string.\n *\n * @param raw - Raw input string\n * @returns The input string if non-empty, null if empty\n *\n * @example\n * emptyToNull('hello') // => 'hello'\n * emptyToNull('') // => null\n */\nconst emptyToNull = (raw: string): string | null => (raw === '' ? null : raw);\n\n/**\n * Default adapter for text-based input types.\n * Used for: text, email, password, search, tel, url\n *\n * Behavior:\n * - Empty strings are converted to null\n * - Values are stored as strings in the FormControl\n * - No special DOM attributes\n * - No additional validation (relies on Angular's built-in validators)\n * - Supports simple masking (0 for digit, A for alpha, * for any)\n */\nexport const defaultTextAdapter: MnInputAdapter<string | null> = {\n parse: (raw) => emptyToNull(raw),\n format: (val) => (val == null ? '' : String(val)),\n attrs: () => ({}),\n validate: () => null,\n applyMask: (value: string, mask: string): string => {\n if (!mask || !value) return value;\n\n let result = '';\n let maskIndex = 0;\n let dataIndex = 0;\n\n // Remove non-alphanumeric if we want to re-mask from clean data\n // But usually we just want to restrict input.\n // A simple implementation:\n while (maskIndex < mask.length && dataIndex < value.length) {\n const maskChar = mask[maskIndex];\n const dataChar = value[dataIndex];\n\n if (maskChar === '0') {\n if (/\\d/.test(dataChar)) {\n result += dataChar;\n dataIndex++;\n maskIndex++;\n } else {\n dataIndex++; // skip invalid\n }\n } else if (maskChar === 'A') {\n if (/[a-zA-Z]/.test(dataChar)) {\n result += dataChar;\n dataIndex++;\n maskIndex++;\n } else {\n dataIndex++; // skip invalid\n }\n } else if (maskChar === '*') {\n result += dataChar;\n dataIndex++;\n maskIndex++;\n } else {\n result += maskChar;\n if (dataChar === maskChar) {\n dataIndex++;\n }\n maskIndex++;\n }\n }\n\n // Auto-append static characters if next in mask\n while (maskIndex < mask.length && !/[0A*]/.test(mask[maskIndex])) {\n result += mask[maskIndex];\n maskIndex++;\n }\n\n return result;\n }\n};\n\n/**\n * Adapter for date and time input types.\n * Used for: date, time, datetime-local\n *\n * Behavior:\n * - Empty strings are converted to null\n * - Values are stored as ISO 8601 strings in the FormControl\n * - Provides min/max attributes from startDate/endDate props\n * - Validates date/time ranges using string comparison\n *\n * Note: String comparison works for ISO 8601 dates/times because they are\n * lexicographically ordered (e.g., '2024-01-15' < '2024-12-31').\n */\nexport const dateTimeAdapter: MnInputAdapter<string | null> = {\n parse: (raw) => emptyToNull(raw),\n format: (val) => (val == null ? '' : String(val)),\n attrs: (props) => ({\n min: (props as MnInputDateTimeProps).startDate ?? null,\n max: (props as MnInputDateTimeProps).endDate ?? null,\n }),\n validate: (props, _control, currentRaw) => {\n const value = currentRaw;\n if (!value) return null; // Don't validate empty values (use 'required' validator for that)\n\n const min = (props as MnInputDateTimeProps).startDate as string | undefined;\n const max = (props as MnInputDateTimeProps).endDate as string | undefined;\n\n // Validate minimum date/time constraint\n if (min && value < min) {\n return { mnMin: { min, actual: value } };\n }\n\n // Validate maximum date/time constraint\n if (max && value > max) {\n return { mnMax: { max, actual: value } };\n }\n\n return null;\n },\n};\n\n/**\n * Adapter for number input type.\n *\n * Behavior:\n * - Empty strings are converted to null\n * - Valid numbers are parsed to number type\n * - Invalid numbers (NaN, Infinity) are converted to null\n * - Values are stored as numbers (or null) in the FormControl\n * - Sets inputmode='decimal' for optimized mobile keyboards\n * - No additional validation (relies on Angular's built-in validators)\n *\n * Note: The browser's native number input validation handles\n * basic number format validation automatically.\n */\nexport const numberAdapter: MnInputAdapter<number | null> = {\n parse: (raw) => {\n if (raw === '') return null;\n const num = Number(raw);\n return Number.isFinite(num) ? num : null;\n },\n format: (val) => (val == null ? '' : String(val)),\n attrs: () => ({\n inputmode: 'decimal',\n }),\n validate: () => null,\n};\n\n/**\n * Selects the appropriate adapter based on the input type.\n * This is the main factory function used by the MnInputField component\n * to determine which adapter to use for a given input type.\n *\n * @param type - The input type (e.g., 'text', 'email', 'date', 'number')\n * @returns The appropriate adapter instance\n *\n * @example\n * pickAdapter('text') // => defaultTextAdapter\n * pickAdapter('email') // => defaultTextAdapter\n * pickAdapter('date') // => dateTimeAdapter\n * pickAdapter('number') // => numberAdapter\n */\nexport function pickAdapter(type: MnInputType): MnInputAdapter<string | null | number> {\n // Date/time inputs use the dateTimeAdapter for range validation\n if (type === 'date' || type === 'time' || type === 'datetime-local') {\n return dateTimeAdapter;\n }\n\n // Number inputs use the numberAdapter for type conversion\n if (type === 'number') {\n return numberAdapter;\n }\n\n // All other input types use the default text adapter\n return defaultTextAdapter;\n}\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnInputFieldVariants = tv({\n base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm outline-none focus:ring-1 focus:ring-primary',\n variants: {\n\n shadow: {\n true: 'shadow-lg',\n },\n size: {\n sm: 'p-2',\n md: 'p-3',\n lg: 'p-4',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n },\n fullWidth: {\n true: 'w-full',\n },\n hover: {\n true: 'hover:cursor-pointer hover:bg-base-200 transition-colors duration-300 ease-in-out',\n },\n disabled: {\n true: 'opacity-50 cursor-not-allowed',\n },\n },\n defaultVariants: {\n size: 'md',\n borderRadius: 'md',\n hover: true,\n }\n});\n\nexport type MnInputVariants = VariantProps<typeof mnInputFieldVariants>;\n","import {Component, Input} from '@angular/core';\n\n@Component({\n selector: 'mn-error-message',\n imports: [],\n templateUrl: './mn-error-message.html',\n})\nexport class MnErrorMessage {\n @Input({ required: true }) errorMessage! :string;\n @Input({ required: true }) id!: string;\n}\n","<div [id]=\"id + '-error'\" role=\"alert\" class=\"text-error mt-2 text-sm\">\n {{ errorMessage }}\n</div>\n","/**\n * Types for mn-lib configuration.\n */\n\nexport type MnConfigSettings = {\n /** Application or library version. */\n version?: string;\n /** Application or library name. */\n name?: string;\n}\n\nexport type MnConfigFile = {\n /**\n * General settings such as version and name.\n */\n settings?: MnConfigSettings;\n /**\n * Base defaults by component name. Each value is a plain object with inputs/options for that component.\n */\n defaults: Record<string, unknown>;\n /**\n * Nested object tree keyed by section names. Leaf nodes may contain\n * component-name keys (component override objects) and keys starting with '#'\n * representing instance-id overrides.\n */\n overrides: Record<string, unknown>;\n}\n","import {inject, Injectable, signal} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {firstValueFrom} from 'rxjs';\nimport {MnConfigFile, MnConfigSettings} from './mn-config.types';\nimport {isTranslatable, MnLanguageConfig, MnLanguageService} from '../language';\nimport JSON5 from 'json5';\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === 'object' &&\n value !== null &&\n Object.prototype.toString.call(value) === '[object Object]'\n );\n}\n\n@Injectable({ providedIn: 'root' })\nexport class MnConfigService {\n private readonly http = inject(HttpClient);\n\n private _config: MnConfigFile | null = null;\n private _settings: MnConfigSettings = {};\n private _debugMode = false;\n\n /** Reactive version counter — incremented on every config load. */\n private _configVersion = signal(0);\n readonly configVersion = this._configVersion.asReadonly();\n\n private readonly lang = inject(MnLanguageService);\n\n /** General settings from the config file (version, name, etc.). */\n get settings(): Readonly<MnConfigSettings> {\n return this._settings;\n }\n\n /**\n * Load the configuration JSON from the provided URL and cache it in memory.\n * Consumers should typically call this via the APP_INITIALIZER helper.\n */\n async load(url: string, debugMode = false): Promise<void> {\n this._debugMode = debugMode;\n this.lang.setDebug(debugMode);\n let text: string;\n\n try {\n text = await firstValueFrom(\n this.http.get(url, { responseType: 'text' })\n );\n } catch (err) {\n console.warn(`[MnConfig] Failed to load config from ${url}`, err);\n this._config = { defaults: {}, overrides: {} };\n return;\n }\n\n let json: unknown;\n\n try {\n json = JSON5.parse(text);\n } catch (err) {\n console.warn(`[MnConfig] Failed to parse JSON5 from ${url}`, err, text);\n json = {};\n }\n\n const cfg = (isPlainObject(json) ? json : {}) as Record<string, unknown>;\n const defaults = isPlainObject(cfg['defaults']) ? cfg['defaults'] : {};\n const overrides: Record<string, unknown> = isPlainObject(cfg['overrides']) ? cfg['overrides'] : {};\n\n const settings: MnConfigSettings = isPlainObject(cfg['settings']) ? cfg['settings'] as MnConfigSettings : {};\n\n this._config = { settings, defaults, overrides };\n this._settings = settings;\n\n // Bootstrap language service from config if a \"language\" section is present.\n // This avoids circular dependency: config reads raw language settings and\n // pushes them into the language service (language service never imports config).\n const langCfg = cfg['language'];\n if (isPlainObject(langCfg) && typeof langCfg['urlPattern'] === 'string') {\n const lc = langCfg as MnLanguageConfig;\n if (this._debugMode) {\n console.log(`[MnConfig] Applying language config from file`, lc);\n }\n this.lang.configure(lc.urlPattern);\n const effectiveLocale = this.lang.resolveLocaleForDomain(lc.domainLocaleMap, lc.defaultLocale);\n const localesToLoad = Array.from(new Set([...(lc.preload ?? []), effectiveLocale]));\n await Promise.all(localesToLoad.map(l => this.lang.loadLocale(l)));\n await this.lang.setLocale(effectiveLocale);\n }\n\n this._configVersion.update(v => v + 1);\n }\n\n /**\n * Load configuration from a pre-parsed object (no HTTP fetch).\n * Used for live preview scenarios where config is pushed via postMessage.\n * Optionally re-bootstraps the language service if a `language` section is present.\n */\n async loadFromObject(config: Record<string, unknown>, bootstrapLanguage = false): Promise<void> {\n const defaults = isPlainObject(config['defaults']) ? config['defaults'] : {};\n const overrides = isPlainObject(config['overrides']) ? config['overrides'] : {};\n const settings: MnConfigSettings = isPlainObject(config['settings']) ? config['settings'] as MnConfigSettings : {};\n\n this._config = { settings, defaults, overrides };\n this._settings = settings;\n\n if (bootstrapLanguage) {\n const langCfg = config['language'];\n if (isPlainObject(langCfg) && typeof langCfg['urlPattern'] === 'string') {\n const lc = langCfg as MnLanguageConfig;\n if (this._debugMode) {\n console.log(`[MnConfig] Applying language config from object`, lc);\n }\n this.lang.configure(lc.urlPattern);\n const effectiveLocale = this.lang.resolveLocaleForDomain(lc.domainLocaleMap, lc.defaultLocale);\n const localesToLoad = Array.from(new Set([...(lc.preload ?? []), effectiveLocale]));\n await Promise.all(localesToLoad.map(l => this.lang.loadLocale(l)));\n await this.lang.setLocale(effectiveLocale);\n }\n }\n\n this._configVersion.update(v => v + 1);\n }\n\n\n /**\n * Resolve a configuration object for a component, optionally scoped to a section path\n * and optionally overridden by an instance id.\n */\n resolve<T extends object = Record<string, unknown>>(\n componentName: string,\n sectionPath: string[] = [],\n instanceId?: string,\n ): T {\n const baseConfig: Record<string, unknown> = isPlainObject(this._config?.defaults)\n ? (isPlainObject((this._config as MnConfigFile).defaults[componentName])\n ? { ...(this._config as MnConfigFile).defaults[componentName] as Record<string, unknown> }\n : {})\n : {};\n\n const leaf = this.walkOverrides(this._config?.overrides ?? {}, sectionPath);\n\n let resolved: Record<string, unknown> = baseConfig;\n\n if (leaf && isPlainObject((leaf as Record<string, unknown>)[componentName])) {\n resolved = this.deepMerge(resolved, (leaf as Record<string, unknown>)[componentName] as Record<string, unknown>);\n }\n\n if (instanceId) {\n const instKey = `#${instanceId}`;\n if (leaf && isPlainObject((leaf as Record<string, unknown>)[instKey])) {\n resolved = this.deepMerge(resolved, (leaf as Record<string, unknown>)[instKey] as Record<string, unknown>);\n }\n }\n\n if (this._debugMode) {\n console.debug(`[MnConfig] Resolving for ${componentName}`, {\n sectionPath,\n instanceId,\n resolved,\n });\n }\n\n return this.resolveTranslatables(resolved) as T;\n }\n\n /**\n * Walk the overrides nested object using the provided section path and return the leaf node.\n * If any segment is missing or the current node is not a plain object, returns undefined.\n */\n walkOverrides(overridesRoot: unknown, sectionPath: string[]): unknown | undefined {\n let node: unknown = overridesRoot;\n for (const segment of sectionPath) {\n if (!isPlainObject(node)) return undefined;\n node = (node as Record<string, unknown>)[segment];\n if (node === undefined) return undefined;\n }\n return node;\n }\n\n /**\n * Recursively walk a resolved config object and replace any `{ $translate: \"key\" }` markers\n * with their translated values from MnLanguageService.\n */\n private resolveTranslatables(obj: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (isTranslatable(value)) {\n out[key] = this.lang.translate(value.$translate, value.params);\n } else if (Array.isArray(value)) {\n out[key] = value.map(item => {\n if (isTranslatable(item)) {\n return this.lang.translate(item.$translate, item.params);\n } else if (isPlainObject(item)) {\n return this.resolveTranslatables(item as Record<string, unknown>);\n }\n return item;\n });\n } else if (isPlainObject(value)) {\n out[key] = this.resolveTranslatables(value as Record<string, unknown>);\n } else {\n out[key] = value;\n }\n }\n return out;\n }\n\n /**\n * Deep merge two plain-object trees. Arrays and non-plain values are replaced by the patch.\n * Does not mutate inputs; returns a new object.\n */\n deepMerge<A extends Record<string, unknown>, B extends Record<string, unknown>>(base: A, patch: B): A & B {\n const out: Record<string, unknown> = {...base};\n for (const key of Object.keys(patch)) {\n const bVal = base[key];\n const pVal = patch[key];\n\n if (isPlainObject(bVal) && isPlainObject(pVal)) {\n out[key] = this.deepMerge(bVal, pVal);\n } else {\n // replace for arrays, primitives, null, undefined, and non-plain objects\n out[key] = pVal;\n }\n }\n return out as A & B;\n }\n}\n","import { APP_INITIALIZER, Provider } from '@angular/core';\nimport { MnConfigService } from './mn-config.service';\n\n/**\n * Provides an APP_INITIALIZER that loads the mn-lib configuration from the given URL\n * during application bootstrap. The consuming application is responsible for providing\n * HttpClient (e.g., via HttpClientModule or provideHttpClient()).\n */\nexport function provideMnConfig(url: string, debugMode = false): Provider[] {\n return [\n {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: (svc: MnConfigService) => () => svc.load(url, debugMode),\n deps: [MnConfigService],\n },\n ];\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Represents the current section path based on nested mn-section directives.\n */\nexport const MN_SECTION_PATH = new InjectionToken<string[]>(\n 'MN_SECTION_PATH',\n {\n providedIn: 'root',\n factory: () => [],\n },\n);\n\n/**\n * Represents the current component instance id provided by [mn-instance].\n */\nexport const MN_INSTANCE_ID = new InjectionToken<string | null>(\n 'MN_INSTANCE_ID',\n {\n providedIn: 'root',\n factory: () => null,\n },\n);\n","import { DestroyRef, InjectionToken, Optional, Provider } from '@angular/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from '../context/mn-context.tokens';\nimport { MnConfigService } from './mn-config.service';\nimport { MnLanguageService } from '../language/mn-language.service';\n\n/**\n * Helper to provide a resolved, typed component config via DI.\n *\n * Usage in a component/module providers:\n * const MY_CFG = new InjectionToken<MyCfg>('MY_CFG');\n * providers: [ provideMnComponentConfig(MY_CFG, 'my-component') ]\n * Then in the component:\n * readonly cfg = inject(MY_CFG)\n *\n * The returned config object is **reactive**: when the active locale changes,\n * all translatable values are re-resolved in place so that templates using\n * `cfg.someLabel` automatically reflect the new language on the next change-detection cycle.\n */\nexport function provideMnComponentConfig<T extends object>(\n token: InjectionToken<T>,\n componentName: string,\n initial?: Partial<T>,\n): Provider {\n return {\n provide: token,\n deps: [\n MnConfigService,\n MnLanguageService,\n DestroyRef,\n [new Optional(), MN_SECTION_PATH],\n [new Optional(), MN_INSTANCE_ID],\n ],\n useFactory: (\n svc: MnConfigService,\n lang: MnLanguageService,\n destroyRef: DestroyRef,\n sectionPath: string[] | null,\n instanceId: string | null,\n ): T => {\n const resolveConfig = (): T => {\n const resolved = svc.resolve<T>(componentName, sectionPath ?? [], instanceId ?? undefined);\n return Object.assign({}, initial ?? {}, resolved);\n };\n\n // Create the initial config object that will be shared by reference.\n const cfg = resolveConfig();\n\n // Re-resolve translatable values whenever the locale changes.\n // skip(1) because the current locale was already used for the initial resolve.\n const sub = lang.locale$.subscribe(() => {\n const updated = resolveConfig();\n // Mutate the existing object in place so all template bindings pick up the new values.\n for (const key of Object.keys(updated)) {\n (cfg as Record<string, unknown>)[key] = (updated as Record<string, unknown>)[key];\n }\n });\n\n destroyRef.onDestroy(() => sub.unsubscribe());\n\n return cfg;\n },\n };\n}\n","import { Attribute, Directive, Input, Optional, SkipSelf } from '@angular/core';\nimport { MN_SECTION_PATH } from './mn-context.tokens';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector -- kebab-case is intentional: matches the Attribute() token and is stable public API\n selector: '[mn-section]',\n standalone: true,\n providers: [\n {\n provide: MN_SECTION_PATH,\n // Read parent MN_SECTION_PATH from ancestor injector (skipSelf to avoid self-reference),\n // and read the attribute value using Attribute so it's available at provider creation time.\n deps: [[new Optional(), new SkipSelf(), MN_SECTION_PATH], new Attribute('mn-section')],\n useFactory: (parentPath: string[] | null, attr: string | null) => {\n const parent = Array.isArray(parentPath) ? parentPath : [];\n const name = (attr ?? '').trim();\n return name ? [...parent, name] : [...parent];\n },\n },\n ],\n})\nexport class MnSectionDirective {\n /** Section name contributed by this DOM node to the section path */\n @Input('mn-section') mnSection: string | undefined;\n}\n","import { Attribute, Directive, Input } from '@angular/core';\nimport { MN_INSTANCE_ID } from './mn-context.tokens';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector -- kebab-case is intentional: matches the Attribute() token and is stable public API\n selector: '[mn-instance]',\n standalone: true,\n providers: [\n {\n provide: MN_INSTANCE_ID,\n // Read the attribute at provider creation time using Attribute token; Inputs may not be set yet.\n deps: [new Attribute('mn-instance')],\n useFactory: (attr: string | null) => (attr ?? '').trim() || null,\n },\n ],\n})\nexport class MnInstanceDirective {\n /** Instance id for targeting per-component instance overrides */\n @Input('mn-instance') mnInstance: string | undefined;\n}\n","import {Component, DestroyRef, ElementRef, inject, InjectionToken, Input, OnInit} from '@angular/core';\nimport {CommonModule, NgClass} from '@angular/common';\nimport {MnErrorMessageData, MnInputFieldUIConfig, MnInputProps} from './mn-input-fieldTypes';\nimport {AbstractControl, FormsModule, NgControl, ValidationErrors, Validators} from '@angular/forms';\nimport {pickAdapter} from './mn-input-field-adapters';\nimport {mnInputFieldVariants} from './mn-input-fieldVariants';\nimport {MnErrorMessage} from '../mn-error-message/mn-error-message';\nimport {MnConfigService} from \"../../config\";\nimport {MN_INSTANCE_ID, MN_SECTION_PATH} from \"../../context\";\nimport {MnLanguageService} from \"../../language\";\nimport {skip} from \"rxjs\";\n\nexport const MN_INPUT_FIELD_CONFIG = new InjectionToken<MnInputFieldUIConfig>('MN_INPUT_FIELD_CONFIG');\n\n/**\n * MnInputField Component\n *\n * A flexible, accessible input field component that implements Angular's ControlValueAccessor\n * and Validator interfaces. Supports multiple input types, custom validation messages,\n * and configurable error display (single or multiple errors).\n *\n * Features:\n * - Works with Angular Reactive Forms (FormControl, FormGroup)\n * - Supports standard and date/time input types\n * - Built-in error messages with internationalization support\n * - Custom error messages per field\n * - Priority-based error display or show all errors\n * - Full accessibility (ARIA attributes)\n * - Type-safe adapter pattern for different input types\n *\n * @example\n * ```typescript\n * <mn-input-field\n * formControlName=\"email\"\n * [props]=\"{\n * id: 'email',\n * type: 'email',\n * label: 'Email Address',\n * size: 'md',\n * borderRadius: 'md',\n * errorMessages: { required: 'Email is required' }\n * }\"\n * ></mn-input-field>\n * ```\n */\n@Component({\n selector: 'mn-lib-input-field',\n standalone: true,\n imports: [CommonModule, NgClass, MnErrorMessage, FormsModule],\n templateUrl: './mn-input-field.html',\n // The native `type=\"search\"` clear affordance (the ✕) is a shadow pseudo-element, so it\n // can't take a Tailwind class — give it a pointer cursor here. Only search inputs render\n // this pseudo, so it needs no type qualifier.\n styles: [`\n input::-webkit-search-cancel-button { cursor: pointer; }\n `],\n host: {\n // Native inputs (notably `type=\"date\"`) have a platform-specific intrinsic width.\n // Without an explicit host width the inline host collapses to that intrinsic size,\n // so the input's `w-full` (width:100%) resolves against a content-sized box and\n // fails to fill the parent on real mobile devices (desktop devtools hides this\n // because it still renders the control with the desktop engine). Give the host a\n // real width when fullWidth is requested so 100% has something to fill.\n '[style.display]': \"props?.fullWidth ? 'block' : null\",\n '[style.width]': \"props?.fullWidth ? '100%' : null\",\n },\n})\nexport class MnInputField implements OnInit {\n ngControl = inject(NgControl, {optional: true, self: true});\n\n /** Resolved UI configuration for the input field */\n protected uiConfig: MnInputFieldUIConfig = {};\n\n private readonly el = inject(ElementRef);\n\n /** Configuration properties for the input field */\n @Input({ required: true }) props!: MnInputProps;\n\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Current raw string value of the input element */\n value: string | null = null;\n\n /** Whether the input is disabled */\n isDisabled = false;\n\n /** Callback function to notify Angular forms of value changes */\n private onChange: (val: unknown) => void = () => {\n };\n\n /** Callback function to notify Angular forms when input is touched/blurred */\n private onTouched: () => void = () => {};\n\n /**\n * Built-in default error messages in English.\n * These are used when useBuiltInErrorMessages is true (default).\n * Can be overridden per-field using props.errorMessages.\n */\n private readonly builtInErrorMessages: Record<string, MnErrorMessageData> = {\n required: 'This field is required',\n email: 'Please enter a valid email address',\n minlength: (args) => `Minimum ${args.requiredLength} characters required`,\n maxlength: (args) => `Maximum ${args.requiredLength} characters allowed`,\n mnMin: (args) => `Date/time must be from ${args.min} onwards`,\n mnMax: (args) => `Date/time must be up to ${args.max}`,\n };\n\n /**\n * Constructor - Registers this component as the ControlValueAccessor\n * for the injected NgControl (FormControl).\n *\n */\n constructor() {\n if (this.ngControl) this.ngControl.valueAccessor = this;\n }\n\n ngOnInit() {\n this.resolveConfig();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveConfig();\n });\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n\n if (this.props.autoFocus) {\n setTimeout(() => this.focus(), 0);\n }\n }\n\n /**\n * Focuses the input element.\n */\n focus(): void {\n const input = this.el.nativeElement.querySelector('input');\n // `preventScroll` so autofocusing inside a popover (e.g. mn-dropdown's search) never\n // scrolls the input into view — a scroll would trip the host's scroll-to-close logic.\n if (input) input.focus({ preventScroll: true });\n }\n\n private resolveConfig() {\n const instanceId = this.explicitInstanceId || `mn-input-${this.props.id}`;\n this.uiConfig = this.configService.resolve<MnInputFieldUIConfig>(\n 'mn-input-field',\n this.sectionPath,\n instanceId\n );\n\n // Allow props to override uiConfig for label and placeholder\n if (this.props) {\n this.uiConfig = { ...this.uiConfig, label: this.props.label };\n this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n if (this.props.ariaLabel) {\n this.uiConfig = {...this.uiConfig, ariaLabel: this.props.ariaLabel};\n }\n }\n }\n\n /**\n * Gets the appropriate adapter based on the input type.\n * Adapters handle type-specific formatting, parsing, and validation.\n */\n private get adapter() {\n return pickAdapter(this.props.type);\n }\n\n // ========== ControlValueAccessor Implementation ==========\n\n /**\n * Writes a new value to the input element (called by Angular Forms).\n * Formats the value using the type-specific adapter.\n *\n * @param val - The value to write (type depends on input type)\n */\n writeValue(val: unknown): void {\n this.value = this.adapter.format(val);\n }\n\n /**\n * Registers a callback function to be called when the input value changes.\n *\n * @param fn - Callback function to notify Angular Forms of changes\n */\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Registers a callback function to be called when the input is touched/blurred.\n *\n * @param fn - Callback function to notify Angular Forms of touch events\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the input element.\n *\n * @param isDisabled - Whether the input should be disabled\n */\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n // ========== Event Handlers ==========\n\n /**\n * Handles input events from the input element.\n * Parses the raw string value and notifies Angular Forms.\n *\n * @param raw - Raw string value from the input element\n */\n handleInput(raw: string): void {\n let finalValue = raw;\n\n // Apply mask if available\n if (this.props.mask && typeof this.adapter.applyMask === 'function') {\n finalValue = this.adapter.applyMask(raw, this.props.mask);\n\n // Force-update the DOM input when the mask stripped characters,\n // because Angular won't re-render if this.value hasn't changed.\n if (finalValue !== raw) {\n const input = this.el.nativeElement.querySelector('input');\n if (input) input.value = finalValue;\n }\n }\n\n this.value = finalValue;\n this.onChange(this.adapter.parse(finalValue));\n }\n\n /**\n * Handles blur events from the input element.\n * Notifies Angular Forms that the input has been touched.\n */\n handleBlur(): void {\n this.onTouched();\n }\n\n // ========== Validator Implementation ==========\n\n /**\n * Validates the control using the type-specific adapter.\n * Called by Angular Forms during validation.\n *\n * @param control - The AbstractControl to validate\n * @returns ValidationErrors if invalid, null if valid\n */\n validate(control: AbstractControl): ValidationErrors | null {\n return this.adapter.validate(this.props, control, this.value);\n }\n\n // ========== Template Attribute Getters ==========\n\n /**\n * Gets all DOM attributes from the adapter.\n * These are input-type-specific attributes (min, max, step, inputmode).\n */\n get domAttrs() {\n return this.adapter.attrs(this.props);\n }\n\n /** Min attribute for date/time/number inputs */\n get minAttr() {\n return this.domAttrs.min ?? null;\n }\n\n /** Max attribute for date/time/number inputs */\n get maxAttr() {\n return this.domAttrs.max ?? null;\n }\n\n /** Step attribute for number/date/time inputs */\n get stepAttr() {\n return this.domAttrs.step ?? null;\n }\n\n /** Inputmode attribute for mobile keyboard optimization */\n get inputmodeAttr() {\n return this.domAttrs.inputmode ?? null;\n }\n\n // ========== Error Handling ==========\n\n /**\n * Gets the FormControl instance from Angular Forms.\n * Returns null if no control is attached.\n */\n get control() {\n return this.ngControl?.control ?? null;\n }\n\n /**\n * Determines whether to show error messages.\n * Errors are shown when the control is invalid and has been touched or modified.\n */\n /**\n * Ids of the rendered error messages, space-separated, for `aria-describedby`. Mirrors the\n * `{id}-error` / `{id}-{index}-error` ids `mn-error-message` renders in single and show-all mode.\n */\n get errorDescribedBy(): string {\n return this.props.showAllErrors\n ? this.errorMessages.map((_, index) => `${this.resolvedId}-${index}-error`).join(' ')\n : `${this.resolvedId}-error`;\n }\n\n get showError(): boolean {\n const c = this.control;\n return !!c && c.invalid && (c.touched || c.dirty);\n }\n\n /**\n * Picks the error key to display based on errorPriority.\n * Used when showAllErrors is false (default).\n *\n * @param errors - ValidationErrors object from the control\n * @returns The error key to display\n */\n private pickErrorKey(errors: ValidationErrors): string {\n // If priority is specified, use the first matching error from the priority list\n if (this.props.errorPriority) {\n for (const key of this.props.errorPriority) {\n if (errors[key] !== undefined) {\n return key;\n }\n }\n }\n // Otherwise, use the first error key\n return Object.keys(errors)[0];\n }\n\n protected isRequired(): boolean {\n if (!this.control) return false;\n return this.control.hasValidator(Validators.required);\n }\n\n /**\n * Resolves a single error message for a specific error key.\n * Checks custom messages, built-in messages, and fallback in order.\n *\n * @param errorKey - The error key (e.g., 'required', 'email')\n * @param errors - All validation errors on the control\n * @returns The resolved error message string\n */\n private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n const errorArgs = errors[errorKey];\n\n // Priority: custom (props) > config > built-in > fallback > default\n const customMsg = this.props.errorMessages?.[errorKey];\n const configMsg = this.uiConfig.errorMessages?.[errorKey];\n const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n const fallbackMsg = this.props.defaultErrorMessage;\n\n const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n // If the message is a function, call it with error arguments\n if (typeof msgDef === 'function') {\n return msgDef(errorArgs, errors);\n }\n // Interpolate {{placeholder}} tokens with error arguments (e.g. {{requiredLength}})\n if (errorArgs && typeof errorArgs === 'object') {\n return msgDef.replace(/\\{\\{(\\w+)}}/g, (_: string, key: string) =>\n errorArgs[key] !== undefined ? String(errorArgs[key]) : `{{${key}}}`\n );\n }\n return msgDef;\n }\n\n /**\n * Gets all error messages for the current control state.\n * Returns an array of error messages (used when showAllErrors is true).\n *\n * @returns Array of error message strings\n */\n get errorMessages(): string[] {\n const errors = this.control?.errors;\n if (!errors) return [];\n\n const errorKeys = Object.keys(errors);\n return errorKeys.map(key => this.resolveErrorMessageForKey(key, errors));\n }\n\n /**\n * Gets a single error message for the current control state.\n * Uses errorPriority to determine which error to show (when showAllErrors is false).\n *\n * @returns Single error message string, or null if no errors\n */\n get errorMessage(): string | null {\n const errors = this.control?.errors;\n if (!errors) return null;\n\n const errorKey = this.pickErrorKey(errors);\n return this.resolveErrorMessageForKey(errorKey, errors);\n }\n\n // ========== Resolved Properties ==========\n\n /** Resolved ID for the input element */\n get resolvedId(): string {\n return this.props.id;\n }\n\n /** Resolved name attribute for the input element */\n get resolvedName(): string | null {\n return this.props?.name ?? null;\n }\n\n /**\n * Computes the CSS classes from tailwind-variants based on the props.\n * Returns the variant classes for styling the input element.\n */\n get inputClasses(): string {\n return mnInputFieldVariants({\n size: this.props.size,\n borderRadius: this.props.borderRadius,\n shadow: this.props.shadow,\n fullWidth: this.props.fullWidth,\n hover: this.isDisabled ? false : this.props.hover,\n disabled: this.isDisabled,\n });\n }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n <!-- Label -->\n @if (uiConfig.label) {\n <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n <p>{{ uiConfig.label }}</p>\n @if (isRequired()) {\n <span class=\"text-error\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n <!-- Input Element -->\n <input\n [id]=\"resolvedId\"\n [attr.aria-required]=\"isRequired() || null\"\n [attr.name]=\"resolvedName\"\n [type]=\"props.type\"\n [attr.placeholder]=\"uiConfig.placeholder || null\"\n [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || null\"\n [attr.aria-invalid]=\"showError || null\"\n [attr.aria-describedby]=\"showError ? errorDescribedBy : null\"\n [attr.aria-activedescendant]=\"props.ariaActiveDescendant || null\"\n [disabled]=\"isDisabled\"\n [attr.autocomplete]=\"props.autocomplete || null\"\n [attr.min]=\"minAttr\"\n [attr.max]=\"maxAttr\"\n [ngModel]=\"value\"\n [ngClass]=\"inputClasses\"\n (input)=\"handleInput(($any($event.target)).value)\"\n (search)=\"handleInput(($any($event.target)).value)\"\n (blur)=\"handleBlur()\"\n />\n\n <!-- Error Messages -->\n @if (showError) {\n <!-- Show all errors mode -->\n @if (props.showAllErrors) {\n <div class=\"flex flex-col gap-y-1\">\n @for (error of errorMessages; track $index) {\n <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n }\n </div>\n } @else {\n @if (errorMessage !== null) {\n <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n\n }\n }\n }\n</div>\n","import {Component, inject, InjectionToken} from '@angular/core';\nimport {NgOptimizedImage} from '@angular/common';\nimport { MnDualHorizontalImageTypes } from './mn-dual-horizontal-imageTypes';\nimport {provideMnComponentConfig} from '../../config';\n\nexport type MnDualHorizontalImageConfig = {\n images?: MnDualHorizontalImageTypes[];\n noImagesFound?: string;\n}\n\nexport const MN_LIB_DUAL_HORIZONTAL_IMAGE = new InjectionToken<MnDualHorizontalImageConfig>('MN_LIB_DUAL_HORIZONTAL_IMAGE');\n\n\n@Component({\n selector: 'mn-lib-dual-horizontal-image',\n standalone: true,\n imports: [\n NgOptimizedImage\n ],\n providers: [\n provideMnComponentConfig<MnDualHorizontalImageConfig>(MN_LIB_DUAL_HORIZONTAL_IMAGE, 'mn-dual-horizontal-image'),\n ],\n templateUrl: './mn-dual-horizontal-image.html',\n host: {\n class: 'block'\n }\n})\nexport class MnDualHorizontalImage {\n protected readonly componentConfig = inject(MN_LIB_DUAL_HORIZONTAL_IMAGE);\n}\n","<div class=\"flex flex-col w-full -space-y-16 md:-space-y-24 lg:-space-y-24\">\n@for (image of componentConfig.images; track image.id) {\n <div\n class=\"relative aspect-3/2 w-[75%] md:w-[65%]\n overflow-hidden rounded-3xl shadow-md\n first:self-start last:self-end\"\n >\n <img\n [ngSrc]=\"image.url\"\n fill\n class=\"object-cover\"\n [alt]=\"image.alt\"\n />\n </div>\n } @empty {\n <p>{{ componentConfig.noImagesFound ?? 'No images found' }}</p>\n }\n</div>\n\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnInformationCardVariants = tv({\n base: '',\n variants: {\n bottomBorder: {\n true: 'border-b border-b-2 border-primary-500',\n },\n shadow: {\n true: 'shadow-xl',\n },\n textPosition: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n },\n },\n});\n\nexport type MnInformationCardVariants = VariantProps<typeof mnInformationCardVariants>;\n","import {Component, Input} from '@angular/core';\nimport {MnInformationCardData} from './mn-information-cardTypes';\nimport {mnInformationCardVariants} from './mn-information-cardVariants';\nimport {NgClass} from '@angular/common';\n\n@Component({\n selector: 'mn-lib-information-card',\n standalone: true,\n imports: [\n NgClass\n ],\n templateUrl: './mn-information-card.html',\n})\nexport class MnInformationCard<TExtra = unknown> {\n @Input({ required: true }) data!: MnInformationCardData<TExtra>;\n\n get hostClasses(): string {\n return mnInformationCardVariants({\n bottomBorder: this.data.bottomBorder,\n shadow: this.data.shadow,\n textPosition: this.data.textPosition,\n borderRadius: this.data.borderRadius\n });\n }\n}\n\n","<div class=\"flex flex-col items-center gap-y-4 p-4 size-full\" [ngClass]=\"hostClasses\">\n<ng-content select=\"[header]\"></ng-content>\n<ng-content></ng-content>\n<ng-content select=\"[footer]\"></ng-content>\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnTextareaVariants = tv({\n base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm outline-none focus:ring-1 focus:ring-primary',\n variants: {\n\n shadow: {\n true: 'shadow-lg',\n },\n size: {\n sm: 'p-2',\n md: 'p-3',\n lg: 'p-4',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n },\n fullWidth: {\n true: 'w-full',\n },\n resize: {\n none: 'resize-none',\n vertical: 'resize-y',\n horizontal: 'resize-x',\n both: 'resize',\n }\n },\n defaultVariants: {\n size: 'md',\n borderRadius: 'md',\n resize: 'vertical',\n }\n});\n\nexport type MnTextareaVariants = VariantProps<typeof mnTextareaVariants>;\n","import {Component, DestroyRef, ElementRef, inject, InjectionToken, Input, OnInit} from '@angular/core';\nimport {NgClass} from '@angular/common';\nimport {MnTextareaErrorMessageData, MnTextareaProps, MnTextareaUIConfig} from './mn-textareaTypes';\nimport {NgControl, ValidationErrors, Validators} from '@angular/forms';\nimport {mnTextareaVariants} from './mn-textareaVariants';\nimport {MnErrorMessage} from '../mn-error-message/mn-error-message';\nimport {MnConfigService} from \"../../config\";\nimport {MN_INSTANCE_ID, MN_SECTION_PATH} from \"../../context\";\nimport {MnLanguageService} from \"../../language\";\nimport {skip} from \"rxjs\";\n\nexport const MN_TEXTAREA_CONFIG = new InjectionToken<MnTextareaUIConfig>('MN_TEXTAREA_CONFIG');\n\n/**\n * MnTextarea Component\n *\n * A flexible, accessible textarea component that implements Angular's ControlValueAccessor\n * and Validator interfaces. Works similarly to MnInputField but uses a textarea element,\n * allowing users to set the height (rows), width (cols), and resize behavior.\n *\n * Features:\n * - Works with Angular Reactive Forms (FormControl, FormGroup)\n * - Configurable rows, cols, and resize behavior\n * - Built-in error messages with internationalization support\n * - Custom error messages per field\n * - Priority-based error display or show all errors\n * - Full accessibility (ARIA attributes)\n *\n * @example\n * ```typescript\n * <mn-textarea\n * formControlName=\"description\"\n * [props]=\"{\n * id: 'description',\n * rows: 5,\n * label: 'Description',\n * size: 'md',\n * borderRadius: 'md',\n * resize: 'vertical',\n * errorMessages: { required: 'Description is required' }\n * }\"\n * ></mn-textarea>\n * ```\n */\n@Component({\n selector: 'mn-lib-textarea',\n standalone: true,\n imports: [NgClass, MnErrorMessage],\n templateUrl: './mn-textarea.html',\n})\nexport class MnTextarea implements OnInit {\n ngControl = inject(NgControl, {optional: true, self: true});\n\n /** Resolved UI configuration for the textarea */\n protected uiConfig: MnTextareaUIConfig = {};\n\n private readonly el = inject(ElementRef);\n\n /** Configuration properties for the textarea */\n @Input({ required: true }) props!: MnTextareaProps;\n\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Current raw string value of the textarea element */\n value: string | null = null;\n\n /** Whether the textarea is disabled */\n isDisabled = false;\n\n /** Callback function to notify Angular forms of value changes */\n private onChange: (val: unknown) => void = () => {\n };\n\n /** Callback function to notify Angular forms when textarea is touched/blurred */\n private onTouched: () => void = () => {};\n\n /**\n * Built-in default error messages in English.\n * These are used when useBuiltInErrorMessages is true (default).\n * Can be overridden per-field using props.errorMessages.\n */\n private readonly builtInErrorMessages: Record<string, MnTextareaErrorMessageData> = {\n required: 'This field is required',\n minlength: (args) => `Minimum ${args.requiredLength} characters required`,\n maxlength: (args) => `Maximum ${args.requiredLength} characters allowed`,\n };\n\n /**\n * Constructor - Registers this component as the ControlValueAccessor\n * for the injected NgControl (FormControl).\n *\n */\n constructor() {\n if (this.ngControl) this.ngControl.valueAccessor = this;\n }\n\n ngOnInit() {\n this.resolveConfig();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveConfig();\n });\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n\n if (this.props.autoFocus) {\n setTimeout(() => this.focus(), 0);\n }\n }\n\n /**\n * Focuses the textarea element.\n */\n focus(): void {\n const textarea = this.el.nativeElement.querySelector('textarea');\n if (textarea) textarea.focus();\n }\n\n private resolveConfig() {\n const instanceId = this.explicitInstanceId || `mn-textarea-${this.props.id}`;\n this.uiConfig = this.configService.resolve<MnTextareaUIConfig>(\n 'mn-textarea',\n this.sectionPath,\n instanceId\n );\n\n // Allow props to override uiConfig for label and placeholder\n if (this.props.label) {\n this.uiConfig = { ...this.uiConfig, label: this.props.label };\n }\n if (this.props.placeholder) {\n this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n }\n }\n\n // ========== ControlValueAccessor Implementation ==========\n\n /**\n * Writes a new value to the textarea element (called by Angular Forms).\n *\n * @param val - The value to write\n */\n writeValue(val: unknown): void {\n this.value = val != null ? String(val) : null;\n }\n\n /**\n * Registers a callback function to be called when the textarea value changes.\n *\n * @param fn - Callback function to notify Angular Forms of changes\n */\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Registers a callback function to be called when the textarea is touched/blurred.\n *\n * @param fn - Callback function to notify Angular Forms of touch events\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Sets the disabled state of the textarea element.\n *\n * @param isDisabled - Whether the textarea should be disabled\n */\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n // ========== Event Handlers ==========\n\n /**\n * Handles input events from the textarea element.\n * Notifies Angular Forms of the new value.\n *\n * @param raw - Raw string value from the textarea element\n */\n handleInput(raw: string): void {\n this.value = raw;\n this.onChange(raw);\n }\n\n /**\n * Handles blur events from the textarea element.\n * Notifies Angular Forms that the textarea has been touched.\n */\n handleBlur(): void {\n this.onTouched();\n }\n\n // ========== Error Handling ==========\n\n /**\n * Gets the FormControl instance from Angular Forms.\n * Returns null if no control is attached.\n */\n get control() {\n return this.ngControl?.control ?? null;\n }\n\n /**\n * Determines whether to show error messages.\n * Errors are shown when the control is invalid and has been touched or modified.\n */\n /**\n * Ids of the rendered error messages, space-separated, for `aria-describedby`. Mirrors the\n * `{id}-error` / `{id}-{index}-error` ids `mn-error-message` renders in single and show-all mode.\n */\n get errorDescribedBy(): string {\n return this.props.showAllErrors\n ? this.errorMessages.map((_, index) => `${this.resolvedId}-${index}-error`).join(' ')\n : `${this.resolvedId}-error`;\n }\n\n get showError(): boolean {\n const c = this.control;\n return !!c && c.invalid && (c.touched || c.dirty);\n }\n\n /**\n * Picks the error key to display based on errorPriority.\n * Used when showAllErrors is false (default).\n *\n * @param errors - ValidationErrors object from the control\n * @returns The error key to display\n */\n private pickErrorKey(errors: ValidationErrors): string {\n if (this.props.errorPriority) {\n for (const key of this.props.errorPriority) {\n if (errors[key] !== undefined) {\n return key;\n }\n }\n }\n return Object.keys(errors)[0];\n }\n\n protected isRequired(): boolean {\n if (!this.control) return false;\n return this.control.hasValidator(Validators.required);\n }\n\n /**\n * Resolves a single error message for a specific error key.\n *\n * @param errorKey - The error key (e.g., 'required', 'minlength')\n * @param errors - All validation errors on the control\n * @returns The resolved error message string\n */\n private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n const errorArgs = errors[errorKey];\n\n const customMsg = this.props.errorMessages?.[errorKey];\n const configMsg = this.uiConfig.errorMessages?.[errorKey];\n const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n const fallbackMsg = this.props.defaultErrorMessage;\n\n const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n if (typeof msgDef === 'function') {\n return msgDef(errorArgs, errors);\n }\n // Interpolate {{placeholder}} tokens with validation error args\n if (errorArgs && typeof errorArgs === 'object') {\n return msgDef.replace(/\\{\\{(\\w+)}}/g, (_, key) => errorArgs[key] ?? _);\n }\n return msgDef;\n }\n\n /**\n * Gets all error messages for the current control state.\n *\n * @returns Array of error message strings\n */\n get errorMessages(): string[] {\n const errors = this.control?.errors;\n if (!errors) return [];\n\n const errorKeys = Object.keys(errors);\n return errorKeys.map(key => this.resolveErrorMessageForKey(key, errors));\n }\n\n /**\n * Gets a single error message for the current control state.\n *\n * @returns Single error message string, or null if no errors\n */\n get errorMessage(): string | null {\n const errors = this.control?.errors;\n if (!errors) return null;\n\n const errorKey = this.pickErrorKey(errors);\n return this.resolveErrorMessageForKey(errorKey, errors);\n }\n\n // ========== Resolved Properties ==========\n\n /** Resolved ID for the textarea element */\n get resolvedId(): string {\n return this.props.id;\n }\n\n /** Resolved name attribute for the textarea element */\n get resolvedName(): string | null {\n return this.props?.name ?? null;\n }\n\n /**\n * Computes the CSS classes from tailwind-variants based on the props.\n * Returns the variant classes for styling the textarea element.\n */\n get textareaClasses(): string {\n return mnTextareaVariants({\n size: this.props.size,\n borderRadius: this.props.borderRadius,\n shadow: this.props.shadow,\n fullWidth: this.props.fullWidth,\n resize: this.props.resize,\n });\n }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n <!-- Label -->\n @if (uiConfig.label || props.label) {\n <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n <p>{{ uiConfig.label || props.label }}</p>\n @if (isRequired()) {\n <span class=\"text-error\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n <!-- Textarea Element -->\n <textarea\n [id]=\"resolvedId\"\n [attr.aria-required]=\"isRequired() || null\"\n [attr.name]=\"resolvedName\"\n [attr.placeholder]=\"uiConfig.placeholder || null\"\n [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || null\"\n [attr.aria-invalid]=\"showError || null\"\n [attr.aria-describedby]=\"showError ? errorDescribedBy : null\"\n [disabled]=\"isDisabled\"\n [attr.autocomplete]=\"props.autocomplete || null\"\n [attr.rows]=\"props.rows ?? null\"\n [attr.cols]=\"props.cols ?? null\"\n [ngClass]=\"textareaClasses\"\n (input)=\"handleInput(($any($event.target)).value)\"\n (blur)=\"handleBlur()\"\n >{{ value ?? '' }}</textarea>\n\n <!-- Error Messages -->\n @if (showError) {\n <!-- Show all errors mode -->\n @if (props.showAllErrors) {\n <div class=\"flex flex-col gap-y-1\">\n @for (error of errorMessages; track $index) {\n <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n }\n </div>\n } @else {\n @if (errorMessage !== null) {\n <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n }\n }\n }\n</div>\n","import {tv, type VariantProps} from 'tailwind-variants';\n\n/**\n * Tailwind-variants definition for the MnFileInput component.\n *\n * Mirrors the styling vocabulary of {@link mnInputFieldVariants} (size,\n * borderRadius, shadow, fullWidth, disabled) so a file input visually matches the\n * rest of the input family, and adds a `dropzone` toggle for the large dashed\n * drop area used by the default display mode plus a `dragging` toggle for the\n * \"release to drop\" state while files hover over that dropzone.\n */\nexport const mnFileInputVariants = tv({\n base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm outline-none transition-all duration-300 ease-in-out',\n variants: {\n /** Inner padding scale of the clickable control. */\n size: {\n sm: 'p-2',\n md: 'p-3',\n lg: 'p-4',\n },\n /** Corner rounding of the control. */\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n },\n /** Drop shadow toggle. */\n shadow: {\n true: 'shadow-lg',\n },\n /** Stretch the control to the full width of its container. */\n fullWidth: {\n true: 'w-full',\n },\n /** Renders the control as a large dashed dropzone with a hover accent. */\n dropzone: {\n true: 'flex flex-col items-center justify-center gap-2 p-6 border-2 border-dashed text-center cursor-pointer hover:border-primary',\n },\n /** Highlighted \"release to drop\" appearance while files hover the dropzone. */\n dragging: {\n true: 'border-primary bg-primary/10 ring-4 ring-primary/20 scale-[1.01] duration-150',\n },\n /** Dimmed, non-interactive appearance. */\n disabled: {\n true: 'opacity-50 cursor-not-allowed pointer-events-none',\n },\n },\n defaultVariants: {\n size: 'md',\n borderRadius: 'lg',\n },\n});\n\n/** Variant prop types derived from {@link mnFileInputVariants}. */\nexport type MnFileInputVariants = VariantProps<typeof mnFileInputVariants>;\n","import {Component, computed, DestroyRef, EventEmitter, inject, Input, OnInit, Output, signal,} from '@angular/core';\nimport {CommonModule, NgClass} from '@angular/common';\nimport {NgControl, ValidationErrors, Validators} from '@angular/forms';\nimport {skip} from 'rxjs';\nimport {\n MnFileInputDisplayMode,\n MnFileInputErrorMessageData,\n MnFileInputProps,\n MnFileInputUIConfig,\n} from './mn-file-inputTypes';\nimport {mnFileInputVariants} from './mn-file-inputVariants';\nimport {MnErrorMessage} from '../mn-error-message/mn-error-message';\nimport {LucideFile, LucideImagePlus, LucideTrash2, LucideUpload, LucideX} from '@lucide/angular';\nimport {MnConfigService} from '../../config';\nimport {MN_INSTANCE_ID, MN_SECTION_PATH} from '../../context';\nimport {MnLanguageService} from '../../language';\nimport {MnValidationErrorArgs} from '../../shared/types';\n\n/** A single renderable entry in the file input (a newly-selected file or an existing image). */\nexport type MnFileDisplayItem = {\n /** File name (new files) or a derived name (existing images). */\n name: string;\n /** Whether the entry should render as an image preview. */\n isImage: boolean;\n /** Object-URL (new image files) or saved URL (existing images), else null. */\n previewUrl: string | null;\n /** Human-readable size for new files, else null. */\n sizeLabel: string | null;\n /** Index used by the remove action. */\n index: number;\n /** True for an already-saved image passed via `currentUrl(s)`. */\n existing: boolean;\n};\n\n/**\n * MnFileInput Component\n *\n * A generic, accessible file input that implements Angular's ControlValueAccessor.\n * It styles selection to match the rest of the input family, shows image previews\n * (and a file icon + name for non-images), supports single or multiple selection,\n * several display layouts, and client-side `accept` / `maxSize` / `maxFiles` limits.\n *\n * Every display mode but `compact` is also a real drop target: dragging files\n * over it switches the area to a highlighted \"release to drop\" state, and\n * dropping runs the files through the same validation as the file picker.\n *\n * The form control value is the plain selection: `File | null` (single) or\n * `File[]` (multiple). An optional `currentUrl`/`currentUrls` renders an\n * already-saved image; removing it leaves the value untouched and emits `cleared`.\n *\n * @example\n * ```html\n * <mn-lib-file-input\n * formControlName=\"image\"\n * [props]=\"{ id: 'image', label: 'Cover', accept: 'image/*', displayMode: 'dropzone' }\"\n * (cleared)=\"onRemoveExisting()\">\n * </mn-lib-file-input>\n * ```\n */\n@Component({\n selector: 'mn-lib-file-input',\n standalone: true,\n imports: [CommonModule, NgClass, MnErrorMessage, LucideFile, LucideImagePlus, LucideTrash2, LucideUpload, LucideX],\n templateUrl: './mn-file-input.html',\n})\nexport class MnFileInput implements OnInit {\n ngControl = inject(NgControl, {optional: true, self: true});\n /** Configuration properties for the file input. */\n @Input({required: true}) props!: MnFileInputProps;\n /** Emits whenever the selected file(s) change (in addition to the form control). */\n @Output() filesChange = new EventEmitter<File | File[] | null>();\n /** Emits when the user removes an already-saved image (`currentUrl(s)`). */\n @Output() cleared = new EventEmitter<void>();\n /** Resolved UI configuration for the file input. */\n protected uiConfig: MnFileInputUIConfig = {};\n /** Currently selected files (always an array internally). */\n protected readonly files = signal<File[]>([]);\n /** True while files are dragged over the dropzone (\"release to drop\" state). */\n protected readonly isDragging = signal(false);\n /** Transient message for a rejected selection (accept/maxSize/maxFiles). */\n protected readonly internalError = signal<string | null>(null);\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, {optional: true}) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, {optional: true});\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n /** Object-URL previews aligned to {@link files}; null for non-image entries. */\n private readonly previewUrls = signal<(string | null)[]>([]);\n /** True once the user removed the single existing image. */\n private readonly currentCleared = signal(false);\n /** Indices of removed existing images (multiple mode). */\n private readonly removedExisting = signal<Set<number>>(new Set());\n /** Renderable entries: existing images (when nothing newer hides them) then new files. */\n readonly displayItems = computed<MnFileDisplayItem[]>(() => {\n const items: MnFileDisplayItem[] = [];\n\n if (this.props.multiple) {\n const urls = this.props.currentUrls ?? [];\n const removed = this.removedExisting();\n urls.forEach((url, i) => {\n if (!removed.has(i)) items.push(this.existingItem(url, i));\n });\n } else if (this.files().length === 0 && this.props.currentUrl && !this.currentCleared()) {\n items.push(this.existingItem(this.props.currentUrl, 0));\n }\n\n const previews = this.previewUrls();\n this.files().forEach((file, i) => {\n items.push({\n name: file.name,\n isImage: this.isImage(file),\n previewUrl: previews[i] ?? null,\n sizeLabel: this.humanFileSize(file.size),\n index: i,\n existing: false,\n });\n });\n\n return items;\n });\n /** Disabled state pushed by the forms API. */\n private formDisabled = false;\n /**\n * Nesting depth of the current drag, so that moving across child elements of\n * the dropzone does not flicker {@link isDragging} off and on again.\n */\n private dragDepth = 0;\n /**\n * Built-in default error messages in English.\n * Used when `useBuiltInErrorMessages` is true (default); overridable per-field.\n */\n private readonly builtInErrorMessages: Record<string, MnFileInputErrorMessageData> = {\n required: 'This field is required',\n accept: 'This file type is not allowed',\n maxSize: (args) => `File is too large (max ${args.max})`,\n maxFiles: (args) => `Too many files (max ${args.max})`,\n };\n\n /** Registers this component as the ControlValueAccessor for the injected control. */\n constructor() {\n if (this.ngControl) this.ngControl.valueAccessor = this;\n }\n\n /** The effective display mode. */\n get displayMode(): MnFileInputDisplayMode {\n return this.props.displayMode ?? 'dropzone';\n }\n\n /**\n * Whether the current display mode acts as a drop target. `compact` is an\n * inline button sized for a form row, too small to aim a drag at.\n */\n get supportsDrop(): boolean {\n return this.displayMode !== 'compact';\n }\n\n /** Whether the control is disabled (via props or the forms API). */\n get isDisabled(): boolean {\n return this.formDisabled || !!this.props.disabled;\n }\n\n /** Native `accept` attribute value, or null for no restriction when unset. */\n get acceptAttr(): string | null {\n return this.props.accept ?? null;\n }\n\n // ========== ControlValueAccessor Implementation ==========\n\n /** Resolved id for the file input element. */\n get resolvedId(): string {\n return this.props.id;\n }\n\n /** Resolved name attribute for the file input element. */\n get resolvedName(): string | null {\n return this.props.name ?? null;\n }\n\n /** Tailwind-variant classes for the clickable control. */\n get controlClasses(): string {\n return mnFileInputVariants({\n size: this.props.size,\n borderRadius: this.props.borderRadius,\n shadow: this.props.shadow,\n fullWidth: this.props.fullWidth ?? (this.displayMode !== 'compact'),\n dropzone: this.displayMode === 'dropzone',\n dragging: this.isDragging(),\n disabled: this.isDisabled,\n });\n }\n\n /** The attached form control, if any. */\n get control() {\n return this.ngControl?.control ?? null;\n }\n\n // ========== Selection handling ==========\n\n /** Whether to show control validation errors. */\n get showError(): boolean {\n const c = this.control;\n return !!c && c.invalid && (c.touched || c.dirty);\n }\n\n /** All control error messages (used when `showAllErrors` is true). */\n get errorMessages(): string[] {\n const errors = this.control?.errors;\n if (!errors) return [];\n return Object.keys(errors).map((key) => this.resolveControlError(key, errors));\n }\n\n /** Single control error message (priority-aware). */\n get errorMessage(): string | null {\n const errors = this.control?.errors;\n if (!errors) return null;\n return this.resolveControlError(this.pickErrorKey(errors), errors);\n }\n\n ngOnInit(): void {\n this.resolveConfig();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => this.resolveConfig());\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n this.destroyRef.onDestroy(() => this.revokeAll());\n }\n\n /**\n * Writes a value from the form into the control.\n * @param val A `File`, an array of `File`, or null/undefined.\n */\n writeValue(val: unknown): void {\n const next = Array.isArray(val) ? val.filter((f): f is File => f instanceof File)\n : val instanceof File ? [val]\n : [];\n this.setFiles(next);\n }\n\n /**\n * Registers the form's change callback.\n * @param fn Callback invoked with the new value.\n */\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Registers the form's touched callback.\n * @param fn Callback invoked when the control is touched.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n // ========== Derived view state ==========\n\n /**\n * Sets the disabled state of the control.\n * @param isDisabled Whether the control should be disabled.\n */\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled = isDisabled;\n }\n\n /**\n * Handles a file-picker change: validates the incoming files against the\n * configured limits and updates the selection.\n * @param event The native change event from the hidden file input.\n */\n onFileSelected(event: Event): void {\n const input = event.target as HTMLInputElement;\n const incoming = Array.from(input.files ?? []);\n input.value = '';\n if (incoming.length === 0) return;\n this.addFiles(incoming);\n }\n\n /**\n * Arms the \"release to drop\" state when a file drag enters the dropzone.\n * @param event The native dragenter event.\n */\n onDragEnter(event: DragEvent): void {\n if (!this.acceptsDrag(event)) return;\n event.preventDefault();\n this.dragDepth++;\n this.isDragging.set(true);\n }\n\n /**\n * Keeps the drop target alive; without a prevented dragover the browser never\n * fires a drop event.\n * @param event The native dragover event.\n */\n onDragOver(event: DragEvent): void {\n if (!this.acceptsDrag(event)) return;\n event.preventDefault();\n if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';\n this.isDragging.set(true);\n }\n\n /**\n * Disarms the \"release to drop\" state once the drag has left the dropzone\n * entirely (and not merely crossed into one of its children).\n * @param event The native dragleave event.\n */\n onDragLeave(event: DragEvent): void {\n if (!this.isDragging()) return;\n event.preventDefault();\n this.dragDepth = Math.max(0, this.dragDepth - 1);\n if (this.dragDepth === 0) this.isDragging.set(false);\n }\n\n /**\n * Accepts the dropped files through the same validation as the file picker.\n * @param event The native drop event.\n */\n onDrop(event: DragEvent): void {\n if (!this.acceptsDrag(event)) return;\n event.preventDefault();\n this.resetDrag();\n const dropped = Array.from(event.dataTransfer?.files ?? []);\n if (dropped.length === 0) return;\n this.addFiles(dropped);\n }\n\n /**\n * Removes a newly-selected file by index.\n * @param index Index into the current selection.\n */\n removeFile(index: number): void {\n const next = this.files().filter((_, i) => i !== index);\n this.internalError.set(null);\n this.setFiles(next);\n this.emit();\n }\n\n /**\n * Removes an already-saved image and notifies the consumer via `cleared`.\n * @param index Index of the existing image (0 in single mode).\n */\n removeExisting(index: number): void {\n if (this.props.multiple) {\n const set = new Set(this.removedExisting());\n set.add(index);\n this.removedExisting.set(set);\n } else {\n this.currentCleared.set(true);\n }\n this.cleared.emit();\n this.onTouched();\n }\n\n /** Whether the attached control carries a `required` validator. */\n protected isRequired(): boolean {\n return this.control?.hasValidator(Validators.required) ?? false;\n }\n\n /** Stable track key for a display item across renders. */\n protected itemKey(item: MnFileDisplayItem): string {\n return `${item.existing ? 'e' : 'f'}-${item.index}`;\n }\n\n /** Whether a file should render as an image. */\n protected isImage(file: File): boolean {\n return (file.type ?? '').startsWith('image/');\n }\n\n /** Callback to notify Angular forms of value changes. */\n private onChange: (val: unknown) => void = () => {\n };\n\n // ========== Error handling (control validators) ==========\n\n /** Callback to notify Angular forms when the control is touched. */\n private onTouched: () => void = () => {\n };\n\n /** Resolves UI strings from config, layering built-in defaults and prop overrides. */\n private resolveConfig(): void {\n const instanceId = this.explicitInstanceId || `mn-file-input-${this.props.id}`;\n const resolved = this.configService.resolve<MnFileInputUIConfig>(\n 'mn-file-input',\n this.sectionPath,\n instanceId,\n );\n\n const builtIn: MnFileInputUIConfig = {\n dropzoneHint: 'Click to upload or drag and drop',\n dropActiveHint: 'Release to drop',\n replaceLabel: 'Replace',\n removeLabel: 'Remove',\n };\n\n this.uiConfig = {...builtIn, ...resolved};\n if (this.props.label) this.uiConfig = {...this.uiConfig, label: this.props.label};\n if (this.props.dropzoneHint) this.uiConfig = {...this.uiConfig, dropzoneHint: this.props.dropzoneHint};\n if (this.props.dropActiveHint) this.uiConfig = {...this.uiConfig, dropActiveHint: this.props.dropActiveHint};\n if (this.props.replaceLabel) this.uiConfig = {...this.uiConfig, replaceLabel: this.props.replaceLabel};\n if (this.props.removeLabel) this.uiConfig = {...this.uiConfig, removeLabel: this.props.removeLabel};\n }\n\n /**\n * Validates and merges newly-picked files into the current selection.\n * @param incoming The files chosen by the user.\n */\n private addFiles(incoming: File[]): void {\n this.internalError.set(null);\n let errorKey: string | null = null;\n let errorArgs: MnValidationErrorArgs = {};\n\n let accepted = incoming.filter((f) => this.matchesAccept(f));\n if (accepted.length < incoming.length) errorKey = 'accept';\n\n if (this.props.maxSize != null) {\n const max = this.props.maxSize;\n const withinSize = accepted.filter((f) => f.size <= max);\n if (withinSize.length < accepted.length) {\n errorKey = 'maxSize';\n errorArgs = {max: this.humanFileSize(max)};\n }\n accepted = withinSize;\n }\n\n let next = this.props.multiple ? [...this.files(), ...accepted] : accepted.slice(-1);\n\n if (this.props.multiple && this.props.maxFiles != null && next.length > this.props.maxFiles) {\n next = next.slice(0, this.props.maxFiles);\n errorKey = 'maxFiles';\n errorArgs = {max: this.props.maxFiles};\n }\n\n if (errorKey) this.internalError.set(this.resolveMessage(errorKey, errorArgs));\n\n this.setFiles(next);\n this.emit();\n }\n\n /** Replaces the internal selection and rebuilds image previews. */\n private setFiles(next: File[]): void {\n this.revokeAll();\n this.files.set(next);\n this.previewUrls.set(next.map((f) => (this.isImage(f) ? URL.createObjectURL(f) : null)));\n }\n\n /** Emits the current value to the form and any listeners. */\n private emit(): void {\n const value = this.props.multiple ? this.files() : (this.files()[0] ?? null);\n this.onChange(value);\n this.onTouched();\n this.filesChange.emit(value);\n }\n\n /** Revokes any outstanding object-URL previews to avoid leaks. */\n private revokeAll(): void {\n for (const url of this.previewUrls()) {\n if (url) URL.revokeObjectURL(url);\n }\n }\n\n /** Builds a display item for an already-saved image. */\n private existingItem(url: string, index: number): MnFileDisplayItem {\n return {\n name: this.fileNameFromUrl(url),\n isImage: true,\n previewUrl: url,\n sizeLabel: null,\n index,\n existing: true,\n };\n }\n\n /** Picks which control error key to display. */\n private pickErrorKey(errors: ValidationErrors): string {\n if (this.props.errorPriority) {\n for (const key of this.props.errorPriority) {\n if (errors[key] !== undefined) return key;\n }\n }\n return Object.keys(errors)[0];\n }\n\n // ========== Helpers ==========\n\n /** Resolves a control error key to a message, interpolating its args. */\n private resolveControlError(key: string, errors: ValidationErrors): string {\n return this.resolveMessage(key, errors[key] as MnValidationErrorArgs);\n }\n\n /**\n * Resolves a message for an error key using the same precedence as the other\n * inputs: custom props > config > built-in > fallback > default.\n */\n private resolveMessage(key: string, args: MnValidationErrorArgs | undefined): string {\n const customMsg = this.props.errorMessages?.[key];\n const configMsg = this.uiConfig.errorMessages?.[key];\n const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n const builtInMsg = useBuiltIn ? this.builtInErrorMessages[key] : undefined;\n const fallbackMsg = this.props.defaultErrorMessage;\n\n const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n if (typeof msgDef === 'function') {\n return msgDef(args ?? {}, {});\n }\n if (args && typeof args === 'object') {\n return msgDef.replace(/\\{\\{(\\w+)}}/g, (_match: string, token: string) => {\n const value = (args as Record<string, unknown>)[token];\n return value !== undefined ? String(value) : `{{${token}}}`;\n });\n }\n return msgDef;\n }\n\n /**\n * Whether a drag event should be treated as a file drop on this control.\n * Ignores disabled controls, modes without a drop target, and drags that\n * carry something other than files (selected text, a link, …) so the page\n * keeps its default behaviour.\n */\n private acceptsDrag(event: DragEvent): boolean {\n if (this.isDisabled || !this.supportsDrop) return false;\n const types = event.dataTransfer?.types;\n return !types || Array.from(types).includes('Files');\n }\n\n /** Clears the drag state and its nesting counter. */\n private resetDrag(): void {\n this.dragDepth = 0;\n this.isDragging.set(false);\n }\n\n /** Checks a file against the configured `accept` filter (extensions and MIME globs). */\n private matchesAccept(file: File): boolean {\n const accept = this.props.accept;\n if (!accept) return true;\n const tokens = accept.split(',').map((t) => t.trim().toLowerCase()).filter(Boolean);\n if (tokens.length === 0) return true;\n const name = file.name.toLowerCase();\n const type = (file.type ?? '').toLowerCase();\n return tokens.some((token) => {\n if (token.startsWith('.')) return name.endsWith(token);\n if (token.endsWith('/*')) return type.startsWith(token.slice(0, -1));\n return type === token;\n });\n }\n\n /** Formats a byte count as a human-readable size. */\n private humanFileSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n }\n\n /** Derives a display name from a URL (last path segment). */\n private fileNameFromUrl(url: string): string {\n const clean = url.split('?')[0].split('#')[0];\n const segment = clean.substring(clean.lastIndexOf('/') + 1);\n return segment || 'image';\n }\n}\n","<!--\n Drag handling sits on the wrapper so a drop anywhere inside the control counts.\n onDragEnter/onDragLeave balance out as the drag crosses children, and\n acceptsDrag() ignores the modes that have no drop target.\n-->\n<div\n (dragenter)=\"onDragEnter($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (dragover)=\"onDragOver($event)\"\n (drop)=\"onDrop($event)\"\n [class.w-full]=\"props.fullWidth !== false && displayMode !== 'compact'\"\n class=\"flex flex-col\">\n <!-- Label -->\n @if (uiConfig.label) {\n <label [attr.for]=\"resolvedId\" class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\">\n <p>{{ uiConfig.label }}</p>\n @if (isRequired()) {\n <span class=\"text-error\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n <!-- Hidden native file input shared by every trigger -->\n <input\n #fileInput\n (change)=\"onFileSelected($event)\"\n [accept]=\"acceptAttr\"\n [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || null\"\n [attr.multiple]=\"props.multiple || null\"\n [attr.name]=\"resolvedName\"\n [disabled]=\"isDisabled\"\n [id]=\"resolvedId\"\n [attr.aria-required]=\"isRequired() || null\"\n class=\"hidden\"\n type=\"file\"\n />\n\n @switch (displayMode) {\n <!-- Compact: inline button + filename chips -->\n @case ('compact') {\n <div class=\"flex flex-wrap items-center gap-2\">\n <button\n (click)=\"fileInput.click()\"\n [disabled]=\"isDisabled\"\n [ngClass]=\"controlClasses\"\n class=\"inline-flex items-center gap-2 cursor-pointer hover:bg-base-200\"\n type=\"button\">\n <svg lucideUpload [size]=\"18\"></svg>\n <span class=\"text-sm\">{{ uiConfig.replaceLabel }}</span>\n </button>\n @for (item of displayItems(); track itemKey(item)) {\n <span class=\"inline-flex items-center gap-1 text-sm text-base-content/70\">\n @if (item.isImage && item.previewUrl) {\n <img [src]=\"item.previewUrl\" alt=\"\" class=\"h-6 w-6 rounded object-cover\"/>\n } @else {\n <svg lucideFile [size]=\"16\" class=\"text-base-content/50\"></svg>\n }\n <span class=\"max-w-40 truncate\">{{ item.name }}</span>\n <button\n (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n [attr.aria-label]=\"uiConfig.removeLabel\"\n class=\"text-base-content/50 hover:text-error cursor-pointer\"\n type=\"button\">\n <svg lucideX [size]=\"14\"></svg>\n </button>\n </span>\n }\n </div>\n }\n\n <!-- List: compact rows of file icon + name + size -->\n @case ('list') {\n <div class=\"relative flex flex-col\">\n <button\n (click)=\"fileInput.click()\"\n [disabled]=\"isDisabled\"\n [ngClass]=\"controlClasses\"\n class=\"flex flex-row items-center justify-center gap-2 cursor-pointer hover:bg-base-200\"\n type=\"button\">\n <svg lucideUpload [size]=\"18\"></svg>\n <span class=\"text-sm\">{{ uiConfig.replaceLabel }}</span>\n </button>\n @if (displayItems().length > 0) {\n <div class=\"mt-2 flex flex-col gap-1\">\n @for (item of displayItems(); track itemKey(item)) {\n <div class=\"flex items-center gap-2 rounded-lg bg-base-200 px-3 py-1.5 text-sm\">\n <svg lucideFile [size]=\"16\" class=\"text-base-content/50\"></svg>\n <span class=\"flex-1 truncate text-base-content\">{{ item.name }}</span>\n @if (item.sizeLabel) {\n <span class=\"text-base-content/50\">{{ item.sizeLabel }}</span>\n }\n <button\n (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n [attr.aria-label]=\"uiConfig.removeLabel\"\n class=\"text-base-content/50 hover:text-error cursor-pointer\"\n type=\"button\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n </div>\n }\n </div>\n }\n @if (isDragging()) {\n <ng-container [ngTemplateOutlet]=\"dropOverlay\"></ng-container>\n }\n </div>\n }\n\n <!-- Thumbnail: grid of tiles with overlay remove + add tile -->\n @case ('thumbnail') {\n <div class=\"relative flex flex-wrap gap-3\">\n @for (item of displayItems(); track itemKey(item)) {\n <div class=\"relative h-24 w-24 overflow-hidden rounded-xl border border-base-300 bg-base-100\">\n @if (item.isImage && item.previewUrl) {\n <img [src]=\"item.previewUrl\" alt=\"\" class=\"h-full w-full object-cover\"/>\n } @else {\n <div class=\"flex h-full w-full flex-col items-center justify-center gap-1 p-1 text-center\">\n <svg lucideFile [size]=\"22\" class=\"text-base-content/50\"></svg>\n <span class=\"w-full truncate text-xs text-base-content/60\">{{ item.name }}</span>\n </div>\n }\n <button\n (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n [attr.aria-label]=\"uiConfig.removeLabel\"\n class=\"inline-flex h-6 w-6 items-center justify-center rounded-full cursor-pointer transition-colors absolute top-1 right-1 border-none bg-black/60 text-white hover:bg-black/80\"\n type=\"button\">\n <svg lucideX [size]=\"14\"></svg>\n </button>\n </div>\n }\n @if (props.multiple || displayItems().length === 0) {\n <button\n (click)=\"fileInput.click()\"\n [disabled]=\"isDisabled\"\n class=\"flex h-24 w-24 flex-col items-center justify-center gap-1 rounded-xl border-2 border-dashed border-base-300 text-base-content/50 hover:border-primary cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed\"\n type=\"button\">\n <svg lucideImagePlus [size]=\"22\"></svg>\n </button>\n }\n @if (isDragging()) {\n <ng-container [ngTemplateOutlet]=\"dropOverlay\"></ng-container>\n }\n </div>\n }\n\n <!-- Dropzone (default): large dashed area + preview rows -->\n @default {\n <button\n (click)=\"fileInput.click()\"\n [disabled]=\"isDisabled\"\n [ngClass]=\"controlClasses\"\n type=\"button\">\n <!-- Inert so a drag crossing the icon/hint never reads as leaving the zone -->\n <span aria-live=\"polite\" class=\"pointer-events-none flex flex-col items-center gap-2\">\n @if (isDragging()) {\n <svg [size]=\"28\" class=\"animate-bounce text-primary\" lucideUpload></svg>\n <span class=\"text-sm font-medium text-primary\">{{ uiConfig.dropActiveHint }}</span>\n } @else {\n <svg [size]=\"28\" class=\"text-base-content/40\" lucideImagePlus></svg>\n <span class=\"text-sm text-base-content/60\">{{ uiConfig.dropzoneHint }}</span>\n }\n </span>\n </button>\n @if (displayItems().length > 0) {\n <div class=\"mt-2 flex flex-col gap-2\">\n @for (item of displayItems(); track itemKey(item)) {\n <div class=\"flex items-center gap-3 rounded-lg bg-base-200 p-2\">\n @if (item.isImage && item.previewUrl) {\n <img [src]=\"item.previewUrl\" alt=\"\" class=\"h-12 w-12 rounded-md object-cover\"/>\n } @else {\n <svg lucideFile [size]=\"24\" class=\"text-base-content/50\"></svg>\n }\n <span class=\"flex-1 truncate text-sm text-base-content\">{{ item.name }}</span>\n @if (item.sizeLabel) {\n <span class=\"text-sm text-base-content/50\">{{ item.sizeLabel }}</span>\n }\n <button\n (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n [attr.aria-label]=\"uiConfig.removeLabel\"\n class=\"inline-flex h-8 w-8 items-center justify-center rounded-full cursor-pointer transition-colors text-error hover:bg-error/10\"\n type=\"button\">\n <svg lucideTrash2 [size]=\"16\"></svg>\n </button>\n </div>\n }\n </div>\n }\n }\n }\n\n <!-- Selection-limit error (accept / maxSize / maxFiles) -->\n @if (internalError(); as msg) {\n <mn-error-message [errorMessage]=\"msg\" [id]=\"resolvedId + '-selection'\"></mn-error-message>\n }\n\n <!-- Control validation errors -->\n @if (showError) {\n @if (props.showAllErrors) {\n <div class=\"flex flex-col gap-y-1\">\n @for (error of errorMessages; track $index) {\n <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n }\n </div>\n } @else if (errorMessage !== null) {\n <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n }\n }\n</div>\n\n<!--\n \"Release to drop\" cover for the modes that render their own layout instead of a\n dropzone. Absolutely positioned so arming it never shifts the layout, and inert\n so the drag keeps reaching the elements underneath.\n-->\n<ng-template #dropOverlay>\n <div\n aria-live=\"polite\"\n class=\"pointer-events-none absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-primary bg-base-100/90 text-center\">\n <svg [size]=\"24\" class=\"animate-bounce text-primary\" lucideUpload></svg>\n <span class=\"px-2 text-sm font-medium text-primary\">{{ uiConfig.dropActiveHint }}</span>\n </div>\n</ng-template>\n","import {tv, type VariantProps} from 'tailwind-variants';\n\nexport const mnCheckboxVariants = tv({\n base: 'mn-checkbox',\n variants: {\n size: {\n xs: 'size-4 p-0.5',\n sm: 'size-5 p-[0.1875rem]',\n md: 'size-6 p-1',\n lg: 'size-7 p-[0.3125rem]',\n xl: 'size-8 p-1.5',\n },\n color: {\n primary: 'border-primary checked:bg-primary indeterminate:bg-primary focus-visible:outline-primary text-primary-content',\n secondary: 'border-secondary checked:bg-secondary indeterminate:bg-secondary focus-visible:outline-secondary text-secondary-content',\n accent: 'border-accent checked:bg-accent indeterminate:bg-accent focus-visible:outline-accent text-accent-content',\n neutral: 'border-neutral checked:bg-neutral indeterminate:bg-neutral focus-visible:outline-neutral text-neutral-content',\n info: 'border-info checked:bg-info indeterminate:bg-info focus-visible:outline-info text-info-content',\n success: 'border-success checked:bg-success indeterminate:bg-success focus-visible:outline-success text-success-content',\n warning: 'border-warning checked:bg-warning indeterminate:bg-warning focus-visible:outline-warning text-warning-content',\n error: 'border-error checked:bg-error indeterminate:bg-error focus-visible:outline-error text-error-content',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n },\n },\n defaultVariants: {\n size: 'md',\n color: 'primary',\n borderRadius: 'sm',\n },\n});\n\nexport const mnCheckboxWrapperVariants = tv({\n base: 'text-base-content',\n variants: {\n size: {\n xs: 'text-sm',\n sm: 'text-sm',\n md: 'text-sm',\n lg: 'text-base',\n xl: 'text-base',\n },\n fullWidth: {\n true: 'w-full',\n },\n hover: {\n true: 'hover:bg-base-200 rounded-md transition-colors duration-200 ease-in-out px-2 -mx-2',\n },\n },\n defaultVariants: {\n size: 'md',\n hover: false,\n },\n});\n\nexport type MnCheckboxVariants = VariantProps<typeof mnCheckboxVariants>;\nexport type MnCheckboxWrapperVariants = VariantProps<typeof mnCheckboxWrapperVariants>;\n","import {\n Component,\n DestroyRef,\n EventEmitter,\n inject,\n InjectionToken,\n Input,\n OnChanges,\n OnInit,\n Output\n} from '@angular/core';\nimport {NgClass} from '@angular/common';\nimport {MnCheckboxErrorMessageData, MnCheckboxProps, MnCheckboxUIConfig} from './mn-checkboxTypes';\nimport {NgControl, ValidationErrors, Validators} from '@angular/forms';\nimport {mnCheckboxVariants, mnCheckboxWrapperVariants} from './mn-checkboxVariants';\nimport {MnErrorMessage} from '../mn-error-message/mn-error-message';\nimport {MnConfigService} from \"../../config\";\nimport {MN_INSTANCE_ID, MN_SECTION_PATH} from \"../../context\";\nimport {MnLanguageService} from \"../../language\";\nimport {skip} from \"rxjs\";\n\nexport const MN_CHECKBOX_CONFIG = new InjectionToken<MnCheckboxUIConfig>('MN_CHECKBOX_CONFIG');\n\n@Component({\n selector: 'mn-lib-checkbox',\n standalone: true,\n imports: [NgClass, MnErrorMessage],\n templateUrl: './mn-checkbox.html',\n styleUrl: './mn-checkbox.css',\n})\nexport class MnCheckbox implements OnInit, OnChanges {\n ngControl = inject(NgControl, {optional: true, self: true});\n\n protected uiConfig: MnCheckboxUIConfig = {};\n\n @Input({ required: true }) props!: MnCheckboxProps;\n\n /** Direct checked binding for non-form usage */\n @Input() checked?: boolean;\n\n /** Emits when checked state changes (for non-form usage) */\n @Output() checkedChange = new EventEmitter<boolean>();\n\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n\n value = false;\n isDisabled = false;\n\n private onChange: (val: unknown) => void = () => {\n };\n private onTouched: () => void = () => {};\n\n private readonly builtInErrorMessages: Record<string, MnCheckboxErrorMessageData> = {\n required: 'This field is required',\n };\n\n constructor() {\n if (this.ngControl) this.ngControl.valueAccessor = this;\n }\n\n ngOnInit() {\n this.resolveConfig();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveConfig();\n });\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n }\n\n private resolveConfig() {\n const instanceId = this.explicitInstanceId || `mn-checkbox-${this.props.id}`;\n this.uiConfig = this.configService.resolve<MnCheckboxUIConfig>(\n 'mn-checkbox',\n this.sectionPath,\n instanceId\n );\n\n if (this.props.label) {\n this.uiConfig = { ...this.uiConfig, label: this.props.label };\n }\n }\n\n // ========== ControlValueAccessor Implementation ==========\n\n writeValue(val: unknown): void {\n this.value = !!val;\n }\n\n /** Sync value from checked input when not using forms */\n ngOnChanges(): void {\n if (this.checked !== undefined) {\n this.value = this.checked;\n }\n }\n\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n // ========== Event Handlers ==========\n\n handleChange(checked: boolean): void {\n this.value = checked;\n this.onChange(checked);\n this.checkedChange.emit(checked);\n }\n\n handleBlur(): void {\n this.onTouched();\n }\n\n // ========== Error Handling ==========\n\n get control() {\n return this.ngControl?.control ?? null;\n }\n\n get showError(): boolean {\n const c = this.control;\n return !!c && c.invalid && (c.touched || c.dirty);\n }\n\n private pickErrorKey(errors: ValidationErrors): string {\n if (this.props.errorPriority) {\n for (const key of this.props.errorPriority) {\n if (errors[key] !== undefined) {\n return key;\n }\n }\n }\n return Object.keys(errors)[0];\n }\n\n protected isRequired(): boolean {\n if (!this.control) return false;\n return this.control.hasValidator(Validators.required);\n }\n\n private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n const errorArgs = errors[errorKey];\n const customMsg = this.props.errorMessages?.[errorKey];\n const configMsg = this.uiConfig.errorMessages?.[errorKey];\n const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n const fallbackMsg = this.props.defaultErrorMessage;\n const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n if (typeof msgDef === 'function') {\n return msgDef(errorArgs, errors);\n }\n return msgDef;\n }\n\n get errorMessages(): string[] {\n const errors = this.control?.errors;\n if (!errors) return [];\n return Object.keys(errors).map(key => this.resolveErrorMessageForKey(key, errors));\n }\n\n get errorMessage(): string | null {\n const errors = this.control?.errors;\n if (!errors) return null;\n const errorKey = this.pickErrorKey(errors);\n return this.resolveErrorMessageForKey(errorKey, errors);\n }\n\n // ========== Resolved Properties ==========\n\n get resolvedId(): string {\n return this.props.id;\n }\n\n get resolvedName(): string | null {\n return this.props?.name ?? null;\n }\n\n get checkboxClasses(): string {\n return mnCheckboxVariants({\n size: this.props.size,\n color: this.props.color,\n borderRadius: this.props.borderRadius,\n });\n }\n\n get wrapperClasses(): string {\n return mnCheckboxWrapperVariants({\n size: this.props.size,\n fullWidth: this.props.fullWidth,\n hover: this.props.hover,\n });\n }\n}\n","<div [class.is-fullwidth]=\"props.fullWidth\" class=\"flex flex-col items-start\">\n <label [attr.for]=\"resolvedId\" [ngClass]=\"wrapperClasses\"\n class=\"flex flex-row items-center gap-x-2 select-none cursor-pointer\">\n <input\n type=\"checkbox\"\n [id]=\"resolvedId\"\n [attr.aria-required]=\"isRequired() || null\"\n [attr.name]=\"resolvedName\"\n [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || props.label || null\"\n [attr.aria-invalid]=\"showError || null\"\n [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n [disabled]=\"isDisabled\"\n [checked]=\"value\"\n [ngClass]=\"checkboxClasses\"\n (change)=\"handleChange($any($event.target).checked)\"\n (blur)=\"handleBlur()\"\n />\n @if (uiConfig.label || props.label) {\n <span class=\"flex flex-row items-center gap-x-0.5\">\n <span>{{ uiConfig.label || props.label }}</span>\n @if (isRequired()) {\n <span class=\"text-error\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n </label>\n\n @if (showError) {\n @if (props.showAllErrors) {\n <div class=\"flex flex-col gap-y-1 mt-1\">\n @for (error of errorMessages; track $index) {\n <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n }\n </div>\n } @else {\n @if (errorMessage !== null) {\n <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n }\n }\n }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnDatetimeVariants = tv({\n base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 cursor-pointer text-base-content text-sm',\n variants: {\n shadow: {\n true: 'shadow-lg',\n },\n size: {\n sm: 'px-2 py-1.5',\n md: 'px-3 py-2',\n lg: 'px-4 py-3',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n },\n fullWidth: {\n true: 'w-full',\n },\n hover: {\n true: 'hover:cursor-pointer hover:bg-base-200 transition-colors duration-300 ease-in-out',\n },\n },\n defaultVariants: {\n size: 'md',\n borderRadius: 'md',\n hover: true,\n },\n});\n\nexport type MnDatetimeVariants = VariantProps<typeof mnDatetimeVariants>;\n","import {Component, DestroyRef, inject, InjectionToken, Input, OnInit} from '@angular/core';\nimport {NgClass, NgTemplateOutlet} from '@angular/common';\nimport {LucideCalendarDays} from '@lucide/angular';\nimport {MnDatetimeErrorMessageData, MnDatetimeMode, MnDatetimeProps, MnDatetimeUIConfig} from './mn-datetimeTypes';\nimport {NgControl, ValidationErrors, Validators} from '@angular/forms';\nimport {mnDatetimeVariants} from './mn-datetimeVariants';\nimport {MnErrorMessage} from '../mn-error-message/mn-error-message';\nimport {MnConfigService} from \"../../config\";\nimport {MN_INSTANCE_ID, MN_SECTION_PATH} from \"../../context\";\nimport {MnLanguageService} from \"../../language\";\nimport {skip} from \"rxjs\";\n\nexport const MN_DATETIME_CONFIG = new InjectionToken<MnDatetimeUIConfig>('MN_DATETIME_CONFIG');\n\n@Component({\n selector: 'mn-lib-datetime',\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, MnErrorMessage, LucideCalendarDays],\n templateUrl: './mn-datetime.html',\n styles: `\n input::-webkit-calendar-picker-indicator {\n cursor: pointer;\n }\n\n /*\n * iOS Safari renders native date/time inputs with a large, fixed intrinsic\n * width and largely ignores the CSS box model (width / flex shrinking) while\n * the native appearance is active. In a fullWidth / flex layout this makes the\n * control overflow narrow screens (\"too big, doesn't fit\") on iPhone, even\n * though Android and desktop honour the width. Resetting the native appearance\n * and clearing the intrinsic min-width lets width:100% take effect so the input\n * shrinks to its container. Scoped to coarse pointers so mouse-driven desktop\n * browsers keep their native calendar-picker indicator untouched.\n */\n @media (pointer: coarse) {\n input[type='date'],\n input[type='datetime-local'],\n input[type='time'],\n input[type='month'],\n input[type='week'] {\n -webkit-appearance: none;\n appearance: none;\n min-width: 0;\n box-sizing: border-box;\n }\n }\n `,\n host: {\n // Native date/time inputs have a platform-specific intrinsic width. Without an\n // explicit host width the inline host collapses to that intrinsic size, so the\n // input's `w-full` (width:100%) resolves against a content-sized box and fails to\n // fill the parent on real mobile devices (desktop devtools hides this because it\n // still renders the control with the desktop engine). Give the host a real width\n // when fullWidth is requested so 100% has something to fill.\n '[style.display]': \"props?.fullWidth ? 'block' : null\",\n '[style.width]': \"props?.fullWidth ? '100%' : null\",\n },\n})\nexport class MnDatetime implements OnInit {\n ngControl = inject(NgControl, {optional: true, self: true});\n\n protected uiConfig: MnDatetimeUIConfig = {};\n\n @Input({ required: true }) props!: MnDatetimeProps;\n\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n\n value: string | null = null;\n isDisabled = false;\n\n private onChange: (val: unknown) => void = () => {\n };\n private onTouched: () => void = () => {};\n\n private readonly builtInErrorMessages: Record<string, MnDatetimeErrorMessageData> = {\n required: 'This field is required',\n mnMin: (args) => `Date/time must be from ${args.min} onwards`,\n mnMax: (args) => `Date/time must be up to ${args.max}`,\n };\n\n constructor() {\n if (this.ngControl) this.ngControl.valueAccessor = this;\n }\n\n ngOnInit() {\n this.resolveConfig();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveConfig();\n });\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n }\n\n private resolveConfig() {\n const instanceId = this.explicitInstanceId || `mn-datetime-${this.props.id}`;\n this.uiConfig = this.configService.resolve<MnDatetimeUIConfig>(\n 'mn-datetime',\n this.sectionPath,\n instanceId\n );\n\n if (this.props.label) {\n this.uiConfig = { ...this.uiConfig, label: this.props.label };\n }\n if (this.props.placeholder) {\n this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n }\n }\n\n // ========== ControlValueAccessor Implementation ==========\n\n writeValue(val: unknown): void {\n if (val != null) {\n let str = String(val);\n // Convert ISO 8601 strings (e.g. \"2025-01-01T10:00:00.000Z\") to datetime-local format\n if (str.includes('T') && (str.endsWith('Z') || /[+-]\\d{2}:\\d{2}$/.test(str))) {\n const date = new Date(str);\n if (!isNaN(date.getTime())) {\n const pad = (n: number) => n.toString().padStart(2, '0');\n str = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;\n }\n }\n this.value = str;\n } else {\n this.value = null;\n }\n }\n\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n // ========== Event Handlers ==========\n\n handleInput(raw: string): void {\n this.value = raw;\n this.onChange(raw);\n }\n\n handleBlur(): void {\n this.onTouched();\n }\n\n handleClick(input: HTMLInputElement): void {\n try {\n input.showPicker();\n } catch {\n // picker already open (icon click) or browser restriction\n }\n }\n\n // ========== Error Handling ==========\n\n get control() {\n return this.ngControl?.control ?? null;\n }\n\n get showError(): boolean {\n const c = this.control;\n return !!c && c.invalid && (c.touched || c.dirty);\n }\n\n private pickErrorKey(errors: ValidationErrors): string {\n if (this.props.errorPriority) {\n for (const key of this.props.errorPriority) {\n if (errors[key] !== undefined) {\n return key;\n }\n }\n }\n return Object.keys(errors)[0];\n }\n\n protected isRequired(): boolean {\n if (!this.control) return false;\n return this.control.hasValidator(Validators.required);\n }\n\n private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n const errorArgs = errors[errorKey];\n const customMsg = this.props.errorMessages?.[errorKey];\n const configMsg = this.uiConfig.errorMessages?.[errorKey];\n const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n const fallbackMsg = this.props.defaultErrorMessage;\n const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n if (typeof msgDef === 'function') {\n return msgDef(errorArgs, errors);\n }\n return msgDef;\n }\n\n get errorMessages(): string[] {\n const errors = this.control?.errors;\n if (!errors) return [];\n return Object.keys(errors).map(key => this.resolveErrorMessageForKey(key, errors));\n }\n\n get errorMessage(): string | null {\n const errors = this.control?.errors;\n if (!errors) return null;\n const errorKey = this.pickErrorKey(errors);\n return this.resolveErrorMessageForKey(errorKey, errors);\n }\n\n // ========== Resolved Properties ==========\n\n get resolvedId(): string {\n return this.props.id;\n }\n\n get resolvedName(): string | null {\n return this.props?.name ?? null;\n }\n\n get resolvedMode(): MnDatetimeMode {\n return this.props.mode ?? 'datetime-local';\n }\n\n /** Whether the control renders as an icon-only button rather than a full input. */\n get iconOnly(): boolean {\n return this.props.iconOnly === true;\n }\n\n /**\n * Accessible name for the input. Prefers an explicit ariaLabel/label; for the\n * icon-only variant — which has no visible text — it falls back to the\n * placeholder so the button is never left unnamed.\n */\n get resolvedAriaLabel(): string | null {\n const explicit = this.uiConfig.ariaLabel || this.uiConfig.label || this.props.label;\n if (explicit) return explicit;\n return this.iconOnly ? (this.uiConfig.placeholder || this.props.placeholder || null) : null;\n }\n\n /** Lucide icon size (px) tracking the field size, used only in the icon-only variant. */\n get iconSize(): number {\n if (this.props.size === 'sm') return 16;\n if (this.props.size === 'lg') return 20;\n return 18;\n }\n\n get inputClasses(): string {\n // Icon-only: the input becomes a transparent click target filling the icon box,\n // which carries the visible styling. `iconBoxClasses` provides the box itself.\n if (this.iconOnly) {\n return 'absolute inset-0 h-full w-full cursor-pointer opacity-0';\n }\n return mnDatetimeVariants({\n size: this.props.size,\n borderRadius: this.props.borderRadius,\n shadow: this.props.shadow,\n fullWidth: this.props.fullWidth,\n hover: this.props.hover,\n });\n }\n\n /**\n * Classes for the icon-only box: the same border/background/radius/hover the full\n * input would wear (reused from the variant), made a positioning context for the\n * overlaid input, with a `focus-within` ring standing in for the transparent\n * input's own focus outline.\n */\n get iconBoxClasses(): string {\n return [\n mnDatetimeVariants({\n size: this.props.size,\n borderRadius: this.props.borderRadius,\n shadow: this.props.shadow,\n hover: this.props.hover,\n }),\n 'relative inline-flex items-center justify-center text-base-content/70',\n 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-primary',\n ].join(' ');\n }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n @if (uiConfig.label || props.label) {\n <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n <p>{{ uiConfig.label || props.label }}</p>\n @if (isRequired()) {\n <span class=\"text-error\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n @if (iconOnly) {\n <!--\n Icon-only variant: a bordered box holding a calendar icon, with the native\n input layered on top at zero opacity. The box carries the look (border,\n background, radius, hover, focus ring); the input stays a real, focusable\n form control that opens the picker on click. `focus-within` on the box\n surfaces the keyboard focus ring, since the input itself is transparent.\n -->\n <div [ngClass]=\"iconBoxClasses\">\n <svg [size]=\"iconSize\" lucideCalendarDays aria-hidden=\"true\" class=\"pointer-events-none\"></svg>\n <ng-container [ngTemplateOutlet]=\"inputTemplate\"></ng-container>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"inputTemplate\"></ng-container>\n }\n\n @if (showError) {\n @if (props.showAllErrors) {\n <div class=\"flex flex-col gap-y-1\">\n @for (error of errorMessages; track $index) {\n <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n }\n </div>\n } @else {\n @if (errorMessage !== null) {\n <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n }\n }\n }\n</div>\n\n<!-- Single input definition, rendered either bare or inside the icon box above,\n so both variants share exactly the same bindings and behaviour. -->\n<ng-template #inputTemplate>\n <input\n #dateInput\n [id]=\"resolvedId\"\n [attr.aria-required]=\"isRequired() || null\"\n [attr.name]=\"resolvedName\"\n [type]=\"resolvedMode\"\n [attr.placeholder]=\"uiConfig.placeholder || props.placeholder || null\"\n [attr.aria-label]=\"resolvedAriaLabel\"\n [attr.aria-invalid]=\"showError || null\"\n [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n [disabled]=\"isDisabled\"\n [attr.min]=\"props.min || null\"\n [attr.max]=\"props.max || null\"\n [attr.step]=\"props.step || null\"\n [value]=\"value ?? ''\"\n [ngClass]=\"inputClasses\"\n (click)=\"handleClick(dateInput)\"\n (input)=\"handleInput(($any($event.target)).value)\"\n (blur)=\"handleBlur()\"\n />\n</ng-template>\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n Injector,\n input,\n linkedSignal,\n OnInit,\n output,\n signal,\n viewChildren,\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule} from '@angular/forms';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {LucideChevronLeft, LucideChevronRight} from '@lucide/angular';\nimport {MnButton} from '../mn-button';\nimport {MnDatetime} from '../mn-datetime';\nimport {MnLanguageService} from '../../language';\n\n/**\n * How the bar arranges itself at its current width.\n *\n * - `inline` — the day strip and Today share one row, under the month header. The\n * strip never stacks: as space runs out it shows fewer days rather than adding a\n * row.\n * - `compact` — too narrow even for a three-day strip, so the days give way to a\n * date picker sitting beside Today, still under the month header.\n *\n * Resolved from the bar's own width — not the viewport — so a bar in a narrow\n * sidebar lays itself out like a phone even on a wide screen.\n */\nexport type DateSelectorBarLayout = 'compact' | 'inline';\n\n/** Represents a single day tile in the date selector. */\nexport type DayTile = {\n /** The full date object (at midnight). */\n date: Date;\n /** Short day name (e.g. 'ma', 'Mon'). */\n dayName: string;\n /** Day-of-month number. */\n dayNumber: number;\n /** Short month name (e.g. 'mei', 'Jun'). */\n monthName: string;\n /**\n * Whether this tile is the first day of a month within the visible strip. The\n * days either side of it move apart, so the break is visible without a label —\n * the month header above the strip names both months.\n */\n startsNewMonth: boolean;\n /** Whether this tile is the currently selected date. */\n isSelected: boolean;\n /** Whether this tile represents today. */\n isToday: boolean;\n /** Full, locale-formatted date used as the tile's accessible name. */\n accessibleLabel: string;\n};\n\n/** A full week: the most days the strip shows, and the size it aligns to. */\nconst DAYS_IN_WEEK = 7;\n/** Fewest days worth showing before the picker takes over instead. */\nconst MIN_TILE_COUNT = 3;\n/** `Date.getDay()` value for Monday. */\nconst MONDAY = 1;\n/**\n * Width one day occupies. Days are sized by their content: a three-letter weekday\n * and a two-digit number at their set sizes measure about 72px including padding,\n * plus the `gap-1` beside it. Rounded up, because coming in under the real width\n * overflows the strip into the arrow beside it.\n */\nconst TILE_SLOT_WIDTH = 80;\n/** Space reserved for the two borderless window arrows and their gaps. */\nconst ARROWS_ZONE_WIDTH = 88;\n/**\n * Space the Today button claims, including the bar's own horizontal padding and\n * the gap beside it.\n */\nconst CONTROLS_ZONE_WIDTH = 150;\n/**\n * Everything on the controls row that isn't a day tile. The month is a full-width\n * header on its own line now, so it no longer competes with the days for room —\n * which is why more of them fit at a given width than they used to.\n */\nconst RESERVED_WIDTH = ARROWS_ZONE_WIDTH + CONTROLS_ZONE_WIDTH;\n/** Below this the strip can't hold even {@link MIN_TILE_COUNT} days. */\nconst COMPACT_MAX_WIDTH = MIN_TILE_COUNT * TILE_SLOT_WIDTH + RESERVED_WIDTH;\n/** Assumed width before the first measurement (and during server-side rendering). */\nconst UNMEASURED_WIDTH = 960;\n\n/** Counter used to give each bar instance a unique date-picker id. */\nlet instanceCounter = 0;\n\n/**\n * Reusable, responsive date selector bar.\n *\n * Renders a \"Today\" button, a month header, previous/next arrows and a strip of\n * day tiles. Selecting a tile or pressing \"Today\" emits the chosen day via\n * {@link dateSelected}. The arrows only shift the visible days and never emit.\n *\n * Given room, the strip is a whole week running Monday to Sunday, so the weekday\n * columns hold still as you page and no weekday appears twice. As the bar narrows\n * it shows fewer days rather than adding a second row — a partial strip has no\n * week to align to, so it slides to keep the selection in view instead. Narrower\n * still, and the days give way to a date picker beside Today, which keeps every\n * date reachable on a phone rather than leaving a strip too cramped to use.\n *\n * Selecting a day already on the strip leaves it exactly where it is; a selection\n * from outside moves the strip to where that day is. The arrows page by whatever\n * is on show, without touching the selection.\n *\n * The component carries no hard-coded copy: button, placeholder and assistive\n * text are supplied through the label inputs, and day/month names follow\n * {@link locale} (falling back to the active {@link MnLanguageService} locale).\n *\n * @example\n * ```html\n * <mn-date-selector-bar\n * [selectedDate]=\"focusDay\"\n * [todayLabel]=\"'Today'\"\n * [pickDateLabel]=\"'Pick a date'\"\n * [locale]=\"'nl-NL'\"\n * (dateSelected)=\"onDaySelected($event)\">\n * </mn-date-selector-bar>\n * ```\n */\n@Component({\n selector: 'mn-date-selector-bar',\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n MnButton,\n MnDatetime,\n LucideChevronLeft,\n LucideChevronRight,\n ],\n templateUrl: './mn-date-selector-bar.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n // Styling lives entirely in the template as Tailwind utilities, as elsewhere in\n // the library — there is no stylesheet for this component.\n host: {class: 'block'},\n})\nexport class MnDateSelectorBar implements OnInit {\n /** The currently selected date, provided by the parent. */\n readonly selectedDate = input<Date>(this.getToday());\n /** Label for the \"Today\" button. */\n readonly todayLabel = input<string>('Today');\n /** Placeholder for the date picker shown in place of a too-cramped week strip. */\n readonly pickDateLabel = input<string>('Pick a date');\n /** Accessible name for the previous-week arrow. */\n readonly previousLabel = input<string>('Show the previous week');\n /** Accessible name for the next-week arrow. */\n readonly nextLabel = input<string>('Show the next week');\n /** Accessible name for the day strip as a whole. */\n readonly dayStripLabel = input<string>('Select a day');\n /**\n * BCP 47 locale used to format day/month names. When empty, the active\n * {@link MnLanguageService} locale is used.\n */\n readonly locale = input<string>('');\n /** Emits when the user selects a new date. */\n readonly dateSelected = output<Date>();\n\n /** Unique id for this instance's date picker, so several bars can coexist. */\n readonly pickerId = `mn-dsb-date-${++instanceCounter}`;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly host = inject(ElementRef<HTMLElement>);\n private readonly lang = inject(MnLanguageService);\n\n private readonly tileButtons = viewChildren<ElementRef<HTMLButtonElement>>('tileButton');\n\n /** The bar's own width in px, tracked so the layout follows its container. */\n private readonly containerWidth = signal<number>(0);\n /** Bumped whenever the active language changes so name formatting re-runs. */\n private readonly localeTick = signal(0);\n\n /** How the bar is arranged at the current width. */\n readonly layout = computed<DateSelectorBarLayout>(() =>\n (this.containerWidth() || UNMEASURED_WIDTH) >= COMPACT_MAX_WIDTH ? 'inline' : 'compact',\n );\n\n /** Whether the day strip is shown, or the picker has taken its place. */\n readonly showDayStrip = computed<boolean>(() => this.layout() === 'inline');\n\n /**\n * Days in the visible strip: a full week where there's room, fewer as the bar\n * narrows. The bar drops days rather than adding a second row, so it stays one\n * line at every width it can.\n */\n readonly tileCount = computed<number>(() => {\n if (!this.showDayStrip()) return 0;\n const width = this.containerWidth() || UNMEASURED_WIDTH;\n const fits = Math.floor((width - RESERVED_WIDTH) / TILE_SLOT_WIDTH);\n return Math.min(DAYS_IN_WEEK, Math.max(MIN_TILE_COUNT, fits));\n });\n\n\n /** Effective locale: explicit input, else the active app locale. */\n private readonly effectiveLocale = computed<string>(() => {\n this.localeTick();\n return this.locale() || this.lang.locale;\n });\n\n /**\n * First day of the visible strip — the week's Monday when a whole week is on\n * show, otherwise whatever start keeps the selection in view.\n *\n * The strip holds still while the selection stays on screen; a selection\n * outside it moves to where that day is. The arrows write here directly to page\n * away from the selection.\n */\n private readonly windowStart = linkedSignal<{selected: number; count: number}, Date>({\n source: () => ({selected: this.selectedDate().getTime(), count: this.tileCount()}),\n computation: (source, previous) => {\n const selected = new Date(source.selected);\n const {count} = source;\n const anchored = this.anchorFor(selected, count);\n if (!previous || count === 0) return anchored;\n\n const current = previous.value;\n const holdsSelection = (() => {\n const offset = this.daysBetween(current, selected);\n return offset >= 0 && offset < count;\n })();\n\n // A whole week must also still be Monday-aligned to be worth keeping —\n // otherwise a strip that grew back to seven would keep a stale start.\n const stillValid = count === DAYS_IN_WEEK\n ? holdsSelection && current.getDay() === MONDAY\n : holdsSelection;\n\n return stillValid ? current : anchored;\n },\n });\n\n /**\n * Index of the tile that is currently keyboard-reachable (roving tabindex).\n * Tracks the selection so Tab lands on the selected day, falling back to Monday\n * when the selection has been paged out of sight.\n */\n private readonly focusedIndex = linkedSignal<number, number>({\n source: () => this.selectedDate().getTime(),\n computation: () => Math.max(0, this.indexOfSelected()),\n });\n\n /** The visible days, derived from the window start and the current selection. */\n readonly dayTiles = computed<DayTile[]>(() => {\n const count = this.tileCount();\n if (count === 0) return [];\n\n const start = this.windowStart();\n const selected = this.selectedDate();\n const today = this.getToday();\n const locale = this.effectiveLocale();\n\n const tiles: DayTile[] = [];\n let previousMonth = -1;\n let previousYear = -1;\n\n for (let i = 0; i < count; i++) {\n const date = new Date(start);\n date.setDate(start.getDate() + i);\n\n const month = date.getMonth();\n const year = date.getFullYear();\n const startsNewMonth = i > 0 && (month !== previousMonth || year !== previousYear);\n\n tiles.push({\n date,\n dayName: date.toLocaleDateString(locale, {weekday: 'short'}),\n dayNumber: date.getDate(),\n monthName: date.toLocaleDateString(locale, {month: 'short'}),\n startsNewMonth,\n isSelected: this.isSameDay(date, selected),\n isToday: this.isSameDay(date, today),\n accessibleLabel: date.toLocaleDateString(locale, {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n }),\n });\n\n previousMonth = month;\n previousYear = year;\n }\n\n return tiles;\n });\n\n /**\n * The month the strip is currently in, spelled out for the header that titles\n * the bar — so the days below are never just loose numbers. Reads as a range\n * when the strip straddles two months, and carries both years when it straddles\n * two of those.\n */\n readonly monthCaption = computed<string>(() => {\n const locale = this.effectiveLocale();\n const tiles = this.dayTiles();\n\n // With no strip to describe — the compact layout — the header names the\n // month the selection sits in, so the bar is never unlabelled.\n if (!tiles.length) {\n return this.selectedDate().toLocaleDateString(locale, {month: 'long', year: 'numeric'});\n }\n\n const first = tiles[0].date;\n const last = tiles[tiles.length - 1].date;\n\n if (first.getFullYear() !== last.getFullYear()) {\n const from = first.toLocaleDateString(locale, {month: 'long', year: 'numeric'});\n const to = last.toLocaleDateString(locale, {month: 'long', year: 'numeric'});\n return `${from} – ${to}`;\n }\n\n if (first.getMonth() !== last.getMonth()) {\n const from = first.toLocaleDateString(locale, {month: 'long'});\n const to = last.toLocaleDateString(locale, {month: 'long', year: 'numeric'});\n return `${from} – ${to}`;\n }\n\n return first.toLocaleDateString(locale, {month: 'long', year: 'numeric'});\n });\n\n /** The selected date formatted as YYYY-MM-DD for the date-picker input. */\n readonly selectedDateString = computed<string>(() => {\n const d = this.selectedDate();\n const pad = (n: number) => n.toString().padStart(2, '0');\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n });\n\n /**\n * Props for the compact-layout date picker. Sized to match the Today button it\n * sits beside, and filling the rest of the row so it stays an easy tap target.\n */\n readonly pickerProps = computed(() => ({\n id: this.pickerId,\n mode: 'date' as const,\n placeholder: this.pickDateLabel(),\n size: 'md' as const,\n borderRadius: 'lg' as const,\n hover: true,\n fullWidth: true,\n }));\n\n ngOnInit(): void {\n // Re-format names when the active language changes.\n this.lang.locale$\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.localeTick.update((v) => v + 1));\n\n this.observeOwnWidth();\n }\n\n /** Shows the days before the visible ones, without changing the selection. */\n navigatePrevious(): void {\n this.shiftWindow(-1);\n }\n\n /** Shows the days after the visible ones, without changing the selection. */\n navigateNext(): void {\n this.shiftWindow(1);\n }\n\n /** Returns to today: brings today into the strip and selects it. */\n goToToday(): void {\n const today = this.getToday();\n // Move explicitly: when today is already selected the window signal has no new\n // source value to react to, but the user still expects to land on it.\n this.windowStart.set(this.anchorFor(today, this.tileCount()));\n // Only emit when today isn't already selected, so pressing \"Today\" while on\n // today doesn't trigger a redundant reload.\n if (!this.isSameDay(today, this.selectedDate())) {\n this.dateSelected.emit(today);\n }\n }\n\n /** Selects a date and emits it, unless it is already the selected day. */\n selectDate(date: Date): void {\n // Re-selecting the current day is a no-op: emitting again would make\n // consumers reload for no change.\n if (this.isSameDay(date, this.selectedDate())) return;\n this.dateSelected.emit(date);\n }\n\n /**\n * Handles the date-picker model change: shows the picked day's week and emits\n * it (unless it is already the selected day).\n * @param value The date string in YYYY-MM-DD format.\n */\n onDateModelChanged(value: string): void {\n if (!value) return;\n const picked = new Date(value + 'T00:00:00');\n if (isNaN(picked.getTime())) return;\n\n this.windowStart.set(this.anchorFor(picked, this.tileCount()));\n // Picking the day that's already selected shouldn't re-emit.\n if (!this.isSameDay(picked, this.selectedDate())) {\n this.dateSelected.emit(picked);\n }\n }\n\n /** Whether the tile at `index` is the one reachable with Tab. */\n isTabbable(index: number): boolean {\n return index === this.focusedIndex();\n }\n\n /** Remembers which tile last held focus, so Tab returns to it. */\n onTileFocus(index: number): void {\n this.focusedIndex.set(index);\n }\n\n /**\n * Moves focus across the week with the arrow keys. Running off either end turns\n * the page to the neighbouring week and lands on the day that continues the run,\n * so the weeks read as one continuous calendar.\n */\n onTileKeydown(event: KeyboardEvent, index: number): void {\n const lastIndex = this.tileCount() - 1;\n\n switch (event.key) {\n case 'ArrowRight':\n event.preventDefault();\n if (index < lastIndex) {\n this.moveFocusTo(index + 1);\n } else {\n // Off the end: turn the page and land on the day that continues the run.\n this.shiftWindow(1);\n this.moveFocusTo(0);\n }\n break;\n\n case 'ArrowLeft':\n event.preventDefault();\n if (index > 0) {\n this.moveFocusTo(index - 1);\n } else {\n this.shiftWindow(-1);\n this.moveFocusTo(lastIndex);\n }\n break;\n\n case 'Home':\n event.preventDefault();\n this.moveFocusTo(0);\n break;\n\n case 'End':\n event.preventDefault();\n this.moveFocusTo(lastIndex);\n break;\n\n default:\n break;\n }\n }\n\n /** trackBy key for day tiles. */\n trackByTile(_index: number, tile: DayTile): number {\n return tile.date.getTime();\n }\n\n /**\n * Moves the strip by `pages` of whatever it is currently showing. Paging by the\n * visible count is what keeps a full week Monday-aligned — seven days forward\n * from a Monday is the next Monday.\n */\n private shiftWindow(pages: number): void {\n const next = new Date(this.windowStart());\n next.setDate(next.getDate() + pages * this.tileCount());\n this.windowStart.set(next);\n }\n\n /** Focuses the tile at `index` once the week has rendered. */\n private moveFocusTo(index: number): void {\n this.focusedIndex.set(index);\n afterNextRender(\n () => this.tileButtons()[index]?.nativeElement.focus(),\n {injector: this.injector},\n );\n }\n\n /** Index of the selected day within the visible week, or -1 when off-week. */\n private indexOfSelected(): number {\n return this.dayTiles().findIndex((tile) => tile.isSelected);\n }\n\n /**\n * Where the strip should start to show `date` among `count` days: the week's\n * Monday when a whole week is on show, otherwise centred on the day, since a\n * partial strip has no week to align to.\n */\n private anchorFor(date: Date, count: number): Date {\n if (count === DAYS_IN_WEEK) return this.startOfWeek(date);\n\n const start = new Date(date);\n start.setHours(0, 0, 0, 0);\n start.setDate(start.getDate() - Math.floor(count / 2));\n return start;\n }\n\n /**\n * Returns the Monday of the week containing `date`. `getDay()` counts from\n * Sunday, so the shift maps Sunday to the end of the week rather than the start.\n */\n private startOfWeek(date: Date): Date {\n const start = new Date(date);\n start.setHours(0, 0, 0, 0);\n start.setDate(start.getDate() - ((start.getDay() + 6) % 7));\n return start;\n }\n\n /** Whole calendar days from `from` to `to`, ignoring time of day and DST. */\n private daysBetween(from: Date, to: Date): number {\n const a = Date.UTC(from.getFullYear(), from.getMonth(), from.getDate());\n const b = Date.UTC(to.getFullYear(), to.getMonth(), to.getDate());\n return Math.round((b - a) / 86400000);\n }\n\n /** Tracks the bar's own width so the layout responds to its container. */\n private observeOwnWidth(): void {\n const element = this.host.nativeElement;\n this.containerWidth.set(element.getBoundingClientRect().width);\n\n if (typeof ResizeObserver === 'undefined') return;\n\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0;\n if (width > 0) this.containerWidth.set(width);\n });\n observer.observe(element);\n this.destroyRef.onDestroy(() => observer.disconnect());\n }\n\n /** Returns a Date object for today at midnight. */\n private getToday(): Date {\n const now = new Date();\n now.setHours(0, 0, 0, 0);\n return now;\n }\n\n /** Checks whether two dates fall on the same calendar day. */\n private isSameDay(a: Date, b: Date): boolean {\n return (\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n );\n }\n}\n","<!-- Date selector bar. Layout is driven by the bar's own measured width, so it\n rearranges for the space the bar was given, not for the viewport. The strip\n never stacks: as room runs out it shows fewer days, then hands over to the\n picker. Nothing here is boxed — spacing does the grouping, not borders. -->\n<div class=\"flex flex-col gap-2 px-4 py-3\">\n\n <!-- Month header. Titles the whole bar so the day numbers below are never loose:\n it names the month the strip is in (or, when compact, the month the\n selection sits in), reading as a range where the strip crosses a boundary.\n On its own line it has room to be spelled out, and no longer steals width\n from the days the way the old inline caption did. -->\n <div aria-hidden=\"true\"\n class=\"text-center text-sm font-semibold tracking-wide whitespace-nowrap opacity-80\">\n {{ monthCaption() }}\n </div>\n\n <!-- Controls row. Today and the strip travel together as one centred cluster, so\n Today sits right beside the days instead of stranded against the far edge;\n the gap between them matches the strip's own spacing. When the strip gives\n way to the picker, the picker fills the row and Today anchors its left. -->\n <div class=\"flex items-center justify-center gap-3\">\n\n <!-- Today: returns the strip and the selection to the current day. Outlined\n rather than filled, so the one filled-primary element on the bar is the\n selected day — Today shares the primary accent without competing with it. -->\n <button (click)=\"goToToday()\"\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md' }\"\n class=\"shrink-0\"\n mnButton\n type=\"button\">\n {{ todayLabel() }}\n </button>\n\n <!-- Too narrow for a usable strip, so the picker takes its place beside Today.\n Every date stays reachable on a phone, in one tap rather than by paging;\n the month header above keeps the compact bar labelled like the wide one. -->\n @if (!showDayStrip()) {\n <mn-lib-datetime (ngModelChange)=\"onDateModelChanged($event)\"\n [ngModel]=\"selectedDateString()\"\n [props]=\"pickerProps()\"\n class=\"block min-w-0 flex-1\"></mn-lib-datetime>\n }\n\n <!-- Arrows and days, sized to their own content so the row can centre them\n together with Today as a single cluster — rather than the days drifting to\n the middle of the leftover space, away from the button. -->\n @if (showDayStrip()) {\n <div [attr.aria-label]=\"dayStripLabel()\"\n class=\"flex min-w-0 items-center gap-3\"\n role=\"group\">\n <button (click)=\"navigatePrevious()\"\n [attr.aria-label]=\"previousLabel()\"\n [data]=\"{ variant: 'text', size: 'md', color: 'gray' }\"\n class=\"shrink-0\"\n mnButton\n type=\"button\">\n <svg [size]=\"18\" lucideChevronLeft></svg>\n </button>\n\n <!-- Days read on one line so each sits at the same height as the buttons\n either side of it. Roving tabindex: one day is in the tab order, the\n arrow keys move between the rest and page the strip at either end. -->\n <div class=\"flex min-w-0 gap-1\">\n @for (tile of dayTiles(); track tile.date.getTime(); let i = $index) {\n <!-- Selected is the filled pill; today is called out by its number\n alone, tinted primary — no box, in keeping with a bar that groups\n by spacing rather than borders. When today is also the selected\n day the fill takes over, since there is nothing left to tell apart.\n A month break is marked by extra breathing room rather than a rule,\n so the run of days stays unbroken; the header names both months. -->\n <button #tileButton\n (click)=\"selectDate(tile.date)\"\n (focus)=\"onTileFocus(i)\"\n (keydown)=\"onTileKeydown($event, i)\"\n [attr.aria-current]=\"tile.isToday ? 'date' : null\"\n [attr.aria-label]=\"tile.accessibleLabel\"\n [attr.aria-pressed]=\"tile.isSelected\"\n [attr.tabindex]=\"isTabbable(i) ? 0 : -1\"\n [class.bg-primary]=\"tile.isSelected\"\n [class.hover:bg-base-200]=\"!tile.isSelected\"\n [class.ml-3]=\"tile.startsNewMonth\"\n [class.text-primary-content]=\"tile.isSelected\"\n class=\"flex min-w-16 shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-lg px-3 py-2 text-sm transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary motion-reduce:transition-none\"\n type=\"button\">\n <span [class.opacity-60]=\"!tile.isSelected\"\n [class.opacity-90]=\"tile.isSelected\"\n aria-hidden=\"true\"\n class=\"text-xs font-medium uppercase\">\n {{ tile.dayName }}\n </span>\n <!-- Today's number carries the primary tint, unless the tile is\n filled — then it wears the fill's own text colour instead. -->\n <span [class.text-primary]=\"tile.isToday && !tile.isSelected\"\n aria-hidden=\"true\"\n class=\"font-bold tabular-nums\">{{ tile.dayNumber }}</span>\n </button>\n }\n </div>\n\n <button (click)=\"navigateNext()\"\n [attr.aria-label]=\"nextLabel()\"\n [data]=\"{ variant: 'text', size: 'md', color: 'gray' }\"\n class=\"shrink-0\"\n mnButton\n type=\"button\">\n <svg [size]=\"18\" lucideChevronRight></svg>\n </button>\n </div>\n }\n </div>\n</div>\n","/**\n * Where a `position: fixed` panel anchored to a trigger should open, and how tall it may be.\n *\n * Shared by the select, the multi-select and the dropdown, which all used to pin their panel\n * to the trigger's bottom edge unconditionally — so a trigger near the bottom of the viewport\n * (a table's \"items per page\" picker is the classic case) opened a list that ran off screen.\n */\nexport type AnchoredPanelPlacement = {\n /** The `top` style, or `auto` when the panel opens above the trigger. */\n top: string;\n /** The `bottom` style, or `auto` when the panel opens below the trigger. */\n bottom: string;\n /**\n * The `max-height` style: the room on the chosen side, so a long list scrolls inside the\n * viewport instead of past its edge, or `null` when the panel's own cap is smaller anyway.\n */\n maxHeight: string | null;\n};\n\n/** Breathing room kept between the panel and the viewport edge, in pixels. */\nexport const PANEL_VIEWPORT_MARGIN_PX = 8;\n\n/**\n * The least room below the trigger before the panel is flipped above it, in pixels: roughly\n * four rows, so a picker that still fits its usual few options never flips for no reason.\n */\nexport const PANEL_FLIP_THRESHOLD_PX = 160;\n\n/**\n * Chooses the side of the trigger with room for the panel.\n *\n * Below by default. Above only when the space below is under {@link PANEL_FLIP_THRESHOLD_PX}\n * and the space above is larger: flipping is the exception, because a list that opens upward\n * reads backwards from what the trigger's chevron promised.\n * @param trigger The trigger's viewport rectangle.\n * @param viewportHeight The viewport's inner height.\n * @param gap Distance between trigger and panel, in pixels.\n * @param panelMaxHeight The panel's own height cap in pixels, so the available room only\n * becomes the cap when it is the smaller of the two.\n * @returns The styles to bind on the panel.\n */\nexport function anchoredPanelPlacement(\n trigger: Pick<DOMRect, 'top' | 'bottom'>,\n viewportHeight: number,\n gap: number,\n panelMaxHeight: number,\n): AnchoredPanelPlacement {\n const below = viewportHeight - trigger.bottom - gap - PANEL_VIEWPORT_MARGIN_PX;\n const above = trigger.top - gap - PANEL_VIEWPORT_MARGIN_PX;\n const openAbove = below < PANEL_FLIP_THRESHOLD_PX && above > below;\n const room = Math.max(openAbove ? above : below, 0);\n return {\n top: openAbove ? 'auto' : `${trigger.bottom + gap}px`,\n bottom: openAbove ? `${viewportHeight - trigger.top + gap}px` : 'auto',\n maxHeight: room < panelMaxHeight ? `${room}px` : null,\n };\n}\n","/**\n * Keyboard navigation shared by mn-select and mn-multi-select. Both follow the WAI-ARIA combobox\n * pattern: focus stays on the trigger (or the search box) and `aria-activedescendant` names the\n * option the arrow keys are on, so the options themselves are never Tab stops.\n */\n\n/**\n * The index of the next option that can be chosen, stepping from `from` in one direction without\n * wrapping. From no active option (-1), a forward step lands on the first enabled option and a\n * backward step on the last, which is also how Home and End are answered.\n * @param options - The options as rendered, in order.\n * @param from - The current active index, or -1 for none.\n * @param step - 1 to move down the list, -1 to move up.\n * @param isEnabled - Whether an option can be highlighted; disabled rows are skipped.\n * @returns The new index; `from` when nothing enabled lies that way, or -1 when `from` is out of range.\n */\nexport function stepEnabledIndex<T>(\n options: readonly T[],\n from: number,\n step: 1 | -1,\n isEnabled: (option: T) => boolean,\n): number {\n const valid = from >= 0 && from < options.length;\n let index = valid ? from : step === 1 ? -1 : options.length;\n for (index += step; index >= 0 && index < options.length; index += step) {\n if (isEnabled(options[index])) return index;\n }\n return valid ? from : -1;\n}\n\n/**\n * Scrolls the nearest scrollable ancestor just far enough to show an option. Written out rather than\n * `scrollIntoView` because that also scrolls the page, and a page scroll closes an anchored panel.\n * @param option - The option element, or null when it is not rendered.\n */\nexport function scrollOptionIntoView(option: HTMLElement | null): void {\n if (!option) return;\n let scroller = option.parentElement;\n while (scroller && scroller !== document.body && scroller.scrollHeight <= scroller.clientHeight) {\n scroller = scroller.parentElement;\n }\n if (!scroller || scroller === document.body) return;\n const box = scroller.getBoundingClientRect();\n const row = option.getBoundingClientRect();\n if (row.top < box.top) {\n scroller.scrollTop -= box.top - row.top;\n } else if (row.bottom > box.bottom) {\n scroller.scrollTop += row.bottom - box.bottom;\n }\n}\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnMultiSelectVariants = tv({\n base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm cursor-pointer',\n variants: {\n shadow: {\n true: 'shadow-lg',\n },\n size: {\n sm: 'p-2',\n md: 'p-3',\n lg: 'p-4',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n },\n fullWidth: {\n true: 'w-full',\n },\n },\n defaultVariants: {\n size: 'md',\n borderRadius: 'md',\n },\n});\n\nexport type MnMultiSelectVariants = VariantProps<typeof mnMultiSelectVariants>;\n","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 `mn-bottom-sheet${this.isDismissing ? ' is-dismissing' : ''}`\n + `${this.growWithKeyboard ? ' grow-with-keyboard' : ''}`;\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 this.releaseVelocity() > MnBottomSheet.FLICK_VELOCITY\n && this.sheetDragY > MnBottomSheet.FLICK_MIN_DISTANCE;\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 = 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 typeof window !== 'undefined'\n && typeof window.matchMedia === 'function'\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\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","import { anchoredPanelPlacement } from '../../shared/anchored-panel-placement';\nimport { scrollOptionIntoView, stepEnabledIndex } from '../../shared/listbox-navigation';\nimport {\n afterNextRender,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n ElementRef,\n HostListener,\n inject,\n InjectionToken,\n Injector,\n Input,\n OnInit,\n Renderer2,\n ViewChild\n} from '@angular/core';\nimport {NgClass, NgTemplateOutlet} from '@angular/common';\nimport {\n MnMultiSelectErrorMessageData,\n MnMultiSelectOption,\n MnMultiSelectProps,\n MnMultiSelectUIConfig\n} from './mn-multi-selectTypes';\nimport {FormsModule, NgControl, ValidationErrors, Validators} from '@angular/forms';\nimport {mnMultiSelectVariants} from './mn-multi-selectVariants';\nimport {MnErrorMessage} from '../mn-error-message/mn-error-message';\nimport {MnButton} from '../mn-button';\nimport {MnInputField} from '../mn-input-field';\nimport {MnBottomSheet} from '../mn-bottom-sheet';\nimport {MnConfigService} from \"../../config\";\nimport {MN_INSTANCE_ID, MN_SECTION_PATH} from \"../../context\";\nimport {MnLanguageService} from \"../../language\";\nimport {skip} from \"rxjs\";\nimport {LucideChevronDown, LucideX} from \"@lucide/angular\";\n\nexport const MN_MULTI_SELECT_CONFIG = new InjectionToken<MnMultiSelectUIConfig>('MN_MULTI_SELECT_CONFIG');\n\n@Component({\n selector: 'mn-lib-multi-select',\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, FormsModule, MnErrorMessage, MnButton, MnInputField, MnBottomSheet, LucideX, LucideChevronDown],\n templateUrl: './mn-multi-select.html',\n styleUrl: './mn-multi-select.css',\n})\nexport class MnMultiSelect implements OnInit {\n ngControl = inject(NgControl, {optional: true, self: true});\n\n protected uiConfig: MnMultiSelectUIConfig = {};\n\n @Input({ required: true }) props!: MnMultiSelectProps;\n\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n private readonly elRef = inject(ElementRef);\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly renderer = inject(Renderer2);\n private readonly cdr = inject(ChangeDetectorRef);\n /** Injector for the after-render scroll of the highlighted option. */\n private readonly injector = inject(Injector);\n\n /** Reference to the trigger element for positioning the dropdown */\n @ViewChild('trigger', { static: false }) triggerRef!: ElementRef<HTMLElement>;\n /** Layout classes for the anchored popover panel. The mobile sheet is rendered by\n * mn-bottom-sheet instead, so it no longer needs a branch here. */\n readonly panelClasses = 'fixed z-9999 bg-base-100 border border-base-300 rounded-md shadow-lg max-h-60 overflow-auto';\n\n /** The panel's own height cap in pixels: the `max-h-60` above, restated for the placement maths. */\n static readonly PANEL_MAX_HEIGHT_PX = 240;\n /** Layout classes for the invisible click shield rendered under the anchored panel.\n * One step below the panel's z-index so the panel itself stays clickable, and above\n * any modal/drawer chrome (which tops out well under 9998). */\n readonly shieldClasses = 'fixed inset-0 z-9998';\n /** The anchored popover panel currently moved into `document.body`, if any. */\n private movedPanel: HTMLElement | null = null;\n /** The click shield currently moved into `document.body`, if any. */\n private movedShield: HTMLElement | null = null;\n\n /** Option count at which the search input auto-enables when `searchable` is unset. */\n private static readonly DEFAULT_SEARCH_THRESHOLD = 8;\n\n /** Tailwind's `sm` breakpoint — below this the panel renders as a bottom sheet.\n * Kept in step with the same constant in `MnModalShellComponent`. */\n private static readonly SHEET_MAX_WIDTH = 639.98;\n\n /** Whether the viewport is currently narrow enough for the sheet layout. */\n private isNarrowViewport = false;\n\n /** Live breakpoint match, so rotating the device re-evaluates the layout. */\n private sheetMedia: MediaQueryList | null = null;\n\n /** The listener registered on `sheetMedia`, retained for teardown. */\n private sheetMediaListener: ((event: MediaQueryListEvent) => void) | null = null;\n\n /** `document.body`'s inline `overflow` before the sheet locked it, restored on close. */\n private previousBodyOverflow: string | null = null;\n\n /**\n * The sheet's height (px) captured the moment it opened, before any search. Re-applied\n * as a `min-height` floor so filtering the option list shorter cannot shrink the sheet\n * mid-type. Null while anchored or closed, so the popover and desktop path are untouched.\n */\n sheetFloorPx: number | null = null;\n\n /**\n * Watches the trigger while the panel is open. The panel lives in `document.body`,\n * so it survives its own trigger being hidden by an ancestor — e.g. a wizard step\n * or a tab that is switched away with `display: none` instead of being destroyed.\n * When the trigger stops being visible the panel must go with it.\n */\n private visibilityObserver: IntersectionObserver | null = null;\n\n /**\n * Capture-phase scroll listener installed while open. `window:scroll` only fires for\n * the document scroller, so scrolling an inner container (a modal body, a scrollable\n * card) used to leave the portalled panel floating at its stale coordinates.\n */\n private scrollCapture: ((event: Event) => void) | null = null;\n /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */\n private sheetHost: HTMLElement | null = null;\n\n /**\n * The dropdown panel element, queried while it is rendered by the `@if` block.\n * The setter relocates the panel to `document.body` so that its `position: fixed`\n * coordinates resolve against the viewport rather than any transformed/filtered\n * ancestor (which would otherwise become the containing block and push the panel\n * to the middle of the screen — the root cause of the mis-positioning bug, also\n * broken on iOS). Cleanup is handled when the query clears on close/destroy.\n */\n @ViewChild('dropdown', {static: false})\n set dropdownRef(ref: ElementRef<HTMLElement> | undefined) {\n this.movedPanel = this.portal(ref?.nativeElement ?? null, this.movedPanel);\n }\n\n /**\n * The click shield sitting under the anchored panel, portalled alongside it for the same\n * reason: `position: fixed` must resolve against the viewport, not a transformed ancestor.\n */\n @ViewChild('shield', {static: false})\n set shieldRef(ref: ElementRef<HTMLElement> | undefined) {\n this.movedShield = this.portal(ref?.nativeElement ?? null, this.movedShield);\n }\n\n /** Currently selected values */\n selectedValues: unknown[] = [];\n isOpen = false;\n isDisabled = false;\n searchTerm = '';\n\n /**\n * Position in `filteredOptions` of the option the keyboard is on, or -1 for none. Reset when the\n * list it indexes changes (a search) or goes away (close), so it never points at a stale row.\n */\n activeIndex = -1;\n\n /** Dropdown position calculated from trigger bounding rect */\n /** Inline placement of the anchored panel; `maxHeight` only binds when the viewport is the tighter cap. */\n dropdownStyle: { top: string; bottom: string; left: string; width: string; maxHeight: string | null } = {\n top: '0px',\n bottom: 'auto',\n left: '0px',\n width: '0px',\n maxHeight: null,\n };\n\n private onChange: (val: unknown) => void = () => {\n };\n private onTouched: () => void = () => {};\n\n private readonly builtInErrorMessages: Record<string, MnMultiSelectErrorMessageData> = {\n required: 'At least one option must be selected',\n };\n\n constructor() {\n if (this.ngControl) this.ngControl.valueAccessor = this;\n }\n\n /**\n * The bottom-sheet host, kept as a reference for outside-click tests. The sheet\n * relocates itself to `document.body`, so nothing is moved here. On open its\n * container height is captured as the sheet's `min-height` floor.\n */\n @ViewChild('sheet', {static: false, read: ElementRef})\n set sheetRef(ref: ElementRef<HTMLElement> | undefined) {\n const el = ref?.nativeElement ?? null;\n this.sheetHost = el;\n if (el) {\n this.captureSheetFloor(el);\n } else {\n this.sheetFloorPx = null;\n }\n }\n\n /**\n * Tracks the sheet breakpoint through `matchMedia` rather than reading `innerWidth`\n * once, so rotating the device switches layout instead of leaving a panel positioned\n * for the previous orientation. An open panel is closed on the switch — its anchored\n * coordinates and its sheet layout are not interchangeable.\n */\n private startWatchingViewport(): void {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n this.sheetMedia = window.matchMedia(`(max-width: ${MnMultiSelect.SHEET_MAX_WIDTH}px)`);\n this.isNarrowViewport = this.sheetMedia.matches;\n\n this.sheetMediaListener = (event: MediaQueryListEvent) => {\n this.isNarrowViewport = event.matches;\n this.close();\n // The listener fires outside Angular, so a zoneless app needs an explicit nudge.\n this.cdr.markForCheck();\n };\n this.sheetMedia.addEventListener('change', this.sheetMediaListener);\n }\n\n /** Tears down the breakpoint listener. Idempotent. */\n private stopWatchingViewport(): void {\n if (this.sheetMedia && this.sheetMediaListener) {\n this.sheetMedia.removeEventListener('change', this.sheetMediaListener);\n }\n this.sheetMedia = null;\n this.sheetMediaListener = null;\n }\n\n ngOnInit() {\n this.resolveConfig();\n this.startWatchingViewport();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveConfig();\n });\n this.destroyRef.onDestroy(() => {\n sub.unsubscribe();\n this.stopWatchingTrigger();\n this.stopWatchingViewport();\n this.unlockBodyScroll();\n // Guarantee the portalled elements never outlive the component.\n this.movedPanel = this.portal(null, this.movedPanel);\n this.movedShield = this.portal(null, this.movedShield);\n this.sheetHost = null;\n });\n }\n\n private resolveConfig() {\n const instanceId = this.explicitInstanceId || `mn-multi-select-${this.props.id}`;\n this.uiConfig = this.configService.resolve<MnMultiSelectUIConfig>(\n 'mn-multi-select',\n this.sectionPath,\n instanceId\n );\n\n if (this.props.label) {\n this.uiConfig = { ...this.uiConfig, label: this.props.label };\n }\n if (this.props.placeholder) {\n this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n }\n if (this.props.ariaLabel) {\n this.uiConfig = { ...this.uiConfig, ariaLabel: this.props.ariaLabel };\n }\n }\n\n // ========== ControlValueAccessor Implementation ==========\n\n writeValue(val: unknown): void {\n this.selectedValues = Array.isArray(val) ? val : [];\n }\n\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n // ========== Dropdown Logic ==========\n\n toggle(): void {\n if (this.isDisabled) return;\n if (this.isOpen) {\n this.close();\n return;\n }\n this.isOpen = true;\n if (this.isSheet) {\n // A sheet is anchored to the viewport, so it needs no trigger tracking — only a\n // scroll lock so the page behind it stays put while the list is scrolled.\n this.lockBodyScroll();\n return;\n }\n this.updateDropdownPosition();\n this.startWatchingTrigger();\n }\n\n /** Whether the panel should currently render as a bottom sheet. */\n get isSheet(): boolean {\n return this.props.mobileSheet !== false && this.isNarrowViewport;\n }\n\n /**\n * Whether the search input is shown: the explicit `searchable` prop when set,\n * otherwise auto-enabled once the option count reaches the threshold.\n */\n get isSearchable(): boolean {\n if (this.props.searchable !== undefined) return this.props.searchable;\n const threshold = this.props.searchThreshold ?? MnMultiSelect.DEFAULT_SEARCH_THRESHOLD;\n return this.props.options.length >= threshold;\n }\n\n /**\n * Dismisses the anchored panel from a shield click, and stops the event there.\n *\n * Swallowing it is the point: the shield spans the viewport, so the click would otherwise\n * land on whatever the panel was floating over. Inside a modal that is the modal's own\n * backdrop, and \"close the dropdown\" would double as \"throw away the modal\". A first click\n * that only dismisses the overlay is also how native selects and menus behave.\n */\n onShieldClick(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n this.close();\n }\n\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: Event): void {\n const target = event.target as Node | null;\n // The panel lives at the body root once open, so it is not a descendant of the\n // host element — treat clicks inside the portalled panel as \"inside\" too.\n const insideHost = !!target && this.elRef.nativeElement.contains(target);\n const insidePanel = !!target && !!this.movedPanel && this.movedPanel.contains(target);\n // In sheet mode the backdrop tap is handled by mn-bottom-sheet's own (dismiss); the\n // sheet host counts as \"inside\" here so this listener never double-fires the close.\n const insideSheet = !!target && !!this.sheetHost && this.sheetHost.contains(target);\n if (!insideHost && !insidePanel && !insideSheet) {\n this.close();\n }\n }\n\n /**\n * Records the sheet's opened height as its `min-height` floor. Measured on the next\n * frame so the read reflects the fully-rendered, unfiltered list (the search box is\n * empty on open) and never forces a reflow mid change-detection. The floor equals the\n * content height at that instant, so applying it triggers no resize — it only stops a\n * later, shorter filtered list from pulling the sheet down.\n *\n * `hostEl` is the portalled mn-bottom-sheet host (`display: contents`), so the height\n * is read from its `.mn-sheet-container` child rather than the host itself.\n */\n private captureSheetFloor(hostEl: HTMLElement): void {\n const measure = (): number => {\n const container = hostEl.querySelector<HTMLElement>('.mn-sheet-container');\n return container?.offsetHeight ?? hostEl.offsetHeight;\n };\n if (typeof requestAnimationFrame !== 'function') {\n this.sheetFloorPx = measure();\n return;\n }\n requestAnimationFrame(() => {\n // The sheet may have closed before the frame ran; don't strand a stale floor.\n if (!this.isOpen || this.sheetHost !== hostEl) return;\n this.sheetFloorPx = measure();\n this.cdr.markForCheck();\n });\n }\n\n /** Closes the dropdown on Escape for keyboard accessibility. */\n @HostListener('document:keydown.escape')\n onEscape(): void {\n this.close();\n }\n\n /**\n * Closes the dropdown when the page or a scrollable parent is scrolled.\n *\n * Skipped for a sheet: it is anchored to the viewport, not to the trigger, so it has\n * no stale position to escape. Crucially, opening the soft keyboard fires a `resize`\n * on Android — closing on that would dismiss the sheet the instant search is focused.\n * A genuine layout switch is handled by the `matchMedia` listener instead.\n */\n @HostListener('window:scroll', [])\n @HostListener('window:resize', [])\n onWindowScrollOrResize(): void {\n if (this.isSheet) return;\n this.close();\n }\n\n /**\n * The single close path. Every trigger (outside click, Escape, scroll, resize, the\n * trigger being hidden) funnels through here so the open-only listeners are always\n * torn down with the panel and never leak.\n */\n close(): void {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.searchTerm = '';\n this.activeIndex = -1;\n this.stopWatchingTrigger();\n this.unlockBodyScroll();\n }\n\n /**\n * Freezes the page behind an open sheet. The previous inline value is captured and\n * restored verbatim so a surrounding modal that set its own lock is left intact.\n */\n private lockBodyScroll(): void {\n if (this.previousBodyOverflow !== null) return;\n this.previousBodyOverflow = document.body.style.overflow;\n this.renderer.setStyle(document.body, 'overflow', 'hidden');\n }\n\n /** Restores the pre-lock `overflow`. Idempotent. */\n private unlockBodyScroll(): void {\n if (this.previousBodyOverflow === null) return;\n if (this.previousBodyOverflow) {\n this.renderer.setStyle(document.body, 'overflow', this.previousBodyOverflow);\n } else {\n this.renderer.removeStyle(document.body, 'overflow');\n }\n this.previousBodyOverflow = null;\n }\n\n /**\n * Calculates the fixed position for the dropdown based on the trigger element: below it\n * while the viewport has room, above it otherwise, never past the viewport's edge.\n */\n private updateDropdownPosition(): void {\n if (!this.triggerRef) return;\n const rect = this.triggerRef.nativeElement.getBoundingClientRect();\n this.dropdownStyle = {\n ...anchoredPanelPlacement(rect, window.innerHeight, 0, MnMultiSelect.PANEL_MAX_HEIGHT_PX),\n left: `${rect.left}px`,\n width: `${rect.width}px`,\n };\n }\n\n /**\n * Starts the open-only watchers: an `IntersectionObserver` on the trigger (closes the\n * panel as soon as the trigger stops being rendered/visible) and a capture-phase\n * `scroll` listener (closes it when any ancestor scroller moves under it). Scrolls\n * that originate inside the panel's own option list are ignored.\n */\n private startWatchingTrigger(): void {\n this.stopWatchingTrigger();\n\n const trigger = this.triggerRef?.nativeElement;\n if (trigger && typeof IntersectionObserver !== 'undefined') {\n this.visibilityObserver = new IntersectionObserver(entries => {\n if (!entries.some(entry => !entry.isIntersecting)) return;\n this.close();\n // The observer fires outside Angular, so a zoneless app needs an explicit nudge.\n this.cdr.markForCheck();\n });\n this.visibilityObserver.observe(trigger);\n }\n\n this.scrollCapture = (event: Event) => {\n const target = event.target as Node | null;\n if (target && this.movedPanel && (this.movedPanel === target || this.movedPanel.contains(target))) {\n return;\n }\n this.close();\n this.cdr.markForCheck();\n };\n document.addEventListener('scroll', this.scrollCapture, true);\n }\n\n /**\n * Move an overlay element to `document.body` when it appears, and detach it when the\n * query clears. Appending to the body root makes the element immune to ancestor\n * `transform`/`filter`/`will-change`, so `position: fixed` anchors to the viewport —\n * without this the panel lands mid-screen (and breaks outright on iOS).\n *\n * Returns the element now portalled, so the caller can store it. Idempotent and safe\n * to call with `null`.\n */\n private portal(el: HTMLElement | null, current: HTMLElement | null): HTMLElement | null {\n if (el) {\n if (current === el) return current;\n this.renderer.appendChild(document.body, el);\n return el;\n }\n if (current) {\n // Angular's view teardown may already have removed it; only detach if still attached.\n const parent = current.parentNode;\n if (parent) {\n this.renderer.removeChild(parent, current);\n }\n }\n return null;\n }\n\n /** Tears down the watchers installed by `startWatchingTrigger`. Idempotent. */\n private stopWatchingTrigger(): void {\n this.visibilityObserver?.disconnect();\n this.visibilityObserver = null;\n if (this.scrollCapture) {\n document.removeEventListener('scroll', this.scrollCapture, true);\n this.scrollCapture = null;\n }\n }\n\n toggleOption(option: MnMultiSelectOption): void {\n if (option.disabled) return;\n\n const index = this.selectedValues.indexOf(option.value);\n if (index > -1) {\n this.selectedValues = this.selectedValues.filter(v => v !== option.value);\n } else {\n if (this.props.maxSelections && this.selectedValues.length >= this.props.maxSelections) {\n return;\n }\n this.selectedValues = [...this.selectedValues, option.value];\n }\n this.onChange(this.selectedValues);\n }\n\n removeOption(option: MnMultiSelectOption, event: Event): void {\n event.stopPropagation();\n this.selectedValues = this.selectedValues.filter(v => v !== option.value);\n this.onChange(this.selectedValues);\n }\n\n isSelected(option: MnMultiSelectOption): boolean {\n return this.selectedValues.includes(option.value);\n }\n\n isMaxReached(option: MnMultiSelectOption): boolean {\n if (!this.props.maxSelections) return false;\n return this.selectedValues.length >= this.props.maxSelections && !this.isSelected(option);\n }\n\n /** Filters the options; the first match is highlighted so Enter toggles it, none once the box is cleared. */\n onSearch(term: string): void {\n this.searchTerm = term;\n this.activeIndex = this.searchTerm ? stepEnabledIndex(this.filteredOptions, -1, 1, this.isChoosable) : -1;\n }\n\n /**\n * Whether the keyboard may highlight an option: not disabled, and not blocked by `maxSelections`.\n * An arrow function so it can be handed to `stepEnabledIndex` as it is.\n */\n private readonly isChoosable = (option: MnMultiSelectOption): boolean =>\n !option.disabled && !this.isMaxReached(option);\n\n /** Id of the keyboard-highlighted option, for `aria-activedescendant`; null when none is. */\n get activeOptionId(): string | null {\n const inRange = this.activeIndex >= 0 && this.activeIndex < this.filteredOptions.length;\n return this.isOpen && inRange ? this.optionId(this.activeIndex) : null;\n }\n\n /**\n * The DOM id of the option rendered at a position in `filteredOptions`.\n * @param index - The option's position.\n * @returns The id, unique per multi-select.\n */\n optionId(index: number): string {\n return `${this.resolvedId}-option-${index}`;\n }\n\n /**\n * Keyboard handling for the trigger and the search box, the WAI-ARIA combobox pattern. While\n * closed, ArrowDown, ArrowUp, Enter and Space open the list with an option highlighted. While\n * open, the arrows move the highlight past disabled options without wrapping, Home and End jump\n * to the ends, Enter (and Space outside the search box) toggles the highlighted option and keeps the list open for the next one, Escape closes and Tab closes and lets focus move on. Enter and Space\n * stop here, so they can never submit a surrounding form or close a surrounding modal.\n * @param event - The keydown.\n * @param fromSearch - True when it came from the search box, where Space, Home and End edit text.\n */\n onKeydown(event: KeyboardEvent, fromSearch = false): void {\n if (this.isDisabled) return;\n // Keys on a chip's remove button bubble up through the trigger; they are that button's own.\n if (!fromSearch && event.target !== event.currentTarget) return;\n\n if (!this.isOpen) {\n if (fromSearch || !['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(event.key)) return;\n this.claim(event);\n this.toggle();\n this.moveActive(-1, event.key === 'ArrowUp' ? -1 : 1);\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n this.claim(event);\n this.moveActive(this.activeIndex, event.key === 'ArrowDown' ? 1 : -1);\n return;\n case 'Home':\n case 'End':\n if (fromSearch) return;\n this.claim(event);\n this.moveActive(-1, event.key === 'Home' ? 1 : -1);\n return;\n case ' ':\n if (fromSearch) return;\n this.toggleActive(event);\n return;\n case 'Enter':\n this.toggleActive(event);\n return;\n case 'Escape':\n this.claim(event);\n this.close();\n this.focusTrigger();\n return;\n case 'Tab':\n // Focus moves on from the trigger, so the search box's Tab order position never matters.\n this.close();\n this.focusTrigger();\n return;\n }\n }\n\n /**\n * Moves the highlight one enabled option from `from` and scrolls it into view.\n * @param from - Where to step from; -1 to start at an end.\n * @param step - 1 for down, -1 for up.\n */\n private moveActive(from: number, step: 1 | -1): void {\n this.activeIndex = stepEnabledIndex(this.filteredOptions, from, step, this.isChoosable);\n this.revealActiveOption();\n }\n\n /**\n * Toggles the highlighted option. The list stays open, as it does for a click, so several options\n * can be picked in a row.\n * @param event - The Enter or Space keydown, claimed so a form around the field is not submitted.\n */\n private toggleActive(event: KeyboardEvent): void {\n this.claim(event);\n const option = this.filteredOptions[this.activeIndex];\n if (option && this.isChoosable(option)) {\n this.toggleOption(option);\n }\n }\n\n /**\n * Takes a key for the field: no default action (no scroll, no form submit) and no bubbling to a\n * surrounding modal's own Enter or Escape handling.\n * @param event - The keydown to claim.\n */\n private claim(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n }\n\n /** Scrolls the highlighted option into view once the render that paints its ring has run. */\n private revealActiveOption(): void {\n afterNextRender(() => {\n const id = this.activeOptionId;\n scrollOptionIntoView(id ? document.getElementById(id) : null);\n }, {injector: this.injector});\n }\n\n /** Puts focus back on the trigger. */\n private focusTrigger(): void {\n this.triggerRef?.nativeElement.focus();\n }\n\n get filteredOptions(): MnMultiSelectOption[] {\n if (!this.searchTerm) return this.props.options;\n const lower = this.searchTerm.toLowerCase();\n return this.props.options.filter(o => o.label.toLowerCase().includes(lower));\n }\n\n get selectedOptions(): MnMultiSelectOption[] {\n return this.props.options.filter(o => this.selectedValues.includes(o.value));\n }\n\n // ========== Collapse Summary ==========\n\n /**\n * Whether the collapse-to-summary feature is opted into. Active when any of\n * `collapsePlaceholder`, `collapseThreshold` or `allSelectedPlaceholder` is\n * supplied; existing usages with none of them are unaffected.\n */\n get collapseEnabled(): boolean {\n return (\n this.props.collapsePlaceholder !== undefined ||\n this.props.collapseThreshold !== undefined ||\n this.props.allSelectedPlaceholder !== undefined\n );\n }\n\n /**\n * Whether every available option is currently selected. False for an empty select, where\n * \"all of them\" would be a claim about nothing.\n */\n get allSelected(): boolean {\n return this.props.options.length > 0 && this.selectedOptions.length === this.props.options.length;\n }\n\n /**\n * The threshold above which the trigger collapses. Defaults to 5 when collapsing\n * is enabled via `collapsePlaceholder` alone (no explicit `collapseThreshold`).\n */\n get effectiveCollapseThreshold(): number {\n return this.props.collapseThreshold ?? 5;\n }\n\n /**\n * Whether the trigger should currently render a summary instead of the individual\n * chips: when the number of selected options exceeds the effective threshold, or\n * when every option is selected and a summary for that case was supplied.\n */\n get isCollapsed(): boolean {\n if (!this.collapseEnabled) return false;\n // \"Everything is selected\" is worth saying at any count, so it collapses on its own rather\n // than waiting for the threshold a small option list would never reach.\n if (this.allSelected && this.props.allSelectedPlaceholder !== undefined) return true;\n return this.selectedOptions.length > this.effectiveCollapseThreshold;\n }\n\n /**\n * The summary text shown while collapsed, with the `{count}` token replaced by\n * the number of selected options. `allSelectedPlaceholder` wins while everything\n * is selected, then `collapsePlaceholder`, then `\"{count} selected\"`.\n */\n get collapseSummaryText(): string {\n const allSelectedTemplate = this.allSelected ? this.props.allSelectedPlaceholder : undefined;\n const template =\n allSelectedTemplate ??\n this.props.collapsePlaceholder ??\n this.resolveLabel(undefined, 'mnMultiSelect.selectedCount', '{count} selected');\n return template.replace(/\\{count}/g, String(this.selectedOptions.length));\n }\n\n /** Trigger text shown while nothing is selected. */\n get placeholderLabel(): string {\n return this.resolveLabel(\n this.props.placeholder,\n 'mnMultiSelect.placeholder',\n 'Select...',\n this.uiConfig.placeholder,\n );\n }\n\n /**\n * Placeholder and accessible name of the dropdown's search input.\n *\n * Search auto-enables at `searchThreshold` options, so this box appears without any\n * call site opting in — which is exactly why it must be translatable without one.\n */\n get searchPlaceholderLabel(): string {\n return this.resolveLabel(\n this.props.searchPlaceholder,\n 'mnMultiSelect.search',\n 'Search...',\n this.uiConfig.searchPlaceholder,\n );\n }\n\n /** Empty text shown when the search filters every option away. */\n get noOptionsLabel(): string {\n return this.resolveLabel(\n undefined,\n 'mnMultiSelect.noOptions',\n 'No options found',\n this.uiConfig.noOptionsFound,\n );\n }\n\n /**\n * Resolves one of the component's own labels, preferring what the caller gave it\n * and falling back through the config layer, a conventional translation key and\n * finally a readable English default.\n *\n * Mirrors `MnCollectionBase.resolveLabel`. Every string this component puts on\n * screen that is not caller data goes through here: without the key step a\n * consumer could only translate these by repeating the same literal at every call\n * site, which is how \"Search...\" ends up in English on an otherwise Dutch page.\n *\n * @param explicit The label the caller passed through `props`, if any.\n * @param key The conventional translation key to try next.\n * @param fallback The English text used when neither resolves.\n * @param configured The value the config layer resolved, if any.\n * @returns The resolved label.\n */\n private resolveLabel(\n explicit: string | undefined,\n key: string,\n fallback: string,\n configured?: string,\n ): string {\n return explicit ?? configured ?? this.lang.translateIfPresent(key) ?? fallback;\n }\n\n handleBlur(): void {\n this.onTouched();\n }\n\n // ========== Error Handling ==========\n\n get control() {\n return this.ngControl?.control ?? null;\n }\n\n get showError(): boolean {\n const c = this.control;\n return !!c && c.invalid && (c.touched || c.dirty);\n }\n\n private pickErrorKey(errors: ValidationErrors): string {\n if (this.props.errorPriority) {\n for (const key of this.props.errorPriority) {\n if (errors[key] !== undefined) {\n return key;\n }\n }\n }\n return Object.keys(errors)[0];\n }\n\n protected isRequired(): boolean {\n if (!this.control) return false;\n return this.control.hasValidator(Validators.required);\n }\n\n private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n const errorArgs = errors[errorKey];\n const customMsg = this.props.errorMessages?.[errorKey];\n const configMsg = this.uiConfig.errorMessages?.[errorKey];\n const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n const fallbackMsg = this.props.defaultErrorMessage;\n const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n if (typeof msgDef === 'function') {\n return msgDef(errorArgs, errors);\n }\n // Interpolate {{placeholder}} tokens with validation error args\n if (errorArgs && typeof errorArgs === 'object') {\n return msgDef.replace(/\\{\\{(\\w+)}}/g, (_, key) => errorArgs[key] ?? _);\n }\n return msgDef;\n }\n\n get errorMessages(): string[] {\n const errors = this.control?.errors;\n if (!errors) return [];\n return Object.keys(errors).map(key => this.resolveErrorMessageForKey(key, errors));\n }\n\n get errorMessage(): string | null {\n const errors = this.control?.errors;\n if (!errors) return null;\n const errorKey = this.pickErrorKey(errors);\n return this.resolveErrorMessageForKey(errorKey, errors);\n }\n\n // ========== Resolved Properties ==========\n\n get resolvedId(): string {\n return this.props.id;\n }\n\n get resolvedName(): string | null {\n return this.props?.name ?? null;\n }\n\n get triggerClasses(): string {\n return mnMultiSelectVariants({\n size: this.props.size,\n borderRadius: this.props.borderRadius,\n shadow: this.props.shadow,\n fullWidth: this.props.fullWidth,\n });\n }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n @if (uiConfig.label || props.label) {\n <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n <p>{{ uiConfig.label || props.label }}</p>\n @if (isRequired()) {\n <span class=\"text-error\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n <!-- Trigger -->\n <div\n #trigger\n [id]=\"resolvedId\"\n [ngClass]=\"triggerClasses\"\n class=\"relative\"\n [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || props.label || null\"\n [attr.aria-invalid]=\"showError || null\"\n [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? resolvedId + '-listbox' : null\"\n role=\"combobox\"\n [attr.aria-required]=\"isRequired() || null\"\n tabindex=\"0\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n (blur)=\"handleBlur()\"\n >\n <!-- `pr-6` reserves the gutter the caret is absolutely positioned in (right-2 +\n w-4), so a value can never render underneath it. `min-w-0` lets the chips\n shrink below their content width, which is what makes truncation possible. -->\n <div class=\"flex flex-row items-center gap-x-2 flex-wrap min-h-6 min-w-0 pr-6\">\n @if (selectedOptions.length === 0) {\n <span class=\"text-base-content/50\">{{ placeholderLabel }}</span>\n } @else if (isCollapsed) {\n <span\n class=\"inline-flex items-center max-w-full truncate bg-base-200 border border-accent text-base-content text-xs px-2 py-0.5 rounded-md\">\n {{ collapseSummaryText }}\n </span>\n } @else {\n @for (opt of selectedOptions; track opt.value) {\n <!-- Only the × removes. The chip body deliberately carries no handler, so a click\n anywhere on it bubbles to the trigger and just opens/closes the panel — clicking\n the trigger to dismiss the dropdown must never silently delete a selection. -->\n <span\n class=\"inline-flex items-center gap-x-1 max-w-full min-w-0 bg-base-200 border border-accent text-base-content text-xs pl-2 py-0.5 rounded-md\">\n <span [attr.title]=\"opt.label\" class=\"truncate\">{{ opt.label }}</span>\n <button\n mnButton\n [data]=\"{ size: 'sm', variant: 'text', color: 'secondary', hover: false }\"\n type=\"button\"\n class=\"text-base-content/50 cursor-pointer shrink-0\"\n (click)=\"removeOption(opt, $event)\"\n [attr.aria-label]=\"'Remove ' + opt.label\"\n ><svg lucideX [size]=\"18\"></svg></button>\n </span>\n }\n }\n </div>\n <div class=\"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none\">\n <svg [size]=\"16\" class=\"text-base-content/50\" lucideChevronDown></svg>\n </div>\n </div>\n\n <!-- Dropdown -->\n @if (isOpen) {\n @if (isSheet) {\n <!-- On mobile the panel is presented as a shared bottom sheet: the sheet chrome\n (backdrop, grabber, swipe/flick-to-dismiss, slide animation) lives in\n mn-bottom-sheet; this component only projects the field's content into it.\n The sheet host is portalled to document.body (see the `sheet` ViewChild) so\n its `position: fixed` anchors to the viewport, not a transformed ancestor. -->\n <mn-bottom-sheet\n #sheet\n (dismiss)=\"close()\"\n [ariaLabel]=\"uiConfig.ariaLabel || uiConfig.label || props.label || uiConfig.placeholder || props.placeholder\"\n [maxHeightVh]=\"80\"\n [minHeightPx]=\"sheetFloorPx\"\n >\n <div\n [id]=\"resolvedId + '-listbox'\"\n aria-multiselectable=\"true\"\n class=\"flex flex-col flex-1 min-h-0 overflow-hidden\"\n role=\"listbox\"\n >\n <!-- The sheet covers its own trigger, so it carries a header to name the field; the\n way out is the grabber (swipe-to-dismiss) and a backdrop tap. -->\n <div class=\"px-4 pt-1 pb-2 shrink-0\">\n <p class=\"text-base font-medium text-base-content truncate\">\n {{ uiConfig.label || props.label || uiConfig.placeholder || props.placeholder || '' }}\n </p>\n </div>\n <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n </div>\n </mn-bottom-sheet>\n } @else {\n <!-- A transparent full-viewport shield behind the panel, so \"click anywhere to\n dismiss\" is literally true. It also *consumes* that click: without it the click\n reaches whatever sits underneath — inside a modal that is the modal's own\n backdrop, so dismissing the dropdown would tear down the whole modal with it.\n Portalled to document.body for the same reason the panel is. It is aria-hidden\n and unfocusable: the keyboard equivalent of this click is Escape. -->\n <div\n #shield\n (click)=\"onShieldClick($event)\"\n [id]=\"resolvedId + '-shield'\"\n [ngClass]=\"shieldClasses\"\n aria-hidden=\"true\"\n ></div>\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n #dropdown\n (click)=\"$event.stopPropagation()\"\n [id]=\"resolvedId + '-listbox'\"\n [ngClass]=\"panelClasses\"\n [style.left]=\"dropdownStyle.left\"\n [style.top]=\"dropdownStyle.top\"\n [style.bottom]=\"dropdownStyle.bottom\"\n [style.max-height]=\"dropdownStyle.maxHeight\"\n [style.width]=\"dropdownStyle.width\"\n aria-multiselectable=\"true\"\n role=\"listbox\"\n >\n <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n </div>\n }\n }\n\n <!-- The search box + option list, shared verbatim by the sheet and the anchored\n popover. `isSheet` only tunes spacing/sizing and which element scrolls: in sheet\n mode the list is the flex scroller; anchored, the popover itself scrolls. -->\n <ng-template #panelBody>\n @if (isSearchable) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onKeydown($event, true)\"\n [ngClass]=\"isSheet ? 'px-4 py-2' : 'p-2'\"\n class=\"border-b border-base-300 shrink-0\"\n >\n <mn-lib-input-field\n (ngModelChange)=\"onSearch($event)\"\n [ngModelOptions]=\"{ standalone: true }\"\n [ngModel]=\"searchTerm\"\n [props]=\"{\n id: resolvedId + '-search',\n type: 'search',\n placeholder: searchPlaceholderLabel,\n ariaLabel: searchPlaceholderLabel,\n ariaActiveDescendant: activeOptionId,\n fullWidth: true,\n size: 'sm'\n }\"\n ></mn-lib-input-field>\n </div>\n }\n <div [ngClass]=\"isSheet ? 'flex-1 overflow-auto overscroll-contain' : ''\">\n @for (opt of filteredOptions; track opt.value) {\n <!-- Options are not Tab stops: the keyboard reaches them with the arrow keys while focus\n stays on the trigger or the search box, and `aria-activedescendant` names the one it\n is on. The ring marks that option, since it never receives real focus. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n (click)=\"toggleOption(opt); $event.stopPropagation()\"\n [attr.aria-disabled]=\"opt.disabled || isMaxReached(opt) || null\"\n [attr.aria-selected]=\"isSelected(opt)\"\n [class.opacity-50]=\"opt.disabled || isMaxReached(opt)\"\n [class.pointer-events-none]=\"opt.disabled || isMaxReached(opt)\"\n [id]=\"optionId($index)\"\n [ngClass]=\"[isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm', $index === activeIndex ? 'ring-2 ring-inset ring-primary' : '']\"\n class=\"flex items-center gap-x-2 cursor-pointer text-base-content hover:bg-base-200\"\n role=\"option\"\n >\n <input\n [checked]=\"isSelected(opt)\"\n [disabled]=\"opt.disabled || isMaxReached(opt)\"\n class=\"w-4 h-4 accent-primary pointer-events-none shrink-0\"\n tabindex=\"-1\"\n type=\"checkbox\"\n />\n <span>{{ opt.label }}</span>\n </div>\n }\n @if (filteredOptions.length === 0) {\n <div [ngClass]=\"isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm'\" class=\"text-base-content/50\">\n {{ noOptionsLabel }}\n </div>\n }\n </div>\n </ng-template>\n\n @if (showError) {\n @if (props.showAllErrors) {\n <div class=\"flex flex-col gap-y-1 mt-1\">\n @for (error of errorMessages; track $index) {\n <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n }\n </div>\n } @else {\n @if (errorMessage !== null) {\n <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n }\n }\n }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\n/**\n * Layout variants for the trigger button. An icon-only trigger (the default ⋯) is a\n * square affordance; a trigger with a text label grows to fit its content with\n * horizontal padding instead. The `labeled` axis switches between the two.\n */\nexport const mnDropdownTriggerVariants = tv({\n base: 'inline-flex items-center justify-center gap-x-1.5 text-base-content/80 cursor-pointer',\n variants: {\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n labeled: {\n true: '',\n false: '',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n full: 'rounded-full',\n },\n },\n compoundVariants: [\n // Icon-only: a fixed square box.\n { labeled: false, size: 'sm', class: 'h-7 w-7' },\n { labeled: false, size: 'md', class: 'h-9 w-9' },\n { labeled: false, size: 'lg', class: 'h-11 w-11' },\n // Labeled: content width with padding.\n { labeled: true, size: 'sm', class: 'px-2.5 py-1 text-sm' },\n { labeled: true, size: 'md', class: 'px-3 py-1.5 text-sm' },\n { labeled: true, size: 'lg', class: 'px-4 py-2 text-base' },\n ],\n defaultVariants: {\n size: 'md',\n labeled: false,\n borderRadius: 'md',\n },\n});\n\nexport type MnDropdownTriggerVariants = VariantProps<typeof mnDropdownTriggerVariants>;\n","import { anchoredPanelPlacement } from '../../shared/anchored-panel-placement';\nimport {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n ElementRef,\n HostListener,\n inject,\n InjectionToken,\n Input,\n OnInit,\n Renderer2,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport {\n LucideCheck,\n LucideChevronDown,\n LucideDynamicIcon,\n LucideEllipsisVertical,\n LucideIconData,\n LucideSearchX,\n} from '@lucide/angular';\nimport { skip } from 'rxjs';\nimport { MnButton, MnButtonTypes } from '../mn-button';\nimport { MnBottomSheet } from '../mn-bottom-sheet';\nimport { MnInputField } from '../mn-input-field';\nimport { MnConfigService } from '../../config';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from '../../context';\nimport { MnLanguageService } from '../../language';\nimport { MnDropdownAction, MnDropdownActionColor, MnDropdownItem, MnDropdownProps, MnDropdownSeparator, MnDropdownUIConfig } from './mn-dropdownTypes';\nimport { mnDropdownTriggerVariants } from './mn-dropdownVariants';\n\nexport const MN_DROPDOWN_CONFIG = new InjectionToken<MnDropdownUIConfig>('MN_DROPDOWN_CONFIG');\n\n/** Counter backing the auto-generated {@link MnDropdownProps.id} when a caller omits one. */\nlet nextDropdownId = 0;\n\n/** Foreground class per action colour token, matching mn-button's text variants. */\nconst ACTION_COLOR_CLASS: Record<MnDropdownActionColor, string> = {\n primary: 'text-primary',\n secondary: 'text-secondary',\n danger: 'text-error',\n warning: 'text-warning',\n success: 'text-success',\n accent: 'text-accent',\n gray: 'text-base-content/70',\n};\n\n/**\n * A ⋯ command menu. The trigger opens a `role=\"menu\"` list of {@link MnDropdownAction}s\n * that each fire and dismiss on choice — a *command* menu, not a value picker, so it is\n * intentionally not a ControlValueAccessor.\n *\n * Presentation mirrors mn-multi-select: an anchored popover on desktop and the shared\n * {@link MnBottomSheet} on mobile (< 640px). Both the popover and the sheet host are\n * portalled to `document.body` so their `position: fixed` anchors to the viewport rather\n * than any transformed/filtered ancestor (a table cell, a card) — the same root-cause fix\n * the multi-select applies.\n */\n@Component({\n selector: 'mn-lib-dropdown',\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, FormsModule, MnButton, MnBottomSheet, MnInputField, LucideSearchX, LucideDynamicIcon],\n templateUrl: './mn-dropdown.html',\n styleUrl: './mn-dropdown.css',\n})\nexport class MnDropdown implements OnInit {\n @Input({ required: true }) datasource!: MnDropdownProps;\n\n protected uiConfig: MnDropdownUIConfig = {};\n\n /** Lucide data for the trailing check shown on the {@link MnDropdownAction.active} row. */\n protected readonly checkIcon = LucideCheck.icon;\n\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n private readonly elRef = inject(ElementRef);\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly renderer = inject(Renderer2);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /** Reference to the trigger element for positioning the popover. Read as an\n * `ElementRef` because `button[mnButton]` is a component — the default query would\n * otherwise return the MnButton instance, which has no `nativeElement`. */\n @ViewChild('trigger', { static: false, read: ElementRef }) triggerRef!: ElementRef<HTMLElement>;\n\n /**\n * Layout classes for the anchored popover panel. Searchable menus become a flex column\n * so the search box can be pinned (`shrink-0`) above a single scrolling list region —\n * paired with {@link panelFloorPx}, that keeps the popover a fixed height while the\n * filter runs, instead of the panel resizing on every keystroke. The mobile sheet is\n * rendered by mn-bottom-sheet instead, so it needs no branch here.\n */\n get panelClasses(): string {\n const base =\n 'fixed z-9999 min-w-48 max-w-[min(20rem,90vw)] bg-base-100 border border-base-300 rounded-md shadow-lg py-1 max-h-[60vh] -translate-x-full';\n return this.isSearchable ? `${base} flex flex-col overflow-hidden` : `${base} overflow-auto`;\n }\n\n /** Tailwind's `sm` breakpoint — below this the menu renders as a bottom sheet.\n * Kept in step with the same constant in mn-bottom-sheet / mn-multi-select. */\n private static readonly SHEET_MAX_WIDTH = 639.98;\n\n /** The anchored popover panel currently moved into `document.body`, if any. */\n private movedPanel: HTMLElement | null = null;\n /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */\n private sheetHost: HTMLElement | null = null;\n\n /** Whether the viewport is currently narrow enough for the sheet layout. */\n private isNarrowViewport = false;\n /** Live breakpoint match, so rotating the device re-evaluates the layout. */\n private sheetMedia: MediaQueryList | null = null;\n /** The listener registered on `sheetMedia`, retained for teardown. */\n private sheetMediaListener: ((event: MediaQueryListEvent) => void) | null = null;\n\n /** `document.body`'s inline `overflow` before the sheet locked it, restored on close. */\n private previousBodyOverflow: string | null = null;\n\n /**\n * The anchored popover's opened height, locked so a shorter filtered list cannot resize\n * it mid-type. Captured on the frame after the panel appears (with the full, unfiltered\n * list), so applying it is jump-free — it only stops a later shrink. Null while closed\n * or when the menu is not searchable, leaving the plain content-height popover untouched.\n */\n panelFloorPx: number | null = null;\n\n /**\n * The anchored popover's opened width, locked for the same reason as {@link panelFloorPx}:\n * the panel is content-sized between its `min-w`/`max-w` bounds, so a filtered list that\n * drops the widest item would otherwise shrink the popover mid-type. Captured on the same\n * next-frame pass as the height, so applying it is jump-free. Null while closed or when the\n * menu is not searchable, leaving the plain content-width popover untouched.\n */\n panelWidthPx: number | null = null;\n\n /**\n * The mobile sheet's opened height, applied as a `min-height` floor for the same reason\n * as {@link panelFloorPx} — mirroring mn-multi-select's sheet floor. Null while anchored,\n * closed, or non-searchable.\n */\n sheetFloorPx: number | null = null;\n\n /** Watches the trigger while open, so the panel closes if the trigger is hidden. */\n private visibilityObserver: IntersectionObserver | null = null;\n /** Capture-phase scroll listener installed while open, closing on any ancestor scroll. */\n private scrollCapture: ((event: Event) => void) | null = null;\n\n isOpen = false;\n\n /** Stable fallback id, used when {@link MnDropdownProps.id} is omitted. Generated once per\n * instance so the a11y wiring (menu id, `aria-controls`, the search input) stays valid. */\n private readonly autoId = `mn-dropdown-${++nextDropdownId}`;\n\n /** Current text in the search input, cleared on close. Only meaningful when the menu\n * is {@link MnDropdownProps.searchable}. */\n searchTerm = '';\n\n /** Popover position computed from the trigger's bounding rect. */\n /** Inline placement of the anchored panel; `maxHeight` only binds when the viewport is the tighter cap. */\n dropdownStyle: { top: string; bottom: string; left: string; maxHeight: string | null } = {\n top: '0px',\n bottom: 'auto',\n left: '0px',\n maxHeight: null,\n };\n\n /**\n * The popover panel, relocated to `document.body` on appearance (see mn-multi-select's\n * portal rationale) and detached when the query clears on close/destroy.\n */\n @ViewChild('dropdown', { static: false })\n set dropdownRef(ref: ElementRef<HTMLElement> | undefined) {\n const el = ref?.nativeElement ?? null;\n this.movedPanel = this.portal(el, this.movedPanel);\n if (el && this.isSearchable) {\n this.capturePanelFloor(el);\n } else if (!el) {\n this.panelFloorPx = null;\n this.panelWidthPx = null;\n }\n }\n\n /**\n * The bottom-sheet host, relocated to `document.body` so its `position: fixed`\n * children anchor to the viewport rather than a transformed ancestor.\n */\n @ViewChild('sheet', { static: false, read: ElementRef })\n set sheetRef(ref: ElementRef<HTMLElement> | undefined) {\n const el = ref?.nativeElement ?? null;\n this.sheetHost = el;\n if (el && this.isSearchable) {\n this.captureSheetFloor(el);\n } else if (!el) {\n this.sheetFloorPx = null;\n }\n }\n\n ngOnInit(): void {\n this.resolveConfig();\n this.startWatchingViewport();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveConfig();\n this.cdr.markForCheck();\n });\n this.destroyRef.onDestroy(() => {\n sub.unsubscribe();\n this.stopWatchingTrigger();\n this.stopWatchingViewport();\n this.unlockBodyScroll();\n // Guarantee the portalled elements never outlive the component.\n this.movedPanel = this.portal(null, this.movedPanel);\n this.sheetHost = null;\n });\n }\n\n private resolveConfig(): void {\n const instanceId = this.explicitInstanceId || `mn-dropdown-${this.resolvedId}`;\n this.uiConfig = this.configService.resolve<MnDropdownUIConfig>(\n 'mn-dropdown',\n this.sectionPath,\n instanceId,\n );\n }\n\n // ── Breakpoint watching ──\n\n private startWatchingViewport(): void {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n this.sheetMedia = window.matchMedia(`(max-width: ${MnDropdown.SHEET_MAX_WIDTH}px)`);\n this.isNarrowViewport = this.sheetMedia.matches;\n\n this.sheetMediaListener = (event: MediaQueryListEvent) => {\n this.isNarrowViewport = event.matches;\n this.close();\n // The listener fires outside Angular, so a zoneless app needs an explicit nudge.\n this.cdr.markForCheck();\n };\n this.sheetMedia.addEventListener('change', this.sheetMediaListener);\n }\n\n private stopWatchingViewport(): void {\n if (this.sheetMedia && this.sheetMediaListener) {\n this.sheetMedia.removeEventListener('change', this.sheetMediaListener);\n }\n this.sheetMedia = null;\n this.sheetMediaListener = null;\n }\n\n // ── Open / close ──\n\n toggle(): void {\n if (this.isOpen) {\n this.close();\n return;\n }\n if (this.datasource.actions.length === 0) return;\n this.isOpen = true;\n if (this.isSheet) {\n // A sheet is anchored to the viewport, so it needs no trigger tracking — only a\n // scroll lock so the page behind it stays put.\n this.lockBodyScroll();\n return;\n }\n this.updateDropdownPosition();\n this.startWatchingTrigger();\n }\n\n /** The single close path, so every open-only listener is torn down with the panel. */\n close(): void {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.searchTerm = '';\n this.panelFloorPx = null;\n this.panelWidthPx = null;\n this.sheetFloorPx = null;\n this.stopWatchingTrigger();\n this.unlockBodyScroll();\n }\n\n /** Whether the menu should currently render as a bottom sheet. */\n get isSheet(): boolean {\n return this.datasource.mobileSheet !== false && this.isNarrowViewport;\n }\n\n /** Fires an action and closes. Ignores disabled items defensively. */\n select(action: MnDropdownAction): void {\n if (action.disabled) return;\n this.close();\n action.run();\n }\n\n // ── Search ──\n\n /** Whether the filter input is shown — the explicit `searchable` prop, off by default. */\n get isSearchable(): boolean {\n return this.datasource.searchable === true;\n }\n\n /**\n * Records the current filter text as the search input changes. The input's\n * ControlValueAccessor emits `null` for an empty field (its text adapter maps `''` to\n * `null`), so coerce to `''` — otherwise clearing or backspacing the box would leave\n * `searchTerm` null and {@link filteredActions}'s `.trim()` would throw, freezing the menu.\n */\n onSearch(term: string | null): void {\n this.searchTerm = term ?? '';\n }\n\n /**\n * The actions currently passing the filter, in their declared order. Every action when\n * the menu is not searchable or the box is empty; otherwise those whose resolved label\n * or {@link MnDropdownAction.keywords} contain the (case-insensitive) query.\n */\n get filteredActions(): MnDropdownItem[] {\n const term = (this.searchTerm ?? '').trim().toLowerCase();\n if (!this.isSearchable || !term) return this.datasource.actions;\n // While filtering, separators are dropped — a divider stranded between or after hidden\n // results is meaningless — so match only real actions.\n return this.datasource.actions.filter(item => {\n if (this.isSeparator(item)) return false;\n const haystack = `${this.actionLabel(item)} ${item.keywords ?? ''}`.toLowerCase();\n return haystack.includes(term);\n });\n }\n\n /**\n * Runs the first still-visible, enabled action — the Enter key's target, matching a\n * help search where Enter opens the top hit. Skips separators. No-op when nothing matches.\n */\n selectFirstVisible(): void {\n const first = this.filteredActions.find(\n (item): item is MnDropdownAction => !this.isSeparator(item) && !item.disabled,\n );\n if (first) this.select(first);\n }\n\n // ── Positioning ──\n\n private updateDropdownPosition(): void {\n if (!this.triggerRef) return;\n const rect = this.triggerRef.nativeElement.getBoundingClientRect();\n // The panel is right-aligned to the trigger via a `-translate-x-full` class, so\n // `left` is anchored to the trigger's right edge.\n // Below the trigger while the viewport has room, above it otherwise, never past the edge;\n // the cap it competes with is the panel's own 60vh.\n this.dropdownStyle = {\n ...anchoredPanelPlacement(rect, window.innerHeight, 4, window.innerHeight * 0.6),\n left: `${rect.right}px`,\n };\n }\n\n private startWatchingTrigger(): void {\n this.stopWatchingTrigger();\n\n const trigger = this.triggerRef?.nativeElement;\n if (trigger && typeof IntersectionObserver !== 'undefined') {\n this.visibilityObserver = new IntersectionObserver(entries => {\n if (!entries.some(entry => !entry.isIntersecting)) return;\n this.close();\n this.cdr.markForCheck();\n });\n this.visibilityObserver.observe(trigger);\n }\n\n this.scrollCapture = (event: Event) => {\n const target = event.target as Node | null;\n if (target && this.movedPanel && (this.movedPanel === target || this.movedPanel.contains(target))) {\n return;\n }\n this.close();\n this.cdr.markForCheck();\n };\n document.addEventListener('scroll', this.scrollCapture, true);\n }\n\n private stopWatchingTrigger(): void {\n this.visibilityObserver?.disconnect();\n this.visibilityObserver = null;\n if (this.scrollCapture) {\n document.removeEventListener('scroll', this.scrollCapture, true);\n this.scrollCapture = null;\n }\n }\n\n // ── Global dismissal ──\n\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: Event): void {\n const target = event.target as Node | null;\n const insideHost = !!target && this.elRef.nativeElement.contains(target);\n const insidePanel = !!target && !!this.movedPanel && this.movedPanel.contains(target);\n const insideSheet = !!target && !!this.sheetHost && this.sheetHost.contains(target);\n if (!insideHost && !insidePanel && !insideSheet) {\n this.close();\n }\n }\n\n @HostListener('document:keydown.escape')\n onEscape(): void {\n if (!this.isOpen) return;\n this.close();\n // Return focus to the trigger so keyboard users are not stranded.\n this.triggerRef?.nativeElement.focus();\n }\n\n @HostListener('window:scroll', [])\n @HostListener('window:resize', [])\n onWindowScrollOrResize(): void {\n // A sheet is viewport-anchored, so it has no stale position to escape; closing it on\n // the `resize` a soft keyboard fires would also be wrong. The matchMedia listener\n // handles a genuine layout switch instead.\n if (this.isSheet) return;\n this.close();\n }\n\n // ── Body scroll lock (sheet only) ──\n\n private lockBodyScroll(): void {\n if (this.previousBodyOverflow !== null) return;\n this.previousBodyOverflow = document.body.style.overflow;\n this.renderer.setStyle(document.body, 'overflow', 'hidden');\n }\n\n private unlockBodyScroll(): void {\n if (this.previousBodyOverflow === null) return;\n if (this.previousBodyOverflow) {\n this.renderer.setStyle(document.body, 'overflow', this.previousBodyOverflow);\n } else {\n this.renderer.removeStyle(document.body, 'overflow');\n }\n this.previousBodyOverflow = null;\n }\n\n // ── Height floors (searchable only) ──\n\n /**\n * Records the anchored popover's opened height and width, locking them via\n * {@link panelFloorPx} / {@link panelWidthPx}. Measured on the next frame so the read\n * reflects the fully-rendered, unfiltered list (the search box is empty on open) and never\n * forces a reflow mid change-detection. Both values equal the current dimensions, so\n * applying them is jump-free — they only stop a later, shorter/narrower filtered list from\n * shrinking the panel.\n */\n private capturePanelFloor(panelEl: HTMLElement): void {\n if (typeof requestAnimationFrame !== 'function') {\n this.panelFloorPx = panelEl.offsetHeight;\n this.panelWidthPx = panelEl.offsetWidth;\n return;\n }\n requestAnimationFrame(() => {\n // The panel may have closed (or the query cleared) before the frame ran.\n if (!this.isOpen || this.movedPanel !== panelEl) return;\n this.panelFloorPx = panelEl.offsetHeight;\n this.panelWidthPx = panelEl.offsetWidth;\n this.cdr.markForCheck();\n });\n }\n\n /**\n * Records the sheet's opened height as its `min-height` floor, on the same next-frame\n * basis as {@link capturePanelFloor}. `hostEl` is the portalled mn-bottom-sheet host\n * (`display: contents`), so the height is read from its `.mn-sheet-container` child.\n */\n private captureSheetFloor(hostEl: HTMLElement): void {\n const measure = (): number => {\n const container = hostEl.querySelector<HTMLElement>('.mn-sheet-container');\n return container?.offsetHeight ?? hostEl.offsetHeight;\n };\n if (typeof requestAnimationFrame !== 'function') {\n this.sheetFloorPx = measure();\n return;\n }\n requestAnimationFrame(() => {\n if (!this.isOpen || this.sheetHost !== hostEl) return;\n this.sheetFloorPx = measure();\n this.cdr.markForCheck();\n });\n }\n\n // ── Portal helper (see mn-multi-select for the full rationale) ──\n\n private portal(el: HTMLElement | null, current: HTMLElement | null): HTMLElement | null {\n if (el) {\n if (current === el) return current;\n this.renderer.appendChild(document.body, el);\n return el;\n }\n if (current) {\n const parent = current.parentNode;\n if (parent) {\n this.renderer.removeChild(parent, current);\n }\n }\n return null;\n }\n\n // ── Resolved presentation ──\n\n /** The label shown for an action, preferring a resolved translation key. */\n actionLabel(action: MnDropdownAction): string {\n const translated = action.labelKey ? this.lang.translateIfPresent(action.labelKey) : undefined;\n return translated ?? action.label ?? '';\n }\n\n /**\n * Whether an icon was supplied as a `TemplateRef` rather than lucide icon data, which\n * decides how the template renders it. Kept as a method (not a pipe) so the narrowing\n * is available inline in the item loop.\n * @param value The icon to test.\n * @returns True when the icon is a template the caller owns.\n */\n isTemplateRef(value: unknown): value is TemplateRef<unknown> {\n return value instanceof TemplateRef;\n }\n\n /** Whether a list entry is a {@link MnDropdownSeparator} rather than a command. */\n isSeparator(item: MnDropdownItem): item is MnDropdownSeparator {\n return (item as MnDropdownSeparator).separator;\n }\n\n /**\n * Narrows a list entry to a command, or null for a separator. Used as `@if (asAction(item);\n * as action)` in the template so the item loop gets a reliably-typed {@link MnDropdownAction}\n * without depending on template narrowing of the {@link isSeparator} guard.\n * @param item The list entry to narrow.\n * @returns The command, or null when the entry is a separator.\n */\n asAction(item: MnDropdownItem): MnDropdownAction | null {\n return this.isSeparator(item) ? null : item;\n }\n\n /**\n * Foreground class for an item: an explicit {@link MnDropdownAction.color}, else the\n * destructive red for a {@link MnDropdownAction.danger} item, else the default text.\n */\n actionColorClass(action: MnDropdownAction): string {\n if (action.color) return ACTION_COLOR_CLASS[action.color];\n if (action.danger) return ACTION_COLOR_CLASS.danger;\n return 'text-base-content';\n }\n\n /** Accessible name for the ⋯ trigger button. */\n get triggerAriaLabel(): string {\n const translated = this.datasource.ariaLabelKey ? this.lang.translateIfPresent(this.datasource.ariaLabelKey) : undefined;\n return translated ?? this.datasource.ariaLabel ?? this.uiConfig.ariaLabel ?? 'Actions';\n }\n\n /** The visible text on the trigger, or null for an icon-only ⋯ trigger. */\n get triggerLabelText(): string | null {\n const translated = this.datasource.triggerLabelKey ? this.lang.translateIfPresent(this.datasource.triggerLabelKey) : undefined;\n return translated ?? this.datasource.triggerLabel ?? null;\n }\n\n /**\n * The trigger's glyph, normalised to a single representation so the template renders it\n * one way — the same template-or-lucide-data path the menu items use — with no per-preset\n * switch. Resolves, in order: an explicit `'none'` (no glyph); a caller's custom template\n * or lucide data ({@link MnActionIcon}); otherwise a built-in preset mapped to its own\n * lucide data (a labelled trigger defaults to the chevron, an icon-only one to the dots).\n * @returns A template glyph, an icon-data glyph with its render size, or null for none.\n */\n private resolveTriggerGlyph():\n | { template: TemplateRef<unknown> }\n | { data: LucideIconData; size: number; dim: boolean }\n | null {\n const icon = this.datasource.triggerIcon;\n if (icon === 'none') return null;\n if (icon instanceof TemplateRef) return { template: icon };\n if (icon != null && typeof icon !== 'string') return { data: icon, size: 18, dim: false };\n const preset = typeof icon === 'string' ? icon : this.triggerLabelText ? 'chevron' : 'dots-vertical';\n // The chevron is a touch smaller and dimmed, matching a select's trailing affordance.\n return preset === 'chevron'\n ? { data: LucideChevronDown.icon, size: 16, dim: true }\n : { data: LucideEllipsisVertical.icon, size: 18, dim: false };\n }\n\n /** The trigger glyph when it is a caller's template, else null. Split from\n * {@link triggerIconData} so the template narrows without a discriminated union. */\n get triggerIconTemplate(): TemplateRef<unknown> | null {\n const glyph = this.resolveTriggerGlyph();\n return glyph && 'template' in glyph ? glyph.template : null;\n }\n\n /** The trigger glyph when it is lucide data (a preset or caller data), with its render\n * size and dim flag, else null. */\n get triggerIconData(): { data: LucideIconData; size: number; dim: boolean } | null {\n const glyph = this.resolveTriggerGlyph();\n return glyph && 'data' in glyph ? glyph : null;\n }\n\n /** Heading shown above the menu/sheet, or null when none is configured. */\n get menuLabel(): string | null {\n const translated = this.datasource.menuLabelKey ? this.lang.translateIfPresent(this.datasource.menuLabelKey) : undefined;\n return translated ?? this.datasource.menuLabel ?? this.uiConfig.menuLabel ?? null;\n }\n\n /** Placeholder shown in the search input, preferring a resolved translation key. */\n get searchPlaceholder(): string {\n const translated = this.datasource.searchPlaceholderKey ? this.lang.translateIfPresent(this.datasource.searchPlaceholderKey) : undefined;\n return translated ?? this.datasource.searchPlaceholder ?? this.uiConfig.searchPlaceholder ?? 'Search...';\n }\n\n /** Text shown in place of the list when the filter matches no actions. */\n get searchEmptyLabel(): string {\n const translated = this.datasource.searchEmptyLabelKey ? this.lang.translateIfPresent(this.datasource.searchEmptyLabelKey) : undefined;\n return translated ?? this.datasource.searchEmptyLabel ?? this.uiConfig.searchEmptyLabel ?? 'No results';\n }\n\n /** The ghost look the trigger has always used; a bare or partial `triggerButton` merges\n * over this, so opting in without overriding anything keeps the current appearance. */\n private static readonly DEFAULT_TRIGGER_BUTTON: Partial<MnButtonTypes> = {\n size: 'sm',\n variant: 'text',\n color: 'gray',\n };\n\n /** mn-button config for the trigger: the ghost default, overlaid with any\n * {@link MnDropdownProps.triggerButton} the caller supplied. */\n get triggerData(): Partial<MnButtonTypes> {\n return { ...MnDropdown.DEFAULT_TRIGGER_BUTTON, ...this.datasource.triggerButton };\n }\n\n get triggerClasses(): string {\n // Button mode: mn-button owns the entire look (fill/outline/size/radius/shape). The\n // trigger's square-box variants would fight that — `h-7 w-7` overrides its padding,\n // `text-base-content/80` its text colour — so keep only the label↔icon gap, which\n // mn-button's base does not provide.\n if (this.datasource.triggerButton) return 'gap-x-1.5';\n // A caller's template can be any size (an avatar, a badge) and sizes the trigger itself,\n // so skip the preset square-box — otherwise its `h-7 w-7` would clip the content, which\n // is why custom triggers used to need a `triggerButton` just to undo it. (A lucide-data\n // glyph is preset-sized, so it keeps the box for a consistent tap target.)\n if (this.datasource.triggerIcon instanceof TemplateRef) return 'gap-x-1.5';\n return mnDropdownTriggerVariants({\n size: this.datasource.size,\n borderRadius: this.datasource.borderRadius,\n labeled: !!this.triggerLabelText,\n });\n }\n\n get resolvedId(): string {\n return this.datasource.id ?? this.autoId;\n }\n}\n","<div class=\"relative inline-flex\">\n <!-- Trigger -->\n <button\n #trigger\n mnButton\n type=\"button\"\n [id]=\"resolvedId\"\n [data]=\"triggerData\"\n [ngClass]=\"triggerClasses\"\n [attr.aria-label]=\"triggerLabelText ? null : triggerAriaLabel\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? resolvedId + '-menu' : null\"\n (click)=\"toggle()\"\n >\n @if (triggerLabelText) {\n <span class=\"truncate\">{{ triggerLabelText }}</span>\n }\n <!-- One glyph, rendered like a menu item's icon: a caller's template, else lucide data\n (a preset resolves to its own data). No per-preset switch. -->\n @if (triggerIconTemplate; as tpl) {\n <span class=\"shrink-0 inline-flex items-center\">\n <ng-container [ngTemplateOutlet]=\"tpl\"></ng-container>\n </span>\n } @else if (triggerIconData; as glyph) {\n <span class=\"shrink-0 inline-flex items-center\">\n <svg [lucideIcon]=\"glyph.data\" [size]=\"glyph.size\" [class.opacity-70]=\"glyph.dim\"></svg>\n </span>\n }\n </button>\n\n <!-- Menu -->\n @if (isOpen) {\n @if (isSheet) {\n <!-- On mobile the menu is presented as the shared bottom sheet: chrome (backdrop,\n grabber, swipe-to-dismiss, slide animation) lives in mn-bottom-sheet; this\n component only projects the item list into it. The host is portalled to\n document.body (see the `sheet` ViewChild). -->\n <mn-bottom-sheet\n #sheet\n (dismiss)=\"close()\"\n [ariaLabel]=\"menuLabel || triggerAriaLabel\"\n [maxHeightVh]=\"80\"\n [minHeightPx]=\"sheetFloorPx\"\n >\n <div [id]=\"resolvedId + '-menu'\" role=\"menu\" class=\"flex flex-col flex-1 min-h-0 overflow-hidden\">\n <!-- The sheet covers its own trigger, so it carries a header to name itself; the\n way out is the grabber (swipe-to-dismiss) and a backdrop tap. -->\n <div class=\"px-4 pt-1 pb-2 shrink-0\">\n <p class=\"text-base font-bold text-base-content truncate\">{{ menuLabel || triggerAriaLabel }}</p>\n </div>\n <ng-container [ngTemplateOutlet]=\"searchBox\" [ngTemplateOutletContext]=\"{ sheet: true }\"></ng-container>\n <div class=\"flex-1 flex flex-col overflow-auto overscroll-contain\">\n <ng-container [ngTemplateOutlet]=\"items\" [ngTemplateOutletContext]=\"{ sheet: true }\"></ng-container>\n </div>\n </div>\n </mn-bottom-sheet>\n } @else {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n #dropdown\n (click)=\"$event.stopPropagation()\"\n [id]=\"resolvedId + '-menu'\"\n [ngClass]=\"panelClasses\"\n [style.left]=\"dropdownStyle.left\"\n [style.top]=\"dropdownStyle.top\"\n [style.bottom]=\"dropdownStyle.bottom\"\n [style.max-height]=\"dropdownStyle.maxHeight\"\n [style.height.px]=\"panelFloorPx\"\n [style.width.px]=\"panelWidthPx\"\n role=\"menu\"\n >\n @if (menuLabel) {\n <p class=\"px-3 pt-1 pb-1.5 text-xs font-medium text-base-content/50 truncate shrink-0\">{{ menuLabel }}</p>\n }\n <ng-container [ngTemplateOutlet]=\"searchBox\" [ngTemplateOutletContext]=\"{ sheet: false }\"></ng-container>\n @if (isSearchable) {\n <!-- Its own scroll region so the pinned search box above stays fixed and the\n locked panel height (panelFloorPx) doesn't change as the list filters. The\n flex column lets the empty state fill and centre in the reserved space. -->\n <div class=\"flex-1 min-h-0 flex flex-col overflow-auto\">\n <ng-container [ngTemplateOutlet]=\"items\" [ngTemplateOutletContext]=\"{ sheet: false }\"></ng-container>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"items\" [ngTemplateOutletContext]=\"{ sheet: false }\"></ng-container>\n }\n </div>\n }\n }\n\n <!-- The item list, shared verbatim by the sheet and the anchored popover. `sheet`\n only tunes the spacing so touch targets are roomier on mobile. -->\n <ng-template #items let-sheet=\"sheet\">\n @for (item of filteredActions; track $index) {\n @if (asAction(item); as action) {\n <button\n type=\"button\"\n role=\"menuitem\"\n [disabled]=\"action.disabled\"\n [attr.aria-current]=\"action.active ? 'true' : null\"\n [class.opacity-50]=\"action.disabled\"\n [class.pointer-events-none]=\"action.disabled\"\n [ngClass]=\"[actionColorClass(action), sheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm', action.active ? 'bg-primary/10 font-medium' : '']\"\n class=\"flex w-full shrink-0 items-center gap-x-2.5 text-left cursor-pointer hover:bg-base-200 focus-visible:bg-base-200 focus:outline-none transition-colors\"\n (click)=\"select(action)\"\n >\n @if (action.icon) {\n <span class=\"shrink-0 inline-flex items-center\">\n @if (isTemplateRef(action.icon)) {\n <ng-container [ngTemplateOutlet]=\"action.icon\"></ng-container>\n } @else {\n <!-- Data icon: rendered here so the item sizes it to match its own text\n (larger in the sheet, where the rows are touch-sized). -->\n <svg [lucideIcon]=\"$any(action.icon)\" [size]=\"sheet ? 18 : 16\"></svg>\n }\n </span>\n }\n <span class=\"truncate min-w-0\">{{ actionLabel(action) }}</span>\n <!-- The current choice's marker (e.g. the active language). Decorative: the\n state is conveyed to assistive tech by `aria-current` on the row. -->\n @if (action.active) {\n <svg\n [lucideIcon]=\"checkIcon\"\n [size]=\"sheet ? 18 : 16\"\n class=\"ml-auto shrink-0 text-primary\"\n aria-hidden=\"true\"\n ></svg>\n }\n </button>\n } @else {\n <hr role=\"separator\" [ngClass]=\"sheet ? 'mx-4 my-1.5' : 'mx-2 my-1'\" class=\"shrink-0 border-t border-base-300\" />\n }\n }\n @if (isSearchable && filteredActions.length === 0) {\n <div class=\"flex-1 flex flex-col items-center justify-center gap-2 px-4 py-6 text-center text-base-content/50\">\n <svg lucideSearchX [size]=\"sheet ? 28 : 24\" class=\"opacity-60\"></svg>\n <span [ngClass]=\"sheet ? 'text-base' : 'text-sm'\">{{ searchEmptyLabel }}</span>\n </div>\n }\n </ng-template>\n\n <!-- The filter input, shared by the sheet and the anchored popover. Autofocused on\n desktop (`!sheet`) so typing starts immediately; deliberately not on mobile, where\n it would pop the soft keyboard and fight the viewport-anchored sheet. Enter runs\n the first visible action via the wrapper's bubbled keydown. -->\n <ng-template #searchBox let-sheet=\"sheet\">\n @if (isSearchable) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n (click)=\"$event.stopPropagation()\"\n (keydown.enter)=\"selectFirstVisible()\"\n [ngClass]=\"sheet ? 'px-4 py-2' : 'p-2'\"\n class=\"border-b border-base-300 shrink-0\"\n >\n <mn-lib-input-field\n (ngModelChange)=\"onSearch($event)\"\n [ngModelOptions]=\"{ standalone: true }\"\n [ngModel]=\"searchTerm\"\n [props]=\"{\n id: resolvedId + '-search',\n type: 'search',\n placeholder: searchPlaceholder,\n ariaLabel: searchPlaceholder,\n fullWidth: true,\n size: 'sm',\n autoFocus: !sheet\n }\"\n ></mn-lib-input-field>\n </div>\n }\n </ng-template>\n</div>\n","import {Component, EventEmitter, HostBinding, Input, Output} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {MnBottomSheet} from '../mn-bottom-sheet';\nimport {MnKeyboardLabels, MnKeyboardLayout, MnKeyboardPresentation} from './mn-keyboard.types';\n\n/** QWERTY letter rows, lower-case. Rendered upper-case when {@link MnKeyboard.uppercase} is set. */\nconst ALPHA_ROWS: readonly string[][] = [\n ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],\n ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],\n ['z', 'x', 'c', 'v', 'b', 'n', 'm'],\n];\n\n/** The digit row that sits above the letters on an alphanumeric keyboard. */\nconst DIGIT_ROW: readonly string[] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];\n\n/** Phone-style pad rows for the numeric layout. */\nconst NUMERIC_ROWS: readonly string[][] = [\n ['1', '2', '3'],\n ['4', '5', '6'],\n ['7', '8', '9'],\n ['0'],\n];\n\n/**\n * An on-screen keyboard for touch devices that have no keyboard of their own.\n *\n * It exists for unattended screens — a tablet on a wall, a kiosk by a door — where\n * the OS keyboard is either unavailable or unwanted, and where the same field may\n * need to take a membership number *or* a name. Hence one component with a\n * {@link layout} switch rather than a separate number pad and text pad.\n *\n * It is a controlled component: it never owns the text. The host passes {@link value}\n * and reacts to {@link valueChange}, exactly like a form control, so the same value\n * can also be filled by a barcode scanner or a real keyboard without this component\n * fighting it.\n *\n * With {@link presentation} set to `sheet` it mounts inside an {@link MnBottomSheet},\n * rising from the bottom of the screen and swipeable away — the shape a kiosk wants\n * so the keys do not permanently occupy half the display.\n *\n * The library ships no user-facing English, so every named key takes its caption\n * from {@link labels}.\n */\n@Component({\n selector: 'mn-keyboard',\n standalone: true,\n imports: [MnBottomSheet, NgTemplateOutlet],\n templateUrl: './mn-keyboard.component.html',\n styleUrl: './mn-keyboard.component.css',\n})\nexport class MnKeyboard {\n /** The current text. This component never mutates it — see {@link valueChange}. */\n @Input() value = '';\n /** Which keys to render. */\n @Input() layout: MnKeyboardLayout = 'alphanumeric';\n /** Whether the keys sit in the page or rise from the bottom as a sheet. */\n @Input() presentation: MnKeyboardPresentation = 'inline';\n /**\n * Captions and accessible names for the named keys.\n *\n * The defaults are language-neutral glyphs rather than words, so a consumer that\n * forgets to translate still ships no English (or Dutch) from the library. The\n * accessible name for the keyboard as a whole has no neutral glyph, so it\n * defaults to empty and the attribute is simply omitted until a host supplies one.\n */\n @Input() labels: MnKeyboardLabels = {\n backspace: '⌫',\n clear: '⨯',\n space: '␣',\n submit: '⏎',\n keyboard: '',\n };\n /** Whether letters are rendered (and typed) upper-case. */\n @Input() uppercase = false;\n /** Whether to offer a space key. Off for a field that can never contain one. */\n @Input() allowSpace = true;\n /** Whether to offer a submit key. */\n @Input() showSubmit = true;\n /** Whether the submit key is currently actionable. */\n @Input() submitDisabled = false;\n /** Hard cap on the text length, or null for none. */\n @Input() maxLength: number | null = null;\n /** Cap on the sheet height as a fraction of the viewport, in vh (sheet presentation only). */\n @Input() sheetMaxHeightVh = 60;\n\n /** Emits the full text after every key press, so the host can drive its own field. */\n @Output() valueChange = new EventEmitter<string>();\n /** Emits when the submit key is pressed. */\n @Output() submitted = new EventEmitter<string>();\n /** Emits when a sheet-presented keyboard is swiped or tapped away. */\n @Output() dismissed = new EventEmitter<void>();\n\n @HostBinding('class') get hostClasses(): string {\n return `mn-keyboard mn-keyboard-${this.layout}`;\n }\n\n /** The character rows to render, driven by {@link layout}. */\n get rows(): readonly string[][] {\n if (this.layout === 'numeric') {\n return NUMERIC_ROWS;\n }\n const letters = this.uppercase\n ? ALPHA_ROWS.map((row) => row.map((key) => key.toUpperCase()))\n : ALPHA_ROWS;\n return this.layout === 'alpha' ? letters : [[...DIGIT_ROW], ...letters];\n }\n\n /** Whether the space key should be offered (never on a digits-only pad). */\n get spaceVisible(): boolean {\n return this.allowSpace && this.layout !== 'numeric';\n }\n\n /**\n * Appends a character, respecting {@link maxLength}.\n * @param key The character pressed.\n */\n press(key: string): void {\n this.emit(this.value + key);\n }\n\n /** Appends a space. */\n pressSpace(): void {\n this.emit(this.value + ' ');\n }\n\n /** Removes the last character. */\n backspace(): void {\n this.emit(this.value.slice(0, -1));\n }\n\n /** Empties the field. */\n clear(): void {\n this.emit('');\n }\n\n /** Reports a submit press. The host decides what submitting means. */\n submit(): void {\n if (this.submitDisabled) {\n return;\n }\n this.submitted.emit(this.value);\n }\n\n /** Reports that a sheet-presented keyboard was dismissed. */\n onDismiss(): void {\n this.dismissed.emit();\n }\n\n /**\n * Emits a new value, clamped to {@link maxLength}.\n *\n * Clamping happens here rather than in each key handler so a paste-like burst\n * from a scanner and a tapped key are bounded the same way.\n * @param next The candidate text.\n */\n private emit(next: string): void {\n const clamped =\n this.maxLength !== null && next.length > this.maxLength\n ? next.slice(0, this.maxLength)\n : next;\n if (clamped === this.value) {\n return;\n }\n this.value = clamped;\n this.valueChange.emit(clamped);\n }\n}\n","<!-- The key block. Rendered directly for `inline`, or projected into the sheet below. -->\n<ng-template #keys>\n <div [attr.aria-label]=\"labels.keyboard || null\" class=\"mn-keyboard-keys flex flex-col gap-2 p-3\" role=\"group\">\n @for (row of rows; track $index) {\n <div class=\"flex justify-center gap-2\">\n @for (key of row; track key) {\n <button\n (click)=\"press(key)\"\n class=\"mn-keyboard-key flex-1 rounded-lg border border-base-300 bg-base-100 py-4 text-xl font-semibold text-base-content shadow-sm transition-colors hover:bg-base-200 active:bg-base-300\"\n type=\"button\"\n >\n {{ key }}\n </button>\n }\n </div>\n }\n\n <div class=\"flex justify-center gap-2\">\n <button\n (click)=\"backspace()\"\n [attr.aria-label]=\"labels.backspace\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.backspace }}\n </button>\n\n @if (spaceVisible) {\n <button\n (click)=\"pressSpace()\"\n [attr.aria-label]=\"labels.space\"\n class=\"mn-keyboard-key mn-keyboard-key-space flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n style=\"flex-grow: 3\"\n type=\"button\"\n >\n {{ labels.space }}\n </button>\n }\n\n <button\n (click)=\"clear()\"\n [attr.aria-label]=\"labels.clear\"\n class=\"mn-keyboard-key mn-keyboard-key-action flex-1 rounded-lg border border-base-300 bg-base-200 py-4 text-base font-medium text-base-content shadow-sm transition-colors hover:bg-base-300\"\n type=\"button\"\n >\n {{ labels.clear }}\n </button>\n\n @if (showSubmit) {\n <button\n (click)=\"submit()\"\n [attr.aria-label]=\"labels.submit\"\n [disabled]=\"submitDisabled\"\n class=\"mn-keyboard-key mn-keyboard-key-submit flex-1 rounded-lg bg-primary py-4 text-base font-semibold text-primary-content shadow-sm transition-colors hover:opacity-90 disabled:opacity-50\"\n style=\"flex-grow: 2\"\n type=\"button\"\n >\n {{ labels.submit }}\n </button>\n }\n </div>\n </div>\n</ng-template>\n\n@if (presentation === 'sheet') {\n <mn-bottom-sheet\n (dismiss)=\"onDismiss()\"\n [ariaLabel]=\"labels.keyboard || undefined\"\n [maxHeightVh]=\"sheetMaxHeightVh\"\n >\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n </mn-bottom-sheet>\n} @else {\n <ng-container [ngTemplateOutlet]=\"keys\"></ng-container>\n}\n","import {tv, type VariantProps} from 'tailwind-variants';\n\nexport const mnSelectVariants = tv({\n base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm cursor-pointer hover:bg-base-200 transition-colors duration-300',\n variants: {\n shadow: {\n true: 'shadow-lg',\n },\n size: {\n sm: 'p-2',\n md: 'p-3',\n lg: 'p-4',\n },\n borderRadius: {\n none: 'rounded-none',\n xs: 'rounded-xs',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n two_xl: 'rounded-2xl',\n three_xl: 'rounded-3xl',\n four_xl: 'rounded-4xl',\n },\n fullWidth: {\n true: 'w-full',\n },\n },\n defaultVariants: {\n size: 'md',\n borderRadius: 'md',\n },\n});\n\nexport type MnSelectVariants = VariantProps<typeof mnSelectVariants>;\n","import { anchoredPanelPlacement } from '../../shared/anchored-panel-placement';\nimport { scrollOptionIntoView, stepEnabledIndex } from '../../shared/listbox-navigation';\nimport {\n afterNextRender,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n ElementRef,\n HostListener,\n inject,\n InjectionToken,\n Injector,\n Input,\n OnInit,\n Renderer2,\n ViewChild\n} from '@angular/core';\nimport {NgClass, NgTemplateOutlet} from '@angular/common';\nimport {MnSelectErrorMessageData, MnSelectOption, MnSelectProps, MnSelectUIConfig} from './mn-selectTypes';\nimport {FormsModule, NgControl, ValidationErrors, Validators} from '@angular/forms';\nimport {mnSelectVariants} from './mn-selectVariants';\nimport {MnErrorMessage} from '../mn-error-message/mn-error-message';\nimport {MnInputField} from '../mn-input-field';\nimport {MnBottomSheet} from '../mn-bottom-sheet';\nimport {MnConfigService} from \"../../config\";\nimport {MN_INSTANCE_ID, MN_SECTION_PATH} from \"../../context\";\nimport {MnLanguageService} from \"../../language\";\nimport {skip} from \"rxjs\";\nimport {LucideCheck, LucideChevronDown, LucideDynamicIcon} from \"@lucide/angular\";\n\nexport const MN_SELECT_CONFIG = new InjectionToken<MnSelectUIConfig>('MN_SELECT_CONFIG');\n\n/** The keys that open a closed select from its trigger. */\nconst OPEN_KEYS = ['ArrowDown', 'ArrowUp', 'Enter', ' '];\n\n/**\n * Whether the keyboard may highlight an option.\n * @param option - The option.\n * @returns False for a disabled option.\n */\nfunction isChoosable(option: MnSelectOption): boolean {\n return !option.disabled;\n}\n\n/**\n * Takes a key for the select: no default action (no scroll, no form submit) and no bubbling to a\n * surrounding modal's own Enter or Escape handling.\n * @param event - The keydown to claim.\n */\nfunction claim(event: KeyboardEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\n/**\n * A single-value picker. The trigger opens a `role=\"listbox\"` of {@link MnSelectOption}s;\n * choosing one sets the value and closes — this is the value-picker twin of the ⋯\n * command menu mn-dropdown, so it *is* a ControlValueAccessor.\n *\n * Presentation mirrors mn-multi-select: one custom field trigger at every size, an\n * anchored popover on desktop and the shared {@link MnBottomSheet} on mobile (< 640px) —\n * the same sheet mn-dropdown itself wraps. Both the popover and the sheet host are\n * portalled to `document.body` so their `position: fixed` anchors to the viewport rather\n * than any transformed/filtered ancestor (a table cell, a card) — the same root-cause fix\n * the multi-select applies.\n */\n@Component({\n selector: 'mn-lib-select',\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, FormsModule, MnErrorMessage, MnInputField, MnBottomSheet, LucideDynamicIcon, LucideChevronDown],\n templateUrl: './mn-select.html',\n host: {\n // Without an explicit host width the inline host collapses to its content size, so\n // the trigger's `w-full` (width:100%) resolves against a content-sized box and fails\n // to fill the parent. Give the host a real width when fullWidth is requested.\n '[style.display]': \"props?.fullWidth ? 'block' : null\",\n '[style.width]': \"props?.fullWidth ? '100%' : null\",\n },\n})\nexport class MnSelect implements OnInit {\n ngControl = inject(NgControl, {optional: true, self: true});\n\n @Input({required: true}) props!: MnSelectProps;\n\n /** Currently selected value */\n selectedValue: unknown = null;\n isOpen = false;\n isDisabled = false;\n searchTerm = '';\n\n /**\n * Position in `filteredOptions` of the option the keyboard is on, or -1 for none. Reset when the\n * list it indexes changes (a search) or goes away (close), so it never points at a stale row.\n */\n activeIndex = -1;\n\n protected uiConfig: MnSelectUIConfig = {};\n\n private readonly configService = inject(MnConfigService);\n private readonly sectionPath = inject(MN_SECTION_PATH, {optional: true}) ?? [];\n private readonly explicitInstanceId = inject(MN_INSTANCE_ID, {optional: true});\n private readonly elRef = inject(ElementRef);\n private readonly lang = inject(MnLanguageService);\n private readonly destroyRef = inject(DestroyRef);\n private readonly renderer = inject(Renderer2);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly injector = inject(Injector);\n\n /** Lucide data for the trailing check shown on the selected row. */\n protected readonly checkIcon = LucideCheck.icon;\n\n /** Reference to the trigger element for positioning the dropdown. */\n @ViewChild('trigger', {static: false}) triggerRef!: ElementRef<HTMLElement>;\n\n /** Layout classes for the anchored popover panel. The mobile sheet is rendered by\n * mn-bottom-sheet instead, so it no longer needs a branch here. */\n readonly panelClasses = 'fixed z-9999 bg-base-100 border border-base-300 rounded-md shadow-lg max-h-60 overflow-auto';\n\n /** The panel's own height cap in pixels: the `max-h-60` above, restated for the placement maths. */\n static readonly PANEL_MAX_HEIGHT_PX = 240;\n /** Layout classes for the invisible click shield rendered under the anchored panel.\n * One step below the panel's z-index so the panel itself stays clickable, and above\n * any modal/drawer chrome (which tops out well under 9998). */\n readonly shieldClasses = 'fixed inset-0 z-9998';\n\n /** Option count at which the search input auto-enables when `searchable` is unset. */\n private static readonly DEFAULT_SEARCH_THRESHOLD = 8;\n\n /** Tailwind's `sm` breakpoint — below this the panel renders as a bottom sheet.\n * Kept in step with the same constant in mn-bottom-sheet / mn-multi-select. */\n private static readonly SHEET_MAX_WIDTH = 639.98;\n\n /** The anchored popover panel currently moved into `document.body`, if any. */\n private movedPanel: HTMLElement | null = null;\n /** The click shield currently moved into `document.body`, if any. */\n private movedShield: HTMLElement | null = null;\n /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */\n private sheetHost: HTMLElement | null = null;\n\n /** Whether the viewport is currently narrow enough for the sheet layout. */\n private isNarrowViewport = false;\n /** Live breakpoint match, so rotating the device re-evaluates the layout. */\n private sheetMedia: MediaQueryList | null = null;\n /** The listener registered on `sheetMedia`, retained for teardown. */\n private sheetMediaListener: ((event: MediaQueryListEvent) => void) | null = null;\n\n /** `document.body`'s inline `overflow` before the sheet locked it, restored on close. */\n private previousBodyOverflow: string | null = null;\n\n /**\n * The sheet's height (px) captured the moment it opened, before any search. Re-applied\n * as a `min-height` floor so filtering the option list shorter cannot shrink the sheet\n * mid-type. Null while anchored or closed, so the popover and desktop path are untouched.\n */\n sheetFloorPx: number | null = null;\n\n /**\n * Watches the trigger while the panel is open. The panel lives in `document.body`, so it\n * survives its own trigger being hidden by an ancestor — a wizard step or a tab switched\n * away with `display: none`. When the trigger stops being visible the panel goes with it.\n */\n private visibilityObserver: IntersectionObserver | null = null;\n\n /**\n * Capture-phase scroll listener installed while open. `window:scroll` only fires for the\n * document scroller, so scrolling an inner container (a modal body, a scrollable card)\n * would otherwise leave the portalled panel floating at its stale coordinates.\n */\n private scrollCapture: ((event: Event) => void) | null = null;\n\n /** Dropdown position calculated from the trigger's bounding rect. */\n /** Inline placement of the anchored panel; `maxHeight` only binds when the viewport is the tighter cap. */\n dropdownStyle: { top: string; bottom: string; left: string; width: string; maxHeight: string | null } = {\n top: '0px',\n bottom: 'auto',\n left: '0px',\n width: '0px',\n maxHeight: null,\n };\n\n private onChange: (val: unknown) => void = () => {\n };\n private onTouched: () => void = () => {\n };\n\n private readonly builtInErrorMessages: Record<string, MnSelectErrorMessageData> = {\n required: 'Please select an option',\n };\n\n constructor() {\n if (this.ngControl) this.ngControl.valueAccessor = this;\n }\n\n /**\n * The dropdown panel element, queried while it is rendered by the `@if` block. The setter\n * relocates the panel to `document.body` so that its `position: fixed` coordinates resolve\n * against the viewport rather than any transformed/filtered ancestor (which would otherwise\n * become the containing block and push the panel to the middle of the screen — also broken\n * on iOS). Cleanup is handled when the query clears on close/destroy.\n */\n @ViewChild('dropdown', {static: false})\n set dropdownRef(ref: ElementRef<HTMLElement> | undefined) {\n this.movedPanel = this.portal(ref?.nativeElement ?? null, this.movedPanel);\n }\n\n /**\n * The click shield sitting under the anchored panel, portalled alongside it for the same\n * reason: `position: fixed` must resolve against the viewport, not a transformed ancestor.\n */\n @ViewChild('shield', {static: false})\n set shieldRef(ref: ElementRef<HTMLElement> | undefined) {\n this.movedShield = this.portal(ref?.nativeElement ?? null, this.movedShield);\n }\n\n /**\n * The bottom-sheet host, kept as a reference for outside-click tests. The sheet relocates\n * itself to `document.body`, so nothing is moved here. On open its container height is\n * captured as the sheet's `min-height` floor.\n */\n @ViewChild('sheet', {static: false, read: ElementRef})\n set sheetRef(ref: ElementRef<HTMLElement> | undefined) {\n const el = ref?.nativeElement ?? null;\n this.sheetHost = el;\n if (el) {\n this.captureSheetFloor(el);\n } else {\n this.sheetFloorPx = null;\n }\n }\n\n get control() {\n return this.ngControl?.control ?? null;\n }\n\n get selectedOption(): MnSelectOption | undefined {\n return this.props.options.find(o => o.value === this.selectedValue);\n }\n\n /** The label shown in the trigger: the selected option, else the placeholder. */\n get displayText(): string {\n return this.selectedOption?.label ?? this.placeholderLabel;\n }\n\n /** Trigger text shown while no option is selected. */\n get placeholderLabel(): string {\n return this.resolveLabel(\n this.props.placeholder,\n 'mnSelect.placeholder',\n 'Select...',\n this.uiConfig.placeholder,\n );\n }\n\n /** Placeholder and accessible name of the dropdown's search input. */\n get searchPlaceholderLabel(): string {\n return this.resolveLabel(\n this.props.searchPlaceholder,\n 'mnSelect.search',\n 'Search...',\n this.uiConfig.searchPlaceholder,\n );\n }\n\n /** Empty text shown when the search filters every option away. */\n get noOptionsLabel(): string {\n return this.resolveLabel(\n undefined,\n 'mnSelect.noOptions',\n 'No options found',\n this.uiConfig.noOptionsFound,\n );\n }\n\n /**\n * Resolves one of the component's own labels, preferring what the caller gave it\n * and falling back through the config layer, a conventional translation key and\n * finally a readable English default.\n *\n * Mirrors `MnCollectionBase.resolveLabel` and its twin in `MnMultiSelect`. Without\n * the key step a consumer could only translate these by repeating the same literal\n * at every call site, and the search box in particular auto-enables on option\n * count — it appears without anyone asking for it, so it must be translatable\n * without anyone asking either.\n *\n * @param explicit The label the caller passed through `props`, if any.\n * @param key The conventional translation key to try next.\n * @param fallback The English text used when neither resolves.\n * @param configured The value the config layer resolved, if any.\n * @returns The resolved label.\n */\n private resolveLabel(\n explicit: string | undefined,\n key: string,\n fallback: string,\n configured?: string,\n ): string {\n return explicit ?? configured ?? this.lang.translateIfPresent(key) ?? fallback;\n }\n\n get showError(): boolean {\n const c = this.control;\n return !!c && c.invalid && (c.touched || c.dirty);\n }\n\n get errorMessages(): string[] {\n const errors = this.control?.errors;\n if (!errors) return [];\n return Object.keys(errors).map(key => this.resolveErrorMessageForKey(key, errors));\n }\n\n get errorMessage(): string | null {\n const errors = this.control?.errors;\n if (!errors) return null;\n const errorKey = this.pickErrorKey(errors);\n return this.resolveErrorMessageForKey(errorKey, errors);\n }\n\n get resolvedId(): string {\n return this.props.id;\n }\n\n get resolvedName(): string | null {\n return this.props?.name ?? null;\n }\n\n get triggerClasses(): string {\n return mnSelectVariants({\n size: this.props.size,\n borderRadius: this.props.borderRadius,\n shadow: this.props.shadow,\n fullWidth: this.props.fullWidth,\n });\n }\n\n /** Whether the panel should currently render as a bottom sheet. */\n get isSheet(): boolean {\n return this.props.mobileSheet !== false && this.isNarrowViewport;\n }\n\n /**\n * Whether the search input is shown: the explicit `searchable` prop when set, otherwise\n * auto-enabled once the option count reaches the threshold.\n */\n get isSearchable(): boolean {\n if (this.props.searchable !== undefined) return this.props.searchable;\n const threshold = this.props.searchThreshold ?? MnSelect.DEFAULT_SEARCH_THRESHOLD;\n return this.props.options.length >= threshold;\n }\n\n get filteredOptions(): MnSelectOption[] {\n if (!this.searchTerm) return this.props.options;\n const lower = this.searchTerm.toLowerCase();\n return this.props.options.filter(o => o.label.toLowerCase().includes(lower));\n }\n\n // ========== Lifecycle ==========\n\n ngOnInit() {\n this.resolveConfig();\n this.startWatchingViewport();\n\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveConfig();\n });\n this.destroyRef.onDestroy(() => {\n sub.unsubscribe();\n this.stopWatchingTrigger();\n this.stopWatchingViewport();\n this.unlockBodyScroll();\n // Guarantee the portalled elements never outlive the component.\n this.movedPanel = this.portal(null, this.movedPanel);\n this.movedShield = this.portal(null, this.movedShield);\n this.sheetHost = null;\n });\n }\n\n // ========== ControlValueAccessor Implementation ==========\n\n writeValue(val: unknown): void {\n // Treat empty string as null so the placeholder is shown and the control stays properly invalid.\n this.selectedValue = (val === '' || val == null) ? null : val;\n }\n\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n\n // ========== Dropdown Logic ==========\n\n toggle(): void {\n if (this.isDisabled) return;\n if (this.isOpen) {\n this.close();\n return;\n }\n this.isOpen = true;\n if (this.isSheet) {\n // A sheet is anchored to the viewport, so it needs no trigger tracking — only a\n // scroll lock so the page behind it stays put while the list is scrolled.\n this.lockBodyScroll();\n return;\n }\n this.updateDropdownPosition();\n this.startWatchingTrigger();\n }\n\n /** Selects an option, notifies the form and closes — a single choice ends the interaction. */\n selectOption(option: MnSelectOption): void {\n if (option.disabled) return;\n this.selectedValue = option.value;\n this.onChange(this.selectedValue);\n this.close();\n }\n\n isSelected(option: MnSelectOption): boolean {\n return this.selectedValue === option.value;\n }\n\n /** Filters the options; the first match is highlighted so Enter picks it, none once the box is cleared. */\n onSearch(term: string | null): void {\n this.searchTerm = term ?? '';\n this.activeIndex = this.searchTerm ? stepEnabledIndex(this.filteredOptions, -1, 1, isChoosable) : -1;\n }\n\n /** Id of the keyboard-highlighted option, for `aria-activedescendant`; null when none is. */\n get activeOptionId(): string | null {\n const inRange = this.activeIndex >= 0 && this.activeIndex < this.filteredOptions.length;\n return this.isOpen && inRange ? this.optionId(this.activeIndex) : null;\n }\n\n /**\n * The DOM id of the option rendered at a position in `filteredOptions`.\n * @param index - The option's position.\n * @returns The id, unique per select.\n */\n optionId(index: number): string {\n return `${this.resolvedId}-option-${index}`;\n }\n\n /**\n * Keyboard handling for the trigger and the search box, the WAI-ARIA combobox pattern. While\n * closed, ArrowDown, ArrowUp, Enter and Space open the list with an option highlighted. While\n * open, the arrows move the highlight past disabled options without wrapping, Home and End jump\n * to the ends, Enter (and Space outside the search box) chooses the highlighted option and returns focus to the trigger, Escape closes and Tab closes and lets focus move on. Enter and Space\n * stop here, so they can never submit a surrounding form or close a surrounding modal.\n * @param event - The keydown.\n * @param fromSearch - True when it came from the search box, where Space, Home and End edit text.\n */\n onKeydown(event: KeyboardEvent, fromSearch = false): void {\n if (this.isDisabled) return;\n // Only keys pressed on the trigger itself; nothing inside it is focusable today, but stay safe.\n if (!fromSearch && event.target !== event.currentTarget) return;\n\n if (!this.isOpen) {\n if (fromSearch || !OPEN_KEYS.includes(event.key)) return;\n claim(event);\n this.toggle();\n const selected = this.filteredOptions.findIndex(o => this.isSelected(o) && isChoosable(o));\n this.activeIndex = selected >= 0\n ? selected\n : stepEnabledIndex(this.filteredOptions, -1, event.key === 'ArrowUp' ? -1 : 1, isChoosable);\n this.revealActiveOption();\n return;\n }\n\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n claim(event);\n this.moveActive(this.activeIndex, event.key === 'ArrowDown' ? 1 : -1);\n return;\n case 'Home':\n case 'End':\n if (fromSearch) return;\n claim(event);\n this.moveActive(-1, event.key === 'Home' ? 1 : -1);\n return;\n case ' ':\n if (fromSearch) return;\n this.chooseActive(event);\n return;\n case 'Enter':\n this.chooseActive(event);\n return;\n case 'Escape':\n claim(event);\n this.close();\n this.focusTrigger();\n return;\n case 'Tab':\n // Focus moves on from the trigger, so the search box's Tab order position never matters.\n this.close();\n this.focusTrigger();\n return;\n }\n }\n\n /**\n * Moves the highlight one enabled option from `from` and scrolls it into view.\n * @param from - Where to step from; -1 to start at an end.\n * @param step - 1 for down, -1 for up.\n */\n private moveActive(from: number, step: 1 | -1): void {\n this.activeIndex = stepEnabledIndex(this.filteredOptions, from, step, isChoosable);\n this.revealActiveOption();\n }\n\n /**\n * Chooses the highlighted option (or just closes when none is) and hands focus back to the trigger,\n * because the search box that may hold it is removed with the panel.\n * @param event - The Enter or Space keydown, claimed so a form around the select is not submitted.\n */\n private chooseActive(event: KeyboardEvent): void {\n claim(event);\n const option = this.filteredOptions[this.activeIndex];\n if (option) {\n this.selectOption(option);\n } else {\n this.close();\n }\n this.focusTrigger();\n }\n\n /** Scrolls the highlighted option into view once the render that paints its ring has run. */\n private revealActiveOption(): void {\n afterNextRender(() => {\n const id = this.activeOptionId;\n scrollOptionIntoView(id ? document.getElementById(id) : null);\n }, {injector: this.injector});\n }\n\n /** Puts focus back on the trigger. */\n private focusTrigger(): void {\n this.triggerRef?.nativeElement.focus();\n }\n\n /**\n * The single close path. Every trigger (outside click, Escape, scroll, resize, the trigger\n * being hidden, a choice) funnels through here so the open-only listeners are always torn\n * down with the panel and never leak.\n */\n close(): void {\n if (!this.isOpen) return;\n this.isOpen = false;\n this.searchTerm = '';\n this.activeIndex = -1;\n this.stopWatchingTrigger();\n this.unlockBodyScroll();\n }\n\n handleBlur(): void {\n this.onTouched();\n }\n\n /**\n * Dismisses the anchored panel from a shield click, and stops the event there.\n *\n * Swallowing it is the point: the shield spans the viewport, so the click would otherwise\n * land on whatever the panel was floating over. Inside a modal that is the modal's own\n * backdrop, and \"close the dropdown\" would double as \"throw away the modal\". A first click\n * that only dismisses the overlay is also how native selects and menus behave.\n */\n onShieldClick(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n this.close();\n }\n\n @HostListener('document:click', ['$event'])\n onDocumentClick(event: Event): void {\n const target = event.target as Node | null;\n // The panel lives at the body root once open, so it is not a descendant of the host\n // element — treat clicks inside the portalled panel as \"inside\" too.\n const insideHost = !!target && this.elRef.nativeElement.contains(target);\n const insidePanel = !!target && !!this.movedPanel && this.movedPanel.contains(target);\n // In sheet mode the backdrop tap is handled by mn-bottom-sheet's own (dismiss); the\n // sheet host counts as \"inside\" here so this listener never double-fires the close.\n const insideSheet = !!target && !!this.sheetHost && this.sheetHost.contains(target);\n if (!insideHost && !insidePanel && !insideSheet) {\n this.close();\n }\n }\n\n /** Closes the dropdown on Escape for keyboard accessibility. */\n @HostListener('document:keydown.escape')\n onEscape(): void {\n this.close();\n }\n\n /**\n * Closes the dropdown when the page or a scrollable parent is scrolled.\n *\n * Skipped for a sheet: it is anchored to the viewport, not to the trigger, so it has no\n * stale position to escape. Crucially, opening the soft keyboard fires a `resize` on\n * Android — closing on that would dismiss the sheet the instant search is focused. A\n * genuine layout switch is handled by the `matchMedia` listener instead.\n */\n @HostListener('window:scroll', [])\n @HostListener('window:resize', [])\n onWindowScrollOrResize(): void {\n if (this.isSheet) return;\n this.close();\n }\n\n protected isRequired(): boolean {\n if (!this.control) return false;\n return this.control.hasValidator(Validators.required);\n }\n\n // ========== Viewport / breakpoint watching ==========\n\n /**\n * Tracks the sheet breakpoint through `matchMedia` rather than reading `innerWidth` once,\n * so rotating the device switches layout instead of leaving a panel positioned for the\n * previous orientation. An open panel is closed on the switch — its anchored coordinates\n * and its sheet layout are not interchangeable.\n */\n private startWatchingViewport(): void {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n this.sheetMedia = window.matchMedia(`(max-width: ${MnSelect.SHEET_MAX_WIDTH}px)`);\n this.isNarrowViewport = this.sheetMedia.matches;\n\n this.sheetMediaListener = (event: MediaQueryListEvent) => {\n this.isNarrowViewport = event.matches;\n this.close();\n // The listener fires outside Angular, so a zoneless app needs an explicit nudge.\n this.cdr.markForCheck();\n };\n this.sheetMedia.addEventListener('change', this.sheetMediaListener);\n }\n\n /** Tears down the breakpoint listener. Idempotent. */\n private stopWatchingViewport(): void {\n if (this.sheetMedia && this.sheetMediaListener) {\n this.sheetMedia.removeEventListener('change', this.sheetMediaListener);\n }\n this.sheetMedia = null;\n this.sheetMediaListener = null;\n }\n\n // ========== Body scroll lock (sheet only) ==========\n\n /**\n * Freezes the page behind an open sheet. The previous inline value is captured and restored\n * verbatim so a surrounding modal that set its own lock is left intact.\n */\n private lockBodyScroll(): void {\n if (this.previousBodyOverflow !== null) return;\n this.previousBodyOverflow = document.body.style.overflow;\n this.renderer.setStyle(document.body, 'overflow', 'hidden');\n }\n\n /** Restores the pre-lock `overflow`. Idempotent. */\n private unlockBodyScroll(): void {\n if (this.previousBodyOverflow === null) return;\n if (this.previousBodyOverflow) {\n this.renderer.setStyle(document.body, 'overflow', this.previousBodyOverflow);\n } else {\n this.renderer.removeStyle(document.body, 'overflow');\n }\n this.previousBodyOverflow = null;\n }\n\n // ========== Positioning ==========\n\n /**\n * Calculates the fixed position for the dropdown based on the trigger element: below it\n * while the viewport has room, above it otherwise, never past the viewport's edge.\n */\n private updateDropdownPosition(): void {\n if (!this.triggerRef) return;\n const rect = this.triggerRef.nativeElement.getBoundingClientRect();\n this.dropdownStyle = {\n ...anchoredPanelPlacement(rect, window.innerHeight, 0, MnSelect.PANEL_MAX_HEIGHT_PX),\n left: `${rect.left}px`,\n width: `${rect.width}px`,\n };\n }\n\n /**\n * Starts the open-only watchers: an `IntersectionObserver` on the trigger (closes the panel\n * as soon as the trigger stops being rendered/visible) and a capture-phase `scroll` listener\n * (closes it when any ancestor scroller moves under it). Scrolls that originate inside the\n * panel's own option list are ignored.\n */\n private startWatchingTrigger(): void {\n this.stopWatchingTrigger();\n\n const trigger = this.triggerRef?.nativeElement;\n if (trigger && typeof IntersectionObserver !== 'undefined') {\n this.visibilityObserver = new IntersectionObserver(entries => {\n if (!entries.some(entry => !entry.isIntersecting)) return;\n this.close();\n // The observer fires outside Angular, so a zoneless app needs an explicit nudge.\n this.cdr.markForCheck();\n });\n this.visibilityObserver.observe(trigger);\n }\n\n this.scrollCapture = (event: Event) => {\n const target = event.target as Node | null;\n if (target && this.movedPanel && (this.movedPanel === target || this.movedPanel.contains(target))) {\n return;\n }\n this.close();\n this.cdr.markForCheck();\n };\n document.addEventListener('scroll', this.scrollCapture, true);\n }\n\n /** Tears down the watchers installed by `startWatchingTrigger`. Idempotent. */\n private stopWatchingTrigger(): void {\n this.visibilityObserver?.disconnect();\n this.visibilityObserver = null;\n if (this.scrollCapture) {\n document.removeEventListener('scroll', this.scrollCapture, true);\n this.scrollCapture = null;\n }\n }\n\n // ========== Sheet height floor ==========\n\n /**\n * Records the sheet's opened height as its `min-height` floor. Measured on the next frame\n * so the read reflects the fully-rendered, unfiltered list (the search box is empty on\n * open) and never forces a reflow mid change-detection. The floor equals the content height\n * at that instant, so applying it triggers no resize — it only stops a later, shorter\n * filtered list from pulling the sheet down.\n *\n * `hostEl` is the portalled mn-bottom-sheet host (`display: contents`), so the height is\n * read from its `.mn-sheet-container` child rather than the host itself.\n */\n private captureSheetFloor(hostEl: HTMLElement): void {\n const measure = (): number => {\n const container = hostEl.querySelector<HTMLElement>('.mn-sheet-container');\n return container?.offsetHeight ?? hostEl.offsetHeight;\n };\n if (typeof requestAnimationFrame !== 'function') {\n this.sheetFloorPx = measure();\n return;\n }\n requestAnimationFrame(() => {\n // The sheet may have closed before the frame ran; don't strand a stale floor.\n if (!this.isOpen || this.sheetHost !== hostEl) return;\n this.sheetFloorPx = measure();\n this.cdr.markForCheck();\n });\n }\n\n // ========== Portal helper (see mn-multi-select for the full rationale) ==========\n\n /**\n * Move an overlay element to `document.body` when it appears, and detach it when the query\n * clears. Appending to the body root makes the element immune to ancestor\n * `transform`/`filter`/`will-change`, so `position: fixed` anchors to the viewport — without\n * this the panel lands mid-screen (and breaks outright on iOS).\n *\n * Returns the element now portalled, so the caller can store it. Idempotent and safe to\n * call with `null`.\n */\n private portal(el: HTMLElement | null, current: HTMLElement | null): HTMLElement | null {\n if (el) {\n if (current === el) return current;\n this.renderer.appendChild(document.body, el);\n return el;\n }\n if (current) {\n // Angular's view teardown may already have removed it; only detach if still attached.\n const parent = current.parentNode;\n if (parent) {\n this.renderer.removeChild(parent, current);\n }\n }\n return null;\n }\n\n // ========== Config / Error Handling ==========\n\n private resolveConfig() {\n const instanceId = this.explicitInstanceId || `mn-select-${this.props.id}`;\n this.uiConfig = this.configService.resolve<MnSelectUIConfig>(\n 'mn-select',\n this.sectionPath,\n instanceId\n );\n\n if (this.props.label) {\n this.uiConfig = {...this.uiConfig, label: this.props.label};\n }\n if (this.props.placeholder) {\n this.uiConfig = {...this.uiConfig, placeholder: this.props.placeholder};\n }\n if (this.props.ariaLabel) {\n this.uiConfig = {...this.uiConfig, ariaLabel: this.props.ariaLabel};\n }\n }\n\n private pickErrorKey(errors: ValidationErrors): string {\n if (this.props.errorPriority) {\n for (const key of this.props.errorPriority) {\n if (errors[key] !== undefined) {\n return key;\n }\n }\n }\n return Object.keys(errors)[0];\n }\n\n private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n const errorArgs = errors[errorKey];\n const customMsg = this.props.errorMessages?.[errorKey];\n const configMsg = this.uiConfig.errorMessages?.[errorKey];\n const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n const fallbackMsg = this.props.defaultErrorMessage;\n const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n if (typeof msgDef === 'function') {\n return msgDef(errorArgs, errors);\n }\n if (errorArgs && typeof errorArgs === 'object') {\n return msgDef.replace(/{{(\\w+)}}/g, (_, key) => errorArgs[key] ?? _);\n }\n return msgDef;\n }\n}\n","<div [class.is-fullwidth]=\"props.fullWidth\" class=\"flex flex-col h-full\">\n @if (uiConfig.label || props.label) {\n <label [attr.for]=\"resolvedId\" class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\">\n <p>{{ uiConfig.label || props.label }}</p>\n @if (isRequired()) {\n <span class=\"text-error\" aria-hidden=\"true\">*</span>\n }\n </label>\n }\n\n <!-- Trigger -->\n <div\n #trigger\n (blur)=\"handleBlur()\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n [attr.aria-controls]=\"isOpen ? resolvedId + '-listbox' : null\"\n [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n [attr.aria-disabled]=\"isDisabled || null\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-invalid]=\"showError || null\"\n [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || props.label || null\"\n [class.cursor-not-allowed]=\"isDisabled\"\n [class.opacity-60]=\"isDisabled\"\n [id]=\"resolvedId\"\n [ngClass]=\"triggerClasses\"\n [tabindex]=\"isDisabled ? -1 : 0\"\n aria-haspopup=\"listbox\"\n class=\"relative\"\n role=\"combobox\"\n [attr.aria-required]=\"isRequired() || null\"\n >\n <!-- `pr-6` reserves the gutter the caret is absolutely positioned in (right-2 + w-4),\n so the value can never render underneath it. `min-w-0` lets the label shrink below\n its content width, which is what makes truncation possible. -->\n <div class=\"flex flex-row items-center min-h-6 min-w-0 pr-6\">\n <span\n [attr.title]=\"selectedOption?.label\"\n [ngClass]=\"selectedOption ? 'text-base-content' : 'text-base-content/50'\"\n class=\"truncate\"\n >{{ displayText }}</span>\n </div>\n <div class=\"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none\">\n <svg [size]=\"16\" class=\"text-base-content/50\" lucideChevronDown></svg>\n </div>\n </div>\n\n <!-- Dropdown -->\n @if (isOpen) {\n @if (isSheet) {\n <!-- On mobile the panel is presented as a shared bottom sheet: the sheet chrome\n (backdrop, grabber, swipe/flick-to-dismiss, slide animation) lives in\n mn-bottom-sheet; this component only projects the field's content into it. The\n sheet host is portalled to document.body (see the `sheet` ViewChild) so its\n `position: fixed` anchors to the viewport, not a transformed ancestor. -->\n <mn-bottom-sheet\n #sheet\n (dismiss)=\"close()\"\n [ariaLabel]=\"uiConfig.ariaLabel || uiConfig.label || props.label || uiConfig.placeholder || props.placeholder\"\n [maxHeightVh]=\"80\"\n [minHeightPx]=\"sheetFloorPx\"\n >\n <div\n [id]=\"resolvedId + '-listbox'\"\n class=\"flex flex-col flex-1 min-h-0 overflow-hidden\"\n role=\"listbox\"\n >\n <!-- The sheet covers its own trigger, so it carries a header to name the field; the\n way out is the grabber (swipe-to-dismiss) and a backdrop tap. -->\n <div class=\"px-4 pt-1 pb-2 shrink-0\">\n <p class=\"text-base font-medium text-base-content truncate\">\n {{ uiConfig.label || props.label || uiConfig.placeholder || props.placeholder || '' }}\n </p>\n </div>\n <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n </div>\n </mn-bottom-sheet>\n } @else {\n <!-- A transparent full-viewport shield behind the panel, so \"click anywhere to dismiss\"\n is literally true. It also *consumes* that click: without it the click reaches\n whatever sits underneath — inside a modal that is the modal's own backdrop, so\n dismissing the dropdown would tear down the whole modal with it. Portalled to\n document.body for the same reason the panel is. It is aria-hidden and unfocusable:\n the keyboard equivalent of this click is Escape. -->\n <div\n #shield\n (click)=\"onShieldClick($event)\"\n [id]=\"resolvedId + '-shield'\"\n [ngClass]=\"shieldClasses\"\n aria-hidden=\"true\"\n ></div>\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n #dropdown\n (click)=\"$event.stopPropagation()\"\n [id]=\"resolvedId + '-listbox'\"\n [ngClass]=\"panelClasses\"\n [style.left]=\"dropdownStyle.left\"\n [style.top]=\"dropdownStyle.top\"\n [style.bottom]=\"dropdownStyle.bottom\"\n [style.max-height]=\"dropdownStyle.maxHeight\"\n [style.width]=\"dropdownStyle.width\"\n role=\"listbox\"\n >\n <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n </div>\n }\n }\n\n <!-- The search box + option list, shared verbatim by the sheet and the anchored popover.\n `isSheet` only tunes spacing/sizing and which element scrolls: in sheet mode the list\n is the flex scroller; anchored, the popover itself scrolls. -->\n <ng-template #panelBody>\n @if (isSearchable) {\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onKeydown($event, true)\"\n [ngClass]=\"isSheet ? 'px-4 py-2' : 'p-2'\"\n class=\"border-b border-base-300 shrink-0\"\n >\n <mn-lib-input-field\n (ngModelChange)=\"onSearch($event)\"\n [ngModelOptions]=\"{ standalone: true }\"\n [ngModel]=\"searchTerm\"\n [props]=\"{\n id: resolvedId + '-search',\n type: 'search',\n placeholder: searchPlaceholderLabel,\n ariaLabel: searchPlaceholderLabel,\n ariaActiveDescendant: activeOptionId,\n fullWidth: true,\n size: 'sm',\n autoFocus: !isSheet\n }\"\n ></mn-lib-input-field>\n </div>\n }\n <div [ngClass]=\"isSheet ? 'flex-1 overflow-auto overscroll-contain' : ''\">\n @for (opt of filteredOptions; track opt.value) {\n <!-- Options are not Tab stops: the keyboard reaches them with the arrow keys while focus\n stays on the trigger or the search box, and `aria-activedescendant` names the one it\n is on. The ring marks that option, since it never receives real focus. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div\n (click)=\"selectOption(opt); $event.stopPropagation()\"\n [attr.aria-disabled]=\"opt.disabled || null\"\n [attr.aria-selected]=\"isSelected(opt)\"\n [class.opacity-50]=\"opt.disabled\"\n [class.pointer-events-none]=\"opt.disabled\"\n [id]=\"optionId($index)\"\n [ngClass]=\"[isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm', isSelected(opt) ? 'bg-primary/10 font-medium' : '', $index === activeIndex ? 'ring-2 ring-inset ring-primary' : '']\"\n class=\"flex items-center gap-x-2.5 cursor-pointer text-base-content hover:bg-base-200 transition-colors\"\n role=\"option\"\n >\n <span class=\"truncate min-w-0\">{{ opt.label }}</span>\n <!-- The current choice's marker. Decorative: the state is conveyed to assistive\n tech by `aria-selected` on the row. -->\n @if (isSelected(opt)) {\n <svg\n [lucideIcon]=\"checkIcon\"\n [size]=\"isSheet ? 18 : 16\"\n aria-hidden=\"true\"\n class=\"ml-auto shrink-0 text-primary\"\n ></svg>\n }\n </div>\n }\n @if (filteredOptions.length === 0) {\n <div [ngClass]=\"isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm'\" class=\"text-base-content/50\">\n {{ noOptionsLabel }}\n </div>\n }\n </div>\n </ng-template>\n\n @if (showError) {\n @if (props.showAllErrors) {\n <div class=\"flex flex-col gap-y-1 mt-1\">\n @for (error of errorMessages; track $index) {\n <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n }\n </div>\n } @else {\n @if (errorMessage !== null) {\n <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n }\n }\n }\n</div>\n","import {TemplateRef, Type} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {AsyncValidatorFn, ValidatorFn} from '@angular/forms';\nimport {LucideIconData} from '@lucide/angular';\nimport {TableDataSource} from '../mn-table';\n\nexport { Type, TemplateRef };\nexport type {LucideIconData};\n\n// =========================\n// Enums / Value Types\n// =========================\n\nexport enum ModalKind {\n WIZARD = 'wizard',\n FORM = 'form',\n CONFIRMATION = 'confirmation',\n CUSTOM = 'custom',\n}\n\nexport enum ModalSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n FULL = 'full',\n}\n\nexport enum CloseMode {\n ALLOWED = 'allowed',\n GUARDED = 'guarded',\n DISABLED = 'disabled',\n}\n\nexport enum BackdropMode {\n HIDE = 'hide',\n STATIC = 'static',\n CLOSABLE = 'closable',\n}\n\nexport enum KeyboardMode {\n ENABLED = 'enabled',\n DISABLED = 'disabled',\n}\n\nexport enum ModalIntent {\n NEUTRAL = 'neutral',\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n DANGER = 'danger',\n}\n\nexport enum WizardFlowMode {\n LINEAR = 'linear',\n FREE = 'free',\n}\n\nexport enum FormLayoutMode {\n SINGLE_COLUMN = 'single-column',\n TWO_COLUMN = 'two-column',\n INLINE = 'inline',\n}\n\nexport enum SubmitMode {\n ONCE = 'once',\n RETRYABLE = 'retryable',\n}\n\nexport enum ConfirmationTone {\n DEFAULT = 'default',\n WARNING = 'warning',\n DANGER = 'danger',\n}\n\nexport enum FieldKind {\n TEXT = 'text',\n NUMBER = 'number',\n SELECT = 'select',\n CHECKBOX = 'checkbox',\n DATE = 'date',\n TEXTAREA = 'textarea',\n DATETIME = 'datetime',\n MULTI_SELECT = 'multi-select',\n MULTI_SELECT_TABLE = 'multi-select-table',\n SINGLE_SELECT_TABLE = 'single-select-table',\n PASSWORD = 'password',\n FILE = 'file',\n COLOR = 'color',\n RATING = 'rating',\n SLIDER = 'slider',\n CUSTOM = 'custom',\n}\n\nexport enum FieldAppearance {\n OUTLINE = 'outline',\n FILLED = 'filled',\n GHOST = 'ghost',\n}\n\nexport enum SelectionMode {\n SINGLE = 'single',\n MULTIPLE = 'multiple',\n}\n\nexport enum OptionState {\n ENABLED = 'enabled',\n DISABLED = 'disabled',\n}\n\nexport enum ActionStyle {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DANGER = 'danger',\n GHOST = 'ghost',\n}\n\nexport enum StepState {\n PENDING = 'pending',\n ACTIVE = 'active',\n COMPLETE = 'complete',\n DISABLED = 'disabled',\n HIDDEN = 'hidden',\n}\n\nexport enum NavigationDirection {\n FORWARD = 'forward',\n BACKWARD = 'backward',\n DIRECT = 'direct',\n}\n\nexport enum ModalCloseReason {\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n DISMISSED = 'dismissed',\n BACKDROP = 'backdrop',\n ESCAPE = 'escape',\n PROGRAMMATIC = 'programmatic',\n GUARD_REJECTED = 'guard_rejected',\n}\n\nexport enum ValidationStatus {\n VALID = 'valid',\n INVALID = 'invalid',\n PENDING = 'pending',\n}\n\nexport enum ValidationCode {\n REQUIRED = 'required',\n MIN = 'min',\n MAX = 'max',\n PATTERN = 'pattern',\n CUSTOM = 'custom',\n}\n\n// =========================\n// Value Objects & Types\n// =========================\n\nexport type ModalStepId = string;\nexport type ModalInputMap = Record<string, unknown>;\n\n// =========================\n// Conditional Field Types\n// =========================\n\n/**\n * A condition function that receives the current form values and returns\n * whether the field should be visible.\n */\nexport type FieldVisibilityCondition<TModel = unknown> = (formValue: Partial<TModel>) => boolean;\n\n/**\n * A condition function that receives the current form values and returns\n * whether the field should be required.\n */\nexport type FieldRequiredCondition<TModel = unknown> = (formValue: Partial<TModel>) => boolean;\n\n// =========================\n// Cross-Field Validation\n// =========================\n\n/**\n * A form-level validator that receives the entire form value\n * and returns an error map or null.\n */\nexport type FormValidator<TModel = unknown> = (formValue: Partial<TModel>) => Record<string, string> | null;\n\n// =========================\n// Async DataSource Types\n// =========================\n\n/**\n * A data source that asynchronously loads options for select/multi-select fields.\n * Can optionally depend on other field values to reload.\n */\nexport type FieldDataSource<TValue = unknown, TModel = unknown> = {\n /** Load options, optionally based on current form values */\n load(formValue?: Partial<TModel>): Promise<SelectOption<TValue>[]> | SelectOption<TValue>[];\n /** Keys of other fields that trigger a reload when their value changes */\n dependsOn?: KeyOf<TModel>[];\n}\n\n// =========================\n// Validation Types\n// =========================\n\nexport type ValidationResult = {\n status: ValidationStatus;\n code?: ValidationCode;\n message?: string;\n}\n\nexport type StepValidator = {\n validate(): Promise<ValidationResult> | ValidationResult;\n}\n\nexport type FieldValidator = {\n validate(value: unknown): Promise<ValidationResult> | ValidationResult;\n}\n\nexport type StepGuard = {\n canEnter(): Promise<boolean> | boolean;\n canExit(): Promise<boolean> | boolean;\n}\n\n// =========================\n// Modal Result & Events\n// =========================\n\nexport type ModalCloseEvent<TResult = unknown> = {\n reason: ModalCloseReason;\n result?: TResult;\n}\n\nexport type ModalRef<TResult = unknown> = {\n afterClosed$: Observable<ModalCloseEvent<TResult>>;\n close(result?: TResult): void;\n dismiss(reason: ModalCloseReason): void;\n update(config: Partial<BaseModalConfig<TResult>>): void;\n}\n\n// =========================\n// Handlers\n// =========================\n\nexport type ModalResultHandler<TResult = unknown> = {\n handle(result: TResult): Promise<void> | void;\n}\n\nexport type WizardStepChangeEvent = {\n previousStepId?: ModalStepId;\n currentStepId: ModalStepId;\n direction: NavigationDirection;\n}\n\nexport type WizardStepChangeHandler = {\n handle(event: WizardStepChangeEvent): Promise<void> | void;\n}\n\n// =========================\n// Wizard Types\n// =========================\n\nexport type StepBodyConfig = Type<unknown> | TemplateRef<unknown> | string;\n\nexport type WizardStepConfig<TModel = unknown> = {\n id: ModalStepId;\n title: string;\n state?: StepState;\n body?: StepBodyConfig;\n /**\n * Inputs passed to the step {@link body} when it is a component or template\n * (ignored for a plain-string body). Each key is assigned to the matching\n * `@Input()` on the rendered component; a `modalRef` property, if present, is\n * populated automatically. Mirrors {@link CustomModalConfig.inputs} but scoped\n * to a single wizard step.\n */\n bodyInputs?: ModalInputMap;\n fields?: FormFieldConfig<TModel>[];\n rows?: FormRow<TModel>[];\n fieldGroups?: FormFieldGroup<TModel>[];\n formValidators?: FormValidator<TModel>[];\n groupValidators?: ValidatorFn[];\n initialValue?: Partial<TModel>;\n guard?: StepGuard;\n validators?: StepValidator[];\n /** Custom label for the 'Next' button on this step */\n nextLabel?: string;\n /** Custom label for the 'Back' button on this step */\n backLabel?: string;\n /** Whether to hide the 'Back' button on this step */\n hideBack?: boolean;\n /** Condition to show/hide this entire step based on aggregated wizard data */\n visible?: (aggregatedData: Record<ModalStepId, Record<string, unknown>>) => boolean;\n}\n\nexport type WizardResult = {\n status: ModalCloseReason;\n visitedStepIds: ModalStepId[];\n payload?: Record<ModalStepId, Record<string, unknown>>;\n}\n\n// =========================\n// Form Types\n// =========================\n\ntype KeyOf<T> = unknown extends T ? string : keyof T & string;\n\nexport type SelectOption<TValue = unknown> = {\n label: string;\n value: TValue;\n state?: OptionState;\n}\n\nexport type TextFieldConfig<TModel = unknown> = {\n kind: FieldKind.TEXT;\n key: KeyOf<TModel>;\n label: string;\n appearance?: FieldAppearance;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n placeholder?: string;\n /** Whether this field is read-only (display only) */\n readOnly?: boolean;\n /** Whether this field is disabled */\n disabled?: boolean;\n /** Condition to show/hide this field based on other field values */\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n /** Input mask (e.g., '(000) 000-0000') */\n mask?: string;\n /** Autocomplete attribute */\n autocomplete?: string;\n /** Whether to focus this field when the modal opens */\n autoFocus?: boolean;\n /** When to update the form control value and run validation */\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type NumberFieldConfig<TModel = unknown> = {\n kind: FieldKind.NUMBER;\n key: KeyOf<TModel>;\n label: string;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n placeholder?: string;\n min?: number;\n max?: number;\n step?: number;\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type SelectFieldConfig<TModel = unknown, TValue = unknown> = {\n kind: FieldKind.SELECT;\n key: KeyOf<TModel>;\n label: string;\n options: SelectOption<TValue>[];\n selectionMode?: SelectionMode;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n /** Async data source for loading options dynamically */\n dataSource?: FieldDataSource<TValue, TModel>;\n}\n\nexport type CheckboxFieldConfig<TModel = unknown> = {\n kind: FieldKind.CHECKBOX;\n key: KeyOf<TModel>;\n label: string;\n defaultValue?: boolean;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type DateFieldConfig<TModel = unknown> = {\n kind: FieldKind.DATE;\n key: KeyOf<TModel>;\n label: string;\n placeholder?: string;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n minDate?: string;\n maxDate?: string;\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type TextareaFieldConfig<TModel = unknown> = {\n kind: FieldKind.TEXTAREA;\n key: KeyOf<TModel>;\n label: string;\n placeholder?: string;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n rows?: number;\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type DatetimeFieldConfig<TModel = unknown> = {\n kind: FieldKind.DATETIME;\n key: KeyOf<TModel>;\n label: string;\n placeholder?: string;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n mode?: 'date' | 'time' | 'datetime-local';\n min?: string;\n max?: string;\n step?: number;\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type MultiSelectFieldConfig<TModel = unknown, TValue = unknown> = {\n kind: FieldKind.MULTI_SELECT;\n key: KeyOf<TModel>;\n label: string;\n options: SelectOption<TValue>[];\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n /** Placeholder shown in the trigger while nothing is selected. */\n placeholder?: string;\n searchable?: boolean;\n searchPlaceholder?: string;\n maxSelections?: number;\n /**\n * Forwarded to the underlying multi-select: once more than this many options are selected the\n * trigger collapses to a summary instead of rendering every chip.\n */\n collapseThreshold?: number;\n /** Forwarded summary text for the collapsed trigger; `{count}` is interpolated. */\n collapsePlaceholder?: string;\n /** Forwarded summary text shown when every option is selected. */\n allSelectedPlaceholder?: string;\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n /** Async data source for loading options dynamically */\n dataSource?: FieldDataSource<TValue, TModel>;\n}\n\nexport type PasswordFieldConfig<TModel = unknown> = {\n kind: FieldKind.PASSWORD;\n key: KeyOf<TModel>;\n label: string;\n placeholder?: string;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type MultiSelectTableFieldConfig<TModel = unknown, TRow = unknown> = {\n kind: FieldKind.MULTI_SELECT_TABLE;\n key: KeyOf<TModel>;\n label: string;\n /** The TableDataSource that powers the mn-table. selectionMode will be forced to 'multi'. */\n tableDataSource: TableDataSource<TRow>;\n /** Function to extract the value stored in the form from a selected row (default: getID) */\n getRowValue?: (row: TRow) => unknown;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type SingleSelectTableFieldConfig<TModel = unknown, TRow = unknown> = {\n kind: FieldKind.SINGLE_SELECT_TABLE;\n key: KeyOf<TModel>;\n label: string;\n /** The TableDataSource that powers the mn-table. selectionMode will be forced to 'single'. */\n tableDataSource: TableDataSource<TRow>;\n /** Function to extract the value stored in the form from a selected row (default: getID) */\n getRowValue?: (row: TRow) => unknown;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type ColorFieldConfig<TModel = unknown> = {\n kind: FieldKind.COLOR;\n key: KeyOf<TModel>;\n label: string;\n /** Default color value (hex string, e.g., '#ff0000') */\n defaultValue?: string;\n /** Predefined color swatches to show */\n swatches?: string[];\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type RatingFieldConfig<TModel = unknown> = {\n kind: FieldKind.RATING;\n key: KeyOf<TModel>;\n label: string;\n /** Maximum rating value (default: 5) */\n max?: number;\n /** Icon to use for rating (default: 'star') */\n icon?: 'star' | 'heart' | 'circle';\n /** Allow half-star ratings (default: false) */\n allowHalf?: boolean;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type SliderFieldConfig<TModel = unknown> = {\n kind: FieldKind.SLIDER;\n key: KeyOf<TModel>;\n label: string;\n /** Minimum value (default: 0) */\n min?: number;\n /** Maximum value (default: 100) */\n max?: number;\n /** Step increment (default: 1) */\n step?: number;\n /** Whether to show the current value label (default: true) */\n showValue?: boolean;\n /** Unit label displayed after the value (e.g., '%', 'px') */\n unit?: string;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type FileFieldConfig<TModel = unknown> = {\n kind: FieldKind.FILE;\n key: KeyOf<TModel>;\n label: string;\n /** Accepted file types (e.g., '.pdf,.jpg,image/*') */\n accept?: string;\n /** Allow multiple file selection */\n multiple?: boolean;\n /** Maximum file size in bytes */\n maxSize?: number;\n /** Maximum number of files (when multiple is true) */\n maxFiles?: number;\n /** How the selection is displayed (default: 'dropzone') */\n displayMode?: 'dropzone' | 'thumbnail' | 'list' | 'compact';\n /** Hint shown inside the empty dropzone */\n dropzoneHint?: string;\n /** Hint shown inside the dropzone while files are dragged over it */\n dropActiveHint?: string;\n /** Label for the \"choose/replace file\" affordance */\n replaceLabel?: string;\n /** Accessible label for the per-file remove button */\n removeLabel?: string;\n /** URL of an already-saved image to preview when no new file is selected (single mode) */\n currentUrl?: string | null;\n /** URLs of already-saved images to preview when nothing is selected (multiple mode) */\n currentUrls?: string[] | null;\n /**\n * Called when the user removes an already-saved image (`currentUrl`/`currentUrls`).\n * The form value stays null; use this to record the removal intent (e.g. to send\n * a \"clear image\" instruction to the API on submit).\n */\n onClear?: () => void;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n readOnly?: boolean;\n disabled?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type CustomFieldConfig<TModel = unknown> = {\n kind: FieldKind.CUSTOM;\n key: KeyOf<TModel>;\n component: Type<unknown>;\n inputs?: ModalInputMap;\n label?: string;\n validators?: ValidatorFn[];\n asyncValidators?: AsyncValidatorFn[];\n visible?: FieldVisibilityCondition<TModel>;\n /** Condition to dynamically mark this field as required based on other field values */\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n updateOn?: 'change' | 'blur' | 'submit';\n}\n\nexport type FormFieldConfig<TModel = unknown> =\n | TextFieldConfig<TModel>\n | NumberFieldConfig<TModel>\n | SelectFieldConfig<TModel>\n | CheckboxFieldConfig<TModel>\n | DateFieldConfig<TModel>\n | TextareaFieldConfig<TModel>\n | DatetimeFieldConfig<TModel>\n | MultiSelectFieldConfig<TModel>\n | MultiSelectTableFieldConfig<TModel, unknown>\n | SingleSelectTableFieldConfig<TModel, unknown>\n | PasswordFieldConfig<TModel>\n | FileFieldConfig<TModel>\n | ColorFieldConfig<TModel>\n | RatingFieldConfig<TModel>\n | SliderFieldConfig<TModel>\n | CustomFieldConfig<TModel>;\n\nexport type AnimationOptions = {\n type: 'slide' | 'fade' | 'zoom';\n duration?: number; // ms\n}\n\n// =========================\n// Form Layout Types\n// =========================\n\nexport type FormRowField<TModel = unknown> = {\n field: FormFieldConfig<TModel>;\n span?: number; // Number of columns this field spans (default: 1)\n}\n\nexport type FormRow<TModel = unknown> = {\n columns?: number; // Number of columns in this row (default: 1 = full width)\n fields: FormRowField<TModel>[];\n}\n\n// =========================\n// Field Group / Section Types\n// =========================\n\nexport type FormFieldGroup<TModel = unknown> = {\n /** Section header title */\n title: string;\n /** Optional description below the section header */\n description?: string;\n /** Fields in this group */\n fields: FormFieldConfig<TModel>[];\n /** Optional rows layout for this group */\n rows?: FormRow<TModel>[];\n /** Condition to show/hide this entire group based on form values */\n visible?: FieldVisibilityCondition<TModel>;\n}\n\n// =========================\n// Action Types\n// =========================\n\nexport type ConfirmationActionConfig<TResult = unknown> = {\n label: string;\n style?: ActionStyle;\n handler?: ModalResultHandler<TResult>;\n /**\n * Overrides the default leading icon for this action button. Pass a Lucide icon's\n * static data (e.g. `LucideTrash2.icon`). Only rendered when the modal's\n * `showActionIcons` is not explicitly `false`.\n */\n icon?: LucideIconData;\n}\n\nexport type CancellationActionConfig = {\n label: string;\n style?: ActionStyle;\n reason?: ModalCloseReason;\n /**\n * Overrides the default leading icon for this action button. Pass a Lucide icon's\n * static data (e.g. `LucideX.icon`). Only rendered when the modal's\n * `showActionIcons` is not explicitly `false`.\n */\n icon?: LucideIconData;\n}\n\n// =========================\n// Footer Action Types\n// =========================\n\nexport type ModalFooterAction<TResult = unknown> = {\n label: string;\n style?: ActionStyle;\n /** Position in the footer: 'left' or 'right' (default: 'right') */\n position?: 'left' | 'right';\n /** Whether this action closes the modal */\n closesModal?: boolean;\n /** Close reason when this action closes the modal */\n closeReason?: ModalCloseReason;\n /** Handler called when the action is clicked */\n handler?: (modalRef: ModalRef<TResult>) => Promise<void> | void;\n /** Whether the button is disabled */\n disabled?: boolean;\n /**\n * Overrides the default leading icon for this action button. Pass a Lucide icon's\n * static data (e.g. `LucideCheck.icon`). Defaults are derived from `style` when\n * omitted. Only rendered when the modal's `showActionIcons` is not explicitly `false`.\n */\n icon?: LucideIconData;\n}\n\n// =========================\n// Polling / Async Types\n// =========================\n\nexport type ModalPollingConfig<TResult = unknown> = {\n /** Polling interval in milliseconds */\n interval: number;\n /** Function called on each poll tick */\n onPoll: (modalRef: ModalRef<TResult>) => Promise<boolean | void> | boolean | void;\n /** Whether to start polling immediately (default: true) */\n autoStart?: boolean;\n /** Maximum number of poll attempts (undefined = unlimited) */\n maxAttempts?: number;\n}\n\n// =========================\n// Base Config\n// =========================\n\n// =========================\n// i18n / Localization\n// =========================\n\nexport type ModalI18nLabels = {\n /** Submit button label (default: 'Submit') */\n submit?: string;\n /** Cancel button label (default: 'Cancel') */\n cancel?: string;\n /** Next button label for wizard (default: 'Next') */\n next?: string;\n /** Back button label for wizard (default: 'Back') */\n back?: string;\n /** Close button label (default: 'Close') */\n close?: string;\n /** Complete button label for wizard (default: 'Complete') */\n complete?: string;\n /** Submitting state label (default: 'Submitting...') */\n submitting?: string;\n /** Completing state label (default: 'Completing...') */\n completing?: string;\n /** Loading label (default: 'Loading...') */\n loading?: string;\n /** Select placeholder (default: 'Select...') */\n selectPlaceholder?: string;\n /** File upload prompt (default: 'Click or drag files here') */\n fileUploadPrompt?: string;\n /** Confirm button label (default: 'Confirm') */\n confirm?: string;\n}\n\n// =========================\n// Cancel / Dismiss Handler\n// =========================\n\nexport type ModalCancelHandler<_TResult = unknown> = (reason: ModalCloseReason) => Promise<void> | void;\n\nexport type BaseModalConfig<TResult = unknown> = {\n kind: ModalKind;\n title?: string;\n subtitle?: string;\n description?: string;\n /** Width of the modal (uses ModalSize enum) */\n sizeWidth?: ModalSize;\n /** Height of the modal (uses ModalSize enum) */\n sizeHeight?: ModalSize;\n closeMode?: CloseMode;\n closeGuard?: () => Promise<boolean> | boolean;\n backdrop?: BackdropMode;\n keyboard?: KeyboardMode;\n intent?: ModalIntent;\n resultType?: TResult;\n /** Custom footer actions (overrides default footer) */\n footerActions?: ModalFooterAction<TResult>[];\n /** Whether modal action buttons render their icons. Defaults to true. */\n showActionIcons?: boolean;\n /** Polling configuration for periodic async operations */\n polling?: ModalPollingConfig<TResult>;\n /** Handler called when the modal is cancelled or dismissed */\n readOnly?: boolean;\n disabled?: boolean;\n onCancel?: ModalCancelHandler<TResult>;\n /** i18n labels for buttons and UI text */\n i18n?: ModalI18nLabels;\n /** Animation configuration */\n animation?: AnimationOptions | AnimationOptions['type'];\n /**\n * Whether the modal renders as a bottom sheet on small screens (< 640px).\n * Defaults to true. Set to false to keep it a centered dialog on mobile.\n */\n mobileBottomSheet?: boolean;\n\n /** Custom component to render in the modal body */\n component?: Type<unknown>;\n /** Custom template to render in the modal body */\n template?: TemplateRef<unknown>;\n /** Inputs for the custom component */\n inputs?: ModalInputMap;\n}\n\n// =========================\n// Specialized Configs\n// =========================\n\nexport type WizardBeforeCompleteValidator<TResult = unknown> = (\n payload: Record<ModalStepId, Record<string, unknown>>\n) => Promise<Partial<Record<keyof TResult & string, string>> | null> | Partial<Record<keyof TResult & string, string>> | null;\n\nexport type WizardModalConfig<TResult = WizardResult> = {\n kind: ModalKind.WIZARD;\n steps: WizardStepConfig[];\n startStepId?: ModalStepId;\n flow?: WizardFlowMode;\n onStepChange?: WizardStepChangeHandler;\n onComplete?: ModalResultHandler<TResult>;\n /** Cross-step validators run before wizard completion */\n onBeforeComplete?: WizardBeforeCompleteValidator<TResult>[];\n /** Global initial values for all steps */\n initialValue?: Partial<TResult>;\n} & BaseModalConfig<TResult>\n\nexport type FormModalConfig<TModel = unknown, TResult = TModel> = {\n kind: ModalKind.FORM;\n body?: StepBodyConfig;\n fields: FormFieldConfig<TModel>[];\n rows?: FormRow<TModel>[];\n layout?: FormLayoutMode;\n initialValue?: Partial<TModel>;\n submitMode?: SubmitMode;\n onComplete?: ModalResultHandler<TResult>;\n /** Form-level validators for cross-field validation */\n formValidators?: FormValidator<TModel>[];\n /** Angular FormGroup-level validators (e.g., Validators.required on the group) */\n groupValidators?: ValidatorFn[];\n /** Field groups with section headers */\n fieldGroups?: FormFieldGroup<TModel>[];\n} & BaseModalConfig<TResult>\n\nexport type ConfirmationModalConfig<TResult = boolean> = {\n kind: ModalKind.CONFIRMATION;\n message: string;\n tone?: ConfirmationTone;\n confirm?: ConfirmationActionConfig<TResult>;\n cancel?: CancellationActionConfig;\n\n // Form-like capabilities for hybrid confirmation modals\n body?: StepBodyConfig;\n fields?: FormFieldConfig<unknown>[];\n rows?: FormRow<unknown>[];\n fieldGroups?: FormFieldGroup<unknown>[];\n formValidators?: FormValidator<unknown>[];\n groupValidators?: ValidatorFn[];\n initialValue?: Partial<unknown>;\n} & BaseModalConfig<TResult>\n\nexport type CustomModalConfig<TResult = unknown> = {\n kind: ModalKind.CUSTOM;\n onComplete?: ModalResultHandler<TResult>;\n} & BaseModalConfig<TResult>\n\n// =========================\n// Union Root Config\n// =========================\n\nexport type ModalConfig<TResult = unknown, TModel = unknown> =\n | WizardModalConfig<TResult>\n | FormModalConfig<TModel, TResult>\n | ConfirmationModalConfig<TResult>\n | CustomModalConfig<TResult>;\n","import {LucideArrowLeft, LucideArrowRight, LucideCheck, LucideIconData, LucideTrash2, LucideX,} from '@lucide/angular';\nimport {ActionStyle} from './mn-modal.types';\n\n/**\n * Default leading-icon size (px) for modal action buttons, matching the standard\n * (`md`) button. Small (`sm`) buttons use {@link MODAL_ACTION_ICON_SIZE_SM}.\n */\nexport const MODAL_ACTION_ICON_SIZE = 18;\n\n/** Leading-icon size (px) for `sm`-sized modal action buttons. */\nexport const MODAL_ACTION_ICON_SIZE_SM = 16;\n\n/**\n * The canonical Lucide icon data used as defaults across all modal action buttons.\n * Each value is a Lucide icon's static `.icon` data, rendered via the dynamic\n * `svg[lucideIcon]` directive so no icon has to be registered in `MN_ICON_MAP`.\n */\nexport const MN_MODAL_ACTION_ICONS = {\n /** Affirmative action (confirm / submit / complete). */\n confirm: LucideCheck.icon as LucideIconData,\n /** Destructive action (danger style). */\n danger: LucideTrash2.icon as LucideIconData,\n /** Cancel / dismiss / close action. */\n cancel: LucideX.icon as LucideIconData,\n /** Wizard forward navigation (rendered trailing). */\n next: LucideArrowRight.icon as LucideIconData,\n /** Wizard backward navigation. */\n back: LucideArrowLeft.icon as LucideIconData,\n} as const;\n\n/**\n * Resolves the default action-button icon from its {@link ActionStyle}. Used by\n * generic footer actions and any confirm button that has no explicit icon:\n * `DANGER` → trash, `PRIMARY` → check, everything else (`GHOST`/`SECONDARY`) → cross.\n * @param style The action's style, if any.\n * @returns The Lucide icon data to render.\n */\nexport function defaultIconForStyle(style?: ActionStyle): LucideIconData {\n switch (style) {\n case ActionStyle.DANGER:\n return MN_MODAL_ACTION_ICONS.danger;\n case ActionStyle.PRIMARY:\n return MN_MODAL_ACTION_ICONS.confirm;\n default:\n return MN_MODAL_ACTION_ICONS.cancel;\n }\n}\n","import {InjectionToken} from '@angular/core';\n\n/**\n * Intensity of a haptic impact. Mirrors the three impact weights exposed by most\n * native haptic engines (e.g. Capacitor Haptics `ImpactStyle`) without binding the\n * library to any particular implementation.\n */\nexport type MnHapticStyle = 'light' | 'medium' | 'heavy';\n\n/**\n * Abstraction over a native haptic feedback engine.\n *\n * The modal feature deliberately does NOT depend on Capacitor (or any other native\n * bridge) so the library stays usable in plain web apps. Consumers that run inside a\n * native shell provide an implementation of this handler through {@link MN_HAPTICS};\n * when no handler is provided the modal simply skips haptic feedback.\n */\nexport type MnHapticsHandler = {\n /**\n * Triggers a transient impact-style haptic.\n * @param style Intensity of the impact.\n */\n impact(style: MnHapticStyle): void;\n}\n\n/**\n * Optional DI token used by the bottom sheet to emit haptic feedback on native\n * platforms (sheet open, swipe-dismiss, and snap-back). Provide a {@link MnHapticsHandler}\n * at the application root to enable it; leave unprovided on the web (the modal injects it\n * with `{ optional: true }` and no-ops when absent).\n */\nexport const MN_HAPTICS = new InjectionToken<MnHapticsHandler>('MN_HAPTICS');\n","import {Validators, ValidatorFn} from '@angular/forms';\nimport {\n FormFieldConfig,\n FormFieldGroup,\n FormRow,\n FormRowField,\n FormValidator,\n StepBodyConfig,\n} from '../mn-modal.types';\n\n/**\n * Shared interface for configurations that support form layouts.\n */\nexport type FormContainerConfig<TModel = unknown> = {\n fields?: FormFieldConfig<TModel>[];\n rows?: FormRow<TModel>[];\n fieldGroups?: FormFieldGroup<TModel>[];\n formValidators?: FormValidator<TModel>[];\n groupValidators?: ValidatorFn[];\n initialValue?: Partial<TModel>;\n body?: StepBodyConfig;\n}\n\ntype WithAutoFocus = { autoFocus?: boolean };\ntype WithValidators = { validators?: ValidatorFn[] };\n\n/**\n * A self-referential type so that field-group builder methods can be chained.\n * e.g. g.field(...).field(...).field(...)\n */\nexport type ChainableGroupBuilder<TModel> = FormLayoutBuilder<TModel, ChainableGroupBuilder<TModel>>;\n\n/**\n * A builder class that provides form layout capabilities (fields, rows, groups).\n * This can be used as a delegate to avoid code duplication between FormModalBuilder and StepBuilder.\n */\nexport class FormLayoutBuilder<TModel = unknown, TParent = unknown> {\n private currentRow: FormRowField<TModel>[] = [];\n private currentRowColumns = 1;\n\n constructor(\n private readonly config: FormContainerConfig<TModel>,\n private parent: TParent\n ) {\n this.config.fields = this.config.fields || [];\n this.config.rows = this.config.rows || [];\n }\n\n /**\n * Add a custom body/content to the form/step.\n */\n body(body: StepBodyConfig): TParent {\n this.config.body = body;\n return this.parent;\n }\n\n /**\n * Add a field as a full-width row (single column).\n */\n field(field: FormFieldConfig<TModel>): TParent {\n this.flushCurrentRow();\n this.config.fields = this.config.fields || [];\n this.config.fields.push(field);\n this.config.rows = this.config.rows || [];\n this.config.rows.push({\n columns: 1,\n fields: [{ field, span: 1 }],\n });\n return this.parent;\n }\n\n /**\n * Start a new row with the specified number of columns.\n * All subsequent `addToRow()` calls will add fields to this row.\n */\n row(columns = 2): TParent {\n this.flushCurrentRow();\n this.currentRowColumns = columns;\n return this.parent;\n }\n\n /**\n * Add a field to the current row started by `row()`.\n * @param field - The field configuration\n * @param span - How many columns this field should span (default: 1)\n */\n addToRow(field: FormFieldConfig<TModel>, span = 1): TParent {\n this.config.fields = this.config.fields || [];\n this.config.fields.push(field);\n this.currentRow.push({ field, span });\n return this.parent;\n }\n\n /**\n * Declarative way to add a row.\n * @example\n * .addRow(2, row => {\n * row.add({ kind: FieldKind.TEXT, key: 'first', ... });\n * row.add({ kind: FieldKind.TEXT, key: 'last', ... });\n * })\n */\n addRow(\n columns: number,\n buildFn: (row: { add: (field: FormFieldConfig<TModel>, span?: number) => void }) => void\n ): TParent {\n this.flushCurrentRow();\n const rowFields: FormRowField<TModel>[] = [];\n buildFn({\n add: (field: FormFieldConfig<TModel>, span = 1) => {\n this.config.fields = this.config.fields || [];\n this.config.fields.push(field);\n rowFields.push({ field, span });\n },\n });\n\n if (rowFields.length > 0) {\n this.config.rows = this.config.rows || [];\n this.config.rows.push({\n columns,\n fields: rowFields,\n });\n }\n return this.parent;\n }\n\n /**\n * Add a field group with a section header.\n */\n fieldGroup(group: FormFieldGroup<TModel>): TParent;\n /**\n * Add a field group using a functional builder.\n */\n fieldGroup(\n title: string,\n buildFn: (group: ChainableGroupBuilder<TModel>) => void\n ): TParent;\n /**\n * Add a field group with title, description, and a functional builder.\n */\n fieldGroup(\n title: string,\n description: string,\n buildFn: (group: ChainableGroupBuilder<TModel>) => void\n ): TParent;\n fieldGroup(\n arg1: string | FormFieldGroup<TModel>,\n arg2?: string | ((group: ChainableGroupBuilder<TModel>) => void),\n arg3?: (group: ChainableGroupBuilder<TModel>) => void\n ): TParent {\n this.flushCurrentRow();\n\n if (typeof arg1 !== 'string') {\n const group = arg1;\n this.processFieldGroup(group);\n return this.parent;\n }\n\n const title = arg1;\n let description: string | undefined;\n let buildFn: (group: ChainableGroupBuilder<TModel>) => void;\n\n if (typeof arg2 === 'string') {\n description = arg2;\n buildFn = arg3!;\n } else {\n buildFn = arg2!;\n }\n\n const groupConfig: FormContainerConfig<TModel> = {\n fields: [],\n rows: [],\n };\n const groupBuilder = new FormLayoutBuilder<TModel, ChainableGroupBuilder<TModel>>(\n groupConfig,\n null as unknown as ChainableGroupBuilder<TModel>\n );\n (groupBuilder as ChainableGroupBuilder<TModel>).parent = groupBuilder as ChainableGroupBuilder<TModel>;\n buildFn(groupBuilder as ChainableGroupBuilder<TModel>);\n groupBuilder.flushCurrentRow();\n\n const group: FormFieldGroup<TModel> = {\n title,\n description,\n fields: groupConfig.fields || [],\n rows: groupConfig.rows || [],\n };\n\n this.processFieldGroup(group);\n return this.parent;\n }\n\n private processFieldGroup(group: FormFieldGroup<TModel>): void {\n if (!this.config.fieldGroups) {\n this.config.fieldGroups = [];\n }\n\n // Also add group fields to the flat fields array for form control creation\n this.config.fields = this.config.fields || [];\n const fields = this.config.fields;\n group.fields.forEach((f) => fields.push(f));\n\n // Build rows for the group if not provided\n if (!group.rows || group.rows.length === 0) {\n group.rows = group.fields.map((f) => ({\n columns: 1,\n fields: [{ field: f, span: 1 }],\n }));\n }\n\n this.config.fieldGroups.push(group);\n }\n\n /**\n * Add form-level validators for cross-field validation.\n */\n formValidators(validators: FormValidator<TModel>[]): TParent {\n this.config.formValidators = validators;\n return this.parent;\n }\n\n /**\n * Add Angular FormGroup-level validators.\n */\n groupValidators(validators: ValidatorFn[]): TParent {\n this.config.groupValidators = validators;\n return this.parent;\n }\n\n /**\n * Set initial value for fields.\n */\n initialValue(value: Partial<TModel>): TParent {\n this.config.initialValue = value;\n return this.parent;\n }\n\n /**\n * Set the field to be focused when the form initializes.\n */\n focus(key: keyof TModel): TParent {\n this.config.fields?.forEach(f => {\n (f as WithAutoFocus).autoFocus = false;\n });\n this.config.fieldGroups?.forEach(g => {\n g.fields.forEach(f => {\n (f as WithAutoFocus).autoFocus = false;\n });\n });\n\n const field = this.config.fields?.find(f => (f as unknown as { key: keyof TModel }).key === key);\n if (field) {\n (field as WithAutoFocus).autoFocus = true;\n }\n return this.parent;\n }\n\n /**\n * Wraps a field with a fluent API for validation.\n */\n fieldWithValidators(field: FormFieldConfig<TModel>): FieldValidatorBuilder<TModel, TParent> {\n const fieldWithV = field as WithValidators;\n fieldWithV.validators = fieldWithV.validators || [];\n this.field(field);\n return new FieldValidatorBuilder(field, this.parent);\n }\n\n /**\n * Flushes any pending fields in the current row to the configuration.\n */\n flushCurrentRow(): void {\n if (this.currentRow.length > 0) {\n this.config.rows!.push({\n columns: this.currentRowColumns,\n fields: [...this.currentRow],\n });\n this.currentRow = [];\n this.currentRowColumns = 1;\n }\n }\n}\n\n/**\n * A builder for adding validation rules to a field fluently.\n */\nexport class FieldValidatorBuilder<TModel = unknown, TParent = unknown> {\n constructor(\n private field: FormFieldConfig<TModel>,\n private parent: TParent\n ) {\n (this.field as WithValidators).validators = (this.field as WithValidators).validators || [];\n }\n\n required(_message?: string): this {\n (this.field as WithValidators).validators!.push(Validators.required);\n return this;\n }\n\n minLength(length: number): this {\n (this.field as WithValidators).validators!.push(Validators.minLength(length));\n return this;\n }\n\n maxLength(length: number): this {\n (this.field as WithValidators).validators!.push(Validators.maxLength(length));\n return this;\n }\n\n pattern(pattern: string | RegExp): this {\n (this.field as WithValidators).validators!.push(Validators.pattern(pattern));\n return this;\n }\n\n email(): this {\n (this.field as WithValidators).validators!.push(Validators.email);\n return this;\n }\n\n min(value: number): this {\n (this.field as WithValidators).validators!.push(Validators.min(value));\n return this;\n }\n\n max(value: number): this {\n (this.field as WithValidators).validators!.push(Validators.max(value));\n return this;\n }\n\n /**\n * Add a custom validator.\n */\n custom(validator: ValidatorFn): this {\n (this.field as WithValidators).validators!.push(validator);\n return this;\n }\n\n /**\n * Return to the parent builder.\n */\n done(): TParent {\n return this.parent;\n }\n}\n","import {\n FormFieldConfig,\n FormFieldGroup,\n FormValidator,\n ModalInputMap,\n ModalStepId,\n StepBodyConfig,\n StepGuard,\n StepState,\n StepValidator,\n WizardStepConfig,\n} from '../mn-modal.types';\nimport {ChainableGroupBuilder, FormLayoutBuilder} from './form-layout.builder';\nimport {ValidatorFn} from '@angular/forms';\n\nexport class StepBuilder<TModel = unknown> {\n private config: WizardStepConfig<TModel>;\n private layoutBuilder: FormLayoutBuilder<TModel, this>;\n\n constructor(id: string, title: string) {\n this.config = {\n id,\n title,\n fields: [],\n state: StepState.PENDING,\n };\n this.layoutBuilder = new FormLayoutBuilder(this.config, this);\n }\n\n /**\n * Set the step body. Accepts plain text, a component, or a template.\n * @param body The step body content (string, component `Type`, or `TemplateRef`).\n * @param inputs Optional inputs for a component/template body (ignored for text).\n */\n body(body: StepBodyConfig, inputs?: ModalInputMap): this {\n this.config.body = body;\n if (inputs !== undefined) {\n this.config.bodyInputs = inputs;\n }\n return this;\n }\n\n state(state: StepState): this {\n this.config.state = state;\n return this;\n }\n\n guard(guard: StepGuard): this {\n this.config.guard = guard;\n return this;\n }\n\n validators(validators: StepValidator[]): this {\n this.config.validators = validators;\n return this;\n }\n\n field(field: FormFieldConfig<TModel>): this {\n return this.layoutBuilder.field(field);\n }\n\n row(columns = 2): this {\n return this.layoutBuilder.row(columns);\n }\n\n addToRow(field: FormFieldConfig<TModel>, span = 1): this {\n return this.layoutBuilder.addToRow(field, span);\n }\n\n addRow(\n columns: number,\n buildFn: (row: { add: (field: FormFieldConfig<TModel>, span?: number) => void }) => void\n ): this {\n return this.layoutBuilder.addRow(columns, buildFn);\n }\n\n fieldGroup(group: FormFieldGroup<TModel>): this;\n fieldGroup(title: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;\n fieldGroup(title: string, description: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;\n fieldGroup(\n arg1: string | FormFieldGroup<TModel>,\n arg2?: string | ((group: ChainableGroupBuilder<TModel>) => void),\n arg3?: (group: ChainableGroupBuilder<TModel>) => void\n ): this {\n if (typeof arg1 !== 'string') {\n return this.layoutBuilder.fieldGroup(arg1);\n }\n if (typeof arg2 === 'string') {\n return this.layoutBuilder.fieldGroup(arg1, arg2, arg3!);\n }\n return this.layoutBuilder.fieldGroup(arg1, arg2!);\n }\n\n formValidators(validators: FormValidator<TModel>[]): this {\n return this.layoutBuilder.formValidators(validators);\n }\n\n groupValidators(validators: ValidatorFn[]): this {\n return this.layoutBuilder.groupValidators(validators);\n }\n\n initialValue(value: Partial<TModel>): this {\n return this.layoutBuilder.initialValue(value);\n }\n\n visible(\n condition: (aggregatedData: Record<ModalStepId, Record<string, unknown>>) => boolean\n ): this {\n this.config.visible = condition;\n return this;\n }\n\n nextLabel(label: string): this {\n this.config.nextLabel = label;\n return this;\n }\n\n backLabel(label: string): this {\n this.config.backLabel = label;\n return this;\n }\n\n hideBack(hide = true): this {\n this.config.hideBack = hide;\n return this;\n }\n\n build(): WizardStepConfig<TModel> {\n this.layoutBuilder.flushCurrentRow();\n return this.config;\n }\n}\n","import {\n ChainableGroupBuilder,\n FieldValidatorBuilder,\n FormContainerConfig,\n FormLayoutBuilder\n} from './form-layout.builder';\nimport {\n AnimationOptions,\n BackdropMode,\n BaseModalConfig,\n CloseMode,\n FormFieldConfig,\n FormFieldGroup,\n KeyboardMode,\n ModalCancelHandler,\n ModalFooterAction,\n ModalI18nLabels,\n ModalInputMap,\n ModalIntent,\n ModalPollingConfig,\n ModalSize,\n StepBodyConfig,\n TemplateRef,\n Type,\n} from '../mn-modal.types';\nimport {ValidatorFn} from '@angular/forms';\n\nexport abstract class BaseModalBuilder<TConfig extends BaseModalConfig<TResult> & FormContainerConfig<TModel>, TResult = unknown, TModel = unknown> {\n protected config: TConfig;\n protected layoutBuilder: FormLayoutBuilder<TModel, this>;\n\n protected constructor(initialConfig: TConfig) {\n this.config = initialConfig;\n this.layoutBuilder = new FormLayoutBuilder<TModel, this>(\n this.config,\n this\n );\n }\n\n title(title: string): this {\n this.config.title = title;\n return this;\n }\n\n subtitle(subtitle: string): this {\n this.config.subtitle = subtitle;\n return this;\n }\n\n description(description: string): this {\n this.config.description = description;\n return this;\n }\n\n closeGuard(guard: () => Promise<boolean> | boolean): this {\n this.config.closeGuard = guard;\n return this;\n }\n\n /** Set the width of the modal */\n sizeWidth(size: ModalSize): this {\n this.config.sizeWidth = size;\n return this;\n }\n\n /** Set the height of the modal */\n sizeHeight(size: ModalSize): this {\n this.config.sizeHeight = size;\n return this;\n }\n\n closeMode(mode: CloseMode): this {\n this.config.closeMode = mode;\n return this;\n }\n\n backdrop(mode: BackdropMode): this {\n this.config.backdrop = mode;\n return this;\n }\n\n keyboard(mode: KeyboardMode): this {\n this.config.keyboard = mode;\n return this;\n }\n\n intent(intent: ModalIntent): this {\n this.config.intent = intent;\n return this;\n }\n\n readOnly(readOnly = true): this {\n this.config.readOnly = readOnly;\n return this;\n }\n\n disabled(disabled = true): this {\n this.config.disabled = disabled;\n return this;\n }\n\n footerActions(actions: ModalFooterAction<TResult>[]): this {\n this.config.footerActions = actions;\n return this;\n }\n\n polling(config: ModalPollingConfig<TResult>): this {\n this.config.polling = config;\n return this;\n }\n\n onCancel(handler: ModalCancelHandler<TResult>): this {\n this.config.onCancel = handler;\n return this;\n }\n\n i18n(labels: ModalI18nLabels): this {\n this.config.i18n = labels;\n return this;\n }\n\n component(component: Type<unknown>): this {\n this.config.component = component;\n return this;\n }\n\n template(template: TemplateRef<unknown>): this {\n this.config.template = template;\n return this;\n }\n\n inputs(inputs: ModalInputMap): this {\n this.config.inputs = inputs;\n return this;\n }\n\n animation(animation: AnimationOptions | AnimationOptions['type']): this {\n this.config.animation = animation;\n return this;\n }\n\n /**\n * Control whether the modal renders as a bottom sheet on small screens (< 640px).\n * Enabled by default; pass `false` to keep a centered dialog on mobile.\n */\n mobileBottomSheet(enabled = true): this {\n this.config.mobileBottomSheet = enabled;\n return this;\n }\n\n /**\n * Add a custom body/content to the modal.\n */\n body(body: StepBodyConfig): this {\n return this.layoutBuilder.body(body);\n }\n\n /**\n * Add a field.\n */\n field(field: FormFieldConfig<TModel>): this {\n return this.layoutBuilder.field(field);\n }\n\n /**\n * Add a field with a fluent validation builder.\n */\n fieldWithValidators(field: FormFieldConfig<TModel>): FieldValidatorBuilder<TModel, this> {\n return this.layoutBuilder.fieldWithValidators(field);\n }\n\n /**\n * Start a new row.\n */\n row(columns = 2): this {\n return this.layoutBuilder.row(columns);\n }\n\n /**\n * Add a field to the current row.\n */\n addToRow(field: FormFieldConfig<TModel>, span = 1): this {\n return this.layoutBuilder.addToRow(field, span);\n }\n\n /**\n * Declarative way to add a row.\n */\n addRow(\n columns: number,\n buildFn: (row: { add: (field: FormFieldConfig<TModel>, span?: number) => void }) => void\n ): this {\n return this.layoutBuilder.addRow(columns, buildFn);\n }\n\n /**\n * Add a field group.\n */\n fieldGroup(group: FormFieldGroup<TModel>): this;\n fieldGroup(title: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;\n fieldGroup(title: string, description: string, buildFn: (group: ChainableGroupBuilder<TModel>) => void): this;\n fieldGroup(\n arg1: string | FormFieldGroup<TModel>,\n arg2?: string | ((group: ChainableGroupBuilder<TModel>) => void),\n arg3?: (group: ChainableGroupBuilder<TModel>) => void\n ): this {\n if (typeof arg1 !== 'string') {\n return this.layoutBuilder.fieldGroup(arg1);\n }\n if (typeof arg2 === 'string') {\n return this.layoutBuilder.fieldGroup(arg1, arg2, arg3!);\n }\n return this.layoutBuilder.fieldGroup(arg1, arg2!);\n }\n\n groupValidators(validators: ValidatorFn[]): this {\n return this.layoutBuilder.groupValidators(validators);\n }\n\n build(): Readonly<TConfig> {\n this.layoutBuilder.flushCurrentRow();\n return Object.freeze({ ...this.config });\n }\n}\n","import {BaseModalBuilder} from './base-modal.builder';\nimport {StepBuilder} from './step.builder';\nimport {\n ModalKind,\n ModalResultHandler,\n ModalStepId,\n WizardBeforeCompleteValidator,\n WizardFlowMode,\n WizardModalConfig,\n WizardResult,\n WizardStepChangeHandler,\n WizardStepConfig,\n} from '../mn-modal.types';\n\nexport class WizardModalBuilder<TResult = WizardResult> extends BaseModalBuilder<\n WizardModalConfig<TResult>,\n TResult\n> {\n constructor() {\n super({\n kind: ModalKind.WIZARD,\n steps: [],\n } as unknown as WizardModalConfig<TResult>);\n }\n\n /**\n * Set initial values for the entire wizard.\n * Note: This will be merged with individual step initial values.\n */\n initialValue(value: Partial<TResult>): this {\n this.config.initialValue = value;\n return this;\n }\n\n /**\n * Description is not supported for wizard modals.\n * Use step-level body text instead.\n */\n override description(_description: string): this {\n return this;\n }\n\n step<TStepModel = unknown>(\n step: WizardStepConfig<TStepModel> | ((builder: StepBuilder<TStepModel>) => void)\n ): this {\n if (typeof step === 'function') {\n const builder = new StepBuilder<TStepModel>('', '');\n step(builder);\n const builtStep = builder.build();\n this.config.steps.push(builtStep as unknown as WizardStepConfig<unknown>);\n } else {\n this.config.steps.push(step as unknown as WizardStepConfig<unknown>);\n }\n return this;\n }\n\n addStep<TStepModel = unknown>(\n title: string,\n buildFn: (builder: StepBuilder<TStepModel>) => void,\n id?: ModalStepId\n ): this {\n const stepId = id || `step-${this.config.steps.length}`;\n const builder = new StepBuilder<TStepModel>(stepId, title);\n buildFn(builder);\n const builtStep = builder.build();\n this.config.steps.push(builtStep as unknown as WizardStepConfig<unknown>);\n return this;\n }\n\n startAt(stepId: ModalStepId): this {\n this.config.startStepId = stepId;\n return this;\n }\n\n flow(mode: WizardFlowMode): this {\n this.config.flow = mode;\n return this;\n }\n\n onStepChange(handler: WizardStepChangeHandler): this {\n this.config.onStepChange = handler;\n return this;\n }\n\n onComplete(handler: ModalResultHandler<TResult>): this {\n this.config.onComplete = handler;\n return this;\n }\n\n onBeforeComplete(validators: WizardBeforeCompleteValidator<TResult>[]): this {\n this.config.onBeforeComplete = validators;\n return this;\n }\n}\n","import { BaseModalBuilder } from './base-modal.builder';\nimport {\n FormModalConfig,\n ModalKind,\n FormFieldConfig,\n FormLayoutMode,\n SubmitMode,\n ModalResultHandler,\n FormValidator,\n MultiSelectTableFieldConfig,\n SingleSelectTableFieldConfig,\n} from '../mn-modal.types';\nimport {ValidatorFn} from '@angular/forms';\n\nexport class FormModalBuilder<TModel = unknown, TResult = TModel> extends BaseModalBuilder<\n FormModalConfig<TModel, TResult>,\n TResult,\n TModel\n> {\n constructor() {\n super({\n kind: ModalKind.FORM,\n fields: [],\n rows: [],\n });\n }\n\n /**\n * Override to also accept table field configs with a concrete TRow (BehaviorSubject is invariant,\n * so TableDataSource<TeamMember> is not assignable to TableDataSource<unknown>).\n */\n override field(field: FormFieldConfig<TModel>): this;\n override field<TRow>(field: MultiSelectTableFieldConfig<TModel, TRow> | SingleSelectTableFieldConfig<TModel, TRow>): this;\n override field<TRow = unknown>(\n field: FormFieldConfig<TModel> | MultiSelectTableFieldConfig<TModel, TRow> | SingleSelectTableFieldConfig<TModel, TRow>\n ): this {\n return super.field(field as FormFieldConfig<TModel>);\n }\n\n layout(mode: FormLayoutMode): this {\n this.config.layout = mode;\n return this;\n }\n\n initialValue(value: Partial<TModel>): this {\n return this.layoutBuilder.initialValue(value);\n }\n\n submitMode(mode: SubmitMode): this {\n this.config.submitMode = mode;\n return this;\n }\n\n onComplete(handler: ModalResultHandler<TResult>): this {\n this.config.onComplete = handler;\n return this;\n }\n\n formValidators(validators: FormValidator<TModel>[]): this {\n return this.layoutBuilder.formValidators(validators);\n }\n\n override groupValidators(validators: ValidatorFn[]): this {\n return this.layoutBuilder.groupValidators(validators);\n }\n\n override build(): Readonly<FormModalConfig<TModel, TResult>> {\n return super.build();\n }\n}\n","import { BaseModalBuilder } from './base-modal.builder';\nimport {\n ConfirmationModalConfig,\n ModalKind,\n ConfirmationTone,\n ConfirmationActionConfig,\n CancellationActionConfig,\n FormValidator,\n} from '../mn-modal.types';\nimport {ValidatorFn} from '@angular/forms';\n\nexport class ConfirmationModalBuilder<TResult = boolean> extends BaseModalBuilder<\n ConfirmationModalConfig<TResult>,\n TResult\n> {\n constructor() {\n super({\n kind: ModalKind.CONFIRMATION,\n message: '',\n fields: [],\n rows: [],\n });\n }\n\n message(text: string): this {\n this.config.message = text;\n return this;\n }\n\n tone(tone: ConfirmationTone): this {\n this.config.tone = tone;\n return this;\n }\n\n confirmAction(action: ConfirmationActionConfig<TResult>): this {\n this.config.confirm = action;\n return this;\n }\n\n cancelAction(action: CancellationActionConfig): this {\n this.config.cancel = action;\n return this;\n }\n\n initialValue(value: Partial<unknown>): this {\n return this.layoutBuilder.initialValue(value);\n }\n\n formValidators(validators: FormValidator<unknown>[]): this {\n return this.layoutBuilder.formValidators(validators);\n }\n\n override groupValidators(validators: ValidatorFn[]): this {\n return this.layoutBuilder.groupValidators(validators);\n }\n\n override build(): Readonly<ConfirmationModalConfig<TResult>> {\n return super.build();\n }\n}\n","import { BaseModalBuilder } from './base-modal.builder';\nimport {\n CustomModalConfig,\n ModalKind,\n ModalResultHandler,\n} from '../mn-modal.types';\n\nexport class CustomModalBuilder<TResult = unknown> extends BaseModalBuilder<\n CustomModalConfig<TResult>,\n TResult\n> {\n constructor() {\n super({\n kind: ModalKind.CUSTOM,\n });\n }\n\n onComplete(handler: ModalResultHandler<TResult>): this {\n this.config.onComplete = handler;\n return this;\n }\n}\n","import { WizardModalBuilder } from './wizard-modal.builder';\nimport { FormModalBuilder } from './form-modal.builder';\nimport { ConfirmationModalBuilder } from './confirmation-modal.builder';\nimport { CustomModalBuilder } from './custom-modal.builder';\nimport {WizardResult} from '../mn-modal.types';\n\nexport class ModalBuilder {\n static wizard<TResult = WizardResult>(): WizardModalBuilder<TResult> {\n return new WizardModalBuilder<TResult>();\n }\n\n static form<TModel = unknown, TResult = TModel>(): FormModalBuilder<TModel, TResult> {\n return new FormModalBuilder<TModel, TResult>();\n }\n\n static confirmation<TResult = boolean>(): ConfirmationModalBuilder<TResult> {\n return new ConfirmationModalBuilder<TResult>();\n }\n\n static custom<TResult = unknown>(): CustomModalBuilder<TResult> {\n return new CustomModalBuilder<TResult>();\n }\n}\n","import { Observable, Subject } from 'rxjs';\nimport {ComponentRef} from '@angular/core';\nimport {\n ModalRef,\n ModalCloseEvent,\n ModalCloseReason,\n BaseModalConfig,\n} from './mn-modal.types';\n\nexport class MnModalRef<TResult = unknown> implements ModalRef<TResult> {\n private readonly closeSubject = new Subject<ModalCloseEvent<TResult>>();\n public readonly afterClosed$: Observable<ModalCloseEvent<TResult>> = this.closeSubject.asObservable();\n\n constructor(\n private componentRef: ComponentRef<unknown>,\n private config: BaseModalConfig<TResult>\n ) {}\n\n close(result?: TResult): void {\n const event: ModalCloseEvent<TResult> = {\n reason: ModalCloseReason.COMPLETED,\n result,\n };\n this.animateAndDestroy(event);\n }\n\n dismiss(reason: ModalCloseReason): void {\n const event: ModalCloseEvent<TResult> = {\n reason,\n };\n this.animateAndDestroy(event);\n }\n\n private async animateAndDestroy(event: ModalCloseEvent<TResult>): Promise<void> {\n const shell = this.componentRef.instance as { startClosing?: () => Promise<void> };\n if (shell && typeof shell.startClosing === 'function') {\n await shell.startClosing();\n }\n this.closeSubject.next(event);\n this.closeSubject.complete();\n this.destroy();\n }\n\n update(config: Partial<BaseModalConfig<TResult>>): void {\n Object.assign(this.config, config);\n // Trigger change detection on the shell component\n this.componentRef.changeDetectorRef.detectChanges();\n }\n\n get component(): unknown {\n return this.componentRef.instance;\n }\n\n private destroy(): void {\n this.componentRef.destroy();\n }\n}\n","import {\n Directive,\n Input,\n ViewContainerRef,\n OnInit,\n OnDestroy,\n ComponentRef,\n Type,\n forwardRef,\n inject\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { ModalInputMap } from '../../mn-modal.types';\n\n@Directive({\n selector: '[mnCustomFieldHost]',\n standalone: true,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MnCustomFieldHostDirective),\n multi: true,\n },\n ],\n})\nexport class MnCustomFieldHostDirective implements OnInit, OnDestroy, ControlValueAccessor {\n private vcr = inject(ViewContainerRef);\n\n @Input() component!: Type<unknown>;\n @Input() inputs?: ModalInputMap;\n\n private componentRef?: ComponentRef<unknown>;\n private onChange: (val: unknown) => void = () => {\n };\n private onTouched: () => void = () => {};\n\n ngOnInit(): void {\n if (!this.component) return;\n\n this.vcr.clear();\n this.componentRef = this.vcr.createComponent(this.component);\n\n // Pass inputs to the component\n if (this.inputs) {\n Object.entries(this.inputs).forEach(([key, value]) => {\n (this.componentRef!.instance as Record<string, unknown>)[key] = value;\n });\n }\n\n // Wire up value accessor if the component supports it\n const instance = this.componentRef.instance as {\n registerOnChange?: (fn: (val: unknown) => void) => void;\n registerOnTouched?: (fn: () => void) => void;\n };\n if (typeof instance.registerOnChange === 'function') {\n instance.registerOnChange((val: unknown) => this.onChange(val));\n }\n if (typeof instance.registerOnTouched === 'function') {\n instance.registerOnTouched(() => this.onTouched());\n }\n }\n\n ngOnDestroy(): void {\n this.componentRef?.destroy();\n }\n\n writeValue(val: unknown): void {\n const instance = this.componentRef?.instance as { writeValue?: (val: unknown) => void };\n if (instance && typeof instance.writeValue === 'function') {\n instance.writeValue(val);\n }\n }\n\n registerOnChange(fn: (val: unknown) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n const instance = this.componentRef?.instance as { setDisabledState?: (isDisabled: boolean) => void };\n if (instance && typeof instance.setDisabledState === 'function') {\n instance.setDisabledState(isDisabled);\n }\n }\n}\n","import {TemplateRef} from '@angular/core';\nimport {MnSkeletonProps} from '../mn-skeleton';\nimport {MnCollectionLabels, MnSelectableCollectionDataSource} from '../mn-collection';\nimport {MnActionIcon, MnDropdownActionColor} from '../mn-dropdown';\n\n// ── Column Sort Type ──\nexport enum ColumnSortType {\n ALPHABETICAL = 'ALPHABETICAL',\n NUMERICAL = 'NUMERICAL',\n DATE = 'DATE',\n NONE = 'NONE',\n}\n\n// ── Sort State ──\nexport type SortState = {\n columnKey: string;\n direction: 'asc' | 'desc';\n}\n\n// ── Appearance ──\nexport type TableAppearance = {\n striped?: boolean;\n hover?: boolean;\n compact?: boolean;\n bordered?: boolean;\n /**\n * How column widths are computed. Defaults to `stable`.\n *\n * - `stable` (default): the best of both. The first render with rows on screen\n * uses the browser's automatic layout, so each column is sized in proportion to\n * its real content; those measured widths are then pinned and the table switches\n * to a fixed layout. Columns therefore keep sensible, content-derived\n * proportions **and** stop moving when the rows change underneath — a new page,\n * a filter or a search cannot resize them. Widths are re-measured only when the\n * table itself is resized (or a {@link ColumnBase.hiddenBelow} column appears or\n * disappears), never when the rows change. Content that no longer fits is\n * truncated with an ellipsis and exposed as a `title` tooltip.\n * - `auto`: the plain browser layout. Every column is re-sized to its widest cell\n * on every change, so the columns shift on each new page, filter and search.\n * Use it for a static table, or when a cell must never be truncated.\n * - `fixed`: widths are **data-independent**. Nothing is measured — not the cell\n * content, and not the header text either. Each column is either its declared\n * {@link ColumnBase.width} or an even share of whatever is left over:\n * `(table width − Σ declared widths) ÷ number of undeclared visible columns`.\n * Only worth choosing over `stable` when every column declares a `width`, or\n * when a deliberate even split is what you want: with widths undeclared, a\n * two-character status column is handed exactly as much room as a long\n * description.\n */\n layout?: 'auto' | 'fixed' | 'stable';\n}\n\n// ── Column Filter Type ──\n/**\n * The control rendered for a column filter, and the shape of the value it produces:\n * - `text` → `string` (free-text, debounced)\n * - `select` → `string` (single choice; empty string means \"no filter\")\n * - `multi-select` → `string[]` (OR semantics across the chosen values)\n * - `boolean` → `boolean` (tri-state: any / true / false)\n */\nexport type ColumnFilterType = 'text' | 'select' | 'multi-select' | 'boolean';\n\n// ── Column Filter Option ──\nexport type ColumnFilterOption = {\n label: string;\n value: string;\n}\n\n/** Every value shape a column filter can hold, discriminated by {@link ColumnFilterType}. */\nexport type ColumnFilterValue = string | string[] | boolean;\n\n/** Map of column key to its current filter value. */\nexport type ColumnFilterState = Record<string, ColumnFilterValue | undefined>;\n\n/**\n * One active column filter, as handed to\n * {@link TableDataSource.onColumnFilterChange}. Only columns whose filter is\n * actually set are included, so the array maps straight onto query params.\n */\nexport type MnColumnFilter = {\n key: string;\n type: ColumnFilterType;\n value: ColumnFilterValue;\n}\n\n// ── Column Skeleton ──\n/**\n * Customizes the loading-skeleton placeholder rendered in a column's cells.\n * Either a partial {@link MnSkeletonProps} (shape/width/height/animated) or a\n * `TemplateRef` for a fully custom placeholder. When omitted, a text-shaped\n * skeleton at 75% width is used (matching the previous default).\n */\nexport type ColumnSkeleton = Partial<MnSkeletonProps> | TemplateRef<unknown>;\n\n// ── Row Action ──\n/**\n * A presentation value that is either fixed for the whole column or derived per row.\n *\n * The function form is what lets one action cover a state that flips — an\n * activate/deactivate toggle, a pin/unpin — instead of declaring two actions and hiding\n * one of them per row. It is only for *presentation*: visibility stays with `hidden` and\n * interactivity with `disabled`, both of which are always predicates.\n *\n * Resolved on every change detection, so the accessor must be cheap and side-effect free.\n */\nexport type MnRowValue<T, V> = V | ((row: T) => V);\n\n/**\n * A per-row command rendered in an actions column (see {@link ColumnBase.actions}).\n * Unlike a cell it carries no display value — choosing it invokes {@link run} with the\n * row. The table renders actions inline as buttons and collapses them into a ⋯ menu\n * (mn-dropdown) once the table is narrower than 450px.\n */\nexport type MnTableRowAction<T> = {\n /** Visible label. Falls back to `labelKey`'s resolved text when omitted. */\n label?: MnRowValue<T, string>;\n /** Translation key for the label, resolved via MnLanguageService and kept updated on locale change. */\n labelKey?: MnRowValue<T, string>;\n /**\n * Optional leading icon: a template (an `<mn-icon>`, a bespoke `<svg>`, …), or lucide\n * icon data such as `LucidePencil.icon`, which the table renders itself. The data form\n * lets an action be declared without an `<ng-template>` stub and a `@ViewChild` per\n * glyph, which is what makes shared action factories practical.\n */\n icon?: MnRowValue<T, MnActionIcon>;\n /** Invoked with the row when the action is chosen. */\n run: (row: T) => void;\n /**\n * Predicate deciding whether the action is hidden for a given row. A hidden action is\n * dropped entirely for that row (not shown, not counted). When every action is hidden\n * for a row its cell is left empty — no buttons and no ⋯ menu. Use this for \"row 1 has\n * actions, row 2 doesn't\", or per-permission actions (e.g. only admins can delete).\n */\n hidden?: (row: T) => boolean;\n /** Predicate deciding whether the action is disabled (shown but non-interactive) for a row. */\n disabled?: (row: T) => boolean;\n /**\n * Tints the action's button and its ⋯-menu item. Defaults to `'primary'` (or\n * `'danger'` when {@link danger} is set), matching the built-in look. Whatever colour\n * an action shows inline is carried into the collapsed bottom-sheet item too.\n */\n color?: MnRowValue<T, MnDropdownActionColor>;\n /** Renders the action in a destructive style (e.g. \"Delete\"). Shorthand for\n * `color: 'danger'`. */\n danger?: boolean;\n};\n\n// ── Column Definition ──\n/** Everything about a column that is independent of filtering. */\nexport type ColumnBase<T> = {\n key: string;\n header: string | TemplateRef<unknown>;\n /** Translation key for the column header. When set, mn-table resolves it via MnLanguageService and keeps it updated on locale change. */\n headerKey?: string;\n /**\n * How a data cell is rendered — a string accessor or a `TemplateRef`. Optional only\n * because an {@link actions} column renders commands instead of a value; every value\n * column must set it.\n */\n cell?: ((row: T) => string) | TemplateRef<unknown>;\n /**\n * Turns this column into an actions column: per-row command buttons rendered inline,\n * automatically collapsing into a ⋯ menu (mn-dropdown) once the table is narrower than\n * 450px. When set, {@link cell} is ignored.\n */\n actions?: MnTableRowAction<T>[];\n /**\n * How each inline action button is presented on a wide table:\n * - `'both'` (default) — icon (when provided) followed by the label;\n * - `'icon'` — icon only; the label becomes the button's accessible name and hover\n * tooltip. An action without an icon falls back to showing its label so it is never\n * blank;\n * - `'label'` — text only, no icon.\n *\n * The collapsed ⋯ menu always lists full labels regardless of this setting, so\n * `'icon'` still reads clearly once the actions move into the bottom sheet on mobile.\n */\n actionsInline?: 'icon' | 'label' | 'both';\n /** Alternative cell renderer shown below the given breakpoint. When set, `cell` is hidden below this breakpoint and `cellSm` is shown instead. */\n cellSm?: { below: 'sm' | 'md' | 'lg'; cell: ((row: T) => string) | TemplateRef<unknown> };\n sortType?: ColumnSortType;\n getRawValueToSort?: (row: T) => unknown;\n width?: string;\n align?: 'left' | 'center' | 'right';\n hiddenBelow?: 'sm' | 'md' | 'lg';\n /** Customizes the loading-skeleton placeholder shown in this column's cells while data loads. */\n skeleton?: ColumnSkeleton;\n}\n\n/** Filter presentation props shared by every filterable column. */\ntype ColumnFilterCommon = {\n /** Whether this column supports per-column filtering. */\n filterable: true;\n /** Placeholder text for the filter input. For `select`, it also labels the \"no filter\" option. */\n filterPlaceholder?: string;\n /** Translation key for the filter placeholder. When set, mn-table resolves it via MnLanguageService. */\n filterPlaceholderKey?: string;\n /** Whether the filter input is disabled. */\n filterDisabled?: boolean;\n /** Autocomplete attribute for the filter input. */\n filterAutocomplete?: string;\n}\n\n/**\n * The filter half of a {@link ColumnDefinition}, discriminated on `filterType` so\n * `filterOptions` is required exactly where it applies and `filterFn` receives the\n * value shape that filter type actually produces.\n *\n * Every branch declares every filter key (inapplicable ones as `never`) so a column\n * can be read and written generically — e.g. mn-table resolving `filterPlaceholderKey`\n * across all columns — without narrowing first.\n */\ntype ColumnFilterConfig<T> =\n | (ColumnFilterCommon & {\n filterType?: 'text';\n filterOptions?: never;\n /** Custom predicate. Receives the row and the trimmed text the user typed. */\n filterFn?: (row: T, filterValue: string) => boolean;\n})\n | (ColumnFilterCommon & {\n filterType: 'select';\n filterOptions: ColumnFilterOption[];\n /** Custom predicate. Receives the row and the selected option value. */\n filterFn?: (row: T, filterValue: string) => boolean;\n})\n | (ColumnFilterCommon & {\n filterType: 'multi-select';\n filterOptions: ColumnFilterOption[];\n /** Custom predicate. Receives the row and every selected option value. */\n filterFn?: (row: T, filterValue: string[]) => boolean;\n})\n | (ColumnFilterCommon & {\n filterType: 'boolean';\n filterOptions?: never;\n /** Custom predicate. Receives the row and the chosen true/false state. */\n filterFn?: (row: T, filterValue: boolean) => boolean;\n})\n | {\n filterable?: false;\n filterType?: never;\n filterOptions?: never;\n filterFn?: never;\n filterPlaceholder?: string;\n filterPlaceholderKey?: string;\n filterDisabled?: never;\n filterAutocomplete?: never;\n};\n\nexport type ColumnDefinition<T> = ColumnBase<T> & ColumnFilterConfig<T>;\n\n// ── Table Data Source ──\nexport type TableDataSource<T> = MnSelectableCollectionDataSource<T> & {\n /** Accessible name of the scrollable table region; without it the `mnCollection.dataTable` convention key is used. */\n ariaLabel?: string;\n columns: ColumnDefinition<T>[];\n\n // Sorting\n defaultSort?: SortState;\n\n // Row interaction\n onRowClick?: (row: T) => void;\n\n // Appearance\n appearance?: TableAppearance;\n\n // Toolbar\n /** Template rendered on the left side of the toolbar (before the search field). */\n toolbarLeftTemplate?: TemplateRef<unknown>;\n /** Template rendered on the right side of the toolbar (after the search field). */\n toolbarRightTemplate?: TemplateRef<unknown>;\n\n // Responsive filters\n /**\n * Label for the toggle button that opens the stacked filter panel on small\n * screens (below 640px). Defaults to \"Filters\".\n */\n filtersLabel?: string;\n /** Translation key for {@link filtersLabel}. Resolved via MnLanguageService. */\n filtersLabelKey?: string;\n /**\n * Label for the action that resets every column filter in the small-screen\n * panel. Defaults to \"Clear all\".\n */\n clearFiltersLabel?: string;\n /** Translation key for {@link clearFiltersLabel}. Resolved via MnLanguageService. */\n clearFiltersLabelKey?: string;\n /** Labels for the range / boolean filter controls. */\n filterLabels?: MnTableFilterLabels;\n\n // Server-side filtering\n /**\n * Callback invoked when a column filter changes (server-side filtering).\n * When provided, mn-table skips client-side column filtering entirely and\n * delegates to the consumer, exactly as {@link MnCollectionDataSource.onServerSearch}\n * does for search: the table resets to page 1 and hands over every active filter.\n *\n * Required whenever filterable columns are combined with\n * `paginationMode: 'paginated'` — client-side filtering would otherwise only\n * filter the page the server already returned, while the paginator kept\n * reporting the unfiltered `totalItems`.\n *\n * Text filters are debounced (300ms); every other filter type fires immediately.\n */\n onColumnFilterChange?: (filters: MnColumnFilter[]) => void;\n}\n\n// ── Filter control labels ──\n/**\n * User-facing labels for the filter controls that need more than a placeholder.\n * Each has a `*Key` counterpart resolved via MnLanguageService on init and on\n * every locale change.\n */\nexport type MnTableFilterLabels = {\n /** Unset option of a boolean filter. Defaults to \"Any\". */\n any?: string;\n anyKey?: string;\n /** True option of a boolean filter. Defaults to \"Yes\". */\n yes?: string;\n yesKey?: string;\n /** False option of a boolean filter. Defaults to \"No\". */\n no?: string;\n noKey?: string;\n /**\n * Summary a multi-select filter collapses to from the second selection onwards.\n * The `{count}` token is replaced with how many are selected. Defaults to\n * `{count} selected`. A column header has room for about one value, so listing\n * them all would overflow the cell the moment a second one is picked.\n */\n selected?: string;\n /** Translation key for {@link selected}. */\n selectedKey?: string;\n}\n\n/** @deprecated Use {@link MnCollectionLabels}. */\nexport type TableLabels = MnCollectionLabels;\n","import {ColumnDefinition, ColumnFilterType, ColumnFilterValue} from './mn-table.types';\n\n/**\n * Pure helpers backing mn-table's per-column filters: the empty value and\n * \"is it set?\" test for each filter type, and the default client-side predicate\n * applied when a column supplies no `filterFn`.\n *\n * Kept free of Angular so the filter semantics can be unit-tested directly.\n */\n\n/** The reset/unset value for a filter type. */\nexport function emptyFilterValue(type: ColumnFilterType): ColumnFilterValue {\n switch (type) {\n case 'multi-select':\n return [];\n case 'boolean':\n case 'text':\n case 'select':\n default:\n return '';\n }\n}\n\n/**\n * Whether a filter value should actually narrow the rows. Empty strings and\n * empty arrays are inactive; `false` on a boolean filter is active (it means\n * \"show only the false rows\"), which is why a plain truthiness check is not\n * enough.\n */\nexport function isFilterValueActive(value: ColumnFilterValue | undefined): boolean {\n if (value === undefined || value === null) return false;\n if (typeof value === 'boolean') return true;\n if (typeof value === 'string') return value.trim().length > 0;\n return Array.isArray(value) && value.length > 0;\n}\n\n/**\n * The value a filter compares against for a row: the column's\n * `getRawValueToSort` when present (the only option for template cells, which\n * have no string to read), otherwise the rendered cell string.\n */\nexport function resolveFilterableValue<T>(column: ColumnDefinition<T>, row: T): unknown {\n if (column.getRawValueToSort) return column.getRawValueToSort(row);\n if (typeof column.cell === 'function') return column.cell(row);\n return '';\n}\n\n/**\n * The default predicate for a filter type, used when the column supplies no\n * `filterFn`. Semantics per type:\n * - `text` — case-insensitive substring match\n * - `select` — exact string equality\n * - `multi-select` — equality against any selected value (OR)\n * - `boolean` — truthiness of the raw value equals the chosen state\n */\nexport function defaultFilterPredicate(\n type: ColumnFilterType,\n raw: unknown,\n value: ColumnFilterValue,\n): boolean {\n switch (type) {\n case 'select':\n return String(raw ?? '') === String(value);\n\n case 'multi-select': {\n const selected = value as string[];\n return selected.some(option => String(raw ?? '') === option);\n }\n\n case 'boolean':\n return Boolean(raw) === value;\n\n case 'text':\n default:\n return String(raw ?? '')\n .toLowerCase()\n .includes(String(value).trim().toLowerCase());\n }\n}\n\n/**\n * Whether a row passes a column's active filter — the column's own `filterFn`\n * when it has one, otherwise {@link defaultFilterPredicate}.\n *\n * `filterFn` is declared per filter type on {@link ColumnDefinition}, so at this\n * generic call site the union of signatures is not callable and the value shape\n * is widened once here. Consumers keep the precise per-type signature where they\n * declare the column, which is where it matters.\n */\nexport function matchesColumnFilter<T>(\n column: ColumnDefinition<T>,\n row: T,\n value: ColumnFilterValue,\n): boolean {\n const filterFn = column.filterFn as ((row: T, filterValue: ColumnFilterValue) => boolean) | undefined;\n if (filterFn) return filterFn(row, value);\n return defaultFilterPredicate(column.filterType ?? 'text', resolveFilterableValue(column, row), value);\n}\n","import {tv, type VariantProps} from 'tailwind-variants';\n\nexport const mnSkeletonVariants = tv({\n base: 'bg-base-300 relative overflow-hidden',\n variants: {\n shape: {\n // Each shape carries a sensible default size so a bare <mn-skeleton> stays\n // visible. The width/height inputs are applied as inline styles, which win\n // over these utility classes whenever the consumer supplies dimensions.\n rectangle: 'rounded-md h-4',\n circle: 'rounded-full h-10 w-10',\n text: 'rounded h-4',\n },\n },\n defaultVariants: {\n shape: 'rectangle',\n },\n});\n\nexport type MnSkeletonVariantProps = VariantProps<typeof mnSkeletonVariants>;\n","import {Component, HostBinding, Input} from '@angular/core';\nimport {MnSkeletonProps} from './mn-skeletonTypes';\nimport {mnSkeletonVariants} from './mn-skeletonVariants';\n\n@Component({\n selector: 'mn-skeleton',\n standalone: true,\n templateUrl: './mn-skeleton.html',\n styleUrls: ['./mn-skeleton.css'],\n})\nexport class MnSkeleton {\n @Input() data: Partial<MnSkeletonProps> = {};\n\n // Skeletons are decorative loading placeholders; hide them from assistive tech.\n // The container that swaps skeleton↔content should carry aria-busy / a live region.\n @HostBinding('attr.aria-hidden') readonly ariaHidden = 'true';\n\n @HostBinding('class')\n get hostClasses(): string {\n return mnSkeletonVariants({shape: this.data.shape});\n }\n\n @HostBinding('style.width')\n get width(): string | null {\n return this.data.width ?? null;\n }\n\n @HostBinding('style.height')\n get height(): string | null {\n return this.data.height ?? null;\n }\n\n get isAnimated(): boolean {\n return this.data.animated !== false;\n }\n}\n","@if (isAnimated) {\n <span class=\"mn-skeleton-shimmer-bar\"></span>\n}\n","import {Directive, ElementRef, inject, Input, OnChanges, Renderer2} from '@angular/core';\n\n/**\n * Attribute directive that applies responsive-hiding classes to table cells/headers.\n * Hides the element by default and shows it as `table-cell` at the specified breakpoint.\n *\n * The breakpoints are **container** queries against the table's own width, not the\n * viewport: a table inside a modal (or any narrow column) is far narrower than the\n * window, so viewport breakpoints would reveal columns the table has no room for.\n * mn-table marks its chrome `@container` for exactly this.\n *\n * Because of that, `sm`/`md`/`lg` mean \"the table is at least this wide\", and the\n * thresholds are **not** the viewport values of the same names — see {@link classMap}.\n *\n * Uses a static class map so Tailwind CSS can detect the full class names at build time.\n *\n * Usage: `<td [mnHiddenBelow]=\"column.hiddenBelow\">`\n */\n@Directive({\n selector: '[mnHiddenBelow]',\n standalone: true,\n})\nexport class MnHiddenBelowDirective implements OnChanges {\n /** The breakpoint below which the element is hidden. */\n @Input() mnHiddenBelow: 'sm' | 'md' | 'lg' | undefined;\n\n private readonly el = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n\n private appliedClasses: string[] = [];\n\n /**\n * Static mapping of breakpoints to their full Tailwind class names, so Tailwind\n * can detect them at build time.\n *\n * These are **container** widths, deliberately lower than the viewport\n * breakpoints they are named after. A table almost never gets the whole window:\n * a page table sits inside a docked sidebar plus page padding, which on a\n * 1280px screen leaves it under 900px. Reusing 1024px for `lg` would demand a\n * ~1400px window before an `lg` column ever appeared — hiding columns on the\n * most ordinary laptop. These values instead express how much room the column\n * itself needs, which is what a container query should measure.\n */\n private readonly classMap: Record<string, string[]> = {\n sm: ['hidden', '@min-[480px]:table-cell'],\n md: ['hidden', '@min-[640px]:table-cell'],\n lg: ['hidden', '@min-[800px]:table-cell'],\n };\n\n ngOnChanges(): void {\n // Remove previously applied classes\n for (const cls of this.appliedClasses) {\n this.renderer.removeClass(this.el.nativeElement, cls);\n }\n this.appliedClasses = [];\n\n if (this.mnHiddenBelow && this.classMap[this.mnHiddenBelow]) {\n const classes = this.classMap[this.mnHiddenBelow];\n for (const cls of classes) {\n this.renderer.addClass(this.el.nativeElement, cls);\n }\n this.appliedClasses = classes;\n }\n }\n}\n","import {Directive, ElementRef, inject, Input, OnChanges, Renderer2} from '@angular/core';\n\n/**\n * Attribute directive that hides an element below the given breakpoint and shows it at/above.\n * Uses `hidden` + `{bp}:inline` so the element is invisible on small screens.\n *\n * Usage: `<span [mnShowAbove]=\"'sm'\">`\n */\n@Directive({\n selector: '[mnShowAbove]',\n standalone: true,\n})\nexport class MnShowAboveDirective implements OnChanges {\n /** The breakpoint at/above which the element becomes visible. */\n @Input() mnShowAbove: 'sm' | 'md' | 'lg' | undefined;\n\n private readonly el = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n\n private appliedClasses: string[] = [];\n\n /** Static mapping of breakpoints to their full Tailwind class names. */\n private readonly classMap: Record<string, string[]> = {\n sm: ['hidden', '@min-[480px]:inline'],\n md: ['hidden', '@min-[640px]:inline'],\n lg: ['hidden', '@min-[800px]:inline'],\n };\n\n ngOnChanges(): void {\n for (const cls of this.appliedClasses) {\n this.renderer.removeClass(this.el.nativeElement, cls);\n }\n this.appliedClasses = [];\n\n if (this.mnShowAbove && this.classMap[this.mnShowAbove]) {\n const classes = this.classMap[this.mnShowAbove];\n for (const cls of classes) {\n this.renderer.addClass(this.el.nativeElement, cls);\n }\n this.appliedClasses = classes;\n }\n }\n}\n","import {Directive, ElementRef, inject, Input, OnChanges, Renderer2} from '@angular/core';\n\n/**\n * Attribute directive that shows an element below the given breakpoint and hides it at/above.\n * Uses `inline` by default + `{bp}:hidden` so the element is only visible on small screens.\n *\n * Usage: `<span [mnShowBelow]=\"'sm'\">`\n */\n@Directive({\n selector: '[mnShowBelow]',\n standalone: true,\n})\nexport class MnShowBelowDirective implements OnChanges {\n /** The breakpoint below which the element is visible. */\n @Input() mnShowBelow: 'sm' | 'md' | 'lg' | undefined;\n\n private readonly el = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n\n private appliedClasses: string[] = [];\n\n /** Static mapping of breakpoints to their full Tailwind class names. */\n private readonly classMap: Record<string, string[]> = {\n sm: ['inline', '@min-[480px]:hidden'],\n md: ['inline', '@min-[640px]:hidden'],\n lg: ['inline', '@min-[800px]:hidden'],\n };\n\n ngOnChanges(): void {\n for (const cls of this.appliedClasses) {\n this.renderer.removeClass(this.el.nativeElement, cls);\n }\n this.appliedClasses = [];\n\n if (this.mnShowBelow && this.classMap[this.mnShowBelow]) {\n const classes = this.classMap[this.mnShowBelow];\n for (const cls of classes) {\n this.renderer.addClass(this.el.nativeElement, cls);\n }\n this.appliedClasses = classes;\n }\n }\n}\n","import {TemplateRef} from '@angular/core';\nimport {LucideIconData} from '@lucide/angular';\nimport {BehaviorSubject} from 'rxjs';\n\n// ── Pagination Strategy ──\nexport type PaginationStrategy = {\n hasMoreRows: boolean;\n loadMore: () => Promise<void>;\n reset?: () => void;\n}\n\nexport type CursorPaginationStrategy = {\n endCursor?: string;\n} & PaginationStrategy\n\nexport type OffsetPaginationStrategy = {\n currentPage: number;\n pageSize: number;\n totalItems?: number;\n} & PaginationStrategy\n\n// ── Data lifecycle state ──\n/**\n * Lifecycle state of a collection's data, driving which chrome the component\n * renders: skeleton placeholders ({@link LOADING}), the rows or empty state\n * ({@link RETRIEVED}), or an error placeholder ({@link ERROR}).\n *\n * Because the components are zoneless and OnPush, a consumer that flips `state`\n * to `ERROR` (or `RETRIEVED`) must also emit on `dataRows` (e.g. `dataRows.next([])`)\n * so the component runs change detection and re-reads the new state.\n */\nexport enum MnCollectionState {\n /** Data is being (re)loaded; skeleton placeholders are shown. */\n LOADING = 'LOADING',\n /** Data has loaded (possibly empty); rows or the empty state are shown. */\n RETRIEVED = 'RETRIEVED',\n /** Loading failed; the error placeholder is shown. */\n ERROR = 'ERROR',\n}\n\n// ── Pagination Mode ──\nexport type PaginationMode =\n | 'none'\n | 'load-more'\n | 'paginated'\n | 'client-side-pagination'\n | 'infinite-scroll';\n\n// ── Shared Labels / i18n ──\nexport type MnCollectionLabels = {\n loadMore?: string;\n /** Translation key for the \"Load more\" button label. */\n loadMoreKey?: string;\n rowsPerPage?: string;\n /** Translation key for the \"Rows per page\" label. */\n rowsPerPageKey?: string;\n /**\n * Page position readout, shown on narrow viewports where the item range does\n * not fit. Supports the `{{current}}` and `{{total}}` placeholders.\n * Defaults to `Page {{current}} of {{total}}`.\n */\n pageIndicator?: string;\n /** Translation key for the page position readout. */\n pageIndicatorKey?: string;\n /**\n * Item range readout. Supports the `{{start}}`, `{{end}}` and `{{total}}`\n * placeholders. Defaults to `{{start}}–{{end}} of {{total}}`.\n */\n itemRange?: string;\n /** Translation key for the item range readout. */\n itemRangeKey?: string;\n}\n\n/**\n * Chrome shared by every MnLib collection component (table, list, grid):\n * data, search, pagination, loading/skeleton, empty state and i18n. Component\n * data sources ({@link import('../mn-table').TableDataSource},\n * {@link import('../mn-list').ListDataSource},\n * {@link import('../mn-grid').GridDataSource}) extend this with their own\n * rendering contract (columns / item template / card template).\n */\nexport type MnCollectionDataSource<T> = {\n dataRows: BehaviorSubject<T[]>;\n getID: (row: T) => string;\n\n emptyMessage: string;\n /** Translation key for the empty message. When set, the component resolves it via MnLanguageService. */\n emptyMessageKey?: string;\n emptyTemplate?: TemplateRef<unknown>;\n /**\n * Icon rendered above {@link emptyMessage} in the default empty state. Pass any\n * lucide icon's static `.icon` data (e.g. `LucideSearchX.icon`). Defaults to an\n * inbox icon when omitted; set to `null` to render the message with no icon.\n * Ignored when {@link emptyTemplate} is provided.\n */\n emptyIcon?: LucideIconData | null;\n\n /**\n * Lifecycle state of the data, controlling loading / error / empty rendering.\n * Defaults to {@link MnCollectionState.RETRIEVED} when not set.\n */\n state?: MnCollectionState;\n /** Number of placeholder rows rendered while data is loading. Defaults to 5. */\n skeletonRowCount?: number;\n\n /** Message shown in the error placeholder when {@link state} is ERROR. */\n errorMessage?: string;\n /** Translation key for {@link errorMessage}; resolved via MnLanguageService. */\n errorMessageKey?: string;\n /** Custom template rendered in place of the default error placeholder. */\n errorTemplate?: TemplateRef<unknown>;\n\n // Search\n /**\n * Whether to show the search box in the toolbar. When omitted, search auto-enables once\n * the collection holds at least {@link searchThreshold} rows *and* a way to search exists\n * ({@link isInSearch} or {@link onServerSearch}) — the same rule mn-select and\n * mn-multi-select apply to their option lists, so long collections stay filterable\n * without every call site opting in. Set explicitly to force it on or off.\n */\n canSearch?: boolean;\n /**\n * Number of rows at which the search box auto-enables (default: 8). Ignored when\n * {@link canSearch} is set explicitly. Server-paginated sources count {@link totalItems}.\n */\n searchThreshold?: number;\n searchPlaceholder?: string;\n /** Translation key for the search placeholder. When set, the component resolves it via MnLanguageService. */\n searchPlaceholderKey?: string;\n isInSearch?: (row: T, searchValue: string) => boolean;\n searchForAdditionalItems?: (searchValue: string) => Promise<T[]>;\n\n /**\n * Callback invoked when the user types in the search box (server-side search).\n * When provided, the component skips client-side filtering and delegates to the consumer.\n */\n onServerSearch?: (searchValue: string) => void;\n\n // Pagination\n paginationMode?: PaginationMode;\n paginationStrategy?: PaginationStrategy;\n loadAdditionalRows?: () => Promise<T[]>;\n\n /** Number of items per page when paginationMode is 'paginated'. Defaults to 10. */\n pageSize?: number;\n\n /** Options for the page-size selector dropdown. Defaults to [5, 10, 25, 50]. */\n pageSizeOptions?: number[];\n\n /** Callback invoked when the user changes the page size via the dropdown. */\n onPageSizeChange?: (newSize: number) => void;\n\n /**\n * Total number of items on the server.\n * When set, pagination and infinite-scroll use this instead of filteredItems.length.\n */\n totalItems?: number;\n\n /**\n * Callback invoked when the user navigates to a different page.\n * When provided, the component delegates pagination to the consumer (server-side).\n */\n onPageChange?: (page: number) => void;\n\n /**\n * Callback invoked when the user scrolls to the bottom in infinite-scroll mode.\n * When provided, the component delegates loading more rows to the consumer (server-side).\n */\n onLoadMore?: () => void;\n\n // Labels / i18n\n labels?: MnCollectionLabels;\n}\n\n/**\n * Adds row/item selection to {@link MnCollectionDataSource}. Used by components\n * that support selection (table, list); grid intentionally omits it.\n */\nexport type MnSelectableCollectionDataSource<T> = MnCollectionDataSource<T> & {\n selectionMode?: 'none' | 'single' | 'multi';\n selectedRows?: BehaviorSubject<T[]>;\n /** IDs to pre-select when the component initializes. */\n initialSelectedIds?: string[];\n\n /**\n * Rows behind {@link initialSelectedIds}, for collections whose rows are paged in\n * from a server. The component can only recognise a selected row once it has been\n * loaded, so on page 1 of a server-paginated table it knows the *ids* that are\n * selected but not what they are called — which is exactly what\n * {@link selectionSummary} needs to render. Supplying the rows here fills that\n * gap. Unnecessary when every row is client-side: the ids resolve against\n * `dataRows` on their own.\n */\n initialSelectedRows?: T[];\n\n /**\n * Renders an always-visible summary of the current selection above the\n * collection: a count and one removable tag per selected row.\n *\n * It exists because a selection and a paginated list answer different questions.\n * The list is for *finding* rows and is therefore filtered, searched and paged;\n * the selection is the answer the user is assembling, and hiding it on page 40\n * makes people re-pick rows they already had. The summary never pages, filters or\n * sorts — it always shows the whole selection.\n */\n selectionSummary?: boolean;\n\n /**\n * Label for a row inside {@link selectionSummary}. Defaults to the first column\n * that renders a plain string, falling back to the row's id.\n */\n selectionLabel?: (row: T) => string;\n\n /**\n * How many tags {@link selectionSummary} shows before collapsing the rest behind\n * a \"+N more\" control. Defaults to 8.\n *\n * A summary exists to be taken in at a glance, so it must not grow without bound:\n * left uncapped, selecting a few hundred rows turns the header into the page and\n * pushes the table — the thing being worked in — off screen entirely. The count in\n * the heading always states the true total, so collapsing hides tags, never\n * information.\n */\n selectionSummaryLimit?: number;\n\n /** Labels for the {@link selectionSummary} chrome. */\n selectionSummaryLabels?: {\n /** Heading, supporting a `{{count}}` placeholder. Defaults to `Selected ({{count}})`. */\n title?: string;\n /** Translation key for {@link title}. */\n titleKey?: string;\n /** Label for the clear-everything action. Defaults to `Clear all`. */\n clearAll?: string;\n /** Translation key for {@link clearAll}. */\n clearAllKey?: string;\n /** Accessible label for a tag's remove button, supporting `{{label}}`. */\n remove?: string;\n /** Translation key for {@link remove}. */\n removeKey?: string;\n /** Expand action, supporting a `{{count}}` placeholder. Defaults to `+{{count}} more`. */\n showMore?: string;\n /** Translation key for {@link showMore}. */\n showMoreKey?: string;\n /** Collapse action. Defaults to `Show less`. */\n showLess?: string;\n /** Translation key for {@link showLess}. */\n showLessKey?: string;\n };\n}\n","import {\n afterEveryRender,\n ChangeDetectorRef,\n Directive,\n DoCheck,\n ElementRef,\n inject,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n} from '@angular/core';\nimport {LucideInbox} from '@lucide/angular';\nimport {debounceTime, skip, Subject, Subscription} from 'rxjs';\nimport {MnLanguageService} from '../../language';\nimport {MnSelectOption} from '../mn-select';\nimport {MnCollectionDataSource, MnCollectionState} from './mn-collection.types';\n\n/**\n * Shared chrome for MnLib collection components (table, list, grid):\n * data subscription, client/server search, every pagination mode, load-more,\n * skeleton-row count, empty-state plumbing, common i18n key resolution and\n * toolbar change-detection.\n *\n * Concrete components extend this (or {@link MnSelectableCollectionBase}) and\n * implement only their rendering. The class is decorated `@Directive()` so it can\n * declare `@Input`s and use `inject()` while remaining abstract.\n *\n * Init runs in a fixed order (see {@link ngOnInit}); subclasses hook in via the\n * `protected` template methods rather than overriding `ngOnInit`.\n */\n@Directive()\nexport abstract class MnCollectionBase<T, DS extends MnCollectionDataSource<T>>\n implements OnInit, OnDestroy, DoCheck {\n @Input() dataSource!: DS;\n\n /** Row count at which the search box auto-enables when `canSearch` is unset. */\n private static readonly DEFAULT_SEARCH_THRESHOLD = 8;\n\n filteredItems: T[] = [];\n paginatedItems: T[] = [];\n searchValue = '';\n loadingMoreRows = false;\n\n /** Fallback empty-state icon used when a data source doesn't set `emptyIcon`. */\n protected readonly defaultEmptyIcon = LucideInbox.icon;\n\n currentPage = 1;\n pageSize = 10;\n\n /**\n * Measured pixel height of the body container, applied as a `min-height` floor\n * while a server reload is in flight so the container can't collapse when the\n * data rows are swapped for skeletons. Released in {@link ngDoCheck} the moment\n * the loading state clears. `0` means no lock.\n */\n lockedMinHeight = 0;\n\n /**\n * Measured pixel height of one full page, applied as a persistent `min-height` floor\n * while paginated so a short page (the last page, or after a row is removed/filtered)\n * can't collapse the body and jump the layout below it. Blank space fills the remaindernpm\n * at the bottom. Captured once a full page is actually on screen; `0` means unmeasured.\n * Distinct from the transient {@link lockedMinHeight} reload lock — both combine in\n * {@link bodyMinHeight} via `Math.max`.\n */\n fullPageHeight = 0;\n\n /** Write-once guard so {@link fullPageHeight} is measured once per pageSize. */\n private pageHeightMeasured = false;\n\n protected readonly cdr = inject(ChangeDetectorRef);\n protected readonly lang = inject(MnLanguageService);\n /** Prefix used in validation error messages, e.g. `MnList`. Overridden by subclasses. */\n protected readonly componentName: string = 'MnCollection';\n private dataSubscription?: Subscription;\n private searchSubject = new Subject<string>();\n private searchSubscription?: Subscription;\n private langSubscription?: Subscription;\n /** Tracks the previous toolbar template reference for change detection. */\n private previousToolbarTemplate?: TemplateRef<unknown>;\n\n constructor() {\n // Measure the body's height once a full page is on screen and cache it as the persistent\n // {@link fullPageHeight} floor. Runs after every render (outside change detection, so\n // writing the bound field can't trigger `ExpressionChangedAfterItHasBeenChecked`); the\n // {@link pageHeightMeasured} guard limits the actual measurement to once per pageSize.\n afterEveryRender(() => {\n if (this.pageHeightMeasured || !this.isPaginated || this.isLoadingState) return;\n if (this.paginatedItems.length !== this.pageSize) return;\n const el = this.collectionBody?.nativeElement;\n if (!el) return;\n this.fullPageHeight = el.offsetHeight;\n this.pageHeightMeasured = true;\n this.cdr.markForCheck();\n });\n }\n\n // ── Data lifecycle state ──\n\n /**\n * Single source of truth for the data lifecycle: the explicit\n * {@link MnCollectionDataSource.state}, defaulting to RETRIEVED when unset.\n * Every internal loading check routes through this.\n */\n get collectionState(): MnCollectionState {\n return this.dataSource.state ?? MnCollectionState.RETRIEVED;\n }\n\n /** Whether the collection is currently loading (skeleton placeholders shown). */\n get isLoadingState(): boolean {\n return this.collectionState === MnCollectionState.LOADING;\n }\n\n /** Accessible name for the loading placeholder, and the text the status region announces. */\n get loadingLabel(): string {\n return this.resolveLabel(undefined, 'mnCollection.loading', 'Loading');\n }\n\n /** Whether loading failed (the error placeholder is shown instead of rows/empty). */\n get isErrorState(): boolean {\n return this.collectionState === MnCollectionState.ERROR;\n }\n\n // ── Template-method hooks ──\n\n /** Whether the component delegates search to the consumer (server-side). */\n get isServerSearched(): boolean {\n return !!this.dataSource.onServerSearch;\n }\n\n /**\n * Whether the search box is shown: the explicit `canSearch` when set, otherwise\n * auto-enabled once the row count reaches `searchThreshold` and the source can actually\n * search (a client predicate or a server callback — a box that filters nothing is noise).\n * A non-empty term keeps the box even when the (server-)filtered result drops below the\n * threshold, so the user can always clear what they typed.\n */\n get isSearchable(): boolean {\n if (this.dataSource.canSearch !== undefined) return this.dataSource.canSearch;\n if (!this.dataSource.isInSearch && !this.isServerSearched) return false;\n if (this.searchValue.length > 0) return true;\n const threshold = this.dataSource.searchThreshold ?? MnCollectionBase.DEFAULT_SEARCH_THRESHOLD;\n const rowCount = this.isServerPaginated && this.dataSource.totalItems != null\n ? this.dataSource.totalItems\n : (this.dataSource.dataRows.value ?? []).length;\n return rowCount >= threshold;\n }\n\n get isPaginated(): boolean {\n const mode = this.dataSource.paginationMode;\n return mode === 'paginated' || mode === 'client-side-pagination';\n }\n\n /** Whether the component delegates pagination to the consumer (server-side). */\n get isServerPaginated(): boolean {\n const mode = this.dataSource.paginationMode ?? 'load-more';\n return mode === 'paginated' || mode === 'load-more';\n }\n\n get showLoadMore(): boolean {\n const mode = this.dataSource.paginationMode ?? 'load-more';\n // Server-side load-more: check if there are more items to load.\n if (this.dataSource.onLoadMore) {\n const totalItems = this.dataSource.totalItems ?? 0;\n return mode === 'load-more' && this.filteredItems.length < totalItems;\n }\n const strategy = this.dataSource.paginationStrategy;\n const hasMore = strategy ? strategy.hasMoreRows : !!this.dataSource.loadAdditionalRows;\n return mode === 'load-more' && hasMore;\n }\n\n // ── Height stabilization ──\n\n /**\n * The measured full-page {@link fullPageHeight} floor, but only while it should apply:\n * paginated, not loading, with rows present. Keeps a short page from collapsing the body.\n */\n get reservedPageHeight(): number {\n if (this.isPaginated && !this.isLoadingState && this.filteredItems.length > 0) {\n return this.fullPageHeight;\n }\n return 0;\n }\n\n /**\n * `min-height` (px) applied to the body: the larger of the transient reload lock and the\n * persistent full-page floor, so neither can shrink the body below the other. `null` clears it.\n */\n get bodyMinHeight(): number | null {\n return Math.max(this.lockedMinHeight, this.reservedPageHeight) || null;\n }\n\n // ── Lifecycle ──\n\n /** Total number of items, accounting for server-side pagination. */\n get totalItemCount(): number {\n if (this.isServerPaginated && this.dataSource.totalItems != null) {\n return this.dataSource.totalItems;\n }\n return this.filteredItems.length;\n }\n\n get totalPages(): number {\n return Math.max(1, Math.ceil(this.totalItemCount / this.pageSize));\n }\n\n get resolvedPageSizeOptions(): number[] {\n return this.dataSource.pageSizeOptions ?? [5, 10, 25, 50];\n }\n\n // ── Search ──\n\n /** Page-size options formatted for mn-select. */\n get pageSizeSelectOptions(): MnSelectOption<number>[] {\n return this.resolvedPageSizeOptions.map(opt => ({label: String(opt), value: opt}));\n }\n\n get visiblePages(): number[] {\n const total = this.totalPages;\n const current = this.currentPage;\n const maxVisible = 3;\n let start = Math.max(1, current - Math.floor(maxVisible / 2));\n let end = start + maxVisible - 1;\n if (end > total) {\n end = total;\n start = Math.max(1, end - maxVisible + 1);\n }\n const pages: number[] = [];\n for (let i = start; i <= end; i++) {\n pages.push(i);\n }\n return pages;\n }\n\n // ── Pagination ──\n /**\n * Body container wrapping the skeleton/data swap region, used to measure its\n * height for {@link lockBodyHeight}. Implemented by each component with a\n * `@ViewChild('collectionBody')` so the template reference resolves there.\n */\n protected abstract collectionBody?: ElementRef<HTMLElement>;\n\n /** The toolbar template whose identity is watched in change detection. */\n protected abstract get trackedToolbarTemplate(): TemplateRef<unknown> | undefined;\n\n get skeletonRows(): number[] {\n // Explicit override wins; otherwise match the rows currently on screen so the\n // skeleton fills the same space on a reload; fall back to 5 on the first load.\n const count = this.dataSource.skeletonRowCount ?? (this.paginatedItems.length || 5);\n return Array.from({length: count});\n }\n\n ngOnInit(): void {\n this.normalizeDataSource();\n this.resolveTranslationKeys();\n this.pageSize = this.dataSource.pageSize ?? 10;\n this.beforeInitialFilter();\n\n this.applyFilter(false);\n\n // Skip the initial BehaviorSubject emission (already handled above).\n this.dataSubscription = this.dataSource.dataRows.pipe(skip(1)).subscribe(() => {\n this.applyFilter(false);\n this.onRowsChanged();\n this.cdr.markForCheck();\n });\n\n this.searchSubscription = this.searchSubject\n .pipe(debounceTime(300))\n .subscribe(value => {\n this.searchValue = value;\n this.applyFilter(true);\n this.cdr.markForCheck();\n });\n\n // Re-resolve translation keys whenever the locale changes.\n this.langSubscription = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.resolveTranslationKeys();\n this.cdr.markForCheck();\n });\n }\n\n ngDoCheck(): void {\n // Release the height lock as soon as loading ends — same CD cycle that clears\n // the skeleton, so the lock can never outlive the skeleton it protects.\n if (this.lockedMinHeight && !this.isLoadingState) {\n this.lockedMinHeight = 0;\n }\n const currentTemplate = this.trackedToolbarTemplate;\n if (currentTemplate !== this.previousToolbarTemplate) {\n this.previousToolbarTemplate = currentTemplate;\n this.cdr.markForCheck();\n }\n }\n\n ngOnDestroy(): void {\n this.dataSubscription?.unsubscribe();\n this.searchSubscription?.unsubscribe();\n this.langSubscription?.unsubscribe();\n }\n\n onSearch(searchString: string): void {\n this.currentPage = 1;\n if (this.isServerSearched) {\n this.lockBodyHeight();\n this.searchValue = searchString;\n this.dataSource.onServerSearch?.(searchString);\n this.cdr.markForCheck();\n } else {\n this.searchSubject.next(searchString);\n }\n }\n\n goToPage(page: number): void {\n if (page < 1 || page > this.totalPages) return;\n this.currentPage = page;\n if (this.dataSource.paginationMode === 'client-side-pagination') {\n this.applyPagination();\n } else {\n this.lockBodyHeight();\n this.dataSource.onPageChange?.(page);\n }\n this.cdr.markForCheck();\n }\n\n onPageSizeChange(newSize: number): void {\n this.invalidatePageHeight();\n this.pageSize = newSize;\n this.currentPage = 1;\n if (this.dataSource.paginationMode === 'client-side-pagination') {\n this.applyPagination();\n } else {\n this.lockBodyHeight();\n this.dataSource.onPageSizeChange?.(newSize);\n }\n this.cdr.markForCheck();\n }\n\n loadMoreRows(): void {\n // Server-side infinite scroll: delegate to consumer callback.\n if (this.dataSource.onLoadMore) {\n this.dataSource.onLoadMore();\n return;\n }\n\n if (!this.dataSource.loadAdditionalRows || this.loadingMoreRows) return;\n\n this.loadingMoreRows = true;\n const promise = (this.searchValue && this.searchValue.length > 0 && this.dataSource.searchForAdditionalItems)\n ? this.dataSource.searchForAdditionalItems(this.searchValue)\n : this.dataSource.loadAdditionalRows();\n\n promise\n .then(rows => this.processLoadedRows(rows))\n .catch(() => this.loadingMoreRows = false);\n }\n\n isTemplateRef(value: unknown): value is TemplateRef<unknown> {\n return value instanceof TemplateRef;\n }\n\n trackByID = (_index: number, item: T): string => {\n return this.dataSource.getID(item);\n };\n\n // ── Skeleton ──\n\n /** Applies search/sort/filtering and pagination to the current rows. */\n protected abstract applyFilter(searchForItems: boolean): void;\n\n // ── Template helpers ──\n\n /** Runs after pageSize is set but before the first {@link applyFilter}. */\n protected beforeInitialFilter(): void {\n // no-op by default\n }\n\n /**\n * Runs after a fresh batch of rows has been filtered in, for work that needs the\n * rows to exist. Subclasses override to react to data arriving late; call `super`\n * to keep the default (currently nothing).\n */\n protected onRowsChanged(): void {\n // no-op by default\n }\n\n /**\n * Resolves a label three ways, in order: the consumer's explicit key, a\n * conventional `mnCollection.*` key when the app defines one, and finally a\n * readable English default.\n *\n * The middle step is what makes the components translatable out of the box: an\n * app that adds the `mnCollection` namespace to its locale files gets every\n * table, list and grid translated at once, with no per-call-site wiring across\n * dozens of data sources. An app that does not keeps today's English text rather\n * than leaking raw keys into the UI.\n *\n * @param consumerKey The data source's own translation key, if it set one.\n * @param defaultKey The conventional key this label falls back to.\n * @param fallback The English text used when neither key resolves.\n * @param params Optional interpolation values.\n * @returns The resolved label.\n */\n protected resolveLabel(\n consumerKey: string | undefined,\n defaultKey: string,\n fallback: string,\n params?: Record<string, string | number>,\n ): string {\n if (consumerKey) return this.lang.t(consumerKey, params);\n return this.lang.translateIfPresent(defaultKey, params) ?? fallback;\n }\n\n /**\n * Resolves translation keys to display strings via {@link MnLanguageService}.\n * Subclasses override to resolve their own keys; call `super` to keep these.\n */\n protected resolveTranslationKeys(): void {\n if (this.dataSource.emptyMessageKey) {\n this.dataSource.emptyMessage = this.lang.t(this.dataSource.emptyMessageKey);\n }\n if (this.dataSource.errorMessageKey) {\n this.dataSource.errorMessage = this.lang.t(this.dataSource.errorMessageKey);\n }\n if (this.dataSource.searchPlaceholderKey) {\n this.dataSource.searchPlaceholder = this.lang.t(this.dataSource.searchPlaceholderKey);\n }\n if (this.dataSource.labels) {\n if (this.dataSource.labels.loadMoreKey) {\n this.dataSource.labels.loadMore = this.lang.t(this.dataSource.labels.loadMoreKey);\n }\n if (this.dataSource.labels.rowsPerPageKey) {\n this.dataSource.labels.rowsPerPage = this.lang.t(this.dataSource.labels.rowsPerPageKey);\n }\n // Resolved without params so the `{{current}}` / `{{start}}` placeholders\n // survive; MnCollectionPagination fills them in per render.\n if (this.dataSource.labels.pageIndicatorKey) {\n this.dataSource.labels.pageIndicator = this.lang.t(this.dataSource.labels.pageIndicatorKey);\n }\n if (this.dataSource.labels.itemRangeKey) {\n this.dataSource.labels.itemRange = this.lang.t(this.dataSource.labels.itemRangeKey);\n }\n }\n }\n\n // ── Shared internals ──\n\n /**\n * Captures the body container's current height into {@link lockedMinHeight} so it\n * holds while a server reload swaps the data rows for skeletons. Must be called\n * while the old rows are still rendered (before delegating to the consumer), and\n * only locks when rows are present — the first load has nothing to preserve.\n */\n protected lockBodyHeight(): void {\n const el = this.collectionBody?.nativeElement;\n if (el && this.paginatedItems.length > 0) {\n this.lockedMinHeight = el.offsetHeight;\n }\n }\n\n /**\n * Drops the cached {@link fullPageHeight} floor so it is re-measured on the next full page.\n * Must run whenever the page size changes (the old floor is for a different row count).\n */\n protected invalidatePageHeight(): void {\n this.fullPageHeight = 0;\n this.pageHeightMeasured = false;\n }\n\n protected applyPagination(): void {\n if (this.dataSource.paginationMode === 'client-side-pagination') {\n const start = (this.currentPage - 1) * this.pageSize;\n this.paginatedItems = this.filteredItems.slice(start, start + this.pageSize);\n } else {\n // Server always provides the correct page/slice — no client-side slicing.\n this.paginatedItems = this.filteredItems;\n }\n }\n\n /** Client-side search filtering shared by list and grid. */\n protected applySearchFilter(items: T[]): T[] {\n if (!this.isServerSearched && this.dataSource.isInSearch && this.isSearchable && this.searchValue && this.searchValue.length > 0) {\n const term = this.searchValue.toLowerCase();\n return items.filter(row => this.dataSource.isInSearch!(row, term));\n }\n return items;\n }\n\n protected processLoadedRows(rows: T[]): void {\n const merged = [...new Map(\n [...this.dataSource.dataRows.value, ...rows].map(item => [this.dataSource.getID(item), item])\n ).values()];\n this.dataSource.dataRows.next(merged);\n this.loadingMoreRows = false;\n this.applyFilter(false);\n }\n\n /**\n * Reports every misconfigured pagination setting and repairs it in place.\n *\n * This deliberately does **not** throw. It runs first in {@link ngOnInit}, and a\n * throw there aborts the rest of init — the data subscription is never made and\n * {@link applyFilter} never runs, so the component renders a permanently empty\n * body that only \"heals\" once some later interaction happens to call\n * {@link applyFilter}. That failure mode reads as \"the table is broken\" rather\n * than \"the data source is misconfigured\", and inside a modal the thrown error\n * is easy to miss entirely. Logging loudly and degrading to the nearest working\n * mode keeps the misconfiguration visible while still rendering the rows.\n */\n protected normalizeDataSource(): void {\n const mode = this.dataSource.paginationMode;\n\n // Server-side pagination without the server half of the contract: there is no\n // way to fetch another page, so paginate the rows we were handed instead.\n if (mode === 'paginated') {\n const missing: string[] = [];\n if (!this.dataSource.onPageChange) missing.push('onPageChange');\n if (this.dataSource.totalItems == null) missing.push('totalItems');\n if (missing.length > 0) {\n this.reportConfigError(\n `paginationMode is 'paginated' but ${missing.join(' and ')} ${missing.length === 1 ? 'is' : 'are'} missing. ` +\n `Server-side pagination requires both; falling back to 'client-side-pagination'.`,\n );\n this.dataSource.paginationMode = 'client-side-pagination';\n }\n }\n\n if (mode === 'load-more' || mode === 'infinite-scroll') {\n if (!this.dataSource.onLoadMore && !this.dataSource.loadAdditionalRows && !this.dataSource.paginationStrategy) {\n this.reportConfigError(\n `paginationMode is '${mode}' but no load-more mechanism is provided. ` +\n `Provide 'onLoadMore', 'loadAdditionalRows', or 'paginationStrategy'; falling back to 'none'.`,\n );\n this.dataSource.paginationMode = 'none';\n }\n }\n\n // A pageSize outside the selector's options would leave the dropdown with no\n // matching entry; widen the options rather than override the consumer's size.\n if (this.dataSource.paginationMode && this.dataSource.paginationMode !== 'none') {\n const options = this.resolvedPageSizeOptions;\n const size = this.dataSource.pageSize ?? 10;\n if (!options.includes(size)) {\n this.reportConfigError(\n `pageSize '${size}' is not one of pageSizeOptions [${options.join(', ')}]. ` +\n `Adding it so the rows-per-page selector can show it.`,\n );\n this.dataSource.pageSizeOptions = [...options, size].sort((a, b) => a - b);\n }\n }\n }\n\n /**\n * Logs a data-source configuration problem, prefixed with the component name.\n * @param message What is wrong and how it was compensated for.\n */\n private reportConfigError(message: string): void {\n console.error(`[${this.componentName}] ${message}`);\n }\n}\n","import {Directive, EventEmitter, Output} from '@angular/core';\nimport {MnCollectionBase} from './mn-collection-base.directive';\nimport {MnSelectableCollectionDataSource} from './mn-collection.types';\n\n/**\n * Extends {@link MnCollectionBase} with single/multi row selection, shared by\n * components that support it (table, list). Grid extends the plain base instead.\n */\n@Directive()\nexport abstract class MnSelectableCollectionBase<\n T,\n DS extends MnSelectableCollectionDataSource<T>,\n> extends MnCollectionBase<T, DS> {\n @Output() selectionChange = new EventEmitter<T[]>();\n\n selectedIds = new Set<string>();\n\n /** Whether the summary is currently showing every tag rather than the first few. */\n selectionSummaryExpanded = false;\n\n get allSelected(): boolean {\n return this.filteredItems.length > 0 && this.selectedIds.size === this.filteredItems.length;\n }\n\n /**\n * The row behind every selected id, kept so the selection survives the rows\n * themselves going away.\n *\n * {@link selectedIds} alone is enough to tick a checkbox, because that only ever\n * asks about a row already on screen. The summary asks the opposite question —\n * \"what is selected, including what isn't on this page?\" — and a server-paginated\n * collection has long since discarded those rows. Rows are captured as they are\n * selected and backfilled from {@link MnSelectableCollectionDataSource.initialSelectedRows}\n * and from each batch that loads.\n */\n protected selectedRowsById = new Map<string, T>();\n /**\n * Whether a seeded initial selection still has to be announced, because none of\n * its ids matched a loaded row yet. See {@link beforeInitialFilter}.\n */\n private pendingInitialEmit = false;\n\n /**\n * Every selected row, in selection order, for the summary. Ids whose row was\n * never seen are skipped rather than rendered as a bare id.\n */\n get selectedSummaryRows(): T[] {\n const rows: T[] = [];\n for (const id of this.selectedIds) {\n const row = this.selectedRowsById.get(id);\n if (row !== undefined) rows.push(row);\n }\n return rows;\n }\n\n /** Whether the selection summary should render. */\n get showSelectionSummary(): boolean {\n return !!this.dataSource.selectionSummary && this.hasSelection && this.selectedIds.size > 0;\n }\n\n /** How many tags to show before collapsing the remainder. */\n get selectionSummaryLimit(): number {\n return this.dataSource.selectionSummaryLimit ?? this.defaultSelectionSummaryLimit;\n }\n\n /**\n * Tag count the summary collapses at when the data source names no limit.\n *\n * Subclasses that know their own width narrow this: the same eight tags that\n * read as a compact header on a wide table become seven stacked lines in a phone\n * sheet, pushing the rows they describe off screen. Overridden by\n * {@link MnCollectionDataSource.selectionSummaryLimit}.\n */\n // Deliberately an accessor, not a readonly field: MnTable overrides it with a\n // width-dependent getter, and TypeScript cannot override a property with one.\n // eslint-disable-next-line @typescript-eslint/class-literal-property-style\n protected get defaultSelectionSummaryLimit(): number {\n return 8;\n }\n\n /**\n * The tags to render: the first {@link selectionSummaryLimit} rows, or all of them\n * once expanded. Keeps a large selection from turning the header into the page.\n */\n get visibleSelectionRows(): T[] {\n const rows = this.selectedSummaryRows;\n return this.selectionSummaryExpanded ? rows : rows.slice(0, this.selectionSummaryLimit);\n }\n\n /** How many selected rows are collapsed out of view; 0 when all are shown. */\n get hiddenSelectionCount(): number {\n if (this.selectionSummaryExpanded) return 0;\n return Math.max(0, this.selectedSummaryRows.length - this.selectionSummaryLimit);\n }\n\n /** Expands or re-collapses the summary's tag list. */\n toggleSelectionSummary(): void {\n this.selectionSummaryExpanded = !this.selectionSummaryExpanded;\n this.cdr.markForCheck();\n }\n\n /**\n * The label for a row in the summary: the consumer's {@link\n * MnSelectableCollectionDataSource.selectionLabel}, else the first column that\n * renders a plain string, else the row's id.\n * @param row The selected row.\n * @returns The text to show on the row's tag.\n */\n selectionLabelFor(row: T): string {\n const custom = this.dataSource.selectionLabel;\n if (custom) return custom(row);\n return this.defaultSelectionLabel(row) ?? this.dataSource.getID(row);\n }\n\n /** Removes one row from the selection, from its tag in the summary. */\n removeSelection(row: T): void {\n const id = this.dataSource.getID(row);\n if (!this.selectedIds.delete(id)) return;\n this.selectedRowsById.delete(id);\n this.emitSelection();\n this.cdr.markForCheck();\n }\n\n get hasSelection(): boolean {\n return (this.dataSource.selectionMode ?? 'none') !== 'none';\n }\n\n get isMultiSelect(): boolean {\n return this.dataSource.selectionMode === 'multi';\n }\n\n isSelected(item: T): boolean {\n return this.selectedIds.has(this.dataSource.getID(item));\n }\n\n /** Clears the whole selection, from the summary's clear-all action. */\n clearSelection(): void {\n if (this.selectedIds.size === 0) return;\n this.selectedIds.clear();\n this.selectedRowsById.clear();\n this.emitSelection();\n this.cdr.markForCheck();\n }\n\n toggle(item: T): void {\n const id = this.dataSource.getID(item);\n const mode = this.dataSource.selectionMode ?? 'none';\n\n if (mode === 'single') {\n this.selectedIds.clear();\n this.selectedRowsById.clear();\n this.selectedIds.add(id);\n this.selectedRowsById.set(id, item);\n } else if (mode === 'multi') {\n if (this.selectedIds.has(id)) {\n this.selectedIds.delete(id);\n this.selectedRowsById.delete(id);\n } else {\n this.selectedIds.add(id);\n this.selectedRowsById.set(id, item);\n }\n }\n\n this.emitSelection();\n }\n\n toggleAll(): void {\n if (this.selectedIds.size === this.filteredItems.length) {\n this.selectedIds.clear();\n this.selectedRowsById.clear();\n } else {\n this.filteredItems.forEach(item => {\n const id = this.dataSource.getID(item);\n this.selectedIds.add(id);\n this.selectedRowsById.set(id, item);\n });\n }\n this.emitSelection();\n }\n\n /**\n * Fallback label used when the data source declares no `selectionLabel`.\n * Subclasses that know how to render a row as text (a table knows its columns)\n * override this; the base has nothing to go on.\n * @returns The label, or null when none can be derived.\n */\n protected defaultSelectionLabel(_row: T): string | null {\n return null;\n }\n\n /** Seeds selection from `initialSelectedIds` before the first filter pass. */\n protected override beforeInitialFilter(): void {\n super.beforeInitialFilter();\n if (!this.dataSource.initialSelectedIds?.length) return;\n\n for (const id of this.dataSource.initialSelectedIds) {\n this.selectedIds.add(id);\n }\n for (const row of this.dataSource.initialSelectedRows ?? []) {\n this.selectedRowsById.set(this.dataSource.getID(row), row);\n }\n this.captureSelectedRows();\n\n // The rows are commonly still in flight at this point (any server fetch), and\n // then no id resolves to a row yet. Emitting that would announce \"nothing is\n // selected\" and let the consumer — a form control bound to this table, say —\n // overwrite the very value it just seeded us with. Defer instead, and announce\n // it from {@link onRowsChanged} once the rows actually arrive.\n if (this.resolveSelectedRows().length === 0) {\n this.pendingInitialEmit = true;\n return;\n }\n this.emitSelection();\n }\n\n /** Announces a deferred initial selection as soon as its rows are loaded. */\n protected override onRowsChanged(): void {\n super.onRowsChanged();\n // A newly loaded page may hold rows for ids selected before it arrived.\n this.captureSelectedRows();\n if (!this.pendingInitialEmit || this.resolveSelectedRows().length === 0) return;\n this.pendingInitialEmit = false;\n this.emitSelection();\n }\n\n protected emitSelection(): void {\n // A real user interaction supersedes any deferred initial announcement.\n this.pendingInitialEmit = false;\n const rows = this.resolveSelectedRows();\n this.dataSource.selectedRows?.next(rows);\n this.selectionChange.emit(rows);\n }\n\n /** Records the row object for every loaded row that is currently selected. */\n private captureSelectedRows(): void {\n for (const row of this.dataSource.dataRows.value ?? []) {\n const id = this.dataSource.getID(row);\n if (this.selectedIds.has(id)) this.selectedRowsById.set(id, row);\n }\n }\n\n /** The currently loaded rows whose id is selected. */\n private resolveSelectedRows(): T[] {\n return (this.dataSource.dataRows.value ?? [])\n .filter(r => this.selectedIds.has(this.dataSource.getID(r)));\n }\n}\n","import {ChangeDetectionStrategy, Component, EventEmitter, inject, Input, Output} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {MnButton} from '../mn-button';\nimport {MnSelect, MnSelectOption} from '../mn-select';\nimport {MnLanguageService} from '../../language';\nimport {MnCollectionLabels} from './mn-collection.types';\n\n/** One position in the page-number strip. */\nexport type MnPageSlot = {\n /** Page to jump to, or `null` for an ellipsis gap. */\n page: number | null;\n /**\n * True for the first/last page anchors and the gaps beside them. These are\n * hidden below `md`, where the readout states the total and « » already jump\n * to either end — the strip would otherwise wrap.\n */\n anchor: boolean;\n}\n\n/**\n * Presentational pagination footer shared by every MnLib collection component\n * (table, list, grid): the load-more button, the page-size selector and the\n * page navigator. It holds no state — the host component owns pagination state\n * (via {@link import('./mn-collection-base.directive').MnCollectionBase}) and\n * reacts to the outputs.\n */\n@Component({\n selector: 'mn-collection-pagination',\n standalone: true,\n imports: [MnButton, MnSelect, FormsModule],\n templateUrl: './mn-collection-pagination.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MnCollectionPagination {\n private readonly lang = inject(MnLanguageService);\n\n /** Prefix for the page-size select's id, keeping it unique per host. */\n @Input() idPrefix = 'mn-collection';\n\n @Input() isPaginated = false;\n @Input() isServerPaginated = false;\n @Input() showLoadMore = false;\n @Input() loadingMoreRows = false;\n\n @Input() currentPage = 1;\n @Input() pageSize = 10;\n @Input() totalPages = 1;\n @Input() totalItemCount = 0;\n @Input() visiblePages: number[] = [];\n @Input() pageSizeSelectOptions: MnSelectOption<number>[] = [];\n @Input() labels?: MnCollectionLabels;\n\n @Output() loadMore = new EventEmitter<void>();\n @Output() pageChange = new EventEmitter<number>();\n @Output() pageSizeChange = new EventEmitter<number>();\n\n get showPagination(): boolean {\n return this.isPaginated && (this.totalPages > 1 || this.isServerPaginated);\n }\n\n /** First item number on the current page, 1-based. Zero when there is no data. */\n get rangeStart(): number {\n return this.totalItemCount === 0 ? 0 : (this.currentPage - 1) * this.pageSize + 1;\n }\n\n /** Last item number on the current page, clamped to the total. */\n get rangeEnd(): number {\n return Math.min(this.currentPage * this.pageSize, this.totalItemCount);\n }\n\n /**\n * {@link visiblePages} anchored with the first and last page, so the total page\n * count is on screen at md+ without consulting the readout.\n *\n * e.g. page 5 of 50 → `1 … 4 5 6 … 50`\n */\n get pageSlots(): MnPageSlot[] {\n const pages = this.visiblePages;\n if (pages.length === 0) return [];\n\n const first = pages[0];\n const last = pages[pages.length - 1];\n const slots: MnPageSlot[] = pages.map(page => ({page, anchor: false}));\n\n if (first > 1) {\n // Only insert a gap when the anchor isn't already adjacent to the window.\n if (first > 2) slots.unshift({page: null, anchor: true});\n slots.unshift({page: 1, anchor: true});\n }\n if (last < this.totalPages) {\n if (last < this.totalPages - 1) slots.push({page: null, anchor: true});\n slots.push({page: this.totalPages, anchor: true});\n }\n return slots;\n }\n\n /** e.g. `Page 5 of 50`. */\n get pageIndicatorLabel(): string {\n return this.fill(this.label(this.labels?.pageIndicator, 'mnCollection.pageIndicator', 'Page {{current}} of {{total}}'), {\n current: this.currentPage,\n total: this.totalPages,\n });\n }\n\n /** e.g. `41–50 of 250`. */\n get itemRangeLabel(): string {\n return this.fill(this.label(this.labels?.itemRange, 'mnCollection.itemRange', '{{start}}–{{end}} of {{total}}'), {\n start: this.rangeStart,\n end: this.rangeEnd,\n total: this.totalItemCount,\n });\n }\n\n /** \"Items per page\" label beside the page-size selector. */\n get rowsPerPageLabel(): string {\n return this.label(this.labels?.rowsPerPage, 'mnCollection.rowsPerPage', 'Items per page:');\n }\n\n /**\n * Substitutes `{{name}}` placeholders, matching the interpolation syntax used\n * by MnLanguageService so the same translation strings work either way.\n */\n private fill(template: string, params: Record<string, number>): string {\n return Object.entries(params).reduce(\n (result, [key, value]) => result.replace(new RegExp(`\\\\{\\\\{${key}\\\\}\\\\}`, 'g'), String(value)),\n template,\n );\n }\n\n /** Label for the load-more button. */\n get loadMoreLabel(): string {\n return this.label(this.labels?.loadMore, 'mnCollection.loadMore', 'Load more');\n }\n\n /** Accessible label for the first-page control. */\n get firstPageLabel(): string {\n return this.label(undefined, 'mnCollection.firstPage', 'First page');\n }\n\n /** Accessible label for the previous-page control. */\n get previousPageLabel(): string {\n return this.label(undefined, 'mnCollection.previousPage', 'Previous page');\n }\n\n /** Accessible label for the next-page control. */\n get nextPageLabel(): string {\n return this.label(undefined, 'mnCollection.nextPage', 'Next page');\n }\n\n /** Accessible label for the last-page control. */\n get lastPageLabel(): string {\n return this.label(undefined, 'mnCollection.lastPage', 'Last page');\n }\n\n /**\n * Wrapper classes for one slot in the page strip, shrinking it in two steps as\n * the footer narrows. Container queries, so the measurement is the footer's own\n * width — the same strip is wide on a page and cramped in a modal.\n *\n * The first/last anchors and their gaps drop below 640px, where « and » already\n * jump to either end. Below 380px every number except the current one drops too:\n * the strip would otherwise wrap onto a second line and push the footer over the\n * table, and the \"Page 3 of 9\" readout beside it already says where the user is.\n * The arrows survive both steps, so navigation never depends on a number.\n */\n slotVisibility(slot: MnPageSlot): string {\n if (slot.anchor) return 'hidden @min-[640px]:inline-flex';\n return slot.page === this.currentPage ? 'inline-flex' : 'hidden @min-[380px]:inline-flex';\n }\n\n /**\n * Accessible label for a page-number button.\n * @param page The page the button jumps to.\n * @returns The label, naming the page.\n */\n pageLabel(page: number): string {\n const template = this.label(undefined, 'mnCollection.page', 'Page {{page}}');\n return template.replace('{{page}}', String(page));\n }\n\n /**\n * Resolves a label three ways, in order: the consumer's explicit text, the\n * conventional `mnCollection.*` key when the app defines one, and finally a\n * readable English default.\n *\n * Mirrors `MnCollectionBase.resolveLabel`; this component is presentational and\n * does not extend that base, but its chrome must be just as translatable — the\n * page-size label and the item-range readout are on screen for every paged\n * collection in the app.\n *\n * @param explicit The label the host passed in, if any.\n * @param key The conventional translation key to try.\n * @param fallback The English text used when neither resolves.\n * @returns The resolved label.\n */\n private label(explicit: string | undefined, key: string, fallback: string): string {\n return explicit ?? this.lang.translateIfPresent(key) ?? fallback;\n }\n}\n","<!-- Load more button -->\n@if (showLoadMore) {\n <div class=\"flex justify-center py-4\">\n <button\n (click)=\"loadMore.emit()\"\n [data]=\"{ size: 'sm', variant: 'outline', color: 'primary' }\"\n [disabled]=\"loadingMoreRows\"\n class=\"px-4 py-1.5 text-sm rounded border border-primary-500 text-primary-500 hover:bg-primary-100 transition-colors disabled:opacity-50\"\n mnButton\n type=\"button\"\n >\n @if (loadingMoreRows) {\n <span\n class=\"inline-block w-3 h-3 border-2 border-primary-500 border-t-transparent rounded-full animate-spin mr-2\"></span>\n }\n {{ loadMoreLabel }}\n </button>\n </div>\n}\n\n<!-- Pagination controls -->\n@if (showPagination) {\n <div class=\"@container flex items-center justify-between gap-2 px-2 py-3 text-sm text-base-content\">\n @if (pageSizeSelectOptions.length > 1) {\n <div class=\"hidden @min-[640px]:flex items-center gap-2\">\n <span>{{ rowsPerPageLabel }}</span>\n <mn-lib-select\n (ngModelChange)=\"pageSizeChange.emit($event)\"\n [ngModel]=\"pageSize\"\n [props]=\"{\n id: idPrefix + '-page-size',\n ariaLabel: rowsPerPageLabel,\n options: pageSizeSelectOptions,\n size: 'sm'\n }\"\n ></mn-lib-select>\n </div>\n } @else {\n <div class=\"hidden @min-[640px]:block\"></div>\n }\n\n <!-- Narrow viewports state the page position outright: the strip's last-page\n anchor only appears once the window stops reaching the end, so it can't\n be relied on to carry the total. -->\n <span aria-live=\"polite\"\n class=\"@min-[640px]:hidden text-xs opacity-70 whitespace-nowrap\">{{ pageIndicatorLabel }}</span>\n\n <div class=\"flex flex-wrap items-center justify-center gap-0.5 @min-[640px]:gap-1\">\n <span class=\"text-xs mr-2 hidden @min-[640px]:inline\">{{ itemRangeLabel }}</span>\n\n <button\n (click)=\"pageChange.emit(1)\"\n [data]=\"{ size: 'sm', variant: 'outline', color: 'secondary', disabled: currentPage === 1 }\"\n [disabled]=\"currentPage === 1\"\n [attr.aria-label]=\"firstPageLabel\"\n class=\"px-2 py-1 rounded border border-base-300 hover:bg-base-200 transition-colors disabled:opacity-40 disabled:cursor-not-allowed aspect-square leading-none\"\n mnButton\n type=\"button\"\n >«\n </button>\n\n <button\n (click)=\"pageChange.emit(currentPage - 1)\"\n [data]=\"{ size: 'sm', variant: 'outline', color: 'secondary', disabled: currentPage === 1 }\"\n [disabled]=\"currentPage === 1\"\n [attr.aria-label]=\"previousPageLabel\"\n class=\"px-2 py-1 rounded border border-base-300 hover:bg-base-200 transition-colors disabled:opacity-40 disabled:cursor-not-allowed aspect-square leading-none\"\n mnButton\n type=\"button\"\n >‹\n </button>\n\n @for (slot of pageSlots; track $index) {\n <span [class]=\"slotVisibility(slot)\">\n @if (slot.page !== null) {\n <button\n (click)=\"pageChange.emit(slot.page)\"\n [attr.aria-current]=\"slot.page === currentPage ? 'page' : null\"\n [attr.aria-label]=\"pageLabel(slot.page)\"\n [data]=\"{ size: 'sm', variant: 'text', color: slot.page === currentPage ? 'primary' : 'gray' }\"\n class=\"px-1.5 @min-[640px]:px-2.5 py-1 rounded underline underline-offset-2 transition-colors text-xs\"\n mnButton\n type=\"button\"\n >{{ slot.page }}\n </button>\n } @else {\n <span aria-hidden=\"true\" class=\"px-0.5 text-xs opacity-50 select-none\">…</span>\n }\n </span>\n }\n\n <button\n (click)=\"pageChange.emit(currentPage + 1)\"\n [data]=\"{ size: 'sm', variant: 'outline', color: 'secondary', disabled: currentPage === totalPages }\"\n [disabled]=\"currentPage === totalPages\"\n [attr.aria-label]=\"nextPageLabel\"\n class=\"px-2 py-1 rounded border border-base-300 hover:bg-base-200 transition-colors disabled:opacity-40 disabled:cursor-not-allowed aspect-square leading-none\"\n mnButton\n type=\"button\"\n >›\n </button>\n\n <button\n (click)=\"pageChange.emit(totalPages)\"\n [data]=\"{ size: 'sm', variant: 'outline', color: 'secondary', disabled: currentPage === totalPages }\"\n [disabled]=\"currentPage === totalPages\"\n [attr.aria-label]=\"lastPageLabel\"\n class=\"px-2 py-1 rounded border border-base-300 hover:bg-base-200 transition-colors disabled:opacity-40 disabled:cursor-not-allowed aspect-square leading-none\"\n mnButton\n type=\"button\"\n >»\n </button>\n </div>\n </div>\n}\n","import {\n afterEveryRender,\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n Output,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {NgClass, NgTemplateOutlet} from '@angular/common';\nimport {debounceTime, Subject} from 'rxjs';\nimport {\n ColumnDefinition,\n ColumnFilterState,\n ColumnFilterType,\n ColumnFilterValue,\n ColumnSortType,\n MnColumnFilter,\n MnRowValue,\n MnTableRowAction,\n SortState,\n TableDataSource,\n} from './mn-table.types';\nimport {emptyFilterValue, isFilterValueActive, matchesColumnFilter} from './mn-table-filter.util';\nimport {MnSkeleton, MnSkeletonProps} from '../mn-skeleton';\nimport {MnSelect, MnSelectOption} from '../mn-select';\nimport {MnMultiSelect, MnMultiSelectOption} from '../mn-multi-select';\nimport {MnActionIcon, MnDropdown, MnDropdownAction, MnDropdownActionColor} from '../mn-dropdown';\nimport {MnCheckbox} from '../mn-checkbox';\nimport {MnHiddenBelowDirective} from './mn-hidden-below.directive';\nimport {MnShowAboveDirective} from './mn-show-above.directive';\nimport {MnShowBelowDirective} from './mn-show-below.directive';\nimport {MnInputField} from '../mn-input-field';\nimport {FormsModule} from '@angular/forms';\nimport {MnCollectionPagination, MnSelectableCollectionBase} from '../mn-collection';\nimport {MnButton} from '../mn-button';\nimport {MnBottomSheet} from '../mn-bottom-sheet';\nimport {LucideDynamicIcon, LucideFilter, LucideFunnel, LucideX} from '@lucide/angular';\n\n@Component({\n selector: 'mn-table',\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, MnCheckbox, MnHiddenBelowDirective, MnShowAboveDirective, MnShowBelowDirective, MnInputField, MnSelect, MnMultiSelect, MnDropdown, MnSkeleton, FormsModule, MnCollectionPagination, MnButton, MnBottomSheet, LucideFilter, LucideX, LucideFunnel, LucideDynamicIcon],\n templateUrl: './mn-table.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n // Block-level so the host has a definite width for the @container chrome inside it.\n host: {class: 'block'},\n})\nexport class MnTable<T = object>\n extends MnSelectableCollectionBase<T, TableDataSource<T>> {\n @Output() sortChange = new EventEmitter<SortState | null>();\n @Output() rowClick = new EventEmitter<T>();\n\n currentSort: SortState | null = null;\n\n /** Per-column filter values keyed by column key. */\n columnFilters: ColumnFilterState = {};\n\n /** Viewport width (px) below which the inline filter row collapses into a panel. */\n private static readonly FILTER_COLLAPSE_WIDTH = 640;\n\n /**\n * True when the viewport is narrow enough that the per-column filter inputs no\n * longer fit under their headers; the inline row is then replaced by a toggle\n * button and a stacked filter panel.\n */\n protected filtersCollapsed = false;\n\n /** Whether the small-screen filter bottom sheet is currently open. */\n protected filtersPanelOpen = false;\n\n /** Small-screen filter sheet, held so the close button can play its exit. */\n @ViewChild('filtersSheet') protected filtersSheet?: MnBottomSheet;\n\n protected override readonly componentName = 'MnTable';\n\n protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined {\n return this.dataSource?.toolbarLeftTemplate;\n }\n\n @ViewChild('collectionBody') protected collectionBody?: ElementRef<HTMLElement>;\n\n // ── Column Filters ──\n /** Debounces server-side text filters so typing doesn't fire a request per keystroke. */\n private readonly filterDebounce = new Subject<void>();\n /**\n * Most rows shown per page on mobile (< md). A **cap**, not an override: a data\n * source asking for fewer rows keeps its own size. Raising a small page size on\n * a phone is the opposite of what it is for — it pushes the paginator below the\n * fold, which is most damaging inside a modal, where the sheet is already short\n * and its footer is pinned over the bottom of the table.\n */\n private static readonly MOBILE_PAGE_SIZE = 10;\n /**\n * The component's own element, measured for every responsive decision. Typed via\n * the annotation, not `inject(ElementRef<HTMLElement>)` — that form is a generic\n * call on the token and leaves `nativeElement` untyped.\n */\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n\n /** Whether the consumer owns filtering (server-side), mirroring {@link isServerSearched}. */\n get isServerFiltered(): boolean {\n return !!this.dataSource.onColumnFilterChange;\n }\n\n /** Every column filter that is actually set, in column order. */\n get activeColumnFilters(): MnColumnFilter[] {\n return this.dataSource.columns\n .filter(col => col.filterable && isFilterValueActive(this.columnFilters[col.key]))\n .map(col => ({\n key: col.key,\n type: this.filterTypeOf(col),\n value: this.columnFilters[col.key] as ColumnFilterValue,\n }));\n }\n\n /** Whether at least one column filter is active. */\n get hasActiveFilters(): boolean {\n return this.dataSource.columns.some(\n col => col.filterable && isFilterValueActive(this.columnFilters[col.key]),\n );\n }\n\n /**\n * Updates a column filter value and either re-filters locally or hands the\n * active filters to the consumer. Server-side text filters are debounced;\n * every other type commits immediately.\n */\n onColumnFilter(column: ColumnDefinition<T>, value: ColumnFilterValue): void {\n this.columnFilters[column.key] = value;\n this.currentPage = 1;\n\n if (this.isServerFiltered) {\n if (this.filterTypeOf(column) === 'text') {\n this.filterDebounce.next();\n } else {\n this.emitServerFilters();\n }\n } else {\n this.applyFilter(false);\n }\n this.cdr.markForCheck();\n }\n\n /** Updates a tri-state boolean filter from its select ('' = any). */\n onBooleanFilter(column: ColumnDefinition<T>, raw: string): void {\n this.onColumnFilter(column, raw === '' ? '' : raw === 'true');\n }\n\n /** The effective filter type of a column, defaulting to text. */\n filterTypeOf(column: ColumnDefinition<T>): ColumnFilterType {\n return column.filterType ?? 'text';\n }\n\n /** Whether a specific column's filter currently narrows the rows. */\n isColumnFilterActive(column: ColumnDefinition<T>): boolean {\n return isFilterValueActive(this.columnFilters[column.key]);\n }\n\n /** Filter options formatted for mn-multi-select for a given column. */\n getFilterMultiSelectOptions(column: ColumnDefinition<T>): MnMultiSelectOption<string>[] {\n return (column.filterOptions ?? []).map(opt => ({label: opt.label, value: String(opt.value)}));\n }\n\n /** Label for the small-screen filters toggle button. */\n get filtersButtonLabel(): string {\n return this.resolveLabel(this.dataSource.filtersLabelKey, 'mnCollection.filters', this.dataSource.filtersLabel ?? 'Filters');\n }\n\n /**\n * Summary a multi-select filter collapses to once more than one option is picked.\n * Resolved with the `{count}` token intact for mn-multi-select to fill in.\n */\n get filterSelectedLabel(): string {\n return this.resolveLabel(this.dataSource.filterLabels?.selectedKey, 'mnCollection.filterSelected', this.dataSource.filterLabels?.selected ?? '{count} selected');\n }\n\n /** Current text/select filter value for a column. */\n textFilterValue(column: ColumnDefinition<T>): string {\n const value = this.columnFilters[column.key];\n return typeof value === 'string' ? value : '';\n }\n\n /** Current multi-select filter value for a column. */\n multiFilterValue(column: ColumnDefinition<T>): string[] {\n const value = this.columnFilters[column.key];\n return Array.isArray(value) ? value : [];\n }\n\n /** Current boolean filter value for a column, as the select's string value. */\n booleanFilterValue(column: ColumnDefinition<T>): string {\n const value = this.columnFilters[column.key];\n return typeof value === 'boolean' ? String(value) : '';\n }\n\n /** Resets every column filter and re-applies (or re-requests) filtering. */\n clearAllFilters(): void {\n this.seedFilterValues();\n this.currentPage = 1;\n if (this.isServerFiltered) {\n this.emitServerFilters();\n } else {\n this.applyFilter(false);\n }\n this.cdr.markForCheck();\n }\n\n /** Whether any column has filtering enabled. */\n get hasColumnFilters(): boolean {\n return this.dataSource.columns.some(c => c.filterable);\n }\n\n /** Label for the \"clear all filters\" action in the small-screen panel. */\n get clearFiltersButtonLabel(): string {\n return this.resolveLabel(this.dataSource.clearFiltersLabelKey, 'mnCollection.clearAll', this.dataSource.clearFiltersLabel ?? 'Clear all');\n }\n\n /** Accessible label for the filter sheet's close button. */\n get filtersCloseLabel(): string {\n return this.resolveLabel(undefined, 'mnCollection.close', 'Close');\n }\n\n /** Heading for the selection summary, with the count filled in. */\n get selectionSummaryTitle(): string {\n const labels = this.dataSource.selectionSummaryLabels;\n const template = this.resolveLabel(labels?.titleKey, 'mnCollection.selectedCount', labels?.title ?? 'Selected ({{count}})');\n return template.replace('{{count}}', String(this.selectedIds.size));\n }\n\n /** Label for the summary's clear-everything action. */\n get selectionClearAllLabel(): string {\n const labels = this.dataSource.selectionSummaryLabels;\n return this.resolveLabel(labels?.clearAllKey, 'mnCollection.clearAll', labels?.clearAll ?? 'Clear all');\n }\n\n /** Opens the small-screen filter bottom sheet. */\n openFiltersPanel(): void {\n this.filtersPanelOpen = true;\n }\n\n /** Plays the sheet's slide-down exit, then unmounts it. */\n async closeFiltersPanel(): Promise<void> {\n await this.filtersSheet?.startClosing();\n this.filtersPanelOpen = false;\n this.cdr.markForCheck();\n }\n private readonly baseTableClasses = 'w-full border-collapse overflow-y-hidden';\n /**\n * Column widths measured from the automatic layout and pinned, keyed by column\n * key, for `stable`. Empty until the first render that has real rows on screen,\n * and cleared whenever the table is resized so the next render re-measures.\n */\n private pinnedWidths = new Map<string, string>();\n\n /** Sets sort/filter state seeded from the data source before the first filter pass. */\n protected override beforeInitialFilter(): void {\n super.beforeInitialFilter();\n\n // Force the mobile row count below `md`; use the consumer's pageSize (or 10) above it.\n this.desktopPageSize = this.dataSource.pageSize ?? 10;\n this.applyResponsivePageSize(false);\n\n // Seed the filter layout for the initial viewport (no markForCheck pre-render).\n this.updateFilterLayout(false);\n\n this.currentSort = this.dataSource.defaultSort ?? null;\n this.seedFilterValues();\n }\n /**\n * Whether {@link pinColumnWidths} has run. Tracked separately from\n * {@link pinnedWidths} being non-empty, because the widest column is deliberately\n * left unpinned and a table with a single flexible column therefore pins nothing.\n */\n private widthsPinned = false;\n\n /**\n * Recomputes whether the inline filter row should collapse into the panel.\n * Closes the panel when returning to the wide layout so reopened state never\n * leaks across the breakpoint. Marks for check only when the layout flips.\n */\n private updateFilterLayout(reflow: boolean): void {\n const collapsed = this.isFilterViewport();\n if (collapsed === this.filtersCollapsed) return;\n this.filtersCollapsed = collapsed;\n if (!collapsed) this.filtersPanelOpen = false;\n if (reflow) this.cdr.markForCheck();\n }\n\n sort(column: ColumnDefinition<T>): void {\n if (!column.sortType || column.sortType === ColumnSortType.NONE) return;\n\n if (this.currentSort?.columnKey === column.key) {\n this.currentSort = this.currentSort.direction === 'asc'\n ? {columnKey: column.key, direction: 'desc'}\n : null;\n } else {\n this.currentSort = {columnKey: column.key, direction: 'asc'};\n }\n\n this.sortChange.emit(this.currentSort);\n this.applyFilter(false);\n }\n\n onRowClick(row: T): void {\n if (this.hasSelection) {\n this.toggle(row);\n }\n this.dataSource.onRowClick?.(row);\n this.rowClick.emit(row);\n }\n\n // ── Sorting ──\n\n /**\n * Resolves the skeleton placeholder config for a column's cells.\n * Falls back to a text-shaped bar at 75% width (the previous default); any\n * fields the column provides override that default.\n */\n getColumnSkeletonData(column: ColumnDefinition<T>): Partial<MnSkeletonProps> {\n const skeleton = column.skeleton;\n const overrides = skeleton && !this.isTemplateRef(skeleton) ? skeleton : {};\n return {shape: 'text', width: '75%', ...overrides};\n }\n\n getSortIcon(column: ColumnDefinition<T>): string {\n if (!this.currentSort || this.currentSort.columnKey !== column.key) return '';\n return this.currentSort.direction === 'asc' ? '▲' : '▼';\n }\n\n /**\n * Accessible name for a column's inline filter control: the header text, or the column key when\n * the header is a template.\n * @param column - The filtered column.\n */\n filterLabel(column: ColumnDefinition<T>): string {\n return typeof column.header === 'string' ? this.headerText(column) : column.key;\n }\n\n /**\n * A string column's header text. `headerKey` is translated here, at render time, rather than\n * only in `resolveTranslationKeys`: that runs on init and on a locale change, so a column a\n * consumer adds afterwards (a permission-gated actions or image column) kept an empty header,\n * which a screen reader announces as a nameless column.\n * @param column - The column whose header is shown.\n * @returns The translated key when the column has one, otherwise its literal header, or an\n * empty string for a template header (rendered through its own outlet instead).\n */\n headerText(column: ColumnDefinition<T>): string {\n if (column.headerKey) {\n return this.lang.t(column.headerKey);\n }\n return typeof column.header === 'string' ? column.header : '';\n }\n\n isSortable(column: ColumnDefinition<T>): boolean {\n return !!column.sortType && column.sortType !== ColumnSortType.NONE;\n }\n\n // ── Row interaction ──\n\n constructor() {\n super();\n // Server-side text filtering only: client-side filtering stays instant per keystroke.\n this.filterDebounce\n .pipe(debounceTime(300), takeUntilDestroyed())\n .subscribe(() => {\n this.emitServerFilters();\n this.cdr.markForCheck();\n });\n\n // Watch the table's own box rather than the window: inside a modal, a sidebar\n // or a narrow grid cell the table resizes without the window ever changing,\n // and the window resizes without the table's share of it changing.\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(() => this.onHostResize());\n observer.observe(this.host.nativeElement);\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n }\n\n // `beforeInitialFilter` runs while the host may not be attached or laid out\n // yet, so its width reads 0 and {@link measuredWidth} has to guess from the\n // window — the one guess that is wrong for a table in a modal. Re-evaluate\n // once after the first render, when the real width is available.\n afterNextRender(() => this.onHostResize());\n\n // The `stable` layout has to let the browser lay the table out automatically\n // once before it can capture the result. This runs after every render because\n // the first render usually has no rows yet (a server fetch is still in flight);\n // the guards below make it a no-op until real rows are on screen, and the\n // pinned widths then stop it from measuring again.\n afterEveryRender(() => {\n if (this.layoutMode !== 'stable') return;\n if (this.widthsPinned || this.isLoadingState) return;\n if (this.paginatedItems.length === 0) return;\n this.pinColumnWidths();\n });\n }\n\n /**\n * Classes for the `<table>` element. `table-fixed` is added once column widths\n * are no longer allowed to follow the content: always for the `fixed` layout, and\n * for `stable` from the moment its widths have been measured and pinned.\n */\n get tableClasses(): string {\n return this.widthsArePinned ? `${this.baseTableClasses} table-fixed` : this.baseTableClasses;\n }\n\n /** Page size to use at/above the `md` breakpoint (consumer's pageSize, or the user's selection). */\n private desktopPageSize = 10;\n\n /** Label for the summary's expand/collapse control. */\n get selectionSummaryToggleLabel(): string {\n const labels = this.dataSource.selectionSummaryLabels;\n if (this.selectionSummaryExpanded) {\n return this.resolveLabel(labels?.showLessKey, 'mnCollection.showLess', labels?.showLess ?? 'Show less');\n }\n const template = this.resolveLabel(labels?.showMoreKey, 'mnCollection.showMore', labels?.showMore ?? '+{{count}} more');\n return template.replace('{{count}}', String(this.hiddenSelectionCount));\n }\n\n /** Placeholder and accessible name for the search box. */\n get searchPlaceholderLabel(): string {\n return this.resolveLabel(\n this.dataSource.searchPlaceholderKey,\n 'mnCollection.search',\n this.dataSource.searchPlaceholder ?? 'Search...',\n );\n }\n\n /** Screen-reader-only header text of the selection column, so that column is never nameless. */\n get selectionColumnLabel(): string {\n return this.resolveLabel(undefined, 'mnCollection.selectionColumn', 'Selection');\n }\n\n /** Accessible name for the scrollable table region. */\n get tableRegionLabel(): string {\n return this.resolveLabel(this.dataSource.ariaLabel, 'mnCollection.dataTable', 'Data table');\n }\n\n /**\n * Fewer tags once the table is narrow. A tag holding a person's full name takes\n * a whole line at phone width, so the eight that read as a compact header on a\n * wide table become eight stacked lines in a modal sheet — the summary then\n * occupies more of the screen than the rows it is summarising.\n *\n * Reuses {@link filtersCollapsed} rather than measuring again: it is already\n * maintained on every resize and means exactly \"this table is under 640px\".\n * The heading still states the true total, so the hidden tags cost no information.\n */\n protected override get defaultSelectionSummaryLimit(): number {\n return this.filtersCollapsed ? 5 : 8;\n }\n\n /** Tracks the desktop page size when the user picks one (selector only shows at >= md). */\n override onPageSizeChange(newSize: number): void {\n this.desktopPageSize = newSize;\n super.onPageSizeChange(newSize);\n }\n\n /** The effective column-width strategy, defaulting to `stable`. */\n get layoutMode(): 'auto' | 'fixed' | 'stable' {\n return this.dataSource.appearance?.layout ?? 'stable';\n }\n\n /**\n * Whether column widths have stopped following the cell content — `fixed` always,\n * `stable` once {@link pinColumnWidths} has captured them. Drives `table-fixed`\n * and the cell truncation together, so a cell is never clipped while the column\n * it sits in could still have grown to fit it.\n */\n get widthsArePinned(): boolean {\n return this.layoutMode === 'fixed' || (this.layoutMode === 'stable' && this.widthsPinned);\n }\n\n /** Any / Yes / No options for a boolean column filter. */\n getBooleanFilterOptions(column: ColumnDefinition<T>): MnSelectOption<string>[] {\n const labels = this.dataSource.filterLabels;\n return [\n {\n label: column.filterPlaceholder ?? this.resolveLabel(labels?.anyKey, 'mnCollection.filterAny', labels?.any ?? 'Any'),\n value: ''\n },\n {label: this.resolveLabel(labels?.yesKey, 'mnCollection.filterYes', labels?.yes ?? 'Yes'), value: 'true'},\n {label: this.resolveLabel(labels?.noKey, 'mnCollection.filterNo', labels?.no ?? 'No'), value: 'false'},\n ];\n }\n\n /**\n * The width to render for a column: the consumer's own declared width always\n * wins, then a width pinned by the `stable` layout, otherwise none.\n * @param column The column being rendered.\n * @returns A CSS width, or `null` to leave it to the layout algorithm.\n */\n columnWidth(column: ColumnDefinition<T>): string | null {\n return column.width ?? this.pinnedWidths.get(column.key) ?? null;\n }\n\n /**\n * The `title` tooltip for a cell, so text truncated by a pinned column stays\n * readable. Only string cells have text to expose; template cells render their\n * own markup and are left alone.\n * @param column The column being rendered.\n * @param row The row being rendered.\n * @returns The full cell text, or `null` when there is nothing to expose.\n */\n cellTitle(column: ColumnDefinition<T>, row: T): string | null {\n if (!this.widthsArePinned || typeof column.cell !== 'function') return null;\n return column.cell(row) || null;\n }\n\n /**\n * Falls back to the first column that renders a plain string, which is almost\n * always the name-like column a person would use to identify the row. Template\n * columns are skipped: they render markup this cannot flatten to a tag label.\n * @param row The selected row.\n * @returns The label, or null when every column renders a template.\n */\n protected override defaultSelectionLabel(row: T): string | null {\n for (const column of this.dataSource.columns) {\n if (typeof column.cell !== 'function') continue;\n const value = column.cell(row);\n if (value) return value;\n }\n return null;\n }\n\n /**\n * Resolves table-specific translation keys (column headers/filters) plus the\n * shared keys handled by the base.\n */\n protected override resolveTranslationKeys(): void {\n super.resolveTranslationKeys();\n for (const col of this.dataSource.columns) {\n if (col.headerKey) {\n col.header = this.lang.t(col.headerKey);\n }\n if (col.filterPlaceholderKey) {\n col.filterPlaceholder = this.lang.t(col.filterPlaceholderKey);\n }\n // Row actions are deliberately not pre-resolved here: `rowActionLabel` translates\n // at render time (a locale change calls markForCheck, so the next pass picks the\n // new text up), which keeps a per-row `label`/`labelKey` accessor intact instead\n // of being flattened to one string for every row.\n }\n if (this.dataSource.filtersLabelKey) {\n this.dataSource.filtersLabel = this.lang.t(this.dataSource.filtersLabelKey);\n }\n if (this.dataSource.clearFiltersLabelKey) {\n this.dataSource.clearFiltersLabel = this.lang.t(this.dataSource.clearFiltersLabelKey);\n }\n this.resolveFilterLabelKeys();\n this.resolveSelectionSummaryKeys();\n }\n\n protected applyFilter(searchForItems: boolean): void {\n let items = this.applySearchFilter(this.dataSource.dataRows.value ?? []);\n\n // Per-column filters. Skipped entirely when the consumer owns filtering: the\n // rows already are the filtered set, and re-filtering them locally would\n // narrow the current page a second time.\n if (!this.isServerFiltered) {\n for (const col of this.dataSource.columns) {\n const filterValue = this.columnFilters[col.key];\n if (!col.filterable || !isFilterValueActive(filterValue)) continue;\n items = items.filter(row => matchesColumnFilter(col, row, filterValue as ColumnFilterValue));\n }\n }\n\n items = this.applySorting(items);\n\n this.filteredItems = items;\n this.applyPagination();\n\n if (searchForItems) {\n this.loadMoreRows();\n }\n }\n\n /**\n * Re-evaluate on a window resize too. The ResizeObserver covers every change to\n * the table's own box, but {@link isMobileViewport} reads the window, which can\n * change without the table's width following it (a fixed-width table, a modal\n * pinned to a max width).\n */\n @HostListener('window:resize')\n protected onWindowResize(): void {\n this.onHostResize();\n }\n\n /** Re-evaluate responsive page size and filter layout when the table is resized. */\n private onHostResize(): void {\n // Pixel widths captured for the old box are meaningless in the new one.\n this.unpinColumnWidths();\n this.applyResponsivePageSize(true);\n this.updateFilterLayout(true);\n }\n\n /**\n * Captures the current, automatically-derived width of every visible column and\n * pins it, which flips the table to `table-fixed` on the next render.\n *\n * Runs only with real rows on screen: measuring the loading skeletons would pin\n * the placeholder bars' widths rather than the data's. Hidden columns\n * ({@link ColumnBase.hiddenBelow}) measure 0 and are skipped, so they are free to\n * size themselves if a resize later reveals them.\n *\n * The **widest** column is measured but deliberately left unpinned, so it absorbs\n * whatever space the pinned ones leave over. Pinning every column instead makes the\n * widths sum to slightly more than the container — `border-collapse` shares borders\n * between neighbours, so rounding each cell's measured width over-counts them — and\n * the table then overflows into a spurious horizontal scrollbar. Leaving one column\n * elastic also means a later resize squeezes the widest column first instead of\n * clipping every column equally.\n */\n private pinColumnWidths(): void {\n const headerCells = this.host.nativeElement.querySelectorAll('thead tr:first-child th[data-column-key]');\n const measured: { key: string; width: number }[] = [];\n for (const cell of Array.from(headerCells) as HTMLElement[]) {\n const key = cell.dataset['columnKey'];\n const width = cell.getBoundingClientRect().width;\n // A width of 0 means the column is hidden at this container width.\n if (!key || width <= 0) continue;\n measured.push({key, width});\n }\n if (measured.length === 0) return;\n\n const widest = measured.reduce((a, b) => (b.width > a.width ? b : a));\n const pinned = new Map<string, string>();\n for (const {key, width} of measured) {\n if (key === widest.key) continue;\n pinned.set(key, `${Math.round(width)}px`);\n }\n\n this.pinnedWidths = pinned;\n this.widthsPinned = true;\n // Pinning changes row heights: cells stop wrapping and start truncating, so a\n // full page becomes shorter than it was during the automatic pass. The reserved\n // full-page floor was measured against those taller rows and would otherwise\n // hold the body open, leaving dead space between the last row and the paginator.\n this.invalidatePageHeight();\n this.cdr.markForCheck();\n }\n\n /**\n * Drops the pinned widths so the next render with rows re-measures them. Called\n * when the table is resized: the old pixel widths were shares of a box that no\n * longer exists, and a resize is also what makes `hiddenBelow` columns come and\n * go, changing which columns need a share at all.\n */\n private unpinColumnWidths(): void {\n if (!this.widthsPinned) return;\n this.pinnedWidths = new Map();\n this.widthsPinned = false;\n // Row heights are about to change back; the floor measured for the pinned\n // layout does not describe the automatic one.\n this.invalidatePageHeight();\n }\n\n // ── Template helpers ──\n\n getCellValue(column: ColumnDefinition<T>, row: T): string {\n if (typeof column.cell === 'function') return column.cell(row);\n return '';\n }\n\n /** Returns the small-screen cell value for a column with cellSm defined. */\n getCellSmValue(column: ColumnDefinition<T>, row: T): string {\n if (column.cellSm && typeof column.cellSm.cell === 'function') return column.cellSm.cell(row);\n return '';\n }\n\n // ── Row actions ──\n\n /** The actions visible for a given row — those whose `hidden(row)` is not true. */\n visibleRowActions(column: ColumnDefinition<T>, row: T): MnTableRowAction<T>[] {\n return (column.actions ?? []).filter(action => !(action.hidden?.(row) ?? false));\n }\n\n /** Whether a row has any visible actions at all; when false its cell is left empty. */\n hasRowActions(column: ColumnDefinition<T>, row: T): boolean {\n return this.visibleRowActions(column, row).length > 0;\n }\n\n /**\n * Whether a row's actions fold into the ⋯ menu below 450px. They do unless the row has\n * exactly one visible action that renders as a bare icon: that button is narrower than the\n * ⋯ trigger it would hide behind, so collapsing it only puts a second tap in front of the\n * one command the row has.\n */\n collapsesRowActions(column: ColumnDefinition<T>, row: T): boolean {\n const visible = this.visibleRowActions(column, row);\n if (visible.length !== 1) return true;\n const [only] = visible;\n return this.showActionLabel(column, only, row);\n }\n\n /**\n * Resolves a {@link MnRowValue}: either the fixed value, or the accessor applied to\n * the row. Every per-row presentation field goes through here so the fixed and derived\n * forms can never drift apart.\n */\n private resolveRowValue<V>(value: MnRowValue<T, V> | undefined, row: T): V | undefined {\n return typeof value === 'function' ? (value as (row: T) => V)(row) : value;\n }\n\n /** The resolved label for an inline action button (translation key wins once resolved). */\n rowActionLabel(action: MnTableRowAction<T>, row: T): string {\n const labelKey = this.resolveRowValue(action.labelKey, row);\n if (labelKey) return this.lang.t(labelKey);\n return this.resolveRowValue(action.label, row) ?? '';\n }\n\n /** The resolved leading icon for an action on a given row, if it has one. */\n rowActionIcon(action: MnTableRowAction<T>, row: T): MnActionIcon | undefined {\n return this.resolveRowValue(action.icon, row);\n }\n\n /** Whether an inline action button should render its icon. */\n showActionIcon(column: ColumnDefinition<T>, action: MnTableRowAction<T>, row: T): boolean {\n return (column.actionsInline ?? 'both') !== 'label' && !!this.rowActionIcon(action, row);\n }\n\n /**\n * Whether an inline action button should render its text label. In `'icon'` mode the\n * label is hidden — unless the action has no icon, in which case it is shown anyway so\n * the button is never blank.\n */\n showActionLabel(column: ColumnDefinition<T>, action: MnTableRowAction<T>, row: T): boolean {\n if ((column.actionsInline ?? 'both') === 'icon') return !this.rowActionIcon(action, row);\n return true;\n }\n\n /** Whether an action is disabled for the given row. */\n isRowActionDisabled(action: MnTableRowAction<T>, row: T): boolean {\n return action.disabled ? action.disabled(row) : false;\n }\n\n /**\n * The effective colour for an action, used identically by the inline button and the\n * collapsed ⋯-menu item so the two never diverge: an explicit `color`, else `'danger'`\n * for a destructive action, else the default `'primary'`.\n */\n rowActionColor(action: MnTableRowAction<T>, row: T): MnDropdownActionColor {\n return this.resolveRowValue(action.color, row) ?? (action.danger ? 'danger' : 'primary');\n }\n\n /** Invokes an action for a row. */\n runRowAction(action: MnTableRowAction<T>, row: T): void {\n action.run(row);\n }\n\n /** A stable, unique element id for a row's actions dropdown (aria wiring). */\n actionsDropdownId(column: ColumnDefinition<T>, row: T): string {\n return `mn-table-actions-${column.key}-${this.dataSource.getID(row)}`;\n }\n\n /** Maps a row's visible actions to mn-dropdown commands, binding the row into each. */\n rowDropdownActions(column: ColumnDefinition<T>, row: T): MnDropdownAction[] {\n return this.visibleRowActions(column, row).map(action => ({\n // Per-row values are resolved here, but `labelKey` stays a *key* so the dropdown\n // keeps re-translating it on a locale change rather than freezing today's text.\n label: this.resolveRowValue(action.label, row),\n labelKey: this.resolveRowValue(action.labelKey, row),\n icon: this.rowActionIcon(action, row),\n color: this.rowActionColor(action, row),\n danger: action.danger,\n disabled: this.isRowActionDisabled(action, row),\n run: () => action.run(row),\n }));\n }\n\n trackByKey = (_index: number, column: ColumnDefinition<T>): string => {\n return column.key;\n };\n\n // ── Table CSS classes ──\n\n /** True when the table is narrower than the filter-collapse breakpoint. */\n private isFilterViewport(): boolean {\n return this.measuredWidth() < MnTable.FILTER_COLLAPSE_WIDTH;\n }\n\n /**\n * True when the **window** is below the `md` (768px) breakpoint.\n *\n * Deliberately viewport-based, unlike {@link isFilterViewport}: the forced\n * mobile page size exists to keep a phone screen scrollable, and it is paired\n * with the rows-per-page selector that mn-collection-pagination hides at the\n * same viewport breakpoint. Measuring the table's own width instead would let\n * the two disagree — a 700px table on a desktop would be pinned to the mobile\n * row count while still offering the selector that overrides it.\n */\n private isMobileViewport(): boolean {\n return typeof window !== 'undefined' && window.innerWidth < 768;\n }\n\n /**\n * The table's own rendered width, which every responsive decision is made\n * against — the same width the `@container` queries in the template use, so\n * the TS and CSS halves of the responsive layout can never disagree.\n *\n * Falls back to the window width before the host has been laid out (and in\n * SSR), which is the closest available approximation at that point.\n * @returns The width in CSS pixels.\n */\n private measuredWidth(): number {\n const width = this.host.nativeElement.getBoundingClientRect().width;\n if (width > 0) return width;\n return typeof window === 'undefined' ? Number.MAX_SAFE_INTEGER : window.innerWidth;\n }\n\n /**\n * Applies the breakpoint-appropriate page size: capped at {@link MOBILE_PAGE_SIZE}\n * below `md`, the desktop size at/above it. When the size actually changes, client-side tables\n * re-slice locally and server-side tables ask the consumer to refetch, so the\n * rendered rows update in every pagination mode (used at init and on window resize).\n */\n private applyResponsivePageSize(reflow: boolean): void {\n const target = this.isMobileViewport()\n ? Math.min(this.desktopPageSize, MnTable.MOBILE_PAGE_SIZE)\n : this.desktopPageSize;\n if (target === this.pageSize) return;\n this.invalidatePageHeight();\n this.pageSize = target;\n this.currentPage = 1;\n\n if (this.dataSource.paginationMode === 'client-side-pagination') {\n this.applyPagination();\n } else if (this.isServerPaginated) {\n // Server owns the slice — tell the consumer to refetch with the new size.\n this.dataSource.onPageSizeChange?.(target);\n }\n\n if (reflow) this.cdr.markForCheck();\n }\n\n get totalColumnCount(): number {\n let count = this.dataSource.columns.length;\n if (this.hasSelection) count++;\n return count;\n }\n\n // ── Skeleton ──\n\n /**\n * Hands the active filters to the consumer. Locks the body height first so the\n * skeleton swap during the refetch can't collapse the layout, matching\n * {@link goToPage} and {@link onSearch}.\n */\n private emitServerFilters(): void {\n this.lockBodyHeight();\n this.dataSource.onColumnFilterChange?.(this.activeColumnFilters);\n }\n\n /** Resets every filterable column to its type's empty value. */\n private seedFilterValues(): void {\n for (const col of this.dataSource.columns) {\n if (col.filterable) {\n this.columnFilters[col.key] = emptyFilterValue(this.filterTypeOf(col));\n }\n }\n }\n\n // ── Filtering & sorting ──\n\n /**\n * Resolves the selection-summary labels from their translation keys. Resolved\n * without params so the `{{count}}` / `{{label}}` placeholders survive for the\n * getters to fill in per render.\n */\n private resolveSelectionSummaryKeys(): void {\n const labels = this.dataSource.selectionSummaryLabels;\n if (!labels) return;\n if (labels.titleKey) labels.title = this.lang.t(labels.titleKey);\n if (labels.clearAllKey) labels.clearAll = this.lang.t(labels.clearAllKey);\n if (labels.removeKey) labels.remove = this.lang.t(labels.removeKey);\n if (labels.showMoreKey) labels.showMore = this.lang.t(labels.showMoreKey);\n if (labels.showLessKey) labels.showLess = this.lang.t(labels.showLessKey);\n }\n\n /** Resolves the range / boolean filter control labels from their translation keys. */\n private resolveFilterLabelKeys(): void {\n const labels = this.dataSource.filterLabels;\n if (!labels) return;\n const pairs = [\n ['anyKey', 'any'], ['yesKey', 'yes'], ['noKey', 'no'], ['selectedKey', 'selected'],\n ] as const;\n for (const [keyProp, labelProp] of pairs) {\n const key = labels[keyProp];\n if (key) labels[labelProp] = this.lang.t(key);\n }\n }\n\n private applySorting(items: T[]): T[] {\n if (!this.currentSort) return items;\n\n const column = this.dataSource.columns.find(c => c.key === this.currentSort!.columnKey);\n if (!column || !column.sortType || column.sortType === ColumnSortType.NONE) return items;\n\n const getValue = column.getRawValueToSort ?? ((row: T) => {\n if (typeof column.cell === 'function') return column.cell(row);\n return '';\n });\n\n const dir = this.currentSort.direction === 'asc' ? 1 : -1;\n\n return [...items].sort((a, b) => {\n const va = getValue(a);\n const vb = getValue(b);\n\n if (va == null && vb == null) return 0;\n if (va == null) return 1;\n if (vb == null) return -1;\n\n switch (column.sortType) {\n case ColumnSortType.ALPHABETICAL:\n return String(va).localeCompare(String(vb)) * dir;\n case ColumnSortType.NUMERICAL:\n return (Number(va) - Number(vb)) * dir;\n case ColumnSortType.DATE:\n return (new Date(va as string | number).getTime() - new Date(vb as string | number).getTime()) * dir;\n default:\n return 0;\n }\n });\n }\n\n /** Filter options formatted for mn-select for a given column. */\n getFilterSelectOptions(column: ColumnDefinition<T>): MnSelectOption<string>[] {\n const placeholder = column.filterPlaceholder ?? this.resolveLabel(undefined, 'mnCollection.filterAll', 'All');\n return [\n {label: placeholder, value: ''},\n ...(column.filterOptions ?? []).map(opt => ({label: opt.label, value: String(opt.value)})),\n ];\n }\n\n /**\n * Accessible label for a tag's remove button.\n * @param row The row the tag stands for.\n * @returns The label, naming the row so screen readers announce which one goes.\n */\n selectionRemoveLabel(row: T): string {\n const labels = this.dataSource.selectionSummaryLabels;\n const template = this.resolveLabel(labels?.removeKey, 'mnCollection.removeSelected', labels?.remove ?? 'Remove {{label}}');\n return template.replace('{{label}}', this.selectionLabelFor(row));\n }\n}\n","<!-- Everything that reflows lives inside a @container, so the breakpoints below\n measure the table's own width rather than the window's. A table in a modal,\n a sidebar or a narrow grid cell is far narrower than the viewport, and\n viewport breakpoints would hand it a desktop layout it has no room for. -->\n<div class=\"@container\">\n <!-- Selection summary: the whole selection, never paged, filtered or sorted. The\n table below answers \"what could I pick?\", which is why it is searched and paged;\n this answers \"what did I pick?\", which a paginated list cannot without hiding\n most of the answer on some other page. -->\n @if (showSelectionSummary) {\n <div class=\"flex flex-col gap-2 rounded-md border border-base-300 bg-base-200/50 p-3 mb-3\">\n <div class=\"flex items-center justify-between gap-2\">\n <span class=\"text-sm font-medium text-base-content\">{{ selectionSummaryTitle }}</span>\n <button\n (click)=\"clearSelection()\"\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"gap-1 shrink-0\"\n mnButton\n type=\"button\"\n >\n <svg [size]=\"14\" lucideX></svg>\n <span>{{ selectionClearAllLabel }}</span>\n </button>\n </div>\n <!-- Only the first few tags render; the rest collapse behind a \"+N more\" control.\n The heading's count always states the true total, so this hides tags, never\n information. Expanded, the list is height-capped and scrolls, so even a\n selection of hundreds cannot push the table off screen. -->\n <ul\n [class.max-h-28]=\"selectionSummaryExpanded\"\n [class.overflow-y-auto]=\"selectionSummaryExpanded\"\n class=\"flex flex-wrap gap-1.5 list-none m-0 p-0\"\n >\n @for (row of visibleSelectionRows; track dataSource.getID(row)) {\n <li\n class=\"inline-flex items-center gap-1 rounded-full bg-base-100 border border-base-300 pl-2.5 pr-1 py-0.5 text-xs text-base-content max-w-full\">\n <span [attr.title]=\"selectionLabelFor(row)\" class=\"truncate\">{{ selectionLabelFor(row) }}</span>\n <button\n (click)=\"removeSelection(row)\"\n [attr.aria-label]=\"selectionRemoveLabel(row)\"\n class=\"shrink-0 rounded-full p-0.5 hover:bg-base-300 transition-colors cursor-pointer\"\n type=\"button\"\n >\n <svg [size]=\"12\" lucideX></svg>\n </button>\n </li>\n }\n @if (hiddenSelectionCount > 0 || selectionSummaryExpanded) {\n <li>\n <button\n (click)=\"toggleSelectionSummary()\"\n [attr.aria-expanded]=\"selectionSummaryExpanded\"\n [data]=\"{ variant: 'text', color: 'primary', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"text-xs\"\n mnButton\n type=\"button\"\n >\n {{ selectionSummaryToggleLabel }}\n </button>\n </li>\n }\n </ul>\n </div>\n }\n\n <!-- Toolbar: custom toolbar template + search. Only rendered when it has content,\n so an unsearchable table without toolbar templates emits no empty spacer. -->\n@if (isSearchable || dataSource.toolbarLeftTemplate || dataSource.toolbarRightTemplate || (hasColumnFilters && filtersCollapsed)) {\n <div class=\"flex flex-col @min-[420px]:flex-row @min-[420px]:items-center justify-between gap-2 mb-3\">\n <div class=\"flex items-center gap-2 w-full @min-[420px]:w-auto\">\n @if (dataSource.toolbarLeftTemplate) {\n <div class=\"flex flex-col w-full @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarLeftTemplate\"></ng-container>\n </div>\n }\n </div>\n <div\n class=\"flex flex-col @min-[420px]:flex-row @min-[420px]:items-center gap-2 w-full @min-[420px]:flex-1 @min-[560px]:flex-none @min-[560px]:w-auto\">\n @if (isSearchable) {\n <!-- Enter must not submit a surrounding form: the search box belongs to the\n table's chrome, not to whatever form the table happens to sit in. -->\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n class=\"w-full @min-[420px]:flex-1 @min-[560px]:max-w-64\"\n [props]=\"{\n id: 'mn-table-search',\n type: 'search',\n label: '',\n ariaLabel: searchPlaceholderLabel,\n placeholder: searchPlaceholderLabel,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true\n }\"\n [ngModel]=\"searchValue\"\n (ngModelChange)=\"onSearch($event)\"\n ></mn-lib-input-field>\n }\n @if (dataSource.toolbarRightTemplate) {\n <div class=\"flex flex-col w-full @min-[420px]:w-auto @min-[420px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarRightTemplate\"></ng-container>\n </div>\n }\n <!-- Small-screen filter toggle: replaces the inline per-column filter row below 640px -->\n @if (hasColumnFilters && filtersCollapsed) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"w-full @min-[420px]:w-auto gap-1.5\"\n [attr.aria-expanded]=\"filtersPanelOpen\"\n aria-controls=\"mn-table-filters-panel\"\n (click)=\"openFiltersPanel()\"\n >\n <svg lucideFunnel [size]=\"15\"></svg>\n <span>{{ filtersButtonLabel }}</span>\n </button>\n }\n </div>\n</div>\n}\n\n<!-- Small-screen filters: full-width fields decoupled from column widths, presented\n as a bottom sheet so they overlay rather than push the table down. -->\n@if (hasColumnFilters && filtersCollapsed && filtersPanelOpen) {\n <mn-bottom-sheet\n #filtersSheet\n (dismiss)=\"filtersPanelOpen = false\"\n [ariaLabel]=\"filtersButtonLabel\"\n [growWithKeyboard]=\"true\"\n [maxHeightVh]=\"80\"\n >\n <div id=\"mn-table-filters-panel\" class=\"flex flex-col gap-3 px-4 pb-4\">\n <span class=\"text-base font-semibold text-base-content\">{{ filtersButtonLabel }}</span>\n @for (column of dataSource.columns; track column.key) {\n @if (column.filterable) {\n <div class=\"flex flex-col gap-1\">\n <label\n class=\"text-xs font-medium text-base-content/70\"\n [attr.for]=\"'mn-table-filter-panel-' + column.key\"\n >\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n {{ headerText(column) }}\n }\n </label>\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'panel' }\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n </div>\n }\n }\n @if (hasActiveFilters) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'text', color: 'gray', size: 'sm', borderRadius: 'md', hover: true }\"\n class=\"self-start gap-1\"\n (click)=\"clearAllFilters()\"\n >\n <svg lucideX [size]=\"14\"></svg>\n <span>{{ clearFiltersButtonLabel }}</span>\n </button>\n }\n <div class=\"mt-1 flex min-[400px]:justify-end\">\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'fill', color: 'primary', size: 'md', borderRadius: 'md', hover: true }\"\n class=\"w-full min-[400px]:w-auto\"\n (click)=\"closeFiltersPanel()\"\n >\n <span>{{ filtersCloseLabel }}</span>\n </button>\n </div>\n </div>\n </mn-bottom-sheet>\n}\n\n<!-- Announces loading. The skeletons are aria-hidden, so without this a screen reader hears\n nothing while rows load. The region stays in the DOM and only its text changes, which is\n what makes assistive tech read it; one inserted with its text already set is often missed. -->\n<span class=\"sr-only\" role=\"status\">{{ isLoadingState ? loadingLabel : '' }}</span>\n\n<!-- Table wrapper with horizontal scroll -->\n <div #collectionBody [attr.aria-busy]=\"isLoadingState || null\" [attr.aria-label]=\"tableRegionLabel\" [style.min-height.px]=\"bodyMinHeight\"\n class=\"overflow-x-auto\"\n role=\"region\">\n <table [class]=\"tableClasses\">\n <thead>\n <tr class=\"bg-base-100\">\n <!-- Selection column header. It always carries a screen-reader-only name: a single-select\n table has nothing else in this cell, and a multi-select one only a checkbox, so\n without it the column is announced as a nameless header (axe empty-table-header). -->\n @if (hasSelection) {\n <th class=\"w-10 text-center text-sm px-2 py-2\">\n <span class=\"sr-only\">{{ selectionColumnLabel }}</span>\n @if (isMultiSelect) {\n <mn-lib-checkbox\n (checkedChange)=\"toggleAll()\"\n [checked]=\"allSelected\"\n [props]=\"{ id: 'mn-table-select-all', size: 'sm' }\"\n ></mn-lib-checkbox>\n }\n </th>\n }\n\n <!-- Data columns -->\n @for (column of dataSource.columns; track column.key) {\n <th\n [attr.data-column-key]=\"column.key\"\n [class.truncate]=\"widthsArePinned\"\n [class.cursor-pointer]=\"isSortable(column)\"\n [class.select-none]=\"isSortable(column)\"\n [class.hover:bg-base-200]=\"isSortable(column)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n [attr.aria-sort]=\"currentSort?.columnKey === column.key ? (currentSort!.direction === 'asc' ? 'ascending' : 'descending') : null\"\n class=\"text-sm px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2 whitespace-nowrap\"\n (click)=\"sort(column)\"\n >\n <!-- The header content is declared once; a sortable column wraps it in a real button so\n the sort is reachable by keyboard. The button's click stops there, so the th's own\n click (which keeps the cell padding clickable) does not sort a second time. -->\n <ng-template #headerContent>\n @if (isTemplateRef(column.header)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.header)\"></ng-container>\n } @else {\n <span>{{ headerText(column) }}</span>\n }\n @if (isSortable(column)) {\n <span class=\"text-[0.65rem] opacity-70 min-w-3 inline-block\" aria-hidden=\"true\">{{ getSortIcon(column) }}</span>\n }\n </ng-template>\n @if (isSortable(column)) {\n <button type=\"button\" class=\"inline-flex items-center gap-1 cursor-pointer\" (click)=\"$event.stopPropagation(); sort(column)\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </button>\n } @else {\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutlet]=\"headerContent\"></ng-container>\n </span>\n }\n </th>\n }\n\n </tr>\n\n <!-- Per-column filter row (wide screens only; collapses into a panel below 640px).\n The cells are `td`, not `th`: they hold form controls, not headings, and a\n column without a filter would otherwise be an empty header, which assistive tech\n announces as a nameless column (axe `empty-table-header`). `font-normal` stays\n so a consumer's thead styling cannot make the controls bold. -->\n @if (hasColumnFilters && !filtersCollapsed) {\n <tr class=\"bg-base-100 border-b border-base-300 font-normal\">\n @if (hasSelection) {\n <td class=\"px-2 py-1 font-normal\"></td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td\n class=\"px-4 py-2 font-normal\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n >\n @if (column.filterable) {\n <!-- Every filter renders as an ordinary control right under its\n header. The rich types used to hide behind a button that opened\n a floating panel, which cost a click to discover, a click to\n apply, and hid whether a column was even filterable. -->\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: column, idScope: 'inline' }\"\n [ngTemplateOutlet]=\"filterField\"\n ></ng-container>\n }\n </td>\n }\n </tr>\n }\n </thead>\n\n <tbody>\n <!-- Loading state -->\n @if (isLoadingState) {\n @for (_ of skeletonRows; track $index) {\n <tr>\n @if (hasSelection) {\n <td class=\"px-2 py-3\">\n <mn-skeleton [data]=\"{ shape: 'rectangle', width: '1rem', height: '1rem' }\"></mn-skeleton>\n </td>\n }\n @for (column of dataSource.columns; track column.key) {\n <td class=\"px-4 py-3\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n >\n @if (isTemplateRef(column.skeleton)) {\n <ng-container [ngTemplateOutlet]=\"$any(column.skeleton)\"></ng-container>\n } @else {\n <mn-skeleton [data]=\"getColumnSkeletonData(column)\"></mn-skeleton>\n }\n </td>\n }\n </tr>\n }\n } @else if (isErrorState) {\n <!-- Error state -->\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n @if (dataSource.errorTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.errorTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-error\">\n <p class=\"text-sm\">{{ dataSource.errorMessage }}</p>\n </div>\n }\n </td>\n </tr>\n } @else {\n <!-- Empty state -->\n @if (filteredItems.length === 0) {\n <tr class=\"bg-base-100\">\n <td [attr.colspan]=\"totalColumnCount\" class=\"text-center text-xs py-8\">\n @if (dataSource.emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.emptyTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-base-content/50\">\n @if (dataSource.emptyIcon !== null) {\n <svg [lucideIcon]=\"dataSource.emptyIcon ?? defaultEmptyIcon\" [size]=\"32\" [strokeWidth]=\"1.5\"></svg>\n }\n <p class=\"text-sm\">{{ dataSource.emptyMessage }}</p>\n </div>\n }\n </td>\n </tr>\n }\n\n <!-- Data rows -->\n @for (row of paginatedItems; track trackByID($index, row); let odd = $odd; let last = $last) {\n <tr\n class=\"bg-base-100 transition-colors duration-150 hover:cursor-pointer\"\n [ngClass]=\"{'bg-primary/10': isSelected(row)}\"\n [class.bg-base-200]=\"!isSelected(row) && odd && dataSource.appearance?.striped\"\n [class.hover:bg-base-200]=\"dataSource.appearance?.hover !== false\"\n [class.cursor-pointer]=\"!!dataSource.onRowClick\"\n [class.border-b]=\"!last\"\n [class.border-base-300]=\"!last\"\n [class.border-b-1]=\"last\"\n [class.border-black]=\"last\"\n [class.shadow-3xl]=\"last\"\n (click)=\"onRowClick(row)\"\n >\n <!-- Selection checkbox -->\n @if (hasSelection) {\n <td (click)=\"$event.stopPropagation()\" class=\"w-10 text-center px-2 py-2\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(row)\"\n [checked]=\"isSelected(row)\"\n [props]=\"{ id: 'mn-table-row-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </td>\n }\n\n <!-- Data cells -->\n @for (column of dataSource.columns; track column.key) {\n <td\n [attr.title]=\"cellTitle(column, row)\"\n [class.text-left]=\"(column.align ?? 'left') === 'left'\"\n [class.text-center]=\"column.align === 'center'\"\n [class.text-right]=\"column.align === 'right'\"\n [class.truncate]=\"widthsArePinned\"\n [mnHiddenBelow]=\"column.hiddenBelow\"\n [style.width]=\"columnWidth(column)\"\n class=\"text-xs px-2 py-1 @min-[640px]:px-4 @min-[640px]:py-2\"\n >\n @if (column.actions) {\n <!-- Actions column: inline command buttons that collapse into a ⋯ menu\n once the table is narrower than 450px (container query), for every\n row with actions. A row with no visible actions renders nothing.\n A row with a single icon-only action never collapses: one icon button\n is narrower than the ⋯ trigger it would hide behind, so folding it\n only costs a tap. -->\n @if (hasRowActions(column, row)) {\n <div class=\"inline-flex items-center gap-1\"\n [class.justify-end]=\"(column.align ?? 'left') === 'right'\">\n @if (collapsesRowActions(column, row)) {\n <span class=\"hidden items-center gap-1 @min-[450px]:inline-flex\">\n <ng-container [ngTemplateOutletContext]=\"{ column: column, row: row }\"\n [ngTemplateOutlet]=\"actionButtons\"></ng-container>\n </span>\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <span class=\"@min-[450px]:hidden\" (click)=\"$event.stopPropagation()\">\n <mn-lib-dropdown [datasource]=\"{\n id: actionsDropdownId(column, row),\n actions: rowDropdownActions(column, row),\n menuLabel: headerText(column),\n size: 'sm'\n }\"></mn-lib-dropdown>\n </span>\n } @else {\n <span class=\"inline-flex items-center gap-1\">\n <ng-container [ngTemplateOutletContext]=\"{ column: column, row: row }\"\n [ngTemplateOutlet]=\"actionButtons\"></ng-container>\n </span>\n }\n </div>\n }\n } @else if (column.cellSm) {\n <!-- Default cell: hidden below the cellSm breakpoint -->\n <span [mnShowAbove]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n </span>\n <!-- Small cell: shown only below the cellSm breakpoint -->\n <span [mnShowBelow]=\"column.cellSm.below\">\n @if (isTemplateRef(column.cellSm.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cellSm.cell)\"></ng-container>\n } @else {\n {{ getCellSmValue(column, row) }}\n }\n </span>\n } @else {\n @if (isTemplateRef(column.cell)) {\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: row, data: row }\"\n [ngTemplateOutlet]=\"$any(column.cell)\"></ng-container>\n } @else {\n {{ getCellValue(column, row) }}\n }\n }\n </td>\n }\n\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n<!-- Load more + pagination -->\n<mn-collection-pagination\n (loadMore)=\"loadMoreRows()\"\n (pageChange)=\"goToPage($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [currentPage]=\"currentPage\"\n [isPaginated]=\"isPaginated\"\n [isServerPaginated]=\"isServerPaginated\"\n [labels]=\"dataSource.labels\"\n [loadingMoreRows]=\"loadingMoreRows\"\n [pageSizeSelectOptions]=\"pageSizeSelectOptions\"\n [pageSize]=\"pageSize\"\n [showLoadMore]=\"showLoadMore\"\n [totalItemCount]=\"totalItemCount\"\n [totalPages]=\"totalPages\"\n [visiblePages]=\"visiblePages\"\n idPrefix=\"mn-table\"\n></mn-collection-pagination>\n</div>\n\n<!-- Single source of truth for every filter control, reused by the inline header\n row and the small-screen panel. `idScope` keeps element ids unique across\n both placements. -->\n<ng-template #filterField let-column let-idScope=\"idScope\">\n @switch (filterTypeOf(column)) {\n @case ('select') {\n <mn-lib-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterSelectOptions(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @case ('multi-select') {\n <mn-lib-multi-select\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"multiFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getFilterMultiSelectOptions(column),\n placeholder: column.filterPlaceholder ?? '',\n collapsePlaceholder: filterSelectedLabel,\n collapseThreshold: 1,\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-multi-select>\n }\n @case ('boolean') {\n <mn-lib-select\n (ngModelChange)=\"onBooleanFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"booleanFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n ariaLabel: filterLabel(column),\n options: getBooleanFilterOptions(column),\n size: 'sm',\n fullWidth: true\n }\"\n ></mn-lib-select>\n }\n @default {\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n (ngModelChange)=\"onColumnFilter(column, $event)\"\n [disabled]=\"column.filterDisabled ?? false\"\n [ngModel]=\"textFilterValue(column)\"\n [props]=\"{\n id: 'mn-table-filter-' + idScope + '-' + column.key,\n type: 'text',\n label: '',\n placeholder: column.filterPlaceholder ?? '',\n ariaLabel: column.filterPlaceholder ?? '',\n autocomplete: column.filterAutocomplete ?? undefined,\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true,\n hover: true\n }\"\n ></mn-lib-input-field>\n }\n }\n</ng-template>\n\n<!-- Inline action buttons for an actions column, shared by the wide-table layout and\n (implicitly) mirrored by the ⋯ menu below 450px. -->\n<ng-template #actionButtons let-column=\"column\" let-row=\"row\">\n @for (action of visibleRowActions(column, row); track $index) {\n <button\n mnButton\n type=\"button\"\n [data]=\"{\n size: 'sm',\n variant: 'text',\n color: rowActionColor(action, row),\n disabled: isRowActionDisabled(action, row)\n }\"\n class=\"cursor-pointer\"\n (click)=\"$event.stopPropagation(); runRowAction(action, row)\"\n [attr.aria-label]=\"rowActionLabel(action, row)\"\n [attr.title]=\"showActionLabel(column, action, row) ? null : rowActionLabel(action, row)\"\n >\n @if (showActionIcon(column, action, row)) {\n <span class=\"inline-flex items-center shrink-0\">\n @let icon = rowActionIcon(action, row);\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <!-- Data icon: sized here to match the sm button's text, so a caller can\n declare the action in TypeScript without owning a template. -->\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"17\"></svg>\n }\n </span>\n }\n @if (showActionLabel(column, action, row)) {\n <span>{{ rowActionLabel(action, row) }}</span>\n }\n </button>\n }\n</ng-template>\n","import {\n Component,\n Input,\n OnInit,\n Type,\n ViewChild,\n ViewContainerRef,\n ComponentRef,\n TemplateRef,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MnModalRef } from '../../mn-modal-ref';\nimport { CustomModalConfig } from '../../mn-modal.types';\n\n@Component({\n selector: 'mn-custom-body-host',\n standalone: true,\n imports: [CommonModule],\n template: '<ng-container #container></ng-container>',\n})\nexport class MnCustomBodyHostComponent implements OnInit {\n @Input() config!: CustomModalConfig;\n @Input() modalRef!: MnModalRef<unknown>;\n\n @ViewChild('container', { read: ViewContainerRef }) container!: ViewContainerRef;\n\n private componentRef?: ComponentRef<unknown>;\n\n ngOnInit(): void {\n setTimeout(() => this.loadContent(), 0);\n }\n\n private loadContent(): void {\n if (!this.container) return;\n\n this.container.clear();\n\n if (this.config.component) {\n this.attachComponent(this.config.component);\n } else if (this.config.template) {\n this.attachTemplate(this.config.template);\n }\n }\n\n attachComponent(component: Type<unknown>): void {\n this.componentRef = this.container.createComponent(component);\n\n // Pass inputs to the component\n if (this.config.inputs) {\n Object.entries(this.config.inputs).forEach(([key, value]) => {\n (this.componentRef!.instance as Record<string, unknown>)[key] = value;\n });\n }\n\n // Pass modalRef if the component has a modalRef property\n const instance = this.componentRef.instance as Record<string, unknown>;\n if (instance && 'modalRef' in instance) {\n instance['modalRef'] = this.modalRef;\n }\n }\n\n attachTemplate(template: TemplateRef<unknown>): void {\n this.container.createEmbeddedView(template, {\n $implicit: this.modalRef,\n modalRef: this.modalRef,\n });\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n Type,\n ViewChildren,\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {\n AbstractControlOptions,\n FormBuilder,\n FormGroup,\n ReactiveFormsModule,\n ValidatorFn,\n Validators\n} from '@angular/forms';\nimport {Subscription} from 'rxjs';\nimport {MnModalRef} from '../../mn-modal-ref';\nimport {\n FieldDataSource,\n FieldKind,\n FieldRequiredCondition,\n FieldVisibilityCondition,\n FileFieldConfig,\n FormFieldConfig,\n FormFieldGroup,\n FormModalConfig,\n FormRow,\n ModalCloseReason,\n ModalI18nLabels,\n ModalInputMap,\n MultiSelectTableFieldConfig,\n RatingFieldConfig,\n SelectOption,\n SingleSelectTableFieldConfig,\n SliderFieldConfig,\n SubmitMode,\n} from '../../mn-modal.types';\nimport {MnButton} from '../../../mn-button';\nimport {MnInputField} from '../../../mn-input-field';\nimport {MnCheckbox} from '../../../mn-checkbox';\nimport {MnDatetime} from '../../../mn-datetime';\nimport {MnMultiSelect} from '../../../mn-multi-select';\nimport {MnTextarea} from '../../../mn-textarea';\nimport {MnFileInput} from '../../../mn-file-input';\nimport {MnSelect, MnSelectOption, MnSelectProps} from '../../../mn-select';\nimport {MnCustomFieldHostDirective} from './mn-custom-field-host.directive';\nimport {MnLanguageService} from '../../../../language';\nimport {MnTable, TableDataSource} from '../../../mn-table';\nimport {MnCustomBodyHostComponent} from '../mn-custom-body-host/mn-custom-body-host.component';\nimport {LucideDynamicIcon, LucideIconData} from '@lucide/angular';\nimport {MN_MODAL_ACTION_ICONS, MODAL_ACTION_ICON_SIZE} from '../../mn-modal-action-icons';\n\n/**\n * A structural \"view\" over the {@link FormFieldConfig} discriminated union that\n * exposes every member-specific property as optional. The template and several\n * helpers need to read properties that only exist on some union members (e.g.\n * `placeholder`, `swatches`, `mode`, `dataSource`, `validators`). Casting the\n * field to this view keeps that access type-checked without resorting to `any`.\n */\ntype FormFieldView<TModel> = FormFieldConfig<TModel> & {\n label?: string;\n placeholder?: string;\n validators?: ValidatorFn[];\n asyncValidators?: ValidatorFn[];\n updateOn?: 'change' | 'blur' | 'submit';\n options?: SelectOption[];\n dataSource?: FieldDataSource;\n disabled?: boolean;\n readOnly?: boolean;\n visible?: FieldVisibilityCondition<TModel>;\n conditionallyRequired?: FieldRequiredCondition<TModel>;\n autoFocus?: boolean;\n defaultValue?: unknown;\n mask?: string;\n autocomplete?: string;\n minDate?: string;\n maxDate?: string;\n mode?: 'date' | 'time' | 'datetime-local';\n min?: number | string;\n max?: number | string;\n step?: number;\n rows?: number;\n searchable?: boolean;\n searchPlaceholder?: string;\n maxSelections?: number;\n collapseThreshold?: number;\n collapsePlaceholder?: string;\n allSelectedPlaceholder?: string;\n swatches?: string[];\n showValue?: boolean;\n unit?: string;\n accept?: string;\n multiple?: boolean;\n displayMode?: 'dropzone' | 'thumbnail' | 'list' | 'compact';\n dropzoneHint?: string;\n dropActiveHint?: string;\n replaceLabel?: string;\n removeLabel?: string;\n currentUrl?: string | null;\n currentUrls?: string[] | null;\n onClear?: () => void;\n // Non-optional in the view: the template only reads these inside the\n // matching @case/@if guards where the runtime value is always present.\n // Keeping them non-undefined avoids spurious template type errors that the\n // previous `any` cast masked, without changing runtime behavior.\n maxSize: number;\n maxFiles?: number;\n component: Type<unknown>;\n inputs?: ModalInputMap;\n};\n\n@Component({\n selector: 'mn-form-body',\n standalone: true,\n imports: [CommonModule, ReactiveFormsModule, MnButton, MnInputField, MnCheckbox, MnDatetime, MnMultiSelect, MnTextarea, MnFileInput, MnSelect, MnCustomFieldHostDirective, MnTable, MnCustomBodyHostComponent, LucideDynamicIcon],\n templateUrl: './mn-form-body.component.html',\n styleUrls: ['./mn-form-body.component.css'],\n})\nexport class MnFormBodyComponent<TModel = unknown, TResult = TModel> implements OnInit, OnDestroy, AfterViewInit {\n private fb = inject(FormBuilder);\n\n /**\n * Change detector used to announce state this component mutates outside an Angular\n * event handler — after an `await`, or from an RxJS subscription. Consuming apps run\n * zoneless, where such a write notifies nothing: the view is never marked dirty, so it\n * keeps rendering the stale value and `checkNoChanges` then reports it as NG0100\n * (e.g. the submit button staying disabled on \"Submitting...\" after a failed submit).\n * Every async mutation of {@link isSubmitting}, {@link fieldLoading}, {@link fieldOptions}\n * and {@link formErrors} must be followed by `markForCheck()`.\n */\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() config!: FormModalConfig<TModel, TResult>;\n @Input() modalRef!: MnModalRef<TResult>;\n @Input() hideFooter = false;\n @Input() hideCustomBody = false;\n @Output() formStatusChange = new EventEmitter<string>();\n\n @ViewChildren(MnInputField) inputFields?: QueryList<MnInputField>;\n @ViewChildren(MnTextarea) textareas?: QueryList<MnTextarea>;\n\n form!: FormGroup;\n rows: FormRow<TModel>[] = [];\n fieldGroups: FormFieldGroup<TModel>[] = [];\n isSubmitting = false;\n readonly FieldKind = FieldKind;\n readonly ModalCloseReason = ModalCloseReason;\n\n /** Cross-field validation errors: { fieldKey: errorMessage } */\n formErrors: Record<string, string> = {};\n\n /** Track which fields are currently visible (for conditional fields) */\n fieldVisibility: Record<string, boolean> = {};\n\n /** Track which fields are currently conditionally required */\n fieldConditionallyRequired: Record<string, boolean> = {};\n\n /** Track loading state per field for async data sources */\n fieldLoading: Record<string, boolean> = {};\n\n /** Dynamic options loaded from data sources */\n fieldOptions: Record<string, SelectOption[]> = {};\n\n private valueChangesSubscription?: Subscription;\n\n asField(field: FormFieldConfig<TModel>): FormFieldView<TModel> {\n return field as FormFieldView<TModel>;\n }\n\n asKey(key: keyof TModel | string): string {\n return key as string;\n }\n\n // The template builds untyped `props` object literals and passes them to\n // strongly-typed child component `[props]` inputs. There is no single static\n // type for those literals, so this identity bridge must return `any` to keep\n // the template assignment-compatible. This is a genuine template-bridge case.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n asAny(val: unknown): any {\n return val;\n }\n\n hasRequiredValidator(field: FormFieldConfig<TModel>): boolean {\n const view = field as FormFieldView<TModel>;\n // Check if conditionallyRequired is currently active\n if (view.conditionallyRequired) {\n const formValue = (this.form?.value ?? {}) as Partial<TModel>;\n if (view.conditionallyRequired(formValue)) return true;\n }\n const validators = view.validators;\n if (!validators) return false;\n // Check if Validators.required is in the array by testing a dummy control\n const control = this.fb.control(null, validators);\n const errors = control.errors;\n return errors != null && 'required' in errors;\n }\n\n /** Store table data sources keyed by field key for template access */\n tableDataSources: Record<string, TableDataSource<unknown>> = {};\n\n private languageService = inject(MnLanguageService);\n\n private static readonly DEFAULT_LABELS: Record<string, string> = {\n submit: 'Submit',\n cancel: 'Cancel',\n submitting: 'Submitting...',\n selectPlaceholder: 'Select...',\n loading: 'Loading...',\n fileUploadPrompt: 'Click or drag files here',\n fieldRequired: 'This field is required',\n loadingOptions: 'Loading options...',\n accepted: 'Accepted:',\n maxSize: 'Max size:',\n };\n\n private resolveLabel(i18nValue: string | undefined, key: string): string {\n if (i18nValue) return i18nValue;\n const translated = this.languageService.translate(`common.${key}`);\n return translated === `common.${key}` ? MnFormBodyComponent.DEFAULT_LABELS[key] : translated;\n }\n\n /** Resolved i18n labels with defaults, falling back to translated keys */\n get labels() {\n // The config's i18n map may carry extra keys beyond ModalI18nLabels (e.g.\n // fieldRequired, loadingOptions), so widen the type to expose them as\n // declared optional properties (keeps dot access type-checked).\n const i18n: ModalI18nLabels &\n Partial<Record<'fieldRequired' | 'loadingOptions' | 'accepted' | 'maxSize', string>> =\n this.config.i18n || {};\n return {\n submit: this.resolveLabel(i18n.submit, 'submit'),\n cancel: this.resolveLabel(i18n.cancel, 'cancel'),\n submitting: this.resolveLabel(i18n.submitting, 'submitting'),\n selectPlaceholder: this.resolveLabel(i18n.selectPlaceholder, 'selectPlaceholder'),\n loading: this.resolveLabel(i18n.loading, 'loading'),\n fileUploadPrompt: this.resolveLabel(i18n.fileUploadPrompt, 'fileUploadPrompt'),\n fieldRequired: this.resolveLabel(i18n.fieldRequired, 'fieldRequired'),\n loadingOptions: this.resolveLabel(i18n.loadingOptions, 'loadingOptions'),\n accepted: this.resolveLabel(i18n.accepted, 'accepted'),\n maxSize: this.resolveLabel(i18n.maxSize, 'maxSize'),\n };\n }\n\n ngOnInit(): void {\n this.initializeForm();\n this.buildRows();\n this.initializeVisibility();\n this.initializeDataSources();\n this.initializeTableFields();\n this.subscribeToValueChanges();\n\n if (this.config.disabled || this.config.readOnly) {\n this.form.disable();\n }\n\n // Emit initial status\n setTimeout(() => {\n this.formStatusChange.emit(this.form.status);\n });\n }\n\n ngAfterViewInit(): void {\n // Small delay to ensure children are fully rendered and MnModalShell hasn't just stolen focus\n setTimeout(() => {\n this.applyAutoFocus();\n }, 100);\n }\n\n public applyAutoFocus(): void {\n const autoFocusField = this.config.fields.find(f => (f as FormFieldView<TModel>).autoFocus);\n if (!autoFocusField) return;\n\n const key = autoFocusField.key as string;\n\n // Small delay to ensure browser is ready to focus\n setTimeout(() => {\n // Try finding in MnInputField components\n const inputField = this.inputFields?.find(f => f.props.id === key);\n if (inputField) {\n inputField.focus();\n return;\n }\n\n // Try finding in MnTextarea components\n const textarea = this.textareas?.find(f => f.props?.id === key);\n if (textarea) {\n textarea.focus();\n return;\n }\n\n // Fallback to native element if possible\n const el = document.getElementById(key);\n if (el) el.focus();\n }, 50);\n }\n\n ngOnDestroy(): void {\n this.valueChangesSubscription?.unsubscribe();\n }\n\n private initializeForm(): void {\n const formControls: Record<string, [unknown, AbstractControlOptions]> = {};\n\n this.config.fields.forEach(field => {\n const fieldConfig = field as FormFieldView<TModel>;\n let initialValue: unknown = this.config.initialValue?.[field.key as keyof TModel] ?? null;\n\n // Handle checkbox default values\n if (field.kind === FieldKind.CHECKBOX && initialValue === null) {\n initialValue = fieldConfig.defaultValue ?? false;\n }\n\n const validators = fieldConfig.validators || [];\n const asyncValidators = fieldConfig.asyncValidators || [];\n const updateOn = fieldConfig.updateOn || 'change';\n\n formControls[field.key as string] = [\n initialValue,\n {\n validators,\n asyncValidators,\n updateOn\n }\n ];\n });\n\n this.form = this.fb.group(formControls);\n\n // Apply Angular FormGroup-level validators\n if (this.config.groupValidators && this.config.groupValidators.length > 0) {\n this.form.setValidators(this.config.groupValidators);\n this.form.updateValueAndValidity();\n }\n\n // Apply disabled/readOnly state to controls\n this.config.fields.forEach(field => {\n const fieldView = field as FormFieldView<TModel>;\n const control = this.form.get(field.key as string);\n if (control && (fieldView.disabled || fieldView.readOnly)) {\n control.disable();\n }\n });\n }\n\n isFieldReadOnly(field: FormFieldConfig<TModel>): boolean {\n return this.config.readOnly === true || (field as FormFieldView<TModel>).readOnly === true;\n }\n\n isFieldDisabled(field: FormFieldConfig<TModel>): boolean {\n return this.config.disabled === true || (field as FormFieldView<TModel>).disabled === true;\n }\n\n /** Track which field groups are currently visible */\n groupVisibility: Record<string, boolean> = {};\n\n private buildRows(): void {\n if (this.config.rows && this.config.rows.length > 0) {\n this.rows = this.config.rows;\n } else {\n // Create rows for fields that are not in any row or group\n const fieldsInGroups = new Set<string>();\n (this.config.fieldGroups || []).forEach(g => {\n (g.rows || []).forEach(r => r.fields.forEach(f => fieldsInGroups.add(f.field.key as string)));\n // Also check if group has flat fields list (compatibility)\n if (g.fields) {\n g.fields.forEach(f => fieldsInGroups.add(f.key as string));\n }\n });\n\n const fieldsInRows = new Set<string>();\n (this.config.rows || []).forEach(r => r.fields.forEach(f => fieldsInRows.add(f.field.key as string)));\n\n const standaloneFields = this.config.fields.filter(f => !fieldsInGroups.has(f.key as string) && !fieldsInRows.has(f.key as string));\n\n if (standaloneFields.length > 0) {\n this.rows = standaloneFields.map(field => ({\n columns: 1,\n fields: [{ field, span: 1 }],\n }));\n }\n }\n // Build field groups\n this.fieldGroups = this.config.fieldGroups || [];\n // Initialize group visibility\n this.initializeGroupVisibility();\n }\n\n private initializeGroupVisibility(): void {\n this.fieldGroups.forEach((group, index) => {\n const key = group.title || `group-${index}`;\n const isVisible = group.visible ? group.visible(this.form.value) : true;\n this.groupVisibility[key] = isVisible;\n // If group is hidden, clear validators on its fields\n if (!isVisible) {\n group.fields.forEach(field => {\n const control = this.form.get(field.key as string);\n if (control) {\n control.clearValidators();\n control.updateValueAndValidity({ emitEvent: false });\n }\n });\n }\n });\n }\n\n private updateGroupVisibility(): void {\n const formValue = this.form.value;\n this.fieldGroups.forEach((group, index) => {\n const key = group.title || `group-${index}`;\n const wasVisible = this.groupVisibility[key];\n const isVisible = group.visible ? group.visible(formValue) : true;\n this.groupVisibility[key] = isVisible;\n\n if (!isVisible && wasVisible) {\n // Group became hidden — clear validators on its fields\n group.fields.forEach(field => {\n const control = this.form.get(field.key as string);\n if (control) {\n control.clearValidators();\n control.updateValueAndValidity({ emitEvent: false });\n }\n });\n } else if (isVisible && !wasVisible) {\n // Group became visible — restore validators\n group.fields.forEach(field => {\n const fieldView = field as FormFieldView<TModel>;\n const validators = fieldView.validators || [];\n const control = this.form.get(field.key as string);\n if (control) {\n control.setValidators(validators);\n control.updateValueAndValidity({ emitEvent: false });\n }\n });\n }\n });\n }\n\n isGroupVisible(group: FormFieldGroup<TModel>): boolean {\n const key = group.title || `group-${this.fieldGroups.indexOf(group)}`;\n return this.groupVisibility[key];\n }\n\n // =========================\n // Feature 1: Conditional/Dynamic Fields\n // =========================\n\n private initializeVisibility(): void {\n const formValue = this.form.value as Partial<TModel>;\n this.config.fields.forEach(field => {\n const key = field.key as string;\n const fieldView = field as FormFieldView<TModel>;\n const isVisible = fieldView.visible ? fieldView.visible(formValue) : true;\n this.fieldVisibility[key] = isVisible;\n\n // If initially hidden, clear validators so they don't block submit\n if (!isVisible) {\n const control = this.form.get(key);\n if (control) {\n control.clearValidators();\n control.updateValueAndValidity({ emitEvent: false });\n }\n } else if (fieldView.conditionallyRequired) {\n // Initialize conditionallyRequired state for visible fields\n const isRequired = fieldView.conditionallyRequired(formValue);\n this.fieldConditionallyRequired[key] = isRequired;\n if (isRequired) {\n const control = this.form.get(key);\n if (control) {\n const validators = this.buildValidators(fieldView, formValue);\n control.setValidators(validators);\n control.updateValueAndValidity({emitEvent: false});\n }\n }\n }\n });\n }\n\n private updateVisibility(): void {\n const formValue = this.form.value as Partial<TModel>;\n this.config.fields.forEach(field => {\n const key = field.key as string;\n const fieldView = field as FormFieldView<TModel>;\n const wasVisible = this.fieldVisibility[key];\n const isVisible = fieldView.visible ? fieldView.visible(formValue) : true;\n this.fieldVisibility[key] = isVisible;\n\n // When a field becomes hidden, clear its validators so it doesn't block submit\n const control = this.form.get(key);\n if (control) {\n if (!isVisible && wasVisible) {\n control.clearValidators();\n control.updateValueAndValidity({ emitEvent: false });\n } else if (isVisible && !wasVisible) {\n // Restore validators (including conditionallyRequired if active)\n const validators = this.buildValidators(fieldView, formValue);\n control.setValidators(validators);\n control.updateValueAndValidity({emitEvent: false});\n } else if (isVisible) {\n // Update conditionallyRequired for visible fields\n this.updateConditionallyRequired(fieldView, formValue);\n }\n }\n });\n }\n\n /**\n * Builds the full validator array for a field, including conditionallyRequired.\n * @param field The field configuration view.\n * @param formValue The current form values.\n * @returns Array of validators to apply.\n */\n private buildValidators(field: FormFieldView<TModel>, formValue: Partial<TModel>): ValidatorFn[] {\n const baseValidators = field.validators ? [...field.validators] : [];\n if (field.conditionallyRequired && field.conditionallyRequired(formValue)) {\n if (!baseValidators.includes(Validators.required)) {\n baseValidators.push(Validators.required);\n }\n }\n return baseValidators;\n }\n\n /**\n * Updates the conditionallyRequired state for a single field and adjusts validators.\n * @param field The field configuration view.\n * @param formValue The current form values.\n */\n private updateConditionallyRequired(field: FormFieldView<TModel>, formValue: Partial<TModel>): void {\n if (!field.conditionallyRequired) return;\n const key = field.key as string;\n const wasRequired = this.fieldConditionallyRequired[key] ?? false;\n const isRequired = field.conditionallyRequired(formValue);\n this.fieldConditionallyRequired[key] = isRequired;\n\n if (isRequired !== wasRequired) {\n const control = this.form.get(key);\n if (control) {\n const validators = this.buildValidators(field, formValue);\n control.setValidators(validators);\n control.updateValueAndValidity({emitEvent: false});\n }\n }\n }\n\n isFieldVisible(field: FormFieldConfig<TModel>): boolean {\n return this.fieldVisibility[field.key as string];\n }\n\n // =========================\n // Feature 2: Cross-Field Validation\n // =========================\n\n private runFormValidators(): void {\n this.formErrors = {};\n if (!this.config.formValidators) return;\n\n const formValue = this.form.value;\n for (const validator of this.config.formValidators) {\n const errors = validator(formValue);\n if (errors) {\n Object.assign(this.formErrors, errors);\n }\n }\n }\n\n getFieldError(key: string): string | null {\n return this.formErrors[key] || null;\n }\n\n get hasFormErrors(): boolean {\n return Object.keys(this.formErrors).length > 0;\n }\n\n // =========================\n // Feature 3: Async Data Sources\n // =========================\n\n private initializeDataSources(): void {\n this.config.fields.forEach(field => {\n const fieldView = field as FormFieldView<TModel>;\n if (fieldView.dataSource) {\n this.loadFieldOptions(field.key as string, fieldView.dataSource, this.form.value as Partial<TModel>);\n }\n });\n }\n\n isFieldLoading(key: string): boolean {\n return this.fieldLoading[key];\n }\n\n /** Get options for a field — uses dataSource options if available, otherwise static options */\n getFieldOptions(field: FormFieldConfig<TModel>): SelectOption[] {\n const key = field.key as string;\n if (this.fieldOptions[key] !== undefined) {\n return this.fieldOptions[key];\n }\n return (field as FormFieldView<TModel>).options || [];\n }\n\n /** Convert SelectOption[] to MnSelectOption[] for mn-lib-select */\n getSelectOptions(field: FormFieldConfig<TModel>): MnSelectOption[] {\n return this.getFieldOptions(field).map(o => ({\n label: o.label,\n value: o.value,\n disabled: o.state === 'disabled',\n }));\n }\n\n getSelectProps(field: FormFieldConfig<TModel>): MnSelectProps {\n return {\n id: field.key as string,\n label: this.asField(field).label,\n placeholder: this.isFieldLoading(field.key as string) ? this.labels.loading : this.labels.selectPlaceholder,\n options: this.getSelectOptions(field),\n fullWidth: true,\n };\n }\n\n private async loadFieldOptions(key: string, dataSource: FieldDataSource, formValue: Partial<TModel>): Promise<void> {\n this.fieldLoading[key] = true;\n this.cdr.markForCheck();\n try {\n this.fieldOptions[key] = await dataSource.load(formValue);\n } catch (error) {\n console.error(`Failed to load options for field '${key}':`, error);\n this.fieldOptions[key] = [];\n } finally {\n // Resolved after an `await`, so nothing has told Angular the spinner can go and the\n // options have arrived. Without this the field renders \"Loading options...\" forever.\n this.fieldLoading[key] = false;\n this.cdr.markForCheck();\n }\n }\n\n // =========================\n // Feature: Multi-Select Table Fields\n // =========================\n\n private initializeTableFields(): void {\n this.config.fields.forEach(field => {\n if (field.kind === FieldKind.MULTI_SELECT_TABLE) {\n const tableField = field as MultiSelectTableFieldConfig<TModel>;\n const ds = tableField.tableDataSource;\n // Force multi selection mode\n ds.selectionMode = 'multi';\n\n // Default the selection summary on. A table used as a form field is always\n // inside a modal, where it is short, paged and searched — so the rows the\n // user has already picked are the ones most likely to be scrolled out of\n // sight, which is exactly what the summary exists to prevent. Set\n // `selectionSummary: false` on the data source to opt a field out.\n ds.selectionSummary ??= true;\n\n // A modal is too short to make a rows-per-page choice meaningful, and the\n // selector costs a row of footer the sheet cannot spare. Pinning the options\n // to the single configured size hides it through the paginator's existing\n // \"more than one option\" rule rather than adding a second way to hide it.\n ds.pageSizeOptions = [ds.pageSize ?? 10];\n\n // Pre-select rows from the form's initial value\n const control = this.form.get(field.key as string);\n if (control && Array.isArray(control.value) && control.value.length > 0) {\n ds.initialSelectedIds = control.value.map((v: unknown) => String(v));\n } else if (control && control.value === null) {\n control.setValue([], { emitEvent: false });\n }\n\n this.tableDataSources[field.key as string] = ds;\n } else if (field.kind === FieldKind.SINGLE_SELECT_TABLE) {\n const tableField = field as SingleSelectTableFieldConfig<TModel>;\n const ds = tableField.tableDataSource;\n // Force single selection mode\n ds.selectionMode = 'single';\n\n // Pre-select row from the form's initial value\n const control = this.form.get(field.key as string);\n if (control && control.value != null) {\n ds.initialSelectedIds = [String(control.value)];\n }\n\n this.tableDataSources[field.key as string] = ds;\n }\n });\n }\n\n onTableSelectionChange(field: FormFieldConfig<TModel>, selectedRows: unknown[]): void {\n if (field.kind === FieldKind.SINGLE_SELECT_TABLE) {\n const tableField = field as SingleSelectTableFieldConfig<TModel>;\n const getVal = tableField.getRowValue || tableField.tableDataSource.getID;\n const value = selectedRows.length > 0 ? getVal(selectedRows[0]) : null;\n const control = this.form.get(field.key as string);\n if (control) {\n control.setValue(value);\n control.markAsTouched();\n }\n } else {\n const tableField = field as MultiSelectTableFieldConfig<TModel>;\n const getVal = tableField.getRowValue || tableField.tableDataSource.getID;\n const values = selectedRows.map(row => getVal(row));\n const control = this.form.get(field.key as string);\n if (control) {\n control.setValue(values);\n control.markAsTouched();\n }\n }\n }\n\n // =========================\n // Feature: Rating Fields\n // =========================\n\n getRatingRange(field: FormFieldConfig<TModel>): number[] {\n const max = (field as RatingFieldConfig<TModel>).max || 5;\n return Array.from({ length: max }, (_, i) => i + 1);\n }\n\n setRating(field: FormFieldConfig<TModel>, value: number): void {\n const control = this.form.get(field.key as string);\n if (control) {\n control.setValue(value);\n control.markAsTouched();\n }\n }\n\n getRatingValue(field: FormFieldConfig<TModel>): number {\n return this.form.get(field.key as string)?.value || 0;\n }\n\n // =========================\n // Feature: Slider Fields\n // =========================\n\n onSliderChange(field: FormFieldConfig<TModel>, event: Event): void {\n const input = event.target as HTMLInputElement;\n const value = parseFloat(input.value);\n const control = this.form.get(field.key as string);\n if (control) {\n control.setValue(value);\n control.markAsTouched();\n }\n }\n\n getSliderValue(field: FormFieldConfig<TModel>): number {\n const f = field as SliderFieldConfig<TModel>;\n return this.form.get(field.key as string)?.value ?? f.min ?? 0;\n }\n\n // =========================\n // Feature: Color Fields\n // =========================\n\n onColorChange(field: FormFieldConfig<TModel>, event: Event): void {\n const input = event.target as HTMLInputElement;\n const control = this.form.get(field.key as string);\n if (control) {\n control.setValue(input.value);\n control.markAsTouched();\n }\n }\n\n setColorFromSwatch(field: FormFieldConfig<TModel>, color: string): void {\n const control = this.form.get(field.key as string);\n if (control) {\n control.setValue(color);\n control.markAsTouched();\n }\n }\n\n getColorValue(field: FormFieldConfig<TModel>): string {\n return this.form.get(field.key as string)?.value || '#000000';\n }\n\n // =========================\n // Value Changes Subscription\n // =========================\n\n private subscribeToValueChanges(): void {\n // Initialize previousFormValue with current form state to avoid false \"changed\" on first emission\n this.previousFormValue = { ...this.form.value };\n\n this.valueChangesSubscription = this.form.valueChanges.subscribe(formValue => {\n // Update conditional visibility\n this.updateVisibility();\n\n // Update group visibility\n this.updateGroupVisibility();\n\n // Run cross-field validators\n this.runFormValidators();\n\n // Reload data sources that depend on changed fields\n this.reloadDependentDataSources(formValue);\n\n // Emit status change\n this.formStatusChange.emit(this.form.status);\n\n // `valueChanges` can fire from outside an Angular event handler (a CVA writing on\n // init, or a caller patching the form), and the callbacks above rewrite visibility,\n // required-state and cross-field errors that the template reads.\n this.cdr.markForCheck();\n });\n }\n\n private previousFormValue: Partial<TModel> = {};\n\n private reloadDependentDataSources(formValue: Partial<TModel>): void {\n this.config.fields.forEach(field => {\n const fieldView = field as FormFieldView<TModel>;\n const dataSource: FieldDataSource | undefined = fieldView.dataSource;\n if (!dataSource?.dependsOn) return;\n\n // Check if any dependency changed\n const changed = dataSource.dependsOn.some(depKey => {\n return formValue[depKey as keyof TModel] !== this.previousFormValue[depKey as keyof TModel];\n });\n\n if (changed) {\n this.loadFieldOptions(field.key as string, dataSource, formValue);\n }\n });\n this.previousFormValue = { ...formValue };\n }\n\n // =========================\n // Feature: File Upload Fields\n // =========================\n\n /**\n * Invokes a FILE field's `onClear` callback when its existing image is removed.\n * FILE fields render {@link MnFileInput}, which owns selection/validation and\n * writes the value (`File | File[] | null`) straight to the form control.\n * @param field The field whose existing image was cleared.\n */\n onFileCleared(field: FormFieldConfig<TModel>): void {\n (field as FileFieldConfig<TModel>).onClear?.();\n }\n\n /** Icon size (px) for the footer action buttons. */\n readonly actionIconSize = MODAL_ACTION_ICON_SIZE;\n\n /** Whether action-button icons should render on this modal (defaults to true). */\n get showActionIcons(): boolean {\n return this.config.showActionIcons !== false;\n }\n\n /** The leading icon for the submit button, or null when icons are disabled. */\n get submitIcon(): LucideIconData | null {\n return this.showActionIcons ? MN_MODAL_ACTION_ICONS.confirm : null;\n }\n\n /** The leading icon for the cancel button, or null when icons are disabled. */\n get cancelIcon(): LucideIconData | null {\n return this.showActionIcons ? MN_MODAL_ACTION_ICONS.cancel : null;\n }\n\n async submit(): Promise<void> {\n // Run cross-field validators before submit\n this.runFormValidators();\n\n if (this.form.invalid || this.isSubmitting || this.hasFormErrors) {\n this.form.markAllAsTouched();\n return;\n }\n\n if (this.config.submitMode === SubmitMode.ONCE) {\n this.isSubmitting = true;\n }\n\n const formValue = this.form.value as TResult;\n\n try {\n if (this.config.onComplete) {\n await this.config.onComplete.handle(formValue);\n }\n this.modalRef.close(formValue);\n } catch (error) {\n // Always allow retry on error, regardless of submit mode. This runs after an `await`,\n // so it must announce itself: otherwise the button stays disabled on \"Submitting...\"\n // and the user can never retry the action that just failed.\n this.isSubmitting = false;\n this.cdr.markForCheck();\n console.error('Form submission error:', error);\n }\n }\n}\n","@if ((config.component || config.template) && !hideCustomBody) {\n <mn-custom-body-host\n [config]=\"asAny(config)\"\n [modalRef]=\"asAny(modalRef)\"\n class=\"mb-6 block\"\n ></mn-custom-body-host>\n}\n\n<form (ngSubmit)=\"submit()\" [formGroup]=\"form\" class=\"flex flex-col gap-6 h-full\">\n <!-- Shared field rendering template (must be inside form for formControlName) -->\n <ng-template #fieldTemplate let-rowField>\n @switch (rowField.field.kind) {\n @case (FieldKind.TEXT) {\n <div>\n <mn-lib-input-field\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n type: 'text',\n label: asField(rowField.field).label,\n placeholder: asField(rowField.field).placeholder,\n mask: asField(rowField.field).mask,\n autocomplete: asField(rowField.field).autocomplete,\n readonly: isFieldReadOnly(rowField.field),\n fullWidth: true\n })\"\n ></mn-lib-input-field>\n </div>\n }\n\n @case (FieldKind.NUMBER) {\n <div>\n <mn-lib-input-field\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n type: 'number',\n label: asField(rowField.field).label,\n placeholder: asField(rowField.field).placeholder,\n readonly: isFieldReadOnly(rowField.field),\n fullWidth: true\n })\"\n ></mn-lib-input-field>\n </div>\n }\n\n @case (FieldKind.PASSWORD) {\n <div>\n <mn-lib-input-field\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n type: 'password',\n label: asField(rowField.field).label,\n placeholder: asField(rowField.field).placeholder,\n readonly: isFieldReadOnly(rowField.field),\n fullWidth: true\n })\"\n ></mn-lib-input-field>\n </div>\n }\n\n @case (FieldKind.SELECT) {\n <div class=\"flex flex-col\">\n <mn-lib-select\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"getSelectProps(rowField.field)\"\n ></mn-lib-select>\n @if (isFieldLoading(asKey(rowField.field.key))) {\n <div class=\"flex items-center gap-1 pl-2 pt-1\">\n <div class=\"w-4 h-4 border-2 border-base-300 border-t-blue-500 rounded-full animate-spin\"></div>\n </div>\n }\n @if (getFieldError(asKey(rowField.field.key))) {\n <div class=\"text-red-500 text-xs pl-2 pt-1\">\n {{ getFieldError(asKey(rowField.field.key)) }}\n </div>\n }\n </div>\n }\n\n @case (FieldKind.CHECKBOX) {\n <div>\n <mn-lib-checkbox\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n label: asField(rowField.field).label,\n disabled: isFieldDisabled(rowField.field) || isFieldReadOnly(rowField.field)\n })\"\n ></mn-lib-checkbox>\n </div>\n }\n\n @case (FieldKind.DATE) {\n <div>\n <mn-lib-input-field\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n type: 'date',\n label: asField(rowField.field).label,\n placeholder: asField(rowField.field).placeholder,\n startDate: asField(rowField.field).minDate,\n endDate: asField(rowField.field).maxDate,\n readonly: isFieldReadOnly(rowField.field),\n fullWidth: true\n })\"\n ></mn-lib-input-field>\n </div>\n }\n\n @case (FieldKind.DATETIME) {\n <div>\n <mn-lib-datetime\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n label: asField(rowField.field).label,\n placeholder: asField(rowField.field).placeholder,\n mode: asField(rowField.field).mode || 'datetime-local',\n min: asField(rowField.field).min,\n max: asField(rowField.field).max,\n step: asField(rowField.field).step,\n readonly: isFieldReadOnly(rowField.field),\n fullWidth: true\n })\"\n ></mn-lib-datetime>\n </div>\n }\n\n @case (FieldKind.TEXTAREA) {\n <div>\n <mn-lib-textarea\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n label: asField(rowField.field).label,\n placeholder: asField(rowField.field).placeholder,\n rows: asField(rowField.field).rows || 4,\n resize: 'vertical',\n autocomplete: asField(rowField.field).autocomplete,\n readonly: isFieldReadOnly(rowField.field)\n })\"\n ></mn-lib-textarea>\n </div>\n }\n\n @case (FieldKind.MULTI_SELECT) {\n <div>\n @if (isFieldLoading(asKey(rowField.field.key))) {\n <div class=\"flex items-center gap-2 py-2 text-sm text-base-content/50\">\n <div class=\"w-4 h-4 border-2 border-base-300 border-t-blue-500 rounded-full animate-spin\"></div>\n {{ labels.loadingOptions }}\n </div>\n }\n @if (!isFieldLoading(asKey(rowField.field.key))) {\n <mn-lib-multi-select\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n label: asField(rowField.field).label,\n options: getFieldOptions(rowField.field),\n placeholder: asField(rowField.field).placeholder,\n searchable: asField(rowField.field).searchable,\n searchPlaceholder: asField(rowField.field).searchPlaceholder,\n maxSelections: asField(rowField.field).maxSelections,\n collapseThreshold: asField(rowField.field).collapseThreshold,\n collapsePlaceholder: asField(rowField.field).collapsePlaceholder,\n allSelectedPlaceholder: asField(rowField.field).allSelectedPlaceholder,\n disabled: isFieldDisabled(rowField.field) || isFieldReadOnly(rowField.field)\n })\"\n ></mn-lib-multi-select>\n }\n @if (getFieldError(asKey(rowField.field.key))) {\n <div class=\"text-red-500 text-xs pl-2 pt-1\">\n {{ getFieldError(asKey(rowField.field.key)) }}\n </div>\n }\n </div>\n }\n\n @case (FieldKind.MULTI_SELECT_TABLE) {\n <ng-container [ngTemplateOutlet]=\"selectTableTemplate\" [ngTemplateOutletContext]=\"{ $implicit: rowField }\"></ng-container>\n }\n\n @case (FieldKind.SINGLE_SELECT_TABLE) {\n <ng-container [ngTemplateOutlet]=\"selectTableTemplate\" [ngTemplateOutletContext]=\"{ $implicit: rowField }\"></ng-container>\n }\n\n @case (FieldKind.COLOR) {\n <div class=\"flex flex-col gap-1\">\n <label [for]=\"'field-' + asKey(rowField.field.key)\"\n class=\"pl-2 pb-1 flex flex-row gap-0.5 text-base font-medium text-base-content\">\n {{ asField(rowField.field).label }}\n @if (hasRequiredValidator(rowField.field)) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n <div class=\"flex items-center gap-3\">\n <input\n type=\"color\"\n [id]=\"'field-' + asKey(rowField.field.key)\"\n class=\"w-10 h-10 rounded-lg border border-base-300 cursor-pointer p-0.5\"\n [value]=\"getColorValue(rowField.field)\"\n [disabled]=\"isFieldReadOnly(rowField.field) || isFieldDisabled(rowField.field)\"\n (input)=\"onColorChange(rowField.field, $event)\"\n />\n <span class=\"text-sm text-base-content/60 font-mono\">{{ getColorValue(rowField.field) }}</span>\n </div>\n @if (asField(rowField.field).swatches) {\n <div class=\"flex gap-1.5 mt-1\">\n @for (swatch of asField(rowField.field).swatches; track swatch) {\n <button\n mnButton\n [data]=\"{ size: 'sm', variant: 'text', color: 'secondary' }\"\n type=\"button\"\n class=\"w-6 h-6 rounded-md border border-base-300 cursor-pointer transition-transform hover:scale-110\"\n [style.background-color]=\"swatch\"\n [class.ring-2]=\"getColorValue(rowField.field) === swatch\"\n [class.ring-blue-500]=\"getColorValue(rowField.field) === swatch\"\n (click)=\"setColorFromSwatch(rowField.field, swatch)\"\n [attr.aria-label]=\"'Select color ' + swatch\"\n ></button>\n }\n </div>\n }\n @if (form.get(asKey(rowField.field.key))?.invalid && form.get(asKey(rowField.field.key))?.touched) {\n <div class=\"text-red-500 text-xs pl-2 pt-1\">\n {{ labels.fieldRequired }}\n </div>\n }\n </div>\n }\n\n @case (FieldKind.RATING) {\n <div class=\"flex flex-col gap-1\">\n <span [id]=\"'rating-label-' + asKey(rowField.field.key)\"\n class=\"pl-2 pb-1 flex flex-row gap-0.5 text-base font-medium text-base-content\">\n {{ asField(rowField.field).label }}\n @if (hasRequiredValidator(rowField.field)) {\n <span class=\"text-red-500\">*</span>\n }\n </span>\n <div [attr.aria-labelledby]=\"'rating-label-' + asKey(rowField.field.key)\" class=\"flex items-center gap-1\"\n role=\"group\">\n @for (star of getRatingRange(rowField.field); track star) {\n <button\n mnButton\n [data]=\"{ size: 'sm', variant: 'text', color: 'secondary' }\"\n type=\"button\"\n class=\"text-2xl cursor-pointer transition-colors focus:outline-none\"\n [class.text-yellow-400]=\"star <= getRatingValue(rowField.field)\"\n [class.text-base-300]=\"star > getRatingValue(rowField.field)\"\n [disabled]=\"isFieldReadOnly(rowField.field) || isFieldDisabled(rowField.field)\"\n (click)=\"setRating(rowField.field, star)\"\n >\n ★\n </button>\n }\n <span class=\"text-sm text-base-content/50 ml-2\">{{ getRatingValue(rowField.field) }} / {{ asField(rowField.field).max || 5 }}</span>\n </div>\n @if (form.get(asKey(rowField.field.key))?.invalid && form.get(asKey(rowField.field.key))?.touched) {\n <div class=\"text-red-500 text-xs pl-2 pt-1\">\n {{ labels.fieldRequired }}\n </div>\n }\n </div>\n }\n\n @case (FieldKind.SLIDER) {\n <div class=\"flex flex-col gap-1\">\n <label [for]=\"'field-' + asKey(rowField.field.key)\"\n class=\"pl-2 pb-1 flex flex-row gap-0.5 text-base font-medium text-base-content\">\n {{ asField(rowField.field).label }}\n @if (hasRequiredValidator(rowField.field)) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n <div class=\"flex items-center gap-3\">\n <input\n type=\"range\"\n [id]=\"'field-' + asKey(rowField.field.key)\"\n class=\"flex-1 h-2 bg-base-200 rounded-lg appearance-none cursor-pointer accent-blue-500\"\n [attr.min]=\"asField(rowField.field).min ?? 0\"\n [attr.max]=\"asField(rowField.field).max ?? 100\"\n [attr.step]=\"asField(rowField.field).step ?? 1\"\n [value]=\"getSliderValue(rowField.field)\"\n [disabled]=\"isFieldReadOnly(rowField.field) || isFieldDisabled(rowField.field)\"\n (input)=\"onSliderChange(rowField.field, $event)\"\n />\n @if (asField(rowField.field).showValue !== false) {\n <span class=\"text-sm text-base-content/60 min-w-[3rem] text-right\">\n {{ getSliderValue(rowField.field) }}{{ asField(rowField.field).unit || '' }}\n </span>\n }\n </div>\n <div class=\"flex justify-between text-xs text-base-content/40 px-1\">\n <span>{{ asField(rowField.field).min ?? 0 }}</span>\n <span>{{ asField(rowField.field).max ?? 100 }}</span>\n </div>\n @if (form.get(asKey(rowField.field.key))?.invalid && form.get(asKey(rowField.field.key))?.touched) {\n <div class=\"text-red-500 text-xs pl-2 pt-1\">\n {{ labels.fieldRequired }}\n </div>\n }\n </div>\n }\n\n @case (FieldKind.FILE) {\n <div>\n <mn-lib-file-input\n (cleared)=\"onFileCleared(rowField.field)\"\n [formControlName]=\"asKey(rowField.field.key)\"\n [props]=\"asAny({\n id: asKey(rowField.field.key),\n label: asField(rowField.field).label,\n accept: asField(rowField.field).accept,\n multiple: asField(rowField.field).multiple,\n maxFiles: asField(rowField.field).maxFiles,\n maxSize: asField(rowField.field).maxSize,\n displayMode: asField(rowField.field).displayMode,\n dropzoneHint: asField(rowField.field).dropzoneHint,\n dropActiveHint: asField(rowField.field).dropActiveHint,\n replaceLabel: asField(rowField.field).replaceLabel,\n removeLabel: asField(rowField.field).removeLabel,\n currentUrl: asField(rowField.field).currentUrl,\n currentUrls: asField(rowField.field).currentUrls,\n disabled: isFieldReadOnly(rowField.field) || isFieldDisabled(rowField.field)\n })\"\n ></mn-lib-file-input>\n </div>\n }\n\n @case (FieldKind.CUSTOM) {\n <div>\n <ng-container\n mnCustomFieldHost\n [component]=\"asField(rowField.field).component\"\n [inputs]=\"asField(rowField.field).inputs\"\n [formControlName]=\"asKey(rowField.field.key)\"\n ></ng-container>\n </div>\n }\n\n @default {\n <div></div>\n }\n }\n\n <!-- Show cross-field error below any field that has one -->\n @if (getFieldError(asKey(rowField.field.key)) && rowField.field.kind !== FieldKind.SELECT && rowField.field.kind !== FieldKind.MULTI_SELECT) {\n <div class=\"text-red-500 text-xs pl-2 pt-1\">\n {{ getFieldError(asKey(rowField.field.key)) }}\n </div>\n }\n </ng-template>\n\n <!-- Shared template for MULTI_SELECT_TABLE and SINGLE_SELECT_TABLE -->\n <ng-template #selectTableTemplate let-rowField>\n <div class=\"flex flex-col gap-1\">\n @if (asField(rowField.field).label) {\n <span class=\"pl-2 pb-1 flex flex-row gap-0.5 text-base font-medium text-base-content\">\n {{ asField(rowField.field).label }}\n @if (hasRequiredValidator(rowField.field)) {\n <span class=\"text-red-500\">*</span>\n }\n </span>\n }\n <mn-table\n [dataSource]=\"tableDataSources[asKey(rowField.field.key)]\"\n [attr.aria-label]=\"asField(rowField.field).label || null\"\n (selectionChange)=\"onTableSelectionChange(rowField.field, $event)\"\n ></mn-table>\n @if (form.get(asKey(rowField.field.key))?.invalid && form.get(asKey(rowField.field.key))?.touched) {\n <div class=\"text-red-500 text-xs pl-2 pt-1\">\n {{ labels.fieldRequired }}\n </div>\n }\n </div>\n </ng-template>\n\n <!-- Field Groups (sections with headers) -->\n @if (fieldGroups.length > 0) {\n <div class=\"flex flex-col gap-6\">\n @for (group of fieldGroups; track group.title) {\n <div class=\"flex flex-col gap-4\" [style.display]=\"isGroupVisible(group) ? '' : 'none'\">\n <div class=\"border-b border-base-300 pb-2\">\n <h3 class=\"text-base font-semibold text-base-content\">{{ group.title }}</h3>\n @if (group.description) {\n <p class=\"text-sm text-base-content/50 mt-0.5\">{{ group.description }}</p>\n }\n </div>\n @for (row of group.rows; track $index) {\n <div [style.--mn-form-cols]=\"row.columns || 1\" class=\"grid gap-4 mn-form-row\">\n @for (rowField of row.fields; track rowField.field.key) {\n <div [style.--mn-form-span]=\"rowField.span || 1\" [style.display]=\"isFieldVisible(rowField.field) ? '' : 'none'\"\n class=\"flex flex-col gap-2 mn-form-cell\">\n <ng-container [ngTemplateOutlet]=\"fieldTemplate\" [ngTemplateOutletContext]=\"{ $implicit: rowField }\"></ng-container>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n <!-- Standard rows (no groups) -->\n @if (rows.length > 0) {\n <div class=\"flex flex-col gap-4\">\n @for (row of rows; track $index) {\n <div [style.--mn-form-cols]=\"row.columns || 1\" class=\"grid gap-4 mn-form-row\">\n @for (rowField of row.fields; track rowField.field.key) {\n <div [style.--mn-form-span]=\"rowField.span || 1\" [style.display]=\"isFieldVisible(rowField.field) ? '' : 'none'\"\n class=\"flex flex-col gap-2 mn-form-cell\">\n <ng-container [ngTemplateOutlet]=\"fieldTemplate\" [ngTemplateOutletContext]=\"{ $implicit: rowField }\"></ng-container>\n </div>\n }\n </div>\n }\n </div>\n }\n\n <!-- Form-level errors (not tied to a specific field) -->\n @if (formErrors['_form']) {\n <div class=\"text-red-500 text-sm px-2 py-1 bg-red-50 rounded-md\">\n {{ formErrors['_form'] }}\n </div>\n }\n\n @if (!hideFooter) {\n <div class=\"flex gap-3 pt-4 pb-6 border-t border-base-300 mt-auto sticky bottom-0 bg-base-100 z-10\">\n <button\n mnButton\n type=\"button\"\n [data]=\"{ variant: 'outline', color: 'secondary' }\"\n (mousedown)=\"modalRef.dismiss(ModalCloseReason.CANCELLED)\"\n >\n @if (cancelIcon; as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ labels.cancel }}\n </button>\n\n <div class=\"flex-1\"></div>\n\n <button\n mnButton\n type=\"submit\"\n [data]=\"{ variant: 'fill', color: 'primary', disabled: form.invalid || isSubmitting }\"\n [disabled]=\"form.invalid || isSubmitting\"\n >\n @if (submitIcon; as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ isSubmitting ? labels.submitting : labels.submit }}\n </button>\n </div>\n }\n</form>\n","import {Component, EventEmitter, Input, Output} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {LucideDynamicIcon, LucideIconData} from '@lucide/angular';\nimport {MnButton, MnButtonTypes} from '../../../mn-button';\nimport {ActionStyle, ModalFooterAction} from '../../mn-modal.types';\nimport {defaultIconForStyle, MODAL_ACTION_ICON_SIZE} from '../../mn-modal-action-icons';\n\n@Component({\n selector: 'mn-footer-actions',\n standalone: true,\n imports: [CommonModule, MnButton, LucideDynamicIcon],\n host: { class: 'contents' },\n template: `\n @for (action of leftActions; track action.label) {\n <button\n mnButton\n [data]=\"getButtonData(action)\"\n [disabled]=\"action.disabled || false\"\n (click)=\"actionClick.emit(action)\"\n >\n @if (iconFor(action); as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ action.label }}\n </button>\n }\n\n <div class=\"flex-1\"></div>\n\n @for (action of rightActions; track action.label) {\n <button\n mnButton\n [data]=\"getButtonData(action)\"\n [disabled]=\"action.disabled || false\"\n (click)=\"actionClick.emit(action)\"\n >\n @if (iconFor(action); as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ action.label }}\n </button>\n }\n `,\n})\nexport class MnFooterActionsComponent<TResult = unknown> {\n @Input() actions: ModalFooterAction<TResult>[] = [];\n /** Whether to render leading icons on the action buttons (defaults to true). */\n @Input() showIcons = true;\n @Output() actionClick = new EventEmitter<ModalFooterAction<TResult>>();\n\n /** Icon size (px) for the footer action buttons. */\n readonly actionIconSize = MODAL_ACTION_ICON_SIZE;\n\n /**\n * Resolves the leading icon for a footer action, or null when icons are disabled.\n * Uses the per-action override, else the default derived from its style.\n * @param action The footer action to resolve an icon for.\n */\n iconFor(action: ModalFooterAction<TResult>): LucideIconData | null {\n if (!this.showIcons) return null;\n return action.icon ?? defaultIconForStyle(action.style);\n }\n\n get leftActions(): ModalFooterAction<TResult>[] {\n return this.actions.filter(a => a.position === 'left');\n }\n\n get rightActions(): ModalFooterAction<TResult>[] {\n return this.actions.filter(a => a.position !== 'left');\n }\n\n getButtonData(action: ModalFooterAction<TResult>): Partial<MnButtonTypes> {\n switch (action.style) {\n case ActionStyle.PRIMARY:\n return { variant: 'fill', color: 'primary', disabled: action.disabled };\n case ActionStyle.DANGER:\n return { variant: 'fill', color: 'danger', disabled: action.disabled };\n case ActionStyle.GHOST:\n return {variant: 'text', color: 'gray', disabled: action.disabled};\n case ActionStyle.SECONDARY:\n default:\n return { variant: 'outline', color: 'secondary', disabled: action.disabled };\n }\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n Input,\n OnDestroy,\n OnInit,\n QueryList,\n signal,\n TemplateRef,\n Type,\n ViewChild,\n ViewChildren,\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ReactiveFormsModule} from '@angular/forms';\nimport {Subscription} from 'rxjs';\nimport {MnModalRef} from '../../mn-modal-ref';\nimport {\n ActionStyle,\n CustomModalConfig,\n FormModalConfig,\n ModalCloseReason,\n ModalFooterAction,\n ModalKind,\n ModalRef,\n ModalSize,\n ModalStepId,\n NavigationDirection,\n WizardFlowMode,\n WizardModalConfig,\n WizardResult,\n WizardStepConfig,\n} from '../../mn-modal.types';\nimport {MnButton, MnButtonTypes} from '../../../mn-button';\nimport {MnFormBodyComponent} from '../mn-form-body/mn-form-body.component';\nimport {MnCustomBodyHostComponent} from '../mn-custom-body-host/mn-custom-body-host.component';\nimport {MnFooterActionsComponent} from '../mn-footer-actions/mn-footer-actions.component';\nimport {MnLanguageService} from '../../../../language';\nimport {LucideDynamicIcon, LucideIconData} from '@lucide/angular';\nimport {MN_MODAL_ACTION_ICONS, MODAL_ACTION_ICON_SIZE} from '../../mn-modal-action-icons';\n\n@Component({\n selector: 'mn-wizard-body',\n standalone: true,\n imports: [CommonModule, ReactiveFormsModule, MnButton, MnFormBodyComponent, MnCustomBodyHostComponent, MnFooterActionsComponent, LucideDynamicIcon],\n templateUrl: './mn-wizard-body.component.html',\n styleUrls: ['./mn-wizard-body.component.css'],\n})\nexport class MnWizardBodyComponent implements OnInit, AfterViewInit, OnDestroy {\n private cdr = inject(ChangeDetectorRef);\n\n @Input() config!: WizardModalConfig;\n @Input() modalRef!: MnModalRef<WizardResult>;\n\n @ViewChildren(MnFormBodyComponent) formBodies!: QueryList<MnFormBodyComponent>;\n @ViewChildren('stepWrapper') stepWrappers!: QueryList<ElementRef<HTMLElement>>;\n /**\n * The step body's scroll container. Every step renders into this one element\n * (inactive steps are hidden, not destroyed), so its scroll offset is shared —\n * without an explicit reset, arriving on a new step lands you wherever the\n * previous step was scrolled to. See {@link setCurrentStep}.\n */\n @ViewChild('stepScroller') stepScroller?: ElementRef<HTMLElement>;\n\n currentStepId!: ModalStepId;\n /**\n * Title of the currently active step, mirrored into a signal so the modal\n * shell can append it to the modal title on small screens (where the step\n * labels under the progress circles are hidden). A signal — not a getter —\n * because the shell lives outside this component's change-detection subtree,\n * so a plain field mutation here would not update the shell in a zoneless app.\n */\n readonly currentStepTitle = signal<string | undefined>(undefined);\n visitedStepIds: ModalStepId[] = [];\n isCurrentStepValid = true;\n isCompleting = false;\n wizardErrors: Record<string, string> = {};\n\n /**\n * Min-height (px) for the step container, sized to the tallest step so the\n * modal does not jump when navigating between steps. Monotonic — only grows.\n */\n measuredMinHeight = 0;\n\n private languageService = inject(MnLanguageService);\n\n private static readonly DEFAULT_LABELS: Record<string, string> = {\n next: 'Next',\n back: 'Back',\n close: 'Close',\n complete: 'Complete',\n completing: 'Completing...',\n };\n\n private resolveLabel(i18nValue: string | undefined, key: string): string {\n if (i18nValue) return i18nValue;\n const translated = this.languageService.translate(`common.${key}`);\n return translated === `common.${key}` ? MnWizardBodyComponent.DEFAULT_LABELS[key] : translated;\n }\n\n /** Resolved i18n labels with defaults, falling back to translated keys */\n get labels() {\n const i18n = (this.config as { i18n?: Record<string, string> }).i18n || {};\n return {\n next: this.resolveLabel(i18n['next'], 'next'),\n back: this.resolveLabel(i18n['back'], 'back'),\n close: this.resolveLabel(i18n['close'], 'close'),\n complete: this.resolveLabel(i18n['complete'], 'complete'),\n completing: this.resolveLabel(i18n['completing'], 'completing'),\n };\n }\n\n /** Pre-built form configs keyed by step id — only for steps that have fields */\n stepFormConfigs: Record<ModalStepId, FormModalConfig<unknown, unknown>> = {};\n\n /**\n * Pre-built host configs keyed by step id — only for steps whose body is a\n * component or template (not a plain string) and that have no form fields.\n * Drives the `mn-custom-body-host` rendered for those steps.\n */\n stepBodyConfigs: Record<ModalStepId, CustomModalConfig> = {};\n\n private statusSubscription?: Subscription;\n private formBodiesSubscription?: Subscription;\n\n ngOnInit(): void {\n // Pre-build form configs for all form-driven steps\n for (const step of this.config.steps) {\n if (step.fields && step.fields.length > 0) {\n // Merge top-level initialValue with step-level initialValue\n const mergedInitialValue = {\n ...(this.config.initialValue || {}),\n ...(step.initialValue || {})\n };\n\n this.stepFormConfigs[step.id] = {\n kind: ModalKind.FORM,\n fields: step.fields,\n rows: step.rows,\n fieldGroups: step.fieldGroups,\n formValidators: step.formValidators,\n groupValidators: step.groupValidators,\n initialValue: mergedInitialValue,\n readOnly: this.config.readOnly,\n disabled: this.config.disabled\n } as FormModalConfig<unknown, unknown>;\n } else {\n // A component/template body (not a plain string) renders through the\n // custom-body host. Pre-build its config once so the `@Input` identity\n // stays stable across change detection and the body is not re-created.\n const bodyConfig = this.buildStepBodyConfig(step);\n if (bodyConfig) {\n this.stepBodyConfigs[step.id] = bodyConfig;\n }\n }\n }\n\n this.setCurrentStep(this.config.startStepId || this.config.steps[0]?.id);\n if (this.currentStepId) {\n this.visitedStepIds.push(this.currentStepId);\n }\n }\n\n ngAfterViewInit(): void {\n // Subscribe to form bodies list changes to track validity\n this.formBodiesSubscription = this.formBodies.changes.subscribe(() => {\n this.trackCurrentStepValidity();\n // Apply autofocus when form bodies change (e.g. step navigation)\n setTimeout(() => {\n this.getCurrentFormBody()?.applyAutoFocus();\n }, 100);\n // Re-measure in case dynamic field visibility changed a step's height\n this.measureTallestStep();\n });\n // Initial validity check\n this.trackCurrentStepValidity();\n\n // Pre-size the modal to the tallest step so it does not jump between steps.\n // All steps are already rendered (display:none), so this is a pure layout\n // read — it creates no components and triggers no data loads or autofocus.\n setTimeout(() => this.measureTallestStep(), 0);\n // A second pass catches content that grows after async data sources resolve.\n setTimeout(() => this.measureTallestStep(), 300);\n }\n\n isTextBody(step: WizardStepConfig): boolean {\n return typeof step.body === 'string';\n }\n\n /**\n * Builds the {@link CustomModalConfig} used to render a step whose body is a\n * component or template. Returns `undefined` for steps with no body or a\n * plain-string body (those render through their own template branches).\n * @param step The wizard step to inspect.\n */\n private buildStepBodyConfig(step: WizardStepConfig): CustomModalConfig | undefined {\n const body = step.body;\n if (!body || typeof body === 'string') return undefined;\n const config: CustomModalConfig = {kind: ModalKind.CUSTOM, inputs: step.bodyInputs};\n if (body instanceof TemplateRef) {\n config.template = body;\n } else {\n config.component = body as Type<unknown>;\n }\n return config;\n }\n\n async goToStep(step: WizardStepConfig): Promise<void> {\n if (!this.canNavigateToStep(step)) return;\n if (step.id === this.currentStepId) return;\n\n // Validate current step's form before allowing direct step navigation\n const formBody = this.getCurrentFormBody();\n if (formBody && formBody.form.invalid) {\n formBody.form.markAllAsTouched();\n return;\n }\n\n const previousStepId = this.currentStepId;\n this.setCurrentStep(step.id);\n\n if (!this.visitedStepIds.includes(this.currentStepId)) {\n this.visitedStepIds.push(this.currentStepId);\n }\n\n await this.notifyStepChange(previousStepId, NavigationDirection.DIRECT);\n this.trackCurrentStepValidity();\n }\n\n ngOnDestroy(): void {\n this.statusSubscription?.unsubscribe();\n this.formBodiesSubscription?.unsubscribe();\n }\n\n /**\n * Measures every step's natural height and records the tallest as\n * {@link measuredMinHeight}. Monotonic: the value only ever grows, so a\n * re-measure can never shrink the modal. Skipped when the modal has an\n * explicit height or is full-size (those are already fixed-height).\n */\n private measureTallestStep(): void {\n if (this.config.sizeHeight || this.config.sizeWidth === ModalSize.FULL) return;\n const wrappers = this.stepWrappers?.toArray().map(ref => ref.nativeElement) ?? [];\n if (wrappers.length === 0) return;\n\n // Synchronous pre-paint pass: show one step at a time, read its height,\n // then restore the original display values (so there is no visible flicker).\n const originalDisplay = wrappers.map(el => el.style.display);\n let tallest = 0;\n for (let i = 0; i < wrappers.length; i++) {\n for (let j = 0; j < wrappers.length; j++) {\n wrappers[j].style.display = i === j ? 'block' : 'none';\n }\n tallest = Math.max(tallest, wrappers[i].offsetHeight);\n }\n wrappers.forEach((el, i) => (el.style.display = originalDisplay[i]));\n\n if (tallest > this.measuredMinHeight) {\n this.measuredMinHeight = tallest;\n this.cdr.detectChanges();\n }\n }\n\n /** Get visible steps (filtered by visibility condition) */\n get visibleSteps(): WizardStepConfig[] {\n return this.config.steps.filter(s => this.isStepVisible(s));\n }\n\n isStepVisible(step: WizardStepConfig): boolean {\n if (!step.visible) return true;\n return step.visible(this.getAggregatedData());\n }\n\n get currentStep() {\n return this.config.steps.find(s => s.id === this.currentStepId);\n }\n\n get currentVisibleIndex(): number {\n return this.visibleSteps.findIndex(s => s.id === this.currentStepId);\n }\n\n get currentStepIndex(): number {\n return this.config.steps.findIndex(s => s.id === this.currentStepId);\n }\n\n get canGoBack(): boolean {\n return this.currentVisibleIndex > 0;\n }\n\n get canGoNext(): boolean {\n return this.currentVisibleIndex < this.visibleSteps.length - 1;\n }\n\n get isLastStep(): boolean {\n return this.currentVisibleIndex === this.visibleSteps.length - 1;\n }\n\n /** Icon size (px) for the wizard action buttons. */\n readonly actionIconSize = MODAL_ACTION_ICON_SIZE;\n\n /** Whether action-button icons should render on this wizard (defaults to true). */\n get showActionIcons(): boolean {\n return this.config.showActionIcons !== false;\n }\n\n /**\n * The leading icon for the back button, or null when icons are disabled.\n * Shows a back arrow when navigation is possible, otherwise a cross (the\n * button acts as \"Close\" on the first step).\n */\n get backIcon(): LucideIconData | null {\n if (!this.showActionIcons) return null;\n return this.canGoBack ? MN_MODAL_ACTION_ICONS.back : MN_MODAL_ACTION_ICONS.cancel;\n }\n\n /** The trailing icon for the next button, or null when icons are disabled. */\n get nextIcon(): LucideIconData | null {\n return this.showActionIcons ? MN_MODAL_ACTION_ICONS.next : null;\n }\n\n /** The leading icon for the complete button, or null when icons are disabled. */\n get completeIcon(): LucideIconData | null {\n return this.showActionIcons ? MN_MODAL_ACTION_ICONS.confirm : null;\n }\n\n /** Index of the current step for the progress line */\n get currentProgressIndex(): number {\n return this.currentVisibleIndex;\n }\n\n get isFreeFlow(): boolean {\n return this.config.flow === WizardFlowMode.FREE;\n }\n\n canNavigateToStep(step: WizardStepConfig): boolean {\n if (!this.isFreeFlow) return false;\n return this.isStepVisible(step);\n }\n\n async next(): Promise<void> {\n if (!this.canGoNext) return;\n\n const currentStep = this.currentStep;\n\n // Validate embedded form if present\n const formBody = this.getCurrentFormBody();\n if (formBody && formBody.form.invalid) {\n formBody.form.markAllAsTouched();\n return;\n }\n\n if (currentStep?.guard?.canExit) {\n const canExit = await currentStep.guard.canExit();\n if (!canExit) return;\n }\n\n if (currentStep?.validators) {\n for (const validator of currentStep.validators) {\n const result = await validator.validate();\n if (result.status === 'invalid') return;\n }\n }\n\n // Find next visible step\n const nextStep = this.visibleSteps[this.currentVisibleIndex + 1];\n if (!nextStep) return;\n\n if (nextStep.guard?.canEnter) {\n const canEnter = await nextStep.guard.canEnter();\n if (!canEnter) return;\n }\n\n const previousStepId = this.currentStepId;\n this.setCurrentStep(nextStep.id);\n\n if (!this.visitedStepIds.includes(this.currentStepId)) {\n this.visitedStepIds.push(this.currentStepId);\n }\n\n await this.notifyStepChange(previousStepId, NavigationDirection.FORWARD);\n this.trackCurrentStepValidity();\n }\n\n /** Find the MnFormBodyComponent for the current step */\n private getCurrentFormBody(): MnFormBodyComponent | undefined {\n if (!this.formBodies) return undefined;\n // formBodies only contains entries for steps that have stepFormConfigs\n // We need to find which form body index corresponds to the current step\n const formStepIds = this.config.steps\n .filter(s => this.stepFormConfigs[s.id])\n .map(s => s.id);\n const formIndex = formStepIds.indexOf(this.currentStepId);\n if (formIndex === -1) return undefined;\n return this.formBodies.toArray()[formIndex];\n }\n\n private trackCurrentStepValidity(): void {\n // Unsubscribe from previous\n this.statusSubscription?.unsubscribe();\n this.statusSubscription = undefined;\n\n const formBody = this.getCurrentFormBody();\n if (formBody && formBody.form) {\n this.isCurrentStepValid = formBody.form.valid;\n this.statusSubscription = formBody.form.statusChanges.subscribe(() => {\n this.isCurrentStepValid = formBody.form.valid;\n this.cdr.detectChanges();\n });\n } else {\n this.isCurrentStepValid = true;\n }\n this.cdr.detectChanges();\n }\n\n async back(): Promise<void> {\n if (!this.canGoBack) {\n // Call onCancel handler if configured\n if (this.config.onCancel) {\n await this.config.onCancel(ModalCloseReason.CANCELLED);\n }\n this.modalRef.dismiss(ModalCloseReason.CANCELLED);\n return;\n }\n\n const prevStep = this.visibleSteps[this.currentVisibleIndex - 1];\n const previousStepId = this.currentStepId;\n\n // Remove current step from visited so the circle resets\n this.visitedStepIds = this.visitedStepIds.filter(id => id !== this.currentStepId);\n\n this.setCurrentStep(prevStep.id);\n\n await this.notifyStepChange(previousStepId, NavigationDirection.BACKWARD);\n this.trackCurrentStepValidity();\n }\n\n /**\n * Activates a step and mirrors its title into {@link currentStepTitle} so the\n * shell can reflect the step name in the modal title on small screens.\n * @param stepId Id of the step to make current.\n */\n private setCurrentStep(stepId: ModalStepId): void {\n this.currentStepId = stepId;\n this.currentStepTitle.set(this.config.steps.find(s => s.id === stepId)?.title);\n // A new step always starts at its top — the shared scroller would otherwise\n // keep the previous step's offset. Instant, not smooth: a scroll animation\n // during a step swap reads as a glitch. Absent before the view is created.\n if (this.stepScroller) {\n this.stepScroller.nativeElement.scrollTop = 0;\n }\n }\n\n async complete(): Promise<void> {\n if (this.isCompleting) return;\n\n const currentStep = this.currentStep;\n\n // Validate embedded form if present\n const formBody = this.getCurrentFormBody();\n if (formBody && formBody.form.invalid) {\n formBody.form.markAllAsTouched();\n return;\n }\n\n if (currentStep?.validators) {\n for (const validator of currentStep.validators) {\n const result = await validator.validate();\n if (result.status === 'invalid') return;\n }\n }\n\n this.isCompleting = true;\n this.wizardErrors = {};\n this.cdr.detectChanges();\n\n try {\n const aggregatedData = this.getAggregatedData();\n\n // Run cross-step validators (onBeforeComplete)\n if (this.config.onBeforeComplete) {\n for (const validator of this.config.onBeforeComplete) {\n const errors = await validator(aggregatedData);\n if (errors) {\n this.wizardErrors = { ...this.wizardErrors, ...errors };\n }\n }\n if (Object.keys(this.wizardErrors).length > 0) {\n this.isCompleting = false;\n this.cdr.detectChanges();\n return;\n }\n }\n\n const result: WizardResult = {\n status: ModalCloseReason.COMPLETED,\n visitedStepIds: this.visitedStepIds,\n payload: aggregatedData,\n };\n\n if (this.config.onComplete) {\n await this.config.onComplete.handle(result);\n }\n\n this.modalRef.close(result);\n } catch (error) {\n this.isCompleting = false;\n this.cdr.detectChanges();\n console.error('Wizard completion error:', error);\n }\n }\n\n /** Collect form data from all form-driven steps, namespaced by step ID */\n private getAggregatedData(): Record<ModalStepId, Record<string, unknown>> {\n const aggregated: Record<ModalStepId, Record<string, unknown>> = {};\n if (!this.formBodies) return aggregated;\n\n const formStepIds = this.config.steps\n .filter(s => this.stepFormConfigs[s.id])\n .map(s => s.id);\n\n this.formBodies.toArray().forEach((fb, index) => {\n if (fb.form && formStepIds[index]) {\n aggregated[formStepIds[index]] = { ...fb.form.value };\n }\n });\n\n return aggregated;\n }\n\n /**\n * Maps a footer action's ActionStyle to mnButton data props.\n * @param action The footer action configuration.\n */\n getFooterActionButtonData(action: ModalFooterAction<unknown>): Partial<MnButtonTypes> {\n switch (action.style) {\n case ActionStyle.DANGER:\n return { variant: 'outline', color: 'danger' };\n case ActionStyle.PRIMARY:\n return { variant: 'fill', color: 'primary' };\n case ActionStyle.SECONDARY:\n return { variant: 'outline', color: 'secondary' };\n case ActionStyle.GHOST:\n return {variant: 'text', color: 'gray'};\n default:\n return { variant: 'outline', color: 'secondary' };\n }\n }\n\n /**\n * Handles a custom footer action click.\n * @param action The footer action configuration.\n */\n async handleFooterAction(action: ModalFooterAction<unknown>): Promise<void> {\n if (action.handler) {\n await action.handler(this.modalRef as unknown as ModalRef<unknown>);\n }\n if (action.closesModal) {\n this.modalRef.close((action.closeReason || ModalCloseReason.PROGRAMMATIC) as unknown as WizardResult);\n }\n }\n\n private async notifyStepChange(previousStepId: ModalStepId, direction: NavigationDirection): Promise<void> {\n if (this.config.onStepChange) {\n await this.config.onStepChange.handle({\n previousStepId,\n currentStepId: this.currentStepId,\n direction,\n });\n }\n }\n}\n","<div class=\"flex flex-col flex-auto min-h-0\">\n @if (config.component || config.template) {\n <mn-custom-body-host\n [config]=\"$any(config)\"\n [modalRef]=\"$any(modalRef)\"\n class=\"block flex-none px-6 pt-6\"\n ></mn-custom-body-host>\n }\n\n <!-- Steps header — fixed (does not scroll with the step body) -->\n <div class=\"flex-none px-6 pt-2 pb-4 border-b border-base-300 bg-base-100\">\n <div class=\"relative flex items-start\">\n <!-- Background line spanning from first circle center to last circle center -->\n <div\n [style.left]=\"'calc(' + 100 / (2 * visibleSteps.length) + '%)'\"\n [style.right]=\"'calc(' + 100 / (2 * visibleSteps.length) + '%)'\"\n class=\"absolute top-3.75 h-1 bg-base-300 z-0\"\n ></div>\n\n <!-- Progress fill line -->\n @if (visibleSteps.length > 1) {\n <div\n [style.left]=\"'calc(' + 100 / (2 * visibleSteps.length) + '%)'\"\n [style.width]=\"'calc(' + (currentProgressIndex / (visibleSteps.length - 1)) * (100 - 100 / visibleSteps.length) + '%)'\"\n class=\"absolute top-3.75 h-1 bg-success z-1 transition-all duration-500\"\n ></div>\n }\n\n @for (step of visibleSteps; track step.id; let i = $index; ) {\n <div\n (keyup.enter)=\"isFreeFlow ? goToStep(step) : null\"\n (click)=\"isFreeFlow ? goToStep(step) : null\"\n [attr.tabindex]=\"isFreeFlow && canNavigateToStep(step) ? 0 : null\"\n [class.cursor-pointer]=\"isFreeFlow && canNavigateToStep(step)\"\n class=\"relative flex flex-col items-center gap-1 z-10 w-0 flex-1\"\n >\n <div\n [ngClass]=\"{\n 'bg-primary text-primary-content': step.id === currentStepId,\n 'bg-success text-success-content': visitedStepIds.includes(step.id) && step.id !== currentStepId,\n 'bg-base-200 text-base-content/50': !visitedStepIds.includes(step.id) && step.id !== currentStepId\n }\"\n class=\"w-8 h-8 rounded-full flex items-center justify-center font-semibold transition-all text-sm\"\n >{{ i + 1 }}\n </div>\n <div\n [ngClass]=\"{\n 'text-base-content font-semibold': step.id === currentStepId,\n 'text-base-content/50': step.id !== currentStepId\n }\"\n class=\"text-xs text-center whitespace-nowrap hidden sm:block\"\n >{{ step.title }}\n </div>\n\n </div>\n }\n </div>\n </div>\n\n <!-- Step body — the only scrolling region in the wizard, shared by every step -->\n <div #stepScroller class=\"flex-auto min-h-0 overflow-y-auto px-6 py-6\">\n <div [style.min-height]=\"measuredMinHeight ? measuredMinHeight + 'px' : null\" class=\"min-h-48\">\n @for (step of config.steps; track step.id) {\n <div #stepWrapper [style.display]=\"step.id === currentStepId ? 'block' : 'none'\">\n <h3 class=\"text-lg font-semibold text-base-content mb-4\">{{ step.title }}</h3>\n <div class=\"text-base-content/80\">\n <!-- Form step -->\n @if (stepFormConfigs[step.id]) {\n <mn-form-body\n [config]=\"stepFormConfigs[step.id]\"\n [modalRef]=\"$any(modalRef)\"\n [hideFooter]=\"true\"\n [hideCustomBody]=\"true\"\n ></mn-form-body>\n }\n\n <!-- Text body -->\n @if (!stepFormConfigs[step.id] && isTextBody(step)) {\n <div>\n {{ step.body }}\n </div>\n }\n\n <!-- Component / template body -->\n @if (stepBodyConfigs[step.id]) {\n <mn-custom-body-host\n [config]=\"stepBodyConfigs[step.id]\"\n [modalRef]=\"$any(modalRef)\"\n ></mn-custom-body-host>\n }\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Wizard-level errors (from onBeforeComplete) — fixed, above the footer -->\n @if (wizardErrors && (wizardErrors | keyvalue).length > 0) {\n <div class=\"flex flex-col gap-1 mx-6 mb-2 px-2 py-2 bg-red-50 rounded-md\">\n @for (err of wizardErrors | keyvalue; track err.key) {\n <div class=\"text-red-500 text-sm\">\n {{ err.value }}\n </div>\n }\n </div>\n }\n\n <!-- Footer — fixed (does not scroll with the step body) -->\n <div class=\"flex-none flex gap-3 px-6 pt-4 pb-6 border-t border-base-300 bg-base-100\">\n @if (!currentStep?.hideBack) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'outline', color: 'secondary' }\"\n (click)=\"back()\"\n >\n @if (backIcon; as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ currentStep?.backLabel || (canGoBack ? labels.back : labels.close) }}\n </button>\n }\n\n <!-- Custom footer actions -->\n @if (config.footerActions) {\n <mn-footer-actions\n [actions]=\"config.footerActions\"\n [showIcons]=\"showActionIcons\"\n (actionClick)=\"handleFooterAction($any($event))\"\n ></mn-footer-actions>\n } @else {\n <div class=\"flex-1\"></div>\n }\n\n @if (!isLastStep) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'fill', color: 'primary', disabled: !isCurrentStepValid }\"\n (click)=\"next()\"\n >\n {{ currentStep?.nextLabel || labels.next }}\n @if (nextIcon; as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"ml-2\"></svg>\n }\n </button>\n }\n\n @if (isLastStep) {\n <button\n type=\"button\"\n mnButton\n [data]=\"{ variant: 'fill', color: 'primary', disabled: !isCurrentStepValid || isCompleting }\"\n [disabled]=\"!isCurrentStepValid || isCompleting\"\n (click)=\"complete()\"\n >\n @if (completeIcon; as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ currentStep?.nextLabel || (isCompleting ? labels.completing : labels.complete) }}\n </button>\n }\n </div>\n</div>\n","import {ChangeDetectorRef, Component, inject, Input, OnInit, ViewChild} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {ReactiveFormsModule} from '@angular/forms';\nimport {MnModalRef} from '../../mn-modal-ref';\nimport {ActionStyle, ConfirmationModalConfig, ConfirmationTone, ModalCloseReason,} from '../../mn-modal.types';\nimport {MnButton} from '../../../mn-button';\nimport {MnFormBodyComponent} from '../mn-form-body/mn-form-body.component';\nimport {MnCustomBodyHostComponent} from '../mn-custom-body-host/mn-custom-body-host.component';\nimport {MnLanguageService} from '../../../../language';\nimport {LucideCircleAlert, LucideDynamicIcon, LucideIconData, LucideTriangleAlert} from '@lucide/angular';\nimport {MN_MODAL_ACTION_ICONS, MODAL_ACTION_ICON_SIZE} from '../../mn-modal-action-icons';\n\n@Component({\n selector: 'mn-confirmation-body',\n standalone: true,\n imports: [CommonModule, MnButton, MnFormBodyComponent, MnCustomBodyHostComponent, ReactiveFormsModule, LucideDynamicIcon, LucideTriangleAlert, LucideCircleAlert],\n templateUrl: './mn-confirmation-body.component.html',\n styleUrls: ['./mn-confirmation-body.component.css'],\n})\nexport class MnConfirmationBodyComponent<TResult = boolean> implements OnInit {\n private cdr = inject(ChangeDetectorRef);\n\n @Input() config!: ConfirmationModalConfig<TResult>;\n @Input() modalRef!: MnModalRef<TResult>;\n\n @ViewChild(MnFormBodyComponent) formBody?: MnFormBodyComponent;\n\n confirmButtonStatus = 'VALID';\n hasFormFields = false;\n\n private languageService = inject(MnLanguageService);\n\n ngOnInit(): void {\n this.hasFormFields = !!(\n (this.config.fields && this.config.fields.length > 0) ||\n (this.config.fieldGroups && this.config.fieldGroups.length > 0) ||\n (this.config.rows && this.config.rows.length > 0)\n );\n }\n\n onFormStatusChange(status: string): void {\n this.confirmButtonStatus = status;\n this.cdr.markForCheck();\n this.cdr.detectChanges();\n }\n\n async confirm(): Promise<void> {\n if (this.hasFormFields && this.formBody?.form.invalid) {\n this.formBody.form.markAllAsTouched();\n return;\n }\n\n const result = (this.hasFormFields ? this.formBody?.form.value : true) as TResult;\n\n if (this.config.confirm?.handler) {\n await this.config.confirm.handler.handle(result);\n }\n\n this.modalRef.close(result);\n }\n\n cancel(): void {\n const reason = this.config.cancel?.reason || ModalCloseReason.CANCELLED;\n this.modalRef.dismiss(reason);\n }\n\n private resolveLabel(value: string | undefined, key: string, fallback: string): string {\n if (value) return value;\n const translated = this.languageService.translate(`common.${key}`);\n return translated === `common.${key}` ? fallback : translated;\n }\n\n get confirmLabel(): string {\n return this.resolveLabel(this.config.confirm?.label, 'confirm', 'Confirm');\n }\n\n get cancelLabel(): string {\n return this.resolveLabel(this.config.cancel?.label, 'cancel', 'Cancel');\n }\n\n get confirmStyle(): ActionStyle {\n return this.config.confirm?.style || ActionStyle.PRIMARY;\n }\n\n get cancelStyle(): ActionStyle {\n return this.config.cancel?.style || ActionStyle.SECONDARY;\n }\n\n get toneClass(): string {\n switch (this.config.tone) {\n case ConfirmationTone.WARNING:\n return 'tone-warning';\n case ConfirmationTone.DANGER:\n return 'tone-danger';\n default:\n return 'tone-default';\n }\n }\n\n getButtonColor(style: ActionStyle): 'primary' | 'secondary' | 'danger' | 'warning' | 'success' {\n switch (style) {\n case ActionStyle.PRIMARY:\n return 'primary';\n case ActionStyle.DANGER:\n return 'danger';\n case ActionStyle.GHOST:\n return 'secondary';\n default:\n return 'secondary';\n }\n }\n\n getButtonVariant(style: ActionStyle): 'fill' | 'outline' | 'text' {\n switch (style) {\n case ActionStyle.PRIMARY:\n case ActionStyle.DANGER:\n return 'fill';\n case ActionStyle.GHOST:\n return 'text';\n default:\n return 'outline';\n }\n }\n get isConfirmDisabled(): boolean {\n if (this.hasFormFields) {\n return this.confirmButtonStatus !== 'VALID';\n }\n return false;\n }\n\n /** Icon size (px) for the action buttons. */\n readonly actionIconSize = MODAL_ACTION_ICON_SIZE;\n\n /** Whether action-button icons should render on this modal (defaults to true). */\n get showActionIcons(): boolean {\n return this.config.showActionIcons !== false;\n }\n\n /**\n * The leading icon for the confirm button, or null when icons are disabled.\n * Uses the per-action override, else defaults by style (DANGER → trash, else check).\n */\n get confirmIcon(): LucideIconData | null {\n if (!this.showActionIcons) return null;\n if (this.config.confirm?.icon) return this.config.confirm.icon;\n return this.confirmStyle === ActionStyle.DANGER\n ? MN_MODAL_ACTION_ICONS.danger\n : MN_MODAL_ACTION_ICONS.confirm;\n }\n\n /** The leading icon for the cancel button, or null when icons are disabled. */\n get cancelIcon(): LucideIconData | null {\n if (!this.showActionIcons) return null;\n return this.config.cancel?.icon ?? MN_MODAL_ACTION_ICONS.cancel;\n }\n}\n","<div class=\"flex flex-col gap-6\" [ngClass]=\"toneClass\">\n <!-- Custom Content (Component or Template) -->\n @if (config.component || config.template) {\n <mn-custom-body-host\n [config]=\"$any(config)\"\n [modalRef]=\"$any(modalRef)\"\n ></mn-custom-body-host>\n }\n\n <div class=\"flex flex-col items-center text-center gap-6\">\n @if (config.tone === 'warning' || config.tone === 'danger') {\n <div\n class=\"w-12 h-12 rounded-full flex items-center justify-center\"\n [ngClass]=\"{\n 'bg-blue-100 text-blue-500': config.tone !== 'warning' && config.tone !== 'danger',\n 'bg-amber-100 text-amber-500': config.tone === 'warning',\n 'bg-red-100 text-red-500': config.tone === 'danger'\n }\">\n @if (config.tone === 'warning') {\n <svg [size]=\"24\" lucideTriangleAlert></svg>\n }\n @if (config.tone === 'danger') {\n <svg [size]=\"24\" lucideCircleAlert></svg>\n }\n </div>\n }\n\n @if (config.message) {\n <div class=\"text-base text-base-content/80 leading-relaxed max-w-[28rem]\">\n {{ config.message }}\n </div>\n }\n </div>\n\n <!-- Form Fields / Rows -->\n @if (hasFormFields) {\n <mn-form-body\n [config]=\"$any(config)\"\n [modalRef]=\"$any(modalRef)\"\n [hideFooter]=\"true\"\n [hideCustomBody]=\"true\"\n (formStatusChange)=\"onFormStatusChange($event)\"\n ></mn-form-body>\n }\n\n <div class=\"flex gap-3 w-full pb-6 sticky bottom-0 bg-base-100 z-10\">\n <button\n type=\"button\"\n mnButton\n [data]=\"{\n variant: getButtonVariant(cancelStyle),\n color: getButtonColor(cancelStyle)\n }\"\n (click)=\"cancel()\"\n >\n @if (cancelIcon; as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ cancelLabel }}\n </button>\n\n <div class=\"flex-1\"></div>\n\n <button\n type=\"button\"\n mnButton\n [data]=\"{\n variant: getButtonVariant(confirmStyle),\n color: getButtonColor(confirmStyle),\n disabled: isConfirmDisabled\n }\"\n [disabled]=\"isConfirmDisabled\"\n (click)=\"confirm()\"\n >\n @if (confirmIcon; as icon) {\n <svg [lucideIcon]=\"icon\" [size]=\"actionIconSize\" class=\"mr-2\"></svg>\n }\n {{ confirmLabel }}\n </button>\n </div>\n</div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n computed,\n ElementRef,\n HostBinding,\n HostListener,\n inject,\n Input,\n OnDestroy,\n OnInit,\n signal,\n viewChild\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {MnModalRef} from '../../mn-modal-ref';\nimport {\n ActionStyle,\n BackdropMode,\n CloseMode,\n ConfirmationModalConfig,\n CustomModalConfig,\n FormModalConfig,\n KeyboardMode,\n ModalCloseReason,\n ModalConfig,\n ModalFooterAction,\n ModalKind,\n ModalSize,\n WizardModalConfig,\n} from '../../mn-modal.types';\nimport {MnWizardBodyComponent} from '../mn-wizard-body/mn-wizard-body.component';\nimport {MnFormBodyComponent} from '../mn-form-body/mn-form-body.component';\nimport {MnConfirmationBodyComponent} from '../mn-confirmation-body/mn-confirmation-body.component';\nimport {MnCustomBodyHostComponent} from '../mn-custom-body-host/mn-custom-body-host.component';\nimport {MnFooterActionsComponent} from '../mn-footer-actions/mn-footer-actions.component';\nimport {MnButton} from '../../../mn-button';\nimport {MnBottomSheet} from '../../../mn-bottom-sheet';\nimport {LucideX} from '@lucide/angular';\nimport {MN_HAPTICS} from '../../mn-modal-haptics';\nimport {MnLanguageService} from '../../../../language';\n\n@Component({\n selector: 'mn-modal-shell',\n standalone: true,\n imports: [\n CommonModule,\n MnWizardBodyComponent,\n MnFormBodyComponent,\n MnConfirmationBodyComponent,\n MnCustomBodyHostComponent,\n MnFooterActionsComponent,\n MnButton,\n MnBottomSheet,\n LucideX,\n ],\n templateUrl: './mn-modal-shell.component.html',\n styleUrls: ['./mn-modal-shell.component.css'],\n})\nexport class MnModalShellComponent<TResult = unknown> implements OnInit, AfterViewInit, OnDestroy {\n private readonly lang = inject(MnLanguageService);\n\n /**\n * Accessible name for this control. Resolved through the conventional\n * `mnModal.close` key so an app can translate it, falling back to English when the\n * key is not defined rather than leaking the raw key into the UI.\n */\n get closeModalLabel(): string {\n return this.lang.translateIfPresent('mnModal.close') ?? 'Close modal';\n }\n\n private el = inject<ElementRef<HTMLElement>>(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n\n @Input() config!: ModalConfig<TResult>;\n @Input() modalRef!: MnModalRef<TResult>;\n\n isClosing = false;\n /**\n * Whether another modal is stacked on top of this one. Set imperatively by\n * `MnModalService` on the already-rendered shell below the newly opened one, so it must\n * be a signal: mutating a plain field there changes the host `[class]` after the view was\n * checked (NG0100 ExpressionChangedAfterItHasBeenChecked) and does not schedule change\n * detection in a zoneless app. A signal write both notifies the host binding and schedules CD.\n */\n readonly isStacked = signal(false);\n readonly ModalKind = ModalKind;\n /** The rendered wizard body, when this modal is a wizard — used to read the active step title. */\n private readonly wizardBody = viewChild(MnWizardBodyComponent);\n /** Tailwind's `sm` breakpoint — below this the modal presents as a bottom sheet. */\n private static readonly SHEET_MAX_WIDTH = 639.98;\n /**\n * Title of the wizard's current step, or undefined for non-wizard modals.\n * The template appends it to the modal title on small screens, where the\n * step labels under the progress circles are hidden.\n */\n readonly wizardStepTitle = computed(() => this.wizardBody()?.currentStepTitle());\n private previouslyFocusedElement: HTMLElement | null = null;\n private focusTrapListener: ((e: KeyboardEvent) => void) | null = null;\n private pollingTimer: ReturnType<typeof setInterval> | null = null;\n private pollAttempts = 0;\n /** Upper bound for the close wait if no animation/transition end event fires\n * (e.g. an animation was suppressed). Must stay longer than the slowest close\n * path so it never preempts. */\n private static readonly CLOSE_FALLBACK_MS = 700;\n /** Live match of the sheet breakpoint, so the modal switches between the centered dialog\n * and the bottom sheet when the viewport crosses it (e.g. an orientation change). */\n readonly isNarrow = signal(false);\n /** The bottom sheet presenting this modal on mobile, absent on the desktop dialog path. */\n private readonly bottomSheet = viewChild(MnBottomSheet);\n /** Optional native haptic engine. Absent on the web — every call is null-guarded. */\n private haptics = inject(MN_HAPTICS, {optional: true});\n private sheetMedia: MediaQueryList | null = null;\n private sheetMediaListener: ((event: MediaQueryListEvent) => void) | null = null;\n\n /** Whether this modal is allowed to present as a bottom sheet on small screens (default: true). */\n get isMobileSheet(): boolean {\n return this.config.mobileBottomSheet !== false;\n }\n\n /** Whether the modal should currently render as a bottom sheet (mobile) rather than the\n * centered dialog (desktop). */\n get showMobileSheet(): boolean {\n return this.isMobileSheet && this.isNarrow();\n }\n\n @HostBinding('class') get hostClasses(): string {\n const size = this.config.sizeWidth || ModalSize.MD;\n // `closing` is intentionally NOT derived here. startClosing() adds the\n // `.closing` class imperatively (classList.add) for reliable, zoneless-safe\n // application. Deriving it here as well flips the host class string after the\n // view has been checked (NG0100). Angular's class binding only manages the tokens\n // it emits, so it leaves the imperatively added `.closing` untouched.\n const animType = typeof this.config.animation === 'string'\n ? this.config.animation\n : this.config.animation?.type || 'slide';\n const animation = ` anim-${animType}`;\n const stacked = this.isStacked() ? ' is-stacked' : '';\n const mobileSheet = this.showMobileSheet ? ' mobile-sheet' : '';\n return `modal-shell modal-${size}${animation}${stacked}${mobileSheet}`;\n }\n\n private setupFocusTrap(): void {\n this.focusTrapListener = (e: KeyboardEvent) => {\n if (e.key !== 'Tab') return;\n const focusable = this.el.nativeElement.querySelectorAll<HTMLElement>(\n 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])'\n );\n if (focusable.length === 0) return;\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (e.shiftKey) {\n if (document.activeElement === first) {\n e.preventDefault();\n last.focus();\n }\n } else {\n if (document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n }\n };\n this.el.nativeElement.addEventListener('keydown', this.focusTrapListener);\n }\n\n private removeFocusTrap(): void {\n if (this.focusTrapListener) {\n this.el.nativeElement.removeEventListener('keydown', this.focusTrapListener);\n this.focusTrapListener = null;\n }\n }\n\n asWizard(config: ModalConfig<TResult>): WizardModalConfig {\n return config as unknown as WizardModalConfig;\n }\n\n asForm(config: ModalConfig<TResult>): FormModalConfig {\n return config as unknown as FormModalConfig;\n }\n\n asConfirmation(config: ModalConfig<TResult>): ConfirmationModalConfig {\n return config as unknown as ConfirmationModalConfig;\n }\n\n asCustom(config: ModalConfig<TResult>): CustomModalConfig {\n return config as unknown as CustomModalConfig;\n }\n\n /** Whether the modal can be dismissed at all (drives the sheet's swipe/backdrop arming). */\n get canClose(): boolean {\n return this.config.closeMode !== CloseMode.DISABLED;\n }\n\n ngOnInit(): void {\n this.startWatchingViewport();\n this.startPollingIfConfigured();\n }\n\n ngOnDestroy(): void {\n this.removeFocusTrap();\n this.stopPolling();\n this.stopWatchingViewport();\n // Restore focus to previously focused element\n if (this.previouslyFocusedElement && typeof this.previouslyFocusedElement.focus === 'function') {\n this.previouslyFocusedElement.focus();\n }\n }\n\n /**\n * Triggers the closing animation and resolves once it has actually finished.\n *\n * Deferred via setTimeout to avoid NG0100 when called during a CD cycle. On mobile the\n * exit is owned by the bottom sheet, so we delegate to its `startClosing()` (idempotent\n * with a swipe-dismiss already in flight); on desktop we wait for the dialog container's\n * `animationend`/`transitionend`. A fallback timeout guarantees resolution if no event\n * fires, and we short-circuit under reduced motion (the CSS collapses to instant).\n */\n startClosing(): Promise<void> {\n return new Promise(resolve => {\n setTimeout(async () => {\n this.isClosing = true;\n // @HostBinding('class') updates are flushed when the host view is checked\n // (appRef.tick), not by a bare detectChanges() on this dynamically-created\n // root component. Apply the `.closing` class directly so the backdrop fade is\n // reliable in a zoneless app.\n this.el.nativeElement.classList.add('closing');\n this.cdr.detectChanges();\n\n if (this.prefersReducedMotion()) {\n resolve();\n return;\n }\n\n // Mobile: the bottom sheet drives the slide-down exit.\n const sheet = this.bottomSheet();\n if (sheet) {\n await sheet.startClosing();\n resolve();\n return;\n }\n\n // Desktop: wait for the centered dialog container's own close animation.\n const container = this.el.nativeElement.querySelector('.modal-container') as HTMLElement | null;\n if (!container) {\n resolve();\n return;\n }\n\n let settled = false;\n const done = (event?: Event): void => {\n // Ignore end events bubbling up from descendant animations/transitions.\n if (event && event.target !== container) return;\n if (settled) return;\n settled = true;\n container.removeEventListener('animationend', done);\n container.removeEventListener('transitionend', done);\n clearTimeout(fallback);\n resolve();\n };\n\n container.addEventListener('animationend', done);\n container.addEventListener('transitionend', done);\n const fallback = setTimeout(done, MnModalShellComponent.CLOSE_FALLBACK_MS);\n });\n });\n }\n\n private prefersReducedMotion(): boolean {\n return typeof window !== 'undefined'\n && typeof window.matchMedia === 'function'\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n @HostListener('document:keydown.escape', ['$event'])\n onEscapeKey(event: Event): void {\n if (this.config.keyboard === KeyboardMode.ENABLED) {\n this.handleClose(ModalCloseReason.ESCAPE);\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n }\n }\n\n onBackdropClick(): void {\n const shouldClose = this.config.backdrop === BackdropMode.CLOSABLE\n || (this.isMobileSheet && this.config.backdrop !== BackdropMode.STATIC);\n if (shouldClose) {\n this.handleClose(ModalCloseReason.BACKDROP);\n }\n }\n\n onCloseButtonClick(): void {\n this.handleClose(ModalCloseReason.DISMISSED);\n }\n\n /**\n * Guard consulted by the bottom sheet before it commits a swipe/flick/backdrop dismissal.\n * Mirrors the DISABLED/GUARDED rules of {@link handleClose} so a swipe cannot escape a\n * modal that a button close could not. Bound as a field so the template passes it directly.\n */\n readonly sheetDismissGuard = async (): Promise<boolean> => {\n if (this.config.closeMode === CloseMode.DISABLED) {\n return false;\n }\n if (this.config.closeMode === CloseMode.GUARDED && this.config.closeGuard) {\n return await this.config.closeGuard();\n }\n return true;\n };\n\n /**\n * Handles the sheet's `(dismiss)` — emitted only after its guard passed and its exit\n * animation finished. Dismisses the modal (no re-guard) with a confirming haptic.\n */\n onSheetDismiss(): void {\n this.haptics?.impact('medium');\n this.modalRef.dismiss(ModalCloseReason.DISMISSED);\n }\n\n ngAfterViewInit(): void {\n this.previouslyFocusedElement = document.activeElement as HTMLElement;\n this.setupFocusTrap();\n // Focus the modal container (the centered dialog, or the sheet's container on mobile).\n const container = this.el.nativeElement.querySelector('.modal-container') as HTMLElement;\n if (container) {\n container.focus();\n }\n }\n\n /** Tracks the sheet breakpoint through `matchMedia` so the dialog/sheet fork re-renders\n * when the viewport crosses it. */\n private startWatchingViewport(): void {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n this.sheetMedia = window.matchMedia(`(max-width: ${MnModalShellComponent.SHEET_MAX_WIDTH}px)`);\n this.isNarrow.set(this.sheetMedia.matches);\n this.sheetMediaListener = (event: MediaQueryListEvent) => this.isNarrow.set(event.matches);\n this.sheetMedia.addEventListener('change', this.sheetMediaListener);\n }\n\n /** Tears down the breakpoint listener. Idempotent. */\n private stopWatchingViewport(): void {\n if (this.sheetMedia && this.sheetMediaListener) {\n this.sheetMedia.removeEventListener('change', this.sheetMediaListener);\n }\n this.sheetMedia = null;\n this.sheetMediaListener = null;\n }\n\n /** Attempts to dismiss the modal. Resolves true if it was actually dismissed,\n * false if blocked by a DISABLED close mode or a rejected close guard. */\n private async handleClose(reason: ModalCloseReason): Promise<boolean> {\n if (this.config.closeMode === CloseMode.DISABLED) {\n return false;\n }\n\n if (this.config.closeMode === CloseMode.GUARDED) {\n if (this.config.closeGuard) {\n const allowed = await this.config.closeGuard();\n if (!allowed) return false;\n }\n }\n\n this.modalRef.dismiss(reason);\n return true;\n }\n\n get showBackdrop(): boolean {\n return this.config.backdrop !== BackdropMode.HIDE;\n }\n\n get containerSizeClass(): string {\n switch (this.config.sizeWidth || ModalSize.MD) {\n case ModalSize.SM: return 'w-96';\n case ModalSize.MD: return 'w-[32rem]';\n case ModalSize.LG: return 'w-[48rem]';\n case ModalSize.XL: return 'w-[64rem]';\n case ModalSize.FULL: return 'w-[95vw]';\n default: return 'w-[32rem]';\n }\n }\n\n get containerHeightStyle(): string | null {\n if (this.config.sizeWidth === ModalSize.FULL && !this.config.sizeHeight) {\n return '95vh';\n }\n if (!this.config.sizeHeight) return null;\n switch (this.config.sizeHeight) {\n case ModalSize.SM: return '30vh';\n case ModalSize.MD: return '50vh';\n case ModalSize.LG: return '70vh';\n case ModalSize.XL: return '85vh';\n case ModalSize.FULL: return '95vh';\n default: return null;\n }\n }\n\n get showCloseButton(): boolean {\n return this.config.closeMode !== CloseMode.DISABLED;\n }\n\n // =========================\n // Footer Actions\n // =========================\n\n get hasCustomFooterActions(): boolean {\n return !!this.config.footerActions && this.config.footerActions.length > 0;\n }\n\n get leftFooterActions(): ModalFooterAction<TResult>[] {\n return (this.config.footerActions || []).filter(a => a.position === 'left');\n }\n\n get rightFooterActions(): ModalFooterAction<TResult>[] {\n return (this.config.footerActions || []).filter(a => a.position !== 'left');\n }\n\n async onFooterAction(action: ModalFooterAction<TResult>): Promise<void> {\n if (action.disabled) return;\n if (action.handler) {\n await action.handler(this.modalRef);\n }\n if (action.closesModal) {\n if (action.closeReason === ModalCloseReason.COMPLETED) {\n this.modalRef.close();\n } else {\n this.modalRef.dismiss(action.closeReason || ModalCloseReason.DISMISSED);\n }\n }\n }\n\n getActionButtonColor(style?: ActionStyle): 'primary' | 'secondary' | 'danger' | 'warning' | 'success' {\n switch (style) {\n case ActionStyle.PRIMARY: return 'primary';\n case ActionStyle.DANGER: return 'danger';\n case ActionStyle.GHOST: return 'secondary';\n default: return 'secondary';\n }\n }\n\n getActionButtonVariant(style?: ActionStyle): 'fill' | 'outline' | 'text' {\n switch (style) {\n case ActionStyle.PRIMARY:\n case ActionStyle.DANGER: return 'fill';\n case ActionStyle.GHOST: return 'text';\n default: return 'outline';\n }\n }\n\n // =========================\n // Polling\n // =========================\n\n private startPollingIfConfigured(): void {\n const polling = this.config.polling;\n if (!polling) return;\n if (polling.autoStart === false) return;\n this.startPolling();\n }\n\n private startPolling(): void {\n const polling = this.config.polling;\n if (!polling) return;\n\n this.pollingTimer = setInterval(async () => {\n this.pollAttempts++;\n try {\n const shouldStop = await polling.onPoll(this.modalRef);\n if (shouldStop === true) {\n this.stopPolling();\n }\n } catch (e) {\n console.error('Polling error:', e);\n }\n if (polling.maxAttempts && this.pollAttempts >= polling.maxAttempts) {\n this.stopPolling();\n }\n }, polling.interval);\n }\n\n private stopPolling(): void {\n if (this.pollingTimer) {\n clearInterval(this.pollingTimer);\n this.pollingTimer = null;\n }\n }\n}\n","@if (showBackdrop) {\n <!-- The backdrop is a visual overlay — keyboard dismiss is handled at component level via Escape key -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div class=\"modal-backdrop absolute inset-0 bg-black/50 animate-[fadeIn_0.2s_ease-in-out]\" (click)=\"onBackdropClick()\"></div>\n}\n\n@if (showMobileSheet) {\n <!-- Mobile: the shared bottom sheet owns the anchoring, grabber, swipe/flick-to-dismiss\n and slide animation. The shell keeps its own backdrop (so the sheet renders none),\n and its close animation delegates to the sheet's startClosing(). `modal-container`\n is kept as a class hook so the host app's keyboard-lift CSS still matches. -->\n <mn-bottom-sheet\n (dismiss)=\"onSheetDismiss()\"\n [ariaLabelledby]=\"config.title ? 'mn-modal-title' : undefined\"\n [containerClass]=\"'modal-container'\"\n [dismissGuard]=\"sheetDismissGuard\"\n [dismissible]=\"canClose\"\n [growWithKeyboard]=\"true\"\n [maxHeightVh]=\"92\"\n [showBackdrop]=\"false\"\n >\n <ng-container [ngTemplateOutlet]=\"modalBody\"></ng-container>\n </mn-bottom-sheet>\n} @else {\n <!--\n Desktop centered dialog. The container deliberately does NOT stop click propagation.\n The backdrop is a *sibling* element (absolutely positioned behind this one), never an\n ancestor, so clicks in here can't reach `onBackdropClick()` anyway. Swallowing them\n instead broke every \"click outside me\" handler inside a modal.\n -->\n <div\n [attr.aria-describedby]=\"config.description ? 'mn-modal-description' : null\"\n [attr.aria-labelledby]=\"config.title ? 'mn-modal-title' : null\"\n [ngClass]=\"containerSizeClass\"\n [style.height]=\"containerHeightStyle\"\n aria-modal=\"true\"\n class=\"modal-container relative bg-base-100 rounded-lg shadow-xl max-h-[90vh] max-w-[calc(100vw-2rem)] overflow-hidden flex flex-col\"\n role=\"dialog\"\n tabindex=\"-1\"\n >\n <ng-container [ngTemplateOutlet]=\"modalBody\"></ng-container>\n </div>\n}\n\n<ng-template #modalBody>\n <div [class.border-b]=\"config.kind !== ModalKind.WIZARD\"\n [class.border-base-300]=\"config.kind !== ModalKind.WIZARD\"\n class=\"flex items-center justify-between p-6\">\n <div class=\"flex flex-col gap-0.5\">\n @if (config.title) {\n <!-- On small screens the wizard's step labels (under the progress circles) are hidden,\n so surface the active step name here as \"Title - Step\" instead. -->\n <h2 class=\"m-0 text-xl font-semibold text-base-content\"\n id=\"mn-modal-title\">{{ config.title }}@if (config.kind === ModalKind.WIZARD && wizardStepTitle()) {\n <span class=\"sm:hidden font-normal text-base-content/60\"> - {{ wizardStepTitle() }}</span>\n }</h2>\n }\n @if (config.subtitle) {\n <p class=\"m-0 text-sm text-base-content/60 font-normal\">{{ config.subtitle }}</p>\n }\n </div>\n @if (showCloseButton) {\n <div [class]=\"showMobileSheet ? 'hidden sm:flex' : ''\">\n <button\n mnButton\n [data]=\"{ size: 'sm', variant: 'text', color: 'gray', hover: true, borderRadius: 'md' }\"\n type=\"button\"\n class=\"w-8 h-8\"\n (click)=\"onCloseButtonClick()\"\n [attr.aria-label]=\"closeModalLabel\"\n >\n <svg lucideX [size]=\"18\"></svg>\n </button>\n </div>\n }\n </div>\n @if (config.description) {\n <p class=\"m-0 px-6 text-sm text-base-content/60 leading-relaxed\" id=\"mn-modal-description\">{{ config.description }}</p>\n }\n\n @if (config.kind === ModalKind.WIZARD) {\n <!-- Wizard manages its own internal scrolling so the steps header and footer\n stay fixed while only the step body scrolls. No padding/scroll here. -->\n <div class=\"flex-auto min-h-0 overflow-hidden flex flex-col\">\n <mn-wizard-body\n [config]=\"asWizard(config)\"\n [modalRef]=\"$any(modalRef)\"\n class=\"flex-auto min-h-0 flex flex-col\"\n ></mn-wizard-body>\n </div>\n } @else {\n <div class=\"flex-1 overflow-y-auto px-6 pt-6\">\n @if (config.kind === ModalKind.FORM) {\n <mn-form-body\n [config]=\"asForm(config)\"\n [modalRef]=\"$any(modalRef)\"\n class=\"block h-full\"\n ></mn-form-body>\n }\n\n @if (config.kind === ModalKind.CONFIRMATION) {\n <mn-confirmation-body\n [config]=\"asConfirmation(config)\"\n [modalRef]=\"$any(modalRef)\"\n ></mn-confirmation-body>\n }\n\n @if (config.kind === ModalKind.CUSTOM) {\n <mn-custom-body-host\n [config]=\"asCustom(config)\"\n [modalRef]=\"$any(modalRef)\"\n class=\"block pb-6\"\n ></mn-custom-body-host>\n }\n </div>\n }\n\n <!-- Custom Footer Actions (not for wizard modals, they render their own) -->\n @if (hasCustomFooterActions && config.kind !== ModalKind.WIZARD) {\n <div class=\"flex gap-3 p-6 border-t border-base-300\">\n <mn-footer-actions\n [actions]=\"config.footerActions || []\"\n [showIcons]=\"config.showActionIcons !== false\"\n (actionClick)=\"onFooterAction($event)\"\n ></mn-footer-actions>\n </div>\n }\n</ng-template>\n","import {ApplicationRef, ComponentRef, createComponent, EnvironmentInjector, inject, Injectable,} from '@angular/core';\nimport {MnModalRef} from './mn-modal-ref';\nimport {ModalConfig} from './mn-modal.types';\nimport {MnModalShellComponent} from './components/mn-modal-shell/mn-modal-shell.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MnModalService {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n private readonly modalStack: MnModalRef<unknown>[] = [];\n\n open<TResult = unknown, TModel = unknown>(config: ModalConfig<TResult, TModel>): MnModalRef<TResult> {\n // Create the modal shell component\n const componentRef = createComponent(MnModalShellComponent, {\n environmentInjector: this.injector,\n }) as unknown as ComponentRef<MnModalShellComponent<TResult>>;\n\n // Work off a mutable shallow copy of the (frozen) builder config, shared by\n // both the shell and the ref. `ModalBuilder.build()` returns a frozen object;\n // `MnModalRef.update()` mutates the config in place (so the shell, which holds\n // the same reference, sees the change), which would throw on a frozen object.\n // Cloning here keeps the caller's built config immutable while giving the\n // runtime an extensible object to update (e.g. footer actions set at runtime).\n const workingConfig = {...(config as ModalConfig<TResult>)};\n\n // TModel is erased at the shell boundary — the shell only needs TResult\n componentRef.instance.config = workingConfig;\n\n // Create modal ref\n const modalRef = new MnModalRef<TResult>(componentRef, workingConfig);\n componentRef.instance.modalRef = modalRef;\n\n // Update stack and dim previous modal\n if (this.modalStack.length > 0) {\n const prevModal = this.modalStack[this.modalStack.length - 1];\n (prevModal.component as MnModalShellComponent<unknown>).isStacked.set(true);\n }\n this.modalStack.push(modalRef as unknown as MnModalRef<unknown>);\n\n // Attach to application\n this.appRef.attachView(componentRef.hostView);\n const domElem = componentRef.location.nativeElement;\n document.body.appendChild(domElem);\n\n // Clean up on close\n modalRef.afterClosed$.subscribe(() => {\n this.appRef.detachView(componentRef.hostView);\n domElem.remove();\n\n // Update stack\n const index = this.modalStack.indexOf(modalRef as unknown as MnModalRef<unknown>);\n if (index > -1) {\n this.modalStack.splice(index, 1);\n if (this.modalStack.length > 0) {\n const topModal = this.modalStack[this.modalStack.length - 1];\n (topModal.component as MnModalShellComponent<unknown>).isStacked.set(false);\n }\n }\n });\n\n return modalRef;\n }\n}\n","// Types\nexport * from './mn-modal.types';\n\n// Action-button icon defaults\nexport * from './mn-modal-action-icons';\n\n// Haptics (optional native feedback hook)\nexport * from './mn-modal-haptics';\n\n// Builders\nexport * from './builder';\n\n// Service\nexport { MnModalService } from './mn-modal.service';\nexport { MnModalRef } from './mn-modal-ref';\n\n// Components\nexport { MnModalShellComponent } from './components/mn-modal-shell/mn-modal-shell.component';\nexport { MnWizardBodyComponent } from './components/mn-wizard-body/mn-wizard-body.component';\nexport { MnFormBodyComponent } from './components/mn-form-body/mn-form-body.component';\nexport { MnConfirmationBodyComponent } from './components/mn-confirmation-body/mn-confirmation-body.component';\nexport { MnCustomBodyHostComponent } from './components/mn-custom-body-host/mn-custom-body-host.component';\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Output,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgClass, NgTemplateOutlet} from '@angular/common';\nimport {FormsModule} from '@angular/forms';\nimport {LucideDynamicIcon} from '@lucide/angular';\nimport {ListDataSource} from './mn-list.types';\nimport {MnCheckbox} from '../mn-checkbox';\nimport {MnInputField} from '../mn-input-field';\nimport {MnSkeleton, MnSkeletonProps} from '../mn-skeleton';\nimport {MnCollectionPagination, MnSelectableCollectionBase} from '../mn-collection';\n\n/** Default skeleton lines reproducing the previous two-bar placeholder. */\nconst DEFAULT_LIST_SKELETON_LINES: Partial<MnSkeletonProps>[] = [\n {shape: 'text', width: '75%'},\n {shape: 'text', width: '50%', height: '0.75rem'},\n];\n\n@Component({\n selector: 'mn-list',\n standalone: true,\n imports: [NgClass, NgTemplateOutlet, FormsModule, MnCheckbox, MnInputField, MnSkeleton, MnCollectionPagination, LucideDynamicIcon],\n templateUrl: './mn-list.component.html',\n styleUrl: './mn-list.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MnList<T = unknown>\n extends MnSelectableCollectionBase<T, ListDataSource<T>> {\n @Output() itemClick = new EventEmitter<T>();\n\n protected override readonly componentName = 'MnList';\n\n /** Skeleton lines rendered for each placeholder item, falling back to the default two-bar layout. */\n get skeletonLines(): Partial<MnSkeletonProps>[] {\n const skeleton = this.dataSource.skeleton;\n if (skeleton && !this.isTemplateRef(skeleton)) {\n return skeleton.lines;\n }\n return DEFAULT_LIST_SKELETON_LINES;\n }\n\n // ── Item interaction ──\n\n onItemClick(item: T): void {\n this.dataSource.onItemClick?.(item);\n this.itemClick.emit(item);\n }\n\n /**\n * Keyboard activation of a clickable item: Enter and Space open it, as they would a button.\n * Handled on keydown so Space does not scroll the page first, and only when the item itself has\n * focus, so a checkbox or button inside the item keeps its own keys.\n * @param event - The keydown on the item.\n * @param item - The item the key was pressed on.\n */\n onItemKeydown(event: KeyboardEvent, item: T): void {\n if (!this.dataSource.onItemClick || event.target !== event.currentTarget) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n this.onItemClick(item);\n }\n\n // ── Skeleton ──\n\n /**\n * The toolbar template the base class watches for identity changes. Prefers the\n * left slot, then the right, then the deprecated `toolbarTemplate`, so a list\n * using any single slot still re-renders when that template is swapped.\n */\n protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined {\n return (\n this.dataSource?.toolbarLeftTemplate ??\n this.dataSource?.toolbarRightTemplate ??\n this.dataSource?.toolbarTemplate\n );\n }\n\n @ViewChild('collectionBody') protected collectionBody?: ElementRef<HTMLElement>;\n\n // ── Filtering ──\n\n protected applyFilter(searchForItems: boolean): void {\n this.filteredItems = this.applySearchFilter(this.dataSource.dataRows.value);\n this.applyPagination();\n\n if (searchForItems) {\n this.loadMoreRows();\n }\n }\n\n /** Accessible name for the scrollable list region. */\n get listRegionLabel(): string {\n return this.resolveLabel(undefined, 'mnCollection.dataList', 'Data list');\n }\n\n /** Label on the header checkbox that selects or clears every visible row. */\n get selectAllLabel(): string {\n return this.resolveLabel(undefined, 'mnCollection.selectAll', 'Select all');\n }\n}\n","<!-- Toolbar: left template, then search + right template. Below 375px each group\n takes its own full-width row; from 375px up the left group sits at the start\n and the search group at the end. Structure and classes mirror mn-table so all\n collections behave identically at every width. -->\n@if (\n isSearchable ||\n dataSource.toolbarLeftTemplate ||\n dataSource.toolbarRightTemplate ||\n dataSource.toolbarTemplate\n) {\n <div class=\"flex flex-col min-[375px]:flex-row min-[375px]:items-center justify-between gap-2 mb-3\">\n <div class=\"flex items-center gap-2 w-full min-[375px]:w-auto\">\n @if (dataSource.toolbarLeftTemplate) {\n <div class=\"flex flex-col w-full min-[375px]:w-auto min-[375px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarLeftTemplate\"></ng-container>\n </div>\n }\n </div>\n <div\n class=\"flex flex-col min-[375px]:flex-row min-[375px]:items-center gap-2 w-full min-[375px]:flex-1 min-[480px]:flex-none min-[480px]:w-auto\">\n @if (isSearchable) {\n <!-- Enter must not submit a surrounding form: the search box is the\n collection's own chrome, not a field of whatever form it sits in. -->\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n (ngModelChange)=\"onSearch($event)\"\n [ngModel]=\"searchValue\"\n [props]=\"{\n id: 'mn-list-search',\n type: 'search',\n label: '',\n ariaLabel: dataSource.searchPlaceholder ?? 'Search...',\n placeholder: dataSource.searchPlaceholder ?? 'Search...',\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true\n }\"\n class=\"w-full min-[375px]:flex-1 min-[480px]:max-w-64\"\n ></mn-lib-input-field>\n }\n <!-- `toolbarTemplate` is the deprecated name for this slot; honouring it here\n keeps existing callers rendering exactly where they used to. -->\n @if (dataSource.toolbarRightTemplate ?? dataSource.toolbarTemplate; as rightTemplate) {\n <div class=\"flex flex-col w-full min-[375px]:w-auto min-[375px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"rightTemplate\"></ng-container>\n </div>\n }\n </div>\n </div>\n}\n\n<!-- Announces loading. The skeletons are aria-hidden, so without this a screen reader hears\n nothing while rows load. The region stays in the DOM and only its text changes, which is\n what makes assistive tech read it; one inserted with its text already set is often missed. -->\n<span class=\"sr-only\" role=\"status\">{{ isLoadingState ? loadingLabel : '' }}</span>\n\n<!-- List wrapper -->\n<div\n #collectionBody\n [attr.aria-busy]=\"isLoadingState || null\"\n [style.min-height.px]=\"bodyMinHeight\"\n class=\"w-full\"\n [class.border]=\"dataSource.appearance?.bordered\"\n [class.border-base-300]=\"dataSource.appearance?.bordered\"\n [class.rounded]=\"dataSource.appearance?.bordered\"\n role=\"list\"\n [attr.aria-label]=\"listRegionLabel\"\n>\n <!-- Loading state -->\n @if (isLoadingState) {\n @for (_ of skeletonRows; track $index) {\n <div [class.py-2]=\"dataSource.appearance?.compact\" class=\"px-4 py-3\" role=\"listitem\">\n @if (isTemplateRef(dataSource.skeleton)) {\n <ng-container [ngTemplateOutlet]=\"$any(dataSource.skeleton)\"></ng-container>\n } @else {\n <div class=\"flex flex-col gap-1\">\n @for (line of skeletonLines; track $index) {\n <mn-skeleton [data]=\"line\"></mn-skeleton>\n }\n </div>\n }\n </div>\n @if (!$last && (dataSource.appearance?.dividers !== false)) {\n <div class=\"border-b border-base-300\"></div>\n }\n }\n } @else if (isErrorState) {\n <!-- Error state -->\n <div class=\"text-center text-xs py-8\" role=\"listitem\">\n @if (dataSource.errorTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.errorTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-error\">\n <p class=\"text-sm\">{{ dataSource.errorMessage }}</p>\n </div>\n }\n </div>\n } @else {\n <!-- Empty state -->\n @if (filteredItems.length === 0) {\n <div class=\"text-center text-xs py-8\" role=\"listitem\">\n @if (dataSource.emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.emptyTemplate\"></ng-container>\n } @else {\n <div class=\"flex flex-col items-center gap-2 text-base-content/50\">\n @if (dataSource.emptyIcon !== null) {\n <svg [lucideIcon]=\"dataSource.emptyIcon ?? defaultEmptyIcon\" [size]=\"32\" [strokeWidth]=\"1.5\"></svg>\n }\n <p class=\"text-sm\">{{ dataSource.emptyMessage }}</p>\n </div>\n }\n </div>\n }\n\n <!-- Select all (multi-select) -->\n @if (isMultiSelect && filteredItems.length > 0) {\n <div class=\"flex items-center gap-2 px-4 py-2 bg-base-200 text-sm\">\n <mn-lib-checkbox\n (checkedChange)=\"toggleAll()\"\n [checked]=\"allSelected\"\n [props]=\"{ id: 'mn-list-select-all', label: selectAllLabel, size: 'sm' }\"\n ></mn-lib-checkbox>\n </div>\n @if (dataSource.appearance?.dividers !== false) {\n <div class=\"border-b border-base-300\"></div>\n }\n }\n\n <!-- Data items -->\n @for (item of paginatedItems; track trackByID($index, item); let odd = $odd; let last = $last) {\n <div\n class=\"flex items-center gap-2 bg-base-100 transition-colors duration-150\"\n [ngClass]=\"{'bg-primary/10': isSelected(item)}\"\n [class.bg-base-200]=\"!isSelected(item) && odd && dataSource.appearance?.dividers !== false\"\n [class.hover:bg-base-200]=\"dataSource.appearance?.hover !== false\"\n [class.cursor-pointer]=\"!!dataSource.onItemClick\"\n [class.px-4]=\"true\"\n [class.py-3]=\"!dataSource.appearance?.compact\"\n [class.py-2]=\"dataSource.appearance?.compact\"\n role=\"listitem\"\n (keydown)=\"onItemKeydown($event, item)\"\n (click)=\"onItemClick(item)\"\n [attr.tabindex]=\"dataSource.onItemClick ? 0 : null\"\n >\n <!-- Selection checkbox -->\n @if (hasSelection) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <div (click)=\"$event.stopPropagation()\" class=\"shrink-0\">\n <mn-lib-checkbox\n (checkedChange)=\"toggle(item)\"\n [checked]=\"isSelected(item)\"\n [props]=\"{ id: 'mn-list-item-' + $index, size: 'sm' }\"\n ></mn-lib-checkbox>\n </div>\n }\n\n <!-- Item content via template -->\n <div class=\"flex-1 min-w-0\">\n <ng-container\n [ngTemplateOutlet]=\"dataSource.itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item, data: item }\"\n ></ng-container>\n </div>\n </div>\n @if (!last && (dataSource.appearance?.dividers !== false)) {\n <div class=\"border-b border-base-300\"></div>\n }\n }\n }\n</div>\n\n<!-- Load more + pagination -->\n<mn-collection-pagination\n (loadMore)=\"loadMoreRows()\"\n (pageChange)=\"goToPage($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [currentPage]=\"currentPage\"\n [isPaginated]=\"isPaginated\"\n [isServerPaginated]=\"isServerPaginated\"\n [labels]=\"dataSource.labels\"\n [loadingMoreRows]=\"loadingMoreRows\"\n [pageSizeSelectOptions]=\"pageSizeSelectOptions\"\n [pageSize]=\"pageSize\"\n [showLoadMore]=\"showLoadMore\"\n [totalItemCount]=\"totalItemCount\"\n [totalPages]=\"totalPages\"\n [visiblePages]=\"visiblePages\"\n idPrefix=\"mn-list\"\n></mn-collection-pagination>\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Output,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {NgTemplateOutlet} from '@angular/common';\nimport {FormsModule} from '@angular/forms';\nimport {LucideDynamicIcon} from '@lucide/angular';\nimport {GridDataSource} from './mn-grid.types';\nimport {MnSkeleton, MnSkeletonProps} from '../mn-skeleton';\nimport {MnInputField} from '../mn-input-field';\nimport {MnCollectionBase, MnCollectionPagination} from '../mn-collection';\n\n/** Default card skeleton: an image block plus two text bars. */\nconst DEFAULT_GRID_SKELETON_LINES: Partial<MnSkeletonProps>[] = [\n {shape: 'rectangle', width: '100%', height: '8rem'},\n {shape: 'text', width: '75%'},\n {shape: 'text', width: '50%', height: '0.75rem'},\n];\n\n/** Breakpoints a `cols` map may address, ordered small → large. */\nconst GRID_BREAKPOINTS = ['base', 'sm', 'md', 'lg', 'xl'] as const;\n\n/** One of the breakpoints in {@link GRID_BREAKPOINTS}. */\ntype GridBreakpoint = (typeof GRID_BREAKPOINTS)[number];\n\n/** Highest column count with a pre-generated class; larger requests clamp to it. */\nconst MAX_GRID_COLS = 12;\n\n/**\n * Column utilities per breakpoint, indexed by `columns - 1`.\n *\n * Spelled out as literals on purpose: the consuming app's Tailwind scanner reads\n * the shipped bundle, so a name assembled at runtime (`sm:grid-cols-${n}`) would\n * never be generated. Breakpoints are Tailwind's defaults (sm 640, md 768,\n * lg 1024, xl 1280), and each unset one simply inherits the next-smaller class.\n */\nconst GRID_COL_CLASSES: Record<GridBreakpoint, readonly string[]> = {\n base: [\n 'grid-cols-1', 'grid-cols-2', 'grid-cols-3', 'grid-cols-4', 'grid-cols-5', 'grid-cols-6',\n 'grid-cols-7', 'grid-cols-8', 'grid-cols-9', 'grid-cols-10', 'grid-cols-11', 'grid-cols-12',\n ],\n sm: [\n 'sm:grid-cols-1', 'sm:grid-cols-2', 'sm:grid-cols-3', 'sm:grid-cols-4', 'sm:grid-cols-5', 'sm:grid-cols-6',\n 'sm:grid-cols-7', 'sm:grid-cols-8', 'sm:grid-cols-9', 'sm:grid-cols-10', 'sm:grid-cols-11', 'sm:grid-cols-12',\n ],\n md: [\n 'md:grid-cols-1', 'md:grid-cols-2', 'md:grid-cols-3', 'md:grid-cols-4', 'md:grid-cols-5', 'md:grid-cols-6',\n 'md:grid-cols-7', 'md:grid-cols-8', 'md:grid-cols-9', 'md:grid-cols-10', 'md:grid-cols-11', 'md:grid-cols-12',\n ],\n lg: [\n 'lg:grid-cols-1', 'lg:grid-cols-2', 'lg:grid-cols-3', 'lg:grid-cols-4', 'lg:grid-cols-5', 'lg:grid-cols-6',\n 'lg:grid-cols-7', 'lg:grid-cols-8', 'lg:grid-cols-9', 'lg:grid-cols-10', 'lg:grid-cols-11', 'lg:grid-cols-12',\n ],\n xl: [\n 'xl:grid-cols-1', 'xl:grid-cols-2', 'xl:grid-cols-3', 'xl:grid-cols-4', 'xl:grid-cols-5', 'xl:grid-cols-6',\n 'xl:grid-cols-7', 'xl:grid-cols-8', 'xl:grid-cols-9', 'xl:grid-cols-10', 'xl:grid-cols-11', 'xl:grid-cols-12',\n ],\n};\n\n/**\n * Picks the column utility for a breakpoint, clamped to the range that has one.\n * @param breakpoint Breakpoint the class applies from.\n * @param columns Requested column count.\n * @returns The Tailwind class name.\n */\nfunction gridColClass(breakpoint: GridBreakpoint, columns: number): string {\n const index = Math.min(Math.max(Math.round(columns), 1), MAX_GRID_COLS) - 1;\n return GRID_COL_CLASSES[breakpoint][index];\n}\n\n/**\n * Responsive card-grid component. Shares the collection chrome (search, every\n * pagination mode, loading skeleton, empty state, toolbar, i18n) with\n * {@link import('../mn-list').MnList} and {@link import('../mn-table').MnTable}\n * via {@link MnCollectionBase}, and lays items out as cards instead of rows.\n * Selection is intentionally not supported.\n */\n@Component({\n selector: 'mn-grid',\n standalone: true,\n imports: [NgTemplateOutlet, FormsModule, MnSkeleton, MnInputField, MnCollectionPagination, LucideDynamicIcon],\n templateUrl: './mn-grid.component.html',\n host: {class: 'block'},\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MnGrid<T = unknown> extends MnCollectionBase<T, GridDataSource<T>> {\n @Output() itemClick = new EventEmitter<T>();\n\n protected override readonly componentName = 'MnGrid';\n\n /** Whether the grid uses auto-fit (minCardWidth) instead of explicit columns. */\n get isAutoLayout(): boolean {\n return !!this.dataSource.layout?.minCardWidth;\n }\n\n // ── Layout ──\n\n /**\n * Classes for the card container: `grid` plus one column utility per\n * breakpoint the consumer configured. Omitted for the auto-fit layout, whose\n * columns come from {@link autoTemplateColumns} instead.\n */\n get gridClasses(): string {\n if (this.isAutoLayout) {\n return 'grid';\n }\n\n const cols = this.dataSource.layout?.cols;\n const classes = ['grid', gridColClass('base', cols?.base ?? 1)];\n\n for (const breakpoint of GRID_BREAKPOINTS) {\n if (breakpoint === 'base') continue;\n const columns = cols?.[breakpoint];\n if (columns != null) {\n classes.push(gridColClass(breakpoint, columns));\n }\n }\n\n return classes.join(' ');\n }\n\n /** Gap between cards. */\n get gridGap(): string {\n return this.dataSource.layout?.gap ?? '1rem';\n }\n\n /**\n * Inline `grid-template-columns` for the auto-fit layout, or null when explicit\n * `cols` are used (the utilities in {@link gridClasses} then own the columns).\n * `minCardWidth` is a free-form CSS length, so it can only be expressed inline.\n */\n get autoTemplateColumns(): string | null {\n const minCardWidth = this.dataSource.layout?.minCardWidth;\n return minCardWidth ? `repeat(auto-fit, minmax(${minCardWidth}, 1fr))` : null;\n }\n\n /** Skeleton lines for the default/lines placeholder; null when a custom template is used. */\n get skeletonLines(): Partial<MnSkeletonProps>[] {\n const skeleton = this.dataSource.skeleton;\n if (skeleton && !this.isTemplateRef(skeleton)) {\n return skeleton.lines;\n }\n return DEFAULT_GRID_SKELETON_LINES;\n }\n\n // ── Item interaction ──\n\n /**\n * The toolbar template the base class watches for identity changes. Prefers the\n * left slot, then the right, then the deprecated `toolbarTemplate`, so a grid\n * using any single slot still re-renders when that template is swapped.\n */\n protected get trackedToolbarTemplate(): TemplateRef<unknown> | undefined {\n return (\n this.dataSource?.toolbarLeftTemplate ??\n this.dataSource?.toolbarRightTemplate ??\n this.dataSource?.toolbarTemplate\n );\n }\n\n @ViewChild('collectionBody') protected collectionBody?: ElementRef<HTMLElement>;\n\n // ── Skeleton ──\n\n onItemClick(item: T): void {\n this.dataSource.onItemClick?.(item);\n this.itemClick.emit(item);\n }\n\n /**\n * Keyboard activation of a clickable item: Enter and Space open it, as they would a button.\n * Handled on keydown so Space does not scroll the page first, and only when the item itself has\n * focus, so a checkbox or button inside the item keeps its own keys.\n * @param event - The keydown on the item.\n * @param item - The item the key was pressed on.\n */\n onItemKeydown(event: KeyboardEvent, item: T): void {\n if (!this.dataSource.onItemClick || event.target !== event.currentTarget) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n event.preventDefault();\n this.onItemClick(item);\n }\n\n // ── Filtering ──\n\n protected applyFilter(searchForItems: boolean): void {\n let items = this.applySearchFilter(this.dataSource.dataRows.value ?? []);\n\n // Preview cap: show only the first `maxItems` cards (pager stays hidden).\n const maxItems = this.dataSource.layout?.maxItems;\n if (maxItems != null) {\n items = items.slice(0, maxItems);\n }\n\n this.filteredItems = items;\n this.applyPagination();\n\n if (searchForItems) {\n this.loadMoreRows();\n }\n }\n\n /** Accessible name for the scrollable grid region. */\n get gridRegionLabel(): string {\n return this.resolveLabel(undefined, 'mnCollection.cardGrid', 'Card grid');\n }\n}\n","<!-- Toolbar: left template, then search + right template. Below 375px each group\n takes its own full-width row; from 375px up the left group sits at the start\n and the search group at the end. Structure and classes mirror mn-table so all\n collections behave identically at every width. -->\n@if (\n isSearchable ||\n dataSource.toolbarLeftTemplate ||\n dataSource.toolbarRightTemplate ||\n dataSource.toolbarTemplate\n) {\n <div class=\"flex flex-col min-[375px]:flex-row min-[375px]:items-center justify-between gap-2 mb-3\">\n <div class=\"flex items-center gap-2 w-full min-[375px]:w-auto\">\n @if (dataSource.toolbarLeftTemplate) {\n <div class=\"flex flex-col w-full min-[375px]:w-auto min-[375px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"dataSource.toolbarLeftTemplate\"></ng-container>\n </div>\n }\n </div>\n <div\n class=\"flex flex-col min-[375px]:flex-row min-[375px]:items-center gap-2 w-full min-[375px]:flex-1 min-[480px]:flex-none min-[480px]:w-auto\">\n @if (isSearchable) {\n <!-- Enter must not submit a surrounding form: the search box is the\n collection's own chrome, not a field of whatever form it sits in. -->\n <mn-lib-input-field\n (keydown.enter)=\"$event.preventDefault()\"\n (ngModelChange)=\"onSearch($event)\"\n [ngModel]=\"searchValue\"\n [props]=\"{\n id: 'mn-grid-search',\n type: 'search',\n label: '',\n ariaLabel: dataSource.searchPlaceholder ?? 'Search...',\n placeholder: dataSource.searchPlaceholder ?? 'Search...',\n size: 'sm',\n borderRadius: 'md',\n fullWidth: true\n }\"\n class=\"w-full min-[375px]:flex-1 min-[480px]:max-w-64\"\n ></mn-lib-input-field>\n }\n <!-- `toolbarTemplate` is the deprecated name for this slot; honouring it here\n keeps existing callers rendering exactly where they used to. -->\n @if (dataSource.toolbarRightTemplate ?? dataSource.toolbarTemplate; as rightTemplate) {\n <div class=\"flex flex-col w-full min-[375px]:w-auto min-[375px]:flex-row\">\n <ng-container [ngTemplateOutlet]=\"rightTemplate\"></ng-container>\n </div>\n }\n </div>\n </div>\n}\n\n<!-- Body: skeleton/data swap region. Wrapper holds its height during a server reload. -->\n<!-- Announces loading. The skeletons are aria-hidden, so without this a screen reader hears\n nothing while rows load. The region stays in the DOM and only its text changes, which is\n what makes assistive tech read it; one inserted with its text already set is often missed. -->\n<span class=\"sr-only\" role=\"status\">{{ isLoadingState ? loadingLabel : '' }}</span>\n\n<div #collectionBody [style.min-height.px]=\"bodyMinHeight\">\n<!-- Loading state -->\n @if (isLoadingState) {\n <div\n [class]=\"gridClasses\"\n [style.gap]=\"gridGap\"\n [style.grid-template-columns]=\"autoTemplateColumns\"\n aria-busy=\"true\"\n [attr.aria-label]=\"loadingLabel\"\n role=\"list\"\n >\n @for (_ of skeletonRows; track $index) {\n <div role=\"listitem\">\n @if (isTemplateRef(dataSource.skeleton)) {\n <ng-container [ngTemplateOutlet]=\"$any(dataSource.skeleton)\"></ng-container>\n } @else {\n <div class=\"flex flex-col gap-2 p-4 border border-base-300 rounded-lg\">\n @for (line of skeletonLines; track $index) {\n <mn-skeleton [data]=\"line\"></mn-skeleton>\n }\n </div>\n }\n </div>\n }\n </div>\n } @else if (isErrorState) {\n <!-- Error state -->\n @if (dataSource.errorTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.errorTemplate\"></ng-container>\n } @else {\n <div\n class=\"flex items-center justify-center min-h-[6rem] py-8 rounded-xl border border-dashed border-error/30 bg-base-100\">\n <p class=\"text-sm text-error\">{{ dataSource.errorMessage }}</p>\n </div>\n }\n} @else {\n <!-- Empty state: a caller-provided template/component (rendered unwrapped, full\n control over its own layout) or, when none is given, the default text. -->\n @if (filteredItems.length === 0) {\n @if (dataSource.emptyTemplate) {\n <ng-container [ngTemplateOutlet]=\"dataSource.emptyTemplate\"></ng-container>\n } @else {\n <div\n class=\"flex flex-col items-center justify-center gap-2 min-h-[6rem] py-8 rounded-xl border border-dashed border-base-content/15 bg-base-100 text-base-content/40\">\n @if (dataSource.emptyIcon !== null) {\n <svg [lucideIcon]=\"dataSource.emptyIcon ?? defaultEmptyIcon\" [size]=\"32\" [strokeWidth]=\"1.5\"></svg>\n }\n <p class=\"text-sm\">{{ dataSource.emptyMessage }}</p>\n </div>\n }\n } @else {\n <!-- Card grid -->\n <div\n [class]=\"gridClasses\"\n [style.gap]=\"gridGap\"\n [style.grid-template-columns]=\"autoTemplateColumns\"\n [attr.aria-label]=\"gridRegionLabel\"\n role=\"list\"\n >\n @for (item of paginatedItems; track trackByID($index, item)) {\n <div\n (click)=\"onItemClick(item)\"\n (keydown)=\"onItemKeydown($event, item)\"\n [attr.tabindex]=\"dataSource.onItemClick ? 0 : null\"\n [class.cursor-pointer]=\"!!dataSource.onItemClick\"\n class=\"transition-colors duration-150\"\n role=\"listitem\"\n >\n <ng-container\n [ngTemplateOutletContext]=\"{ $implicit: item, data: item }\"\n [ngTemplateOutlet]=\"dataSource.cardTemplate\"\n ></ng-container>\n </div>\n }\n </div>\n }\n}\n</div>\n\n<!-- Load more + pagination -->\n<mn-collection-pagination\n (loadMore)=\"loadMoreRows()\"\n (pageChange)=\"goToPage($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n [currentPage]=\"currentPage\"\n [isPaginated]=\"isPaginated\"\n [isServerPaginated]=\"isServerPaginated\"\n [labels]=\"dataSource.labels\"\n [loadingMoreRows]=\"loadingMoreRows\"\n [pageSizeSelectOptions]=\"pageSizeSelectOptions\"\n [pageSize]=\"pageSize\"\n [showLoadMore]=\"showLoadMore\"\n [totalItemCount]=\"totalItemCount\"\n [totalPages]=\"totalPages\"\n [visiblePages]=\"visiblePages\"\n idPrefix=\"mn-grid\"\n></mn-collection-pagination>\n","import {InjectionToken} from '@angular/core';\nimport {CalendarEvent} from './calendar-event.model';\nimport {provideMnComponentConfig} from '../../../config';\n\n/**\n * Available calendar view modes.\n */\nexport enum CalendarView {\n MONTH = 'MONTH',\n WEEK = 'WEEK',\n DAY = 'DAY'\n}\n\n/**\n * Configuration for the calendar component.\n * All properties are optional — sensible defaults are provided.\n * Can be supplied via the `CALENDAR_CONFIG` injection token or through\n * the `provideMnComponentConfig` helper using component name `'mn-calendar'`.\n */\nexport type CalendarConfig = {\n /** First visible hour in week/day views (0–23). Default: `7`. */\n startHour: number;\n /** Last visible hour in week/day views (1–24, exclusive). Default: `22`. */\n endHour: number;\n /** BCP 47 locale tag used for date/time formatting (e.g. `'en-US'`, `'nl-NL'`). Default: `'en-US'`. */\n locale: string;\n /** Label for the \"Today\" navigation button. Default: `'Today'`. */\n todayLabel: string;\n /** Placeholder for the toolbar's date picker. Default: `'Pick a date'`. */\n pickDateLabel: string;\n /** Accessible name for the toolbar's back arrow. Default: `'Previous'`. */\n previousLabel: string;\n /** Accessible name for the toolbar's forward arrow. Default: `'Next'`. */\n nextLabel: string;\n /** Title shown above the upcoming-events sidebar. Default: `'Upcoming events'`. */\n upcomingEventsTitle: string;\n /** Message shown when there are no upcoming events. Default: `'No upcoming events'`. */\n noUpcomingEvents: string;\n /** Word after the \"+N\" overflow count in a month cell — \"+3 more\". Default: `'more'`. */\n moreEventsLabel: string;\n /** Display labels for each calendar view mode. */\n viewLabels: Record<string, string>;\n /** Abbreviated day names starting from Monday (length 7). Derived from `locale` when not set. */\n shortDayNames: string[];\n /** Full day names starting from Monday (length 7). Derived from `locale` when not set. */\n longDayNames: string[];\n /** Screen-width breakpoint (px) below which only day view is shown. Default: `768`. */\n mobileBreakpoint: number;\n}\n\n/**\n * Builds locale-derived day name arrays from a BCP 47 locale string.\n * Uses January 1 2024 (a Monday) as the reference date.\n */\nfunction buildDayNames(locale: string): { short: string[]; long: string[] } {\n const base = new Date(2024, 0, 1); // 2024-01-01 is a Monday\n const short: string[] = [];\n const long: string[] = [];\n for (let i = 0; i < 7; i++) {\n const d = new Date(base);\n d.setDate(base.getDate() + i);\n short.push(d.toLocaleDateString(locale, { weekday: 'short' }));\n long.push(d.toLocaleDateString(locale, { weekday: 'long' }));\n }\n return { short, long };\n}\n\n/** Default calendar configuration values. */\nexport const DEFAULT_CALENDAR_CONFIG: CalendarConfig = (() => {\n const locale = 'en-US';\n const names = buildDayNames(locale);\n return {\n startHour: 7,\n endHour: 22,\n locale,\n todayLabel: 'Today',\n pickDateLabel: 'Pick a date',\n previousLabel: 'Previous',\n nextLabel: 'Next',\n upcomingEventsTitle: 'Upcoming events',\n noUpcomingEvents: 'No upcoming events',\n moreEventsLabel: 'more',\n viewLabels: { MONTH: 'Month', WEEK: 'Week', DAY: 'Day' },\n shortDayNames: names.short,\n longDayNames: names.long,\n mobileBreakpoint: 768,\n };\n})();\n\n/**\n * Injection token for the resolved calendar configuration.\n *\n * Prefer using {@link MN_CALENDAR_CONFIG} with `provideMnComponentConfig`\n * so that settings can be managed via `mn-config.json5`. This token is\n * kept for backward compatibility and manual `providers` usage.\n *\n * @example\n * ```ts\n * providers: [\n * { provide: CALENDAR_CONFIG, useValue: { startHour: 8, endHour: 20, locale: 'nl-NL' } }\n * ]\n * ```\n */\nexport const CALENDAR_CONFIG = new InjectionToken<CalendarConfig>('CalendarConfig', {\n providedIn: 'root',\n factory: () => DEFAULT_CALENDAR_CONFIG\n});\n\n/**\n * Injection token resolved via `MnConfigService` (the `mn-config.json5` system).\n *\n * Use the helper {@link provideMnCalendarConfig} in the component's `providers`\n * array so that calendar settings are read from the config file and support\n * `$translate` markers, section scoping, and instance-id overrides.\n *\n * Component name in the config file: `'mn-calendar'`.\n *\n * @example\n * ```json5\n * // mn-config.json5\n * {\n * defaults: {\n * \"mn-calendar\": {\n * startHour: 8,\n * endHour: 20,\n * locale: \"nl-NL\",\n * todayLabel: { $translate: \"calendar.today\" }\n * }\n * }\n * }\n * ```\n */\nexport const MN_CALENDAR_CONFIG = new InjectionToken<CalendarConfig>('MN_CALENDAR_CONFIG');\n\n/** Component name used to look up calendar settings in `mn-config.json5`. */\nexport const MN_CALENDAR_COMPONENT_NAME = 'mn-calendar';\n\n/**\n * Provider helper that wires the calendar into the `mn-config` system.\n *\n * Add this to the `providers` array of the component (or module) that hosts\n * `<mn-calendar-view>`. It reads defaults and overrides from `mn-config.json5`\n * under the key `\"mn-calendar\"` and provides them via {@link MN_CALENDAR_CONFIG}.\n *\n * @param initial — optional partial defaults merged before config-file values.\n */\nexport function provideMnCalendarConfig(initial?: Partial<CalendarConfig>) {\n return provideMnComponentConfig<CalendarConfig>(MN_CALENDAR_CONFIG, MN_CALENDAR_COMPONENT_NAME, initial);\n}\n\n/**\n * Merges a partial config with defaults, re-deriving day names from locale when needed.\n */\nexport function resolveCalendarConfig(partial?: Partial<CalendarConfig>): CalendarConfig {\n if (!partial) return { ...DEFAULT_CALENDAR_CONFIG };\n const locale = partial.locale ?? DEFAULT_CALENDAR_CONFIG.locale;\n const names = buildDayNames(locale);\n return {\n ...DEFAULT_CALENDAR_CONFIG,\n ...partial,\n locale,\n shortDayNames: partial.shortDayNames ?? names.short,\n longDayNames: partial.longDayNames ?? names.long,\n };\n}\n\n/**\n * Represents a half-hour row in the week/day time grid.\n */\nexport type HourRow = {\n /** The hour value (e.g. 7, 8, …). */\n hour: number;\n /** CSS grid row start (1-based). */\n topRow: number;\n /** CSS grid row end (1-based, exclusive). */\n bottomRow: number;\n}\n\n/**\n * Represents a single day column in the week view header.\n */\nexport type ColumnDay = {\n /** The date this column represents. */\n date: Date;\n /** Abbreviated day name (e.g. \"Mon\"). */\n dayName: string;\n /** Day-of-month number (1–31). */\n dayNumber: number;\n /** Whether this column is today. */\n isToday: boolean;\n}\n\n/**\n * Represents a single cell in the month grid.\n */\nexport type MonthItem = {\n /** The date this cell represents. */\n date: Date;\n /** Day-of-month number (1–31). */\n dayNumber: number;\n /** Whether this date belongs to the currently focused month. */\n isCurrentMonth: boolean;\n /** Whether this date is today. */\n isToday: boolean;\n /** Events occurring on this date. */\n events: CalendarEvent[];\n}\n","import {Injectable, inject} from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { CalendarDateFormatter } from './calendar-date-formatter';\nimport { CALENDAR_CONFIG, CalendarConfig, DEFAULT_CALENDAR_CONFIG } from '../models/calendar-config.model';\n\n/**\n * Default implementation of {@link CalendarDateFormatter} that uses the\n * browser's `Intl.DateTimeFormat` API for locale-aware formatting.\n *\n * The locale is read from the injected {@link CALENDAR_CONFIG}. If no config\n * is provided, `'en-US'` is used as the fallback.\n *\n * This service has no dependency on `@ngx-translate` or any other i18n library,\n * so the calendar library works out of the box. Consumers can replace it with\n * their own implementation via the `CALENDAR_DATE_FORMATTER` injection token.\n */\n@Injectable()\nexport class DefaultCalendarDateFormatter implements CalendarDateFormatter {\n private readonly locale: string;\n\n constructor() {\n const config = inject<CalendarConfig | null>(CALENDAR_CONFIG, {optional: true});\n\n this.locale = config?.locale ?? DEFAULT_CALENDAR_CONFIG.locale;\n }\n\n /** Formats an hour and minute pair into a locale time string (e.g. \"09:00 AM\"). */\n formatTimeI(hour: number, minute: number): Promise<string> {\n const date = new Date();\n date.setHours(hour, minute, 0, 0);\n return Promise.resolve(\n date.toLocaleTimeString(this.locale, { hour: '2-digit', minute: '2-digit' })\n );\n }\n\n /** Formats the time portion of a Date (e.g. \"2:30 PM\"). Returns empty string for undefined. */\n formatTime(date: Date | undefined): Promise<string> {\n if (!date) return Promise.resolve('');\n return Promise.resolve(\n date.toLocaleTimeString(this.locale, { hour: '2-digit', minute: '2-digit' })\n );\n }\n\n /** Formats a Date as a full date-time string (e.g. \"May 15, 2026, 02:30 PM\"). */\n formatDateTime(date: Date): Observable<string> {\n return of(\n date.toLocaleString(this.locale, {\n year: 'numeric', month: 'short', day: 'numeric',\n hour: '2-digit', minute: '2-digit'\n })\n );\n }\n\n /** Formats a Date as a date-only string (e.g. \"May 15, 2026\"). */\n formatDate(date: Date): Observable<string> {\n return of(\n date.toLocaleDateString(this.locale, {\n year: 'numeric', month: 'short', day: 'numeric'\n })\n );\n }\n\n /** Formats a Date as `YYYY-MM-DD` for use in `<input type=\"date\">` controls. */\n formatDateForFormControl(date: Date): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, '0');\n const d = String(date.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}`;\n }\n\n /** Returns `true` if both dates fall on the same calendar day. */\n isSameDay(date1: Date, date2: Date): boolean {\n return date1.getFullYear() === date2.getFullYear()\n && date1.getMonth() === date2.getMonth()\n && date1.getDate() === date2.getDate();\n }\n\n /** Formats a Date as \"Month Year\" (e.g. \"January 2026\"). */\n formatMonthName(date: Date): Promise<string> {\n return Promise.resolve(\n date.toLocaleString(this.locale, { month: 'long', year: 'numeric' })\n );\n }\n}\n","import {ChangeDetectorRef, Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Observable, Subject, takeUntil} from 'rxjs';\nimport {CalendarEvent} from '../../models/calendar-event.model';\nimport {\n CalendarConfig,\n DEFAULT_CALENDAR_CONFIG,\n MonthItem,\n resolveCalendarConfig\n} from '../../models/calendar-config.model';\nimport {CalendarDateFormatter} from '../../services/calendar-date-formatter';\nimport {DefaultCalendarDateFormatter} from '../../services/default-calendar-date-formatter';\nimport {MnLanguageService} from '../../../../language';\n\n/**\n * Month grid view showing a 7×6 grid of day cells.\n *\n * Each cell displays the day number and up to 3 coloured dots representing\n * events on that day. Clicking a cell emits `dayClicked`.\n */\n@Component({\n selector: 'mn-calendar-month',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './calendar-month.component.html',\n})\nexport class CalendarMonthComponent implements OnInit, OnDestroy {\n private readonly lang = inject(MnLanguageService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /**\n * Accessible name for this control. Resolved through the conventional\n * `mnCalendar.monthView` key so an app can translate it, falling back to English when the\n * key is not defined rather than leaking the raw key into the UI.\n */\n get monthViewLabel(): string {\n return this.lang.translateIfPresent('mnCalendar.monthView') ?? 'Month view';\n }\n\n /** The date whose month is displayed. */\n @Input() focusDay!: Date;\n /** Observable that emits the full event list whenever it changes. */\n @Input() eventsChanged!: Observable<CalendarEvent[]>;\n /** Observable that emits when the focus day changes. */\n @Input() focusDayChanged!: Observable<Date>;\n /** Resolved calendar configuration passed from the parent view. */\n @Input() config?: CalendarConfig;\n /** Emits the date of a clicked day cell. */\n @Output() dayClicked = new EventEmitter<Date>();\n\n monthItems: MonthItem[] = [];\n /** Short weekday column headers (e.g. \"Mon\"), kept compact for the narrow columns. */\n weekdayLabels: string[];\n /** Word shown after the \"+N\" overflow count (e.g. \"more\"), from config. */\n moreEventsLabel = DEFAULT_CALENDAR_CONFIG.moreEventsLabel;\n\n private events: CalendarEvent[] = [];\n private destroy$ = new Subject<void>();\n private formatter: CalendarDateFormatter;\n\n constructor() {\n this.formatter = new DefaultCalendarDateFormatter();\n this.weekdayLabels = DEFAULT_CALENDAR_CONFIG.shortDayNames;\n }\n\n ngOnInit() {\n const resolved = this.config ? resolveCalendarConfig(this.config) : { ...DEFAULT_CALENDAR_CONFIG };\n this.weekdayLabels = resolved.shortDayNames;\n this.moreEventsLabel = resolved.moreEventsLabel;\n this.buildMonth();\n\n // Both subscriptions mark the view: the grid is rebuilt into plain fields, so in a zoneless\n // app nothing else tells Angular this component has to be re-rendered. Without it a month\n // whose events arrive from a stream — a fetch, a parent seeding its list — stays blank until\n // some unrelated interaction happens to trigger change detection.\n if (this.eventsChanged) {\n this.eventsChanged.pipe(takeUntil(this.destroy$)).subscribe(events => {\n this.events = events;\n this.buildMonth();\n this.cdr.markForCheck();\n });\n }\n\n if (this.focusDayChanged) {\n this.focusDayChanged.pipe(takeUntil(this.destroy$)).subscribe(date => {\n this.focusDay = date;\n this.buildMonth();\n this.cdr.markForCheck();\n });\n }\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /** Emits the clicked day's date. */\n onDayClick(date: Date) {\n this.dayClicked.emit(date);\n }\n\n /** trackBy for day name headers. */\n trackByDayName(index: number): number {\n return index;\n }\n\n /** trackBy for month grid cells. */\n trackByMonthItem(_index: number, item: MonthItem): number {\n return item.date.getTime();\n }\n\n /** trackBy for event dots. */\n trackByEventDot(_index: number, event: CalendarEvent): string {\n return event.id;\n }\n\n /** Builds the 42-cell month grid (6 rows × 7 columns). */\n private buildMonth() {\n if (!this.focusDay) return;\n\n const year = this.focusDay.getFullYear();\n const month = this.focusDay.getMonth();\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n\n let startOffset = firstDay.getDay() - 1;\n if (startOffset < 0) startOffset = 6;\n\n const today = new Date();\n this.monthItems = [];\n\n for (let i = startOffset - 1; i >= 0; i--) {\n const date = new Date(year, month, -i);\n this.monthItems.push(this.createMonthItem(date, false, today));\n }\n\n for (let d = 1; d <= lastDay.getDate(); d++) {\n const date = new Date(year, month, d);\n this.monthItems.push(this.createMonthItem(date, true, today));\n }\n\n const remaining = 42 - this.monthItems.length;\n for (let i = 1; i <= remaining; i++) {\n const date = new Date(year, month + 1, i);\n this.monthItems.push(this.createMonthItem(date, false, today));\n }\n }\n\n private createMonthItem(date: Date, isCurrentMonth: boolean, today: Date): MonthItem {\n const isToday = this.formatter.isSameDay(date, today);\n const dayEvents = this.events.filter(e =>\n this.formatter.isSameDay(e.startTime, date) ||\n this.formatter.isSameDay(e.endTime, date) ||\n (e.startTime < date && e.endTime > date)\n );\n\n return {\n date,\n dayNumber: date.getDate(),\n isCurrentMonth,\n isToday,\n events: dayEvents\n };\n }\n}\n","<!-- 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.secondaryColor\"\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","import { Injectable } from '@angular/core';\nimport { CalendarEvent } from '../models/calendar-event.model';\n\n/**\n * Service that computes the visual layout of calendar events within a\n * time-grid (week or day view).\n *\n * Responsibilities:\n * - Splitting multi-day events into per-day segments.\n * - Assigning non-overlapping column indices to concurrent events.\n * - Computing the width (column span) each event should occupy.\n *\n * This service is stateless — all state is passed via method parameters.\n * Provide it per-component (not root) so each view gets its own instance.\n */\n@Injectable()\nexport class CalendarEventLayoutService {\n\n /**\n * Returns `true` when two time ranges overlap (exclusive boundaries).\n */\n eventsOverlap(startA: Date, endA: Date, startB: Date, endB: Date): boolean {\n return startA < endB && startB < endA;\n }\n\n /**\n * Returns all events whose time range overlaps the given `[start, end)` window.\n */\n getAllEventsOnSpecificTime(events: CalendarEvent[], start: Date, end: Date): CalendarEvent[] {\n return events.filter(e =>\n this.eventsOverlap(e.startTime, e.endTime, start, end)\n );\n }\n\n /**\n * Splits multi-day events into per-day segments that fit within the\n * visible hour range (`startHour`–`endHour`) and date range.\n *\n * Single-day events are shallow-copied as-is. Multi-day events produce\n * one segment per day with `continued` / `continuedEnd` flags set.\n */\n calculateMultiDayEvents(\n events: CalendarEvent[],\n startHour: number,\n endHour: number,\n rangeStart: Date,\n rangeEnd: Date\n ): CalendarEvent[] {\n const result: CalendarEvent[] = [];\n\n for (const event of events) {\n const eventStart = new Date(event.startTime);\n const eventEnd = new Date(event.endTime);\n\n if (eventStart.toDateString() === eventEnd.toDateString()) {\n result.push({ ...event });\n continue;\n }\n\n const current = new Date(eventStart);\n let isFirst = true;\n\n while (current < eventEnd && current < rangeEnd) {\n if (current >= rangeStart) {\n const dayStart = new Date(current);\n const dayEnd = new Date(current);\n\n if (isFirst) {\n dayEnd.setHours(endHour, 0, 0, 0);\n } else {\n dayStart.setHours(startHour, 0, 0, 0);\n if (current.toDateString() === eventEnd.toDateString()) {\n dayEnd.setHours(eventEnd.getHours(), eventEnd.getMinutes(), 0, 0);\n } else {\n dayEnd.setHours(endHour, 0, 0, 0);\n }\n }\n\n result.push({\n ...event,\n startTime: isFirst ? eventStart : dayStart,\n endTime: current.toDateString() === eventEnd.toDateString() ? eventEnd : dayEnd,\n continued: !isFirst,\n continuedEnd: current.toDateString() !== eventEnd.toDateString()\n });\n }\n\n isFirst = false;\n current.setDate(current.getDate() + 1);\n current.setHours(0, 0, 0, 0);\n }\n }\n\n return result;\n }\n\n /**\n * Assigns a zero-based `column` index to each event so that overlapping\n * events occupy different columns.\n *\n * Events are processed in start-time order (longest duration first for ties).\n * Each event gets the earliest column not already occupied by an overlapping event.\n */\n assignColumnsToEvents(events: CalendarEvent[]): void {\n const sorted = [...events].sort((a, b) => {\n const diff = a.startTime.getTime() - b.startTime.getTime();\n if (diff !== 0) return diff;\n return (b.endTime.getTime() - b.startTime.getTime()) - (a.endTime.getTime() - a.startTime.getTime());\n });\n\n for (const event of sorted) {\n event.column = this.findEarliestPossibleColumn(event, sorted);\n }\n }\n\n /**\n * Assigns a `width` (column span) to each event, expanding it to fill\n * unused columns to its right within the overlapping group.\n */\n assignWidthsToEvents(events: CalendarEvent[], scanStart: Date, scanEnd: Date): void {\n for (const event of events) {\n const overlapping = this.getAllEventsOnSpecificTime(events, event.startTime, event.endTime);\n const maxCol = Math.max(...overlapping.map(e => e.column ?? 0));\n const biggestPossible = this.findBiggestPossibleWidth(event, events, scanStart, scanEnd);\n event.width = Math.max(1, biggestPossible);\n\n if ((event.column ?? 0) + event.width > maxCol + 1) {\n event.width = maxCol + 1 - (event.column ?? 0);\n }\n if (event.width < 1) event.width = 1;\n }\n }\n\n /** Finds the lowest column index not occupied by any overlapping event. */\n private findEarliestPossibleColumn(event: CalendarEvent, allEvents: CalendarEvent[]): number {\n const overlapping = allEvents.filter(e =>\n e !== event\n && e.column !== undefined\n && this.eventsOverlap(e.startTime, e.endTime, event.startTime, event.endTime)\n );\n\n let column = 0;\n while (overlapping.some(e => e.column === column)) {\n column++;\n }\n return column;\n }\n\n /** Computes the maximum width an event can span without overlapping a neighbour to its right. */\n private findBiggestPossibleWidth(\n event: CalendarEvent,\n allEvents: CalendarEvent[],\n _scanStart: Date,\n _scanEnd: Date\n ): number {\n const overlapping = this.getAllEventsOnSpecificTime(allEvents, event.startTime, event.endTime);\n const maxCol = Math.max(...overlapping.map(e => e.column ?? 0));\n const totalColumns = maxCol + 1;\n\n const occupiedCols = overlapping\n .filter(e => e !== event && (e.column ?? 0) > (event.column ?? 0))\n .map(e => e.column ?? 0);\n\n if (occupiedCols.length === 0) {\n return totalColumns - (event.column ?? 0);\n }\n\n return Math.min(...occupiedCols) - (event.column ?? 0);\n }\n}\n","/**\n * Static utility methods for calendar grid positioning.\n */\nexport class CalendarUtility {\n /**\n * Converts a weekday (from `Date.getDay()`) to a 1-based Monday-first column index.\n * Monday = 1, Tuesday = 2, …, Sunday = 7.\n */\n static getCorrectColumn(date: Date): number {\n const day = date.getDay();\n return day === 0 ? 7 : day;\n }\n\n /**\n * Converts an hour + minute pair to a 1-based CSS grid row index\n * within a half-hour grid starting at `startHour`.\n *\n * Each hour occupies two rows (one per 30-minute slot).\n * Formula: `(hour - startHour) * 2 + (minute >= 30 ? 1 : 0) + 1`\n *\n * @returns Grid row number (minimum 1).\n */\n static getCorrectRow(hour: number, minute: number, startHour: number): number {\n const hourOffset = hour - startHour;\n const row = hourOffset * 2 + (minute >= 30 ? 1 : 0) + 1;\n return Math.max(1, row);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n/**\n * Abstraction for date/time formatting used by calendar components.\n *\n * The library ships a default implementation ({@link DefaultCalendarDateFormatter})\n * that uses `Intl.DateTimeFormat`. Consumers can provide their own implementation\n * (e.g. wrapping `@ngx-translate`) via the {@link CALENDAR_DATE_FORMATTER} token.\n *\n * Locale-independent settings (day names, view labels, \"Today\" label) have been\n * moved to {@link CalendarConfig} so they can be configured declaratively.\n */\nexport type CalendarDateFormatter = {\n /** Formats an hour + minute pair (e.g. `9, 0` → `\"09:00 AM\"`). */\n formatTimeI(hour: number, minute: number): Promise<string>;\n /** Formats the time portion of a Date. Returns `''` for `undefined`. */\n formatTime(date: Date | undefined): Promise<string>;\n /** Formats a full date-time string as an Observable. */\n formatDateTime(date: Date): Observable<string>;\n /** Formats a date-only string as an Observable. */\n formatDate(date: Date): Observable<string>;\n /** Formats a Date as `YYYY-MM-DD` for `<input type=\"date\">`. */\n formatDateForFormControl(date: Date): string;\n /** Returns `true` when both dates fall on the same calendar day. */\n isSameDay(date1: Date, date2: Date): boolean;\n /** Formats a Date as \"Month Year\" (e.g. \"January 2026\"). */\n formatMonthName(date: Date): Promise<string>;\n}\n\n/**\n * Injection token for the calendar date formatter.\n *\n * @example\n * ```ts\n * providers: [\n * { provide: CALENDAR_DATE_FORMATTER, useClass: MyCustomFormatter }\n * ]\n * ```\n */\nexport const CALENDAR_DATE_FORMATTER = new InjectionToken<CalendarDateFormatter>('CalendarDateFormatter');\n","import {ChangeDetectorRef, Component, OnInit, inject} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { CalendarEventData } from '../../models/calendar-event-data.model';\nimport { CalendarEvent } from '../../models/calendar-event.model';\nimport { CALENDAR_DATE_FORMATTER, CalendarDateFormatter } from '../../services/calendar-date-formatter';\nimport { DefaultCalendarDateFormatter } from '../../services/default-calendar-date-formatter';\n\n/**\n * Default event renderer used when no custom component is provided.\n *\n * Displays the event title, formatted time range, and optional description\n * with the event's colour scheme applied as background and left-border accent.\n */\n@Component({\n selector: 'mn-calendar-event-default',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './calendar-event-default.component.html',\n})\nexport class CalendarEventDefaultComponent implements CalendarEventData, OnInit {\n private cdr = inject(ChangeDetectorRef);\n\n /** The event to render. Set by {@link CalendarEventComponent} after creation. */\n event!: CalendarEvent;\n formattedTime = '';\n\n private formatter: CalendarDateFormatter;\n\n constructor() {\n const formatter = inject<CalendarDateFormatter | null>(CALENDAR_DATE_FORMATTER, {optional: true});\n\n this.formatter = formatter ?? new DefaultCalendarDateFormatter();\n }\n\n async ngOnInit() {\n if (this.event) {\n const start = await this.formatter.formatTime(this.event.startTime);\n const end = await this.formatter.formatTime(this.event.endTime);\n this.formattedTime = `${start} - ${end}`;\n this.cdr.markForCheck();\n }\n }\n}\n","<!-- 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.secondaryColor\"\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","import {\n Component, Input, Output, EventEmitter, ViewChild, ViewContainerRef,\n AfterViewInit, Type, OnChanges, SimpleChanges\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { CalendarEvent } from '../../models/calendar-event.model';\nimport { CalendarEventData } from '../../models/calendar-event-data.model';\nimport { CalendarEventDefaultComponent } from '../calendar-event-default/calendar-event-default.component';\n\n/**\n * Dynamic event renderer that injects a custom or default event component\n * into its view container.\n *\n * The component to render is resolved in this order:\n * 1. `customComponent` input (set on the parent week/day view)\n * 2. `event.component` (per-event override)\n * 3. {@link CalendarEventDefaultComponent} (library default)\n */\n@Component({\n selector: 'mn-calendar-event',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './calendar-event.component.html',\n})\nexport class CalendarEventComponent implements AfterViewInit, OnChanges {\n /** The event data to render. */\n @Input() event!: CalendarEvent;\n /** Optional custom component type that overrides the default renderer. */\n @Input() customComponent?: Type<CalendarEventData>;\n /** Emits when the rendered event is clicked. */\n @Output() eventClicked = new EventEmitter<CalendarEvent>();\n\n @ViewChild('eventContainer', { read: ViewContainerRef, static: true }) eventContainer!: ViewContainerRef;\n\n private rendered = false;\n\n ngAfterViewInit() {\n this.renderComponent();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (this.rendered && (changes['event'] || changes['customComponent'])) {\n this.renderComponent();\n }\n }\n\n /** Emits the event click. */\n onEventClick() {\n this.eventClicked.emit(this.event);\n }\n\n /** Creates the event component dynamically and sets its `event` property. */\n private renderComponent() {\n if (!this.eventContainer) return;\n this.eventContainer.clear();\n const component = this.customComponent ?? this.event?.component ?? CalendarEventDefaultComponent;\n const ref = this.eventContainer.createComponent(component);\n (ref.instance as CalendarEventData).event = this.event;\n ref.changeDetectorRef.detectChanges();\n this.rendered = true;\n }\n}\n","<!-- Host for the dynamically-rendered event component. Click/keyboard handling and\n the focus ring live on the week/day event wrapper, so this stays presentational\n to avoid a second, redundant tab stop per event. -->\n<div class=\"h-full w-full\">\n <ng-template #eventContainer></ng-template>\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Type\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Observable, Subject, takeUntil} from 'rxjs';\nimport {CalendarEvent} from '../../models/calendar-event.model';\nimport {CalendarEventData} from '../../models/calendar-event-data.model';\nimport {\n CalendarConfig,\n ColumnDay,\n DEFAULT_CALENDAR_CONFIG,\n HourRow,\n resolveCalendarConfig\n} from '../../models/calendar-config.model';\nimport {CalendarDateFormatter} from '../../services/calendar-date-formatter';\nimport {DefaultCalendarDateFormatter} from '../../services/default-calendar-date-formatter';\nimport {CalendarEventLayoutService} from '../../services/calendar-event-layout.service';\nimport {CalendarUtility} from '../../utils/calendar-utils';\nimport {CalendarEventComponent} from '../calendar-event/calendar-event.component';\nimport {MnLanguageService} from '../../../../language';\n\n/** Extended hour row with a pre-resolved display label. */\ntype DisplayHourRow = {\n hourLabel: string;\n} & HourRow\n\n/**\n * Week grid view showing 7 day columns with half-hour time slots.\n *\n * Overlapping events within the same day are laid out in sub-columns\n * so they appear side-by-side rather than stacked.\n */\n@Component({\n selector: 'mn-calendar-week',\n standalone: true,\n imports: [CommonModule, CalendarEventComponent],\n templateUrl: './calendar-week.component.html',\n providers: [CalendarEventLayoutService],\n})\nexport class CalendarWeekComponent implements OnInit, OnDestroy {\n private readonly lang = inject(MnLanguageService);\n\n /**\n * Accessible name for this control. Resolved through the conventional\n * `mnCalendar.weekView` key so an app can translate it, falling back to English when the\n * key is not defined rather than leaking the raw key into the UI.\n */\n get weekViewLabel(): string {\n return this.lang.translateIfPresent('mnCalendar.weekView') ?? 'Week view';\n }\n\n private layoutService = inject(CalendarEventLayoutService);\n private cdr = inject(ChangeDetectorRef);\n\n /** The date around which the week is centred. */\n @Input() focusDay!: Date;\n /** Observable that emits the full event list whenever it changes. */\n @Input() eventsChanged!: Observable<CalendarEvent[]>;\n /** Observable that emits when the focus day changes. */\n @Input() focusDayChanged!: Observable<Date>;\n /** Resolved calendar configuration passed from the parent view. */\n @Input() config?: CalendarConfig;\n /** Optional custom event renderer component. */\n @Input() calendarEventComponent?: Type<CalendarEventData>;\n /** Emits when a calendar event is clicked. */\n @Output() eventClicked = new EventEmitter<CalendarEvent>();\n\n columns: ColumnDay[] = [];\n hourRows: DisplayHourRow[] = [];\n displayEvents: CalendarEvent[] = [];\n totalRows = 0;\n currentTimeRow = 0;\n currentTimeCol = '';\n /** The current time, formatted for the label riding the now-line. */\n currentTimeLabel = '';\n gridTemplateColumns = 'repeat(7, 1fr)';\n\n private dayColumnMap: { subColumns: number; startCol: number }[] = [];\n private events: CalendarEvent[] = [];\n private destroy$ = new Subject<void>();\n private formatter: CalendarDateFormatter;\n private resolvedConfig!: CalendarConfig;\n private currentTimeInterval?: ReturnType<typeof setInterval>;\n\n constructor() {\n this.formatter = new DefaultCalendarDateFormatter();\n }\n\n ngOnInit() {\n this.resolvedConfig = this.config ? resolveCalendarConfig(this.config) : { ...DEFAULT_CALENDAR_CONFIG };\n this.buildColumns();\n this.updateCurrentTime();\n this.currentTimeInterval = setInterval(() => this.updateCurrentTime(), 60000);\n\n if (this.eventsChanged) {\n this.eventsChanged.pipe(takeUntil(this.destroy$)).subscribe(events => {\n this.events = events;\n this.refreshEvents();\n this.cdr.markForCheck();\n });\n }\n\n if (this.focusDayChanged) {\n this.focusDayChanged.pipe(takeUntil(this.destroy$)).subscribe(date => {\n this.focusDay = date;\n this.buildColumns();\n this.refreshEvents();\n this.updateCurrentTime();\n this.cdr.markForCheck();\n });\n }\n\n // Build hour rows asynchronously (formatTimeI returns a Promise).\n this.buildHourRows().then(() => this.cdr.markForCheck());\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.currentTimeInterval) clearInterval(this.currentTimeInterval);\n }\n\n /** Returns the CSS `grid-row` value for an event based on its start/end times. */\n getEventRow(event: CalendarEvent): string {\n const startRow = CalendarUtility.getCorrectRow(\n event.startTime.getHours(), event.startTime.getMinutes(), this.resolvedConfig.startHour\n );\n const endRow = CalendarUtility.getCorrectRow(\n event.endTime.getHours(), event.endTime.getMinutes(), this.resolvedConfig.startHour\n );\n return `${startRow} / ${Math.max(endRow, startRow + 1)}`;\n }\n\n /** Returns the CSS `grid-column` span for a day header, accounting for sub-columns. */\n getHeaderColumn(dayIndex: number): string {\n if (!this.dayColumnMap.length) return `${dayIndex + 2} / span 1`;\n const dayInfo = this.dayColumnMap[dayIndex];\n return `${dayInfo.startCol + 1} / span ${dayInfo.subColumns}`;\n }\n\n /** Returns the CSS `grid-column` value for an event within its day's sub-columns. */\n getEventColumn(event: CalendarEvent): string {\n const dayIdx = this.columns.findIndex(c => this.formatter.isSameDay(c.date, event.startTime));\n if (dayIdx < 0) return '1 / span 1';\n const dayInfo = this.dayColumnMap[dayIdx];\n const subCol = (event.column ?? 0) + dayInfo.startCol;\n const width = event.width ?? 1;\n return `${subCol} / span ${width}`;\n }\n\n /** Forwards event click to parent. */\n onEventClick(event: CalendarEvent) {\n this.eventClicked.emit(event);\n }\n\n /** trackBy for hour rows. */\n trackByHour(_index: number, row: DisplayHourRow): number {\n return row.hour;\n }\n\n /** trackBy for day columns. */\n trackByColumn(_index: number, col: ColumnDay): number {\n return col.date.getTime();\n }\n\n /** trackBy for events. */\n trackByEvent(_index: number, event: CalendarEvent): string {\n return event.id;\n }\n\n private async buildHourRows() {\n const hours = this.resolvedConfig.endHour - this.resolvedConfig.startHour;\n this.totalRows = hours * 2;\n\n const rows: DisplayHourRow[] = [];\n for (let i = 0; i < hours; i++) {\n const hour = this.resolvedConfig.startHour + i;\n const label = await this.formatter.formatTimeI(hour, 0);\n rows.push({\n hour,\n topRow: i * 2 + 1,\n bottomRow: i * 2 + 3,\n hourLabel: label\n });\n }\n this.hourRows = rows;\n }\n\n /** Builds the 7 day columns for the current week (Monday–Sunday). */\n private buildColumns() {\n if (!this.focusDay) return;\n\n const shortNames = this.resolvedConfig.shortDayNames;\n const today = new Date();\n\n const day = this.focusDay.getDay();\n const mondayOffset = day === 0 ? -6 : 1 - day;\n const monday = new Date(this.focusDay);\n monday.setDate(this.focusDay.getDate() + mondayOffset);\n\n this.columns = [];\n for (let i = 0; i < 7; i++) {\n const date = new Date(monday);\n date.setDate(monday.getDate() + i);\n this.columns.push({\n date,\n dayName: shortNames[i],\n dayNumber: date.getDate(),\n isToday: this.formatter.isSameDay(date, today)\n });\n }\n }\n\n /** Filters, splits, and lays out events for the current week. */\n private refreshEvents() {\n if (!this.columns.length) return;\n\n const rangeStart = this.columns[0].date;\n const rangeEnd = new Date(this.columns[6].date);\n rangeEnd.setHours(23, 59, 59, 999);\n\n const filtered = this.events.filter(e =>\n this.layoutService.eventsOverlap(e.startTime, e.endTime, rangeStart, rangeEnd)\n );\n\n this.displayEvents = this.layoutService.calculateMultiDayEvents(\n filtered, this.resolvedConfig.startHour, this.resolvedConfig.endHour, rangeStart, rangeEnd\n );\n\n // Assign columns per day so overlapping events within a day get sub-columns\n for (let i = 0; i < 7; i++) {\n const dayStart = new Date(this.columns[i].date);\n dayStart.setHours(0, 0, 0, 0);\n const dayEnd = new Date(this.columns[i].date);\n dayEnd.setHours(23, 59, 59, 999);\n\n const dayEvents = this.displayEvents.filter(e =>\n this.formatter.isSameDay(e.startTime, this.columns[i].date)\n );\n\n this.layoutService.assignColumnsToEvents(dayEvents);\n this.layoutService.assignWidthsToEvents(dayEvents, dayStart, dayEnd);\n }\n\n this.buildGridColumns();\n this.updateCurrentTime();\n }\n\n /** Computes the CSS grid-template-columns string based on per-day sub-column counts. */\n private buildGridColumns() {\n this.dayColumnMap = [];\n let currentCol = 1;\n\n for (let i = 0; i < 7; i++) {\n const dayEvents = this.displayEvents.filter(e =>\n this.formatter.isSameDay(e.startTime, this.columns[i].date)\n );\n\n let maxSubCols = 1;\n for (const e of dayEvents) {\n maxSubCols = Math.max(maxSubCols, (e.column ?? 0) + (e.width ?? 1));\n }\n\n this.dayColumnMap.push({ subColumns: maxSubCols, startCol: currentCol });\n currentCol += maxSubCols;\n }\n\n const parts: string[] = [];\n for (const day of this.dayColumnMap) {\n for (let j = 0; j < day.subColumns; j++) {\n parts.push(`${1 / day.subColumns}fr`);\n }\n }\n this.gridTemplateColumns = parts.join(' ');\n }\n\n /** Updates the current-time red line position. */\n private updateCurrentTime() {\n const now = new Date();\n const dayIdx = this.columns.findIndex(c => this.formatter.isSameDay(c.date, now));\n if (dayIdx >= 0 && this.dayColumnMap.length > 0) {\n const dayInfo = this.dayColumnMap[dayIdx];\n this.currentTimeCol = `${dayInfo.startCol} / span ${dayInfo.subColumns}`;\n this.currentTimeRow = CalendarUtility.getCorrectRow(now.getHours(), now.getMinutes(), this.resolvedConfig.startHour);\n // formatTime is async; refresh the label and re-render when it resolves.\n this.formatter.formatTime(now).then(label => {\n this.currentTimeLabel = label;\n this.cdr.markForCheck();\n });\n } else {\n this.currentTimeCol = '';\n this.currentTimeRow = 0;\n this.currentTimeLabel = '';\n }\n }\n}\n","<!-- Week grid. Hour rules are quiet hairlines; today's column header is a tinted\n number (no fill); the current time is a line carrying a small time bubble.\n Dynamic row/column placement stays inline — the layout maths lives in TS. -->\n<div [attr.aria-label]=\"weekViewLabel\" class=\"w-full h-full flex flex-col overflow-hidden\" role=\"grid\">\n <div class=\"grid\" [style.grid-template-columns]=\"'60px ' + gridTemplateColumns\">\n <div></div>\n @for (col of columns; track col.dayName; let i = $index) {\n <div class=\"py-2 px-1 text-center\"\n [style.grid-column]=\"getHeaderColumn(i)\"\n role=\"columnheader\">\n <span class=\"block text-[11px] font-semibold uppercase tracking-wide opacity-50\">{{ col.dayName }}</span>\n <span class=\"text-lg font-bold tabular-nums\" [class.text-primary]=\"col.isToday\">{{ col.dayNumber }}</span>\n </div>\n }\n </div>\n <div class=\"grid grid-cols-[60px_1fr] flex-1 min-h-0 overflow-hidden items-stretch\">\n <div class=\"grid h-full min-h-0\" [style.grid-template-rows]=\"'repeat(' + totalRows + ', minmax(1.5rem, 1fr))'\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"flex items-start justify-end min-h-0 overflow-hidden pr-2 text-[11px] tabular-nums opacity-50\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\">\n {{ row.hourLabel }}\n </div>\n }\n </div>\n <div class=\"grid relative auto-rows-fr h-full min-h-0\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', minmax(1.5rem, 1fr))'\"\n [style.grid-template-columns]=\"gridTemplateColumns\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"border-t border-base-200 pointer-events-none min-h-0\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\"\n [style.grid-column]=\"'1 / -1'\">\n </div>\n }\n @if (currentTimeRow > 0 && currentTimeCol) {\n <div class=\"relative z-[2] pointer-events-none\"\n [style.grid-row]=\"currentTimeRow\"\n [style.grid-column]=\"currentTimeCol\">\n <div class=\"absolute -left-1 -top-1 h-2 w-2 rounded-full bg-error\"></div>\n <div class=\"h-0.5 w-full bg-error\"></div>\n <div class=\"absolute left-0 top-0 -translate-x-2 -translate-y-1/2 rounded-full bg-error px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-error-content shadow\">{{ currentTimeLabel }}</div>\n </div>\n }\n @for (event of displayEvents; track $index) {\n <div class=\"z-[1] min-h-0 overflow-hidden rounded-lg p-0.5 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary\"\n [style.grid-row]=\"getEventRow(event)\"\n [style.grid-column]=\"getEventColumn(event)\"\n (click)=\"onEventClick(event)\"\n (keyup.enter)=\"onEventClick(event)\"\n tabindex=\"0\">\n <mn-calendar-event [customComponent]=\"calendarEventComponent\" [event]=\"event\"></mn-calendar-event>\n </div>\n }\n </div>\n </div>\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Type\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Observable, Subject, takeUntil} from 'rxjs';\nimport {CalendarEvent} from '../../models/calendar-event.model';\nimport {CalendarEventData} from '../../models/calendar-event-data.model';\nimport {\n CalendarConfig,\n DEFAULT_CALENDAR_CONFIG,\n HourRow,\n resolveCalendarConfig\n} from '../../models/calendar-config.model';\nimport {CalendarDateFormatter} from '../../services/calendar-date-formatter';\nimport {DefaultCalendarDateFormatter} from '../../services/default-calendar-date-formatter';\nimport {CalendarEventLayoutService} from '../../services/calendar-event-layout.service';\nimport {CalendarUtility} from '../../utils/calendar-utils';\nimport {CalendarEventComponent} from '../calendar-event/calendar-event.component';\nimport {MnLanguageService} from '../../../../language';\n\n/** Extended hour row with a pre-resolved display label. */\ntype DisplayHourRow = {\n hourLabel: string;\n} & HourRow\n\n/**\n * Day grid view showing a single day with half-hour time slots.\n *\n * Shares the same layout algorithm as the week view via\n * {@link CalendarEventLayoutService}.\n */\n@Component({\n selector: 'mn-calendar-day',\n standalone: true,\n imports: [CommonModule, CalendarEventComponent],\n templateUrl: './calendar-day.component.html',\n providers: [CalendarEventLayoutService],\n})\nexport class CalendarDayComponent implements OnInit, OnDestroy {\n private readonly lang = inject(MnLanguageService);\n\n /**\n * Accessible name for this control. Resolved through the conventional\n * `mnCalendar.dayView` key so an app can translate it, falling back to English when the\n * key is not defined rather than leaking the raw key into the UI.\n */\n get dayViewLabel(): string {\n return this.lang.translateIfPresent('mnCalendar.dayView') ?? 'Day view';\n }\n\n private layoutService = inject(CalendarEventLayoutService);\n private cdr = inject(ChangeDetectorRef);\n\n /** The date to display. */\n @Input() focusDay!: Date;\n /** Observable that emits the full event list whenever it changes. */\n @Input() eventsChanged!: Observable<CalendarEvent[]>;\n /** Observable that emits when the focus day changes. */\n @Input() focusDayChanged!: Observable<Date>;\n /** Resolved calendar configuration passed from the parent view. */\n @Input() config?: CalendarConfig;\n /** Optional custom event renderer component. */\n @Input() calendarEventComponent?: Type<CalendarEventData>;\n /** Emits when a calendar event is clicked. */\n @Output() eventClicked = new EventEmitter<CalendarEvent>();\n\n hourRows: DisplayHourRow[] = [];\n displayEvents: CalendarEvent[] = [];\n totalRows = 0;\n totalColumns = 1;\n currentTimeRow = 0;\n /** The current time, formatted for the label riding the now-line. */\n currentTimeLabel = '';\n isToday = false;\n dayName = '';\n\n private events: CalendarEvent[] = [];\n private destroy$ = new Subject<void>();\n private formatter: CalendarDateFormatter;\n private resolvedConfig!: CalendarConfig;\n private currentTimeInterval?: ReturnType<typeof setInterval>;\n\n constructor() {\n this.formatter = new DefaultCalendarDateFormatter();\n }\n\n ngOnInit() {\n this.resolvedConfig = this.config ? resolveCalendarConfig(this.config) : { ...DEFAULT_CALENDAR_CONFIG };\n this.updateDayInfo();\n this.updateCurrentTime();\n this.currentTimeInterval = setInterval(() => this.updateCurrentTime(), 60000);\n\n if (this.eventsChanged) {\n this.eventsChanged.pipe(takeUntil(this.destroy$)).subscribe(events => {\n this.events = events;\n this.refreshEvents();\n this.cdr.markForCheck();\n });\n }\n\n if (this.focusDayChanged) {\n this.focusDayChanged.pipe(takeUntil(this.destroy$)).subscribe(date => {\n this.focusDay = date;\n this.updateDayInfo();\n this.refreshEvents();\n this.updateCurrentTime();\n this.cdr.markForCheck();\n });\n }\n\n // Build hour rows asynchronously (formatTimeI returns a Promise).\n this.buildHourRows().then(() => this.cdr.markForCheck());\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.currentTimeInterval) clearInterval(this.currentTimeInterval);\n }\n\n /** Returns the CSS `grid-row` value for an event. */\n getEventRow(event: CalendarEvent): string {\n const startRow = CalendarUtility.getCorrectRow(\n event.startTime.getHours(), event.startTime.getMinutes(), this.resolvedConfig.startHour\n );\n const endRow = CalendarUtility.getCorrectRow(\n event.endTime.getHours(), event.endTime.getMinutes(), this.resolvedConfig.startHour\n );\n return `${startRow} / ${Math.max(endRow, startRow + 1)}`;\n }\n\n /** Returns the CSS `grid-column` value for an event within its sub-columns. */\n getEventColumn(event: CalendarEvent): string {\n const col = (event.column ?? 0) + 1;\n const width = event.width ?? 1;\n return `${col} / span ${width}`;\n }\n\n /** Forwards event click to parent. */\n onEventClick(event: CalendarEvent) {\n this.eventClicked.emit(event);\n }\n\n /** trackBy for hour rows. */\n trackByHour(_index: number, row: DisplayHourRow): number {\n return row.hour;\n }\n\n /** trackBy for events. */\n trackByEvent(_index: number, event: CalendarEvent): string {\n return event.id;\n }\n\n private async buildHourRows() {\n const hours = this.resolvedConfig.endHour - this.resolvedConfig.startHour;\n this.totalRows = hours * 2;\n\n const rows: DisplayHourRow[] = [];\n for (let i = 0; i < hours; i++) {\n const hour = this.resolvedConfig.startHour + i;\n const label = await this.formatter.formatTimeI(hour, 0);\n rows.push({\n hour,\n topRow: i * 2 + 1,\n bottomRow: i * 2 + 3,\n hourLabel: label\n });\n }\n this.hourRows = rows;\n }\n\n /** Updates the day name and isToday flag. */\n private updateDayInfo() {\n if (!this.focusDay) return;\n const today = new Date();\n this.isToday = this.formatter.isSameDay(this.focusDay, today);\n const longNames = this.resolvedConfig.longDayNames;\n const dayIdx = this.focusDay.getDay();\n const mondayIdx = dayIdx === 0 ? 6 : dayIdx - 1;\n this.dayName = longNames[mondayIdx];\n }\n\n /** Filters, splits, and lays out events for the focus day. */\n private refreshEvents() {\n if (!this.focusDay) return;\n\n const rangeStart = new Date(this.focusDay);\n rangeStart.setHours(0, 0, 0, 0);\n const rangeEnd = new Date(this.focusDay);\n rangeEnd.setHours(23, 59, 59, 999);\n\n const filtered = this.events.filter(e =>\n this.layoutService.eventsOverlap(e.startTime, e.endTime, rangeStart, rangeEnd)\n );\n\n this.displayEvents = this.layoutService.calculateMultiDayEvents(\n filtered, this.resolvedConfig.startHour, this.resolvedConfig.endHour, rangeStart, rangeEnd\n );\n\n this.layoutService.assignColumnsToEvents(this.displayEvents);\n this.layoutService.assignWidthsToEvents(this.displayEvents, rangeStart, rangeEnd);\n\n this.totalColumns = this.displayEvents.reduce((max, e) => Math.max(max, (e.column ?? 0) + (e.width ?? 1)), 1);\n }\n\n /** Updates the current-time red line position. */\n private updateCurrentTime() {\n const now = new Date();\n if (this.focusDay && this.formatter.isSameDay(this.focusDay, now)) {\n this.currentTimeRow = CalendarUtility.getCorrectRow(now.getHours(), now.getMinutes(), this.resolvedConfig.startHour);\n this.isToday = true;\n // formatTime is async; refresh the label and re-render when it resolves.\n this.formatter.formatTime(now).then(label => {\n this.currentTimeLabel = label;\n this.cdr.markForCheck();\n });\n } else {\n this.currentTimeRow = 0;\n this.isToday = false;\n this.currentTimeLabel = '';\n }\n }\n}\n","<!-- Day grid. One column, its header centered over that column (the toolbar\n already names the date). Today's number is tinted, not filled; the now-line\n carries a time bubble that overhangs into the gutter. -->\n<div [attr.aria-label]=\"dayViewLabel\" class=\"w-full h-full flex flex-col overflow-hidden\" role=\"grid\">\n <div class=\"grid grid-cols-[60px_1fr]\">\n <div></div>\n <div class=\"flex items-center justify-center gap-2 py-2 px-1\" role=\"columnheader\">\n <span class=\"text-[11px] font-semibold uppercase tracking-wide opacity-50\">{{ dayName }}</span>\n <span class=\"text-base font-bold tabular-nums\" [class.text-primary]=\"isToday\">{{ focusDay.getDate() }}</span>\n </div>\n </div>\n <div class=\"grid grid-cols-[60px_1fr] flex-1 min-h-0 overflow-hidden items-stretch\">\n <div class=\"grid h-full min-h-0\" [style.grid-template-rows]=\"'repeat(' + totalRows + ', minmax(1.5rem, 1fr))'\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"flex items-start justify-end min-h-0 overflow-hidden pr-2 text-[11px] tabular-nums opacity-50\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\">\n {{ row.hourLabel }}\n </div>\n }\n </div>\n <div class=\"grid relative auto-rows-fr h-full min-h-0\"\n [style.grid-template-rows]=\"'repeat(' + totalRows + ', minmax(1.5rem, 1fr))'\"\n [style.grid-template-columns]=\"'repeat(' + totalColumns + ', 1fr)'\">\n @for (row of hourRows; track row.topRow) {\n <div class=\"border-t border-base-200 pointer-events-none min-h-0\"\n [style.grid-row]=\"row.topRow + '/' + row.bottomRow\"\n [style.grid-column]=\"'1 / -1'\">\n </div>\n }\n @if (currentTimeRow > 0 && isToday) {\n <div class=\"relative z-[2] pointer-events-none\"\n [style.grid-row]=\"currentTimeRow\"\n [style.grid-column]=\"'1 / -1'\">\n <div class=\"absolute -left-1 -top-1 h-2 w-2 rounded-full bg-error\"></div>\n <div class=\"h-0.5 w-full bg-error\"></div>\n <div class=\"absolute left-0 top-0 -translate-x-2 -translate-y-1/2 rounded-full bg-error px-1.5 py-0.5 text-[10px] font-bold tabular-nums text-error-content shadow\">{{ currentTimeLabel }}</div>\n </div>\n }\n @for (event of displayEvents; track $index) {\n <div class=\"z-[1] min-h-0 overflow-hidden rounded-lg p-0.5 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-primary\"\n [style.grid-row]=\"getEventRow(event)\"\n [style.grid-column]=\"getEventColumn(event)\"\n (click)=\"onEventClick(event)\"\n (keyup.enter)=\"onEventClick(event)\"\n tabindex=\"0\">\n <mn-calendar-event [customComponent]=\"calendarEventComponent\" [event]=\"event\"></mn-calendar-event>\n </div>\n }\n </div>\n </div>\n</div>\n","import {Component, Input, OnInit, Output, EventEmitter, inject} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { CalendarEvent } from '../../models/calendar-event.model';\nimport { CALENDAR_DATE_FORMATTER, CalendarDateFormatter } from '../../services/calendar-date-formatter';\nimport { DefaultCalendarDateFormatter } from '../../services/default-calendar-date-formatter';\n\n/**\n * Renders a single row in the upcoming-events sidebar.\n * Shows the event title, formatted date/time, and optional description.\n */\n@Component({\n selector: 'mn-upcoming-event-row',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './upcoming-event-row.component.html',\n})\nexport class UpcomingEventRowComponent implements OnInit {\n /** The event to display. */\n @Input() event!: CalendarEvent;\n /** Emits the event when this row is clicked. */\n @Output() eventClicked = new EventEmitter<CalendarEvent>();\n\n formattedDate = '';\n\n private formatter: CalendarDateFormatter;\n\n constructor() {\n const formatter = inject<CalendarDateFormatter | null>(CALENDAR_DATE_FORMATTER, {optional: true});\n\n this.formatter = formatter ?? new DefaultCalendarDateFormatter();\n }\n\n async ngOnInit() {\n if (this.event) {\n const start = await this.formatter.formatTime(this.event.startTime);\n const end = await this.formatter.formatTime(this.event.endTime);\n this.formattedDate = `${start} - ${end}`;\n }\n }\n}\n","<!-- Sidebar row in the shared chip language: a colored rail from the event's own\n colour, a hover wash, and space-grouped content — no boxed borders. -->\n<div (click)=\"eventClicked.emit(event)\"\n (keyup.enter)=\"eventClicked.emit(event)\"\n class=\"grid grid-cols-[3px_1fr] items-stretch gap-2.5 mb-1.5 cursor-pointer rounded-lg p-2 transition-colors hover:bg-base-200 focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-primary motion-reduce:transition-none\"\n tabindex=\"0\">\n <div class=\"rounded-full\" [style.background-color]=\"event.color.primaryColor\"></div>\n <div class=\"min-w-0\">\n <div class=\"truncate text-[13px] font-semibold\">{{ event.title }}</div>\n <div class=\"text-xs tabular-nums opacity-60\">{{ formattedDate }}</div>\n @if (event.description) {\n <div class=\"truncate text-xs opacity-50\">{{ event.description }}</div>\n }\n </div>\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {Observable, Subject, takeUntil} from 'rxjs';\nimport {CalendarEvent} from '../../models/calendar-event.model';\nimport {CalendarConfig, DEFAULT_CALENDAR_CONFIG, resolveCalendarConfig} from '../../models/calendar-config.model';\nimport {UpcomingEventRowComponent} from '../upcoming-event-row/upcoming-event-row.component';\nimport {MnLanguageService} from '../../../../language';\n\n/**\n * Sidebar component that lists the next 10 upcoming events\n * (events whose end time is in the future), sorted by start time.\n */\n@Component({\n selector: 'mn-upcoming-events',\n standalone: true,\n imports: [CommonModule, UpcomingEventRowComponent],\n templateUrl: './upcoming-events.component.html',\n})\nexport class UpcomingEventsComponent implements OnInit, OnChanges, OnDestroy {\n private readonly lang = inject(MnLanguageService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /**\n * Accessible name for this control. Resolved through the conventional\n * `mnCalendar.upcomingEvents` key so an app can translate it, falling back to English when the\n * key is not defined rather than leaking the raw key into the UI.\n */\n get upcomingEventsLabel(): string {\n return this.lang.translateIfPresent('mnCalendar.upcomingEvents') ?? 'Upcoming events';\n }\n\n /** Observable that emits the full event list whenever it changes. */\n @Input() eventsChanged!: Observable<CalendarEvent[]>;\n /** Resolved calendar configuration passed from the parent view. */\n @Input() config?: CalendarConfig;\n /** Emits when an upcoming event row is clicked. */\n @Output() eventClicked = new EventEmitter<CalendarEvent>();\n\n upcomingEvents: CalendarEvent[] = [];\n title: string;\n noEventsMessage: string;\n\n private destroy$ = new Subject<void>();\n\n constructor() {\n this.title = DEFAULT_CALENDAR_CONFIG.upcomingEventsTitle;\n this.noEventsMessage = DEFAULT_CALENDAR_CONFIG.noUpcomingEvents;\n }\n\n /** Re-read labels when the config input changes (e.g. after a locale switch). */\n ngOnChanges(changes: SimpleChanges) {\n if (changes['config'] && this.config) {\n const resolved = resolveCalendarConfig(this.config);\n this.title = resolved.upcomingEventsTitle;\n this.noEventsMessage = resolved.noUpcomingEvents;\n }\n }\n\n ngOnInit() {\n const resolved = this.config ? resolveCalendarConfig(this.config) : { ...DEFAULT_CALENDAR_CONFIG };\n this.title = resolved.upcomingEventsTitle;\n this.noEventsMessage = resolved.noUpcomingEvents;\n\n // Marked because the list is a plain field: in a zoneless app a stream emission is not by\n // itself a reason for Angular to re-render, so the sidebar would keep showing the events it\n // was first given.\n if (this.eventsChanged) {\n this.eventsChanged.pipe(takeUntil(this.destroy$)).subscribe(events => {\n const now = new Date();\n this.upcomingEvents = events\n .filter(e => e.endTime > now)\n .sort((a, b) => a.startTime.getTime() - b.startTime.getTime())\n .slice(0, 10);\n this.cdr.markForCheck();\n });\n }\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /** trackBy for upcoming event rows. */\n trackByEvent(_index: number, event: CalendarEvent): string {\n return event.id;\n }\n}\n","<div [attr.aria-label]=\"upcomingEventsLabel\" class=\"p-4\" role=\"complementary\">\n <div class=\"mb-3 flex items-center gap-2\">\n <h3 class=\"text-sm font-bold tracking-wide\">{{ title }}</h3>\n @if (upcomingEvents.length) {\n <span class=\"text-xs font-semibold tabular-nums opacity-45\">{{ upcomingEvents.length }}</span>\n }\n </div>\n @for (event of upcomingEvents; track $index) {\n <mn-upcoming-event-row\n [event]=\"event\"\n (eventClicked)=\"eventClicked.emit($event)\">\n </mn-upcoming-event-row>\n }\n @if (upcomingEvents.length === 0) {\n <div class=\"text-sm opacity-50\">{{ noEventsMessage }}</div>\n }\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n EventEmitter,\n HostListener,\n inject,\n Input,\n OnDestroy,\n OnInit,\n Output,\n Type\n} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {FormsModule} from '@angular/forms';\nimport {LucideChevronLeft, LucideChevronRight} from '@lucide/angular';\nimport {BehaviorSubject, skip, Subject, takeUntil} from 'rxjs';\nimport {CalendarButton, CalendarEvent} from '../../models/calendar-event.model';\nimport {CalendarEventData} from '../../models/calendar-event-data.model';\nimport {\n CALENDAR_CONFIG,\n CalendarConfig,\n CalendarView,\n DEFAULT_CALENDAR_CONFIG,\n MN_CALENDAR_CONFIG,\n provideMnCalendarConfig,\n resolveCalendarConfig\n} from '../../models/calendar-config.model';\nimport {MnLanguageService} from '../../../../language';\nimport {CalendarMonthComponent} from '../calendar-month/calendar-month.component';\nimport {CalendarWeekComponent} from '../calendar-week/calendar-week.component';\nimport {CalendarDayComponent} from '../calendar-day/calendar-day.component';\nimport {UpcomingEventsComponent} from '../upcoming-events/upcoming-events.component';\nimport {MnButton} from '../../../mn-button';\nimport {MnDatetime} from '../../../mn-datetime';\n\n/** Gives each calendar instance a unique id to tie its tabs to its view panel. */\nlet instanceCounter = 0;\n\n/**\n * Main calendar orchestrator component.\n *\n * Provides a toolbar with view switching (month / week / day), date navigation,\n * and an optional action button. The active view and an upcoming-events sidebar\n * are rendered inside a responsive grid layout.\n *\n * All configuration (visible hours, locale, labels, mobile breakpoint) is read\n * from the `mn-config.json5` system via {@link MN_CALENDAR_CONFIG}, falling back\n * to the legacy {@link CALENDAR_CONFIG} injection token, then to built-in defaults.\n * Date formatting is delegated to the {@link CALENDAR_DATE_FORMATTER} token.\n *\n * @example\n * ```html\n * <mn-calendar-view\n * [showButton]=\"true\"\n * [buttonTitle]=\"'New Event'\"\n * [NewCalendarItemsEvent]=\"eventsEmitter\"\n * (RequestNewCalendarItemsEvent)=\"loadEvents($event)\"\n * (CalendarItemClickedEvent)=\"onEventClick($event)\"\n * (ButtonClickedEvent)=\"openModal()\">\n * </mn-calendar-view>\n * ```\n */\n@Component({\n selector: 'mn-calendar-view',\n standalone: true,\n imports: [\n CommonModule,\n FormsModule,\n CalendarMonthComponent,\n CalendarWeekComponent,\n CalendarDayComponent,\n UpcomingEventsComponent,\n MnButton,\n MnDatetime,\n LucideChevronLeft,\n LucideChevronRight\n ],\n templateUrl: './calendar-view.component.html',\n providers: [\n provideMnCalendarConfig(DEFAULT_CALENDAR_CONFIG),\n ],\n styles: [`:host { display: flex; flex-direction: column; width: 100%; height: 100%; }`]\n})\nexport class CalendarViewComponent implements OnInit, OnDestroy {\n /**\n * Accessible name for this control. Resolved through the conventional\n * `mnCalendar.calendarView` key so an app can translate it, falling back to English when the\n * key is not defined rather than leaking the raw key into the UI.\n */\n get calendarViewLabel(): string {\n return this.lang.translateIfPresent('mnCalendar.calendarView') ?? 'Calendar view';\n }\n\n /** Whether to show the action button in the toolbar. */\n @Input() showButton = false;\n /** Label text for the action button. */\n @Input() buttonTitle = '';\n /** Array of buttons to display in the toolbar's top-right area. */\n @Input() buttons: CalendarButton[] = [];\n /** Custom event renderer component type. */\n @Input() CalendarEventComponent?: Type<CalendarEventData>;\n /** Observable or EventEmitter that pushes new event arrays into the calendar. */\n @Input() NewCalendarItemsEvent?: EventEmitter<CalendarEvent[]>;\n\n /** Emits when the calendar needs fresh event data (e.g. after navigation). */\n @Output() RequestNewCalendarItemsEvent = new EventEmitter<Date>();\n /** Emits when a calendar event is clicked. */\n @Output() CalendarItemClickedEvent = new EventEmitter<CalendarEvent>();\n /** Emits when the action button is clicked. */\n @Output() ButtonClickedEvent = new EventEmitter<void>();\n\n readonly CalendarView = CalendarView;\n /** Ties the view tabs to the panel they control, uniquely per calendar. */\n readonly panelId = `mn-calendar-panel-${++instanceCounter}`;\n currentView = CalendarView.WEEK;\n focusDay = new Date();\n viewOptions: { value: CalendarView; label: string }[] = [];\n isMobileView = false;\n\n /** BehaviorSubject so late-subscribing child views receive the last emitted events. */\n internalEventsChanged = new BehaviorSubject<CalendarEvent[]>([]);\n /** Subject for broadcasting focus-day changes to child views. */\n internalFocusDayChanged = new Subject<Date>();\n\n private destroy$ = new Subject<void>();\n protected config: CalendarConfig;\n /** Reference to the injected mn-config object (mutated in-place on locale change). */\n private readonly mnConfigRef: CalendarConfig | null;\n private readonly destroyRef = inject(DestroyRef);\n private readonly lang = inject(MnLanguageService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n constructor() {\n const mnConfig = inject<CalendarConfig | null>(MN_CALENDAR_CONFIG, {optional: true});\n const legacyConfig = inject<CalendarConfig | null>(CALENDAR_CONFIG, {optional: true});\n\n // Keep a reference to the injected config so we can re-read it after locale changes.\n this.mnConfigRef = mnConfig;\n // Priority: mn-config system > legacy CALENDAR_CONFIG > built-in defaults\n const raw = mnConfig ?? legacyConfig ?? undefined;\n this.config = resolveCalendarConfig(raw as Partial<CalendarConfig> | undefined);\n }\n\n @HostListener('window:resize')\n onResize() {\n this.checkMobileView();\n }\n\n ngOnInit() {\n this.rebuildFromConfig();\n\n // Re-resolve config when locale changes (supports $translate in mn-config). Marked because\n // the labels it rebuilds are plain fields: a locale switch arrives on a stream, which in a\n // zoneless app is not by itself a reason for Angular to re-render the toolbar.\n const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n this.rebuildFromConfig();\n this.cdr.markForCheck();\n });\n this.destroyRef.onDestroy(() => sub.unsubscribe());\n\n this.checkMobileView();\n this.RequestNewCalendarItemsEvent.emit(this.focusDay);\n\n if (this.NewCalendarItemsEvent) {\n this.NewCalendarItemsEvent.pipe(takeUntil(this.destroy$)).subscribe(events => {\n this.internalEventsChanged.next(events);\n });\n }\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /** Switches the active view. On mobile, forces day view. */\n switchView(view: CalendarView) {\n if (this.isMobileView) {\n this.currentView = CalendarView.DAY;\n return;\n }\n this.currentView = view;\n }\n\n /**\n * Names the stretch of time on screen — the day, the week, or the month. It is\n * the toolbar's orientation: without it, navigating leaves you somewhere with\n * no label. Announced politely, so stepping through says where you landed.\n */\n get periodLabel(): string {\n const locale = this.config.locale;\n\n if (this.currentView === CalendarView.MONTH) {\n return this.focusDay.toLocaleDateString(locale, {month: 'long', year: 'numeric'});\n }\n\n if (this.currentView === CalendarView.DAY) {\n // No weekday: the view's own column header already says which day it is,\n // and the year only earns its place once it stops being the obvious one.\n return this.focusDay.toLocaleDateString(locale, {\n day: 'numeric',\n month: 'long',\n ...(this.focusDay.getFullYear() !== new Date().getFullYear() ? {year: 'numeric'} : {}),\n });\n }\n\n const start = this.startOfWeek(this.focusDay);\n const end = new Date(start);\n end.setDate(end.getDate() + 6);\n // Only repeat what actually changes across the week's two ends.\n const from = start.getFullYear() !== end.getFullYear()\n ? start.toLocaleDateString(locale, {day: 'numeric', month: 'short', year: 'numeric'})\n : start.toLocaleDateString(locale, {\n day: 'numeric',\n ...(start.getMonth() !== end.getMonth() ? {month: 'short'} : {}),\n });\n const to = end.toLocaleDateString(locale, {day: 'numeric', month: 'short', year: 'numeric'});\n return `${from} – ${to}`;\n }\n\n /** The focus day as YYYY-MM-DD, for the toolbar's date picker. */\n get focusDayString(): string {\n const pad = (n: number) => n.toString().padStart(2, '0');\n const d = this.focusDay;\n return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n }\n\n /**\n * Steps the calendar by one unit of whatever is on screen: a day in day view,\n * a week in week view, a month in month view. Navigating by the visible unit is\n * what makes one pair of arrows serve all three.\n */\n navigate(step: number) {\n const next = new Date(this.focusDay);\n\n switch (this.currentView) {\n case CalendarView.DAY:\n next.setDate(next.getDate() + step);\n break;\n case CalendarView.WEEK:\n next.setDate(next.getDate() + step * 7);\n break;\n default:\n this.setFocusDay(this.addMonths(this.focusDay, step));\n return;\n }\n\n this.setFocusDay(next);\n }\n\n /** Returns the calendar to today. */\n goToToday() {\n this.setFocusDay(new Date());\n }\n\n /**\n * Handles the toolbar date picker.\n * @param value The date string in YYYY-MM-DD format.\n */\n onPickDate(value: string) {\n if (!value) return;\n const picked = new Date(value + 'T00:00:00');\n if (isNaN(picked.getTime())) return;\n this.setFocusDay(picked);\n }\n\n /** Handles a day click from the month view — switches to day view. */\n onMonthDayClick(date: Date) {\n this.currentView = CalendarView.DAY;\n this.setFocusDay(date);\n }\n\n /** Forwards a child event click to the parent output. */\n onEventClick(event: CalendarEvent) {\n this.CalendarItemClickedEvent.emit(event);\n }\n\n /** trackBy for view option buttons. */\n trackByView(_index: number, item: { value: CalendarView }): string {\n return item.value;\n }\n\n /** Rebuilds view options and labels from the current config. */\n private rebuildFromConfig() {\n // Re-resolve from the injected config reference which is mutated in-place by the provider on locale change.\n if (this.mnConfigRef) {\n this.config = resolveCalendarConfig(this.mnConfigRef as Partial<CalendarConfig>);\n }\n this.viewOptions = [\n { value: CalendarView.MONTH, label: this.config.viewLabels['MONTH'] ?? 'Month' },\n { value: CalendarView.WEEK, label: this.config.viewLabels['WEEK'] ?? 'Week' },\n { value: CalendarView.DAY, label: this.config.viewLabels['DAY'] ?? 'Day' }\n ];\n }\n\n private checkMobileView() {\n const wasMobile = this.isMobileView;\n const width = window.innerWidth;\n // Honour the configured mobile breakpoint (default 768) rather than a hard-coded\n // width: a seven-column week is cramped well before a phone's width, so the day\n // view takes over earlier — and consumers can tune where via `mobileBreakpoint`.\n const breakpoint = this.config.mobileBreakpoint;\n this.isMobileView = width < breakpoint;\n if (this.isMobileView && !wasMobile) {\n this.currentView = CalendarView.DAY;\n }\n }\n\n /**\n * Adds months without the end-of-month overflow `setMonth` alone produces —\n * 31 January plus one month is 28 February, not 3 March.\n */\n private addMonths(date: Date, months: number): Date {\n const day = date.getDate();\n const shifted = new Date(date);\n shifted.setDate(1);\n shifted.setMonth(shifted.getMonth() + months);\n const lastDayOfMonth = new Date(shifted.getFullYear(), shifted.getMonth() + 1, 0).getDate();\n shifted.setDate(Math.min(day, lastDayOfMonth));\n return shifted;\n }\n\n /** Monday of the week containing `date`, matching the grid the views draw. */\n private startOfWeek(date: Date): Date {\n const start = new Date(date);\n start.setHours(0, 0, 0, 0);\n start.setDate(start.getDate() - ((start.getDay() + 6) % 7));\n return start;\n }\n\n private setFocusDay(date: Date) {\n this.focusDay = date;\n this.internalFocusDayChanged.next(date);\n this.RequestNewCalendarItemsEvent.emit(date);\n }\n}\n","<div class=\"w-full h-full flex flex-col\" role=\"application\" aria-label=\"Calendar\">\n\n <!-- Toolbar has one layout below the desktop (`lg`) width and one at it. Below\n `lg`: a controls row (Today anchored left, the right-hand cluster anchored\n right) with the ‹ date › nav centred on its own row beneath — the same\n shape from phone through tablet, so nothing wraps into a lopsided diagonal.\n At `lg`, where the upcoming-events sidebar also appears, the nav folds up\n inline after Today and the whole toolbar becomes a single row. The one JS\n breakpoint (`mobileBreakpoint`) governs the phone controls — icon-only\n picker, hidden view-switcher, forced day view — not the toolbar's shape. -->\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-2 py-3\">\n\n <button (click)=\"goToToday()\"\n [data]=\"{ variant: 'outline', size: 'md', color: 'primary' }\"\n class=\"shrink-0\"\n mnButton\n type=\"button\">\n {{ config.todayLabel }}\n </button>\n\n <!-- Stepping through time. The arrows sit either side of the date they move,\n so the control and the thing it controls read as one unit. Below `lg` it\n sits centred on its own row (basis-full, ordered last) — a period header\n above the grid, tight rather than flinging the arrows to the row's edges.\n At `lg` it folds inline right after Today, taking a stable min-width so\n the arrows don't jitter as the label's length changes. -->\n <div class=\"flex basis-full order-last justify-center items-center gap-1\n lg:basis-auto lg:order-none lg:justify-start\">\n <button (click)=\"navigate(-1)\"\n [attr.aria-label]=\"config.previousLabel\"\n [data]=\"{ variant: 'text', size: 'md', color: 'gray' }\"\n class=\"shrink-0\"\n mnButton\n type=\"button\">\n <svg [size]=\"18\" lucideChevronLeft></svg>\n </button>\n\n <h2 aria-live=\"polite\"\n class=\"text-center text-base font-semibold whitespace-nowrap px-1 lg:min-w-56\">\n {{ periodLabel }}\n </h2>\n\n <button (click)=\"navigate(1)\"\n [attr.aria-label]=\"config.nextLabel\"\n [data]=\"{ variant: 'text', size: 'md', color: 'gray' }\"\n class=\"shrink-0\"\n mnButton\n type=\"button\">\n <svg [size]=\"18\" lucideChevronRight></svg>\n </button>\n </div>\n\n <!-- Right-hand controls travel together as one cluster with `ml-auto`, so they\n hold to the right of the row on every width — and when space runs short the\n whole group wraps to a new line as a unit rather than stranding a lone\n button. On desktop the cluster lands above the upcoming-events sidebar,\n using that otherwise-empty space. -->\n <div class=\"ml-auto flex items-center gap-2\">\n <!-- On mobile the picker collapses to its icon-only variant. -->\n <mn-lib-datetime (ngModelChange)=\"onPickDate($event)\"\n [ngModel]=\"focusDayString\"\n [props]=\"{ id: panelId + '-date', mode: 'date', placeholder: config.pickDateLabel, size: 'md', borderRadius: 'lg', hover: true, iconOnly: isMobileView }\"\n class=\"block\"></mn-lib-datetime>\n\n <!-- View switcher (month / week / day) — hidden on mobile, which is forced to day view. -->\n @if (!isMobileView) {\n <div [attr.aria-label]=\"calendarViewLabel\" class=\"flex border border-base-300 rounded-md overflow-hidden\"\n role=\"tablist\">\n @for (view of viewOptions; track view.value) {\n <button\n (click)=\"switchView(view.value)\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-selected]=\"currentView === view.value\"\n [data]=\"{ size: 'md', variant: currentView === view.value ? 'fill' : 'text', color: 'primary' }\"\n mnButton\n role=\"tab\"\n type=\"button\">\n {{ view.label }}\n </button>\n }\n </div>\n }\n\n <!-- Action buttons (custom buttons + optional showButton CTA). -->\n @if (buttons.length || showButton) {\n @for (btn of buttons; track btn.label) {\n <button (click)=\"btn.onClick()\" [data]=\"btn.buttonData || {}\" mnButton type=\"button\">\n {{ btn.label }}\n </button>\n }\n @if (showButton) {\n <button (click)=\"ButtonClickedEvent.emit()\" [data]=\"{}\" mnButton type=\"button\">\n {{ buttonTitle }}\n </button>\n }\n }\n </div>\n\n </div>\n\n <div class=\"grid grid-cols-1 lg:grid-cols-[1fr_220px] gap-3 flex-1 min-h-0\">\n <div [id]=\"panelId\" class=\"min-w-0 min-h-0 overflow-hidden overflow-y-auto\" role=\"tabpanel\">\n @if (currentView === CalendarView.MONTH) {\n <mn-calendar-month\n [focusDay]=\"focusDay\"\n [eventsChanged]=\"internalEventsChanged\"\n [focusDayChanged]=\"internalFocusDayChanged\"\n [config]=\"config\"\n (dayClicked)=\"onMonthDayClick($event)\">\n </mn-calendar-month>\n }\n @if (currentView === CalendarView.WEEK) {\n <mn-calendar-week\n [focusDay]=\"focusDay\"\n [eventsChanged]=\"internalEventsChanged\"\n [focusDayChanged]=\"internalFocusDayChanged\"\n [config]=\"config\"\n [calendarEventComponent]=\"CalendarEventComponent\"\n (eventClicked)=\"onEventClick($event)\">\n </mn-calendar-week>\n }\n @if (currentView === CalendarView.DAY) {\n <mn-calendar-day\n [focusDay]=\"focusDay\"\n [eventsChanged]=\"internalEventsChanged\"\n [focusDayChanged]=\"internalFocusDayChanged\"\n [config]=\"config\"\n [calendarEventComponent]=\"CalendarEventComponent\"\n (eventClicked)=\"onEventClick($event)\">\n </mn-calendar-day>\n }\n </div>\n <div class=\"hidden lg:block border-l border-base-300 overflow-auto\">\n <mn-upcoming-events\n [eventsChanged]=\"internalEventsChanged\"\n [config]=\"config\"\n (eventClicked)=\"onEventClick($event)\">\n </mn-upcoming-events>\n </div>\n </div>\n\n</div>\n","// Main component\nexport { CalendarViewComponent } from './components/calendar-view/calendar-view.component';\n\n// Sub-components\nexport { CalendarWeekComponent } from './components/calendar-week/calendar-week.component';\nexport { CalendarDayComponent } from './components/calendar-day/calendar-day.component';\nexport { CalendarMonthComponent } from './components/calendar-month/calendar-month.component';\nexport { CalendarEventComponent } from './components/calendar-event/calendar-event.component';\nexport { CalendarEventDefaultComponent } from './components/calendar-event-default/calendar-event-default.component';\nexport { UpcomingEventsComponent } from './components/upcoming-events/upcoming-events.component';\nexport { UpcomingEventRowComponent } from './components/upcoming-event-row/upcoming-event-row.component';\n\n// Models\nexport type { CalendarEvent, CurrentTimeCalendarEvent, CalendarButton } from './models/calendar-event.model';\nexport type { CalendarEventData } from './models/calendar-event-data.model';\nexport { CalendarView, CALENDAR_CONFIG, DEFAULT_CALENDAR_CONFIG, MN_CALENDAR_CONFIG, MN_CALENDAR_COMPONENT_NAME, provideMnCalendarConfig, resolveCalendarConfig } from './models/calendar-config.model';\nexport type { CalendarConfig, HourRow, ColumnDay, MonthItem } from './models/calendar-config.model';\nexport type { ColorPreset } from './models/color-preset.model';\n\n// Services / Tokens\nexport { CALENDAR_DATE_FORMATTER } from './services/calendar-date-formatter';\nexport type { CalendarDateFormatter } from './services/calendar-date-formatter';\nexport { DefaultCalendarDateFormatter } from './services/default-calendar-date-formatter';\nexport { CalendarEventLayoutService } from './services/calendar-event-layout.service';\n\n// Utility\nexport { CalendarUtility } from './utils/calendar-utils';\n","import {\n AfterViewChecked,\n AfterViewInit,\n Component,\n DoCheck,\n ElementRef,\n EventEmitter,\n inject,\n Input,\n isSignal,\n OnDestroy,\n Output,\n ViewChild\n} from '@angular/core';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {Subscription} from 'rxjs';\nimport {MnTranslatePipe} from '../../language';\nimport {MnCollectionState} from '../mn-collection';\nimport {MnTabDataSource, MnTabItem} from './mn-tab.types';\nimport {CommonModule} from '@angular/common';\nimport {MnBadge} from '../mn-badge';\nimport {MnSkeleton} from '../mn-skeleton';\n\n/** Fallback number of skeleton tabs when no items are known and no count is given. */\nconst DEFAULT_SKELETON_TAB_COUNT = 3;\n\n/** Query parameter the active tab is mirrored in unless the data source names another. */\nconst DEFAULT_TAB_URL_PARAM = 'tab';\n\n/** Key used for a label that slugs to nothing (e.g. punctuation only). */\nconst FALLBACK_TAB_URL_KEY = 'tab';\n\n/**\n * Slugs a tab label into the value it takes in the URL: the last segment of a\n * translation key, kebab-cased. `matches.hub.tab.entrants` → `entrants`,\n * `members.tabMembers` → `tab-members`.\n * @param label - The tab's label or translation key.\n */\nfunction tabUrlKey(label: string): string {\n const segment = label.split('.').pop() ?? label;\n const slug = segment\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/[^a-zA-Z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .toLowerCase();\n return slug || FALLBACK_TAB_URL_KEY;\n}\n\n/**\n * Tab component that renders a horizontal tab bar.\n * Supports translation keys for labels via MnTranslatePipe.\n *\n * The active tab is mirrored in the URL query string by default, so a reload,\n * a back button or a shared link lands on the same tab; see\n * {@link MnTabDataSource.urlParam} to rename that parameter or switch it off.\n */\n@Component({\n selector: 'mn-tab',\n standalone: true,\n imports: [MnTranslatePipe, CommonModule, MnBadge, MnSkeleton],\n templateUrl: './mn-tab.component.html',\n})\nexport class MnTabComponent implements DoCheck, AfterViewInit, AfterViewChecked, OnDestroy {\n /**\n * Router the active tab is written to. Optional: a tab bar used outside a\n * routed application still works, it just has no URL to mirror into.\n */\n private readonly router = inject(Router, {optional: true});\n\n /** Route the tab value is read back from; absent for the same reason as {@link router}. */\n private readonly route = inject(ActivatedRoute, {optional: true});\n\n /** Watches the URL so a deep link, a back button or an in-app link moves the tab bar. */\n private readonly queryParamsSub?: Subscription;\n\n /**\n * URL keys of the current items, memoised on the items array so a slug is\n * computed once per tab set rather than on every change-detection pass.\n */\n private urlKeyCache?: { items: MnTabItem[]; keys: string[] };\n\n /** URL key of {@link currentActive}, so a rebuilt tab set can be recognised as the same tab. */\n private currentKey?: string;\n\n /**\n * Key of a selection whose URL write has not landed yet. Navigation is\n * asynchronous, so a consumer that rebuilds its tabs in response to the click\n * can be resolved against a URL that still names the previous tab; until the\n * write completes, this is the truth about what the user picked.\n */\n private pendingKey?: string;\n\n /** Set on destroy so a deferred restore can't announce a tab nobody is showing. */\n private destroyed = false;\n\n /** The horizontally-scrolling wrapper the edge fade is painted onto. */\n @ViewChild('scrollContainer') private scrollContainer?: ElementRef<HTMLElement>;\n\n /** The tab row; queried for the active tab so the indicator can measure it. */\n @ViewChild('tabList') private tabList?: ElementRef<HTMLElement>;\n\n /** The shared underline that slides to the active tab. */\n @ViewChild('indicator') private indicator?: ElementRef<HTMLElement>;\n\n /** Pending indicator remeasure, cancelled on destroy so a post-destroy frame can't read a detached ref. */\n private indicatorFrame?: number;\n\n /**\n * True while a click-initiated slide is animating. The active tab's\n * `font-bold` widens the row, which fires {@link resizeObserver}; without\n * this guard the observer's snap ({@link updateIndicator} with `animate:\n * false`) would land the indicator at its target the same frame the slide\n * starts, so the transition never paints. Set synchronously in\n * {@link setActive} — before the frame runs — so the guard doesn't depend on\n * rAF-vs-ResizeObserver callback ordering.\n */\n private sliding = false;\n\n /** Clears {@link sliding} after the slide finishes; re-armed per click, cancelled on destroy. */\n private slidingTimer?: number;\n\n /** Slide duration in ms; matches the indicator's `duration-300` transition. */\n private static readonly SLIDE_MS = 300;\n\n /** How far the fade reaches in from each overflowing edge. */\n private static readonly FADE = '2rem';\n /** Data source containing tab items and default active index. */\n @Input() dataSource!: MnTabDataSource;\n\n /**\n * Whether to enable horizontal scrolling when items overflow.\n * When true, tabs scroll horizontally instead of overflowing their container.\n *\n * Defaults to `true`: the tab bar never wraps (`flex-nowrap`), so without\n * scrolling an overflowing bar would clip its last tabs or push the page width\n * on narrow screens. When the tabs already fit, `overflow-x-auto` is a no-op,\n * so this default only ever changes behaviour for the overflow case it fixes.\n */\n @Input() scrollable = true;\n\n /**\n * Whether tabs should stretch to fill the available width.\n * Defaults to false, so tabs only take as much space as their content.\n */\n @Input() justified = false;\n\n /** Emits the newly activated tab item whenever the active tab changes. */\n @Output() activeChange = new EventEmitter<MnTabItem>();\n\n /** The currently active tab item. */\n currentActive?: MnTabItem;\n\n /** Watches the wrapper and the tab row so the fade re-evaluates on width or content changes. */\n private resizeObserver?: ResizeObserver;\n\n /**\n * Whether the tab bar is loading and should render skeleton tabs, from\n * {@link MnTabDataSource.state}.\n */\n get isLoadingState(): boolean {\n return this.dataSource.state === MnCollectionState.LOADING;\n }\n\n /**\n * Index array sizing the loading skeleton: `skeletonCount` when provided,\n * otherwise the number of known items, falling back to a default when none.\n */\n get skeletonTabs(): number[] {\n const count =\n this.dataSource.skeletonCount ??\n (this.dataSource.items.length || DEFAULT_SKELETON_TAB_COUNT);\n return Array.from({length: count}, (_, index) => index);\n }\n\n constructor() {\n // The URL is a second source of truth for the selection: a deep link, an\n // in-app link into another tab of the page already on screen, or the back\n // button all change it without a click landing on this component.\n this.queryParamsSub = this.route?.queryParamMap.subscribe((params) => {\n const param = this.urlParam();\n if (param) this.activateUrlKey(params.get(param));\n });\n }\n\n /**\n * Re-resolves the active tab on every change-detection pass.\n *\n * The data source is often populated or rebuilt asynchronously (tabs that\n * depend on fetched data or permissions). Resolving the active tab only once\n * at init would leave {@link currentActive} pointing at a stale item — the\n * tab bar would then highlight nothing and swallow the first click — so the\n * selection is kept in sync with whatever the data source currently holds.\n */\n ngDoCheck(): void {\n this.syncActiveTab();\n }\n\n /**\n * Starts watching the scroll wrapper so the edge fade stays honest. A scroll\n * moves the fade to whichever side now hides tabs; a resize (viewport change)\n * or a change to the tab row's width (tabs added, relabelled, skeleton →\n * loaded) re-checks whether either edge overflows at all.\n */\n ngAfterViewInit(): void {\n const el = this.scrollContainer?.nativeElement;\n if (!el) return;\n this.resizeObserver = new ResizeObserver(() => {\n this.updateEdgeFades();\n // Tabs may have reflowed (viewport change, justified widths); snap the\n // indicator to the new geometry — animating a resize tick reads as jank.\n // But skip the snap mid-slide: a click's own `font-bold` resizes the row\n // and fires this observer, and snapping there kills the slide it triggered.\n if (!this.sliding) this.updateIndicator(false);\n });\n this.resizeObserver.observe(el);\n if (el.firstElementChild) this.resizeObserver.observe(el.firstElementChild);\n this.updateEdgeFades();\n // Place the indicator on the default tab without a slide-in from zero.\n this.updateIndicator(false);\n }\n\n /** Wrapper geometry (`scrollWidth:clientWidth`) at the last fade evaluation. */\n private lastFadeGeometry = '';\n\n /**\n * Re-evaluates the edge fade when the wrapper's scrollable extent changes without its box\n * changing. {@link resizeObserver} only sees border-box changes, and the tab row is a\n * block-level flex container that keeps its parent's width while its tabs overflow inside it,\n * so tabs that arrive after init (permission-gated tabs, badge counts, skeleton → loaded) grow\n * `scrollWidth` without firing it; until a resize or scroll the fade stayed off. Two property\n * reads per pass; the repaint only runs when they moved.\n */\n ngAfterViewChecked(): void {\n const el = this.scrollContainer?.nativeElement;\n if (!el) return;\n const geometry = `${el.scrollWidth}:${el.clientWidth}`;\n if (geometry === this.lastFadeGeometry) return;\n this.lastFadeGeometry = geometry;\n this.updateEdgeFades();\n }\n\n ngOnDestroy(): void {\n this.destroyed = true;\n this.queryParamsSub?.unsubscribe();\n this.resizeObserver?.disconnect();\n if (this.indicatorFrame !== undefined) cancelAnimationFrame(this.indicatorFrame);\n if (this.slidingTimer !== undefined) clearTimeout(this.slidingTimer);\n }\n\n /**\n * Paints a fade over whichever edge has tabs scrolled out of view — a soft\n * dissolve that reads as \"more this way\", the affordance a hidden scrollbar\n * otherwise costs us. Uses a mask (content → transparent) rather than a\n * background-coloured overlay, so it needs no knowledge of the theme.\n */\n updateEdgeFades(): void {\n const el = this.scrollContainer?.nativeElement;\n if (!el) return;\n const fadeStart = el.scrollLeft > 1;\n const fadeEnd = el.scrollLeft + el.clientWidth < el.scrollWidth - 1;\n const f = MnTabComponent.FADE;\n let mask = '';\n if (this.scrollable && fadeStart && fadeEnd) {\n mask = `linear-gradient(to right, transparent 0, #000 ${f}, #000 calc(100% - ${f}), transparent 100%)`;\n } else if (this.scrollable && fadeStart) {\n mask = `linear-gradient(to right, transparent 0, #000 ${f}, #000 100%)`;\n } else if (this.scrollable && fadeEnd) {\n mask = `linear-gradient(to right, #000 0, #000 calc(100% - ${f}), transparent 100%)`;\n }\n el.style.maskImage = mask;\n el.style.setProperty('-webkit-mask-image', mask);\n }\n\n /**\n * Sets the given tab item as active, invoking deactivate/activate callbacks,\n * and records the selection in the URL so it survives a reload or a share.\n * @param item - The tab item to activate.\n */\n setActive(item: MnTabItem): void {\n if (this.currentActive === item) {\n return;\n }\n this.activate(item);\n this.writeUrl(item);\n }\n\n /**\n * Whether a tab is the bar's single Tab stop: the active tab, or the first tab while none is\n * active yet. Every other tab is reached with the arrow keys, so Tab leaves the bar in one press.\n * @param item - The tab to check.\n * @returns True for the one tab that keeps `tabindex=\"0\"`.\n */\n isTabStop(item: MnTabItem): boolean {\n return this.currentActive ? this.currentActive === item : this.dataSource?.items[0] === item;\n }\n\n /**\n * Keyboard handling on a tab. Left and Right move to the previous or next tab and wrap at the\n * ends, Home and End jump to the first and last; the tab moved to is activated at once\n * (automatic activation) and receives focus. Enter and Space activate the focused tab, handled\n * on keydown so Space does not scroll the page first. Other keys are left alone.\n * @param event - The keydown on a tab.\n * @param item - The tab the key was pressed on.\n */\n onTabKeydown(event: KeyboardEvent, item: MnTabItem): void {\n const items = this.dataSource?.items ?? [];\n const index = items.indexOf(item);\n if (index < 0) return;\n\n let target: number;\n switch (event.key) {\n case 'ArrowRight':\n target = (index + 1) % items.length;\n break;\n case 'ArrowLeft':\n target = (index - 1 + items.length) % items.length;\n break;\n case 'Home':\n target = 0;\n break;\n case 'End':\n target = items.length - 1;\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n this.setActive(item);\n return;\n default:\n return;\n }\n\n event.preventDefault();\n this.setActive(items[target]);\n this.focusTab(target);\n }\n\n /**\n * Moves focus to the tab at `index` and scrolls it into view inside a scrollable bar. Focusing\n * works before change detection has moved `tabindex=\"0\"` onto it, because a script may focus an\n * element with `tabindex=\"-1\"`.\n * @param index - Position of the tab in the data source's items.\n */\n private focusTab(index: number): void {\n const tabs = this.tabList?.nativeElement.querySelectorAll<HTMLElement>('[role=\"tab\"]');\n const tab = tabs?.[index];\n if (!tab) return;\n tab.focus();\n tab.scrollIntoView?.({block: 'nearest', inline: 'nearest'});\n }\n\n /**\n * Moves the selection to `item` and tells the consumer about it: the\n * deactivate/activate/emit sequence a click produces, shared by the click\n * path and the URL-driven ones (deep link, back button), which owe the\n * consumer the same notifications.\n * @param item - The tab item to activate.\n */\n private activate(item: MnTabItem): void {\n this.currentActive?.onDeactivate?.();\n item.onClick?.();\n this.select(item);\n this.activeChange.emit(item);\n // Slide the underline to the new tab. Measure on the next frame, after\n // change detection has applied the active tab's `font-bold` (which widens\n // it) so the indicator lands on the final, bolded geometry. Guard the slide\n // against the resize snap the same `font-bold` triggers (see {@link sliding}).\n this.beginSlide();\n this.scheduleIndicator(true);\n }\n\n /**\n * Marks a click-driven slide as in progress and schedules the guard to lift\n * once the transition has finished. A timeout (not `transitionend`) so the\n * flag still clears under `motion-reduce`, where no transition event fires.\n */\n private beginSlide(): void {\n this.sliding = true;\n if (this.slidingTimer !== undefined) clearTimeout(this.slidingTimer);\n this.slidingTimer = setTimeout(() => {\n this.slidingTimer = undefined;\n this.sliding = false;\n }, MnTabComponent.SLIDE_MS) as unknown as number;\n }\n\n /**\n * Moves the shared underline to the active tab. When `animate` is false the\n * move is snapped (no slide) by disabling the transition for one reflow —\n * used on init, async selection and resize, where a slide would read as jank.\n * @param animate - Whether the move should slide (true) or snap (false).\n */\n private updateIndicator(animate: boolean): void {\n const bar = this.indicator?.nativeElement;\n const list = this.tabList?.nativeElement;\n if (!bar || !list) return;\n const active = list.querySelector<HTMLElement>('[role=\"tab\"][aria-selected=\"true\"]');\n if (!active) {\n bar.style.opacity = '0';\n return;\n }\n if (!animate) bar.style.transition = 'none';\n bar.style.opacity = '1';\n bar.style.width = `${active.offsetWidth}px`;\n bar.style.transform = `translateX(${active.offsetLeft}px)`;\n if (!animate) {\n // Force a reflow so the snapped values apply before the transition is\n // restored, then hand animation back to the CSS class.\n void bar.offsetWidth;\n bar.style.transition = '';\n }\n }\n\n /**\n * Remeasures the indicator on the next animation frame, so the read happens\n * after layout reflects the latest active-tab classes. Coalesces bursts and\n * is cancellable on destroy.\n * @param animate - Whether the resulting move should slide.\n */\n private scheduleIndicator(animate: boolean): void {\n if (this.indicatorFrame !== undefined) cancelAnimationFrame(this.indicatorFrame);\n this.indicatorFrame = requestAnimationFrame(() => {\n this.indicatorFrame = undefined;\n this.updateIndicator(animate);\n });\n }\n\n /**\n * Returns the resolved badge value for a tab item, supporting both plain numbers and Signal<number>.\n * @param item - The tab item whose badge to resolve.\n */\n getBadge(item: MnTabItem): number | undefined {\n if (isSignal(item.badge)) return item.badge();\n return item.badge;\n }\n\n /**\n * Ensures {@link currentActive} references a tab that still exists in the data\n * source, preferring the tab named in the URL and falling back to the\n * configured default tab when the current selection is missing or stale\n * (e.g. after the items array is replaced).\n */\n private syncActiveTab(): void {\n const items = this.dataSource?.items;\n if (!items || items.length === 0) {\n if (this.currentActive !== undefined) {\n this.currentActive = undefined;\n this.currentKey = undefined;\n this.scheduleIndicator(false);\n }\n return;\n }\n if (this.currentActive && items.includes(this.currentActive)) {\n return;\n }\n const defaultIndex = this.dataSource.defaultActive;\n const index =\n defaultIndex >= 0 && defaultIndex < items.length ? defaultIndex : 0;\n const fallback = items[index];\n const restored = this.itemFromUrl(items);\n const previousKey = this.currentKey;\n this.select(restored ?? fallback);\n // Selection resolved from data (not a user click): snap, don't slide.\n this.scheduleIndicator(false);\n if (restored && restored !== fallback && this.currentKey !== previousKey) {\n // The URL asks for a tab the consumer has not rendered, so this selection\n // has to be announced like a click's would be — but only the first time,\n // or a consumer that rebuilds its items array would re-run the tab's\n // callbacks on every rebuild. Deferred out of the change-detection pass\n // that resolved it: the consumer will flip its own state in response, and\n // doing that mid-pass writes to bindings that have already been checked.\n queueMicrotask(() => this.announceRestored(restored));\n }\n }\n\n /**\n * Records `item` as the selection, remembering its URL key so the same tab is\n * recognised after the consumer rebuilds the items array.\n * @param item - The newly selected tab.\n */\n private select(item: MnTabItem): void {\n const items = this.dataSource.items;\n this.currentActive = item;\n this.currentKey = this.urlKeys(items)[items.indexOf(item)];\n }\n\n /**\n * Runs the restored tab's callbacks a change-detection pass later, unless the\n * selection moved on in the meantime (a click, or another tab set arriving).\n * @param item - The tab restored from the URL.\n */\n private announceRestored(item: MnTabItem): void {\n if (this.destroyed || this.currentActive !== item) return;\n item.onClick?.();\n this.activeChange.emit(item);\n }\n\n /**\n * Activates the tab a URL value names, when it is not the tab already on\n * screen. Values naming no known tab are ignored: another tab bar on the page\n * may own that parameter, and a stale link should leave the default standing.\n * @param key - The value read from the query parameter, if any.\n */\n private activateUrlKey(key: string | null): void {\n const items = this.dataSource?.items;\n if (!key || !items?.length) return;\n const item = items[this.urlKeys(items).indexOf(key)];\n if (!item || item === this.currentActive) return;\n this.activate(item);\n }\n\n /**\n * The query parameter this tab bar mirrors into, or undefined when there is\n * nothing to mirror into (no router) or the consumer switched it off.\n */\n private urlParam(): string | undefined {\n if (!this.router || !this.route) return undefined;\n const param = this.dataSource?.urlParam ?? DEFAULT_TAB_URL_PARAM;\n return param === false || param === '' ? undefined : param;\n }\n\n /**\n * The tab the current URL asks for, if it names one of `items`.\n * @param items - The tab set to resolve the URL value against.\n */\n private itemFromUrl(items: MnTabItem[]): MnTabItem | undefined {\n const param = this.urlParam();\n if (!param) return undefined;\n const key = this.pendingKey ?? this.route?.snapshot.queryParamMap.get(param);\n if (!key) return undefined;\n const index = this.urlKeys(items).indexOf(key);\n return index === -1 ? undefined : items[index];\n }\n\n /**\n * Records the active tab in the query string, replacing the current history\n * entry: switching tabs is not a navigation to walk back through, and back\n * should leave the page rather than retrace its tabs.\n * @param item - The tab that just became active.\n */\n private writeUrl(item: MnTabItem): void {\n const param = this.urlParam();\n if (!param || !this.router) return;\n const items = this.dataSource.items;\n const key = this.urlKeys(items)[items.indexOf(item)];\n if (!key) return;\n this.pendingKey = key;\n // No path commands and no `relativeTo`, so only the query string changes.\n // That holds wherever the tab bar sits, including a modal body, which has\n // no route of its own to be relative to.\n void this.router\n .navigate([], {\n queryParams: {[param]: key},\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n .catch(() => undefined)\n .then(() => {\n // Only clear our own write; a later click already owns the pending key.\n if (this.pendingKey === key) this.pendingKey = undefined;\n });\n }\n\n /**\n * The URL key of every tab, in item order: the item's `id`, else a slug of\n * its label. Repeats are numbered so each tab still round-trips through the\n * URL; give such tabs an explicit `id` to choose the value yourself.\n * @param items - The tab set to key.\n */\n private urlKeys(items: MnTabItem[]): string[] {\n if (this.urlKeyCache?.items === items) return this.urlKeyCache.keys;\n const used = new Map<string, number>();\n const keys = items.map((item) => {\n const base = item.id ?? tabUrlKey(item.label);\n const taken = used.get(base) ?? 0;\n used.set(base, taken + 1);\n return taken === 0 ? base : `${base}-${taken + 1}`;\n });\n this.urlKeyCache = {items, keys};\n return keys;\n }\n}\n","<div class=\"mb-10\">\n <div\n #scrollContainer\n (scroll)=\"updateEdgeFades()\"\n class=\"flex justify-start scrollbar-hide\"\n [class.overflow-x-auto]=\"scrollable\"\n [class.overflow-y-hidden]=\"scrollable\"\n >\n <div\n #tabList\n role=\"tablist\"\n class=\"tabs relative flex flex-nowrap -mb-[1px] border-b border-base-300\"\n [class.w-full]=\"justified\"\n >\n <!--\n Shared sliding indicator: a single underline that travels to the active\n tab, rather than each tab flipping its own border on/off (which snaps).\n Pinned to left-0/top-auto so offsetLeft maps 1:1 regardless of the\n flex justify-content or the justified full-width layout; position and\n width are measured and set from TS. Sits on the same baseline as the\n hover ::after so hover → select reads as one continuous underline.\n -->\n <div\n #indicator\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute left-0 top-auto bottom-0 h-[2px] w-0 bg-primary opacity-0 transition-[transform,width] duration-300 ease-out motion-reduce:transition-none\"\n ></div>\n @if (isLoadingState) {\n @for (i of skeletonTabs; track i) {\n <div\n [class.flex-1]=\"justified\"\n class=\"tab px-4 py-2 border-b-2 border-transparent flex items-center justify-center\"\n >\n <mn-skeleton [data]=\"{ shape: 'rectangle', width: '4.5rem', height: '1rem' }\"></mn-skeleton>\n </div>\n }\n } @else {\n @for (item of dataSource.items; track item.label) {\n <!-- One Tab stop per bar (the active tab); the arrow keys, Home and End move between\n tabs and activate them, the WAI-ARIA tabs pattern. Every tab used to be its own\n Tab stop with no arrow keys, so crossing an eight-tab bar took eight presses. -->\n <div\n (click)=\"setActive(item)\"\n (keydown)=\"onTabKeydown($event, item)\"\n [attr.aria-selected]=\"currentActive === item\"\n [attr.tabindex]=\"isTabStop(item) ? 0 : -1\"\n [class.hover:after:scale-x-100]=\"currentActive !== item\"\n [class.flex-1]=\"justified\"\n [class.font-bold]=\"currentActive === item\"\n [class.text-base-content]=\"currentActive !== item\"\n [class.text-primary]=\"currentActive === item\"\n class=\"tab relative px-4 py-2 border-b-2 border-transparent cursor-pointer select-none transition-colors whitespace-nowrap text-center flex items-center gap-2 after:content-[''] after:absolute after:inset-x-0 after:-bottom-[2px] after:h-[2px] after:bg-primary/60 after:origin-center after:scale-x-0 after:transition-transform after:duration-300 after:ease-out\"\n role=\"tab\"\n >\n {{ item.label | mnTranslate }}\n @let badge = getBadge(item);\n @if (badge && badge > 0) {\n <span [data]=\"{ size: 'sm', color: 'accent', variant: 'fill' }\" mnBadge>{{ badge }}</span>\n }\n </div>\n }\n }\n </div>\n </div>\n</div>\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type Quill from 'quill';\nimport {MnLanguageService} from '../../language';\nimport {MnRichTextEditorControl, MnRichTextEditorLabels, MnRichTextEditorToolbar,} from './mn-rich-text-editor.types';\n\n/**\n * Toolbar the editor renders when the consumer does not supply one. Deliberately\n * small: it covers written prose, so there is no colour picker, no font picker\n * and no image embedding (an image needs an upload and storage path the editor\n * knows nothing about).\n */\nconst DEFAULT_TOOLBAR: MnRichTextEditorToolbar = [\n [{header: [2, 3, false]}],\n ['bold', 'italic', 'underline', 'strike'],\n [{list: 'ordered'}, {list: 'bullet'}],\n ['blockquote', 'code-block'],\n ['link'],\n ['clean'],\n];\n\n/** Where each control sits in the toolbar Quill builds. */\nconst CONTROL_SELECTORS: Record<MnRichTextEditorControl, string> = {\n textStyle: '.ql-header .ql-picker-label',\n bold: 'button.ql-bold',\n italic: 'button.ql-italic',\n underline: 'button.ql-underline',\n strike: 'button.ql-strike',\n orderedList: 'button.ql-list[value=\"ordered\"]',\n bulletList: 'button.ql-list[value=\"bullet\"]',\n blockquote: 'button.ql-blockquote',\n codeBlock: 'button.ql-code-block',\n link: 'button.ql-link',\n clean: 'button.ql-clean',\n};\n\n/** Hover labels used when the consumer supplies neither a label nor a key. */\nconst DEFAULT_LABELS: Record<MnRichTextEditorControl, string> = {\n textStyle: 'Text style',\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n strike: 'Strikethrough',\n orderedList: 'Numbered list',\n bulletList: 'Bulleted list',\n blockquote: 'Quote',\n codeBlock: 'Code block',\n link: 'Link',\n clean: 'Clear formatting',\n};\n\n/** Quill's document when it holds no text; treated as an empty value. */\nconst EMPTY_DOCUMENT = '<p><br></p>';\n\n/**\n * Thin wrapper around the {@link Quill} rich-text editor.\n *\n * Quill is used **directly** rather than through an Angular wrapper package: the\n * wrapper libraries carry peer-dependency ranges that lag behind Angular's\n * release train, and none of them add anything this component needs.\n *\n * Consumers must install `quill` themselves (it is an optional peer dependency)\n * and load its snow theme, e.g. `node_modules/quill/dist/quill.snow.css` in the\n * `styles` array of `angular.json`. Only the chrome around that theme — radius,\n * borders, height limits and the toolbar tooltips — belongs to this component;\n * recolouring Quill's own palette to an app theme stays with the app, because\n * the same `.ql-snow` markup is normally reused to render stored HTML in places\n * where no editor is mounted.\n *\n * Quill itself is pulled in with a dynamic `import()` when the editor mounts.\n * This component sits in the library's single entry point, which apps import\n * eagerly, so a static import would put the whole editor engine in every app's\n * initial bundle — including the pages that never open one.\n *\n * Zoneless notes: nothing here relies on an implicit change-detection tick. The\n * editor is created inside {@link afterNextRender} (the host element only exists\n * after the first render pass) and every value that flows back out is written to\n * a signal or emitted through an `output`, both of which schedule change\n * detection themselves. No `setTimeout`, no manual `detectChanges`.\n *\n * The produced HTML is **not** trusted: sanitise it before rendering it anywhere.\n *\n * @example\n * ```html\n * <mn-rich-text-editor\n * [content]=\"draft()\"\n * [placeholder]=\"'minutes.placeholder' | mnTranslate\"\n * [labelKeys]=\"{ bold: 'editor.bold', italic: 'editor.italic' }\"\n * (contentChange)=\"draft.set($event)\">\n * </mn-rich-text-editor>\n * ```\n */\n@Component({\n selector: 'mn-rich-text-editor',\n standalone: true,\n templateUrl: './mn-rich-text-editor.component.html',\n styleUrl: './mn-rich-text-editor.component.css',\n // Quill builds its DOM at runtime, so those elements never carry Angular's\n // scoping attribute and an encapsulated stylesheet could never reach them.\n // Every rule in the stylesheet is scoped by `.mn-rich-text-editor` instead.\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MnRichTextEditor implements OnDestroy {\n /**\n * The initial HTML content. Later changes are applied only when they differ\n * from what the editor currently holds, so a parent echoing the emitted value\n * back never moves the caret.\n */\n public readonly content = input<string>('');\n /** Placeholder shown while the editor is empty. */\n public readonly placeholder = input<string>('');\n /** Accessible label for the editing surface. */\n public readonly ariaLabel = input<string>('');\n /** Toolbar layout, in Quill's own format. Defaults to a prose-oriented set. */\n public readonly toolbar = input<MnRichTextEditorToolbar>(DEFAULT_TOOLBAR);\n /** Literal hover labels per toolbar control. */\n public readonly labels = input<MnRichTextEditorLabels>({});\n /** Translation keys per toolbar control; takes precedence over `labels`. */\n public readonly labelKeys = input<MnRichTextEditorLabels>({});\n /**\n * Utilities applied to the wrapper, for sizing the writing surface. Overriding\n * this replaces the default height limits, so pass both bounds when you do.\n */\n public readonly editorClass = input<string>(\n '[&_.ql-editor]:max-h-104 [&_.ql-editor]:min-h-72 [&_.ql-editor]:overflow-y-auto',\n );\n /** Emits the editor's HTML on every user edit. */\n public readonly contentChange = output<string>();\n /**\n * Chrome around Quill's snow theme: the field's radius, border and surface.\n *\n * Descendant variants rather than a stylesheet — the utilities come from the\n * consuming app's Tailwind build (which scans this bundle), so they follow the\n * app's theme tokens the same way the rest of the library does.\n */\n protected readonly chromeClass =\n '[&_.ql-container.ql-snow]:rounded-b-xl [&_.ql-container.ql-snow]:border-base-300 ' +\n '[&_.ql-container.ql-snow]:bg-base-100 [&_.ql-container.ql-snow]:text-base ' +\n '[&_.ql-toolbar.ql-snow]:rounded-t-xl [&_.ql-toolbar.ql-snow]:border-base-300 ' +\n '[&_.ql-toolbar.ql-snow]:bg-base-100';\n /** Host element, used to keep DOM queries inside this component. */\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Language service, used to resolve the toolbar labels from keys. */\n private readonly lang = inject(MnLanguageService);\n /** The container Quill mounts into. */\n private readonly editorHost = viewChild.required<ElementRef<HTMLElement>>('editorHost');\n /** The live editor instance, or null before Quill has loaded. */\n private quill: Quill | null = null;\n\n /** Whether the component is gone, so a late Quill load knows to stop. */\n private destroyed = false;\n\n /** The last HTML this component emitted, used to skip redundant writes. */\n private readonly lastEmitted = signal<string>('');\n\n constructor() {\n afterNextRender(() => void this.createEditor());\n // Push a changed `content` input into a live editor. `lastEmitted` is read\n // `untracked` on purpose: it must gate the write (skip when the incoming HTML\n // already matches what we hold) WITHOUT making the effect depend on it. If it\n // were tracked, every keystroke (which updates `lastEmitted`) would re-run the\n // effect and re-paste the now-stale `content` seed — wiping the user's typing\n // and resetting the caret after any wholesale reseed.\n effect(() => {\n const incoming = this.content();\n if (!this.quill || incoming === untracked(this.lastEmitted)) return;\n this.setEditorHtml(incoming);\n });\n }\n\n /** Drops the editor reference so the instance can be garbage collected. */\n ngOnDestroy(): void {\n this.destroyed = true;\n this.quill = null;\n }\n\n /** Moves focus into the editing surface. */\n public focusEditor(): void {\n this.quill?.focus();\n if (!this.quill) {\n this.host.nativeElement.querySelector<HTMLElement>('.ql-editor')?.focus();\n }\n }\n\n /**\n * Loads Quill, builds the instance and wires its change handler.\n *\n * Nothing awaits this beyond the component itself: the surface appears once\n * the engine has loaded, and until then the `content` effect is a no-op that\n * the seeding below makes good.\n */\n private async createEditor(): Promise<void> {\n const {default: QuillEditor} = await import('quill');\n if (this.destroyed) return;\n const container = this.editorHost().nativeElement;\n this.quill = new QuillEditor(container, {\n theme: 'snow',\n placeholder: this.placeholder(),\n modules: {toolbar: this.toolbar() as unknown[]},\n });\n const label = this.ariaLabel();\n if (label) {\n this.quill.root.setAttribute('aria-label', label);\n }\n this.applyToolbarLabels();\n this.setEditorHtml(this.content());\n this.quill.on('text-change', () => this.emitCurrentHtml());\n }\n\n /**\n * Gives each toolbar control a hover label, so hovering explains what the\n * style does. Set on the Quill-generated DOM after init; a control the current\n * toolbar does not render is simply skipped.\n */\n private applyToolbarLabels(): void {\n const toolbar = this.host.nativeElement.querySelector('.ql-toolbar');\n if (!toolbar) return;\n const labels = this.labels();\n const keys = this.labelKeys();\n for (const [control, selector] of Object.entries(CONTROL_SELECTORS)) {\n const element = toolbar.querySelector(selector);\n if (!element) continue;\n element.classList.add('mn-rte-tooltip');\n element.setAttribute(\n 'data-tip',\n this.resolveLabel(control as MnRichTextEditorControl, labels, keys),\n );\n }\n }\n\n /**\n * Picks the hover label for one control.\n * @param control The control being labelled.\n * @param labels Literal labels supplied by the consumer.\n * @param keys Translation keys supplied by the consumer.\n * @returns The translated key, the literal label, or the built-in default.\n */\n private resolveLabel(\n control: MnRichTextEditorControl,\n labels: MnRichTextEditorLabels,\n keys: MnRichTextEditorLabels,\n ): string {\n const key = keys[control];\n if (key) {\n // `t()` echoes the key back when the consumer has no translation for it;\n // that is a miss, not a label, so fall through to the remaining sources.\n const translated = this.lang.t(key);\n if (translated !== key) return translated;\n }\n return labels[control] ?? DEFAULT_LABELS[control];\n }\n\n /**\n * Replaces the editor content with stored HTML. Quill parses it into its own\n * document model, which silently drops anything it has no format for — a\n * useful extra filter on top of the consumer's sanitiser.\n * @param html The HTML to load into the editor.\n */\n private setEditorHtml(html: string): void {\n if (!this.quill) return;\n // `dangerouslyPasteHTML` is Quill's documented name for \"parse this HTML\".\n this.quill.clipboard.dangerouslyPasteHTML(html ?? '', 'silent');\n this.lastEmitted.set(this.readHtml());\n }\n\n /** Emits the editor's current HTML, normalising Quill's \"empty\" document. */\n private emitCurrentHtml(): void {\n const html = this.readHtml();\n this.lastEmitted.set(html);\n this.contentChange.emit(html);\n }\n\n /**\n * Reads the editor's HTML.\n * @returns The current HTML, or an empty string when the editor is blank.\n */\n private readHtml(): string {\n if (!this.quill) return '';\n // Quill leaves an empty paragraph behind after a clear; treat that as empty\n // so an untouched editor does not count as authored content.\n const html = this.quill.root.innerHTML;\n return html === EMPTY_DOCUMENT ? '' : html;\n }\n}\n","<div class=\"mn-rich-text-editor {{ chromeClass }} {{ editorClass() }}\">\n <div #editorHost></div>\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnIconVariants = tv({\n base: 'inline-flex shrink-0',\n variants: {\n color: {\n current: 'text-current',\n primary: 'text-primary',\n secondary: 'text-secondary',\n danger: 'text-error',\n warning: 'text-warning',\n success: 'text-success',\n accent: 'text-accent',\n },\n },\n\n defaultVariants: {\n color: 'current',\n },\n});\n\nexport type MnIconVariants = VariantProps<typeof mnIconVariants>;\n","// Custom SVGs that are NOT available in lucide (https://lucide.dev).\n// For any lucide icon, use the @lucide/angular directive directly instead —\n// e.g. `<svg lucideX [size]=\"18\"></svg>` — rather than adding it here.\n// Sourced from the .svg files in the ./icons/ directory.\nconst pistolSvg = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M8.72 14.56 9 10h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v4c2.5 0 1 4 1 4-4 6-1 6-1 6h3.38a1 1 0 0 0 .89-.55za1 1 0 0 1 .9-.56H13a2 2 0 0 0 2-2v-1a1 1 0 0 1 1-1\" /></svg>`;\n\nexport const MN_ICON_MAP: Record<string, string> = {\n pistol: pistolSvg,\n};\n","import { Component, HostBinding, Input, OnChanges, OnInit, inject, ElementRef } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { MnIconTypes } from './mn-iconTypes';\nimport { mnIconVariants } from './mn-iconVariants';\nimport { MN_ICON_MAP } from './mn-icon-map';\n\n@Component({\n selector: 'mn-icon',\n standalone: true,\n templateUrl: './mn-icon.html',\n})\nexport class MnIcon implements OnChanges, OnInit {\n @Input() data: Partial<MnIconTypes> = {};\n\n private sanitizer = inject(DomSanitizer);\n private el = inject(ElementRef);\n\n svgContent: SafeHtml = '';\n\n get iconSize(): number {\n return this.data.size ?? 24;\n }\n\n @HostBinding('class')\n get hostClasses(): string {\n return mnIconVariants({\n color: this.data.color,\n });\n }\n\n private resolvedName: string | null = null;\n\n ngOnInit(): void {\n const attrs = this.el.nativeElement.attributes;\n for (const item of Array.from<Attr>(attrs)) {\n const attr = item.name.toLowerCase();\n if (attr.startsWith('mnicon')) {\n const iconKey = attr.slice('mnicon'.length);\n for (const key of Object.keys(MN_ICON_MAP)) {\n if (key.toLowerCase() === iconKey) {\n this.resolvedName = key;\n break;\n }\n }\n if (this.resolvedName) break;\n }\n }\n this.updateContent();\n }\n\n ngOnChanges(): void {\n this.updateContent();\n }\n\n private updateContent(): void {\n const name = this.data.name ?? this.resolvedName;\n if (name) {\n const raw = MN_ICON_MAP[name];\n if (raw) {\n const size = this.iconSize;\n const isFullSvg = raw.trim().startsWith('<svg');\n if (isFullSvg) {\n const sized = raw.replace(/<svg([^>]*)>/, (_match: string, attrs: string) => {\n let updated = attrs.replace(/width=\"[^\"]*\"/, `width=\"${size}\"`);\n updated = updated.replace(/height=\"[^\"]*\"/, `height=\"${size}\"`);\n if (!attrs.includes('width=')) updated += ` width=\"${size}\"`;\n if (!attrs.includes('height=')) updated += ` height=\"${size}\"`;\n return `<svg${updated}>`;\n });\n this.svgContent = this.sanitizer.bypassSecurityTrustHtml(sized);\n } else {\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${raw}</svg>`;\n this.svgContent = this.sanitizer.bypassSecurityTrustHtml(svg);\n }\n } else {\n this.svgContent = '';\n }\n } else {\n this.svgContent = '';\n }\n }\n}\n","<span\n [style.width.px]=\"iconSize\"\n [style.height.px]=\"iconSize\"\n style=\"display: inline-flex; align-items: center; justify-content: center;\"\n [innerHTML]=\"svgContent\"\n></span>\n","import { Directive } from '@angular/core';\n\n// AUTO-GENERATED — do not edit manually.\n// Run `npm run generate:icons` to regenerate after modifying MN_ICON_MAP.\n@Directive({\n selector: 'mn-icon[mnIconPistol]',\n standalone: true,\n})\nexport class MnIconAttributes {}\n","import { tv, type VariantProps } from 'tailwind-variants';\n\n/**\n * Styling for {@link MnBreadcrumbs}, expressed as tailwind-variants slots so the\n * template can pull one class string per role. Theme tokens only, so the trail\n * reads correctly in both light and dark. Links and the Back control are native\n * `<button>`/`<a>` elements reset to look like plain text with a hover accent.\n */\nexport const mnBreadcrumbsVariants = tv({\n slots: {\n root: 'flex items-center',\n list: 'flex flex-wrap items-center',\n link:\n 'inline-flex items-center bg-transparent border-0 p-0 rounded-md cursor-pointer ' +\n 'text-base-content/60 hover:text-primary transition-colors ' +\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n current: 'inline-flex items-center font-semibold text-base-content',\n separator: 'inline-flex shrink-0 text-base-content/40',\n back:\n 'inline-flex items-center gap-1 bg-transparent border-0 p-0 rounded-md cursor-pointer ' +\n 'text-base-content/70 hover:text-primary transition-colors ' +\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n },\n variants: {\n size: {\n // Text size lives on the root so every crumb, separator and the Back\n // control inherit it; only the inter-crumb gap changes per slot.\n sm: { root: 'text-xs', list: 'gap-1' },\n md: { root: 'text-sm', list: 'gap-1.5' },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nexport type MnBreadcrumbsVariants = VariantProps<typeof mnBreadcrumbsVariants>;\n","import {Component, EventEmitter, inject, Input, Output} from '@angular/core';\nimport {LucideChevronLeft, LucideChevronRight} from '@lucide/angular';\nimport {MnLanguageService, MnTranslatePipe} from '../../language';\nimport {MnBreadcrumbItem, MnBreadcrumbsData} from './mn-breadcrumbsTypes';\nimport {mnBreadcrumbsVariants} from './mn-breadcrumbsVariants';\n\n/**\n * A flexible breadcrumb trail.\n *\n * Given crumbs it renders a linkable trail (`root › … › current`) where the last\n * crumb is the current page and is never a link. Given no crumbs it degrades to\n * a single \"Back\" control — the two are mutually exclusive. \"Flexible\" here is\n * input-driven, not viewport-driven: there is deliberately no responsive\n * collapse, no scroll machinery — it is a list of links plus a fallback.\n *\n * Navigation stays router- and history-agnostic where possible: a crumb (or the\n * Back control) with an `href` renders a plain `<a>` and navigates natively;\n * otherwise clicks emit outputs for the app to handle. Only the Back fallback\n * with no `href` reaches for `history.back()`.\n */\n@Component({\n selector: 'mn-breadcrumbs',\n standalone: true,\n imports: [MnTranslatePipe, LucideChevronLeft, LucideChevronRight],\n templateUrl: './mn-breadcrumbs.html',\n})\nexport class MnBreadcrumbs {\n /** Trail crumbs and Back-fallback configuration. */\n @Input() data: MnBreadcrumbsData = { items: [] };\n\n /** Emits the crumb that was clicked (non-current crumbs only). */\n @Output() crumbClick = new EventEmitter<MnBreadcrumbItem>();\n\n /** Emits when the fallback \"Back\" control is activated. */\n @Output() back = new EventEmitter<void>();\n\n /** Conventional key an app defines to translate the Back control's label. */\n private static readonly BACK_LABEL_KEY = 'mnBreadcrumbs.back';\n /** Conventional key an app defines to name the navigation landmark. */\n private static readonly NAV_LABEL_KEY = 'mnBreadcrumbs.label';\n /** Resolves this component's own labels against the app's bundle. */\n private readonly lang = inject(MnLanguageService);\n\n /** Resolved tailwind-variants slot functions for the current size. */\n get styles() {\n return mnBreadcrumbsVariants({ size: this.data.size });\n }\n\n /**\n * Accessible name of the `<nav>` landmark.\n *\n * A landmark's name is announced verbatim, so leaving it as a hardcoded English\n * \"Breadcrumb\" put one English word into every page of a translated app — in the\n * one place only screen-reader users hear.\n */\n get navLabel(): string {\n return this.lang.translateIfPresent(MnBreadcrumbs.NAV_LABEL_KEY) ?? 'Breadcrumb';\n }\n\n /** Whether a linkable trail should render (vs the Back fallback). */\n get hasTrail(): boolean {\n return (this.data.items?.length ?? 0) > 0;\n }\n\n /**\n * Text of the Back control, already translated.\n *\n * `data.backLabel` is a key (or a literal, which `translate` passes through\n * unchanged). Without one this falls back to the conventional key and then to\n * English — never to a raw key: the old default was the bare key `'back'`, which\n * the template's translate pipe echoed as lowercase \"back\" in every app that had\n * not happened to define it.\n */\n get backLabel(): string {\n if (this.data.backLabel) {\n return this.lang.translate(this.data.backLabel);\n }\n return this.lang.translateIfPresent(MnBreadcrumbs.BACK_LABEL_KEY) ?? 'Back';\n }\n\n /** The last crumb is the current page and is rendered as plain text. */\n isCurrent(index: number): boolean {\n return index === this.data.items.length - 1;\n }\n\n /** Runs a crumb's own callback and notifies listeners of the click. */\n onCrumb(item: MnBreadcrumbItem): void {\n item.onClick?.();\n this.crumbClick.emit(item);\n }\n\n /**\n * Fallback Back action. Always emits `back` for listeners; when no `backHref`\n * anchor is carrying the navigation, steps back through browser history.\n */\n onBack(): void {\n this.back.emit();\n if (!this.data.backHref) {\n window.history.back();\n }\n }\n}\n","<nav [attr.aria-label]=\"navLabel\" [class]=\"styles.root()\">\n @if (hasTrail) {\n <ol [class]=\"styles.list()\">\n @for (item of data.items; track $index; let first = $first) {\n @if (!first) {\n <li aria-hidden=\"true\" [class]=\"styles.separator()\">\n <svg [size]=\"14\" lucideChevronRight></svg>\n </li>\n }\n <li class=\"inline-flex items-center\">\n @if (isCurrent($index)) {\n <span aria-current=\"page\" [class]=\"styles.current()\">{{ item.label | mnTranslate }}</span>\n } @else if (item.href) {\n <a [attr.href]=\"item.href\" [class]=\"styles.link()\" (click)=\"onCrumb(item)\">{{ item.label | mnTranslate }}</a>\n } @else {\n <button type=\"button\" [class]=\"styles.link()\" (click)=\"onCrumb(item)\">{{ item.label | mnTranslate }}</button>\n }\n </li>\n }\n </ol>\n } @else if (data.backHref) {\n <a [attr.href]=\"data.backHref\" [class]=\"styles.back()\" (click)=\"onBack()\">\n <svg [size]=\"16\" lucideChevronLeft></svg>\n {{ backLabel }}\n </a>\n } @else {\n <button type=\"button\" [class]=\"styles.back()\" (click)=\"onBack()\">\n <svg [size]=\"16\" lucideChevronLeft></svg>\n {{ backLabel }}\n </button>\n }\n</nav>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\n/**\n * Styling for {@link MnSegmented}, expressed as tailwind-variants slots so the\n * template pulls one class string per role.\n *\n * The control is a track with the active choice raised out of it, rather than a\n * row of loose buttons: the segments share one bordered surface, so they read as\n * one control with one answer instead of several independent actions. Theme\n * tokens only, so it holds up in both light and dark.\n *\n * Each segment is an `mnButton`, which owns its own size, colour, radius and\n * disabled look; the `segment` slot adds only what the button does not know\n * about — how it sits inside the track.\n */\nexport const mnSegmentedVariants = tv({\n slots: {\n root: 'inline-flex items-center gap-0.5 border border-base-300 bg-base-200 p-0.5',\n segment:\n 'gap-1.5 select-none ' +\n 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n },\n variants: {\n /**\n * Corner rounding of the track. The segments are rounded one step tighter\n * (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside\n * the track's own corner instead of poking out of it. Token names match\n * mn-button's; `full` makes a pill, where track and segment share the same\n * fully-rounded ends.\n */\n borderRadius: {\n none: { root: 'rounded-none' },\n xs: { root: 'rounded-xs' },\n sm: { root: 'rounded-sm' },\n md: { root: 'rounded-md' },\n lg: { root: 'rounded-lg' },\n xl: { root: 'rounded-xl' },\n two_xl: { root: 'rounded-2xl' },\n three_xl: { root: 'rounded-3xl' },\n four_xl: { root: 'rounded-4xl' },\n full: { root: 'rounded-full' },\n },\n /**\n * Stretch the track and share its width evenly between the segments.\n *\n * The segments grow from a zero basis but keep their automatic minimum, so a\n * justified control inside an auto-width parent still asks for the room its\n * labels need. Letting them shrink below their content (`min-w-0`) made the\n * parent resolve to a narrower box and truncated the labels instead.\n */\n justified: {\n true: { root: 'flex w-full', segment: 'flex-1' },\n false: {},\n },\n /**\n * Whether the segment is the picked one. The colours come from the button\n * itself (a filled primary button when active, a ghost one otherwise); this\n * only keeps an inactive segment's box the same size as an active one, whose\n * fill variant carries a real border.\n */\n active: {\n true: {},\n false: { segment: 'border border-transparent' },\n },\n },\n defaultVariants: {\n borderRadius: 'lg',\n justified: false,\n active: false,\n },\n});\n\nexport type MnSegmentedVariants = VariantProps<typeof mnSegmentedVariants>;\n","import { Component, EventEmitter, inject, Input, Output, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { LucideDynamicIcon } from '@lucide/angular';\nimport { MnLanguageService, MnTranslatePipe } from '../../language';\nimport { MnButton, MnButtonTypes } from '../mn-button';\nimport { MnSegmentedDataSource, MnSegmentedItem } from './mn-segmentedTypes';\nimport { MnSegmentedVariants, mnSegmentedVariants } from './mn-segmentedVariants';\n\n/** Icon edge length per size, so a segment's glyph matches its own text. */\nconst ICON_SIZE: Record<'sm' | 'md', number> = { sm: 16, md: 18 };\n\n/**\n * Segment radius per track radius: one step tighter, so a filled segment nests\n * inside the track's corner instead of poking out of it. A pill has no tighter\n * step, so its segments are pills too.\n */\nconst SEGMENT_RADIUS: Record<\n NonNullable<MnSegmentedVariants['borderRadius']>,\n NonNullable<MnButtonTypes['borderRadius']>\n> = {\n none: 'none',\n xs: 'none',\n sm: 'xs',\n md: 'sm',\n lg: 'md',\n xl: 'lg',\n two_xl: 'xl',\n three_xl: 'two_xl',\n four_xl: 'three_xl',\n full: 'full',\n};\n\n/**\n * A segmented control: two or three mutually exclusive choices sharing one\n * track, of which exactly one is active — a view switch (list ⇄ calendar), a\n * scope switch (mine ⇄ everyone), a range switch (week ⇄ month).\n *\n * The selection is **controlled**: the component renders whatever\n * {@link value} says and emits {@link valueChange} on a click, so the consumer's\n * own state stays the single source of truth for what is on screen. It keeps no\n * copy of the selection, and — unlike `mn-tab` — it does not mirror one into the\n * URL, so it can sit on a page that already has a tab bar without the two\n * fighting over the query string.\n *\n * Each segment is an `mnButton` — a filled primary one when active, a ghost one\n * otherwise — so the control inherits the button's sizes, colours and disabled\n * look rather than maintaining a parallel set.\n *\n * For switching between panes of a page, reach for `mn-tab`; this is for\n * switching how one pane is rendered.\n */\n@Component({\n selector: 'mn-segmented',\n standalone: true,\n imports: [MnButton, MnTranslatePipe, NgTemplateOutlet, LucideDynamicIcon],\n templateUrl: './mn-segmented.html',\n})\nexport class MnSegmented {\n /** The choices and how the group is labelled and scaled. */\n @Input({ required: true }) dataSource!: MnSegmentedDataSource;\n\n /**\n * Value of the active segment. No value (or one naming no segment) leaves the\n * control with nothing active, which is what an unresolved selection should\n * look like — the component never picks one on the consumer's behalf.\n */\n @Input() value?: string;\n\n /**\n * Whether the segments stretch to fill the available width. Defaults to false,\n * so the control hugs its content and can be parked at the end of a row; turn\n * it on where it should span its container, typically on a narrow screen.\n */\n @Input() justified = false;\n\n /** Emits the picked segment's value. The consumer decides what to do with it. */\n @Output() valueChange = new EventEmitter<string>();\n\n /** Resolves this control's own accessible names against the app's bundle. */\n private readonly lang = inject(MnLanguageService);\n\n /** Resolved slot classes for the current rounding and layout. */\n get styles() {\n return mnSegmentedVariants({\n borderRadius: this.dataSource.borderRadius,\n justified: this.justified,\n });\n }\n\n /** Icon edge length matching the control's text size. */\n get iconSize(): number {\n return ICON_SIZE[this.dataSource.size ?? 'md'];\n }\n\n /** Accessible name of the group, or null when the consumer named nothing. */\n get groupLabel(): string | null {\n const key = this.dataSource.ariaLabel;\n return key ? this.lang.translate(key) : null;\n }\n\n /**\n * Whether `item` is the active choice.\n * @param item - The segment to test.\n */\n isActive(item: MnSegmentedItem): boolean {\n return item.value === this.value;\n }\n\n /**\n * Layout classes for one segment — how it sits in the track. Its size, colour,\n * radius and disabled look come from the button itself; see\n * {@link segmentButton}.\n * @param item - The segment to style.\n */\n segmentClass(item: MnSegmentedItem): string {\n return mnSegmentedVariants({\n justified: this.justified,\n active: this.isActive(item),\n }).segment();\n }\n\n /**\n * The `mnButton` configuration of one segment: a filled primary button when it\n * is the active choice, a ghost button otherwise, at the control's size and one\n * radius step inside the track. The active segment has no hover — re-picking it\n * does nothing, so nothing should invite the click.\n * @param item - The segment to configure.\n */\n segmentButton(item: MnSegmentedItem): Partial<MnButtonTypes> {\n const active = this.isActive(item);\n return {\n size: this.dataSource.size ?? 'md',\n variant: active ? 'fill' : 'ghost',\n color: active ? 'primary' : 'gray',\n hover: !active,\n borderRadius: SEGMENT_RADIUS[this.dataSource.borderRadius ?? 'lg'],\n disabled: item.disabled ?? false,\n };\n }\n\n /**\n * Accessible name for an icon-only segment, or null when the segment shows a\n * label — that label already names it, and a second name would only compete.\n * @param item - The segment to name.\n */\n segmentLabel(item: MnSegmentedItem): string | null {\n if (item.label || !item.ariaLabel) return null;\n return this.lang.translate(item.ariaLabel);\n }\n\n /**\n * Whether an icon was supplied as a `TemplateRef` rather than lucide icon data.\n * @param value - The icon to test.\n */\n isTemplateRef(value: unknown): value is TemplateRef<unknown> {\n return value instanceof TemplateRef;\n }\n\n /**\n * Announces a click. Re-picking the active segment is silent: it is not a\n * change, and a consumer that reloads on every emission would refetch for\n * nothing.\n * @param item - The segment that was clicked.\n */\n select(item: MnSegmentedItem): void {\n if (item.disabled || this.isActive(item)) return;\n this.valueChange.emit(item.value);\n }\n}\n","<!-- One control, one answer: `role=\"group\"` with `aria-pressed` per segment, so\n the picked choice is announced as pressed rather than as a plain button\n nobody can tell the state of. Not a radiogroup — these are buttons that act\n immediately, not a value being edited inside a form. -->\n<div [attr.aria-label]=\"groupLabel\" [class]=\"styles.root()\" role=\"group\">\n @for (item of dataSource.items; track item.value) {\n <!-- Each segment is an mn-button: the active one a filled primary button, the\n rest ghost buttons, so the control shares the button's sizes, colours and\n disabled look instead of re-deriving them. -->\n <button\n mnButton\n (click)=\"select(item)\"\n [attr.aria-label]=\"segmentLabel(item)\"\n [attr.aria-pressed]=\"isActive(item)\"\n [class]=\"segmentClass(item)\"\n [data]=\"segmentButton(item)\"\n type=\"button\"\n >\n @if (item.icon; as icon) {\n <span class=\"inline-flex shrink-0 items-center\">\n <!-- A caller's template, else lucide data rendered at the size that\n matches this control's text — the same icon convention the\n dropdown's actions use. -->\n @if (isTemplateRef(icon)) {\n <ng-container [ngTemplateOutlet]=\"icon\"></ng-container>\n } @else {\n <svg [lucideIcon]=\"$any(icon)\" [size]=\"iconSize\"></svg>\n }\n </span>\n }\n @if (item.label; as label) {\n <span class=\"truncate\">{{ label | mnTranslate }}</span>\n }\n </button>\n }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\n/**\n * Styling for {@link MnIconChip}: one 10% wash of the colour behind an icon drawn in\n * the consumer's `--color-<colour>-text` token when it defines one (the shade it uses\n * for readable coloured text on a tinted ground) and in the base colour otherwise, the\n * same device `mnBadge` uses. The radius grows with the box so the corner reads the\n * same at every size.\n */\nexport const mnIconChipVariants = tv({\n base: 'inline-flex shrink-0 items-center justify-center',\n variants: {\n /**\n * `xs` for compact rows and inline labels, `sm` for list rows, `md` for section-card headers\n * and stat tiles, `lg` for page headers, `xl` for a lone hero or empty-state icon.\n */\n size: {\n xs: 'h-8 w-8 rounded-lg',\n sm: 'h-9 w-9 rounded-lg',\n md: 'h-10 w-10 rounded-xl',\n lg: 'h-12 w-12 rounded-2xl',\n xl: 'h-14 w-14 rounded-2xl',\n },\n color: {\n primary: 'bg-primary/10 text-(--color-primary-text,var(--color-primary))',\n secondary: 'bg-secondary/10 text-(--color-secondary-text,var(--color-secondary))',\n accent: 'bg-accent/10 text-(--color-accent-text,var(--color-accent))',\n success: 'bg-success/10 text-(--color-success-text,var(--color-success))',\n warning: 'bg-warning/10 text-(--color-warning-text,var(--color-warning))',\n danger: 'bg-error/10 text-(--color-error-text,var(--color-error))',\n gray: 'bg-base-content/10 text-base-content/70',\n },\n },\n defaultVariants: {\n size: 'md',\n color: 'primary',\n },\n});\n\nexport type MnIconChipVariants = VariantProps<typeof mnIconChipVariants>;\n","import { Component, HostBinding, Input } from '@angular/core';\nimport { MnIconChipTypes } from './mn-icon-chipTypes';\nimport { mnIconChipVariants } from './mn-icon-chipVariants';\n\n/**\n * The tinted square that carries an icon in front of a card title, a stat or a list\n * row: the one place a colour says \"what kind of thing this is\". Project the icon as\n * content; the chip sizes and tints itself and never grows with the row.\n *\n * Decorative for assistive technology: the title or label beside it carries the\n * meaning, so the chip is `aria-hidden` and a screen reader never meets a bare icon.\n *\n * ```html\n * <mn-icon-chip [data]=\"{ color: 'success', size: 'md' }\">\n * <svg lucideCheck [size]=\"20\"></svg>\n * </mn-icon-chip>\n * ```\n */\n@Component({\n selector: 'mn-icon-chip',\n standalone: true,\n templateUrl: './mn-icon-chip.html',\n host: { 'aria-hidden': 'true' },\n})\nexport class MnIconChip {\n /** Size and colour; see {@link MnIconChipTypes}. */\n @Input() data: Partial<MnIconChipTypes> = {};\n\n /** The chip's own classes; the consumer's static classes merge with them. */\n @HostBinding('class')\n get hostClasses(): string {\n return mnIconChipVariants({\n size: this.data.size,\n color: this.data.color,\n });\n }\n}\n","<ng-content></ng-content>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\n/**\n * Styling for {@link MnCard}, as tailwind-variants slots: `root` is the card element\n * itself, `accent` the optional bar along its top edge, `header` the heading row and\n * `title` the `h2` inside it.\n *\n * Theme tokens only, so the card holds up in light and dark. The surface reads the\n * consumer's `--color-base-card` when it defines one (a card ground a step off the\n * page background) and falls back to `base-100` otherwise, the same fallback device\n * `mnBadge` uses for its `-text` tokens.\n */\nexport const mnCardVariants = tv({\n slots: {\n root:\n 'relative flex overflow-hidden border border-base-300 ' +\n 'bg-(--color-base-card,var(--color-base-100)) transition-all duration-200 motion-reduce:transition-none',\n accent: 'absolute inset-x-0 top-0 h-1',\n header: 'flex flex-wrap items-center gap-3',\n title: 'text-lg font-semibold text-base-content',\n },\n variants: {\n /**\n * Inner padding, and with it the gap between the card's children: a tile needs\n * less air than a section card, and a section card that had to say `gap-4` on\n * every use would drift.\n */\n padding: {\n sm: { root: 'p-4 gap-3' },\n md: { root: 'p-5 gap-4' },\n lg: { root: 'p-6 gap-5' },\n },\n /** How the children flow: stacked (the default) or on one line, centred. */\n layout: {\n column: { root: 'flex-col' },\n row: { root: 'flex-row items-center' },\n },\n /**\n * Hover response. `shadow` is a little depth for a card that only sits there;\n * `lift` promises a destination and belongs on a card that is a link.\n */\n hover: {\n none: {},\n shadow: { root: 'hover:shadow-md' },\n lift: { root: 'hover:-translate-y-1 hover:shadow-lg' },\n },\n /**\n * Entrance. `rise` plays the consumer's `--animate-rise` keyframes when its theme\n * defines them (a short rise-in, delayed per card through\n * {@link MnCard.enterDelayMs}) and is a no-op otherwise; reduced-motion users\n * never see it.\n */\n enter: {\n none: {},\n rise: { root: 'animate-rise motion-reduce:animate-none' },\n },\n /** Corner rounding, in mn-button's radius tokens. */\n borderRadius: {\n none: { root: 'rounded-none' },\n xs: { root: 'rounded-xs' },\n sm: { root: 'rounded-sm' },\n md: { root: 'rounded-md' },\n lg: { root: 'rounded-lg' },\n xl: { root: 'rounded-xl' },\n two_xl: { root: 'rounded-2xl' },\n three_xl: { root: 'rounded-3xl' },\n four_xl: { root: 'rounded-4xl' },\n },\n /**\n * Colour of the accent bar and of the heading's icon chip: the same palette as\n * mn-button and the icon chip. What the colour *means* (a kind, a status, a\n * module) is the consumer's choice; the card only renders it.\n */\n color: {\n primary: { accent: 'bg-primary' },\n secondary: { accent: 'bg-secondary' },\n accent: { accent: 'bg-accent' },\n success: { accent: 'bg-success' },\n warning: { accent: 'bg-warning' },\n danger: { accent: 'bg-error' },\n gray: { accent: 'bg-base-content/30' },\n },\n },\n defaultVariants: {\n padding: 'sm',\n layout: 'column',\n hover: 'shadow',\n enter: 'rise',\n borderRadius: 'two_xl',\n color: 'primary',\n },\n});\n\nexport type MnCardVariants = VariantProps<typeof mnCardVariants>;\n","import { Component, HostBinding, Input } from '@angular/core';\nimport { MnTranslatePipe } from '../../language';\nimport { MnIconChip } from './mn-icon-chip';\nimport { MnCardTypes } from './mn-cardTypes';\nimport { mnCardVariants } from './mn-cardVariants';\n\n/**\n * The card: a rounded surface with a hairline border, a hover response and an\n * optional accent bar along its top edge. The body is whatever the consumer projects,\n * so a booking, a competition and a pending-action tile share one look without\n * sharing a view model.\n *\n * It is an attribute as well as an element, like `mnButton` and `mnBadge`: `<mn-card>`\n * for a plain surface, `<a mnCard [routerLink]>` for a card that is a link,\n * `<section mnCard>` when the landmark matters. Extra classes on the host merge with\n * the card's own, so sizing it (`min-w-0 flex-1`, `lg:w-80`) is ordinary CSS on the\n * element, not an input.\n *\n * A **section card** passes a {@link heading}: the card then renders the shared header\n * row, an {@link MnIconChip} beside an `h2`, then whatever trails the title (a badge, a\n * button). Project the icon with the `cardIcon` attribute and group the trailing content\n * in one `cardHeaderEnd` container, so the template reads icon, header end, body:\n *\n * ```html\n * <mn-card [data]=\"{ padding: 'md', color: 'primary' }\" heading=\"meetings.agenda.title\">\n * <svg cardIcon lucideListOrdered [size]=\"20\"></svg>\n * <ng-container cardHeaderEnd>\n * <span mnBadge [data]=\"{ size: 'sm', color: 'warning' }\">Draft</span>\n * </ng-container>\n * ...body...\n * </mn-card>\n * ```\n *\n * The other members of the family build on this shell: {@link MnStatTile} for one\n * figure at a glance, and {@link MnProportionBar} for the bar inside a card.\n */\n@Component({\n selector: 'mn-card, [mnCard]',\n standalone: true,\n imports: [MnIconChip, MnTranslatePipe],\n templateUrl: './mn-card.html',\n})\nexport class MnCard {\n /** Padding, layout, hover, entrance, radius, colour and accent; see {@link MnCardTypes}. */\n @Input() data: Partial<MnCardTypes> = {};\n\n /**\n * Section title, as a translation key or a literal. When set, the header row with\n * the icon chip and `h2` renders above the body. Deliberately not called `title`: a\n * static `title=\"...\"` on the host would also become a browser tooltip.\n */\n @Input() heading?: string;\n\n /**\n * Delay before the entrance animation starts, in milliseconds, so a row of cards\n * can rise one after another. Ignored when {@link MnCardTypes.enter} is `none`.\n */\n @Input() enterDelayMs = 0;\n\n /** Resolved slot classes for the current configuration. */\n get styles() {\n return mnCardVariants({\n padding: this.data.padding,\n layout: this.data.layout,\n hover: this.data.hover,\n enter: this.data.enter,\n borderRadius: this.data.borderRadius,\n color: this.data.color,\n });\n }\n\n /** The card element's own classes; the consumer's static classes merge with them. */\n @HostBinding('class')\n get hostClasses(): string {\n return this.styles.root();\n }\n\n /** Staggers the entrance per card. */\n @HostBinding('style.animation-delay')\n get animationDelay(): string {\n return `${this.enterDelayMs}ms`;\n }\n}\n","<!-- The accent bar sits on the card's top edge, clipped by the host's overflow-hidden\n into the corner radius. Decorative: the colour's meaning is in the content. -->\n@if (data.accent) {\n <span [class]=\"styles.accent()\" aria-hidden=\"true\"></span>\n}\n<!-- The section header: chip, title, then whatever the consumer marks cardHeaderEnd.\n Wraps on narrow screens so a full-width button drops under the title. -->\n@if (heading; as text) {\n <div [class]=\"styles.header()\">\n <mn-icon-chip [data]=\"{ color: data.color }\">\n <ng-content select=\"[cardIcon]\"></ng-content>\n </mn-icon-chip>\n <h2 [class]=\"styles.title()\">{{ text | mnTranslate }}</h2>\n <ng-content select=\"[cardHeaderEnd]\"></ng-content>\n </div>\n}\n<ng-content></ng-content>\n","import { Component, HostBinding, Input } from '@angular/core';\nimport { MnTranslatePipe } from '../../language';\nimport { MnCard } from './mn-card';\nimport { MnIconChip } from './mn-icon-chip';\nimport { MnIconChipVariants } from './mn-icon-chipVariants';\n\n/** Configuration of one {@link MnStatTile}. */\nexport type MnStatTileTypes = {\n /** Colour of the chip; the number itself stays in the base text colour. Defaults to `primary`. */\n color: MnIconChipVariants['color'];\n};\n\n/**\n * One fact at a glance: a tinted icon chip, a muted label and a large tabular number,\n * on the {@link MnCard} shell, in a tile that shares a row with its siblings as\n * `flex-1`. Project the icon as content; project a badge or a short note into the\n * `trailing` slot when the number needs a qualifier.\n *\n * ```html\n * <div class=\"flex flex-wrap gap-4\">\n * <mn-stat-tile label=\"meetings.attending\" [value]=\"yesCount\" [data]=\"{ color: 'success' }\">\n * <svg lucideCheck [size]=\"20\"></svg>\n * </mn-stat-tile>\n * </div>\n * ```\n */\n@Component({\n selector: 'mn-stat-tile',\n standalone: true,\n imports: [MnCard, MnIconChip, MnTranslatePipe],\n templateUrl: './mn-stat-tile.html',\n})\nexport class MnStatTile {\n /** Caption under the number, as a translation key or a literal. */\n @Input({ required: true }) label!: string;\n\n /** The figure, already formatted for display. */\n @Input({ required: true }) value!: string | number;\n\n /** Colour of the chip; see {@link MnStatTileTypes}. */\n @Input() data: Partial<MnStatTileTypes> = {};\n\n /** Grows to share its row and never forces the row wider than its siblings. */\n @HostBinding('class')\n readonly hostClasses = 'flex flex-1 basis-40 min-w-0';\n}\n","<!-- The card is a row: chip, then label over number. The muted label reads the\n consumer's muted-text token when it has one and plain base text otherwise. -->\n<div mnCard class=\"w-full\" [data]=\"{ layout: 'row' }\">\n <mn-icon-chip [data]=\"{ color: data.color }\">\n <ng-content></ng-content>\n </mn-icon-chip>\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span class=\"text-sm text-(--color-base-content-muted,var(--color-base-content))\">{{ label | mnTranslate }}</span>\n <div class=\"flex flex-wrap items-baseline gap-2\">\n <span class=\"text-2xl font-bold leading-none tabular-nums text-base-content\">{{ value }}</span>\n <ng-content select=\"[trailing]\"></ng-content>\n </div>\n </div>\n</div>\n","import { Component, inject, Input } from '@angular/core';\nimport { MnLanguageService } from '../../language';\nimport { MnProportionBarTypes, MnProportionSegment } from './mn-proportion-barTypes';\n\n/** Fill class per colour, spelled out so Tailwind's scanner finds every one. */\nconst SEGMENT_CLASS: Record<MnProportionSegment['color'], string> = {\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n accent: 'bg-accent',\n success: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-error',\n gray: 'bg-base-content/25',\n};\n\n/** Tinted fill class per colour for a `soft` segment, spelled out for the same reason. */\nconst SOFT_SEGMENT_CLASS: Record<MnProportionSegment['color'], string> = {\n primary: 'bg-primary/30',\n secondary: 'bg-secondary/30',\n accent: 'bg-accent/30',\n success: 'bg-success/30',\n warning: 'bg-warning/30',\n danger: 'bg-error/30',\n gray: 'bg-base-content/15',\n};\n\n/** Track height per size. */\nconst HEIGHT_CLASS: Record<MnProportionBarTypes['height'], string> = {\n sm: 'h-2',\n md: 'h-2.5',\n};\n\n/** A segment resolved to a rendered width. */\nexport type MnRenderedProportionSegment = {\n /** Percentage of the track this run covers. */\n widthPct: number;\n /** Fill class for the run. */\n fillClass: string;\n};\n\n/**\n * The proportional bar every turnout, budget, capacity and collection figure draws:\n * a rounded track with one coloured run per segment, widths from the values. Empty\n * segments are skipped so a zero never leaves a hairline. Announced as one image with\n * the caller's label, because the numbers it visualises are always written out next\n * to it.\n *\n * ```html\n * <mn-proportion-bar\n * [segments]=\"[{ value: yes, color: 'success' }, { value: maybe, color: 'warning' }]\"\n * [total]=\"invited\"\n * ariaLabel=\"meetings.responses.title\">\n * </mn-proportion-bar>\n * ```\n */\n@Component({\n selector: 'mn-proportion-bar',\n standalone: true,\n templateUrl: './mn-proportion-bar.html',\n})\nexport class MnProportionBar {\n /** The coloured runs, in draw order from the left. */\n @Input({ required: true }) segments!: MnProportionSegment[];\n\n /** The whole the segments are measured against; defaults to their sum. */\n @Input() total?: number | null;\n\n /** Accessible name for the bar as a whole, as a translation key or a literal. */\n @Input({ required: true }) ariaLabel!: string;\n\n /** Track thickness; see {@link MnProportionBarTypes}. */\n @Input() data: Partial<MnProportionBarTypes> = {};\n\n /** Resolves the accessible name against the app's bundle. */\n private readonly lang = inject(MnLanguageService);\n\n /** The translated accessible name. */\n get label(): string {\n return this.lang.translate(this.ariaLabel);\n }\n\n /** Every class on the track element. */\n get trackClass(): string {\n return `flex w-full overflow-hidden rounded-full bg-base-content/10 ${HEIGHT_CLASS[this.data.height ?? 'md']}`;\n }\n\n /** The denominator actually used: the explicit total when positive, else the segment sum. */\n private get denominator(): number {\n const explicit = this.total;\n if (explicit !== null && explicit !== undefined && explicit > 0) return explicit;\n return this.segments.reduce((sum, segment) => sum + Math.max(0, segment.value), 0);\n }\n\n /** Segments with a width, empty ones dropped. */\n get rendered(): MnRenderedProportionSegment[] {\n const denominator = this.denominator;\n if (denominator <= 0) return [];\n return this.segments\n .filter((segment) => segment.value > 0)\n .map((segment) => ({\n widthPct: Math.min(100, (segment.value / denominator) * 100),\n fillClass: (segment.soft ? SOFT_SEGMENT_CLASS : SEGMENT_CLASS)[segment.color],\n }));\n }\n}\n","<!-- One labelled image: the runs are decoration, the numbers live in the caller's text. -->\n<div role=\"img\" [attr.aria-label]=\"label\" [class]=\"trackClass\">\n @for (segment of rendered; track $index) {\n <span\n class=\"h-full transition-[width] duration-300 ease-out motion-reduce:transition-none\"\n [class]=\"segment.fillClass\"\n [style.width.%]=\"segment.widthPct\"\n ></span>\n }\n</div>\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Injection token for the base URL used by all CRUD service requests.\n *\n * Provide this token at the application or module level to configure\n * the root API URL that `CrudService` prepends to every endpoint.\n */\nexport const API_BASE_URL = new InjectionToken<string>('API_BASE_URL');\n","import {inject} from '@angular/core';\nimport {ApiError, FailureResult, QueryParams, Result, ResultMeta, SuccessResult} from './crud.model';\nimport {catchError, map, Observable, of} from 'rxjs';\nimport {HttpClient, HttpErrorResponse, HttpParams, HttpResponse, HttpStatusCode} from '@angular/common/http';\nimport {API_BASE_URL} from './crud.tokens';\n\n/**\n * Configuration for a CRUD service endpoint.\n *\n * Passed to the `CrudService` constructor to define which API\n * resource the service operates on.\n */\nexport type CrudConfig = {\n endpoint: string;\n}\n\n/**\n * Abstract base class for CRUD services.\n * Provides standard HTTP operations with typed `Result<T>` responses.\n *\n * @template TEntity The entity type returned by single-item operations.\n * @template TListResponse The response type for list operations (defaults to `TEntity[]`).\n * @template TCreatePayload The payload type for create operations (defaults to `Partial<TEntity>`).\n * @template TUpdatePayload The payload type for update operations (defaults to `Partial<TEntity>`).\n * @template TId The type of the entity identifier (defaults to `number`).\n * @template TGetByIdResponse The response type for getById (defaults to `TEntity`).\n * @template TCreateResponse The response type for create (defaults to `TEntity`).\n * @template TUpdateResponse The response type for update and patch (defaults to `TEntity`).\n * @template TDeleteResponse The response type for delete (defaults to `void`).\n */\nexport abstract class CrudService<\n TEntity,\n TListResponse = TEntity[],\n TCreatePayload = Partial<TEntity>,\n TUpdatePayload = Partial<TEntity>,\n TId extends string | number = number,\n TGetByIdResponse = TEntity,\n TCreateResponse = TEntity,\n TUpdateResponse = TEntity,\n TDeleteResponse = void\n> {\n protected readonly http = inject(HttpClient);\n protected readonly baseUrl = inject(API_BASE_URL);\n protected readonly endpoint: string;\n\n protected constructor(config: CrudConfig) {\n this.endpoint = `${this.baseUrl}${config.endpoint}`;\n }\n\n /**\n * Retrieves all entities from the configured endpoint.\n *\n * Sends a GET request to the base endpoint. Query values are\n * converted to `HttpParams` before the request is sent.\n *\n * @param query Optional query parameters appended to the request URL.\n * @returns An observable emitting a `Result` with the list response or a structured failure.\n */\n getAll(query?: QueryParams): Observable<Result<TListResponse>> {\n return this.http\n .get<TListResponse>(this.endpoint, {\n params: this.toHttpParams(query)\n })\n .pipe(\n map((data) => this.success(data)),\n catchError((error) => of(this.failure(this.mapHttpError(error))))\n );\n }\n\n /**\n * Retrieves a single entity by its identifier.\n *\n * Sends a GET request to `{endpoint}/{id}`.\n *\n * @param id The unique identifier of the entity to retrieve.\n * @returns An observable emitting a `Result` with the entity or a structured failure.\n */\n getById(id: TId): Observable<Result<TGetByIdResponse>> {\n return this.http\n .get<TGetByIdResponse>(this.itemUrl(id))\n .pipe(\n map((data) => this.success(data)),\n catchError((error) => of(this.failure(this.mapHttpError(error))))\n );\n }\n\n /**\n * Creates a new entity at the configured endpoint.\n *\n * Sends a POST request with the provided payload as the request body.\n *\n * @param payload The data used to create the entity.\n * @returns An observable emitting a `Result` with the created entity or a structured failure.\n */\n create(payload: TCreatePayload): Observable<Result<TCreateResponse>> {\n return this.http\n .post<TCreateResponse>(this.endpoint, payload)\n .pipe(\n map((data) => this.success(data)),\n catchError((error) => of(this.failure(this.mapHttpError(error))))\n );\n }\n\n /**\n * Fully replaces an existing entity.\n *\n * Sends a PUT request to `{endpoint}/{id}` with the provided payload,\n * replacing the entire entity.\n *\n * @param id The unique identifier of the entity to update.\n * @param payload The complete data to replace the existing entity with.\n * @returns An observable emitting a `Result` with the updated entity or a structured failure.\n */\n update(id: TId, payload: TUpdatePayload): Observable<Result<TUpdateResponse>> {\n return this.http\n .put<TUpdateResponse>(this.itemUrl(id), payload)\n .pipe(\n map((data) => this.success(data)),\n catchError((error) => of(this.failure(this.mapHttpError(error))))\n );\n }\n\n /**\n * Partially updates an existing entity.\n *\n * Sends a PATCH request to `{endpoint}/{id}` with the provided payload,\n * merging changes into the existing entity.\n *\n * @param id The unique identifier of the entity to patch.\n * @param payload A partial set of fields to update on the existing entity.\n * @returns An observable emitting a `Result` with the updated entity or a structured failure.\n */\n patch(id: TId, payload: Partial<TUpdatePayload>): Observable<Result<TUpdateResponse>> {\n return this.http\n .patch<TUpdateResponse>(this.itemUrl(id), payload)\n .pipe(\n map((data) => this.success(data)),\n catchError((error) => of(this.failure(this.mapHttpError(error))))\n );\n }\n\n /**\n * Deletes an entity by its identifier.\n *\n * Sends a DELETE request to `{endpoint}/{id}`.\n *\n * @param id The unique identifier of the entity to delete.\n * @returns An observable emitting a `Result` with the delete response or a structured failure.\n */\n delete(id: TId): Observable<Result<TDeleteResponse>> {\n return this.http\n .delete<TDeleteResponse>(this.itemUrl(id))\n .pipe(\n map((data) => this.success(data)),\n catchError((error) => of(this.failure(this.mapHttpError(error))))\n );\n }\n\n /**\n * Retrieves all entities with the full `HttpResponse` wrapper.\n *\n * Behaves like {@link getAll} but observes the complete HTTP response,\n * giving access to headers, status code, and URL alongside the body.\n *\n * @param query Optional query parameters appended to the request URL.\n * @returns An observable emitting a `Result` with the full HTTP response or a structured failure.\n */\n getAllResponse(query?: QueryParams): Observable<Result<HttpResponse<TListResponse>>> {\n return this.http\n .get<TListResponse>(this.endpoint, {\n params: this.toHttpParams(query),\n observe: 'response',\n })\n .pipe(\n map((response) =>\n this.success(response, {\n statusCode: response.status,\n headers: response.headers,\n url: response.url ?? undefined,\n })\n ),\n catchError((error) => of(this.failure(this.mapHttpError(error))))\n );\n }\n\n /**\n * Builds the URL for a single entity by appending the identifier to the endpoint.\n *\n * @param id The unique identifier to append.\n * @returns The full URL targeting the specific entity.\n */\n protected itemUrl(id: TId): string {\n return `${this.endpoint}/${id}`;\n }\n\n /**\n * Wraps a value in a `SuccessResult`.\n *\n * @template T The type of the response data.\n * @param data The response data to wrap.\n * @param meta Optional metadata (status code, headers, URL) to attach.\n * @returns A `SuccessResult` containing the provided data.\n */\n protected success<T>(data: T, meta?: ResultMeta): SuccessResult<T> {\n return {ok: true, data, meta};\n }\n\n /**\n * Wraps an error in a `FailureResult`.\n *\n * When no explicit metadata is provided, metadata is derived from\n * the `ApiError` itself (status code, headers, URL).\n *\n * @param error The structured API error.\n * @param meta Optional metadata to override the error-derived values.\n * @returns A `FailureResult` containing the error and metadata.\n */\n protected failure(error: ApiError, meta?: ResultMeta): FailureResult {\n return {\n ok: false,\n error,\n meta: meta ?? {\n statusCode: error.status ?? undefined,\n headers: error.headers,\n url: error.url ?? undefined,\n },\n };\n }\n\n /**\n * Maps an unknown error into a structured `ApiError`.\n *\n * Handles both `HttpErrorResponse` instances and unexpected error types.\n * Extracts backend messages, validation errors, and retry information\n * so callers receive a consistent error shape.\n *\n * @param error The raw error caught from the HTTP pipeline.\n * @returns A fully populated `ApiError` object.\n */\n protected mapHttpError(error: unknown): ApiError {\n const timestamp = new Date().toISOString();\n\n if (!(error instanceof HttpErrorResponse)) {\n return {\n status: null,\n message: 'Unknown error',\n original: error instanceof Error ? error : new Error(String(error)),\n retryable: false,\n timestamp,\n };\n }\n\n const status = this.normalizeStatus(error.status);\n const details = error.error;\n const backendMessage = this.extractBackendMessage(details);\n const validationErrors = this.extractValidationErrors(details);\n\n return {\n status,\n message: backendMessage ?? this.defaultMessage(status),\n details,\n backendMessage,\n validationErrors,\n url: error.url,\n headers: error.headers,\n original: error,\n retryable: this.isRetryable(status),\n timestamp,\n };\n }\n\n /**\n * Extracts a human-readable message from the error response body.\n *\n * Checks common keys (`message`, `title`, `detail`, `error`) on the\n * body object and returns the first non-empty string found.\n *\n * @param body The parsed error response body.\n * @returns The extracted message, or `undefined` if none was found.\n */\n protected extractBackendMessage(body: unknown): string | undefined {\n if (typeof body === 'string' && body.trim()) {\n return body;\n }\n\n if (!body || typeof body !== 'object') {\n return undefined;\n }\n\n const obj = body as Record<string, unknown>;\n\n for (const key of ['message', 'title', 'detail', 'error']) {\n const value = obj[key];\n if (typeof value === 'string' && value.trim()) {\n return value;\n }\n }\n return undefined;\n }\n\n /**\n * Extracts field-level validation errors from the error response body.\n *\n * Expects an `errors` property on the body containing a record of\n * field names to error messages (string or string array).\n *\n * @param body The parsed error response body.\n * @returns A record mapping field names to their error messages, or `undefined` if none were found.\n */\n protected extractValidationErrors(body: unknown): Record<string, string[]> | undefined {\n if (!body || typeof body !== 'object') {\n return undefined;\n }\n\n const obj = body as Record<string, unknown>;\n const errors = obj['errors'];\n\n if (!errors || typeof errors !== 'object') {\n return undefined;\n }\n\n const result: Record<string, string[]> = {};\n\n for (const [key, value] of Object.entries(errors as Record<string, unknown>)) {\n if (Array.isArray(value)) {\n result[key] = value.map(String);\n } else if (typeof value === 'string') {\n result[key] = [value];\n }\n }\n return Object.keys(result).length ? result : undefined;\n }\n\n /**\n * Returns a default user-facing message for the given HTTP status code.\n *\n * Provides human-readable messages for common HTTP status codes.\n * Override this method to customise messages.\n *\n * @param status The HTTP status code, or `null` when unknown.\n * @returns A descriptive error message.\n */\n protected defaultMessage(status: HttpStatusCode | null): string {\n switch (status) {\n case HttpStatusCode.BadRequest:\n return 'Bad request';\n case HttpStatusCode.Unauthorized:\n return 'Unauthorized';\n case HttpStatusCode.Forbidden:\n return 'Forbidden';\n case HttpStatusCode.NotFound:\n return 'Not found';\n case HttpStatusCode.Conflict:\n return 'Conflict';\n case HttpStatusCode.UnprocessableEntity:\n return 'Unprocessable entity';\n case HttpStatusCode.InternalServerError:\n return 'Internal server error';\n case null:\n return 'Unknown error';\n default:\n return `Request failed with status ${status}`;\n }\n }\n\n /**\n * Determines whether a request with the given status can be retried.\n *\n * Timeouts, rate-limiting responses, and server errors\n * (5xx) are considered retryable by default.\n *\n * @param status The HTTP status code, or `null` when unknown.\n * @returns `true` if the request is safe to retry.\n */\n protected isRetryable(status: HttpStatusCode | null): boolean {\n if (status === HttpStatusCode.RequestTimeout) return true;\n if (status === HttpStatusCode.TooManyRequests) return true;\n if (typeof status === 'number' && status >= 500) return true;\n return false;\n }\n\n /**\n * Normalises a raw HTTP status into an `HttpStatusCode | null` value.\n *\n * Converts `undefined`, `NaN`, and `0` (network error) to `null`\n * so downstream code only needs to handle `HttpStatusCode | null`.\n *\n * @param status The raw status value from the HTTP response.\n * @returns The normalised status code, or `null` when indeterminate.\n */\n protected normalizeStatus(status: number | null | undefined): HttpStatusCode | null {\n if (status === null || status === undefined || status === 0 || Number.isNaN(status)) return null;\n return status as HttpStatusCode;\n }\n\n /**\n * Converts query parameters into Angular `HttpParams`.\n *\n * `null` and `undefined` values are silently skipped.\n * Array values are appended as multiple entries for the same key.\n *\n * @param query The query parameter record to convert.\n * @returns An `HttpParams` instance, or `undefined` when no parameters are provided.\n */\n protected toHttpParams(query?: QueryParams): HttpParams | undefined {\n if (!query) return undefined;\n\n let params = new HttpParams();\n\n for (const [key, rawValue] of Object.entries(query)) {\n if (rawValue === null || rawValue === undefined) continue;\n\n const values = Array.isArray(rawValue) ? rawValue : [rawValue];\n\n for (const value of values) {\n if (value === null || value === undefined) continue;\n params = params.append(key, String(value));\n }\n }\n return params;\n }\n}\n","import {inject} from '@angular/core';\nimport {HttpClient, HttpParams} from '@angular/common/http';\nimport {firstValueFrom} from 'rxjs';\nimport {API_BASE_URL} from '../crud';\n\n/** A single query parameter value. */\ntype MnQueryValue = string | number | boolean | null | undefined;\n\n/** A record of query parameter key-value pairs. Arrays are appended as multiple entries. */\nexport type MnQueryParams = Record<string, MnQueryValue | MnQueryValue[]>;\n\n/**\n * Lightweight abstract HTTP base class that removes common boilerplate\n * from API services.\n *\n * Provides typed `get`, `post`, `patch`, `put`, and `delete` methods\n * that return Promises, automatic query-param building, and base-URL\n * injection via the `API_BASE_URL` token.\n *\n * Subclass this directly for services with static or mixed endpoints.\n * No CRUD structure is imposed — every method accepts a free-form path.\n */\nexport abstract class MnHttpService {\n /** Angular HTTP client injected automatically. */\n protected readonly http = inject(HttpClient);\n\n /** Base API URL provided via the `API_BASE_URL` injection token. */\n protected readonly baseUrl = inject(API_BASE_URL);\n\n /**\n * Sends a typed GET request.\n * @param path The path appended to the base URL.\n * @param query Optional query parameters.\n * @returns A promise resolving to the typed response body.\n */\n protected get<T>(path: string, query?: MnQueryParams): Promise<T> {\n return firstValueFrom(\n this.http.get<T>(`${this.baseUrl}${path}`, {\n params: this.toHttpParams(query),\n }),\n );\n }\n\n /**\n * Sends a typed POST request.\n * @param path The path appended to the base URL.\n * @param body Optional request body.\n * @param query Optional query parameters.\n * @returns A promise resolving to the typed response body.\n */\n protected post<T>(path: string, body?: unknown, query?: MnQueryParams): Promise<T> {\n return firstValueFrom(\n this.http.post<T>(`${this.baseUrl}${path}`, body ?? {}, {\n params: this.toHttpParams(query),\n }),\n );\n }\n\n /**\n * Sends a typed PATCH request.\n * @param path The path appended to the base URL.\n * @param body Optional request body.\n * @param query Optional query parameters.\n * @returns A promise resolving to the typed response body.\n */\n protected patch<T>(path: string, body?: unknown, query?: MnQueryParams): Promise<T> {\n return firstValueFrom(\n this.http.patch<T>(`${this.baseUrl}${path}`, body ?? {}, {\n params: this.toHttpParams(query),\n }),\n );\n }\n\n /**\n * Sends a typed PUT request.\n * @param path The path appended to the base URL.\n * @param body Optional request body.\n * @param query Optional query parameters.\n * @returns A promise resolving to the typed response body.\n */\n protected put<T>(path: string, body?: unknown, query?: MnQueryParams): Promise<T> {\n return firstValueFrom(\n this.http.put<T>(`${this.baseUrl}${path}`, body ?? {}, {\n params: this.toHttpParams(query),\n }),\n );\n }\n\n /**\n * Sends a typed DELETE request.\n * @param path The path appended to the base URL.\n * @param query Optional query parameters.\n * @returns A promise resolving to the typed response body.\n */\n protected delete<T = void>(path: string, query?: MnQueryParams): Promise<T> {\n return firstValueFrom(\n this.http.delete<T>(`${this.baseUrl}${path}`, {\n params: this.toHttpParams(query),\n }),\n );\n }\n\n /**\n * Converts a query-params record to Angular `HttpParams`.\n * Null and undefined values are silently skipped.\n * Array values are appended as multiple entries for the same key.\n * @param query The query parameter record to convert.\n * @returns An `HttpParams` instance, or `undefined` when no parameters are provided.\n */\n protected toHttpParams(query?: MnQueryParams): HttpParams | undefined {\n if (!query) return undefined;\n\n let params = new HttpParams();\n\n for (const [key, rawValue] of Object.entries(query)) {\n if (rawValue === null || rawValue === undefined) continue;\n\n const values = Array.isArray(rawValue) ? rawValue : [rawValue];\n\n for (const value of values) {\n if (value === null || value === undefined) continue;\n params = params.append(key, String(value));\n }\n }\n\n return params;\n }\n}\n","import { MnConfigService } from '../config/mn-config.service';\nimport { MnLanguageService } from '../language/mn-language.service';\n\nexport type MnPreviewMessage = {\n type: 'mn-config-update' | 'mn-translations-update';\n config?: Record<string, unknown>;\n translations?: Record<string, Record<string, string>>;\n}\n\n/**\n * Enable live preview mode. Listens for postMessage events from\n * Mn Web Manager and hot-swaps config/translations at runtime.\n *\n * Call this once in your app's bootstrap (e.g., APP_INITIALIZER or root component).\n *\n * @param configService - The MnConfigService instance\n * @param langService - The MnLanguageService instance\n * @param allowedOrigins - Optional whitelist of allowed origins (security)\n */\nexport function enableMnPreviewMode(\n configService: MnConfigService,\n langService: MnLanguageService,\n allowedOrigins?: string[]\n): void {\n window.addEventListener('message', async (event: MessageEvent<MnPreviewMessage>) => {\n if (allowedOrigins?.length && !allowedOrigins.includes(event.origin)) {\n return;\n }\n\n const data = event.data;\n if (!data?.type) return;\n\n switch (data.type) {\n case 'mn-config-update':\n if (data.config) {\n await configService.loadFromObject(data.config);\n }\n break;\n\n case 'mn-translations-update':\n if (data.translations) {\n for (const [locale, translations] of Object.entries(data.translations)) {\n langService.registerTranslations(locale, translations);\n }\n await langService.setLocale(langService.locale);\n }\n break;\n }\n });\n}\n","/*\n * Public API Surface of mn-lib\n */\nexport * from './lib';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2","instanceCounter","i1"],"mappings":";;;;;;;;;;;;;;;;AAAA;MAmBa,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB;AAE3E,MAAM,uBAAuB,GAA4B;IAC9D,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AACnF,IAAA,UAAU,EAAE;AACV,QAAA,OAAO,EAAE,kBAAkB;AAC3B,QAAA,IAAI,EAAE,eAAe;AACrB,QAAA,OAAO,EAAE,kBAAkB;AAC3B,QAAA,KAAK,EAAE,gBAAgB;AACvB,QAAA,OAAO,EAAE;AACV,KAAA;AACD,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,gBAAgB,EAAE,IAAI;AACtB,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,QAAQ,EAAE,CAAC,CAAC,KAAK;;;AC7Bb,SAAU,eAAe,CAAC,MAAA,GAAwB,EAAE,EAAA;AACxD,IAAA,MAAM,MAAM,GAAkB;AAC5B,QAAA,GAAG,uBAAuB;AAC1B,QAAA,GAAG,MAAM;AACT,QAAA,SAAS,EAAE,EAAE,GAAG,uBAAuB,CAAC,SAAS,EAAE,IAAI,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE;AAChF,QAAA,UAAU,EAAE,EAAE,GAAG,uBAAuB,CAAC,UAAU,EAAE,IAAI,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,EAAE;AACnF,QAAA,KAAK,EAAE,EAAE,GAAG,uBAAuB,CAAC,KAAK,EAAE,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;KACnE;IACD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE;A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CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;AACtE,wBAAA,WAAW,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,CAAC;oBACxD;oBACA,MAAM,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC;gBACjD;gBACA;;AAEN,IAAA,CAAC,CAAC;AACJ;;ACjDA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mn-angular-lib.mjs","sources":["../../../projects/mn-angular-lib/src/public-api.ts","../../../projects/mn-angular-lib/src/mn-angular-lib.ts"],"sourcesContent":["/*\n * Public API Surface of mn-angular-lib.\n *\n * Every export lives in a secondary entry point (`mn-angular-lib/<name>`). This root entry\n * only re-exports them, so existing `from 'mn-angular-lib'` imports keep working while a\n * bundler still keeps each entry point in the chunk that uses it.\n */\nexport * from 'mn-angular-lib/core';\nexport * from 'mn-angular-lib/button';\nexport * from 'mn-angular-lib/alert';\nexport * from 'mn-angular-lib/bottom-sheet';\nexport * from 'mn-angular-lib/keyboard';\nexport * from 'mn-angular-lib/forms';\nexport * from 'mn-angular-lib/collection';\nexport * from 'mn-angular-lib/tab';\nexport * from 'mn-angular-lib/segmented';\nexport * from 'mn-angular-lib/rich-text-editor';\nexport * from 'mn-angular-lib/display';\nexport * from 'mn-angular-lib/calendar-core';\nexport * from 'mn-angular-lib/calendar';\nexport * from 'mn-angular-lib/modal-core';\nexport * from 'mn-angular-lib/modal-ui';\nexport * from 'mn-angular-lib/modal';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;AAMG;;ACNH;;AAEG"}
|