@masterteam/components 0.0.269 → 0.0.270
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/masterteam-components-entities.mjs +6 -6
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-tabs.mjs +73 -13
- package/fesm2022/masterteam-components-tabs.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-tabs.d.ts +24 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-tabs.mjs","sources":["../../../../packages/masterteam/components/tabs/tabs.ts","../../../../packages/masterteam/components/tabs/tabs.html","../../../../packages/masterteam/components/tabs/masterteam-components-tabs.ts"],"sourcesContent":["import {\r\n afterNextRender,\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n DestroyRef,\r\n effect,\r\n ElementRef,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\r\nimport { MTIcon, Icon } from '@masterteam/icons';\r\nimport { SelectButton } from 'primeng/selectbutton';\r\nimport { Popover } from 'primeng/popover';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { IconFieldModule } from 'primeng/iconfield';\r\nimport { InputIconModule } from 'primeng/inputicon';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\n\r\nexport type TabSeverity =\r\n | 'primary'\r\n | 'secondary'\r\n | 'success'\r\n | 'info'\r\n | 'warn'\r\n | 'warning'\r\n | 'danger'\r\n | 'error'\r\n | 'help'\r\n | 'contrast';\r\n\r\nexport interface OptionItem {\r\n label?: string;\r\n value?: any;\r\n icon?: MTIcon | null;\r\n badge?: number | string | null;\r\n severity?: TabSeverity | null;\r\n disabled?: boolean;\r\n /**\r\n * The host is still resolving this tab's title — typically it names a record\r\n * that is being fetched. The label slot renders a placeholder instead of the\r\n * text, so the tab never flashes a stand-in name before the real one lands.\r\n * Keep supplying the fallback `label`: it stays the accessible name and is\r\n * still what the \"more\" search matches against.\r\n */\r\n loading?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\ntype NormalizedTabSeverity =\r\n | 'primary'\r\n | 'secondary'\r\n | 'success'\r\n | 'info'\r\n | 'warn'\r\n | 'danger'\r\n | 'help'\r\n | 'contrast';\r\n\r\n@Component({\r\n selector: 'mt-tabs',\r\n standalone: true,\r\n imports: [\r\n Icon,\r\n NgTemplateOutlet,\r\n SelectButton,\r\n FormsModule,\r\n Button,\r\n Popover,\r\n Avatar,\r\n InputTextModule,\r\n IconFieldModule,\r\n InputIconModule,\r\n TranslocoPipe,\r\n ],\r\n templateUrl: './tabs.html',\r\n styleUrls: ['./tabs.scss'],\r\n host: {\r\n class: 'grid min-w-0 gap-1',\r\n '[class.w-full]': 'fluid()',\r\n },\r\n})\r\nexport class Tabs {\r\n private readonly transloco = inject(TranslocoService);\r\n options = input<OptionItem[]>([]);\r\n optionLabel = input<string>('label');\r\n optionValue = input<string>('value');\r\n active = model<any>(null);\r\n readonly mode = input<'horizontal' | 'vertical' | 'underline'>('horizontal');\r\n readonly moreLabel = input<string>(\r\n this.transloco.translate('components.tabs.more'),\r\n );\r\n readonly defaultIcon = input<MTIcon>('layout.align-left-02');\r\n\r\n onChange = output<any>();\r\n\r\n readonly size = input<'small' | 'large' | undefined>();\r\n readonly fluid = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n disabled = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly tabsContainer =\r\n viewChild<ElementRef<HTMLElement>>('tabsContainer');\r\n private readonly measureRow =\r\n viewChild<ElementRef<HTMLElement>>('measureRow');\r\n private readonly morePopover = viewChild(Popover);\r\n private resizeObserver?: ResizeObserver;\r\n private measureHandle = 0;\r\n private alignHandle = 0;\r\n\r\n readonly visibleCount = signal<number>(Number.MAX_SAFE_INTEGER);\r\n readonly visibleOptions = computed(() =>\r\n this.options().slice(0, this.visibleCount()),\r\n );\r\n readonly overflowOptions = computed(() =>\r\n this.options().slice(this.visibleCount()),\r\n );\r\n readonly hasOverflow = computed(() => this.overflowOptions().length > 0);\r\n readonly isActiveInOverflow = computed(() =>\r\n this.overflowOptions().some((option) => this.isActiveOption(option)),\r\n );\r\n\r\n readonly searchThreshold = input<number>(8);\r\n readonly searchTerm = signal<string>('');\r\n readonly showOverflowSearch = computed(\r\n () => this.overflowOptions().length >= this.searchThreshold(),\r\n );\r\n readonly filteredOverflowOptions = computed(() => {\r\n const term = this.searchTerm().trim().toLowerCase();\r\n if (!term) return this.overflowOptions();\r\n return this.overflowOptions().filter((option) =>\r\n this.resolveLabel(option).toLowerCase().includes(term),\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const options = this.options();\r\n const active = this.active();\r\n if (!options.length) {\r\n return;\r\n }\r\n\r\n const hasActiveOption = options.some((option) =>\r\n Object.is(this.resolveValue(option), active),\r\n );\r\n if (!hasActiveOption) {\r\n this.active.set(this.resolveValue(options[0]));\r\n }\r\n });\r\n\r\n afterNextRender(() => {\r\n if (this.mode() !== 'underline') return;\r\n this.setupResizeObserver();\r\n this.scheduleMeasure();\r\n });\r\n\r\n effect(() => {\r\n // Re-measure when options or mode change.\r\n this.options();\r\n if (this.mode() !== 'underline') return;\r\n this.scheduleMeasure();\r\n });\r\n\r\n this.destroyRef.onDestroy(() => {\r\n this.resizeObserver?.disconnect();\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n if (this.alignHandle) {\r\n cancelAnimationFrame(this.alignHandle);\r\n }\r\n });\r\n }\r\n\r\n private setupResizeObserver(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n if (!container || typeof ResizeObserver === 'undefined') return;\r\n\r\n this.resizeObserver = new ResizeObserver(() => this.scheduleMeasure());\r\n this.resizeObserver.observe(container);\r\n }\r\n\r\n private scheduleMeasure(): void {\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n this.measureHandle = requestAnimationFrame(() => {\r\n this.measureHandle = 0;\r\n this.measureAndUpdate();\r\n });\r\n }\r\n\r\n private measureAndUpdate(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n const measureRow = this.measureRow()?.nativeElement;\r\n if (!container || !measureRow) return;\r\n\r\n const optionsCount = this.options().length;\r\n if (optionsCount === 0) {\r\n this.visibleCount.set(0);\r\n return;\r\n }\r\n\r\n if (container.clientWidth === 0) return;\r\n\r\n // Inner width excludes the container's horizontal padding so we compare\r\n // against the actual space available to the flex tabs row.\r\n const style = getComputedStyle(container);\r\n const paddingX =\r\n (parseFloat(style.paddingLeft) || 0) +\r\n (parseFloat(style.paddingRight) || 0);\r\n const innerWidth = container.clientWidth - paddingX;\r\n if (innerWidth <= 0) return;\r\n\r\n const tabWidths = Array.from(measureRow.children).map(\r\n (el) => (el as HTMLElement).getBoundingClientRect().width,\r\n );\r\n\r\n if (tabWidths.length === 0) return;\r\n\r\n // Approximate gap-0.5 between tabs (2px).\r\n const gap = 2;\r\n const totalWidth =\r\n tabWidths.reduce((sum, width) => sum + width, 0) +\r\n Math.max(0, tabWidths.length - 1) * gap;\r\n\r\n // Everything fits — no more button needed.\r\n if (totalWidth <= innerWidth) {\r\n this.visibleCount.set(tabWidths.length);\r\n return;\r\n }\r\n\r\n // Reserve space for the More button (icon + label ~ 88px).\r\n const moreButtonReserve = 96;\r\n const available = innerWidth - moreButtonReserve;\r\n\r\n let cumulative = 0;\r\n let visibleCount = 0;\r\n for (let i = 0; i < tabWidths.length; i++) {\r\n const next = cumulative + tabWidths[i] + (i > 0 ? gap : 0);\r\n if (next > available) break;\r\n cumulative = next;\r\n visibleCount++;\r\n }\r\n\r\n this.visibleCount.set(Math.max(1, visibleCount));\r\n }\r\n\r\n onTabChange(value: any) {\r\n this.onChange.emit(value);\r\n }\r\n\r\n onOverflowSearch(value: string): void {\r\n this.searchTerm.set(value ?? '');\r\n // Filtering shrinks/grows the popover content, but PrimeNG only positions\r\n // the popover on show. Re-align after the filtered list re-renders so a\r\n // popover opened above the trigger stays attached instead of overlapping.\r\n this.scheduleOverflowAlign();\r\n }\r\n\r\n private scheduleOverflowAlign(): void {\r\n if (this.alignHandle) {\r\n cancelAnimationFrame(this.alignHandle);\r\n }\r\n this.alignHandle = requestAnimationFrame(() => {\r\n this.alignHandle = 0;\r\n const popover = this.morePopover();\r\n if (!popover?.overlayVisible) return;\r\n\r\n // Clear the stale flip marker so align() recomputes the arrow direction\r\n // for the new height instead of keeping the previous \"above\" state.\r\n const container = popover.container;\r\n if (container) {\r\n container.removeAttribute('data-p-popover-flipped');\r\n container.classList.remove('p-popover-flipped');\r\n }\r\n popover.align();\r\n });\r\n }\r\n\r\n onOverflowPopoverHide(): void {\r\n this.searchTerm.set('');\r\n }\r\n\r\n onOptionSelect(option: OptionItem): void {\r\n if (this.disabled() || this.isOptionDisabled(option)) {\r\n return;\r\n }\r\n\r\n const value = this.resolveValue(option);\r\n this.active.set(value);\r\n this.onTabChange(value);\r\n }\r\n\r\n resolveLabel(option: OptionItem): string {\r\n const labelKey = this.optionLabel();\r\n const label =\r\n option && typeof option === 'object'\r\n ? (option as Record<string, unknown>)[labelKey]\r\n : option;\r\n\r\n return typeof label === 'string' ? label : String(label ?? '');\r\n }\r\n\r\n resolveValue(option: OptionItem): unknown {\r\n const valueKey = this.optionValue();\r\n if (option && typeof option === 'object' && valueKey in option) {\r\n return (option as Record<string, unknown>)[valueKey];\r\n }\r\n\r\n return option;\r\n }\r\n\r\n resolveIcon(option: OptionItem): MTIcon | null {\r\n return typeof option?.icon === 'string' ? option.icon : null;\r\n }\r\n\r\n resolveIconOrDefault(option: OptionItem): MTIcon {\r\n return this.resolveIcon(option) ?? this.defaultIcon();\r\n }\r\n\r\n resolveBadge(option: OptionItem): number | string | null {\r\n return option?.badge ?? null;\r\n }\r\n\r\n isOptionLoading(option: OptionItem): boolean {\r\n return option?.loading === true;\r\n }\r\n\r\n hasBadge(option: OptionItem): boolean {\r\n return option?.badge !== null && option?.badge !== undefined;\r\n }\r\n\r\n hasCountBadge(option: OptionItem): boolean {\r\n const badge = option?.badge;\r\n if (badge === null || badge === undefined || badge === '') {\r\n return false;\r\n }\r\n const numeric = typeof badge === 'number' ? badge : Number(badge);\r\n return Number.isNaN(numeric) ? true : numeric > 0;\r\n }\r\n\r\n severity(option: OptionItem): NormalizedTabSeverity {\r\n const severity =\r\n typeof option?.severity === 'string'\r\n ? option.severity.trim().toLowerCase()\r\n : '';\r\n if (severity === 'error') return 'danger';\r\n if (severity === 'warning') return 'warn';\r\n if (\r\n severity === 'secondary' ||\r\n severity === 'success' ||\r\n severity === 'info' ||\r\n severity === 'warn' ||\r\n severity === 'danger' ||\r\n severity === 'help' ||\r\n severity === 'contrast'\r\n ) {\r\n return severity;\r\n }\r\n\r\n return 'primary';\r\n }\r\n\r\n isSeverity(option: OptionItem, severity: NormalizedTabSeverity): boolean {\r\n return this.severity(option) === severity;\r\n }\r\n\r\n hasNonPrimarySeverity(option: OptionItem): boolean {\r\n return this.severity(option) !== 'primary';\r\n }\r\n\r\n isActiveOption(option: OptionItem): boolean {\r\n return Object.is(this.active(), this.resolveValue(option));\r\n }\r\n\r\n isOptionDisabled(option: OptionItem): boolean {\r\n return !!option?.disabled;\r\n }\r\n\r\n trackOption(option: OptionItem, index: number): unknown {\r\n return this.resolveValue(option) ?? index;\r\n }\r\n}\r\n","@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-start text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.text-primary]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.border-slate-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'secondary')\r\n \"\r\n [class.text-slate-600]=\"isSeverity(option, 'secondary')\"\r\n [class.border-emerald-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'success')\r\n \"\r\n [class.text-emerald-600]=\"isSeverity(option, 'success')\"\r\n [class.border-sky-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'info')\r\n \"\r\n [class.text-sky-600]=\"isSeverity(option, 'info')\"\r\n [class.border-amber-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'warn')\r\n \"\r\n [class.text-amber-700]=\"isSeverity(option, 'warn')\"\r\n [class.border-red-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'danger')\r\n \"\r\n [class.text-red-600]=\"isSeverity(option, 'danger')\"\r\n [class.border-purple-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'help')\r\n \"\r\n [class.text-purple-600]=\"isSeverity(option, 'help')\"\r\n [class.border-zinc-700]=\"\r\n isActiveOption(option) && isSeverity(option, 'contrast')\r\n \"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) &&\r\n !hasNonPrimarySeverity(option) &&\r\n !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.hover:text-slate-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'secondary')\r\n \"\r\n [class.hover:text-emerald-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'success')\r\n \"\r\n [class.hover:text-sky-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'info')\r\n \"\r\n [class.hover:text-amber-800]=\"\r\n !isActiveOption(option) && isSeverity(option, 'warn')\r\n \"\r\n [class.hover:text-red-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'danger')\r\n \"\r\n [class.hover:text-purple-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'help')\r\n \"\r\n [class.hover:text-zinc-900]=\"\r\n !isActiveOption(option) && isSeverity(option, 'contrast')\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isSeverity(option, 'primary')\"\r\n [class.text-primary-700]=\"isSeverity(option, 'primary')\"\r\n [class.bg-slate-100]=\"isSeverity(option, 'secondary')\"\r\n [class.text-slate-700]=\"isSeverity(option, 'secondary')\"\r\n [class.bg-emerald-50]=\"isSeverity(option, 'success')\"\r\n [class.text-emerald-700]=\"isSeverity(option, 'success')\"\r\n [class.bg-sky-50]=\"isSeverity(option, 'info')\"\r\n [class.text-sky-700]=\"isSeverity(option, 'info')\"\r\n [class.bg-amber-50]=\"isSeverity(option, 'warn')\"\r\n [class.text-amber-800]=\"isSeverity(option, 'warn')\"\r\n [class.bg-red-50]=\"isSeverity(option, 'danger')\"\r\n [class.text-red-700]=\"isSeverity(option, 'danger')\"\r\n [class.bg-purple-50]=\"isSeverity(option, 'help')\"\r\n [class.text-purple-700]=\"isSeverity(option, 'help')\"\r\n [class.bg-zinc-100]=\"isSeverity(option, 'contrast')\"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.bg-surface-100]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n [class.text-surface-500]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.text-primary]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.bg-slate-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'secondary')\r\n \"\r\n [class.text-slate-600]=\"isSeverity(option, 'secondary')\"\r\n [class.bg-emerald-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'success')\r\n \"\r\n [class.text-emerald-600]=\"isSeverity(option, 'success')\"\r\n [class.bg-sky-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'info')\r\n \"\r\n [class.text-sky-600]=\"isSeverity(option, 'info')\"\r\n [class.bg-amber-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'warn')\r\n \"\r\n [class.text-amber-700]=\"isSeverity(option, 'warn')\"\r\n [class.bg-red-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'danger')\r\n \"\r\n [class.text-red-600]=\"isSeverity(option, 'danger')\"\r\n [class.bg-purple-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'help')\r\n \"\r\n [class.text-purple-600]=\"isSeverity(option, 'help')\"\r\n [class.bg-zinc-100]=\"\r\n isActiveOption(option) && isSeverity(option, 'contrast')\r\n \"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isSeverity(option, 'primary')\"\r\n [class.text-primary-700]=\"isSeverity(option, 'primary')\"\r\n [class.bg-slate-100]=\"isSeverity(option, 'secondary')\"\r\n [class.text-slate-700]=\"isSeverity(option, 'secondary')\"\r\n [class.bg-emerald-50]=\"isSeverity(option, 'success')\"\r\n [class.text-emerald-700]=\"isSeverity(option, 'success')\"\r\n [class.bg-sky-50]=\"isSeverity(option, 'info')\"\r\n [class.text-sky-700]=\"isSeverity(option, 'info')\"\r\n [class.bg-amber-50]=\"isSeverity(option, 'warn')\"\r\n [class.text-amber-800]=\"isSeverity(option, 'warn')\"\r\n [class.bg-red-50]=\"isSeverity(option, 'danger')\"\r\n [class.text-red-700]=\"isSeverity(option, 'danger')\"\r\n [class.bg-purple-50]=\"isSeverity(option, 'help')\"\r\n [class.text-purple-700]=\"isSeverity(option, 'help')\"\r\n [class.bg-zinc-100]=\"isSeverity(option, 'contrast')\"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.bg-surface-100]=\"\r\n !isActiveOption(option) &&\r\n !hasNonPrimarySeverity(option)\r\n \"\r\n [class.text-surface-500]=\"\r\n !isActiveOption(option) &&\r\n !hasNonPrimarySeverity(option)\r\n \"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n >\r\n <ng-template #item let-option>\r\n <span class=\"inline-flex min-w-0 items-center gap-1.5\">\r\n <span class=\"truncate\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 min-w-5 ms-auto inline-flex items-center justify-center rounded-full p-1 text-xs leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n </ng-template>\r\n </p-selectbutton>\r\n}\r\n\r\n<!-- Shared label slot. A tab whose title is still being resolved by the host\r\n (`option.loading`) renders a placeholder bar instead of a stand-in name;\r\n the real label stays in the accessibility tree throughout. -->\r\n<ng-template #tabLabel let-option>\r\n @if (isOptionLoading(option)) {\r\n <span class=\"sr-only\">{{ resolveLabel(option) }}</span>\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"inline-block h-3 w-20 max-w-full animate-pulse rounded bg-surface-200 align-middle\"\r\n ></span>\r\n } @else {\r\n {{ resolveLabel(option) }}\r\n }\r\n</ng-template>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;MA0Fa,IAAI,CAAA;AACE,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACrD,IAAA,OAAO,GAAG,KAAK,CAAe,EAAE,8EAAC;AACjC,IAAA,WAAW,GAAG,KAAK,CAAS,OAAO,kFAAC;AACpC,IAAA,WAAW,GAAG,KAAK,CAAS,OAAO,kFAAC;AACpC,IAAA,MAAM,GAAG,KAAK,CAAM,IAAI,6EAAC;AAChB,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AA,EAAA,CAAA;kBAvBhB,SAAS;+BACE,SAAS,EAAA,UAAA,EACP,IAAI,EAAA,OAAA,EACP;wBACP,IAAI;wBACJ,gBAAgB;wBAChB,YAAY;wBACZ,WAAW;wBACX,MAAM;wBACN,OAAO;wBACP,MAAM;wBACN,eAAe;wBACf,eAAe;wBACf,eAAe;wBACf,aAAa;qBACd,EAAA,IAAA,EAGK;AACJ,wBAAA,KAAK,EAAE,oBAAoB;AAC3B,wBAAA,gBAAgB,EAAE,SAAS;AAC5B,qBAAA,EAAA,QAAA,EAAA,8hmBAAA,EAAA,MAAA,EAAA,CAAA,sBAAA,CAAA,EAAA;+nCA0BoC,eAAe,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAEf,YAAY,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACR,OAAO,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErHlD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-tabs.mjs","sources":["../../../../packages/masterteam/components/tabs/tabs.ts","../../../../packages/masterteam/components/tabs/tabs.html","../../../../packages/masterteam/components/tabs/masterteam-components-tabs.ts"],"sourcesContent":["import {\r\n afterNextRender,\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n DestroyRef,\r\n effect,\r\n ElementRef,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslocoPipe, TranslocoService } from '@jsverse/transloco';\r\nimport { MTIcon, Icon } from '@masterteam/icons';\r\nimport { SelectButton } from 'primeng/selectbutton';\r\nimport { Popover } from 'primeng/popover';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { IconFieldModule } from 'primeng/iconfield';\r\nimport { InputIconModule } from 'primeng/inputicon';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { Avatar } from '@masterteam/components/avatar';\r\n\r\n/** Horizontal gap between tabs — `gap-0.5`, in pixels. */\r\nconst GAP = 2;\r\n\r\n/** Width assumed for the more block on the one pass before it has rendered. */\r\nconst MORE_BLOCK_FALLBACK = 96;\r\n\r\nexport type TabSeverity =\r\n | 'primary'\r\n | 'secondary'\r\n | 'success'\r\n | 'info'\r\n | 'warn'\r\n | 'warning'\r\n | 'danger'\r\n | 'error'\r\n | 'help'\r\n | 'contrast';\r\n\r\nexport interface OptionItem {\r\n label?: string;\r\n value?: any;\r\n icon?: MTIcon | null;\r\n badge?: number | string | null;\r\n severity?: TabSeverity | null;\r\n disabled?: boolean;\r\n /**\r\n * The host is still resolving this tab's title — typically it names a record\r\n * that is being fetched. The label slot renders a placeholder instead of the\r\n * text, so the tab never flashes a stand-in name before the real one lands.\r\n * Keep supplying the fallback `label`: it stays the accessible name and is\r\n * still what the \"more\" search matches against.\r\n */\r\n loading?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\ntype NormalizedTabSeverity =\r\n | 'primary'\r\n | 'secondary'\r\n | 'success'\r\n | 'info'\r\n | 'warn'\r\n | 'danger'\r\n | 'help'\r\n | 'contrast';\r\n\r\n@Component({\r\n selector: 'mt-tabs',\r\n standalone: true,\r\n imports: [\r\n Icon,\r\n NgTemplateOutlet,\r\n SelectButton,\r\n FormsModule,\r\n Button,\r\n Popover,\r\n Avatar,\r\n InputTextModule,\r\n IconFieldModule,\r\n InputIconModule,\r\n TranslocoPipe,\r\n ],\r\n templateUrl: './tabs.html',\r\n styleUrls: ['./tabs.scss'],\r\n host: {\r\n class: 'grid min-w-0 gap-1',\r\n '[class.w-full]': 'fluid()',\r\n },\r\n})\r\nexport class Tabs {\r\n private readonly transloco = inject(TranslocoService);\r\n options = input<OptionItem[]>([]);\r\n optionLabel = input<string>('label');\r\n optionValue = input<string>('value');\r\n active = model<any>(null);\r\n readonly mode = input<'horizontal' | 'vertical' | 'underline'>('horizontal');\r\n readonly moreLabel = input<string>(\r\n this.transloco.translate('components.tabs.more'),\r\n );\r\n readonly defaultIcon = input<MTIcon>('layout.align-left-02');\r\n\r\n onChange = output<any>();\r\n\r\n readonly size = input<'small' | 'large' | undefined>();\r\n readonly fluid = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n disabled = input<boolean, unknown>(false, {\r\n transform: booleanAttribute,\r\n });\r\n\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly tabsContainer =\r\n viewChild<ElementRef<HTMLElement>>('tabsContainer');\r\n private readonly measureRow =\r\n viewChild<ElementRef<HTMLElement>>('measureRow');\r\n private readonly morePopover = viewChild(Popover);\r\n private readonly moreBlock = viewChild<ElementRef<HTMLElement>>('moreBlock');\r\n private resizeObserver?: ResizeObserver;\r\n private measureHandle = 0;\r\n private alignHandle = 0;\r\n /** Last real width of the more block; 0 until it has been rendered once. */\r\n private moreWidth = 0;\r\n\r\n readonly visibleCount = signal<number>(Number.MAX_SAFE_INTEGER);\r\n\r\n /** Natural width of every option, in order, from the measurement ghost row. */\r\n private readonly tabWidths = signal<number[]>([]);\r\n /** Room the visible row actually has, once the more button is accounted for. */\r\n private readonly availableWidth = signal<number>(0);\r\n\r\n private readonly activeIndex = computed(() =>\r\n this.options().findIndex((option) => this.isActiveOption(option)),\r\n );\r\n\r\n /**\r\n * The tabs the strip shows — the widest prefix that fits, plus the active tab\r\n * if that prefix would have hidden it.\r\n *\r\n * Without the second half, selecting a tab from the more menu left the strip\r\n * with nothing selected at all: no underline, and no `aria-selected` on any\r\n * tab, so neither a sighted user nor a screen reader could tell where they\r\n * were. A project exposes twenty-three tabs and ten of them sit in the menu,\r\n * so this is the normal case for a third of the product, not an edge.\r\n *\r\n * The active tab is appended rather than swapped in, which keeps the row in\r\n * the options' own order: everything in the prefix precedes it already.\r\n * Trailing tabs are dropped until it genuinely fits, using the same measured\r\n * widths the prefix was chosen with, so pinning never pushes the row wider\r\n * than the space it was measured against.\r\n */\r\n readonly visibleOptions = computed(() => {\r\n const options = this.options();\r\n const head = options.slice(0, this.visibleCount());\r\n\r\n const activeIndex = this.activeIndex();\r\n if (activeIndex < 0 || activeIndex < head.length) {\r\n return head;\r\n }\r\n\r\n const widths = this.tabWidths();\r\n const budget = this.availableWidth();\r\n const activeWidth = widths[activeIndex] ?? 0;\r\n\r\n const kept = [...head];\r\n let used = kept.reduce(\r\n (total, _, index) => total + (widths[index] ?? 0) + (index > 0 ? GAP : 0),\r\n 0,\r\n );\r\n while (kept.length && used + GAP + activeWidth > budget) {\r\n const last = kept.length - 1;\r\n used -= (widths[last] ?? 0) + (last > 0 ? GAP : 0);\r\n kept.pop();\r\n }\r\n\r\n return [...kept, options[activeIndex]];\r\n });\r\n\r\n readonly overflowOptions = computed(() => {\r\n const visible = new Set<OptionItem>(this.visibleOptions());\r\n return this.options().filter((option) => !visible.has(option));\r\n });\r\n readonly hasOverflow = computed(() => this.overflowOptions().length > 0);\r\n\r\n readonly searchThreshold = input<number>(8);\r\n readonly searchTerm = signal<string>('');\r\n readonly showOverflowSearch = computed(\r\n () => this.overflowOptions().length >= this.searchThreshold(),\r\n );\r\n readonly filteredOverflowOptions = computed(() => {\r\n const term = this.searchTerm().trim().toLowerCase();\r\n if (!term) return this.overflowOptions();\r\n return this.overflowOptions().filter((option) =>\r\n this.resolveLabel(option).toLowerCase().includes(term),\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const options = this.options();\r\n const active = this.active();\r\n if (!options.length) {\r\n return;\r\n }\r\n\r\n const hasActiveOption = options.some((option) =>\r\n Object.is(this.resolveValue(option), active),\r\n );\r\n if (!hasActiveOption) {\r\n this.active.set(this.resolveValue(options[0]));\r\n }\r\n });\r\n\r\n afterNextRender(() => {\r\n if (this.mode() !== 'underline') return;\r\n this.setupResizeObserver();\r\n this.scheduleMeasure();\r\n });\r\n\r\n effect(() => {\r\n // Re-measure when options or mode change.\r\n this.options();\r\n if (this.mode() !== 'underline') return;\r\n this.scheduleMeasure();\r\n });\r\n\r\n this.destroyRef.onDestroy(() => {\r\n this.resizeObserver?.disconnect();\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n if (this.alignHandle) {\r\n cancelAnimationFrame(this.alignHandle);\r\n }\r\n });\r\n }\r\n\r\n private setupResizeObserver(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n if (!container || typeof ResizeObserver === 'undefined') return;\r\n\r\n this.resizeObserver = new ResizeObserver(() => this.scheduleMeasure());\r\n this.resizeObserver.observe(container);\r\n }\r\n\r\n private scheduleMeasure(): void {\r\n if (this.measureHandle) {\r\n cancelAnimationFrame(this.measureHandle);\r\n }\r\n this.measureHandle = requestAnimationFrame(() => {\r\n this.measureHandle = 0;\r\n this.measureAndUpdate();\r\n });\r\n }\r\n\r\n private measureAndUpdate(): void {\r\n const container = this.tabsContainer()?.nativeElement;\r\n const measureRow = this.measureRow()?.nativeElement;\r\n if (!container || !measureRow) return;\r\n\r\n const optionsCount = this.options().length;\r\n if (optionsCount === 0) {\r\n this.visibleCount.set(0);\r\n return;\r\n }\r\n\r\n if (container.clientWidth === 0) return;\r\n\r\n // Inner width excludes the container's horizontal padding so we compare\r\n // against the actual space available to the flex tabs row.\r\n const style = getComputedStyle(container);\r\n const paddingX =\r\n (parseFloat(style.paddingLeft) || 0) +\r\n (parseFloat(style.paddingRight) || 0);\r\n const innerWidth = container.clientWidth - paddingX;\r\n if (innerWidth <= 0) return;\r\n\r\n const tabWidths = Array.from(measureRow.children).map(\r\n (el) => (el as HTMLElement).getBoundingClientRect().width,\r\n );\r\n\r\n if (tabWidths.length === 0) return;\r\n\r\n this.tabWidths.set(tabWidths);\r\n\r\n const totalWidth =\r\n tabWidths.reduce((sum, width) => sum + width, 0) +\r\n Math.max(0, tabWidths.length - 1) * GAP;\r\n\r\n // Everything fits — no more button needed.\r\n if (totalWidth <= innerWidth) {\r\n this.availableWidth.set(innerWidth);\r\n this.visibleCount.set(tabWidths.length);\r\n return;\r\n }\r\n\r\n // Reserve space for the more block. Measure it rather than assume: its\r\n // label is translated and it carries a count, so the old fixed 96px guess\r\n // ran narrow and let the row overflow the space it was measured against.\r\n // The block only exists once there IS overflow, so the first pass has to\r\n // fall back to the guess and re-measure as soon as the real one renders.\r\n const renderedMore = this.moreBlock()?.nativeElement.offsetWidth ?? 0;\r\n if (renderedMore > 0) {\r\n this.moreWidth = renderedMore;\r\n }\r\n const available = innerWidth - (this.moreWidth || MORE_BLOCK_FALLBACK);\r\n this.availableWidth.set(available);\r\n\r\n let cumulative = 0;\r\n let visibleCount = 0;\r\n for (let i = 0; i < tabWidths.length; i++) {\r\n const next = cumulative + tabWidths[i] + (i > 0 ? GAP : 0);\r\n if (next > available) break;\r\n cumulative = next;\r\n visibleCount++;\r\n }\r\n\r\n this.visibleCount.set(Math.max(1, visibleCount));\r\n\r\n if (!this.moreWidth) {\r\n // Second and final pass, now that the block it reserved room for exists.\r\n this.scheduleMeasure();\r\n }\r\n }\r\n\r\n onTabChange(value: any) {\r\n this.onChange.emit(value);\r\n }\r\n\r\n onOverflowSearch(value: string): void {\r\n this.searchTerm.set(value ?? '');\r\n // Filtering shrinks/grows the popover content, but PrimeNG only positions\r\n // the popover on show. Re-align after the filtered list re-renders so a\r\n // popover opened above the trigger stays attached instead of overlapping.\r\n this.scheduleOverflowAlign();\r\n }\r\n\r\n private scheduleOverflowAlign(): void {\r\n if (this.alignHandle) {\r\n cancelAnimationFrame(this.alignHandle);\r\n }\r\n this.alignHandle = requestAnimationFrame(() => {\r\n this.alignHandle = 0;\r\n const popover = this.morePopover();\r\n if (!popover?.overlayVisible) return;\r\n\r\n // Clear the stale flip marker so align() recomputes the arrow direction\r\n // for the new height instead of keeping the previous \"above\" state.\r\n const container = popover.container;\r\n if (container) {\r\n container.removeAttribute('data-p-popover-flipped');\r\n container.classList.remove('p-popover-flipped');\r\n }\r\n popover.align();\r\n });\r\n }\r\n\r\n onOverflowPopoverHide(): void {\r\n this.searchTerm.set('');\r\n }\r\n\r\n onOptionSelect(option: OptionItem): void {\r\n if (this.disabled() || this.isOptionDisabled(option)) {\r\n return;\r\n }\r\n\r\n const value = this.resolveValue(option);\r\n this.active.set(value);\r\n this.onTabChange(value);\r\n }\r\n\r\n resolveLabel(option: OptionItem): string {\r\n const labelKey = this.optionLabel();\r\n const label =\r\n option && typeof option === 'object'\r\n ? (option as Record<string, unknown>)[labelKey]\r\n : option;\r\n\r\n return typeof label === 'string' ? label : String(label ?? '');\r\n }\r\n\r\n resolveValue(option: OptionItem): unknown {\r\n const valueKey = this.optionValue();\r\n if (option && typeof option === 'object' && valueKey in option) {\r\n return (option as Record<string, unknown>)[valueKey];\r\n }\r\n\r\n return option;\r\n }\r\n\r\n resolveIcon(option: OptionItem): MTIcon | null {\r\n return typeof option?.icon === 'string' ? option.icon : null;\r\n }\r\n\r\n resolveIconOrDefault(option: OptionItem): MTIcon {\r\n return this.resolveIcon(option) ?? this.defaultIcon();\r\n }\r\n\r\n resolveBadge(option: OptionItem): number | string | null {\r\n return option?.badge ?? null;\r\n }\r\n\r\n isOptionLoading(option: OptionItem): boolean {\r\n return option?.loading === true;\r\n }\r\n\r\n hasBadge(option: OptionItem): boolean {\r\n return option?.badge !== null && option?.badge !== undefined;\r\n }\r\n\r\n hasCountBadge(option: OptionItem): boolean {\r\n const badge = option?.badge;\r\n if (badge === null || badge === undefined || badge === '') {\r\n return false;\r\n }\r\n const numeric = typeof badge === 'number' ? badge : Number(badge);\r\n return Number.isNaN(numeric) ? true : numeric > 0;\r\n }\r\n\r\n severity(option: OptionItem): NormalizedTabSeverity {\r\n const severity =\r\n typeof option?.severity === 'string'\r\n ? option.severity.trim().toLowerCase()\r\n : '';\r\n if (severity === 'error') return 'danger';\r\n if (severity === 'warning') return 'warn';\r\n if (\r\n severity === 'secondary' ||\r\n severity === 'success' ||\r\n severity === 'info' ||\r\n severity === 'warn' ||\r\n severity === 'danger' ||\r\n severity === 'help' ||\r\n severity === 'contrast'\r\n ) {\r\n return severity;\r\n }\r\n\r\n return 'primary';\r\n }\r\n\r\n isSeverity(option: OptionItem, severity: NormalizedTabSeverity): boolean {\r\n return this.severity(option) === severity;\r\n }\r\n\r\n hasNonPrimarySeverity(option: OptionItem): boolean {\r\n return this.severity(option) !== 'primary';\r\n }\r\n\r\n isActiveOption(option: OptionItem): boolean {\r\n return Object.is(this.active(), this.resolveValue(option));\r\n }\r\n\r\n isOptionDisabled(option: OptionItem): boolean {\r\n return !!option?.disabled;\r\n }\r\n\r\n trackOption(option: OptionItem, index: number): unknown {\r\n return this.resolveValue(option) ?? index;\r\n }\r\n}\r\n","@if (mode() === \"vertical\") {\r\n <div\r\n class=\"flex min-h-0 flex-col gap-1 rounded-2xl border border-surface-200 bg-white p-2\"\r\n role=\"tablist\"\r\n aria-orientation=\"vertical\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"group relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-start text-sm transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.bg-primary-50]=\"isActiveOption(option)\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-primary-700]=\"isActiveOption(option)\"\r\n [class.text-surface-500]=\"!isActiveOption(option)\"\r\n [class.hover:bg-surface-50]=\"!isActiveOption(option)\"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon\r\n [icon]=\"icon\"\r\n class=\"relative z-10 text-base\"\r\n [class.text-primary]=\"isActiveOption(option)\"\r\n [class.text-surface-400]=\"!isActiveOption(option)\"\r\n />\r\n }\r\n\r\n <span class=\"relative z-10 min-w-0 flex-1 truncate\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 ms-auto inline-flex min-w-5 items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n} @else if (mode() === \"underline\") {\r\n <div\r\n #tabsContainer\r\n class=\"relative flex w-full min-w-0 max-w-full items-center gap-0.5 overflow-x-clip\"\r\n role=\"tablist\"\r\n aria-orientation=\"horizontal\"\r\n >\r\n <!-- Invisible measurement ghost row: always renders every option at natural width -->\r\n <div\r\n #measureRow\r\n aria-hidden=\"true\"\r\n class=\"pointer-events-none invisible absolute top-0 left-0 flex flex-nowrap gap-0.5 -z-10\"\r\n >\r\n @for (option of options(); track trackOption(option, $index)) {\r\n <span\r\n class=\"inline-flex items-center gap-1.5 border-b-2 border-transparent px-3.5 py-2.5 text-sm font-semibold whitespace-nowrap\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n <span>\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n\r\n <!-- Visible tabs row -->\r\n <div\r\n class=\"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-clip border-b border-surface-200\"\r\n >\r\n @for (option of visibleOptions(); track trackOption(option, $index)) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"-mb-px inline-flex shrink-0 items-center gap-1.5 border-b-2 px-3.5 py-2.5 text-sm whitespace-nowrap transition-colors duration-150 outline-none focus-visible:ring-2 focus-visible:ring-primary/20\"\r\n [attr.aria-selected]=\"isActiveOption(option)\"\r\n [attr.tabindex]=\"isActiveOption(option) ? 0 : -1\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n [class.border-primary]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.text-primary]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.border-slate-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'secondary')\r\n \"\r\n [class.text-slate-600]=\"isSeverity(option, 'secondary')\"\r\n [class.border-emerald-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'success')\r\n \"\r\n [class.text-emerald-600]=\"isSeverity(option, 'success')\"\r\n [class.border-sky-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'info')\r\n \"\r\n [class.text-sky-600]=\"isSeverity(option, 'info')\"\r\n [class.border-amber-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'warn')\r\n \"\r\n [class.text-amber-700]=\"isSeverity(option, 'warn')\"\r\n [class.border-red-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'danger')\r\n \"\r\n [class.text-red-600]=\"isSeverity(option, 'danger')\"\r\n [class.border-purple-500]=\"\r\n isActiveOption(option) && isSeverity(option, 'help')\r\n \"\r\n [class.text-purple-600]=\"isSeverity(option, 'help')\"\r\n [class.border-zinc-700]=\"\r\n isActiveOption(option) && isSeverity(option, 'contrast')\r\n \"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.border-transparent]=\"!isActiveOption(option)\"\r\n [class.text-surface-700]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n [class.font-medium]=\"!isActiveOption(option)\"\r\n [class.hover:text-primary-600]=\"\r\n !isActiveOption(option) &&\r\n !hasNonPrimarySeverity(option) &&\r\n !(disabled() || isOptionDisabled(option))\r\n \"\r\n [class.hover:text-slate-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'secondary')\r\n \"\r\n [class.hover:text-emerald-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'success')\r\n \"\r\n [class.hover:text-sky-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'info')\r\n \"\r\n [class.hover:text-amber-800]=\"\r\n !isActiveOption(option) && isSeverity(option, 'warn')\r\n \"\r\n [class.hover:text-red-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'danger')\r\n \"\r\n [class.hover:text-purple-700]=\"\r\n !isActiveOption(option) && isSeverity(option, 'help')\r\n \"\r\n [class.hover:text-zinc-900]=\"\r\n !isActiveOption(option) && isSeverity(option, 'contrast')\r\n \"\r\n [class.cursor-pointer]=\"!(disabled() || isOptionDisabled(option))\"\r\n [class.cursor-not-allowed]=\"disabled() || isOptionDisabled(option)\"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option)\"\r\n >\r\n @if (resolveIcon(option); as icon) {\r\n <mt-icon [icon]=\"icon\" class=\"text-base\" />\r\n }\r\n\r\n <span class=\"truncate\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-50]=\"isSeverity(option, 'primary')\"\r\n [class.text-primary-700]=\"isSeverity(option, 'primary')\"\r\n [class.bg-slate-100]=\"isSeverity(option, 'secondary')\"\r\n [class.text-slate-700]=\"isSeverity(option, 'secondary')\"\r\n [class.bg-emerald-50]=\"isSeverity(option, 'success')\"\r\n [class.text-emerald-700]=\"isSeverity(option, 'success')\"\r\n [class.bg-sky-50]=\"isSeverity(option, 'info')\"\r\n [class.text-sky-700]=\"isSeverity(option, 'info')\"\r\n [class.bg-amber-50]=\"isSeverity(option, 'warn')\"\r\n [class.text-amber-800]=\"isSeverity(option, 'warn')\"\r\n [class.bg-red-50]=\"isSeverity(option, 'danger')\"\r\n [class.text-red-700]=\"isSeverity(option, 'danger')\"\r\n [class.bg-purple-50]=\"isSeverity(option, 'help')\"\r\n [class.text-purple-700]=\"isSeverity(option, 'help')\"\r\n [class.bg-zinc-100]=\"isSeverity(option, 'contrast')\"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.bg-surface-100]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n [class.text-surface-500]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hasOverflow()) {\r\n <div\r\n #moreBlock\r\n class=\"flex shrink-0 items-center -mb-px border-b border-surface-200 pb-1\"\r\n >\r\n <!--\r\n The count is the only thing on the strip that says how much is behind\r\n this button. A project hides ten of its twenty-three tabs here, and an\r\n unqualified \"More\" reads as an afterthought rather than as a third of\r\n the workspace.\r\n -->\r\n <mt-button\r\n icon=\"arrow.chevron-down\"\r\n [label]=\"moreLabel()\"\r\n [badge]=\"overflowOptions().length.toString()\"\r\n size=\"small\"\r\n severity=\"primary\"\r\n [text]=\"true\"\r\n [rounded]=\"true\"\r\n (onClick)=\"morePopover.toggle($event)\"\r\n />\r\n <p-popover\r\n #morePopover\r\n appendTo=\"body\"\r\n (onHide)=\"onOverflowPopoverHide()\"\r\n >\r\n <div class=\"flex min-w-56 flex-col\">\r\n @if (showOverflowSearch()) {\r\n <div class=\"border-b border-surface-200 p-2\">\r\n <p-iconfield iconPosition=\"left\">\r\n <p-inputicon>\r\n <mt-icon icon=\"general.search-md\" />\r\n </p-inputicon>\r\n <input\r\n pInputText\r\n type=\"text\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onOverflowSearch($any($event.target).value)\"\r\n [placeholder]=\"'components.tabs.search' | transloco\"\r\n class=\"w-full\"\r\n />\r\n </p-iconfield>\r\n </div>\r\n }\r\n <div\r\n class=\"flex max-h-80 flex-col divide-y divide-surface-100 overflow-y-auto\"\r\n >\r\n @for (\r\n option of filteredOverflowOptions();\r\n track trackOption(option, $index)\r\n ) {\r\n <button\r\n type=\"button\"\r\n class=\"flex w-full cursor-pointer items-center justify-start gap-2 px-2 py-1 text-start text-sm transition-colors [&_.p-avatar]:h-7 [&_.p-avatar]:w-7 [&_.p-avatar]:text-sm\"\r\n [class.bg-primary-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.text-primary]=\"\r\n isActiveOption(option) && isSeverity(option, 'primary')\r\n \"\r\n [class.bg-slate-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'secondary')\r\n \"\r\n [class.text-slate-600]=\"isSeverity(option, 'secondary')\"\r\n [class.bg-emerald-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'success')\r\n \"\r\n [class.text-emerald-600]=\"isSeverity(option, 'success')\"\r\n [class.bg-sky-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'info')\r\n \"\r\n [class.text-sky-600]=\"isSeverity(option, 'info')\"\r\n [class.bg-amber-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'warn')\r\n \"\r\n [class.text-amber-700]=\"isSeverity(option, 'warn')\"\r\n [class.bg-red-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'danger')\r\n \"\r\n [class.text-red-600]=\"isSeverity(option, 'danger')\"\r\n [class.bg-purple-50]=\"\r\n isActiveOption(option) && isSeverity(option, 'help')\r\n \"\r\n [class.text-purple-600]=\"isSeverity(option, 'help')\"\r\n [class.bg-zinc-100]=\"\r\n isActiveOption(option) && isSeverity(option, 'contrast')\r\n \"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.font-semibold]=\"isActiveOption(option)\"\r\n [class.text-surface-700]=\"\r\n !isActiveOption(option) && !hasNonPrimarySeverity(option)\r\n \"\r\n [class.hover:bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.cursor-not-allowed]=\"\r\n disabled() || isOptionDisabled(option)\r\n \"\r\n [class.opacity-60]=\"disabled() || isOptionDisabled(option)\"\r\n [disabled]=\"disabled() || isOptionDisabled(option)\"\r\n (click)=\"onOptionSelect(option); morePopover.hide()\"\r\n >\r\n <mt-avatar\r\n [icon]=\"resolveIconOrDefault(option)\"\r\n size=\"normal\"\r\n shape=\"circle\"\r\n styleClass=\"!bg-surface-100 !text-surface-600\"\r\n />\r\n <span class=\"flex-1 truncate text-start\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n @if (hasCountBadge(option)) {\r\n <span\r\n class=\"inline-grid min-w-[18px] place-items-center rounded-full px-1.5 text-[10px] leading-4 font-bold tabular-nums\"\r\n [class.bg-primary-100]=\"isSeverity(option, 'primary')\"\r\n [class.text-primary-700]=\"isSeverity(option, 'primary')\"\r\n [class.bg-slate-100]=\"isSeverity(option, 'secondary')\"\r\n [class.text-slate-700]=\"isSeverity(option, 'secondary')\"\r\n [class.bg-emerald-50]=\"isSeverity(option, 'success')\"\r\n [class.text-emerald-700]=\"isSeverity(option, 'success')\"\r\n [class.bg-sky-50]=\"isSeverity(option, 'info')\"\r\n [class.text-sky-700]=\"isSeverity(option, 'info')\"\r\n [class.bg-amber-50]=\"isSeverity(option, 'warn')\"\r\n [class.text-amber-800]=\"isSeverity(option, 'warn')\"\r\n [class.bg-red-50]=\"isSeverity(option, 'danger')\"\r\n [class.text-red-700]=\"isSeverity(option, 'danger')\"\r\n [class.bg-purple-50]=\"isSeverity(option, 'help')\"\r\n [class.text-purple-700]=\"isSeverity(option, 'help')\"\r\n [class.bg-zinc-100]=\"isSeverity(option, 'contrast')\"\r\n [class.text-zinc-800]=\"isSeverity(option, 'contrast')\"\r\n [class.bg-surface-100]=\"\r\n !isActiveOption(option) &&\r\n !hasNonPrimarySeverity(option)\r\n \"\r\n [class.text-surface-500]=\"\r\n !isActiveOption(option) &&\r\n !hasNonPrimarySeverity(option)\r\n \"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </button>\r\n } @empty {\r\n <div class=\"px-3 py-4 text-center text-sm text-surface-500\">\r\n {{ \"components.tabs.no-results\" | transloco }}\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </p-popover>\r\n </div>\r\n }\r\n </div>\r\n} @else {\r\n <p-selectbutton\r\n [options]=\"options()\"\r\n [(ngModel)]=\"active\"\r\n (ngModelChange)=\"onTabChange($event)\"\r\n [optionLabel]=\"optionLabel()\"\r\n [optionValue]=\"optionValue()\"\r\n styleClass=\"my-tabs-button\"\r\n [size]=\"size()\"\r\n [fluid]=\"fluid()\"\r\n [disabled]=\"disabled()\"\r\n unselectable\r\n >\r\n <ng-template #item let-option>\r\n <span class=\"inline-flex min-w-0 items-center gap-1.5\">\r\n <span class=\"truncate\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"tabLabel\"\r\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\r\n />\r\n </span>\r\n\r\n @if (hasBadge(option)) {\r\n <span\r\n class=\"relative z-10 min-w-5 ms-auto inline-flex items-center justify-center rounded-full p-1 text-xs leading-none\"\r\n [class.bg-primary]=\"isActiveOption(option)\"\r\n [class.text-white]=\"isActiveOption(option)\"\r\n [class.bg-surface-100]=\"!isActiveOption(option)\"\r\n [class.text-surface-600]=\"!isActiveOption(option)\"\r\n >\r\n {{ resolveBadge(option) }}\r\n </span>\r\n }\r\n </span>\r\n </ng-template>\r\n </p-selectbutton>\r\n}\r\n\r\n<!-- Shared label slot. A tab whose title is still being resolved by the host\r\n (`option.loading`) renders a placeholder bar instead of a stand-in name;\r\n the real label stays in the accessibility tree throughout. -->\r\n<ng-template #tabLabel let-option>\r\n @if (isOptionLoading(option)) {\r\n <span class=\"sr-only\">{{ resolveLabel(option) }}</span>\r\n <span\r\n aria-hidden=\"true\"\r\n class=\"inline-block h-3 w-20 max-w-full animate-pulse rounded bg-surface-200 align-middle\"\r\n ></span>\r\n } @else {\r\n {{ resolveLabel(option) }}\r\n }\r\n</ng-template>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA2BA;AACA,MAAM,GAAG,GAAG,CAAC;AAEb;AACA,MAAM,mBAAmB,GAAG,EAAE;MAiEjB,IAAI,CAAA;AACE,IAAA,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACrD,IAAA,OAAO,GAAG,KAAK,CAAe,EAAE,8EAAC;AACjC,IAAA,WAAW,GAAG,KAAK,CAAS,OAAO,kFAAC;AACpC,IAAA,WAAW,GAAG,KAAK,CAAS,OAAO,kFAAC;AACpC,IAAA,MAAM,GAAG,KAAK,CAAM,IAAI,6EAAC;AACh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AAA,EAAA,iBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE5H7E;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -37,14 +37,37 @@ declare class Tabs {
|
|
|
37
37
|
private readonly tabsContainer;
|
|
38
38
|
private readonly measureRow;
|
|
39
39
|
private readonly morePopover;
|
|
40
|
+
private readonly moreBlock;
|
|
40
41
|
private resizeObserver?;
|
|
41
42
|
private measureHandle;
|
|
42
43
|
private alignHandle;
|
|
44
|
+
/** Last real width of the more block; 0 until it has been rendered once. */
|
|
45
|
+
private moreWidth;
|
|
43
46
|
readonly visibleCount: _angular_core.WritableSignal<number>;
|
|
47
|
+
/** Natural width of every option, in order, from the measurement ghost row. */
|
|
48
|
+
private readonly tabWidths;
|
|
49
|
+
/** Room the visible row actually has, once the more button is accounted for. */
|
|
50
|
+
private readonly availableWidth;
|
|
51
|
+
private readonly activeIndex;
|
|
52
|
+
/**
|
|
53
|
+
* The tabs the strip shows — the widest prefix that fits, plus the active tab
|
|
54
|
+
* if that prefix would have hidden it.
|
|
55
|
+
*
|
|
56
|
+
* Without the second half, selecting a tab from the more menu left the strip
|
|
57
|
+
* with nothing selected at all: no underline, and no `aria-selected` on any
|
|
58
|
+
* tab, so neither a sighted user nor a screen reader could tell where they
|
|
59
|
+
* were. A project exposes twenty-three tabs and ten of them sit in the menu,
|
|
60
|
+
* so this is the normal case for a third of the product, not an edge.
|
|
61
|
+
*
|
|
62
|
+
* The active tab is appended rather than swapped in, which keeps the row in
|
|
63
|
+
* the options' own order: everything in the prefix precedes it already.
|
|
64
|
+
* Trailing tabs are dropped until it genuinely fits, using the same measured
|
|
65
|
+
* widths the prefix was chosen with, so pinning never pushes the row wider
|
|
66
|
+
* than the space it was measured against.
|
|
67
|
+
*/
|
|
44
68
|
readonly visibleOptions: _angular_core.Signal<OptionItem[]>;
|
|
45
69
|
readonly overflowOptions: _angular_core.Signal<OptionItem[]>;
|
|
46
70
|
readonly hasOverflow: _angular_core.Signal<boolean>;
|
|
47
|
-
readonly isActiveInOverflow: _angular_core.Signal<boolean>;
|
|
48
71
|
readonly searchThreshold: _angular_core.InputSignal<number>;
|
|
49
72
|
readonly searchTerm: _angular_core.WritableSignal<string>;
|
|
50
73
|
readonly showOverflowSearch: _angular_core.Signal<boolean>;
|