primeng
Version:
PrimeNG is a premium UI library for Angular featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock,
1 lines • 103 kB
Source Map (JSON)
{"version":3,"file":"primeng-sidebar.mjs","sources":["../../src/sidebar/tokens.ts","../../src/sidebar/style/sidebarstyle.ts","../../src/sidebar/sidebar-backdrop.ts","../../src/sidebar/sidebar-content.ts","../../src/sidebar/sidebar-footer.ts","../../src/sidebar/sidebar-group.ts","../../src/sidebar/sidebar-group-action.ts","../../src/sidebar/sidebar-group-content.ts","../../src/sidebar/sidebar-group-label.ts","../../src/sidebar/sidebar-header.ts","../../src/sidebar/sidebar-main.ts","../../src/sidebar/sidebar-layout.ts","../../src/sidebar/sidebar-menu.ts","../../src/sidebar/sidebar-menu-action.ts","../../src/sidebar/sidebar-menu-badge.ts","../../src/sidebar/sidebar-menu-button.ts","../../src/sidebar/sidebar-menu-item.ts","../../src/sidebar/sidebar-menu-sub.ts","../../src/sidebar/sidebar-menu-sub-button.ts","../../src/sidebar/sidebar-menu-sub-item.ts","../../src/sidebar/sidebar-aside.ts","../../src/sidebar/sidebar-panel.ts","../../src/sidebar/sidebar-rail.ts","../../src/sidebar/sidebar-spacer.ts","../../src/sidebar/sidebar-trigger.ts","../../src/sidebar/sidebar.ts","../../src/sidebar/primeng-sidebar.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const SIDEBAR_INSTANCE = new InjectionToken<any>('SIDEBAR_INSTANCE');\nexport const SIDEBAR_LAYOUT_INSTANCE = new InjectionToken<any>('SIDEBAR_LAYOUT_INSTANCE');\nexport const SIDEBAR_ASIDE_INSTANCE = new InjectionToken<any>('SIDEBAR_ASIDE_INSTANCE');\nexport const SIDEBAR_CONTENT_INSTANCE = new InjectionToken<any>('SIDEBAR_CONTENT_INSTANCE');\nexport const SIDEBAR_HEADER_INSTANCE = new InjectionToken<any>('SIDEBAR_HEADER_INSTANCE');\nexport const SIDEBAR_PANEL_INSTANCE = new InjectionToken<any>('SIDEBAR_PANEL_INSTANCE');\nexport const SIDEBAR_FOOTER_INSTANCE = new InjectionToken<any>('SIDEBAR_FOOTER_INSTANCE');\nexport const SIDEBAR_GROUP_INSTANCE = new InjectionToken<any>('SIDEBAR_GROUP_INSTANCE');\nexport const SIDEBAR_MENU_INSTANCE = new InjectionToken<any>('SIDEBAR_MENU_INSTANCE');\nexport const SIDEBAR_MENU_ITEM_INSTANCE = new InjectionToken<any>('SIDEBAR_MENU_ITEM_INSTANCE');\nexport const SIDEBAR_MENU_SUB_INSTANCE = new InjectionToken<any>('SIDEBAR_MENU_SUB_INSTANCE');\nexport const SIDEBAR_MENU_SUB_ITEM_INSTANCE = new InjectionToken<any>('SIDEBAR_MENU_SUB_ITEM_INSTANCE');\n","import { Injectable } from '@angular/core';\nimport { style as sidebar_style } from '@primeuix/styles/sidebar';\nimport { BaseStyle } from 'primeng/base';\n\nconst style = /*css*/ `\n${sidebar_style}\n\n/* For PrimeNG */\n.p-sidebar-backdrop {\n display: block;\n position: fixed;\n inset: 0;\n z-index: 15;\n background-color: rgb(0 0 0 / 0.4);\n}\n\n/* NG uses extra DOM wrappers around .p-sidebar-menu-sub for the Angular animation system */\n.p-sidebar-menu-sub-content-container {\n display: grid;\n grid-template-rows: 1fr;\n}\n\n.p-sidebar-menu-sub-content-wrapper {\n min-height: 0;\n}\n\n.p-sidebar[data-collapsible=\"icon\"] .p-sidebar-menu-item[data-collapsible]>.p-sidebar-menu-sub-content-container {\n display: none;\n}\n\n.p-sidebar-menu-sub-enter-from,\n.p-sidebar-menu-sub-leave-to {\n height: 0 !important;\n opacity: 0;\n}\n\n.p-sidebar-menu-sub-enter-to,\n.p-sidebar-menu-sub-leave-from {\n height: var(--px-sidebar-menu-sub-height, auto);\n opacity: 1;\n}\n\n.p-sidebar-menu-sub-enter-active,\n.p-sidebar-menu-sub-leave-active {\n transition: height 200ms ease-out, opacity 200ms ease-out;\n overflow: hidden;\n}\n`;\n\nconst classes = {\n root: 'p-sidebar p-component',\n layout: 'p-sidebar-layout',\n spacer: 'p-sidebar-spacer',\n aside: 'p-sidebar-aside',\n panel: 'p-sidebar-panel',\n header: 'p-sidebar-header',\n content: 'p-sidebar-content',\n footer: 'p-sidebar-footer',\n group: 'p-sidebar-group',\n groupLabel: 'p-sidebar-group-label',\n groupAction: 'p-sidebar-group-action',\n groupContent: 'p-sidebar-group-content',\n menu: 'p-sidebar-menu',\n menuItem: 'p-sidebar-menu-item',\n menuButton: 'p-sidebar-menu-button',\n menuAction: 'p-sidebar-menu-action',\n menuBadge: 'p-sidebar-menu-badge',\n menuSub: 'p-sidebar-menu-sub',\n menuSubItem: 'p-sidebar-menu-sub-item',\n menuSubButton: 'p-sidebar-menu-sub-button',\n trigger: 'p-sidebar-trigger',\n rail: 'p-sidebar-rail',\n main: 'p-sidebar-main',\n backdrop: 'p-sidebar-backdrop'\n};\n\n@Injectable()\nexport class SidebarStyle extends BaseStyle {\n name = 'sidebar';\n\n style = style;\n\n classes = classes;\n}\n\n/**\n *\n * Sidebar is a panel displayed as an overlay or static side navigation with a compound API.\n *\n * [Live Demo](https://www.primeng.org/sidebar/)\n *\n * @module sidebarstyle\n *\n */\nexport enum SidebarClasses {\n /**\n * Class name of the root element\n */\n root = 'p-sidebar',\n /**\n * Class name of the layout element\n */\n layout = 'p-sidebar-layout',\n /**\n * Class name of the spacer element\n */\n spacer = 'p-sidebar-spacer',\n /**\n * Class name of the aside element\n */\n aside = 'p-sidebar-aside',\n /**\n * Class name of the panel element\n */\n panel = 'p-sidebar-panel',\n /**\n * Class name of the header element\n */\n header = 'p-sidebar-header',\n /**\n * Class name of the content element\n */\n content = 'p-sidebar-content',\n /**\n * Class name of the footer element\n */\n footer = 'p-sidebar-footer',\n /**\n * Class name of the group element\n */\n group = 'p-sidebar-group',\n /**\n * Class name of the group label element\n */\n groupLabel = 'p-sidebar-group-label',\n /**\n * Class name of the group action element\n */\n groupAction = 'p-sidebar-group-action',\n /**\n * Class name of the group content element\n */\n groupContent = 'p-sidebar-group-content',\n /**\n * Class name of the menu element\n */\n menu = 'p-sidebar-menu',\n /**\n * Class name of the menu item element\n */\n menuItem = 'p-sidebar-menu-item',\n /**\n * Class name of the menu button element\n */\n menuButton = 'p-sidebar-menu-button',\n /**\n * Class name of the menu action element\n */\n menuAction = 'p-sidebar-menu-action',\n /**\n * Class name of the menu badge element\n */\n menuBadge = 'p-sidebar-menu-badge',\n /**\n * Class name of the menu sub element\n */\n menuSub = 'p-sidebar-menu-sub',\n /**\n * Class name of the menu sub item element\n */\n menuSubItem = 'p-sidebar-menu-sub-item',\n /**\n * Class name of the menu sub button element\n */\n menuSubButton = 'p-sidebar-menu-sub-button',\n /**\n * Class name of the trigger element\n */\n trigger = 'p-sidebar-trigger',\n /**\n * Class name of the rail element\n */\n rail = 'p-sidebar-rail',\n /**\n * Class name of the main element\n */\n main = 'p-sidebar-main',\n /**\n * Class name of the backdrop element\n */\n backdrop = 'p-sidebar-backdrop'\n}\n\nexport interface SidebarStyle extends BaseStyle {}\n","import { isPlatformBrowser } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, ViewEncapsulation } from '@angular/core';\nimport { createMotion, type MotionInstance } from '@primeuix/motion';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarBackdropPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_INSTANCE, SIDEBAR_LAYOUT_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarBackdrop is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-backdrop',\n standalone: true,\n imports: [BindModule],\n template: ``,\n host: {\n '[class]': \"cx('backdrop')\",\n '(click)': 'onClick($event)'\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarBackdrop }]\n})\nexport class SidebarBackdrop extends BaseComponent<SidebarBackdropPassThrough> {\n componentName = 'SidebarBackdrop';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n private pcSidebar: any = inject(SIDEBAR_INSTANCE, { optional: true });\n\n private layout: any = inject(SIDEBAR_LAYOUT_INSTANCE, { optional: true });\n\n visible = computed(() => {\n if (this.pcSidebar) return this.pcSidebar.open();\n return !!this.layout?.isAnyOpen();\n });\n\n private motion: MotionInstance | undefined;\n private isInitialMount = true;\n\n constructor() {\n super();\n\n effect(() => {\n const show = this.visible();\n if (!isPlatformBrowser(this.platformId)) return;\n const el = this.el?.nativeElement as HTMLElement | undefined;\n if (!el) return;\n\n if (!this.motion) {\n this.motion = createMotion(el, {\n name: 'p-overlay-mask',\n autoHeight: false,\n autoWidth: false\n });\n }\n\n if (show) {\n el.style.removeProperty('display');\n el.classList.add('p-overlay-mask');\n this.motion.enter();\n } else if (!this.isInitialMount) {\n this.motion.leave().then(() => {\n if (!this.visible() && this.el?.nativeElement) {\n (this.el.nativeElement as HTMLElement).style.display = 'none';\n (this.el.nativeElement as HTMLElement).classList.remove('p-overlay-mask');\n }\n });\n } else {\n el.style.display = 'none';\n }\n\n this.isInitialMount = false;\n });\n }\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n\n onClick(event: Event): void {\n if (this.pcSidebar) {\n if (this.pcSidebar.dismissable()) this.pcSidebar.collapse(event);\n } else {\n this.layout?.collapseAll(event);\n }\n }\n\n onDestroy(): void {\n this.motion?.cancel();\n this.motion = undefined;\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarContentPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_CONTENT_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarContent is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-content',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('content')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_CONTENT_INSTANCE, useExisting: SidebarContent }, { provide: PARENT_INSTANCE, useExisting: SidebarContent }]\n})\nexport class SidebarContent extends BaseComponent<SidebarContentPassThrough> {\n componentName = 'SidebarContent';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarFooterPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_FOOTER_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarFooter is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-footer',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('footer')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_FOOTER_INSTANCE, useExisting: SidebarFooter }, { provide: PARENT_INSTANCE, useExisting: SidebarFooter }]\n})\nexport class SidebarFooter extends BaseComponent<SidebarFooterPassThrough> {\n componentName = 'SidebarFooter';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarGroupPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_GROUP_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarGroup is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-group',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('group')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_GROUP_INSTANCE, useExisting: SidebarGroup }, { provide: PARENT_INSTANCE, useExisting: SidebarGroup }]\n})\nexport class SidebarGroup extends BaseComponent<SidebarGroupPassThrough> {\n componentName = 'SidebarGroup';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind } from 'primeng/bind';\nimport { SidebarGroupActionPassThrough } from 'primeng/types/sidebar';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarGroupAction is a helper directive for Sidebar component.\n * @group Components\n */\n@Directive({\n selector: '[pSidebarGroupAction]',\n standalone: true,\n host: { '[class]': \"cx('groupAction')\" },\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarGroupAction }]\n})\nexport class SidebarGroupAction extends BaseComponent<SidebarGroupActionPassThrough> {\n componentName = 'SidebarGroupAction';\n\n bindDirectiveInstance = inject(Bind, { optional: true, self: true }) ?? undefined;\n\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance?.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarGroupContentPassThrough } from 'primeng/types/sidebar';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarGroupContent is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-group-content',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('groupContent')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarGroupContent }]\n})\nexport class SidebarGroupContent extends BaseComponent<SidebarGroupContentPassThrough> {\n componentName = 'SidebarGroupContent';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarGroupLabelPassThrough } from 'primeng/types/sidebar';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarGroupLabel is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-group-label',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('groupLabel')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarGroupLabel }]\n})\nexport class SidebarGroupLabel extends BaseComponent<SidebarGroupLabelPassThrough> {\n componentName = 'SidebarGroupLabel';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarHeaderPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_HEADER_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarHeader is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-header',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('header')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_HEADER_INSTANCE, useExisting: SidebarHeader }, { provide: PARENT_INSTANCE, useExisting: SidebarHeader }]\n})\nexport class SidebarHeader extends BaseComponent<SidebarHeaderPassThrough> {\n componentName = 'SidebarHeader';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarMainPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_LAYOUT_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMain is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-main',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: {\n '[class]': \"cx('main')\",\n '(click)': 'onClick($event)'\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarMain }]\n})\nexport class SidebarMain extends BaseComponent<SidebarMainPassThrough> {\n componentName = 'SidebarMain';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n private layout: any = inject(SIDEBAR_LAYOUT_INSTANCE, { optional: true });\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n\n onClick(event: Event): void {\n this.layout?.onMainClick(event);\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, signal, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarLayoutPassThrough } from 'primeng/types/sidebar';\nimport type { Sidebar } from './sidebar';\nimport { SIDEBAR_LAYOUT_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarLayout is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-layout',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: {\n '[class]': \"cx('layout')\"\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_LAYOUT_INSTANCE, useExisting: SidebarLayout }, { provide: PARENT_INSTANCE, useExisting: SidebarLayout }]\n})\nexport class SidebarLayout extends BaseComponent<SidebarLayoutPassThrough> {\n componentName = 'SidebarLayout';\n\n bindDirectiveInstance = inject(Bind, { self: true });\n\n _componentStyle = inject(SidebarStyle);\n\n private sidebars = new Map<string, Sidebar>();\n\n private version = signal(0);\n\n isAnyOpen = computed(() => {\n this.version();\n let open = false;\n this.sidebars.forEach((s) => {\n if (s.open()) open = true;\n });\n return open;\n });\n\n registerSidebar(id: string, sidebar: Sidebar): void {\n this.sidebars.set(id, sidebar);\n this.version.update((v) => v + 1);\n }\n\n unregisterSidebar(id: string): void {\n this.sidebars.delete(id);\n this.version.update((v) => v + 1);\n }\n\n getSidebar(id: string): Sidebar | undefined {\n return this.sidebars.get(id);\n }\n\n toggle(target?: string, event?: Event): void {\n if (target) {\n this.sidebars.get(target)?.toggle(event);\n return;\n }\n if (this.sidebars.size === 1) {\n this.sidebars.values().next().value?.toggle(event);\n }\n }\n\n collapseAll(event?: Event): void {\n this.sidebars.forEach((s) => s.collapse(event));\n }\n\n onMainClick(event: Event): void {\n const target = event.target as HTMLElement | null;\n // Skip clicks that originate from a sidebar trigger so opening the sidebar via the trigger is not immediately undone by the same click.\n if (target?.closest('[data-scope=\"sidebar\"][data-part=\"trigger\"]')) return;\n this.sidebars.forEach((s) => {\n if (s.open() && s.overlay() && s.hideOnOutsideClick()) s.collapse(event);\n });\n }\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarMenuPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_MENU_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenu is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-menu',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: {\n '[class]': \"cx('menu')\",\n role: 'list'\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_MENU_INSTANCE, useExisting: SidebarMenu }, { provide: PARENT_INSTANCE, useExisting: SidebarMenu }]\n})\nexport class SidebarMenu extends BaseComponent<SidebarMenuPassThrough> {\n componentName = 'SidebarMenu';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind } from 'primeng/bind';\nimport { SidebarMenuActionPassThrough } from 'primeng/types/sidebar';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenuAction is a helper directive for Sidebar component.\n * @group Components\n */\n@Directive({\n selector: '[pSidebarMenuAction]',\n standalone: true,\n host: {\n '[class]': \"cx('menuAction')\",\n '[attr.data-show-on-hover]': 'dataShowOnHover()'\n },\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarMenuAction }]\n})\nexport class SidebarMenuAction extends BaseComponent<SidebarMenuActionPassThrough> {\n componentName = 'SidebarMenuAction';\n\n bindDirectiveInstance = inject(Bind, { optional: true, self: true }) ?? undefined;\n\n _componentStyle = inject(SidebarStyle);\n\n /**\n * Hide the action until the parent menu item is hovered / focus-within.\n * @defaultValue false\n * @group Props\n */\n showOnHover = input(false, { transform: booleanAttribute });\n\n dataShowOnHover = computed(() => (this.showOnHover() ? '' : null));\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance?.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarMenuBadgePassThrough } from 'primeng/types/sidebar';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenuBadge is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-menu-badge',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('menuBadge')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarMenuBadge }]\n})\nexport class SidebarMenuBadge extends BaseComponent<SidebarMenuBadgePassThrough> {\n componentName = 'SidebarMenuBadge';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind } from 'primeng/bind';\nimport { SidebarMenuButtonPassThrough } from 'primeng/types/sidebar';\nimport { SidebarMenuItem } from './sidebar-menu-item';\nimport { SIDEBAR_MENU_ITEM_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenuButton is a helper directive for Sidebar component.\n * @group Components\n */\n@Directive({\n selector: '[pSidebarMenuButton]',\n standalone: true,\n host: {\n '[class]': \"cx('menuButton')\",\n '[attr.data-active]': 'dataActive()',\n '(click)': 'onClick($event)'\n },\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarMenuButton }]\n})\nexport class SidebarMenuButton extends BaseComponent<SidebarMenuButtonPassThrough> {\n componentName = 'SidebarMenuButton';\n\n bindDirectiveInstance = inject(Bind, { optional: true, self: true }) ?? undefined;\n\n _componentStyle = inject(SidebarStyle);\n\n pcMenuItem = inject<SidebarMenuItem>(SIDEBAR_MENU_ITEM_INSTANCE, { optional: true }) ?? undefined;\n\n /**\n * Whether this button represents the active menu entry.\n * @defaultValue false\n * @group Props\n */\n isActive = input(false, { transform: booleanAttribute });\n\n dataActive = computed(() => (this.isActive() ? 'true' : null));\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance?.setAttrs(this.ptm('root'));\n }\n\n onClick(event: Event): void {\n if (this.pcMenuItem?.collapsible()) {\n this.pcMenuItem.toggle();\n }\n }\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, effect, inject, input, model, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarMenuItemPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_MENU_ITEM_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenuItem is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-menu-item',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: {\n '[class]': \"cx('menuItem')\",\n role: 'listitem',\n '[attr.data-collapsible]': 'dataCollapsible()',\n '[attr.data-open]': 'dataOpen()',\n '[attr.data-disabled]': 'dataDisabled()'\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_MENU_ITEM_INSTANCE, useExisting: SidebarMenuItem }, { provide: PARENT_INSTANCE, useExisting: SidebarMenuItem }]\n})\nexport class SidebarMenuItem extends BaseComponent<SidebarMenuItemPassThrough> {\n componentName = 'SidebarMenuItem';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n /**\n * When enabled, renders a collapsible item that toggles the nested SidebarMenuSub.\n * @defaultValue false\n * @group Props\n */\n collapsible = input(false, { transform: booleanAttribute });\n /**\n * Two-way bound open state for the nested sub-menu (only when `collapsible`).\n * @defaultValue false\n * @group Props\n */\n open = model<boolean>(false);\n /**\n * Initial open state applied once on init (like React's defaultOpen). Does not continuously bind.\n * @defaultValue undefined\n * @group Props\n */\n defaultOpen = input<boolean | undefined>(undefined);\n /**\n * Disables interaction within the item.\n * @defaultValue false\n * @group Props\n */\n disabled = input(false, { transform: booleanAttribute });\n\n isOpen = computed(() => this.collapsible() && this.open());\n\n dataCollapsible = computed(() => (this.collapsible() ? '' : null));\n\n dataOpen = computed(() => (this.collapsible() && this.open() ? '' : null));\n\n dataDisabled = computed(() => (this.disabled() ? '' : null));\n\n constructor() {\n super();\n effect(() => {\n const def = this.defaultOpen();\n if (def !== undefined && !this.defaultApplied) {\n this.defaultApplied = true;\n this.open.set(def);\n }\n });\n }\n\n private defaultApplied = false;\n\n toggle(): void {\n if (this.collapsible() && !this.disabled()) {\n this.open.set(!this.open());\n }\n }\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, effect, inject, ViewEncapsulation } from '@angular/core';\nimport { createMotion, type MotionInstance } from '@primeuix/motion';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarMenuSubPassThrough } from 'primeng/types/sidebar';\nimport { SidebarMenuItem } from './sidebar-menu-item';\nimport { SIDEBAR_MENU_ITEM_INSTANCE, SIDEBAR_MENU_SUB_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenuSub is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-menu-sub',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: {\n '[class]': \"cx('menuSub')\",\n role: 'list'\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_MENU_SUB_INSTANCE, useExisting: SidebarMenuSub }, { provide: PARENT_INSTANCE, useExisting: SidebarMenuSub }]\n})\nexport class SidebarMenuSub extends BaseComponent<SidebarMenuSubPassThrough> {\n componentName = 'SidebarMenuSub';\n\n bindDirectiveInstance = inject(Bind, { self: true });\n\n _componentStyle = inject(SidebarStyle);\n\n pcMenuItem = inject<SidebarMenuItem>(SIDEBAR_MENU_ITEM_INSTANCE, { optional: true }) ?? undefined;\n\n private motion: MotionInstance | undefined;\n\n private isInitialMount = true;\n\n constructor() {\n super();\n\n effect(() => {\n const collapsible = this.pcMenuItem?.collapsible() ?? false;\n const visible = collapsible ? this.pcMenuItem!.open() : true;\n if (!isPlatformBrowser(this.platformId)) return;\n const el = this.el?.nativeElement as HTMLElement | undefined;\n\n if (!el) return;\n\n if (!collapsible) {\n this.cancel();\n el.style.removeProperty('display');\n return;\n }\n\n if (!this.motion) {\n this.motion = createMotion(el, {\n name: 'p-sidebar-menu-sub',\n cssVarPrefix: 'px-sidebar-menu-sub',\n autoHeight: true,\n duration: 200\n });\n }\n\n if (this.isInitialMount) {\n if (!visible) el.style.display = 'none';\n this.isInitialMount = false;\n return;\n }\n\n if (visible) {\n el.style.removeProperty('display');\n this.motion.enter();\n } else {\n this.motion.leave().then(() => {\n const stillClosed = this.pcMenuItem?.collapsible() && !this.pcMenuItem?.open();\n if (stillClosed && this.el?.nativeElement) {\n (this.el.nativeElement as HTMLElement).style.display = 'none';\n }\n });\n }\n });\n }\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n\n onDestroy(): void {\n this.cancel();\n }\n\n private cancel(): void {\n this.motion?.cancel();\n this.motion = undefined;\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind } from 'primeng/bind';\nimport { SidebarMenuSubButtonPassThrough } from 'primeng/types/sidebar';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenuSubButton is a helper directive for Sidebar component.\n * @group Components\n */\n@Directive({\n selector: '[pSidebarMenuSubButton]',\n standalone: true,\n host: {\n '[class]': \"cx('menuSubButton')\",\n '[attr.data-active]': 'dataActive()',\n '[attr.data-size]': 'dataSize()'\n },\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarMenuSubButton }]\n})\nexport class SidebarMenuSubButton extends BaseComponent<SidebarMenuSubButtonPassThrough> {\n componentName = 'SidebarMenuSubButton';\n\n bindDirectiveInstance = inject(Bind, { optional: true, self: true }) ?? undefined;\n\n _componentStyle = inject(SidebarStyle);\n\n /**\n * Whether this button represents the active sub-menu entry.\n * @defaultValue false\n * @group Props\n */\n isActive = input(false, { transform: booleanAttribute });\n /**\n * Optional size variant.\n * @group Props\n */\n size = input<'sm' | 'md'>('md');\n\n dataActive = computed(() => (this.isActive() ? 'true' : null));\n\n dataSize = computed(() => (this.size() === 'sm' ? 'sm' : null));\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance?.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarMenuSubItemPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_MENU_SUB_ITEM_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarMenuSubItem is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-menu-sub-item',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: {\n '[class]': \"cx('menuSubItem')\",\n role: 'listitem'\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_MENU_SUB_ITEM_INSTANCE, useExisting: SidebarMenuSubItem }, { provide: PARENT_INSTANCE, useExisting: SidebarMenuSubItem }]\n})\nexport class SidebarMenuSubItem extends BaseComponent<SidebarMenuSubItemPassThrough> {\n componentName = 'SidebarMenuSubItem';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarAsidePassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_ASIDE_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarAside is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-aside',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('aside')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_ASIDE_INSTANCE, useExisting: SidebarAside }, { provide: PARENT_INSTANCE, useExisting: SidebarAside }]\n})\nexport class SidebarAside extends BaseComponent<SidebarAsidePassThrough> {\n componentName = 'SidebarAside';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarPanelPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_PANEL_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarPanel is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-panel',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: { '[class]': \"cx('panel')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_PANEL_INSTANCE, useExisting: SidebarPanel }, { provide: PARENT_INSTANCE, useExisting: SidebarPanel }]\n})\nexport class SidebarPanel extends BaseComponent<SidebarPanelPassThrough> {\n componentName = 'SidebarPanel';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind } from 'primeng/bind';\nimport { SidebarRailPassThrough } from 'primeng/types/sidebar';\nimport { Sidebar } from './sidebar';\nimport { SIDEBAR_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarRail is a helper directive for Sidebar component.\n * @group Components\n */\n@Directive({\n selector: '[pSidebarRail]',\n standalone: true,\n host: {\n '[class]': \"cx('rail')\",\n 'aria-label': 'Toggle Sidebar',\n title: 'Toggle Sidebar',\n tabindex: '-1',\n type: 'button',\n '(click)': 'onClick($event)'\n },\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarRail }]\n})\nexport class SidebarRail extends BaseComponent<SidebarRailPassThrough> {\n componentName = 'SidebarRail';\n\n bindDirectiveInstance = inject(Bind, { optional: true, self: true }) ?? undefined;\n\n _componentStyle = inject(SidebarStyle);\n\n pcSidebar = inject<Sidebar>(SIDEBAR_INSTANCE, { optional: true }) ?? undefined;\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance?.setAttrs(this.ptm('root'));\n }\n\n onClick(event: Event): void {\n this.pcSidebar?.toggle(event);\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarSpacerPassThrough } from 'primeng/types/sidebar';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarSpacer is a helper component for Sidebar component.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar-spacer',\n standalone: true,\n imports: [BindModule],\n template: ``,\n host: { '[class]': \"cx('spacer')\" },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarSpacer }]\n})\nexport class SidebarSpacer extends BaseComponent<SidebarSpacerPassThrough> {\n componentName = 'SidebarSpacer';\n bindDirectiveInstance = inject(Bind, { self: true });\n _componentStyle = inject(SidebarStyle);\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance.setAttrs(this.ptm('root'));\n }\n}\n","import { Directive, inject, input } from '@angular/core';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind } from 'primeng/bind';\nimport { SidebarTriggerPassThrough } from 'primeng/types/sidebar';\nimport { SIDEBAR_INSTANCE, SIDEBAR_LAYOUT_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\n\n/**\n * SidebarTrigger is a helper directive for Sidebar component.\n * @group Components\n */\n@Directive({\n selector: '[pSidebarTrigger]',\n standalone: true,\n host: {\n '[class]': \"cx('trigger')\",\n 'data-scope': 'sidebar',\n 'data-part': 'trigger',\n '[attr.aria-controls]': 'resolveTarget()?.id()',\n '[attr.aria-expanded]': 'resolveTarget()?.open()',\n '(click)': 'onClick($event)'\n },\n providers: [SidebarStyle, { provide: PARENT_INSTANCE, useExisting: SidebarTrigger }]\n})\nexport class SidebarTrigger extends BaseComponent<SidebarTriggerPassThrough> {\n componentName = 'SidebarTrigger';\n\n bindDirectiveInstance = inject(Bind, { optional: true, self: true }) ?? undefined;\n\n _componentStyle = inject(SidebarStyle);\n\n private layout: any = inject(SIDEBAR_LAYOUT_INSTANCE, { optional: true });\n\n private ancestorSidebar: any = inject(SIDEBAR_INSTANCE, { optional: true });\n\n /**\n * Id of the target Sidebar within the parent Layout.\n * @group Props\n */\n target = input<string>();\n\n onAfterViewChecked(): void {\n this.bindDirectiveInstance?.setAttrs(this.ptm('root'));\n }\n\n resolveTarget(): any {\n const id = this.target();\n if (id) return this.layout?.getSidebar(id);\n return this.ancestorSidebar;\n }\n\n onClick(event: Event): void {\n this.resolveTarget()?.toggle(event);\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, HostListener, inject, input, model, NgModule, ViewEncapsulation } from '@angular/core';\nimport { uuid } from '@primeuix/utils';\nimport { BaseComponent, PARENT_INSTANCE } from 'primeng/basecomponent';\nimport { Bind, BindModule } from 'primeng/bind';\nimport { SidebarCollapsible, SidebarDisplayState, SidebarPassThrough, SidebarSide, SidebarVariant } from 'primeng/types/sidebar';\nimport { SIDEBAR_INSTANCE, SIDEBAR_LAYOUT_INSTANCE } from './tokens';\nimport { SidebarStyle } from './style/sidebarstyle';\nimport { SidebarBackdrop } from './sidebar-backdrop';\nimport { SidebarContent } from './sidebar-content';\nimport { SidebarFooter } from './sidebar-footer';\nimport { SidebarGroup } from './sidebar-group';\nimport { SidebarGroupAction } from './sidebar-group-action';\nimport { SidebarGroupContent } from './sidebar-group-content';\nimport { SidebarGroupLabel } from './sidebar-group-label';\nimport { SidebarHeader } from './sidebar-header';\nimport { SidebarMain } from './sidebar-main';\nimport { SidebarLayout } from './sidebar-layout';\nimport { SidebarMenu } from './sidebar-menu';\nimport { SidebarMenuAction } from './sidebar-menu-action';\nimport { SidebarMenuBadge } from './sidebar-menu-badge';\nimport { SidebarMenuButton } from './sidebar-menu-button';\nimport { SidebarMenuItem } from './sidebar-menu-item';\nimport { SidebarMenuSub } from './sidebar-menu-sub';\nimport { SidebarMenuSubButton } from './sidebar-menu-sub-button';\nimport { SidebarMenuSubItem } from './sidebar-menu-sub-item';\nimport { SidebarAside } from './sidebar-aside';\nimport { SidebarPanel } from './sidebar-panel';\nimport { SidebarRail } from './sidebar-rail';\nimport { SidebarSpacer } from './sidebar-spacer';\nimport { SidebarTrigger } from './sidebar-trigger';\n\n/**\n * Sidebar is a compound navigation panel with collapsible icon mode, offcanvas mode, variants and optional overlay.\n * @group Components\n */\n@Component({\n selector: 'p-sidebar',\n standalone: true,\n imports: [BindModule],\n template: `<ng-content />`,\n host: {\n '[class]': \"cx('root')\",\n '[attr.data-side]': 'side()',\n '[attr.data-variant]': 'variant()',\n '[attr.data-collapsible]': 'dataCollapsible()',\n '[attr.data-collapsible-mode]': 'collapsible()',\n '[attr.data-overlay]': 'dataOverlay()',\n '[attr.data-state]': 'displayState()',\n '[style.--px-sidebar-width]': 'width()',\n '[style.--px-sidebar-width-icon]': 'iconWidth()',\n '(pointerenter)': 'onPointerEnter($event)',\n '(pointerleave)': 'onPointerLeave($event)'\n },\n hostDirectives: [Bind],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [SidebarStyle, { provide: SIDEBAR_INSTANCE, useExisting: Sidebar }, { provide: PARENT_INSTANCE, useExisting: Sidebar }]\n})\nexport class Sidebar extends BaseComponent<SidebarPassThrough> {\n componentName = 'Sidebar';\n\n bindDirectiveInstance = inject(Bind, { self: true });\n\n private layout: any = inject(SIDEBAR_LAYOUT_INSTANCE, { optional: true });\n\n /**\n * Two-way bound open state.\n * @defaultValue true\n * @group Props\n */\n open = model<boolean>(true);\n /**\n * Side the sidebar attaches to.\n * @defaultValue 'left'\n * @group Props\n */\n side = input<SidebarSide>('left');\n /**\n * Visual variant.\n * @defaultValue 'sidebar'\n * @group Props\n */\n variant = input<SidebarVariant>('sidebar');\n /**\n * Collapse mode.\n * @defaultValue 'icon'\n * @group Props\n */\n collapsible = input<SidebarCollapsible>('icon');\n /**\n * When enabled, the sidebar overlays the inset instead of pushing it.\n * @defaultValue false\n * @group Props\n */\n overlay = input<boolean>(false);\n /**\n * Clicking the backdrop closes the sidebar when overlay is active.\n * @defaultValue true\n * @group Props\n */\n dismissable = input<boolean>(true);\n /**\n * When overlay is active, clicking inside the SidebarMain area collapses the sidebar. Clicks originating from a [pSidebarTrigger] are excluded so opening via the trigger is not immediately undone.\n * @defaultValue true\n * @group Props\n */\n hideOnOutsideCli