@masterteam/components 0.0.325 → 0.0.327
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/assets/common.css +1 -1
- package/assets/i18n/ar.json +2 -1
- package/assets/i18n/en.json +2 -1
- package/fesm2022/masterteam-components-business-fields.mjs +6 -1
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +180 -18
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +4 -1
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/fesm2022/masterteam-components-select-field.mjs +16 -2
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-sidebar.mjs +2 -2
- package/fesm2022/masterteam-components-sidebar.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-entities.d.ts +115 -8
- package/types/masterteam-components-select-field.d.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masterteam-components-sidebar.mjs","sources":["../../../../packages/masterteam/components/sidebar/sidebar.ts","../../../../packages/masterteam/components/sidebar/sidebar.html","../../../../packages/masterteam/components/sidebar/masterteam-components-sidebar.ts"],"sourcesContent":["import {\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n HostListener,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport {\r\n NavigationEnd,\r\n Router,\r\n RouterLink,\r\n RouterLinkActive,\r\n} from '@angular/router';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { filter } from 'rxjs';\r\nimport { Directionality } from '@angular/cdk/bidi';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\n\r\nexport interface SidebarItem {\r\n id: string | number;\r\n title: string;\r\n icon?: MTIcon;\r\n routerLink?: any[] | string;\r\n /** Absolute or app-relative URL for cross-app links. */\r\n href?: string;\r\n /**\r\n * Optional nested items. When present the entry becomes a submenu:\r\n * an inline accordion while the sidebar is expanded, and a hover/focus\r\n * flyout panel beside the icon while the sidebar is collapsed.\r\n */\r\n children?: SidebarItem[];\r\n /** Show a placeholder spinner row while the children load lazily. */\r\n loading?: boolean;\r\n}\r\n\r\n/** Positioned state for the collapsed-mode flyout panel. */\r\ninterface FlyoutState {\r\n item: SidebarItem;\r\n top: number;\r\n left?: number;\r\n right?: number;\r\n maxHeight: number;\r\n}\r\n\r\nconst FLYOUT_GAP = 8;\r\nconst FLYOUT_MARGIN = 16;\r\nconst FLYOUT_MIN_HEIGHT = 200;\r\nconst FLYOUT_CLOSE_DELAY = 140;\r\n\r\n@Component({\r\n selector: 'mt-sidebar',\r\n standalone: true,\r\n imports: [RouterLinkActive, RouterLink, Icon, Tooltip, TranslocoPipe],\r\n templateUrl: './sidebar.html',\r\n styles: [\r\n `\r\n :host {\r\n display: block;\r\n height: 100%;\r\n min-height: 0;\r\n }\r\n\r\n .mt-sidebar-menu {\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--p-surface-400) transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar {\r\n width: 6px;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-track {\r\n background: transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb {\r\n border-radius: 9999px;\r\n background: color-mix(in srgb, var(--p-surface-500) 58%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb:hover {\r\n background: color-mix(in srgb, var(--p-surface-600) 72%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu-collapsed {\r\n scrollbar-color: var(--p-surface-500) transparent;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar {\r\n width: 2px;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb {\r\n background: color-mix(in srgb, var(--p-surface-600) 82%, transparent);\r\n }\r\n\r\n /* Collapsed-mode submenu flyout */\r\n .mt-sidebar-flyout {\r\n position: fixed;\r\n z-index: 1200;\r\n animation: mt-sidebar-flyout-in 140ms ease-out;\r\n }\r\n\r\n @keyframes mt-sidebar-flyout-in {\r\n from {\r\n opacity: 0;\r\n transform: translateY(2px) scale(0.98);\r\n }\r\n\r\n to {\r\n opacity: 1;\r\n transform: translateY(0) scale(1);\r\n }\r\n }\r\n\r\n @media (prefers-reduced-motion: reduce) {\r\n .mt-sidebar-flyout {\r\n animation: none;\r\n }\r\n }\r\n `,\r\n ],\r\n // A static `title=\"…\"` is also the HTML global title attribute - without\r\n // this the browser shows it as a native tooltip over the whole sidebar.\r\n host: { '[attr.title]': 'null' },\r\n})\r\nexport class Sidebar {\r\n private readonly router = inject(Router);\r\n private readonly dir = inject(Directionality, { optional: true });\r\n\r\n items = input<SidebarItem[]>([]);\r\n\r\n logo = input<string>();\r\n logoLink = input<string | any[]>();\r\n title = input<string>();\r\n subTitle = input<string>();\r\n\r\n // Each half renders only when it carries text. A host can legitimately have\r\n // one and not the other — clearing the tagline in the branding editor is how\r\n // a tenant hides it — and an empty `<span>` still holds a line box, which\r\n // left the surviving half sitting off-centre.\r\n protected readonly hasTitle = computed(() => !!this.title()?.trim());\r\n protected readonly hasSubTitle = computed(() => !!this.subTitle()?.trim());\r\n protected readonly hasBrandText = computed(\r\n () => this.hasTitle() || this.hasSubTitle(),\r\n );\r\n\r\n bgColor = input<string>();\r\n bgImage = input<string>();\r\n bgRepeat = input<boolean, unknown>(false, { transform: booleanAttribute });\r\n iconsColor = input<string>('var(--p-text-color)');\r\n\r\n expanded = signal(false);\r\n expandedChange = output<boolean>();\r\n\r\n /** Parent items the user forced open / closed, overriding auto-expand. */\r\n private readonly openGroupIds = signal<Set<string | number>>(new Set());\r\n private readonly closedGroupIds = signal<Set<string | number>>(new Set());\r\n\r\n /** Currently anchored collapsed-mode flyout, if any. */\r\n readonly flyout = signal<FlyoutState | null>(null);\r\n private flyoutCloseTimer: ReturnType<typeof setTimeout> | null = null;\r\n\r\n /** Live URL so active sections auto-expand their submenu. */\r\n private readonly currentUrl = signal(this.router.url);\r\n\r\n protected readonly isRtl = computed(() => this.dir?.value === 'rtl');\r\n\r\n constructor() {\r\n this.router.events\r\n .pipe(\r\n filter(\r\n (event): event is NavigationEnd => event instanceof NavigationEnd,\r\n ),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe((event) => this.currentUrl.set(event.urlAfterRedirects));\r\n }\r\n\r\n toggleSidebar(): void {\r\n this.expanded.update((v) => !v);\r\n this.expandedChange.emit(this.expanded());\r\n this.closeFlyout();\r\n }\r\n\r\n hasChildren(item: SidebarItem): boolean {\r\n return !!item.children?.length || !!item.loading;\r\n }\r\n\r\n // ============================================================================\r\n // Expanded mode — inline accordion\r\n // ============================================================================\r\n\r\n isGroupOpen(item: SidebarItem): boolean {\r\n if (this.openGroupIds().has(item.id)) return true;\r\n if (this.closedGroupIds().has(item.id)) return false;\r\n return this.isSectionActive(item);\r\n }\r\n\r\n toggleGroup(item: SidebarItem, event?: Event): void {\r\n event?.stopPropagation();\r\n const open = new Set(this.openGroupIds());\r\n const closed = new Set(this.closedGroupIds());\r\n if (this.isGroupOpen(item)) {\r\n open.delete(item.id);\r\n closed.add(item.id);\r\n } else {\r\n closed.delete(item.id);\r\n open.add(item.id);\r\n }\r\n this.openGroupIds.set(open);\r\n this.closedGroupIds.set(closed);\r\n }\r\n\r\n /** A parent is \"active\" when the current route matches it or any child. */\r\n isSectionActive(item: SidebarItem): boolean {\r\n const url = this.currentUrl().split('?')[0];\r\n if (this.linkMatches(item.routerLink, url, true)) return true;\r\n return !!item.children?.some((child) =>\r\n this.linkMatches(child.routerLink, url),\r\n );\r\n }\r\n\r\n private linkMatches(\r\n link: SidebarItem['routerLink'],\r\n url: string,\r\n exact = false,\r\n ): boolean {\r\n const path = this.toPath(link);\r\n if (!path) return false;\r\n return exact ? url === path : url === path || url.startsWith(path + '/');\r\n }\r\n\r\n private toPath(link: SidebarItem['routerLink']): string {\r\n if (!link) return '';\r\n const parts = Array.isArray(link) ? link : [link];\r\n return ('/' + parts.map((p) => String(p)).join('/')).replace(\r\n /\\/{2,}/g,\r\n '/',\r\n );\r\n }\r\n\r\n // ============================================================================\r\n // Collapsed mode — flyout panel\r\n // ============================================================================\r\n\r\n openFlyout(item: SidebarItem, event: Event): void {\r\n if (this.expanded() || !this.hasChildren(item)) return;\r\n\r\n const anchor = event.currentTarget as HTMLElement | null;\r\n if (!anchor) return;\r\n\r\n this.cancelFlyoutClose();\r\n\r\n const rect = anchor.getBoundingClientRect();\r\n const viewportHeight = window.innerHeight;\r\n\r\n let top = rect.top;\r\n if (top + FLYOUT_MIN_HEIGHT > viewportHeight) {\r\n top = Math.max(\r\n FLYOUT_MARGIN,\r\n viewportHeight - FLYOUT_MIN_HEIGHT - FLYOUT_MARGIN,\r\n );\r\n }\r\n\r\n const maxHeight = Math.max(\r\n FLYOUT_MIN_HEIGHT,\r\n viewportHeight - top - FLYOUT_MARGIN,\r\n );\r\n\r\n this.flyout.set(\r\n this.isRtl()\r\n ? {\r\n item,\r\n top,\r\n right: window.innerWidth - rect.left + FLYOUT_GAP,\r\n maxHeight,\r\n }\r\n : { item, top, left: rect.right + FLYOUT_GAP, maxHeight },\r\n );\r\n }\r\n\r\n /** Keep the panel open while the pointer travels into it. */\r\n cancelFlyoutClose(): void {\r\n if (this.flyoutCloseTimer !== null) {\r\n clearTimeout(this.flyoutCloseTimer);\r\n this.flyoutCloseTimer = null;\r\n }\r\n }\r\n\r\n scheduleFlyoutClose(): void {\r\n this.cancelFlyoutClose();\r\n this.flyoutCloseTimer = setTimeout(\r\n () => this.flyout.set(null),\r\n FLYOUT_CLOSE_DELAY,\r\n );\r\n }\r\n\r\n closeFlyout(): void {\r\n this.cancelFlyoutClose();\r\n this.flyout.set(null);\r\n }\r\n\r\n @HostListener('window:resize')\r\n onViewportChange(): void {\r\n this.closeFlyout();\r\n }\r\n}\r\n","<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-7 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] hover:bg-surface-100 dark:hover:bg-surface-900 transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-xl transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'22px'\"\r\n [style.--mt-icon-prev-height]=\"'22px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || hasBrandText()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (hasTitle()) {\r\n <span class=\"text-sm font-semibold truncate\">{{\r\n title()\r\n }}</span>\r\n }\r\n @if (hasSubTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-2 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded hover:bg-surface-300/60 dark:hover:bg-surface-700/60 transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md hover:bg-primary-50 dark:hover:bg-surface-900 transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 dark:hover:bg-surface-900 hover:bg-primary-50 transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAiDA,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,iBAAiB,GAAG,GAAG;AAC7B,MAAM,kBAAkB,GAAG,GAAG;MA+EjB,OAAO,CAAA;AACD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACvB,GAAG,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEjE,IAAA,KAAK,GAAG,KAAK,CAAgB,EAAE,4EAAC;IAEhC,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BA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AAa,CAAC,EAAA,IAAA,EAwE/D,EAAE,cAAc,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,kqgBAAA,EAAA,MAAA,EAAA,CAAA,6gCAAA,CAAA,EAAA;;sBAmL/B,YAAY;uBAAC,eAAe;;;AEpT/B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"masterteam-components-sidebar.mjs","sources":["../../../../packages/masterteam/components/sidebar/sidebar.ts","../../../../packages/masterteam/components/sidebar/sidebar.html","../../../../packages/masterteam/components/sidebar/masterteam-components-sidebar.ts"],"sourcesContent":["import {\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n HostListener,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { TranslocoPipe } from '@jsverse/transloco';\r\nimport { Icon, MTIcon } from '@masterteam/icons';\r\nimport {\r\n NavigationEnd,\r\n Router,\r\n RouterLink,\r\n RouterLinkActive,\r\n} from '@angular/router';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { filter } from 'rxjs';\r\nimport { Directionality } from '@angular/cdk/bidi';\r\nimport { Tooltip } from '@masterteam/components/tooltip';\r\n\r\nexport interface SidebarItem {\r\n id: string | number;\r\n title: string;\r\n icon?: MTIcon;\r\n routerLink?: any[] | string;\r\n /** Absolute or app-relative URL for cross-app links. */\r\n href?: string;\r\n /**\r\n * Optional nested items. When present the entry becomes a submenu:\r\n * an inline accordion while the sidebar is expanded, and a hover/focus\r\n * flyout panel beside the icon while the sidebar is collapsed.\r\n */\r\n children?: SidebarItem[];\r\n /** Show a placeholder spinner row while the children load lazily. */\r\n loading?: boolean;\r\n}\r\n\r\n/** Positioned state for the collapsed-mode flyout panel. */\r\ninterface FlyoutState {\r\n item: SidebarItem;\r\n top: number;\r\n left?: number;\r\n right?: number;\r\n maxHeight: number;\r\n}\r\n\r\nconst FLYOUT_GAP = 8;\r\nconst FLYOUT_MARGIN = 16;\r\nconst FLYOUT_MIN_HEIGHT = 200;\r\nconst FLYOUT_CLOSE_DELAY = 140;\r\n\r\n@Component({\r\n selector: 'mt-sidebar',\r\n standalone: true,\r\n imports: [RouterLinkActive, RouterLink, Icon, Tooltip, TranslocoPipe],\r\n templateUrl: './sidebar.html',\r\n styles: [\r\n `\r\n :host {\r\n display: block;\r\n height: 100%;\r\n min-height: 0;\r\n }\r\n\r\n .mt-sidebar-menu {\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--p-surface-400) transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar {\r\n width: 6px;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-track {\r\n background: transparent;\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb {\r\n border-radius: 9999px;\r\n background: color-mix(in srgb, var(--p-surface-500) 58%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu::-webkit-scrollbar-thumb:hover {\r\n background: color-mix(in srgb, var(--p-surface-600) 72%, transparent);\r\n }\r\n\r\n .mt-sidebar-menu-collapsed {\r\n scrollbar-color: var(--p-surface-500) transparent;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar {\r\n width: 2px;\r\n }\r\n\r\n .mt-sidebar-menu-collapsed::-webkit-scrollbar-thumb {\r\n background: color-mix(in srgb, var(--p-surface-600) 82%, transparent);\r\n }\r\n\r\n /*\r\n * Hover tints with the item's own colour (iconsColor, or primary on the\r\n * active section) instead of a fixed light surface: a branded dark rail\r\n * with light icons turned the old light hover into light-on-light and the\r\n * icon vanished. The active row keeps its own background — this rule is\r\n * unlayered, so it would otherwise beat the routerLinkActive utilities.\r\n */\r\n .mt-sidebar-item:not(.mt-sidebar-item-active):hover {\r\n background-color: color-mix(in srgb, currentColor 12%, transparent);\r\n }\r\n\r\n .mt-sidebar-chevron:hover {\r\n background-color: color-mix(in srgb, currentColor 18%, transparent);\r\n }\r\n\r\n /* Collapsed-mode submenu flyout */\r\n .mt-sidebar-flyout {\r\n position: fixed;\r\n z-index: 1200;\r\n animation: mt-sidebar-flyout-in 140ms ease-out;\r\n }\r\n\r\n @keyframes mt-sidebar-flyout-in {\r\n from {\r\n opacity: 0;\r\n transform: translateY(2px) scale(0.98);\r\n }\r\n\r\n to {\r\n opacity: 1;\r\n transform: translateY(0) scale(1);\r\n }\r\n }\r\n\r\n @media (prefers-reduced-motion: reduce) {\r\n .mt-sidebar-flyout {\r\n animation: none;\r\n }\r\n }\r\n `,\r\n ],\r\n // A static `title=\"…\"` is also the HTML global title attribute - without\r\n // this the browser shows it as a native tooltip over the whole sidebar.\r\n host: { '[attr.title]': 'null' },\r\n})\r\nexport class Sidebar {\r\n private readonly router = inject(Router);\r\n private readonly dir = inject(Directionality, { optional: true });\r\n\r\n items = input<SidebarItem[]>([]);\r\n\r\n logo = input<string>();\r\n logoLink = input<string | any[]>();\r\n title = input<string>();\r\n subTitle = input<string>();\r\n\r\n // Each half renders only when it carries text. A host can legitimately have\r\n // one and not the other — clearing the tagline in the branding editor is how\r\n // a tenant hides it — and an empty `<span>` still holds a line box, which\r\n // left the surviving half sitting off-centre.\r\n protected readonly hasTitle = computed(() => !!this.title()?.trim());\r\n protected readonly hasSubTitle = computed(() => !!this.subTitle()?.trim());\r\n protected readonly hasBrandText = computed(\r\n () => this.hasTitle() || this.hasSubTitle(),\r\n );\r\n\r\n bgColor = input<string>();\r\n bgImage = input<string>();\r\n bgRepeat = input<boolean, unknown>(false, { transform: booleanAttribute });\r\n iconsColor = input<string>('var(--p-text-color)');\r\n\r\n expanded = signal(false);\r\n expandedChange = output<boolean>();\r\n\r\n /** Parent items the user forced open / closed, overriding auto-expand. */\r\n private readonly openGroupIds = signal<Set<string | number>>(new Set());\r\n private readonly closedGroupIds = signal<Set<string | number>>(new Set());\r\n\r\n /** Currently anchored collapsed-mode flyout, if any. */\r\n readonly flyout = signal<FlyoutState | null>(null);\r\n private flyoutCloseTimer: ReturnType<typeof setTimeout> | null = null;\r\n\r\n /** Live URL so active sections auto-expand their submenu. */\r\n private readonly currentUrl = signal(this.router.url);\r\n\r\n protected readonly isRtl = computed(() => this.dir?.value === 'rtl');\r\n\r\n constructor() {\r\n this.router.events\r\n .pipe(\r\n filter(\r\n (event): event is NavigationEnd => event instanceof NavigationEnd,\r\n ),\r\n takeUntilDestroyed(),\r\n )\r\n .subscribe((event) => this.currentUrl.set(event.urlAfterRedirects));\r\n }\r\n\r\n toggleSidebar(): void {\r\n this.expanded.update((v) => !v);\r\n this.expandedChange.emit(this.expanded());\r\n this.closeFlyout();\r\n }\r\n\r\n hasChildren(item: SidebarItem): boolean {\r\n return !!item.children?.length || !!item.loading;\r\n }\r\n\r\n // ============================================================================\r\n // Expanded mode — inline accordion\r\n // ============================================================================\r\n\r\n isGroupOpen(item: SidebarItem): boolean {\r\n if (this.openGroupIds().has(item.id)) return true;\r\n if (this.closedGroupIds().has(item.id)) return false;\r\n return this.isSectionActive(item);\r\n }\r\n\r\n toggleGroup(item: SidebarItem, event?: Event): void {\r\n event?.stopPropagation();\r\n const open = new Set(this.openGroupIds());\r\n const closed = new Set(this.closedGroupIds());\r\n if (this.isGroupOpen(item)) {\r\n open.delete(item.id);\r\n closed.add(item.id);\r\n } else {\r\n closed.delete(item.id);\r\n open.add(item.id);\r\n }\r\n this.openGroupIds.set(open);\r\n this.closedGroupIds.set(closed);\r\n }\r\n\r\n /** A parent is \"active\" when the current route matches it or any child. */\r\n isSectionActive(item: SidebarItem): boolean {\r\n const url = this.currentUrl().split('?')[0];\r\n if (this.linkMatches(item.routerLink, url, true)) return true;\r\n return !!item.children?.some((child) =>\r\n this.linkMatches(child.routerLink, url),\r\n );\r\n }\r\n\r\n private linkMatches(\r\n link: SidebarItem['routerLink'],\r\n url: string,\r\n exact = false,\r\n ): boolean {\r\n const path = this.toPath(link);\r\n if (!path) return false;\r\n return exact ? url === path : url === path || url.startsWith(path + '/');\r\n }\r\n\r\n private toPath(link: SidebarItem['routerLink']): string {\r\n if (!link) return '';\r\n const parts = Array.isArray(link) ? link : [link];\r\n return ('/' + parts.map((p) => String(p)).join('/')).replace(\r\n /\\/{2,}/g,\r\n '/',\r\n );\r\n }\r\n\r\n // ============================================================================\r\n // Collapsed mode — flyout panel\r\n // ============================================================================\r\n\r\n openFlyout(item: SidebarItem, event: Event): void {\r\n if (this.expanded() || !this.hasChildren(item)) return;\r\n\r\n const anchor = event.currentTarget as HTMLElement | null;\r\n if (!anchor) return;\r\n\r\n this.cancelFlyoutClose();\r\n\r\n const rect = anchor.getBoundingClientRect();\r\n const viewportHeight = window.innerHeight;\r\n\r\n let top = rect.top;\r\n if (top + FLYOUT_MIN_HEIGHT > viewportHeight) {\r\n top = Math.max(\r\n FLYOUT_MARGIN,\r\n viewportHeight - FLYOUT_MIN_HEIGHT - FLYOUT_MARGIN,\r\n );\r\n }\r\n\r\n const maxHeight = Math.max(\r\n FLYOUT_MIN_HEIGHT,\r\n viewportHeight - top - FLYOUT_MARGIN,\r\n );\r\n\r\n this.flyout.set(\r\n this.isRtl()\r\n ? {\r\n item,\r\n top,\r\n right: window.innerWidth - rect.left + FLYOUT_GAP,\r\n maxHeight,\r\n }\r\n : { item, top, left: rect.right + FLYOUT_GAP, maxHeight },\r\n );\r\n }\r\n\r\n /** Keep the panel open while the pointer travels into it. */\r\n cancelFlyoutClose(): void {\r\n if (this.flyoutCloseTimer !== null) {\r\n clearTimeout(this.flyoutCloseTimer);\r\n this.flyoutCloseTimer = null;\r\n }\r\n }\r\n\r\n scheduleFlyoutClose(): void {\r\n this.cancelFlyoutClose();\r\n this.flyoutCloseTimer = setTimeout(\r\n () => this.flyout.set(null),\r\n FLYOUT_CLOSE_DELAY,\r\n );\r\n }\r\n\r\n closeFlyout(): void {\r\n this.cancelFlyoutClose();\r\n this.flyout.set(null);\r\n }\r\n\r\n @HostListener('window:resize')\r\n onViewportChange(): void {\r\n this.closeFlyout();\r\n }\r\n}\r\n","<div\r\n class=\"flex h-full min-h-0 flex-col overflow-hidden border-e-1 border-surface-300 bg-surface-200 transition-all duration-400 ease-in-out dark:bg-surface-800\"\r\n [style.width]=\"expanded() ? '18rem' : '4rem'\"\r\n>\r\n <div\r\n class=\"flex h-full min-h-0 flex-col gap-7 px-2 py-4\"\r\n [style.backgroundColor]=\"bgColor()\"\r\n [style.backgroundImage]=\"bgImage() ? 'url(' + bgImage() + ')' : null\"\r\n [style.backgroundSize]=\"bgImage() && !bgRepeat() ? 'cover' : null\"\r\n [style.backgroundPosition]=\"bgImage() && !bgRepeat() ? 'center' : null\"\r\n [class.bg-no-repeat]=\"!bgRepeat()\"\r\n [class.bg-repeat]=\"bgRepeat()\"\r\n >\r\n <!-- Toggle Button & Branding -->\r\n <div class=\"flex shrink-0 items-center gap-2\">\r\n <button\r\n type=\"button\"\r\n size=\"large\"\r\n class=\"flex items-center justify-center w-[47px] h-[40px] mt-sidebar-item transition-colors rounded-xl cursor-pointer shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n (click)=\"toggleSidebar()\"\r\n >\r\n <mt-icon\r\n icon=\"general.menu-01\"\r\n class=\"text-xl transition-transform duration-400 ease-in-out\"\r\n [class.rotate-180]=\"expanded()\"\r\n [style.--mt-icon-prev-width]=\"'22px'\"\r\n [style.--mt-icon-prev-height]=\"'22px'\"\r\n />\r\n </button>\r\n\r\n @if (logo() || hasBrandText()) {\r\n <div\r\n class=\"flex items-center gap-2 overflow-hidden transition-all duration-400 ease-in-out\"\r\n [class.max-w-0]=\"!expanded()\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n @if (logo()) {\r\n <img\r\n [src]=\"logo()\"\r\n [alt]=\"'components.sidebar.logoAlt' | transloco\"\r\n class=\"h-8 shrink-0\"\r\n [routerLink]=\"logoLink()\"\r\n [class.cursor-pointer]=\"logoLink()\"\r\n />\r\n }\r\n @if (logo() && hasBrandText()) {\r\n <div\r\n class=\"h-6 w-[1px] bg-current opacity-30 shrink-0\"\r\n [style.color]=\"iconsColor()\"\r\n ></div>\r\n }\r\n @if (hasBrandText()) {\r\n <div\r\n class=\"flex flex-col gap-0.5 min-w-0\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (hasTitle()) {\r\n <span class=\"text-sm font-semibold truncate\">{{\r\n title()\r\n }}</span>\r\n }\r\n @if (hasSubTitle()) {\r\n <span class=\"text-xs opacity-70 truncate\">{{\r\n subTitle()\r\n }}</span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex min-h-0 flex-1 flex-col gap-2 overflow-x-hidden overflow-y-auto overscroll-contain\"\r\n [class.mt-sidebar-menu-collapsed]=\"!expanded()\"\r\n [class.pr-1]=\"expanded()\"\r\n [class.pr-px]=\"!expanded()\"\r\n (scroll)=\"closeFlyout()\"\r\n >\r\n @for (item of items(); track item.id) {\r\n <!-- ============ Submenu parent (has children) ============ -->\r\n @if (hasChildren(item)) {\r\n @if (expanded()) {\r\n <!-- Expanded: inline accordion -->\r\n <div class=\"flex flex-col\">\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 rounded-md mt-sidebar-item transition-colors overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"flex-1 truncate whitespace-nowrap text-sm font-medium\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n <button\r\n type=\"button\"\r\n class=\"me-2 grid h-6 w-6 shrink-0 cursor-pointer place-items-center rounded mt-sidebar-chevron transition-colors\"\r\n [attr.aria-expanded]=\"isGroupOpen(item)\"\r\n (click)=\"toggleGroup(item, $event)\"\r\n >\r\n <mt-icon\r\n icon=\"arrow.chevron-down\"\r\n class=\"text-xs transition-transform duration-300 ease-in-out\"\r\n [class.rotate-180]=\"isGroupOpen(item)\"\r\n [style.--mt-icon-prev-width]=\"'14px'\"\r\n [style.--mt-icon-prev-height]=\"'14px'\"\r\n />\r\n </button>\r\n </a>\r\n\r\n <div\r\n class=\"grid transition-[grid-template-rows] duration-300 ease-in-out\"\r\n [style.gridTemplateRows]=\"isGroupOpen(item) ? '1fr' : '0fr'\"\r\n >\r\n <div class=\"overflow-hidden\">\r\n <div class=\"flex flex-col gap-0.5 py-1\">\r\n @if (item.loading && !item.children?.length) {\r\n <div\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 text-sm opacity-70\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <mt-icon\r\n icon=\"general.loading-01\"\r\n class=\"animate-spin\"\r\n />\r\n <span class=\"truncate\">{{\r\n \"components.sidebar.loading\" | transloco\r\n }}</span>\r\n </div>\r\n }\r\n @for (child of item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md mt-sidebar-item transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"mt-sidebar-item-active bg-primary-50 dark:bg-primary-900\"\r\n #crla=\"routerLinkActive\"\r\n class=\"flex items-center gap-2.5 h-10 ps-11 pe-3 shrink-0 rounded-md mt-sidebar-item transition-colors overflow-hidden\"\r\n mtTooltip=\"{{ child.title }}\"\r\n [style.color]=\"\r\n crla.isActive\r\n ? 'var(--p-primary-500)'\r\n : iconsColor()\r\n \"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate text-sm\">{{\r\n child.title\r\n }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- Collapsed: icon trigger + hover/focus flyout -->\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 mt-sidebar-item transition-colors rounded-md overflow-hidden\"\r\n [style.color]=\"\r\n isSectionActive(item) ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n (mouseenter)=\"openFlyout(item, $event)\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n (focus)=\"openFlyout(item, $event)\"\r\n (blur)=\"scheduleFlyoutClose()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n </a>\r\n }\r\n } @else {\r\n <!-- ============ Leaf item ============ -->\r\n @if (item.href) {\r\n <a\r\n [href]=\"item.href\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 mt-sidebar-item transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"iconsColor()\"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"item.routerLink\"\r\n routerLinkActive=\"mt-sidebar-item-active bg-primary-50 dark:bg-primary-900\"\r\n #rla=\"routerLinkActive\"\r\n class=\"flex items-center gap-3 h-[47px] min-w-[47px] shrink-0 mt-sidebar-item transition-colors rounded-md overflow-hidden\"\r\n mtTooltip=\"{{ item.title }}\"\r\n [style.color]=\"\r\n rla.isActive ? 'var(--p-primary-500)' : iconsColor()\r\n \"\r\n >\r\n <div class=\"px-3.5\">\r\n <mt-icon\r\n [icon]=\"item.icon\"\r\n class=\"shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'20px'\"\r\n [style.--mt-icon-prev-height]=\"'20px'\"\r\n />\r\n </div>\r\n <div\r\n class=\"whitespace-nowrap text-sm font-medium transition-all duration-400 ease-in-out overflow-hidden\"\r\n [class.opacity-0]=\"!expanded()\"\r\n [class.max-w-xs]=\"expanded()\"\r\n [class.opacity-100]=\"expanded()\"\r\n >\r\n {{ item.title }}\r\n </div>\r\n </a>\r\n }\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<!-- ============ Collapsed-mode flyout panel ============ -->\r\n@if (flyout(); as fly) {\r\n <div\r\n class=\"mt-sidebar-flyout flex w-60 flex-col overflow-hidden rounded-xl border border-surface-300 bg-surface-0 shadow-2xl dark:border-surface-700 dark:bg-surface-800\"\r\n [style.top.px]=\"fly.top\"\r\n [style.left.px]=\"fly.left\"\r\n [style.right.px]=\"fly.right\"\r\n (mouseenter)=\"cancelFlyoutClose()\"\r\n (mouseleave)=\"scheduleFlyoutClose()\"\r\n >\r\n <div\r\n class=\"flex items-center gap-2 border-b border-surface-200 px-4 py-2.5 dark:border-surface-700\"\r\n >\r\n @if (fly.item.icon) {\r\n <mt-icon\r\n [icon]=\"fly.item.icon\"\r\n class=\"text-primary-500 shrink-0\"\r\n [style.--mt-icon-prev-width]=\"'18px'\"\r\n [style.--mt-icon-prev-height]=\"'18px'\"\r\n />\r\n }\r\n <span class=\"truncate text-sm font-semibold\">{{ fly.item.title }}</span>\r\n </div>\r\n\r\n <div\r\n class=\"mt-sidebar-menu flex flex-col gap-0.5 overflow-y-auto p-1.5\"\r\n [style.maxHeight.px]=\"fly.maxHeight\"\r\n >\r\n @if (fly.item.loading && !fly.item.children?.length) {\r\n <div class=\"flex items-center gap-2 px-3 py-2 text-sm text-muted-color\">\r\n <mt-icon icon=\"general.loading-01\" class=\"animate-spin\" />\r\n <span>{{ \"components.sidebar.loading\" | transloco }}</span>\r\n </div>\r\n } @else if (!fly.item.children?.length) {\r\n <div class=\"px-3 py-2 text-sm text-muted-color\">\r\n {{ \"components.sidebar.empty\" | transloco }}\r\n </div>\r\n }\r\n @for (child of fly.item.children ?? []; track child.id) {\r\n @if (child.href) {\r\n <a\r\n [href]=\"child.href\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n } @else {\r\n <a\r\n [routerLink]=\"child.routerLink\"\r\n routerLinkActive=\"bg-primary-50 text-(--p-primary-500) dark:bg-primary-900\"\r\n class=\"flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm hover:bg-surface-100 dark:hover:bg-surface-700 transition-colors\"\r\n (click)=\"closeFlyout()\"\r\n >\r\n @if (child.icon) {\r\n <mt-icon\r\n [icon]=\"child.icon\"\r\n class=\"shrink-0 opacity-80\"\r\n [style.--mt-icon-prev-width]=\"'16px'\"\r\n [style.--mt-icon-prev-height]=\"'16px'\"\r\n />\r\n } @else {\r\n <span\r\n class=\"h-1.5 w-1.5 shrink-0 rounded-full bg-current opacity-50\"\r\n ></span>\r\n }\r\n <span class=\"truncate\">{{ child.title }}</span>\r\n </a>\r\n }\r\n }\r\n </div>\r\n </div>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAiDA,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,iBAAiB,GAAG,GAAG;AAC7B,MAAM,kBAAkB,GAAG,GAAG;MA8FjB,OAAO,CAAA;AACD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACvB,GAAG,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEjE,IAAA,KAAK,GAAG,KAAK,CAAgB,EAAE,4EAAC;IAEhC,IAAI,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;IACtB,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAkB;IAClC,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OA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
|
|
178
178
|
* renderer preserves the author's own line breaks instead.
|
|
179
179
|
*/
|
|
180
180
|
info?: EntitySectionLabel;
|
|
181
|
+
/**
|
|
182
|
+
* Renders the entity as the card's header instead of a grid cell: a
|
|
183
|
+
* full-width band pinned above every other entity, showing the value
|
|
184
|
+
* centred with no label. Its presence is the switch — absent ⇒ an ordinary
|
|
185
|
+
* cell.
|
|
186
|
+
*
|
|
187
|
+
* Text view types only, and one per display area. The customization drawer
|
|
188
|
+
* enforces both; the renderers only honour the first Text entity carrying
|
|
189
|
+
* it, so a configuration written elsewhere cannot produce two headers.
|
|
190
|
+
*/
|
|
191
|
+
header?: EntityHeaderConfig;
|
|
192
|
+
}
|
|
193
|
+
/** Colours of an entity rendered as a card header (`EntityBaseConfig.header`). */
|
|
194
|
+
interface EntityHeaderConfig {
|
|
195
|
+
/** Band background, `#rrggbb`. Absent ⇒ a light tint of the primary colour. */
|
|
196
|
+
backgroundColor?: string | null;
|
|
197
|
+
/** Top border, `#rrggbb`. Absent ⇒ the primary colour. */
|
|
198
|
+
borderColor?: string | null;
|
|
181
199
|
}
|
|
182
200
|
interface EntityUserConfig extends EntityBaseConfig {
|
|
183
201
|
showDisplayName?: boolean;
|
|
@@ -1786,9 +1804,10 @@ declare function splitLeafKey(key: string): {
|
|
|
1786
1804
|
declare function expandLeafDetailsEntity(entity: EntityData): EntityData[];
|
|
1787
1805
|
/**
|
|
1788
1806
|
* Expands the entity types that render as several items — LeafDetails levels
|
|
1789
|
-
* and Connection source levels — then orders the flattened list
|
|
1790
|
-
*
|
|
1791
|
-
* configured area actually
|
|
1807
|
+
* and Connection source levels — then orders the flattened list, with the card
|
|
1808
|
+
* header (if any) pinned first. Shared by the customization builder canvas and
|
|
1809
|
+
* the runtime preview so both agree on what a configured area actually
|
|
1810
|
+
* contains.
|
|
1792
1811
|
*/
|
|
1793
1812
|
declare function buildDisplayEntities(entities: EntityData[]): EntityData[];
|
|
1794
1813
|
|
|
@@ -1934,6 +1953,75 @@ declare function groupEntitiesIntoSections(entities: EntityData[]): EntitySectio
|
|
|
1934
1953
|
*/
|
|
1935
1954
|
declare function getEntitySectionTitle(section: EntityData | null | undefined, lang?: string): string;
|
|
1936
1955
|
|
|
1956
|
+
/**
|
|
1957
|
+
* View types that can be rendered as a card header.
|
|
1958
|
+
*
|
|
1959
|
+
* Text only, deliberately: the header is one centred line naming the record,
|
|
1960
|
+
* and no other view type reads as that — a date, a status chip or a progress
|
|
1961
|
+
* bar stretched across the top of a card is decoration, not a title.
|
|
1962
|
+
*/
|
|
1963
|
+
declare const ENTITY_HEADER_VIEW_TYPES: ReadonlySet<string>;
|
|
1964
|
+
/** True when a property of this view type may be set as the card header. */
|
|
1965
|
+
declare function canEntityBeHeader(viewType: string | null | undefined): boolean;
|
|
1966
|
+
/**
|
|
1967
|
+
* The entity's header settings, or `null` when it renders as an ordinary cell.
|
|
1968
|
+
* A `header` saved on a view type that cannot be one is ignored rather than
|
|
1969
|
+
* honoured, so the renderers and the builder agree on what is a header.
|
|
1970
|
+
*/
|
|
1971
|
+
declare function resolveEntityHeader(entity: EntityData | null | undefined): EntityHeaderConfig | null;
|
|
1972
|
+
/** True when the entity renders as the card header. */
|
|
1973
|
+
declare function isEntityHeader(entity: EntityData | null | undefined): boolean;
|
|
1974
|
+
/**
|
|
1975
|
+
* Moves the first header entity to the front of an order-sorted list.
|
|
1976
|
+
*
|
|
1977
|
+
* The header is drawn above the card whatever its saved `order`, so it is
|
|
1978
|
+
* pinned here — in the one ordering every renderer and the builder share —
|
|
1979
|
+
* rather than in each of them. That keeps the builder's drag indexes, its
|
|
1980
|
+
* section-insert index and the runtime card all agreeing on the same list.
|
|
1981
|
+
*
|
|
1982
|
+
* Only the first is moved: a second entity flagged as a header (the drawer
|
|
1983
|
+
* allows one per area, but a configuration can be written elsewhere) stays an
|
|
1984
|
+
* ordinary cell where it is.
|
|
1985
|
+
*/
|
|
1986
|
+
declare function pinEntityHeaderFirst(entities: EntityData[]): EntityData[];
|
|
1987
|
+
/**
|
|
1988
|
+
* The colours a header with none picked is painted in, as `#rrggbb` — the
|
|
1989
|
+
* values `entity-header.css` produces: the theme's primary as the top border
|
|
1990
|
+
* and a 10% primary tint over white as the background. For showing an author
|
|
1991
|
+
* the defaults (the customization drawer's colour fields), not for saving
|
|
1992
|
+
* them: a stored hex would stop following the tenant's primary colour.
|
|
1993
|
+
*
|
|
1994
|
+
* `null` when the primary colour cannot be resolved in this document.
|
|
1995
|
+
*/
|
|
1996
|
+
declare function readEntityHeaderDefaults(doc: Document): Required<EntityHeaderConfig> | null;
|
|
1997
|
+
|
|
1998
|
+
/**
|
|
1999
|
+
* A Text entity configured as the card header (`configuration.header`): a
|
|
2000
|
+
* full-width band with a coloured top border and the value centred, no label.
|
|
2001
|
+
*
|
|
2002
|
+
* The band covers its host's padding so it sits flush against the card's top
|
|
2003
|
+
* and side edges. A padded host declares how much padding there is through
|
|
2004
|
+
* three custom properties — see `entity-header.css`. Without them the band
|
|
2005
|
+
* stays inside the content box with ordinary rounded corners.
|
|
2006
|
+
*/
|
|
2007
|
+
declare class EntityHeader {
|
|
2008
|
+
readonly data: _angular_core.InputSignal<EntityData>;
|
|
2009
|
+
private readonly header;
|
|
2010
|
+
/** `null` leaves the stylesheet's primary tint in place. */
|
|
2011
|
+
readonly backgroundColor: _angular_core.Signal<string | null>;
|
|
2012
|
+
/** `null` leaves the stylesheet's primary border in place. */
|
|
2013
|
+
readonly borderColor: _angular_core.Signal<string | null>;
|
|
2014
|
+
/**
|
|
2015
|
+
* A chosen background can be any colour at all, so the ink is picked to read
|
|
2016
|
+
* on it. The default tint is translucent over the card, so it keeps the
|
|
2017
|
+
* theme's own text colour — which is what flips correctly in dark mode.
|
|
2018
|
+
*/
|
|
2019
|
+
readonly textColor: _angular_core.Signal<string | null>;
|
|
2020
|
+
readonly displayValue: _angular_core.Signal<string>;
|
|
2021
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityHeader, never>;
|
|
2022
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityHeader, "mt-entity-header", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
1937
2025
|
declare class EntityPreview {
|
|
1938
2026
|
private readonly transloco;
|
|
1939
2027
|
readonly data: _angular_core.InputSignal<EntityData>;
|
|
@@ -2079,9 +2167,14 @@ declare class EntitiesPreview {
|
|
|
2079
2167
|
/** Entities expanded and sorted by order */
|
|
2080
2168
|
readonly displayEntities: _angular_core.Signal<EntityData[]>;
|
|
2081
2169
|
/**
|
|
2082
|
-
* The
|
|
2083
|
-
*
|
|
2084
|
-
|
|
2170
|
+
* The entity drawn as the card header, or `null`. `buildDisplayEntities`
|
|
2171
|
+
* pins it first, so only the head of the list needs checking.
|
|
2172
|
+
*/
|
|
2173
|
+
readonly header: _angular_core.Signal<EntityData | null>;
|
|
2174
|
+
/**
|
|
2175
|
+
* The display entities, minus the header, split into section groups. With
|
|
2176
|
+
* no `Section` markers this is a single `{ section: null }` group, so the
|
|
2177
|
+
* bare grid renders exactly as before.
|
|
2085
2178
|
*/
|
|
2086
2179
|
readonly sectionGroups: _angular_core.Signal<_masterteam_components_entities.EntitySectionGroup[]>;
|
|
2087
2180
|
/**
|
|
@@ -2163,12 +2256,26 @@ declare class EntitiesManage extends EntitiesResizeBase {
|
|
|
2163
2256
|
}>;
|
|
2164
2257
|
/** Entities expanded and sorted by their configured order */
|
|
2165
2258
|
readonly displayEntities: _angular_core.Signal<EntityData[]>;
|
|
2259
|
+
/**
|
|
2260
|
+
* The card header, or `null`. `buildDisplayEntities` pins it first, which is
|
|
2261
|
+
* also where it renders — so it stays in the drop list's data and every drag
|
|
2262
|
+
* index the host receives still lines up with the host's own entity list.
|
|
2263
|
+
*/
|
|
2264
|
+
readonly header: _angular_core.Signal<EntityData | null>;
|
|
2265
|
+
/**
|
|
2266
|
+
* Keeps every drop below the header. The header is drawn above the card
|
|
2267
|
+
* whatever its order, so an item dropped in front of it would land somewhere
|
|
2268
|
+
* other than where the user let go of it.
|
|
2269
|
+
*/
|
|
2270
|
+
readonly sortPredicate: (index: number) => boolean;
|
|
2166
2271
|
/** Returns the grid-column span for a given entity size (1-24) */
|
|
2167
2272
|
getColSpan(entity: EntityData): string;
|
|
2168
2273
|
/** Returns the grid-row span (`null` = single row) for a given entity */
|
|
2169
2274
|
getRowSpan(entity: EntityData): string | null;
|
|
2170
2275
|
/** True when the entity is a full-width `Section` layout marker. */
|
|
2171
2276
|
isSection(entity: EntityData): boolean;
|
|
2277
|
+
/** True when the entity is the pinned card header. */
|
|
2278
|
+
isHeader(entity: EntityData): boolean;
|
|
2172
2279
|
/** Handle drag-drop reorder */
|
|
2173
2280
|
onDrop(event: CdkDragDrop<EntityData[]>): void;
|
|
2174
2281
|
protected onResizeComplete(entity: EntityData, previousSize: EntitySize, newSize: EntitySize): void;
|
|
@@ -2214,5 +2321,5 @@ declare class FitText {
|
|
|
2214
2321
|
|
|
2215
2322
|
declare function sharedActiveLang(transloco: TranslocoService): Signal<string>;
|
|
2216
2323
|
|
|
2217
|
-
export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PERFORMANCE_SCORE_CHART_SIZE, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, ENTITY_LIST_TABLE_COMPONENT, ENTITY_ROW_SPANS, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPerformanceScore, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityRuntimeContextStore, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, PERFORMANCE_SCORE_CHART_SIZES, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, getPerformanceScoreBands, groupEntitiesIntoSections, humanizeEntityListKey, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntityListLocalDocument, isEntityListSelectionDocument, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, localCellsByFieldId, matchesPercentageColorRule, mergeStakeholderNameColumns, mergeStakeholderNameEntities, mergeStakeholderNameRows, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, parsePerformanceScore, readEntityValueColor, resolveConnectionLevelName, resolveEntityGridRow, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalFieldConfiguration, resolveLocalFieldLabel, resolveLocalFieldViewType, resolveLocalizedLabel, resolvePercentageColor, resolvePerformanceScoreStatus, serializeEntityRawValue, sharedActiveLang, sortLocalRows, splitConnectionKey, splitLeafKey, summarizeEntityListRows, visibleLocalSchemaFields };
|
|
2218
|
-
export type { ComparisonValueSide, ConnectionCatalogConfiguration, ConnectionLevelSavedConfig, ConnectionSourceLevelConfig, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionConfig, EntityConnectionSourceValue, EntityConnectionValue, EntityData, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, EntityListEntityValue, EntityListInlineFieldMeta, EntityListLocalCell, EntityListLocalDocument, EntityListLocalFieldDefinition, EntityListLocalFieldWidth, EntityListLocalRow, EntityListLocalSchema, EntityListLocalSchemaField, EntityListRenderedRow, EntityListRowValue, EntityListSelectionDocument, EntityListSelectionRecord, EntityListSelectionRecordValue, EntityListTableHost, EntityListTranslatable, EntityListValueItem, EntityLocationValue, EntityLookupCheckListItem, EntityLookupCheckListPropValue, EntityLookupCheckListValue, EntityLookupValue, EntityMultiLookupValue, EntityMultiUserValue, EntityNestedPropertyMeta, EntityPercentageConfig, EntityPerformanceScoreChartSize, EntityPerformanceScoreConfig, EntityPerformanceScoreStatus, EntityPerformanceScoreValue, EntityPhaseGateValue, EntityPropertyConfiguration, EntityResizeEvent, EntityRowSpan, EntityRuntimeContext, EntityScheduleItemValue, EntitySectionConfig, EntitySectionGroup, EntitySectionLabel, EntitySize, EntityStatusValue, EntityTranslatableTextValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsBadgeKind, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogPhaseValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsPhaseSummary, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimePhaseCount, LeafDetailsRuntimePhaseDetails, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, LeafPhaseSavedConfig, PercentageColorMode, PercentageColorPropertyRef, PercentageColorRule, PercentageColorSource, PropertyValueComparison, ValueComparison };
|
|
2324
|
+
export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PERFORMANCE_SCORE_CHART_SIZE, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, ENTITY_HEADER_VIEW_TYPES, ENTITY_LIST_TABLE_COMPONENT, ENTITY_ROW_SPANS, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityHeader, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPerformanceScore, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityRuntimeContextStore, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, PERFORMANCE_SCORE_CHART_SIZES, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, canEntityBeHeader, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, getPerformanceScoreBands, groupEntitiesIntoSections, humanizeEntityListKey, isConnectionSyntheticKey, isEntityAlignEnd, isEntityHeader, isEntityLabelHidden, isEntityListLocalDocument, isEntityListSelectionDocument, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, localCellsByFieldId, matchesPercentageColorRule, mergeStakeholderNameColumns, mergeStakeholderNameEntities, mergeStakeholderNameRows, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, parsePerformanceScore, pinEntityHeaderFirst, readEntityHeaderDefaults, readEntityValueColor, resolveConnectionLevelName, resolveEntityGridRow, resolveEntityHeader, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalFieldConfiguration, resolveLocalFieldLabel, resolveLocalFieldViewType, resolveLocalizedLabel, resolvePercentageColor, resolvePerformanceScoreStatus, serializeEntityRawValue, sharedActiveLang, sortLocalRows, splitConnectionKey, splitLeafKey, summarizeEntityListRows, visibleLocalSchemaFields };
|
|
2325
|
+
export type { ComparisonValueSide, ConnectionCatalogConfiguration, ConnectionLevelSavedConfig, ConnectionSourceLevelConfig, EntityAttachmentItemValue, EntityAttachmentValue, EntityBaseConfig, EntityClickEvent, EntityComparisonField, EntityComparisonOperation, EntityConfiguration, EntityConnectionConfig, EntityConnectionSourceValue, EntityConnectionValue, EntityData, EntityHeaderConfig, EntityLabelPosition, EntityLeafDetailsConfig, EntityListComparison, EntityListComparisonRow, EntityListEntityValue, EntityListInlineFieldMeta, EntityListLocalCell, EntityListLocalDocument, EntityListLocalFieldDefinition, EntityListLocalFieldWidth, EntityListLocalRow, EntityListLocalSchema, EntityListLocalSchemaField, EntityListRenderedRow, EntityListRowValue, EntityListSelectionDocument, EntityListSelectionRecord, EntityListSelectionRecordValue, EntityListTableHost, EntityListTranslatable, EntityListValueItem, EntityLocationValue, EntityLookupCheckListItem, EntityLookupCheckListPropValue, EntityLookupCheckListValue, EntityLookupValue, EntityMultiLookupValue, EntityMultiUserValue, EntityNestedPropertyMeta, EntityPercentageConfig, EntityPerformanceScoreChartSize, EntityPerformanceScoreConfig, EntityPerformanceScoreStatus, EntityPerformanceScoreValue, EntityPhaseGateValue, EntityPropertyConfiguration, EntityResizeEvent, EntityRowSpan, EntityRuntimeContext, EntityScheduleItemValue, EntitySectionConfig, EntitySectionGroup, EntitySectionLabel, EntitySize, EntityStatusValue, EntityTranslatableTextValue, EntityUserConfig, EntityUserValue, EntityViewType, LeafDetailsBadgeKind, LeafDetailsCatalogConfiguration, LeafDetailsCatalogLevelValue, LeafDetailsCatalogPhaseValue, LeafDetailsCatalogStatusValue, LeafDetailsEntityCollectionValue, LeafDetailsEntityValue, LeafDetailsPhaseSummary, LeafDetailsRuntimeChildSchema, LeafDetailsRuntimePhaseCount, LeafDetailsRuntimePhaseDetails, LeafDetailsRuntimeStatusCount, LeafDetailsRuntimeStatusDetails, LeafDetailsRuntimeValue, LeafDetailsStatusSummary, LeafLevelSavedConfig, LeafPhaseSavedConfig, PercentageColorMode, PercentageColorPropertyRef, PercentageColorRule, PercentageColorSource, PropertyValueComparison, ValueComparison };
|
|
@@ -91,6 +91,12 @@ declare class SelectField implements ControlValueAccessor, OnInit, OnChanges, Af
|
|
|
91
91
|
ngOnInit(): void;
|
|
92
92
|
onValueChange(value: any): void;
|
|
93
93
|
ngOnChanges(changes: SimpleChanges): void;
|
|
94
|
+
/**
|
|
95
|
+
* The search leaves no option focused, so Enter picked nothing even when the
|
|
96
|
+
* search narrowed the list to one option. Focus that option: Enter then
|
|
97
|
+
* selects it, as it would after an arrow key.
|
|
98
|
+
*/
|
|
99
|
+
protected onDropdownFilter(): void;
|
|
94
100
|
writeValue(value: string): void;
|
|
95
101
|
registerOnChange(fn: any): void;
|
|
96
102
|
registerOnTouched(fn: any): void;
|