ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
818 lines (803 loc) • 29.7 kB
JavaScript
import { __decorate, __metadata } from 'tslib';
import { Platform } from '@angular/cdk/platform';
import { combineLatest, BehaviorSubject, Subject, merge, EMPTY } from 'rxjs';
import { auditTime, distinctUntilChanged, map, tap, takeUntil, flatMap, startWith } from 'rxjs/operators';
import { CdkConnectedOverlay, CdkOverlayOrigin, OverlayModule } from '@angular/cdk/overlay';
import { CommonModule } from '@angular/common';
import { Injectable, Optional, SkipSelf, Directive, ElementRef, Input, Renderer2, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, EventEmitter, Host, Output, ViewChild, ViewEncapsulation, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzMenuBaseService, isNotNil, InputBoolean, NzUpdateHostClassService, collapseMotion, getPlacementName, slideMotion, zoomBigMotion, DEFAULT_SUBMENU_POSITIONS, NzNoAnimationDirective, POSITION_MAP, NzDropdownHigherOrderServiceToken, NzNoAnimationModule } from 'ng-zorro-antd/core';
import { NzIconModule } from 'ng-zorro-antd/icon';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuService extends NzMenuBaseService {
constructor() {
super(...arguments);
this.isInDropDown = false;
}
}
NzMenuService.decorators = [
{ type: Injectable }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSubmenuService {
/**
* @param {?} nzHostSubmenuService
* @param {?} nzMenuService
*/
constructor(nzHostSubmenuService, nzMenuService) {
this.nzHostSubmenuService = nzHostSubmenuService;
this.nzMenuService = nzMenuService;
this.disabled = false;
this.mode = 'vertical';
this.mode$ = this.nzMenuService.mode$.pipe(map((/**
* @param {?} mode
* @return {?}
*/
mode => {
if (mode === 'inline') {
return 'inline';
}
else if (mode === 'vertical' || this.nzHostSubmenuService) {
return 'vertical';
}
else {
return 'horizontal';
}
})), tap((/**
* @param {?} mode
* @return {?}
*/
mode => (this.mode = (/** @type {?} */ (mode))))));
this.level = 1;
this.level$ = new BehaviorSubject(1);
this.subMenuOpen$ = new BehaviorSubject(false);
this.open$ = new BehaviorSubject(false);
this.mouseEnterLeave$ = new Subject();
this.menuOpen$ = combineLatest(this.subMenuOpen$, this.mouseEnterLeave$).pipe(map((/**
* @param {?} value
* @return {?}
*/
value => value[0] || value[1])), auditTime(150), distinctUntilChanged(), tap((/**
* @param {?} data
* @return {?}
*/
data => {
this.setOpenState(data);
if (this.nzHostSubmenuService) {
this.nzHostSubmenuService.subMenuOpen$.next(data);
}
})));
if (this.nzHostSubmenuService) {
this.setLevel(this.nzHostSubmenuService.level + 1);
}
}
/**
* @param {?} value
* @return {?}
*/
setOpenState(value) {
this.open$.next(value);
}
/**
* @return {?}
*/
onMenuItemClick() {
this.setMouseEnterState(false);
}
/**
* @param {?} value
* @return {?}
*/
setLevel(value) {
this.level$.next(value);
this.level = value;
}
/**
* @param {?} value
* @return {?}
*/
setMouseEnterState(value) {
if ((this.mode === 'horizontal' || this.mode === 'vertical' || this.nzMenuService.isInDropDown) && !this.disabled) {
this.mouseEnterLeave$.next(value);
}
}
}
NzSubmenuService.decorators = [
{ type: Injectable }
];
/** @nocollapse */
NzSubmenuService.ctorParameters = () => [
{ type: NzSubmenuService, decorators: [{ type: SkipSelf }, { type: Optional }] },
{ type: NzMenuService }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuItemDirective {
/**
* @param {?} nzUpdateHostClassService
* @param {?} nzMenuService
* @param {?} nzSubmenuService
* @param {?} renderer
* @param {?} elementRef
*/
constructor(nzUpdateHostClassService, nzMenuService, nzSubmenuService, renderer, elementRef) {
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.nzMenuService = nzMenuService;
this.nzSubmenuService = nzSubmenuService;
this.renderer = renderer;
this.elementRef = elementRef;
this.el = this.elementRef.nativeElement;
this.destroy$ = new Subject();
this.originalPadding = null;
this.selected$ = new Subject();
this.nzDisabled = false;
this.nzSelected = false;
}
/**
* clear all item selected status except this
* @param {?} e
* @return {?}
*/
clickMenuItem(e) {
if (this.nzDisabled) {
e.preventDefault();
e.stopPropagation();
return;
}
this.nzMenuService.onMenuItemClick(this);
if (this.nzSubmenuService) {
this.nzSubmenuService.onMenuItemClick();
}
}
/**
* @return {?}
*/
setClassMap() {
/** @type {?} */
const prefixName = this.nzMenuService.isInDropDown ? 'ant-dropdown-menu-item' : 'ant-menu-item';
this.nzUpdateHostClassService.updateHostClass(this.el, {
[`${prefixName}`]: true,
[`${prefixName}-selected`]: this.nzSelected,
[`${prefixName}-disabled`]: this.nzDisabled
});
}
/**
* @param {?} value
* @return {?}
*/
setSelectedState(value) {
this.nzSelected = value;
this.selected$.next(value);
this.setClassMap();
}
/**
* @return {?}
*/
ngOnInit() {
/**
* store origin padding in padding
* @type {?}
*/
const paddingLeft = this.el.style.paddingLeft;
if (paddingLeft) {
this.originalPadding = parseInt(paddingLeft, 10);
}
merge(this.nzMenuService.mode$, this.nzMenuService.inlineIndent$, this.nzSubmenuService ? this.nzSubmenuService.level$ : EMPTY)
.pipe(takeUntil(this.destroy$))
.subscribe((/**
* @return {?}
*/
() => {
/** @type {?} */
let padding = null;
if (this.nzMenuService.mode === 'inline') {
if (isNotNil(this.nzPaddingLeft)) {
padding = this.nzPaddingLeft;
}
else {
/** @type {?} */
const level = this.nzSubmenuService ? this.nzSubmenuService.level + 1 : 1;
padding = level * this.nzMenuService.inlineIndent;
}
}
else {
padding = this.originalPadding;
}
if (padding) {
this.renderer.setStyle(this.el, 'padding-left', `${padding}px`);
}
else {
this.renderer.removeStyle(this.el, 'padding-left');
}
}));
this.setClassMap();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzSelected) {
this.setSelectedState(this.nzSelected);
}
if (changes.nzDisabled) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzMenuItemDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-menu-item]',
exportAs: 'nzMenuItem',
providers: [NzUpdateHostClassService],
host: {
'(click)': 'clickMenuItem($event)'
}
},] }
];
/** @nocollapse */
NzMenuItemDirective.ctorParameters = () => [
{ type: NzUpdateHostClassService },
{ type: NzMenuBaseService },
{ type: NzSubmenuService, decorators: [{ type: Optional }] },
{ type: Renderer2 },
{ type: ElementRef }
];
NzMenuItemDirective.propDecorators = {
nzPaddingLeft: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzSelected: [{ type: Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuItemDirective.prototype, "nzDisabled", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuItemDirective.prototype, "nzSelected", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @param {?} higherOrderService
* @param {?} menuService
* @return {?}
*/
function NzMenuServiceFactory(higherOrderService, menuService) {
return higherOrderService ? higherOrderService : menuService;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzSubMenuComponent {
/**
* @param {?} elementRef
* @param {?} nzMenuService
* @param {?} cdr
* @param {?} nzSubmenuService
* @param {?} nzUpdateHostClassService
* @param {?} platform
* @param {?=} noAnimation
*/
constructor(elementRef, nzMenuService, cdr, nzSubmenuService, nzUpdateHostClassService, platform, noAnimation) {
this.elementRef = elementRef;
this.nzMenuService = nzMenuService;
this.cdr = cdr;
this.nzSubmenuService = nzSubmenuService;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.platform = platform;
this.noAnimation = noAnimation;
this.nzOpen = false;
this.nzDisabled = false;
this.nzOpenChange = new EventEmitter();
this.placement = 'rightTop';
this.expandState = 'collapsed';
this.overlayPositions = [...DEFAULT_SUBMENU_POSITIONS];
this.destroy$ = new Subject();
this.isChildMenuSelected = false;
this.isMouseHover = false;
}
/**
* @param {?} open
* @return {?}
*/
setOpenState(open) {
this.nzSubmenuService.setOpenState(open);
}
/**
* @return {?}
*/
clickSubMenuTitle() {
if (this.nzSubmenuService.mode === 'inline' && !this.nzMenuService.isInDropDown && !this.nzDisabled) {
this.setOpenState(!this.nzOpen);
}
}
/**
* @param {?} value
* @return {?}
*/
setMouseEnterState(value) {
this.isMouseHover = value;
this.setClassMap();
this.nzSubmenuService.setMouseEnterState(value);
}
/**
* @return {?}
*/
setTriggerWidth() {
if (this.nzSubmenuService.mode === 'horizontal' && this.platform.isBrowser) {
this.triggerWidth = this.cdkOverlayOrigin.nativeElement.getBoundingClientRect().width;
}
}
/**
* @param {?} position
* @return {?}
*/
onPositionChange(position) {
this.placement = (/** @type {?} */ (getPlacementName(position)));
this.cdr.markForCheck();
}
/**
* @return {?}
*/
setClassMap() {
/** @type {?} */
const prefixName = this.nzMenuService.isInDropDown ? 'ant-dropdown-menu-submenu' : 'ant-menu-submenu';
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
[`${prefixName}`]: true,
[`${prefixName}-disabled`]: this.nzDisabled,
[`${prefixName}-open`]: this.nzOpen,
[`${prefixName}-selected`]: this.isChildMenuSelected,
[`${prefixName}-${this.nzSubmenuService.mode}`]: true,
[`${prefixName}-active`]: this.isMouseHover && !this.nzDisabled
});
}
/**
* @return {?}
*/
ngOnInit() {
combineLatest(this.nzSubmenuService.mode$, this.nzSubmenuService.open$)
.pipe(takeUntil(this.destroy$))
.subscribe((/**
* @param {?} data
* @return {?}
*/
data => {
/** @type {?} */
const mode = data[0];
/** @type {?} */
const open = data[1];
if (open && mode === 'inline') {
this.expandState = 'expanded';
}
else if (open && mode === 'horizontal') {
this.expandState = 'bottom';
}
else if (open && mode === 'vertical') {
this.expandState = 'active';
}
else {
this.isMouseHover = false;
this.expandState = 'collapsed';
}
this.overlayPositions =
mode === 'horizontal' ? [POSITION_MAP.bottomLeft] : [POSITION_MAP.rightTop, POSITION_MAP.leftTop];
if (open !== this.nzOpen) {
this.nzOpen = open;
this.nzOpenChange.emit(this.nzOpen);
}
this.setClassMap();
this.setTriggerWidth();
}));
this.nzSubmenuService.menuOpen$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} data
* @return {?}
*/
(data) => {
this.nzMenuService.menuOpen$.next(data);
}));
merge(this.nzMenuService.mode$, this.nzMenuService.inlineIndent$, this.nzSubmenuService.level$, this.nzSubmenuService.open$, this.nzSubmenuService.mode$)
.pipe(takeUntil(this.destroy$))
.subscribe((/**
* @return {?}
*/
() => {
this.cdr.markForCheck();
}));
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.setTriggerWidth();
this.listOfNzMenuItemDirective.changes
.pipe(startWith(true), flatMap((/**
* @return {?}
*/
() => merge(this.listOfNzMenuItemDirective.changes, ...this.listOfNzMenuItemDirective.map((/**
* @param {?} menu
* @return {?}
*/
menu => menu.selected$))))), map((/**
* @return {?}
*/
() => this.listOfNzMenuItemDirective.some((/**
* @param {?} e
* @return {?}
*/
e => e.nzSelected)))), takeUntil(this.destroy$))
.subscribe((/**
* @param {?} selected
* @return {?}
*/
selected => {
this.isChildMenuSelected = selected;
this.setClassMap();
}));
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzOpen) {
this.nzSubmenuService.setOpenState(this.nzOpen);
}
if (changes.nzDisabled) {
this.nzSubmenuService.disabled = this.nzDisabled;
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzSubMenuComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-submenu]',
exportAs: 'nzSubmenu',
providers: [NzSubmenuService, NzUpdateHostClassService],
animations: [collapseMotion, zoomBigMotion, slideMotion],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
preserveWhitespaces: false,
template: "<div cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n [class.ant-dropdown-menu-submenu-title]=\"nzMenuService.isInDropDown\"\n [class.ant-menu-submenu-title]=\"!nzMenuService.isInDropDown\"\n [style.paddingLeft.px]=\"nzMenuService.mode === 'inline'? (nzPaddingLeft ? nzPaddingLeft : nzSubmenuService.level * nzMenuService.inlineIndent) : null\"\n (mouseenter)=\"setMouseEnterState(true)\"\n (mouseleave)=\"setMouseEnterState(false)\"\n (click)=\"clickSubMenuTitle()\">\n <ng-content select=\"[title]\"></ng-content>\n <span *ngIf=\"nzMenuService.isInDropDown; else notDropdownTpl\" class=\"ant-dropdown-menu-submenu-arrow\">\n <i nz-icon type=\"right\" class=\"anticon-right ant-dropdown-menu-submenu-arrow-icon\"></i>\n </span>\n <ng-template #notDropdownTpl><i class=\"ant-menu-submenu-arrow\"></i></ng-template>\n</div>\n<ul *ngIf=\"nzMenuService.mode === 'inline'\"\n [@collapseMotion]=\"expandState\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [ngClass]=\"nzMenuClassName\"\n class=\"ant-menu ant-menu-inline ant-menu-sub\">\n <ng-template [ngTemplateOutlet]=\"subMenuTemplate\"></ng-template>\n</ul>\n<ng-template cdkConnectedOverlay\n (positionChange)=\"onPositionChange($event)\"\n [cdkConnectedOverlayPositions]=\"overlayPositions\"\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayWidth]=\"triggerWidth\"\n [cdkConnectedOverlayOpen]=\"nzOpen && nzMenuService.mode !== 'inline'\">\n <div class=\"ant-menu-submenu ant-menu-submenu-popup\"\n [@slideMotion]=\"expandState\"\n [@zoomBigMotion]=\"expandState\"\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [class.ant-menu-light]=\"nzMenuService.theme === 'light'\"\n [class.ant-menu-dark]=\"nzMenuService.theme === 'dark'\"\n [class.ant-menu-submenu-placement-bottomLeft]=\"nzSubmenuService.mode === 'horizontal'\"\n [class.ant-menu-submenu-placement-rightTop]=\"nzSubmenuService.mode === 'vertical' && placement === 'rightTop'\"\n [class.ant-menu-submenu-placement-leftTop]=\"nzSubmenuService.mode === 'vertical' && placement === 'leftTop'\"\n (mouseleave)=\"setMouseEnterState(false)\"\n (mouseenter)=\"setMouseEnterState(true)\">\n <ul [class.ant-dropdown-menu]=\"nzMenuService.isInDropDown\"\n [class.ant-menu]=\"!nzMenuService.isInDropDown\"\n [class.ant-dropdown-menu-vertical]=\"nzMenuService.isInDropDown\"\n [class.ant-menu-vertical]=\"!nzMenuService.isInDropDown\"\n [class.ant-dropdown-menu-sub]=\"nzMenuService.isInDropDown\"\n [class.ant-menu-sub]=\"!nzMenuService.isInDropDown\"\n [ngClass]=\"nzMenuClassName\">\n <ng-template [ngTemplateOutlet]=\"subMenuTemplate\"></ng-template>\n </ul>\n </div>\n</ng-template>\n\n<ng-template #subMenuTemplate>\n <ng-content></ng-content>\n</ng-template>",
styles: [`
.ant-menu-submenu-placement-bottomLeft {
top: 6px;
position: relative;
}
.ant-menu-submenu-placement-rightTop {
left: 4px;
position: relative;
}
.ant-menu-submenu-placement-leftTop {
right: 4px;
position: relative;
}
`]
}] }
];
/** @nocollapse */
NzSubMenuComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: NzMenuBaseService },
{ type: ChangeDetectorRef },
{ type: NzSubmenuService },
{ type: NzUpdateHostClassService },
{ type: Platform },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
];
NzSubMenuComponent.propDecorators = {
nzMenuClassName: [{ type: Input }],
nzPaddingLeft: [{ type: Input }],
nzOpen: [{ type: Input }],
nzDisabled: [{ type: Input }],
nzOpenChange: [{ type: Output }],
cdkConnectedOverlay: [{ type: ViewChild, args: [CdkConnectedOverlay,] }],
cdkOverlayOrigin: [{ type: ViewChild, args: [CdkOverlayOrigin, { read: ElementRef },] }],
listOfNzSubMenuComponent: [{ type: ContentChildren, args: [NzSubMenuComponent, { descendants: true },] }],
listOfNzMenuItemDirective: [{ type: ContentChildren, args: [NzMenuItemDirective, { descendants: true },] }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSubMenuComponent.prototype, "nzOpen", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzSubMenuComponent.prototype, "nzDisabled", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
const ɵ0 = NzMenuServiceFactory;
class NzMenuDirective {
/**
* @param {?} elementRef
* @param {?} nzMenuService
* @param {?} nzUpdateHostClassService
*/
constructor(elementRef, nzMenuService, nzUpdateHostClassService) {
this.elementRef = elementRef;
this.nzMenuService = nzMenuService;
this.nzUpdateHostClassService = nzUpdateHostClassService;
this.destroy$ = new Subject();
this.listOfOpenedNzSubMenuComponent = [];
this.nzInlineIndent = 24;
this.nzTheme = 'light';
this.nzMode = 'vertical';
this.nzInDropDown = false;
this.nzInlineCollapsed = false;
this.nzSelectable = !this.nzMenuService.isInDropDown;
this.nzClick = new EventEmitter();
}
/**
* @return {?}
*/
updateInlineCollapse() {
if (this.listOfNzMenuItemDirective) {
if (this.nzInlineCollapsed) {
this.listOfOpenedNzSubMenuComponent = this.listOfNzSubMenuComponent.filter((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.nzOpen));
this.listOfNzSubMenuComponent.forEach((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.setOpenState(false)));
this.nzMode = 'vertical';
}
else {
this.listOfOpenedNzSubMenuComponent.forEach((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.setOpenState(true)));
this.listOfOpenedNzSubMenuComponent = [];
this.nzMode = this.cacheMode;
}
this.nzMenuService.setMode(this.nzMode);
}
}
/**
* @return {?}
*/
setClassMap() {
/** @type {?} */
const prefixName = this.nzMenuService.isInDropDown ? 'ant-dropdown-menu' : 'ant-menu';
this.nzUpdateHostClassService.updateHostClass(this.elementRef.nativeElement, {
[`${prefixName}`]: true,
[`${prefixName}-root`]: true,
[`${prefixName}-${this.nzTheme}`]: true,
[`${prefixName}-${this.nzMode}`]: true,
[`${prefixName}-inline-collapsed`]: this.nzInlineCollapsed
});
}
/**
* @return {?}
*/
ngOnInit() {
this.setClassMap();
this.nzMenuService.menuItemClick$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} menu
* @return {?}
*/
menu => {
this.nzClick.emit(menu);
if (this.nzSelectable) {
this.listOfNzMenuItemDirective.forEach((/**
* @param {?} item
* @return {?}
*/
item => item.setSelectedState(item === menu)));
}
}));
}
/**
* @return {?}
*/
ngAfterContentInit() {
this.cacheMode = this.nzMode;
this.updateInlineCollapse();
}
/**
* @param {?} changes
* @return {?}
*/
ngOnChanges(changes) {
if (changes.nzInlineCollapsed) {
this.updateInlineCollapse();
}
if (changes.nzInlineIndent) {
this.nzMenuService.setInlineIndent(this.nzInlineIndent);
}
if (changes.nzInDropDown) {
this.nzMenuService.isInDropDown = this.nzInDropDown;
}
if (changes.nzTheme) {
this.nzMenuService.setTheme(this.nzTheme);
}
if (changes.nzMode) {
this.nzMenuService.setMode(this.nzMode);
if (!changes.nzMode.isFirstChange() && this.listOfNzSubMenuComponent) {
this.listOfNzSubMenuComponent.forEach((/**
* @param {?} submenu
* @return {?}
*/
submenu => submenu.setOpenState(false)));
}
}
if (changes.nzTheme || changes.nzMode || changes.nzInlineCollapsed) {
this.setClassMap();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
NzMenuDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-menu]',
exportAs: 'nzMenu',
providers: [
NzUpdateHostClassService,
NzMenuService,
{
provide: NzMenuBaseService,
useFactory: ɵ0,
deps: [[new SkipSelf(), new Optional(), NzDropdownHigherOrderServiceToken], NzMenuService]
}
]
},] }
];
/** @nocollapse */
NzMenuDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: NzMenuBaseService },
{ type: NzUpdateHostClassService }
];
NzMenuDirective.propDecorators = {
listOfNzMenuItemDirective: [{ type: ContentChildren, args: [NzMenuItemDirective, { descendants: true },] }],
listOfNzSubMenuComponent: [{ type: ContentChildren, args: [NzSubMenuComponent, { descendants: true },] }],
nzInlineIndent: [{ type: Input }],
nzTheme: [{ type: Input }],
nzMode: [{ type: Input }],
nzInDropDown: [{ type: Input }],
nzInlineCollapsed: [{ type: Input }],
nzSelectable: [{ type: Input }],
nzClick: [{ type: Output }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuDirective.prototype, "nzInDropDown", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuDirective.prototype, "nzInlineCollapsed", void 0);
__decorate([
InputBoolean(),
__metadata("design:type", Object)
], NzMenuDirective.prototype, "nzSelectable", void 0);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuGroupComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(elementRef.nativeElement, 'ant-menu-item-group');
}
}
NzMenuGroupComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-menu-group]',
exportAs: 'nzMenuGroup',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<div class=\"ant-menu-item-group-title\">\n <ng-content select=\"[title]\"></ng-content>\n</div>\n<ul class=\"ant-menu-item-group-list\">\n <ng-content></ng-content>\n</ul>",
preserveWhitespaces: false
}] }
];
/** @nocollapse */
NzMenuGroupComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuDividerDirective {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.renderer.addClass(elementRef.nativeElement, 'ant-dropdown-menu-item-divider');
}
}
NzMenuDividerDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-menu-divider]',
exportAs: 'nzMenuDivider'
},] }
];
/** @nocollapse */
NzMenuDividerDirective.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class NzMenuModule {
}
NzMenuModule.decorators = [
{ type: NgModule, args: [{
imports: [CommonModule, FormsModule, NzButtonModule, OverlayModule, NzIconModule, NzNoAnimationModule],
declarations: [
NzMenuDirective,
NzMenuItemDirective,
NzSubMenuComponent,
NzMenuDividerDirective,
NzMenuGroupComponent
],
exports: [NzMenuDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuDividerDirective, NzMenuGroupComponent]
},] }
];
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
export { NzMenuDirective, NzMenuGroupComponent, NzMenuDividerDirective, NzMenuItemDirective, NzSubMenuComponent, NzMenuModule, NzMenuService, NzSubmenuService, NzMenuServiceFactory };
//# sourceMappingURL=ng-zorro-antd-menu.js.map