UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

1 lines 83.9 kB
{"version":3,"file":"ng-zorro-antd-menu.mjs","sources":["../../components/menu/menu.token.ts","../../components/menu/menu.service.ts","../../components/menu/submenu.service.ts","../../components/menu/menu-item.component.ts","../../components/menu/submenu-inline-child.component.ts","../../components/menu/submenu-non-inline-child.component.ts","../../components/menu/submenu-title.component.ts","../../components/menu/submenu.component.ts","../../components/menu/menu.directive.ts","../../components/menu/menu-group.component.ts","../../components/menu/menu-divider.directive.ts","../../components/menu/menu.module.ts","../../components/menu/menu.types.ts","../../components/menu/public-api.ts","../../components/menu/ng-zorro-antd-menu.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { MenuService } from './menu.service';\n\nexport const NzIsMenuInsideDropDownToken = new InjectionToken<boolean>('NzIsInDropDownMenuToken');\nexport const NzMenuServiceLocalToken = new InjectionToken<MenuService>('NzMenuServiceLocalToken');\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Injectable } from '@angular/core';\nimport { BehaviorSubject, Subject } from 'rxjs';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzMenuModeType, NzMenuThemeType } from './menu.types';\n\n@Injectable()\nexport class MenuService {\n /** all descendant menu click **/\n descendantMenuItemClick$ = new Subject<NzSafeAny>();\n /** child menu item click **/\n childMenuItemClick$ = new Subject<NzSafeAny>();\n theme$ = new BehaviorSubject<NzMenuThemeType>('light');\n mode$ = new BehaviorSubject<NzMenuModeType>('vertical');\n inlineIndent$ = new BehaviorSubject<number>(24);\n isChildSubMenuOpen$ = new BehaviorSubject<boolean>(false);\n\n onDescendantMenuItemClick(menu: NzSafeAny): void {\n this.descendantMenuItemClick$.next(menu);\n }\n\n onChildMenuItemClick(menu: NzSafeAny): void {\n this.childMenuItemClick$.next(menu);\n }\n\n setMode(mode: NzMenuModeType): void {\n this.mode$.next(mode);\n }\n\n setTheme(theme: NzMenuThemeType): void {\n this.theme$.next(theme);\n }\n\n setInlineIndent(indent: number): void {\n this.inlineIndent$.next(indent);\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Injectable, OnDestroy, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject, combineLatest, merge } from 'rxjs';\nimport { auditTime, distinctUntilChanged, filter, map, mergeMap, takeUntil } from 'rxjs/operators';\n\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { MenuService } from './menu.service';\nimport { NzIsMenuInsideDropDownToken } from './menu.token';\nimport { NzMenuModeType } from './menu.types';\n\n@Injectable()\nexport class NzSubmenuService implements OnDestroy {\n public nzMenuService = inject(MenuService);\n mode$: Observable<NzMenuModeType> = this.nzMenuService.mode$.pipe(\n map(mode => {\n if (mode === 'inline') {\n return 'inline';\n /** if inside another submenu, set the mode to vertical **/\n } else if (mode === 'vertical' || this.nzHostSubmenuService) {\n return 'vertical';\n } else {\n return 'horizontal';\n }\n })\n );\n level = 1;\n isMenuInsideDropDown = inject(NzIsMenuInsideDropDownToken);\n isCurrentSubMenuOpen$ = new BehaviorSubject<boolean>(false);\n private isChildSubMenuOpen$ = new BehaviorSubject<boolean>(false);\n /** submenu title & overlay mouse enter status **/\n private isMouseEnterTitleOrOverlay$ = new Subject<boolean>();\n private childMenuItemClick$ = new Subject<NzSafeAny>();\n private destroy$ = new Subject<void>();\n private nzHostSubmenuService = inject(NzSubmenuService, { optional: true, skipSelf: true });\n /**\n * menu item inside submenu clicked\n *\n * @param menu\n */\n onChildMenuItemClick(menu: NzSafeAny): void {\n this.childMenuItemClick$.next(menu);\n }\n setOpenStateWithoutDebounce(value: boolean): void {\n this.isCurrentSubMenuOpen$.next(value);\n }\n setMouseEnterTitleOrOverlayState(value: boolean): void {\n this.isMouseEnterTitleOrOverlay$.next(value);\n }\n\n constructor() {\n if (this.nzHostSubmenuService) {\n this.level = this.nzHostSubmenuService.level + 1;\n }\n /** close if menu item clicked **/\n const isClosedByMenuItemClick = this.childMenuItemClick$.pipe(\n mergeMap(() => this.mode$),\n filter(mode => mode !== 'inline' || this.isMenuInsideDropDown),\n map(() => false)\n );\n const isCurrentSubmenuOpen$ = merge(this.isMouseEnterTitleOrOverlay$, isClosedByMenuItemClick);\n /** combine the child submenu status with current submenu status to calculate host submenu open **/\n const isSubMenuOpenWithDebounce$ = combineLatest([this.isChildSubMenuOpen$, isCurrentSubmenuOpen$]).pipe(\n map(([isChildSubMenuOpen, isCurrentSubmenuOpen]) => isChildSubMenuOpen || isCurrentSubmenuOpen),\n auditTime(150),\n distinctUntilChanged(),\n takeUntil(this.destroy$)\n );\n isSubMenuOpenWithDebounce$.pipe(distinctUntilChanged()).subscribe(data => {\n this.setOpenStateWithoutDebounce(data);\n if (this.nzHostSubmenuService) {\n /** set parent submenu's child submenu open status **/\n this.nzHostSubmenuService.isChildSubMenuOpen$.next(data);\n } else {\n this.nzMenuService.isChildSubMenuOpen$.next(data);\n }\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n QueryList,\n SimpleChanges,\n ViewEncapsulation,\n booleanAttribute,\n inject\n} from '@angular/core';\nimport { NavigationEnd, Router, RouterLink } from '@angular/router';\nimport { Subject, combineLatest } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport { numberAttributeWithZeroFallback } from 'ng-zorro-antd/core/util';\n\nimport { MenuService } from './menu.service';\nimport { NzIsMenuInsideDropDownToken } from './menu.token';\nimport { NzSubmenuService } from './submenu.service';\n\n@Component({\n selector: '[nz-menu-item]',\n exportAs: 'nzMenuItem',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n preserveWhitespaces: false,\n template: `\n <span class=\"ant-menu-title-content\">\n <ng-content></ng-content>\n </span>\n `,\n host: {\n '[class.ant-dropdown-menu-item]': `isMenuInsideDropDown`,\n '[class.ant-dropdown-menu-item-selected]': `isMenuInsideDropDown && nzSelected`,\n '[class.ant-dropdown-menu-item-danger]': `isMenuInsideDropDown && nzDanger`,\n '[class.ant-dropdown-menu-item-disabled]': `isMenuInsideDropDown && nzDisabled`,\n '[class.ant-menu-item]': `!isMenuInsideDropDown`,\n '[class.ant-menu-item-selected]': `!isMenuInsideDropDown && nzSelected`,\n '[class.ant-menu-item-danger]': `!isMenuInsideDropDown && nzDanger`,\n '[class.ant-menu-item-disabled]': `!isMenuInsideDropDown && nzDisabled`,\n '[style.paddingLeft.px]': `dir === 'rtl' ? null : nzPaddingLeft || inlinePaddingLeft`,\n '[style.paddingRight.px]': `dir === 'rtl' ? nzPaddingLeft || inlinePaddingLeft : null`,\n '(click)': 'clickMenuItem($event)'\n }\n})\nexport class NzMenuItemComponent implements OnInit, OnChanges, OnDestroy, AfterContentInit {\n private destroy$ = new Subject<boolean>();\n private nzSubmenuService = inject(NzSubmenuService, { optional: true });\n private directionality = inject(Directionality);\n private routerLink = inject(RouterLink, { optional: true });\n private router = inject(Router, { optional: true });\n isMenuInsideDropDown = inject(NzIsMenuInsideDropDownToken);\n level = this.nzSubmenuService ? this.nzSubmenuService.level + 1 : 1;\n selected$ = new Subject<boolean>();\n inlinePaddingLeft: number | null = null;\n dir: Direction = 'ltr';\n @Input({ transform: numberAttributeWithZeroFallback }) nzPaddingLeft?: number;\n @Input({ transform: booleanAttribute }) nzDisabled = false;\n @Input({ transform: booleanAttribute }) nzSelected = false;\n @Input({ transform: booleanAttribute }) nzDanger = false;\n @Input({ transform: booleanAttribute }) nzMatchRouterExact = false;\n @Input({ transform: booleanAttribute }) nzMatchRouter = false;\n @ContentChildren(RouterLink, { descendants: true }) listOfRouterLink!: QueryList<RouterLink>;\n\n /** clear all item selected status except this */\n clickMenuItem(e: MouseEvent): void {\n if (this.nzDisabled) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n this.nzMenuService.onDescendantMenuItemClick(this);\n if (this.nzSubmenuService) {\n /** menu item inside the submenu **/\n this.nzSubmenuService.onChildMenuItemClick(this);\n } else {\n /** menu item inside the root menu **/\n this.nzMenuService.onChildMenuItemClick(this);\n }\n }\n }\n\n setSelectedState(value: boolean): void {\n this.nzSelected = value;\n this.selected$.next(value);\n }\n\n private updateRouterActive(): void {\n if (!this.listOfRouterLink || !this.router || !this.router.navigated || !this.nzMatchRouter) {\n return;\n }\n Promise.resolve().then(() => {\n const hasActiveLinks = this.hasActiveLinks();\n if (this.nzSelected !== hasActiveLinks) {\n this.nzSelected = hasActiveLinks;\n this.setSelectedState(this.nzSelected);\n this.cdr.markForCheck();\n }\n });\n }\n\n private hasActiveLinks(): boolean {\n const isActiveCheckFn = this.isLinkActive(this.router!);\n return (this.routerLink && isActiveCheckFn(this.routerLink)) || this.listOfRouterLink.some(isActiveCheckFn);\n }\n\n private isLinkActive(router: Router): (link: RouterLink) => boolean {\n return (link: RouterLink) =>\n router.isActive(link.urlTree || '', {\n paths: this.nzMatchRouterExact ? 'exact' : 'subset',\n queryParams: this.nzMatchRouterExact ? 'exact' : 'subset',\n fragment: 'ignored',\n matrixParams: 'ignored'\n });\n }\n\n constructor(\n private nzMenuService: MenuService,\n private cdr: ChangeDetectorRef\n ) {\n if (this.router) {\n this.router!.events.pipe(\n takeUntil(this.destroy$),\n filter(e => e instanceof NavigationEnd)\n ).subscribe(() => {\n this.updateRouterActive();\n });\n }\n }\n\n ngOnInit(): void {\n /** store origin padding in padding */\n combineLatest([this.nzMenuService.mode$, this.nzMenuService.inlineIndent$])\n .pipe(takeUntil(this.destroy$))\n .subscribe(([mode, inlineIndent]) => {\n this.inlinePaddingLeft = mode === 'inline' ? this.level * inlineIndent : null;\n });\n\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n });\n }\n\n ngAfterContentInit(): void {\n this.listOfRouterLink.changes.pipe(takeUntil(this.destroy$)).subscribe(() => this.updateRouterActive());\n this.updateRouterActive();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.nzSelected) {\n this.setSelectedState(this.nzSelected);\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { collapseMotion } from 'ng-zorro-antd/core/animation';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzMenuModeType } from './menu.types';\n\n@Component({\n selector: '[nz-submenu-inline-child]',\n animations: [collapseMotion],\n exportAs: 'nzSubmenuInlineChild',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: ` <ng-template [ngTemplateOutlet]=\"templateOutlet\"></ng-template> `,\n host: {\n class: 'ant-menu ant-menu-inline ant-menu-sub',\n '[class.ant-menu-rtl]': `dir === 'rtl'`,\n '[@collapseMotion]': 'expandState'\n },\n imports: [NgTemplateOutlet]\n})\nexport class NzSubmenuInlineChildComponent implements OnDestroy, OnInit, OnChanges {\n @Input() templateOutlet: TemplateRef<NzSafeAny> | null = null;\n @Input() menuClass: string = '';\n @Input() mode: NzMenuModeType = 'vertical';\n @Input() nzOpen = false;\n listOfCacheClassName: string[] = [];\n expandState = 'collapsed';\n dir: Direction = 'ltr';\n private destroy$ = new Subject<void>();\n\n constructor(\n private elementRef: ElementRef,\n private renderer: Renderer2,\n private directionality: Directionality\n ) {}\n\n calcMotionState(): void {\n if (this.nzOpen) {\n this.expandState = 'expanded';\n } else {\n this.expandState = 'collapsed';\n }\n }\n ngOnInit(): void {\n this.calcMotionState();\n\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n });\n }\n ngOnChanges(changes: SimpleChanges): void {\n const { mode, nzOpen, menuClass } = changes;\n if (mode || nzOpen) {\n this.calcMotionState();\n }\n if (menuClass) {\n if (this.listOfCacheClassName.length) {\n this.listOfCacheClassName\n .filter(item => !!item)\n .forEach(className => {\n this.renderer.removeClass(this.elementRef.nativeElement, className);\n });\n }\n if (this.menuClass) {\n this.listOfCacheClassName = this.menuClass.split(' ');\n this.listOfCacheClassName\n .filter(item => !!item)\n .forEach(className => {\n this.renderer.addClass(this.elementRef.nativeElement, className);\n });\n }\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { slideMotion, zoomBigMotion } from 'ng-zorro-antd/core/animation';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\n\nimport { NzMenuModeType, NzMenuThemeType, NzSubmenuTrigger } from './menu.types';\n\n@Component({\n selector: '[nz-submenu-none-inline-child]',\n exportAs: 'nzSubmenuNoneInlineChild',\n encapsulation: ViewEncapsulation.None,\n animations: [zoomBigMotion, slideMotion],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div\n [class.ant-dropdown-menu]=\"isMenuInsideDropDown\"\n [class.ant-menu]=\"!isMenuInsideDropDown\"\n [class.ant-dropdown-menu-vertical]=\"isMenuInsideDropDown\"\n [class.ant-menu-vertical]=\"!isMenuInsideDropDown\"\n [class.ant-dropdown-menu-sub]=\"isMenuInsideDropDown\"\n [class.ant-menu-sub]=\"!isMenuInsideDropDown\"\n [class.ant-menu-rtl]=\"dir === 'rtl'\"\n [class]=\"menuClass\"\n >\n <ng-template [ngTemplateOutlet]=\"templateOutlet\"></ng-template>\n </div>\n `,\n host: {\n class: 'ant-menu-submenu ant-menu-submenu-popup',\n '[class.ant-menu-light]': \"theme === 'light'\",\n '[class.ant-menu-dark]': \"theme === 'dark'\",\n '[class.ant-menu-submenu-placement-bottom]': \"mode === 'horizontal'\",\n '[class.ant-menu-submenu-placement-right]': \"mode === 'vertical' && position === 'right'\",\n '[class.ant-menu-submenu-placement-left]': \"mode === 'vertical' && position === 'left'\",\n '[class.ant-menu-submenu-rtl]': 'dir ===\"rtl\"',\n '[@slideMotion]': 'expandState',\n '[@zoomBigMotion]': 'expandState',\n '(mouseenter)': 'setMouseState(true)',\n '(mouseleave)': 'setMouseState(false)'\n },\n imports: [NgTemplateOutlet]\n})\nexport class NzSubmenuNoneInlineChildComponent implements OnDestroy, OnInit, OnChanges {\n @Input() menuClass: string = '';\n @Input() theme: NzMenuThemeType = 'light';\n @Input() templateOutlet: TemplateRef<NzSafeAny> | null = null;\n @Input() isMenuInsideDropDown = false;\n @Input() mode: NzMenuModeType = 'vertical';\n @Input() nzTriggerSubMenuAction: NzSubmenuTrigger = 'hover';\n @Input() position = 'right';\n @Input() nzDisabled = false;\n @Input() nzOpen = false;\n @Output() readonly subMenuMouseState = new EventEmitter<boolean>();\n\n constructor(private directionality: Directionality) {}\n\n setMouseState(state: boolean): void {\n if (!this.nzDisabled && this.nzTriggerSubMenuAction === 'hover') {\n this.subMenuMouseState.next(state);\n }\n }\n expandState = 'collapsed';\n dir: Direction = 'ltr';\n private destroy$ = new Subject<void>();\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n calcMotionState(): void {\n if (this.nzOpen) {\n if (this.mode === 'horizontal') {\n this.expandState = 'bottom';\n } else if (this.mode === 'vertical') {\n this.expandState = 'active';\n }\n } else {\n this.expandState = 'collapsed';\n }\n }\n ngOnInit(): void {\n this.calcMotionState();\n\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n });\n }\n ngOnChanges(changes: SimpleChanges): void {\n const { mode, nzOpen } = changes;\n if (mode || nzOpen) {\n this.calcMotionState();\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport { NzMenuModeType, NzSubmenuTrigger } from './menu.types';\n\n@Component({\n selector: '[nz-submenu-title]',\n exportAs: 'nzSubmenuTitle',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (nzIcon) {\n <nz-icon [nzType]=\"nzIcon\" />\n }\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">\n <span class=\"ant-menu-title-content\">{{ nzTitle }}</span>\n </ng-container>\n <ng-content />\n @if (isMenuInsideDropDown) {\n <span class=\"ant-dropdown-menu-submenu-expand-icon\">\n @switch (dir) {\n @case ('rtl') {\n <nz-icon nzType=\"left\" class=\"ant-dropdown-menu-submenu-arrow-icon\" />\n }\n @default {\n <nz-icon nzType=\"right\" class=\"ant-dropdown-menu-submenu-arrow-icon\" />\n }\n }\n </span>\n } @else {\n <span class=\"ant-menu-submenu-arrow\"></span>\n }\n `,\n host: {\n '[class.ant-dropdown-menu-submenu-title]': 'isMenuInsideDropDown',\n '[class.ant-menu-submenu-title]': '!isMenuInsideDropDown',\n '[style.paddingLeft.px]': `dir === 'rtl' ? null : paddingLeft `,\n '[style.paddingRight.px]': `dir === 'rtl' ? paddingLeft : null`,\n '(click)': 'clickTitle()',\n '(mouseenter)': 'setMouseState(true)',\n '(mouseleave)': 'setMouseState(false)'\n },\n imports: [NzIconModule, NzOutletModule]\n})\nexport class NzSubMenuTitleComponent implements OnDestroy, OnInit {\n @Input() nzIcon: string | null = null;\n @Input() nzTitle: string | TemplateRef<void> | null = null;\n @Input() isMenuInsideDropDown = false;\n @Input() nzDisabled = false;\n @Input() paddingLeft: number | null = null;\n @Input() mode: NzMenuModeType = 'vertical';\n @Input() nzTriggerSubMenuAction: NzSubmenuTrigger = 'hover';\n @Output() readonly toggleSubMenu = new EventEmitter();\n @Output() readonly subMenuMouseState = new EventEmitter<boolean>();\n\n dir: Direction = 'ltr';\n private destroy$ = new Subject<void>();\n\n constructor(\n private cdr: ChangeDetectorRef,\n private directionality: Directionality\n ) {}\n ngOnInit(): void {\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n this.cdr.detectChanges();\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n setMouseState(state: boolean): void {\n if (!this.nzDisabled && this.nzTriggerSubMenuAction === 'hover') {\n this.subMenuMouseState.next(state);\n }\n }\n clickTitle(): void {\n if ((this.mode === 'inline' || this.nzTriggerSubMenuAction === 'click') && !this.nzDisabled) {\n this.subMenuMouseState.next(true);\n this.toggleSubMenu.emit();\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport { CdkOverlayOrigin, ConnectedOverlayPositionChange, OverlayModule } from '@angular/cdk/overlay';\nimport { Platform } from '@angular/cdk/platform';\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { combineLatest, merge, Subject } from 'rxjs';\nimport { map, startWith, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';\nimport { getPlacementName, POSITION_MAP, POSITION_TYPE_HORIZONTAL } from 'ng-zorro-antd/core/overlay';\n\nimport { NzMenuItemComponent } from './menu-item.component';\nimport { MenuService } from './menu.service';\nimport { NzIsMenuInsideDropDownToken } from './menu.token';\nimport { NzMenuModeType, NzMenuThemeType, NzSubmenuTrigger } from './menu.types';\nimport { NzSubmenuInlineChildComponent } from './submenu-inline-child.component';\nimport { NzSubmenuNoneInlineChildComponent } from './submenu-non-inline-child.component';\nimport { NzSubMenuTitleComponent } from './submenu-title.component';\nimport { NzSubmenuService } from './submenu.service';\n\nconst listOfVerticalPositions = [\n POSITION_MAP.rightTop,\n POSITION_MAP.right,\n POSITION_MAP.rightBottom,\n POSITION_MAP.leftTop,\n POSITION_MAP.left,\n POSITION_MAP.leftBottom\n];\nconst listOfHorizontalPositions = [\n POSITION_MAP.bottomLeft,\n POSITION_MAP.bottomRight,\n POSITION_MAP.topRight,\n POSITION_MAP.topLeft\n];\n\n@Component({\n selector: '[nz-submenu]',\n exportAs: 'nzSubmenu',\n providers: [NzSubmenuService],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false,\n template: `\n <div\n nz-submenu-title\n cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n [nzIcon]=\"nzIcon\"\n [nzTitle]=\"nzTitle\"\n [mode]=\"mode\"\n [nzDisabled]=\"nzDisabled\"\n [isMenuInsideDropDown]=\"isMenuInsideDropDown\"\n [paddingLeft]=\"nzPaddingLeft || inlinePaddingLeft\"\n [nzTriggerSubMenuAction]=\"nzTriggerSubMenuAction\"\n (subMenuMouseState)=\"setMouseEnterState($event)\"\n (toggleSubMenu)=\"toggleSubMenu()\"\n >\n @if (!nzTitle) {\n <ng-content select=\"[title]\" />\n }\n </div>\n @if (mode === 'inline') {\n <div\n nz-submenu-inline-child\n [mode]=\"mode\"\n [nzOpen]=\"nzOpen\"\n [@.disabled]=\"!!noAnimation?.nzNoAnimation\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [menuClass]=\"nzMenuClassName\"\n [templateOutlet]=\"subMenuTemplate\"\n ></div>\n } @else {\n <ng-template\n cdkConnectedOverlay\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayWidth]=\"triggerWidth!\"\n [cdkConnectedOverlayOpen]=\"nzOpen\"\n [cdkConnectedOverlayTransformOriginOn]=\"'.ant-menu-submenu'\"\n (overlayOutsideClick)=\"setMouseEnterState(false)\"\n >\n <div\n nz-submenu-none-inline-child\n [theme]=\"theme\"\n [mode]=\"mode\"\n [nzOpen]=\"nzOpen\"\n [position]=\"position\"\n [nzDisabled]=\"nzDisabled\"\n [isMenuInsideDropDown]=\"isMenuInsideDropDown\"\n [nzTriggerSubMenuAction]=\"nzTriggerSubMenuAction\"\n [templateOutlet]=\"subMenuTemplate\"\n [menuClass]=\"nzMenuClassName\"\n [@.disabled]=\"!!noAnimation?.nzNoAnimation\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n (subMenuMouseState)=\"setMouseEnterState($event)\"\n ></div>\n </ng-template>\n }\n\n <ng-template #subMenuTemplate>\n <ng-content />\n </ng-template>\n `,\n host: {\n '[class.ant-dropdown-menu-submenu]': `isMenuInsideDropDown`,\n '[class.ant-dropdown-menu-submenu-disabled]': `isMenuInsideDropDown && nzDisabled`,\n '[class.ant-dropdown-menu-submenu-open]': `isMenuInsideDropDown && nzOpen`,\n '[class.ant-dropdown-menu-submenu-selected]': `isMenuInsideDropDown && isSelected`,\n '[class.ant-dropdown-menu-submenu-vertical]': `isMenuInsideDropDown && mode === 'vertical'`,\n '[class.ant-dropdown-menu-submenu-horizontal]': `isMenuInsideDropDown && mode === 'horizontal'`,\n '[class.ant-dropdown-menu-submenu-inline]': `isMenuInsideDropDown && mode === 'inline'`,\n '[class.ant-dropdown-menu-submenu-active]': `isMenuInsideDropDown && isActive`,\n '[class.ant-menu-submenu]': `!isMenuInsideDropDown`,\n '[class.ant-menu-submenu-disabled]': `!isMenuInsideDropDown && nzDisabled`,\n '[class.ant-menu-submenu-open]': `!isMenuInsideDropDown && nzOpen`,\n '[class.ant-menu-submenu-selected]': `!isMenuInsideDropDown && isSelected`,\n '[class.ant-menu-submenu-vertical]': `!isMenuInsideDropDown && mode === 'vertical'`,\n '[class.ant-menu-submenu-horizontal]': `!isMenuInsideDropDown && mode === 'horizontal'`,\n '[class.ant-menu-submenu-inline]': `!isMenuInsideDropDown && mode === 'inline'`,\n '[class.ant-menu-submenu-active]': `!isMenuInsideDropDown && isActive`,\n '[class.ant-menu-submenu-rtl]': `dir === 'rtl'`\n },\n imports: [\n NzSubMenuTitleComponent,\n NzSubmenuInlineChildComponent,\n NzNoAnimationDirective,\n NzSubmenuNoneInlineChildComponent,\n OverlayModule\n ]\n})\nexport class NzSubMenuComponent implements OnInit, OnDestroy, AfterContentInit, OnChanges {\n @Input() nzMenuClassName: string = '';\n @Input() nzPaddingLeft: number | null = null;\n @Input() nzTitle: string | TemplateRef<void> | null = null;\n @Input() nzIcon: string | null = null;\n @Input() nzTriggerSubMenuAction: NzSubmenuTrigger = 'hover';\n @Input({ transform: booleanAttribute }) nzOpen = false;\n @Input({ transform: booleanAttribute }) nzDisabled = false;\n @Input() nzPlacement: POSITION_TYPE_HORIZONTAL = 'bottomLeft';\n @Output() readonly nzOpenChange = new EventEmitter<boolean>();\n @ViewChild(CdkOverlayOrigin, { static: true, read: ElementRef }) cdkOverlayOrigin: ElementRef | null = null;\n // fix errors about circular dependency\n // Can't construct a query for the property ... since the query selector wasn't defined\"\n @ContentChildren(forwardRef(() => NzSubMenuComponent), { descendants: true })\n listOfNzSubMenuComponent: QueryList<NzSubMenuComponent> | null = null;\n @ContentChildren(NzMenuItemComponent, { descendants: true })\n listOfNzMenuItemDirective: QueryList<NzMenuItemComponent> | null = null;\n\n public nzSubmenuService = inject(NzSubmenuService);\n private level = this.nzSubmenuService.level;\n private destroy$ = new Subject<void>();\n position = 'right';\n triggerWidth: number | null = null;\n theme: NzMenuThemeType = 'light';\n mode: NzMenuModeType = 'vertical';\n inlinePaddingLeft: number | null = null;\n overlayPositions = listOfVerticalPositions;\n isSelected = false;\n isActive = false;\n dir: Direction = 'ltr';\n isMenuInsideDropDown = inject(NzIsMenuInsideDropDownToken);\n noAnimation = inject(NzNoAnimationDirective, { optional: true, host: true });\n private directionality = inject(Directionality);\n\n /** set the submenu host open status directly **/\n setOpenStateWithoutDebounce(open: boolean): void {\n this.nzSubmenuService.setOpenStateWithoutDebounce(open);\n }\n\n toggleSubMenu(): void {\n this.setOpenStateWithoutDebounce(!this.nzOpen);\n }\n\n setMouseEnterState(value: boolean): void {\n this.isActive = value;\n if (this.mode !== 'inline') {\n this.nzSubmenuService.setMouseEnterTitleOrOverlayState(value);\n }\n }\n\n setTriggerWidth(): void {\n if (\n this.mode === 'horizontal' &&\n this.platform.isBrowser &&\n this.cdkOverlayOrigin &&\n this.nzPlacement === 'bottomLeft'\n ) {\n /** TODO: fast dom **/\n this.triggerWidth = this.cdkOverlayOrigin!.nativeElement.getBoundingClientRect().width;\n }\n }\n\n onPositionChange(position: ConnectedOverlayPositionChange): void {\n const placement = getPlacementName(position);\n if (placement === 'rightTop' || placement === 'rightBottom' || placement === 'right') {\n this.position = 'right';\n } else if (placement === 'leftTop' || placement === 'leftBottom' || placement === 'left') {\n this.position = 'left';\n }\n }\n\n constructor(\n public nzMenuService: MenuService,\n private cdr: ChangeDetectorRef,\n private platform: Platform\n ) {}\n\n ngOnInit(): void {\n /** submenu theme update **/\n this.nzMenuService.theme$.pipe(takeUntil(this.destroy$)).subscribe(theme => {\n this.theme = theme;\n this.cdr.markForCheck();\n });\n /** submenu mode update **/\n this.nzSubmenuService.mode$.pipe(takeUntil(this.destroy$)).subscribe(mode => {\n this.mode = mode;\n if (mode === 'horizontal') {\n this.overlayPositions = [POSITION_MAP[this.nzPlacement], ...listOfHorizontalPositions];\n } else if (mode === 'vertical') {\n this.overlayPositions = listOfVerticalPositions;\n }\n this.cdr.markForCheck();\n });\n /** inlineIndent update **/\n combineLatest([this.nzSubmenuService.mode$, this.nzMenuService.inlineIndent$])\n .pipe(takeUntil(this.destroy$))\n .subscribe(([mode, inlineIndent]) => {\n this.inlinePaddingLeft = mode === 'inline' ? this.level * inlineIndent : null;\n this.cdr.markForCheck();\n });\n /** current submenu open status **/\n this.nzSubmenuService.isCurrentSubMenuOpen$.pipe(takeUntil(this.destroy$)).subscribe(open => {\n this.isActive = open;\n if (open !== this.nzOpen) {\n this.setTriggerWidth();\n this.nzOpen = open;\n this.nzOpenChange.emit(this.nzOpen);\n this.cdr.markForCheck();\n }\n });\n\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n this.cdr.markForCheck();\n });\n }\n\n ngAfterContentInit(): void {\n this.setTriggerWidth();\n const listOfNzMenuItemDirective = this.listOfNzMenuItemDirective;\n const changes = listOfNzMenuItemDirective!.changes;\n const mergedObservable = merge(...[changes, ...listOfNzMenuItemDirective!.map(menu => menu.selected$)]);\n changes\n .pipe(\n startWith(listOfNzMenuItemDirective),\n switchMap(() => mergedObservable),\n startWith(true),\n map(() => listOfNzMenuItemDirective!.some(e => e.nzSelected)),\n takeUntil(this.destroy$)\n )\n .subscribe(selected => {\n this.isSelected = selected;\n this.cdr.markForCheck();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { nzOpen } = changes;\n if (nzOpen) {\n this.nzSubmenuService.setOpenStateWithoutDebounce(this.nzOpen);\n this.setTriggerWidth();\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n SimpleChanges,\n booleanAttribute,\n inject\n} from '@angular/core';\nimport { BehaviorSubject, Subject, combineLatest } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzMenuItemComponent } from './menu-item.component';\nimport { MenuService } from './menu.service';\nimport { NzIsMenuInsideDropDownToken, NzMenuServiceLocalToken } from './menu.token';\nimport { NzMenuModeType, NzMenuThemeType } from './menu.types';\nimport { NzSubMenuComponent } from './submenu.component';\n\nexport function MenuServiceFactory(): MenuService {\n const serviceInsideDropDown = inject(MenuService, { skipSelf: true, optional: true });\n const serviceOutsideDropDown = inject(NzMenuServiceLocalToken);\n return serviceInsideDropDown ?? serviceOutsideDropDown;\n}\n\nexport function MenuDropDownTokenFactory(): boolean {\n const isMenuInsideDropDownToken = inject(NzIsMenuInsideDropDownToken, { skipSelf: true, optional: true });\n return isMenuInsideDropDownToken ?? false;\n}\n\n@Directive({\n selector: '[nz-menu]',\n exportAs: 'nzMenu',\n providers: [\n {\n provide: NzMenuServiceLocalToken,\n useClass: MenuService\n },\n /** use the top level service **/\n {\n provide: MenuService,\n useFactory: MenuServiceFactory\n },\n /** check if menu inside dropdown-menu component **/\n {\n provide: NzIsMenuInsideDropDownToken,\n useFactory: MenuDropDownTokenFactory\n }\n ],\n host: {\n '[class.ant-dropdown-menu]': `isMenuInsideDropDown`,\n '[class.ant-dropdown-menu-root]': `isMenuInsideDropDown`,\n '[class.ant-dropdown-menu-light]': `isMenuInsideDropDown && nzTheme === 'light'`,\n '[class.ant-dropdown-menu-dark]': `isMenuInsideDropDown && nzTheme === 'dark'`,\n '[class.ant-dropdown-menu-vertical]': `isMenuInsideDropDown && actualMode === 'vertical'`,\n '[class.ant-dropdown-menu-horizontal]': `isMenuInsideDropDown && actualMode === 'horizontal'`,\n '[class.ant-dropdown-menu-inline]': `isMenuInsideDropDown && actualMode === 'inline'`,\n '[class.ant-dropdown-menu-inline-collapsed]': `isMenuInsideDropDown && nzInlineCollapsed`,\n '[class.ant-menu]': `!isMenuInsideDropDown`,\n '[class.ant-menu-root]': `!isMenuInsideDropDown`,\n '[class.ant-menu-light]': `!isMenuInsideDropDown && nzTheme === 'light'`,\n '[class.ant-menu-dark]': `!isMenuInsideDropDown && nzTheme === 'dark'`,\n '[class.ant-menu-vertical]': `!isMenuInsideDropDown && actualMode === 'vertical'`,\n '[class.ant-menu-horizontal]': `!isMenuInsideDropDown && actualMode === 'horizontal'`,\n '[class.ant-menu-inline]': `!isMenuInsideDropDown && actualMode === 'inline'`,\n '[class.ant-menu-inline-collapsed]': `!isMenuInsideDropDown && nzInlineCollapsed`,\n '[class.ant-menu-rtl]': `dir === 'rtl'`\n }\n})\nexport class NzMenuDirective implements AfterContentInit, OnInit, OnChanges, OnDestroy {\n @ContentChildren(NzMenuItemComponent, { descendants: true })\n listOfNzMenuItemDirective!: QueryList<NzMenuItemComponent>;\n isMenuInsideDropDown = inject(NzIsMenuInsideDropDownToken);\n @ContentChildren(NzSubMenuComponent, { descendants: true }) listOfNzSubMenuComponent!: QueryList<NzSubMenuComponent>;\n @Input() nzInlineIndent = 24;\n @Input() nzTheme: NzMenuThemeType = 'light';\n @Input() nzMode: NzMenuModeType = 'vertical';\n @Input({ transform: booleanAttribute }) nzInlineCollapsed = false;\n @Input({ transform: booleanAttribute }) nzSelectable = !this.isMenuInsideDropDown;\n @Output() readonly nzClick = new EventEmitter<NzMenuItemComponent>();\n actualMode: NzMenuModeType = 'vertical';\n dir: Direction = 'ltr';\n private inlineCollapsed$ = new BehaviorSubject<boolean>(this.nzInlineCollapsed);\n private mode$ = new BehaviorSubject<NzMenuModeType>(this.nzMode);\n private destroy$ = new Subject<boolean>();\n private listOfOpenedNzSubMenuComponent: NzSubMenuComponent[] = [];\n private directionality = inject(Directionality);\n\n setInlineCollapsed(inlineCollapsed: boolean): void {\n this.nzInlineCollapsed = inlineCollapsed;\n this.inlineCollapsed$.next(inlineCollapsed);\n }\n\n updateInlineCollapse(): void {\n if (this.listOfNzMenuItemDirective) {\n if (this.nzInlineCollapsed) {\n this.listOfOpenedNzSubMenuComponent = this.listOfNzSubMenuComponent.filter(submenu => submenu.nzOpen);\n this.listOfNzSubMenuComponent.forEach(submenu => submenu.setOpenStateWithoutDebounce(false));\n } else {\n this.listOfOpenedNzSubMenuComponent.forEach(submenu => submenu.setOpenStateWithoutDebounce(true));\n this.listOfOpenedNzSubMenuComponent = [];\n }\n }\n }\n\n constructor(\n private nzMenuService: MenuService,\n private cdr: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n combineLatest([this.inlineCollapsed$, this.mode$])\n .pipe(takeUntil(this.destroy$))\n .subscribe(([inlineCollapsed, mode]) => {\n this.actualMode = inlineCollapsed ? 'vertical' : mode;\n this.nzMenuService.setMode(this.actualMode);\n this.cdr.markForCheck();\n });\n this.nzMenuService.descendantMenuItemClick$.pipe(takeUntil(this.destroy$)).subscribe(menu => {\n this.nzClick.emit(menu);\n if (this.nzSelectable && !menu.nzMatchRouter) {\n this.listOfNzMenuItemDirective.forEach(item => item.setSelectedState(item === menu));\n }\n });\n\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe((direction: Direction) => {\n this.dir = direction;\n this.nzMenuService.setMode(this.actualMode);\n this.cdr.markForCheck();\n });\n }\n\n ngAfterContentInit(): void {\n this.inlineCollapsed$.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateInlineCollapse();\n this.cdr.markForCheck();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const { nzInlineCollapsed, nzInlineIndent, nzTheme, nzMode } = changes;\n if (nzInlineCollapsed) {\n this.inlineCollapsed$.next(this.nzInlineCollapsed);\n }\n if (nzInlineIndent) {\n this.nzMenuService.setInlineIndent(this.nzInlineIndent);\n }\n if (nzTheme) {\n this.nzMenuService.setTheme(this.nzTheme);\n }\n if (nzMode) {\n this.mode$.next(this.nzMode);\n if (!changes.nzMode.isFirstChange() && this.listOfNzSubMenuComponent) {\n this.listOfNzSubMenuComponent.forEach(submenu => submenu.setOpenStateWithoutDebounce(false));\n }\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n inject,\n Input,\n Renderer2,\n TemplateRef,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\n\nimport { NzIsMenuInsideDropDownToken } from './menu.token';\n\nexport function MenuGroupFactory(): boolean {\n const isMenuInsideDropDownToken = inject(NzIsMenuInsideDropDownToken, { optional: true, skipSelf: true });\n return isMenuInsideDropDownToken ?? false;\n}\n@Component({\n selector: '[nz-menu-group]',\n exportAs: 'nzMenuGroup',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n /** check if menu inside dropdown-menu component **/\n {\n provide: NzIsMenuInsideDropDownToken,\n useFactory: MenuGroupFactory\n }\n ],\n encapsulation: ViewEncapsulation.None,\n template: `\n <div\n [class.ant-menu-item-group-title]=\"!isMenuInsideDropDown\"\n [class.ant-dropdown-menu-item-group-title]=\"isMenuInsideDropDown\"\n #titleElement\n >\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n @if (!nzTitle) {\n <ng-content select=\"[title]\" />\n }\n </div>\n <ng-content></ng-content>\n `,\n preserveWhitespaces: false,\n imports: [NzOutletModule]\n})\nexport class NzMenuGroupComponent implements AfterViewInit {\n @Input() nzTitle?: string | TemplateRef<void>;\n @ViewChild('titleElement') titleElement?: ElementRef;\n isMenuInsideDropDown = inject(NzIsMenuInsideDropDownToken);\n\n constructor(\n public elementRef: ElementRef,\n private renderer: Renderer2\n ) {\n const className = this.isMenuInsideDropDown ? 'ant-dropdown-menu-item-group' : 'ant-menu-item-group';\n this.renderer.addClass(elementRef.nativeElement, className);\n }\n\n ngAfterViewInit(): void {\n const ulElement = this.titleElement!.nativeElement.nextElementSibling;\n if (ulElement) {\n /** add classname to ul **/\n const className = this.isMenuInsideDropDown ? 'ant-dropdown-menu-item-group-list' : 'ant-menu-item-group-list';\n this.renderer.addClass(ulElement, className);\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, ElementRef } from '@angular/core';\n\n@Directive({\n selector: '[nz-menu-divider]',\n exportAs: 'nzMenuDivider',\n host: {\n class: 'ant-dropdown-menu-item-divider'\n }\n})\nexport class NzMenuDividerDirective {\n constructor(public elementRef: ElementRef) {}\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { NzMenuDividerDirective } from './menu-divider.directive';\nimport { NzMenuGroupComponent } from './menu-group.component';\nimport { NzMenuItemComponent } from './menu-item.component';\nimport { NzMenuDirective } from './menu.directive';\nimport { NzSubmenuInlineChildComponent } from './submenu-inline-child.component';\nimport { NzSubmenuNoneInlineChildComponent } from './submenu-non-inline-child.component';\nimport { NzSubMenuTitleComponent } from './submenu-title.component';\nimport { NzSubMenuComponent } from './submenu.component';\n\n@NgModule({\n imports: [\n NzMenuDirective,\n NzMenuItemComponent,\n NzSubMenuComponent,\n NzMenuDividerDirective,\n NzMenuGroupComponent,\n NzSubMenuTitleComponent,\n NzSubmenuInlineChildComponent,\n NzSubmenuNoneInlineChildComponent\n ],\n exports: [NzMenuDirective, NzMenuItemComponent, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent]\n})\nexport class NzMenuModule {}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport type NzMenuModeType = 'vertical' | 'horizontal' | 'inline';\nexport type NzMenuThemeType = 'light' | 'dark';\nexport type NzSubmenuTrigger = 'hover' | 'click';\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nexport * from './menu.directive';\nexport * from './menu-group.component';\nexport * from './menu-divider.directive';\nexport * from './menu-item.component';\nexport * from './submenu.component';\nexport * from './submenu-title.component';\nexport * from './submenu-inline-child.component';\nexport * from './submenu-non-inline-child.component';\nexport * from './menu.module';\nexport * from './submenu.service';\nexport * from './menu.types';\nexport * from './menu.service';\nexport * from './menu.token';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.MenuService","i2","i3","i1"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;AAGG;MAMU,2BAA2B,GAAG,IAAI,cAAc,CAAU,yBAAyB;MACnF,uBAAuB,GAAG,IAAI,cAAc,CAAc,yBAAyB;;ACVhG;;;AAGG;MAUU,WAAW,CAAA;;AAEtB,IAAA,wBAAwB,GAAG,IAAI,OAAO,EAAa;;AAEnD,IAAA,mBAAmB,GAAG,IAAI,OAAO,EAAa;AAC9C,IAAA,MAAM,GAAG,IAAI,eAAe,CAAkB,OAAO,CAAC;AACtD,IAAA,KAAK,GAAG,IAAI,eAAe,CAAiB,UAAU,CAAC;AACvD,IAAA,aAAa,GAAG,IAAI,eAAe,CAAS,EAAE,CAAC;AAC/C,IAAA,mBAAmB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AAEzD,IAAA,yBAAyB,CAAC,IAAe,EAAA;AACvC,QAAA,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;;AAG1C,IAAA,oBAAoB,CAAC,IAAe,EAAA;AAClC,QAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;;AAGrC,IAAA,OAAO,CAAC,IAAoB,EAAA;AAC1B,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;;AAGvB,IAAA,QAAQ,CAAC,KAAsB,EAAA;AAC7B,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;;AAGzB,IAAA,eAAe,CAAC,MAAc,EAAA;AAC5B,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;;uGA3BtB,WAAW,EAAA,IAAA,EAAA,EAAA,EAA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