mn-angular-lib 1.0.179 → 2.0.1
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 +11 -10
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +15 -14
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-button.mjs +9 -9
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar-core.mjs +6 -6
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-calendar.mjs +118 -81
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-collection.mjs +36 -28
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-core.mjs +17 -16
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-display.mjs +88 -45
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-forms.mjs +243 -99
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-keyboard.mjs +3 -3
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal-ui.mjs +158 -100
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-modal.mjs +3 -3
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +21 -12
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-segmented.mjs +3 -3
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -1
- package/fesm2022/mn-angular-lib-tab.mjs +14 -6
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -1
- package/package.json +4 -4
- package/types/mn-angular-lib-alert.d.ts +2 -2
- package/types/mn-angular-lib-calendar-core.d.ts +2 -2
- package/types/mn-angular-lib-calendar.d.ts +2 -0
- package/types/mn-angular-lib-core.d.ts +2 -2
- package/types/mn-angular-lib-display.d.ts +80 -3
- package/types/mn-angular-lib-forms.d.ts +10 -0
- package/types/mn-angular-lib-modal.d.ts +1 -1
- package/types/mn-angular-lib-tab.d.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mn-angular-lib-tab.mjs","sources":["../../../projects/mn-angular-lib/tab/src/mn-tab/mn-tab.component.ts","../../../projects/mn-angular-lib/tab/src/mn-tab/mn-tab.component.html","../../../projects/mn-angular-lib/tab/public-api.ts","../../../projects/mn-angular-lib/tab/mn-angular-lib-tab.ts"],"sourcesContent":["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 'mn-angular-lib/core';\nimport {MnCollectionState} from 'mn-angular-lib/collection';\nimport {MnTabDataSource, MnTabItem} from './mn-tab.types';\nimport {CommonModule} from '@angular/common';\nimport {MnBadge} from 'mn-angular-lib/button';\nimport {MnSkeleton} from 'mn-angular-lib/button';\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","/**\n * Public API of the `mn-angular-lib/tab` entry point: tabs.\n *\n * Each entry point is its own module in the published package, so a consumer's bundler\n * splits it into the chunk that uses it instead of loading the whole library at startup.\n * The root `mn-angular-lib` entry re-exports every entry point.\n */\nexport * from './src/mn-tab';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAuBA;AACA,MAAM,0BAA0B,GAAG,CAAC;AAEpC;AACA,MAAM,qBAAqB,GAAG,KAAK;AAEnC;AACA,MAAM,oBAAoB,GAAG,KAAK;AAElC;;;;;AAKG;AACH,SAAS,SAAS,CAAC,KAAa,EAAA;AAC9B,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK;IAC/C,MAAM,IAAI,GAAG;AACV,SAAA,OAAO,CAAC,oBAAoB,EAAE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W;;sBAyBrB;;sBAWA;;sBAMA;;sBAGA;;;AEnJH;;;;;;AAMG;;ACNH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mn-angular-lib-tab.mjs","sources":["../../../projects/mn-angular-lib/tab/src/mn-tab/mn-tab.component.ts","../../../projects/mn-angular-lib/tab/src/mn-tab/mn-tab.component.html","../../../projects/mn-angular-lib/tab/public-api.ts","../../../projects/mn-angular-lib/tab/mn-angular-lib-tab.ts"],"sourcesContent":["import {\n AfterViewChecked,\n AfterViewInit,\n ChangeDetectorRef,\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 'mn-angular-lib/core';\nimport { MnCollectionState } from 'mn-angular-lib/collection';\nimport { MnTabDataSource, MnTabItem } from './mn-tab.types';\nimport { CommonModule } from '@angular/common';\nimport { MnBadge } from 'mn-angular-lib/button';\nimport { MnSkeleton } from 'mn-angular-lib/button';\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 /**\n * Marks the view whenever {@link currentActive} moves. The selection changes from three\n * places Angular does not notice under OnPush: the query-parameter subscription, the\n * {@link ngDoCheck} re-resolve, and a stale item being dropped — only a click arrives\n * through a listener that dirties the view by itself.\n */\n private readonly cdr = inject(ChangeDetectorRef);\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 ?? (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.cdr.markForCheck();\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 = 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 this.cdr.markForCheck();\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","/**\n * Public API of the `mn-angular-lib/tab` entry point: tabs.\n *\n * Each entry point is its own module in the published package, so a consumer's bundler\n * splits it into the chunk that uses it instead of loading the whole library at startup.\n * The root `mn-angular-lib` entry re-exports every entry point.\n */\nexport * from './src/mn-tab';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAwBA;AACA,MAAM,0BAA0B,GAAG,CAAC;AAEpC;AACA,MAAM,qBAAqB,GAAG,KAAK;AAEnC;AACA,MAAM,oBAAoB,GAAG,KAAK;AAElC;;;;;AAKG;AACH,SAAS,SAAS,CAAC,KAAa,EAAA;AAC9B,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK;IAC/C,MAAM,IAAI,GAAG;AACV,SAAA,OAAO,CAAC,oBAAoB,EAAE,OAAO;AACrC,SAAA,OAAO,CAAC,gBAAgB,EAAE,GAAG;AAC7B,SAAA,OAAO,C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,EAAA;;sBA6C5D,SAAS;uBAAC,iBAAiB;;sBAG3B,SAAS;uBAAC,SAAS;;sBAGnB,SAAS;uBAAC,WAAW;;sBAyBrB;;sBAWA;;sBAMA;;sBAGA;;;AE5JH;;;;;;AAMG;;ACNH;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mn-angular-lib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
7
|
-
"@angular/router": "^
|
|
5
|
+
"@angular/common": "^22.1.7",
|
|
6
|
+
"@angular/core": "^22.1.7",
|
|
7
|
+
"@angular/router": "^22.1.7",
|
|
8
8
|
"@lucide/angular": "^1.18.0",
|
|
9
9
|
"lucide": "^1.27.0",
|
|
10
10
|
"quill": "^2.0.3"
|
|
@@ -105,7 +105,7 @@ declare class MnAlertService {
|
|
|
105
105
|
clear(): void;
|
|
106
106
|
private kind;
|
|
107
107
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnAlertService, never>;
|
|
108
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
108
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
declare class MnAlertStore {
|
|
@@ -124,7 +124,7 @@ declare class MnAlertStore {
|
|
|
124
124
|
clear(): void;
|
|
125
125
|
private clearTimer;
|
|
126
126
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnAlertStore, never>;
|
|
127
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
127
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
type MnAlertTemplateContext = {
|
|
@@ -300,7 +300,7 @@ declare class DefaultCalendarDateFormatter implements CalendarDateFormatter {
|
|
|
300
300
|
/** Formats a Date as "Month Year" (e.g. "January 2026"). */
|
|
301
301
|
formatMonthName(date: Date): Promise<string>;
|
|
302
302
|
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultCalendarDateFormatter, never>;
|
|
303
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
303
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
/**
|
|
@@ -350,7 +350,7 @@ declare class CalendarEventLayoutService {
|
|
|
350
350
|
/** Computes the maximum width an event can span without overlapping a neighbour to its right. */
|
|
351
351
|
private findBiggestPossibleWidth;
|
|
352
352
|
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarEventLayoutService, never>;
|
|
353
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
353
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
/**
|
|
@@ -413,6 +413,8 @@ declare class UpcomingEventRowComponent implements OnInit {
|
|
|
413
413
|
eventClicked: EventEmitter<CalendarEvent>;
|
|
414
414
|
formattedDate: string;
|
|
415
415
|
private formatter;
|
|
416
|
+
/** Marks the view when the awaited time string lands (see {@link ngOnInit}). */
|
|
417
|
+
private readonly cdr;
|
|
416
418
|
constructor();
|
|
417
419
|
ngOnInit(): Promise<void>;
|
|
418
420
|
static ɵfac: i0.ɵɵFactoryDeclaration<UpcomingEventRowComponent, never>;
|
|
@@ -84,7 +84,7 @@ declare class MnConfigService {
|
|
|
84
84
|
*/
|
|
85
85
|
deepMerge<A extends Record<string, unknown>, B extends Record<string, unknown>>(base: A, patch: B): A & B;
|
|
86
86
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnConfigService, never>;
|
|
87
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
87
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/**
|
|
@@ -703,7 +703,7 @@ declare class MnLanguageService {
|
|
|
703
703
|
*/
|
|
704
704
|
resolveLocaleForDomain(domainLocaleMap: Record<string, string> | undefined, fallback: string): string;
|
|
705
705
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnLanguageService, never>;
|
|
706
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
706
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
/**
|
|
@@ -736,6 +736,15 @@ type MnBreadcrumbsData = {
|
|
|
736
736
|
backLabel?: string;
|
|
737
737
|
/** Visual scale. Defaults to `'md'`. */
|
|
738
738
|
size?: 'sm' | 'md';
|
|
739
|
+
/**
|
|
740
|
+
* What the trail does on a narrow screen (below `sm`). Defaults to `'parent'`:
|
|
741
|
+
* the crumbs give way to the parent crumb alone, drawn as a back control,
|
|
742
|
+
* because a hierarchy read on a phone is a way up rather than a map, and an
|
|
743
|
+
* uncollapsed trail wraps over three lines above the title it belongs to.
|
|
744
|
+
* `'never'` keeps every crumb at every width, for a page where the trail
|
|
745
|
+
* itself is the content.
|
|
746
|
+
*/
|
|
747
|
+
collapse?: 'parent' | 'never';
|
|
739
748
|
};
|
|
740
749
|
|
|
741
750
|
/**
|
|
@@ -743,9 +752,14 @@ type MnBreadcrumbsData = {
|
|
|
743
752
|
*
|
|
744
753
|
* Given crumbs it renders a linkable trail (`root › … › current`) where the last
|
|
745
754
|
* crumb is the current page and is never a link. Given no crumbs it degrades to
|
|
746
|
-
* a single "Back" control — the two are mutually exclusive.
|
|
747
|
-
*
|
|
748
|
-
*
|
|
755
|
+
* a single "Back" control — the two are mutually exclusive.
|
|
756
|
+
*
|
|
757
|
+
* The one thing a width decides is how much of the trail shows: below `sm` the
|
|
758
|
+
* crumbs give way to the parent crumb alone, drawn as a back control, unless
|
|
759
|
+
* `data.collapse` is `'never'`. That measures nothing — both renderings sit in
|
|
760
|
+
* the DOM and a Tailwind breakpoint hides one — and there is deliberately no
|
|
761
|
+
* scroll machinery: on a phone a hierarchy is a way up rather than a map, and a
|
|
762
|
+
* trail that scrolls sideways buries the one link anybody reaches for.
|
|
749
763
|
*
|
|
750
764
|
* Navigation stays router- and history-agnostic where possible: a crumb (or the
|
|
751
765
|
* Back control) with an `href` renders a plain `<a>` and navigates natively;
|
|
@@ -771,42 +785,70 @@ declare class MnBreadcrumbs {
|
|
|
771
785
|
get styles(): {
|
|
772
786
|
root: (slotProps?: ({
|
|
773
787
|
size?: "md" | "sm" | undefined;
|
|
788
|
+
collapsible?: boolean | undefined;
|
|
774
789
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
775
790
|
list: (slotProps?: ({
|
|
776
791
|
size?: "md" | "sm" | undefined;
|
|
792
|
+
collapsible?: boolean | undefined;
|
|
777
793
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
778
794
|
link: (slotProps?: ({
|
|
779
795
|
size?: "md" | "sm" | undefined;
|
|
796
|
+
collapsible?: boolean | undefined;
|
|
780
797
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
781
798
|
current: (slotProps?: ({
|
|
782
799
|
size?: "md" | "sm" | undefined;
|
|
800
|
+
collapsible?: boolean | undefined;
|
|
783
801
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
784
802
|
separator: (slotProps?: ({
|
|
785
803
|
size?: "md" | "sm" | undefined;
|
|
804
|
+
collapsible?: boolean | undefined;
|
|
786
805
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
787
806
|
back: (slotProps?: ({
|
|
788
807
|
size?: "md" | "sm" | undefined;
|
|
808
|
+
collapsible?: boolean | undefined;
|
|
809
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
810
|
+
collapsed: (slotProps?: ({
|
|
811
|
+
size?: "md" | "sm" | undefined;
|
|
812
|
+
collapsible?: boolean | undefined;
|
|
789
813
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
790
814
|
} & {
|
|
791
815
|
root: (slotProps?: ({
|
|
792
816
|
size?: "md" | "sm" | undefined;
|
|
817
|
+
collapsible?: boolean | undefined;
|
|
793
818
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
794
819
|
list: (slotProps?: ({
|
|
795
820
|
size?: "md" | "sm" | undefined;
|
|
821
|
+
collapsible?: boolean | undefined;
|
|
796
822
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
797
823
|
link: (slotProps?: ({
|
|
798
824
|
size?: "md" | "sm" | undefined;
|
|
825
|
+
collapsible?: boolean | undefined;
|
|
799
826
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
800
827
|
current: (slotProps?: ({
|
|
801
828
|
size?: "md" | "sm" | undefined;
|
|
829
|
+
collapsible?: boolean | undefined;
|
|
802
830
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
803
831
|
separator: (slotProps?: ({
|
|
804
832
|
size?: "md" | "sm" | undefined;
|
|
833
|
+
collapsible?: boolean | undefined;
|
|
805
834
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
806
835
|
back: (slotProps?: ({
|
|
807
836
|
size?: "md" | "sm" | undefined;
|
|
837
|
+
collapsible?: boolean | undefined;
|
|
838
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
839
|
+
collapsed: (slotProps?: ({
|
|
840
|
+
size?: "md" | "sm" | undefined;
|
|
841
|
+
collapsible?: boolean | undefined;
|
|
808
842
|
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
|
|
809
843
|
} & {};
|
|
844
|
+
/** Whether the parent crumb replaces the trail below `sm`. */
|
|
845
|
+
get collapsesToParent(): boolean;
|
|
846
|
+
/**
|
|
847
|
+
* The crumb one level above the current page, or `null` when the trail stays
|
|
848
|
+
* whole: a single crumb has nowhere to go up to, and `'never'` asks for every
|
|
849
|
+
* crumb at every width.
|
|
850
|
+
*/
|
|
851
|
+
get parentCrumb(): MnBreadcrumbItem | null;
|
|
810
852
|
/**
|
|
811
853
|
* Accessible name of the `<nav>` landmark.
|
|
812
854
|
*
|
|
@@ -845,6 +887,12 @@ declare class MnBreadcrumbs {
|
|
|
845
887
|
* template can pull one class string per role. Theme tokens only, so the trail
|
|
846
888
|
* reads correctly in both light and dark. Links and the Back control are native
|
|
847
889
|
* `<button>`/`<a>` elements reset to look like plain text with a hover accent.
|
|
890
|
+
*
|
|
891
|
+
* A crumb carries vertical padding that the list takes back with a negative
|
|
892
|
+
* margin, so the row keeps the height it always had while each crumb is a
|
|
893
|
+
* target you can hit rather than the bare height of its text. The collapsed
|
|
894
|
+
* control replaces the trail on a phone, where it is the only way up, so it
|
|
895
|
+
* takes a full 44px.
|
|
848
896
|
*/
|
|
849
897
|
declare const mnBreadcrumbsVariants: tailwind_variants.TVReturnType<{
|
|
850
898
|
size: {
|
|
@@ -857,6 +905,13 @@ declare const mnBreadcrumbsVariants: tailwind_variants.TVReturnType<{
|
|
|
857
905
|
list: string;
|
|
858
906
|
};
|
|
859
907
|
};
|
|
908
|
+
/** Whether the parent crumb takes the trail's place below `sm`. */
|
|
909
|
+
collapsible: {
|
|
910
|
+
true: {
|
|
911
|
+
list: string;
|
|
912
|
+
};
|
|
913
|
+
false: {};
|
|
914
|
+
};
|
|
860
915
|
}, {
|
|
861
916
|
root: string;
|
|
862
917
|
list: string;
|
|
@@ -864,6 +919,7 @@ declare const mnBreadcrumbsVariants: tailwind_variants.TVReturnType<{
|
|
|
864
919
|
current: string;
|
|
865
920
|
separator: string;
|
|
866
921
|
back: string;
|
|
922
|
+
collapsed: string;
|
|
867
923
|
}, undefined, {
|
|
868
924
|
size: {
|
|
869
925
|
sm: {
|
|
@@ -875,6 +931,13 @@ declare const mnBreadcrumbsVariants: tailwind_variants.TVReturnType<{
|
|
|
875
931
|
list: string;
|
|
876
932
|
};
|
|
877
933
|
};
|
|
934
|
+
/** Whether the parent crumb takes the trail's place below `sm`. */
|
|
935
|
+
collapsible: {
|
|
936
|
+
true: {
|
|
937
|
+
list: string;
|
|
938
|
+
};
|
|
939
|
+
false: {};
|
|
940
|
+
};
|
|
878
941
|
}, {
|
|
879
942
|
root: string;
|
|
880
943
|
list: string;
|
|
@@ -882,6 +945,7 @@ declare const mnBreadcrumbsVariants: tailwind_variants.TVReturnType<{
|
|
|
882
945
|
current: string;
|
|
883
946
|
separator: string;
|
|
884
947
|
back: string;
|
|
948
|
+
collapsed: string;
|
|
885
949
|
}, tailwind_variants.TVReturnType<{
|
|
886
950
|
size: {
|
|
887
951
|
sm: {
|
|
@@ -893,6 +957,13 @@ declare const mnBreadcrumbsVariants: tailwind_variants.TVReturnType<{
|
|
|
893
957
|
list: string;
|
|
894
958
|
};
|
|
895
959
|
};
|
|
960
|
+
/** Whether the parent crumb takes the trail's place below `sm`. */
|
|
961
|
+
collapsible: {
|
|
962
|
+
true: {
|
|
963
|
+
list: string;
|
|
964
|
+
};
|
|
965
|
+
false: {};
|
|
966
|
+
};
|
|
896
967
|
}, {
|
|
897
968
|
root: string;
|
|
898
969
|
list: string;
|
|
@@ -900,6 +971,7 @@ declare const mnBreadcrumbsVariants: tailwind_variants.TVReturnType<{
|
|
|
900
971
|
current: string;
|
|
901
972
|
separator: string;
|
|
902
973
|
back: string;
|
|
974
|
+
collapsed: string;
|
|
903
975
|
}, undefined, unknown, unknown, undefined>>;
|
|
904
976
|
type MnBreadcrumbsVariants = VariantProps<typeof mnBreadcrumbsVariants>;
|
|
905
977
|
|
|
@@ -1067,6 +1139,11 @@ type MnDualHorizontalImageConfig = {
|
|
|
1067
1139
|
declare const MN_LIB_DUAL_HORIZONTAL_IMAGE: InjectionToken<MnDualHorizontalImageConfig>;
|
|
1068
1140
|
declare class MnDualHorizontalImage {
|
|
1069
1141
|
protected readonly componentConfig: MnDualHorizontalImageConfig;
|
|
1142
|
+
/** Marks the view when a locale change rewrites the injected config (see the constructor). */
|
|
1143
|
+
private readonly cdr;
|
|
1144
|
+
private readonly lang;
|
|
1145
|
+
private readonly destroyRef;
|
|
1146
|
+
constructor();
|
|
1070
1147
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnDualHorizontalImage, never>;
|
|
1071
1148
|
static ɵcmp: i0.ɵɵComponentDeclaration<MnDualHorizontalImage, "mn-lib-dual-horizontal-image", never, {}, {}, never, never, true, never>;
|
|
1072
1149
|
}
|
|
@@ -268,6 +268,8 @@ declare class MnInputField implements OnInit {
|
|
|
268
268
|
private readonly configService;
|
|
269
269
|
private readonly sectionPath;
|
|
270
270
|
private readonly explicitInstanceId;
|
|
271
|
+
/** Marks the view when a locale change re-resolves the config (OnPush). */
|
|
272
|
+
private readonly cdr;
|
|
271
273
|
private readonly lang;
|
|
272
274
|
private readonly destroyRef;
|
|
273
275
|
/** Current raw string value of the input element */
|
|
@@ -765,6 +767,8 @@ declare class MnCheckbox implements OnInit, OnChanges {
|
|
|
765
767
|
private readonly configService;
|
|
766
768
|
private readonly sectionPath;
|
|
767
769
|
private readonly explicitInstanceId;
|
|
770
|
+
/** Marks the view when a locale change re-resolves the config (OnPush). */
|
|
771
|
+
private readonly cdr;
|
|
768
772
|
private readonly lang;
|
|
769
773
|
private readonly destroyRef;
|
|
770
774
|
value: boolean;
|
|
@@ -1016,6 +1020,8 @@ declare class MnTextarea implements OnInit {
|
|
|
1016
1020
|
private readonly configService;
|
|
1017
1021
|
private readonly sectionPath;
|
|
1018
1022
|
private readonly explicitInstanceId;
|
|
1023
|
+
/** Marks the view when a locale change re-resolves the config (OnPush). */
|
|
1024
|
+
private readonly cdr;
|
|
1019
1025
|
private readonly lang;
|
|
1020
1026
|
private readonly destroyRef;
|
|
1021
1027
|
/** Current raw string value of the textarea element */
|
|
@@ -1299,6 +1305,8 @@ declare class MnDatetime implements OnInit {
|
|
|
1299
1305
|
private readonly configService;
|
|
1300
1306
|
private readonly sectionPath;
|
|
1301
1307
|
private readonly explicitInstanceId;
|
|
1308
|
+
/** Marks the view when a locale change re-resolves the config (OnPush). */
|
|
1309
|
+
private readonly cdr;
|
|
1302
1310
|
private readonly lang;
|
|
1303
1311
|
private readonly destroyRef;
|
|
1304
1312
|
value: string | null;
|
|
@@ -1642,6 +1650,8 @@ declare class MnFileInput implements OnInit {
|
|
|
1642
1650
|
private readonly configService;
|
|
1643
1651
|
private readonly sectionPath;
|
|
1644
1652
|
private readonly explicitInstanceId;
|
|
1653
|
+
/** Marks the view when a locale change re-resolves the config (OnPush). */
|
|
1654
|
+
private readonly cdr;
|
|
1645
1655
|
private readonly lang;
|
|
1646
1656
|
private readonly destroyRef;
|
|
1647
1657
|
/** Object-URL previews aligned to {@link files}; null for non-image entries. */
|
|
@@ -21,7 +21,7 @@ declare class MnModalService {
|
|
|
21
21
|
*/
|
|
22
22
|
private render;
|
|
23
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<MnModalService, never>;
|
|
24
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export { MnModalService };
|
|
@@ -81,6 +81,13 @@ declare class MnTabComponent implements DoCheck, AfterViewInit, AfterViewChecked
|
|
|
81
81
|
private readonly router;
|
|
82
82
|
/** Route the tab value is read back from; absent for the same reason as {@link router}. */
|
|
83
83
|
private readonly route;
|
|
84
|
+
/**
|
|
85
|
+
* Marks the view whenever {@link currentActive} moves. The selection changes from three
|
|
86
|
+
* places Angular does not notice under OnPush: the query-parameter subscription, the
|
|
87
|
+
* {@link ngDoCheck} re-resolve, and a stale item being dropped — only a click arrives
|
|
88
|
+
* through a listener that dirties the view by itself.
|
|
89
|
+
*/
|
|
90
|
+
private readonly cdr;
|
|
84
91
|
/** Watches the URL so a deep link, a back button or an in-app link moves the tab bar. */
|
|
85
92
|
private readonly queryParamsSub?;
|
|
86
93
|
/**
|