UNPKG

9.75 kBJavaScriptView Raw
1import * as i0 from '@angular/core';
2import { Component, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
3import * as i1 from '@angular/common';
4import { CommonModule } from '@angular/common';
5import * as i1$1 from '@angular/material/menu';
6import { MatMenuModule } from '@angular/material/menu';
7import * as i2 from '@angular/material/icon';
8import { MatIconModule } from '@angular/material/icon';
9import * as i3$1 from '@angular/material/button';
10import { MatButtonModule } from '@angular/material/button';
11import * as i3 from '@angular/material/list';
12import { MatListModule } from '@angular/material/list';
13import * as i4 from '@covalent/core/menu';
14import { CovalentMenuModule } from '@covalent/core/menu';
15
16class TdUserProfileMenuComponent {
17 email;
18 name;
19 _blockEvent(event) {
20 event.preventDefault();
21 event.stopPropagation();
22 }
23 static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdUserProfileMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
24 static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdUserProfileMenuComponent, selector: "td-user-profile-menu", inputs: { email: "email", name: "name" }, ngImport: i0, template: "<td-menu class=\"user-profile-menu\">\n <!--header-->\n <mat-list td-menu-header>\n <mat-list-item *ngIf=\"name || email\" (click)=\"_blockEvent($event)\">\n <mat-icon matListItemAvatar>person</mat-icon>\n <span matListItemLine *ngIf=\"name\" class=\"mat-body-1\">{{ name }}</span>\n <span matListItemLine *ngIf=\"email\">{{ email }}</span>\n </mat-list-item>\n <ng-content select=\"[td-user-info-list]\"></ng-content>\n </mat-list>\n <!--content-->\n <mat-action-list>\n <ng-content select=\"[td-user-action-list]\"></ng-content>\n </mat-action-list>\n</td-menu>\n", styles: [".user-profile-menu [td-menu-header]{text-align:left;padding-bottom:0}::ng-deep mat-list-item:not(:first-child) .mat-list-item-content .mat-icon[matListItemAvatar],::ng-deep [mat-list-item] .mat-list-item-content .mat-icon[matListItemAvatar]{background:none}.mat-action-list{padding-top:0}:host ::ng-deep .mat-action-list .mat-divider,:host ::ng-deep .mat-divider{margin:8px 0}:host ::ng-deep mat-divider:last-child{display:none}:host ::ng-deep mat-list .mat-list-item.mat-2-line .mat-list-item-content{height:inherit}:host ::ng-deep mat-list .mat-list-item .mat-list-item-content{padding:8px}td-menu{margin-bottom:0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i3.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i3.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i3.MatListItemAvatar, selector: "[matListItemAvatar]" }, { kind: "directive", type: i3.MatListItemLine, selector: "[matListItemLine]" }, { kind: "component", type: i4.TdMenuComponent, selector: "td-menu" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
25}
26i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdUserProfileMenuComponent, decorators: [{
27 type: Component,
28 args: [{ selector: 'td-user-profile-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<td-menu class=\"user-profile-menu\">\n <!--header-->\n <mat-list td-menu-header>\n <mat-list-item *ngIf=\"name || email\" (click)=\"_blockEvent($event)\">\n <mat-icon matListItemAvatar>person</mat-icon>\n <span matListItemLine *ngIf=\"name\" class=\"mat-body-1\">{{ name }}</span>\n <span matListItemLine *ngIf=\"email\">{{ email }}</span>\n </mat-list-item>\n <ng-content select=\"[td-user-info-list]\"></ng-content>\n </mat-list>\n <!--content-->\n <mat-action-list>\n <ng-content select=\"[td-user-action-list]\"></ng-content>\n </mat-action-list>\n</td-menu>\n", styles: [".user-profile-menu [td-menu-header]{text-align:left;padding-bottom:0}::ng-deep mat-list-item:not(:first-child) .mat-list-item-content .mat-icon[matListItemAvatar],::ng-deep [mat-list-item] .mat-list-item-content .mat-icon[matListItemAvatar]{background:none}.mat-action-list{padding-top:0}:host ::ng-deep .mat-action-list .mat-divider,:host ::ng-deep .mat-divider{margin:8px 0}:host ::ng-deep mat-divider:last-child{display:none}:host ::ng-deep mat-list .mat-list-item.mat-2-line .mat-list-item-content{height:inherit}:host ::ng-deep mat-list .mat-list-item .mat-list-item-content{padding:8px}td-menu{margin-bottom:0}\n"] }]
29 }], propDecorators: { email: [{
30 type: Input
31 }], name: [{
32 type: Input
33 }] } });
34
35class TdUserProfileComponent {
36 name;
37 email;
38 static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdUserProfileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
39 static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdUserProfileComponent, selector: "td-user-profile", inputs: { name: "name", email: "email" }, ngImport: i0, template: "<button mat-icon-button [matMenuTriggerFor]=\"accountMenu\">\n <mat-icon>person</mat-icon>\n</button>\n\n<mat-menu #accountMenu=\"matMenu\" [overlapTrigger]=\"false\">\n <td-user-profile-menu [name]=\"name\" [email]=\"email\">\n <ng-content select=\"[td-user-info-list]\" td-user-info-list></ng-content>\n <ng-content select=\"[td-user-action-list]\" td-user-action-list></ng-content>\n </td-user-profile-menu>\n</mat-menu>\n", dependencies: [{ kind: "component", type: i1$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: TdUserProfileMenuComponent, selector: "td-user-profile-menu", inputs: ["email", "name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
40}
41i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdUserProfileComponent, decorators: [{
42 type: Component,
43 args: [{ selector: 'td-user-profile', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button mat-icon-button [matMenuTriggerFor]=\"accountMenu\">\n <mat-icon>person</mat-icon>\n</button>\n\n<mat-menu #accountMenu=\"matMenu\" [overlapTrigger]=\"false\">\n <td-user-profile-menu [name]=\"name\" [email]=\"email\">\n <ng-content select=\"[td-user-info-list]\" td-user-info-list></ng-content>\n <ng-content select=\"[td-user-action-list]\" td-user-action-list></ng-content>\n </td-user-profile-menu>\n</mat-menu>\n" }]
44 }], propDecorators: { name: [{
45 type: Input
46 }], email: [{
47 type: Input
48 }] } });
49
50class CovalentUserProfileModule {
51 static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentUserProfileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
52 static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.2", ngImport: i0, type: CovalentUserProfileModule, declarations: [TdUserProfileComponent, TdUserProfileMenuComponent], imports: [CommonModule,
53 MatMenuModule,
54 MatIconModule,
55 MatButtonModule,
56 MatListModule,
57 CovalentMenuModule], exports: [TdUserProfileComponent, TdUserProfileMenuComponent] });
58 static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentUserProfileModule, imports: [CommonModule,
59 MatMenuModule,
60 MatIconModule,
61 MatButtonModule,
62 MatListModule,
63 CovalentMenuModule] });
64}
65i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentUserProfileModule, decorators: [{
66 type: NgModule,
67 args: [{
68 declarations: [TdUserProfileComponent, TdUserProfileMenuComponent],
69 imports: [
70 CommonModule,
71 MatMenuModule,
72 MatIconModule,
73 MatButtonModule,
74 MatListModule,
75 CovalentMenuModule,
76 ],
77 providers: [],
78 exports: [TdUserProfileComponent, TdUserProfileMenuComponent],
79 }]
80 }] });
81
82/**
83 * Generated bundle index. Do not edit.
84 */
85
86export { CovalentUserProfileModule, TdUserProfileComponent, TdUserProfileMenuComponent };
87//# sourceMappingURL=covalent-core-user-profile.mjs.map