@covalent/core
Version:
Core Teradata UI Platform for layouts, icons, custom components and themes. This should be added as a dependency for any project that wants to use layouts, icons and themes for Angular Material.
148 lines (142 loc) • 9.72 kB
JavaScript
import * as i0 from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, NgModule } from '@angular/core';
import * as i1$1 from '@angular/material/button';
import { MatButtonModule } from '@angular/material/button';
import { MatIcon } from '@angular/material/icon';
import { MatMenuTrigger, MatMenu } from '@angular/material/menu';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2 from '@angular/material/list';
import { MatListModule } from '@angular/material/list';
import { TdMenuComponent } from '@covalent/core/menu';
const _c0$1 = [[["", "td-user-info-list", ""]], [["", "td-user-action-list", ""]]];
const _c1$1 = ["[td-user-info-list]", "[td-user-action-list]"];
function TdUserProfileMenuComponent_mat_list_item_2_span_3_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "span", 7);
i0.ɵɵtext(1);
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r1 = i0.ɵɵnextContext(2);
i0.ɵɵadvance();
i0.ɵɵtextInterpolate(ctx_r1.name);
} }
function TdUserProfileMenuComponent_mat_list_item_2_span_4_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵelementStart(0, "span", 8);
i0.ɵɵtext(1);
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r1 = i0.ɵɵnextContext(2);
i0.ɵɵadvance();
i0.ɵɵtextInterpolate(ctx_r1.email);
} }
function TdUserProfileMenuComponent_mat_list_item_2_Template(rf, ctx) { if (rf & 1) {
const _r1 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "mat-list-item", 3);
i0.ɵɵlistener("click", function TdUserProfileMenuComponent_mat_list_item_2_Template_mat_list_item_click_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1._blockEvent($event)); });
i0.ɵɵelementStart(1, "mat-icon", 4);
i0.ɵɵtext(2, "person");
i0.ɵɵelementEnd();
i0.ɵɵtemplate(3, TdUserProfileMenuComponent_mat_list_item_2_span_3_Template, 2, 1, "span", 5)(4, TdUserProfileMenuComponent_mat_list_item_2_span_4_Template, 2, 1, "span", 6);
i0.ɵɵelementEnd();
} if (rf & 2) {
const ctx_r1 = i0.ɵɵnextContext();
i0.ɵɵadvance(3);
i0.ɵɵproperty("ngIf", ctx_r1.name);
i0.ɵɵadvance();
i0.ɵɵproperty("ngIf", ctx_r1.email);
} }
class TdUserProfileMenuComponent {
email;
name;
_blockEvent(event) {
event.preventDefault();
event.stopPropagation();
}
static ɵfac = function TdUserProfileMenuComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdUserProfileMenuComponent)(); };
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TdUserProfileMenuComponent, selectors: [["td-user-profile-menu"]], inputs: { email: "email", name: "name" }, ngContentSelectors: _c1$1, decls: 6, vars: 1, consts: [[1, "user-profile-menu"], ["td-menu-header", ""], [3, "click", 4, "ngIf"], [3, "click"], ["matListItemAvatar", ""], ["matListItemTitle", "", 4, "ngIf"], ["matListItemLine", "", 4, "ngIf"], ["matListItemTitle", ""], ["matListItemLine", ""]], template: function TdUserProfileMenuComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵprojectionDef(_c0$1);
i0.ɵɵelementStart(0, "td-menu", 0)(1, "mat-list", 1);
i0.ɵɵtemplate(2, TdUserProfileMenuComponent_mat_list_item_2_Template, 5, 2, "mat-list-item", 2);
i0.ɵɵprojection(3);
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "mat-action-list");
i0.ɵɵprojection(5, 1);
i0.ɵɵelementEnd()();
} if (rf & 2) {
i0.ɵɵadvance(2);
i0.ɵɵproperty("ngIf", ctx.name || ctx.email);
} }, dependencies: [CommonModule, i1.NgIf, TdMenuComponent, MatIcon, MatListModule, i2.MatList, i2.MatActionList, i2.MatListItem, i2.MatListItemAvatar, i2.MatListItemLine, i2.MatListItemTitle], styles: [".mat-mdc-list-item-avatar.mdc-list-item__start{line-height:40px;text-align:center;margin:0 16px} .mat-mdc-action-list .mdc-list-item:not(.mdc-list-item--with-leading-avatar){padding-left:72px}"], changeDetection: 0 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdUserProfileMenuComponent, [{
type: Component,
args: [{ selector: 'td-user-profile-menu', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, TdMenuComponent, MatIcon, MatListModule], 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 matListItemTitle *ngIf=\"name\">{{ 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: ["::ng-deep .mat-mdc-list-item-avatar.mdc-list-item__start{line-height:40px;text-align:center;margin:0 16px}::ng-deep .mat-mdc-action-list .mdc-list-item:not(.mdc-list-item--with-leading-avatar){padding-left:72px}\n"] }]
}], null, { email: [{
type: Input
}], name: [{
type: Input
}] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TdUserProfileMenuComponent, { className: "TdUserProfileMenuComponent", filePath: "user-profile-menu/user-profile-menu.component.ts", lineNumber: 14 }); })();
const _c0 = [[["", "td-user-info-list", ""]], [["", "td-user-action-list", ""]]];
const _c1 = ["[td-user-info-list]", "[td-user-action-list]"];
class TdUserProfileComponent {
name;
email;
static ɵfac = function TdUserProfileComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TdUserProfileComponent)(); };
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TdUserProfileComponent, selectors: [["td-user-profile"]], inputs: { name: "name", email: "email" }, ngContentSelectors: _c1, decls: 8, vars: 4, consts: [["accountMenu", "matMenu"], ["mat-icon-button", "", 3, "matMenuTriggerFor"], [3, "overlapTrigger"], [3, "name", "email"]], template: function TdUserProfileComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵprojectionDef(_c0);
i0.ɵɵelementStart(0, "button", 1)(1, "mat-icon");
i0.ɵɵtext(2, "person");
i0.ɵɵelementEnd()();
i0.ɵɵelementStart(3, "mat-menu", 2, 0)(5, "td-user-profile-menu", 3);
i0.ɵɵprojection(6, 0, ["td-user-info-list", ""]);
i0.ɵɵprojection(7, 1, ["td-user-action-list", ""]);
i0.ɵɵelementEnd()();
} if (rf & 2) {
const accountMenu_r1 = i0.ɵɵreference(4);
i0.ɵɵproperty("matMenuTriggerFor", accountMenu_r1);
i0.ɵɵadvance(3);
i0.ɵɵproperty("overlapTrigger", false);
i0.ɵɵadvance(2);
i0.ɵɵproperty("name", ctx.name)("email", ctx.email);
} }, dependencies: [MatMenuTrigger,
MatMenu,
MatIcon,
MatButtonModule, i1$1.MatIconButton, TdUserProfileMenuComponent], encapsulation: 2, changeDetection: 0 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TdUserProfileComponent, [{
type: Component,
args: [{ selector: 'td-user-profile', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
MatMenuTrigger,
MatMenu,
MatIcon,
MatButtonModule,
TdUserProfileMenuComponent,
], 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" }]
}], null, { name: [{
type: Input
}], email: [{
type: Input
}] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TdUserProfileComponent, { className: "TdUserProfileComponent", filePath: "user-profile.component.ts", lineNumber: 19 }); })();
/**
* @deprecated This module is deprecated and will be removed in future versions.
* Please migrate to using standalone components as soon as possible.
*/
class CovalentUserProfileModule {
static ɵfac = function CovalentUserProfileModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CovalentUserProfileModule)(); };
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: CovalentUserProfileModule });
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [TdUserProfileComponent] });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentUserProfileModule, [{
type: NgModule,
args: [{
imports: [TdUserProfileComponent],
exports: [TdUserProfileComponent],
}]
}], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(CovalentUserProfileModule, { imports: [TdUserProfileComponent], exports: [TdUserProfileComponent] }); })();
/**
* Generated bundle index. Do not edit.
*/
export { CovalentUserProfileModule, TdUserProfileComponent, TdUserProfileMenuComponent };
//# sourceMappingURL=covalent-core-user-profile.mjs.map