UNPKG

igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

1 lines 10.1 kB
{"version":3,"file":"igniteui-angular-navbar.mjs","sources":["../../../projects/igniteui-angular/navbar/src/navbar/navbar.component.ts","../../../projects/igniteui-angular/navbar/src/navbar/navbar.component.html","../../../projects/igniteui-angular/navbar/src/navbar/public_api.ts","../../../projects/igniteui-angular/navbar/src/navbar/navbar.module.ts","../../../projects/igniteui-angular/navbar/src/igniteui-angular-navbar.ts"],"sourcesContent":["import {\n Component,\n EventEmitter,\n HostBinding,\n Input,\n Output,\n Directive,\n ContentChild,\n booleanAttribute\n} from '@angular/core';\n\nimport { IgxIconComponent } from 'igniteui-angular/icon';\n\n/**\n * IgxActionIcon is a container for the action nav icon of the IgxNavbar.\n */\n@Directive({\n selector: 'igx-navbar-action,[igxNavbarAction]',\n standalone: true\n})\nexport class IgxNavbarActionDirective { }\n\n@Directive({\n selector: 'igx-navbar-title,[igxNavbarTitle]',\n standalone: true\n})\nexport class IgxNavbarTitleDirective { }\n\nlet NEXT_ID = 0;\n/**\n * **Ignite UI for Angular Navbar** -\n * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/navbar.html)\n *\n * The Ignite UI Navbar is most commonly used to provide an app header with a hamburger menu and navigation\n * state such as a \"Go Back\" button. It also supports other actions represented by icons.\n *\n * Example:\n * ```html\n * <igx-navbar title=\"Sample App\" actionButtonIcon=\"menu\">\n * <igx-icon>search</igx-icon>\n * <igx-icon>favorite</igx-icon>\n * <igx-icon>more_vert</igx-icon>\n * </igx-navbar>\n * ```\n */\n\n@Component({\n selector: 'igx-navbar',\n templateUrl: 'navbar.component.html',\n styles: [`\n :host {\n display: block;\n width: 100%;\n }\n `\n ],\n imports: [IgxIconComponent]\n})\n\nexport class IgxNavbarComponent {\n /**\n * Sets the value of the `id` attribute. If not provided it will be automatically generated.\n * ```html\n * <igx-navbar [id]=\"'igx-navbar-12'\" title=\"Sample App\" actionButtonIcon=\"menu\">\n * ```\n */\n @HostBinding('attr.id')\n @Input()\n public id = `igx-navbar-${NEXT_ID++}`;\n\n /**\n * Sets the icon of the `IgxNavbarComponent`.\n * ```html\n * <igx-navbar [title]=\"currentView\" actionButtonIcon=\"arrow_back\"></igx-navbar>\n * ```\n */\n @Input() public actionButtonIcon: string;\n\n /**\n * Sets the title of the `IgxNavbarComponent`.\n * ```html\n * <igx-navbar title=\"Sample App\" actionButtonIcon=\"menu\">\n * ```\n */\n @Input() public title: string;\n\n /**\n * The event that will be thrown when the action is executed,\n * provides reference to the `IgxNavbar` component as argument\n * ```typescript\n * public actionExc(event){\n * alert(\"Action Execute!\");\n * }\n * //..\n * ```\n * ```html\n * <igx-navbar (action)=\"actionExc($event)\" title=\"Sample App\" actionButtonIcon=\"menu\">\n * ```\n */\n @Output() public action = new EventEmitter<IgxNavbarComponent>();\n\n /**\n * Sets the titleId of the `IgxNavbarComponent`. If not set it will be automatically generated.\n * ```html\n * <igx-navbar [titleId]=\"'igx-navbar-7'\" title=\"Sample App\" actionButtonIcon=\"menu\">\n * ```\n */\n @Input()\n public titleId = `igx-navbar-title-${NEXT_ID++}`;\n\n /**\n * @hidden\n */\n @ContentChild(IgxNavbarActionDirective, { read: IgxNavbarActionDirective })\n protected actionIconTemplate: IgxNavbarActionDirective;\n\n /**\n * @hidden\n */\n @ContentChild(IgxNavbarTitleDirective, { read: IgxNavbarTitleDirective })\n protected titleContent: IgxNavbarTitleDirective;\n\n private isVisible = true;\n\n /**\n * Sets whether the action button of the `IgxNavbarComponent` is visible.\n * ```html\n * <igx-navbar [title]=\"currentView\" [isActionButtonVisible]=\"'false'\"></igx-navbar>\n * ```\n */\n public set isActionButtonVisible(value: boolean) {\n this.isVisible = value;\n }\n\n /**\n * Returns whether the `IgxNavbarComponent` action button is visible, true/false.\n * ```typescript\n * @ViewChild(\"MyChild\")\n * public navBar: IgxNavbarComponent;\n * ngAfterViewInit(){\n * let actionButtonVisibile = this.navBar.isActionButtonVisible;\n * }\n * ```\n */\n @Input({ transform: booleanAttribute })\n public get isActionButtonVisible(): boolean {\n if (this.actionIconTemplate || !this.actionButtonIcon) {\n return false;\n }\n return this.isVisible;\n }\n\n public get isTitleContentVisible(): boolean {\n return this.titleContent ? true : false;\n }\n\n /**\n * @hidden\n */\n public _triggerAction() {\n this.action.emit(this);\n }\n}\n\n","<nav class=\"igx-navbar\" role=\"navigation\" [attr.aria-labelledby]=\"titleId\">\n <div class=\"igx-navbar__left\">\n @if (isActionButtonVisible) {\n <igx-icon (click)=\"_triggerAction()\">\n {{actionButtonIcon}}\n </igx-icon>\n }\n <ng-content select=\"igx-navbar-action, [igxNavbarAction]\"></ng-content>\n </div>\n <div class=\"igx-navbar__middle\">\n @if (!isTitleContentVisible) {\n <h1\n class=\"igx-navbar__title\"\n [attr.id]=\"titleId\">\n {{ title }}\n </h1>\n }\n <ng-content select=\"igx-navbar-title, [igxNavbarTitle]\"></ng-content>\n </div>\n <div class=\"igx-navbar__right\">\n <ng-content></ng-content>\n </div>\n</nav>\n","import { IgxNavbarActionDirective, IgxNavbarComponent, IgxNavbarTitleDirective } from './navbar.component';\n\nexport * from './navbar.component';\n\n/* NOTE: Navbar directives collection for ease-of-use import in standalone components scenario */\nexport const IGX_NAVBAR_DIRECTIVES = [\n IgxNavbarComponent,\n IgxNavbarActionDirective,\n IgxNavbarTitleDirective\n] as const;\n","import { NgModule } from '@angular/core';\nimport { IGX_NAVBAR_DIRECTIVES } from './public_api';\n\n/**\n * @hidden\n * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components\n */\n@NgModule({\n imports: [\n ...IGX_NAVBAR_DIRECTIVES\n ],\n exports: [\n ...IGX_NAVBAR_DIRECTIVES\n ]\n})\n\nexport class IgxNavbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.IgxNavbarComponent","i1.IgxNavbarActionDirective","i1.IgxNavbarTitleDirective"],"mappings":";;;;AAaA;;AAEG;MAKU,wBAAwB,CAAA;8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