ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 72.6 kB
Source Map (JSON)
{"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.directive.ts","../../components/menu/submenu-title.component.ts","../../components/menu/submenu-inline-child.component.ts","../../components/menu/submenu-non-inline-child.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 { Inject, Injectable, OnDestroy, Optional, SkipSelf } from '@angular/core';\nimport { BehaviorSubject, combineLatest, merge, Observable, Subject } from 'rxjs';\nimport { auditTime, distinctUntilChanged, filter, map, mapTo, 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 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 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 /**\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 @SkipSelf() @Optional() private nzHostSubmenuService: NzSubmenuService,\n public nzMenuService: MenuService,\n @Inject(NzIsMenuInsideDropDownToken) public isMenuInsideDropDown: boolean\n ) {\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 mapTo(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 ChangeDetectorRef,\n ContentChildren,\n Directive,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { NavigationEnd, Router, RouterLink, RouterLinkWithHref } from '@angular/router';\nimport { combineLatest, Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\nimport { MenuService } from './menu.service';\nimport { NzIsMenuInsideDropDownToken } from './menu.token';\nimport { NzSubmenuService } from './submenu.service';\n\n@Directive({\n selector: '[nz-menu-item]',\n exportAs: 'nzMenuItem',\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 NzMenuItemDirective implements OnInit, OnChanges, OnDestroy, AfterContentInit {\n static ngAcceptInputType_nzDisabled: BooleanInput;\n static ngAcceptInputType_nzSelected: BooleanInput;\n static ngAcceptInputType_nzDanger: BooleanInput;\n static ngAcceptInputType_nzMatchRouterExact: BooleanInput;\n static ngAcceptInputType_nzMatchRouter: BooleanInput;\n\n private destroy$ = new Subject();\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() nzPaddingLeft?: number;\n @Input() @InputBoolean() nzDisabled = false;\n @Input() @InputBoolean() nzSelected = false;\n @Input() @InputBoolean() nzDanger = false;\n @Input() @InputBoolean() nzMatchRouterExact = false;\n @Input() @InputBoolean() nzMatchRouter = false;\n @ContentChildren(RouterLink, { descendants: true }) listOfRouterLink!: QueryList<RouterLink>;\n @ContentChildren(RouterLinkWithHref, { descendants: true }) listOfRouterLinkWithHref!: QueryList<RouterLinkWithHref>;\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 (\n !this.listOfRouterLink ||\n !this.listOfRouterLinkWithHref ||\n !this.router ||\n !this.router.navigated ||\n !this.nzMatchRouter\n ) {\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 (\n (this.routerLink && isActiveCheckFn(this.routerLink)) ||\n (this.routerLinkWithHref && isActiveCheckFn(this.routerLinkWithHref)) ||\n this.listOfRouterLink.some(isActiveCheckFn) ||\n this.listOfRouterLinkWithHref.some(isActiveCheckFn)\n );\n }\n\n private isLinkActive(router: Router): (link: RouterLink | RouterLinkWithHref) => boolean {\n return (link: RouterLink | RouterLinkWithHref) =>\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 @Optional() private nzSubmenuService: NzSubmenuService,\n @Inject(NzIsMenuInsideDropDownToken) public isMenuInsideDropDown: boolean,\n @Optional() private directionality: Directionality,\n @Optional() private routerLink?: RouterLink,\n @Optional() private routerLinkWithHref?: RouterLinkWithHref,\n @Optional() private router?: Router\n ) {\n if (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.listOfRouterLinkWithHref.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();\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 ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzMenuModeType } 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 <i nz-icon [nzType]=\"nzIcon\" *ngIf=\"nzIcon\"></i>\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">\n <span>{{ nzTitle }}</span>\n </ng-container>\n <ng-content></ng-content>\n <span\n [ngSwitch]=\"dir\"\n *ngIf=\"isMenuInsideDropDown; else notDropdownTpl\"\n class=\"ant-dropdown-menu-submenu-expand-icon\"\n >\n <i *ngSwitchCase=\"'rtl'\" nz-icon nzType=\"left\" class=\"ant-dropdown-menu-submenu-arrow-icon\"></i>\n <i *ngSwitchDefault nz-icon nzType=\"right\" class=\"ant-dropdown-menu-submenu-arrow-icon\"></i>\n </span>\n <ng-template #notDropdownTpl>\n <i class=\"ant-menu-submenu-arrow\"></i>\n </ng-template>\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})\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 @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(private cdr: ChangeDetectorRef, @Optional() private directionality: Directionality) {}\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) {\n this.subMenuMouseState.next(state);\n }\n }\n clickTitle(): void {\n if (this.mode === 'inline' && !this.nzDisabled) {\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 {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\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})\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 @Optional() 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 {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\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 } 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 [ngClass]=\"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})\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() position = 'right';\n @Input() nzDisabled = false;\n @Input() nzOpen = false;\n @Output() readonly subMenuMouseState = new EventEmitter<boolean>();\n\n constructor(@Optional() private directionality: Directionality) {}\n\n setMouseState(state: boolean): void {\n if (!this.nzDisabled) {\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 { CdkOverlayOrigin, ConnectedOverlayPositionChange } from '@angular/cdk/overlay';\nimport { Platform } from '@angular/cdk/platform';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Host,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\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 } from 'ng-zorro-antd/core/overlay';\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\nimport { NzMenuItemDirective } from './menu-item.directive';\nimport { MenuService } from './menu.service';\nimport { NzIsMenuInsideDropDownToken } from './menu.token';\nimport { NzMenuModeType, NzMenuThemeType } from './menu.types';\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 = [POSITION_MAP.bottomLeft];\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 (subMenuMouseState)=\"setMouseEnterState($event)\"\n (toggleSubMenu)=\"toggleSubMenu()\"\n >\n <ng-content select=\"[title]\" *ngIf=\"!nzTitle\"></ng-content>\n </div>\n <div\n *ngIf=\"mode === 'inline'; else nonInlineTemplate\"\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 <ng-template #nonInlineTemplate>\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 >\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 [templateOutlet]=\"subMenuTemplate\"\n [menuClass]=\"nzMenuClassName\"\n [@.disabled]=\"noAnimation?.nzNoAnimation\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n (subMenuMouseState)=\"setMouseEnterState($event)\"\n ></div>\n </ng-template>\n </ng-template>\n\n <ng-template #subMenuTemplate>\n <ng-content></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})\nexport class NzSubMenuComponent implements OnInit, OnDestroy, AfterContentInit, OnChanges {\n static ngAcceptInputType_nzOpen: BooleanInput;\n static ngAcceptInputType_nzDisabled: BooleanInput;\n\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() @InputBoolean() nzOpen = false;\n @Input() @InputBoolean() nzDisabled = false;\n @Output() readonly nzOpenChange: EventEmitter<boolean> = new EventEmitter();\n @ViewChild(CdkOverlayOrigin, { static: true, read: ElementRef }) cdkOverlayOrigin: ElementRef | null = null;\n @ContentChildren(NzSubMenuComponent, { descendants: true })\n listOfNzSubMenuComponent: QueryList<NzSubMenuComponent> | null = null;\n @ContentChildren(NzMenuItemDirective, { descendants: true })\n listOfNzMenuItemDirective: QueryList<NzMenuItemDirective> | null = null;\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\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 (this.mode === 'horizontal' && this.platform.isBrowser && this.cdkOverlayOrigin) {\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 public nzSubmenuService: NzSubmenuService,\n private platform: Platform,\n @Inject(NzIsMenuInsideDropDownToken) public isMenuInsideDropDown: boolean,\n @Optional() private directionality: Directionality,\n @Host() @Optional() public noAnimation?: NzNoAnimationDirective\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 = 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 Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n SimpleChanges,\n SkipSelf\n} from '@angular/core';\nimport { BehaviorSubject, combineLatest, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { BooleanInput } from 'ng-zorro-antd/core/types';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\n\nimport { NzMenuItemDirective } from './menu-item.directive';\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(\n serviceInsideDropDown: MenuService,\n serviceOutsideDropDown: MenuService\n): MenuService {\n return serviceInsideDropDown ? serviceInsideDropDown : serviceOutsideDropDown;\n}\nexport function MenuDropDownTokenFactory(isMenuInsideDropDownToken: boolean): boolean {\n return isMenuInsideDropDownToken ? 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 deps: [[new SkipSelf(), new Optional(), MenuService], NzMenuServiceLocalToken]\n },\n /** check if menu inside dropdown-menu component **/\n {\n provide: NzIsMenuInsideDropDownToken,\n useFactory: MenuDropDownTokenFactory,\n deps: [[new SkipSelf(), new Optional(), NzIsMenuInsideDropDownToken]]\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 static ngAcceptInputType_nzInlineCollapsed: BooleanInput;\n static ngAcceptInputType_nzSelectable: BooleanInput;\n\n @ContentChildren(NzMenuItemDirective, { descendants: true })\n listOfNzMenuItemDirective!: QueryList<NzMenuItemDirective>;\n @ContentChildren(NzSubMenuComponent, { descendants: true }) listOfNzSubMenuComponent!: QueryList<NzSubMenuComponent>;\n @Input() nzInlineIndent = 24;\n @Input() nzTheme: NzMenuThemeType = 'light';\n @Input() nzMode: NzMenuModeType = 'vertical';\n @Input() @InputBoolean() nzInlineCollapsed = false;\n @Input() @InputBoolean() nzSelectable = !this.isMenuInsideDropDown;\n @Output() readonly nzClick = new EventEmitter<NzMenuItemDirective>();\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();\n private listOfOpenedNzSubMenuComponent: NzSubMenuComponent[] = [];\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 @Inject(NzIsMenuInsideDropDownToken) public isMenuInsideDropDown: boolean,\n private cdr: ChangeDetectorRef,\n @Optional() private directionality: Directionality\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();\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 Optional,\n Renderer2,\n SkipSelf,\n TemplateRef,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { NzIsMenuInsideDropDownToken } from './menu.token';\n\nexport function MenuGroupFactory(isMenuInsideDropDownToken: boolean): boolean {\n return isMenuInsideDropDownToken ? 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 deps: [[new SkipSelf(), new Optional(), NzIsMenuInsideDropDownToken]]\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 <ng-content select=\"[title]\" *ngIf=\"!nzTitle\"></ng-content>\n </div>\n <ng-content></ng-content>\n `,\n preserveWhitespaces: false\n})\nexport class NzMenuGroupComponent implements AfterViewInit {\n @Input() nzTitle?: string | TemplateRef<void>;\n @ViewChild('titleElement') titleElement?: ElementRef;\n\n constructor(\n public elementRef: ElementRef,\n private renderer: Renderer2,\n @Inject(NzIsMenuInsideDropDownToken) public isMenuInsideDropDown: boolean\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, Renderer2 } from '@angular/core';\n\n@Directive({\n selector: '[nz-menu-divider]',\n exportAs: 'nzMenuDivider'\n})\nexport class NzMenuDividerDirective {\n constructor(public elementRef: ElementRef, private renderer: Renderer2) {\n this.renderer.addClass(elementRef.nativeElement, 'ant-dropdown-menu-item-divider');\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 { BidiModule } from '@angular/cdk/bidi';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { PlatformModule } from '@angular/cdk/platform';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport { NzMenuDividerDirective } from './menu-divider.directive';\nimport { NzMenuGroupComponent } from './menu-group.component';\nimport { NzMenuItemDirective } from './menu-item.directive';\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: [BidiModule, CommonModule, PlatformModule, OverlayModule, NzIconModule, NzNoAnimationModule, NzOutletModule],\n declarations: [\n NzMenuDirective,\n NzMenuItemDirective,\n NzSubMenuComponent,\n NzMenuDividerDirective,\n NzMenuGroupComponent,\n NzSubMenuTitleComponent,\n NzSubmenuInlineChildComponent,\n NzSubmenuNoneInlineChildComponent\n ],\n exports: [NzMenuDirective, NzMenuItemDirective, 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';\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.directive';\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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;MASa,2BAA2B,GAAG,IAAI,cAAc,CAAU,yBAAyB,EAAE;MACrF,uBAAuB,GAAG,IAAI,cAAc,CAAc,yBAAyB;;ACVhG;;;;MAaa,WAAW;IADxB;;QAGE,6BAAwB,GAAG,IAAI,OAAO,EAAa,CAAC;;QAEpD,wBAAmB,GAAG,IAAI,OAAO,EAAa,CAAC;QAC/C,WAAM,GAAG,IAAI,eAAe,CAAkB,OAAO,CAAC,CAAC;QACvD,UAAK,GAAG,IAAI,eAAe,CAAiB,UAAU,CAAC,CAAC;QACxD,kBAAa,GAAG,IAAI,eAAe,CAAS,EAAE,CAAC,CAAC;QAChD,wBAAmB,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;KAqB3D;IAnBC,yBAAyB,CAAC,IAAe;QACvC,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC1C;IAED,oBAAoB,CAAC,IAAe;QAClC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACrC;IAED,OAAO,CAAC,IAAoB;QAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACvB;IAED,QAAQ,CAAC,KAAsB;QAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACzB;IAED,eAAe,CAAC,MAAc;QAC5B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KACjC;;wGA5BU,WAAW;4GAAX,WAAW;2FAAX,WAAW;kBADvB,UAAU;;;ACZX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