UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

96 lines 9.8 kB
import { Component, HostBinding, Injector, Input } from '@angular/core'; import { CoreBaseComponent } from '../common/base.component'; import * as i0 from "@angular/core"; import * as i1 from "@angular/common"; import * as i2 from "./tile-content.component"; function TileComponent_ng_template_0_Template(rf, ctx) { if (rf & 1) { i0.ɵɵprojection(0); } } function TileComponent_sme_tile_content_2_ng_container_1_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementContainer(0); } } function TileComponent_sme_tile_content_2_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementStart(0, "sme-tile-content", 3); i0.ɵɵtemplate(1, TileComponent_sme_tile_content_2_ng_container_1_Template, 1, 0, "ng-container", 4); i0.ɵɵelementEnd(); } if (rf & 2) { const ctx_r2 = i0.ɵɵnextContext(); const _r0 = i0.ɵɵreference(1); i0.ɵɵproperty("tileHeader", ctx_r2.tileHeader)("tileImageSrc", ctx_r2.tileImageSrc); i0.ɵɵattribute("tabindex", ctx_r2.isFocusable ? 0 : null); i0.ɵɵadvance(1); i0.ɵɵproperty("ngTemplateOutlet", _r0); } } function TileComponent_ng_container_3_ng_container_2_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementContainer(0); } } function TileComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) { i0.ɵɵelementContainerStart(0); i0.ɵɵelementStart(1, "div", 5); i0.ɵɵtemplate(2, TileComponent_ng_container_3_ng_container_2_Template, 1, 0, "ng-container", 4); i0.ɵɵelementEnd(); i0.ɵɵelementContainerEnd(); } if (rf & 2) { const ctx_r3 = i0.ɵɵnextContext(); const _r0 = i0.ɵɵreference(1); i0.ɵɵadvance(1); i0.ɵɵattribute("tabindex", ctx_r3.isFocusable ? 0 : null); i0.ɵɵadvance(1); i0.ɵɵproperty("ngTemplateOutlet", _r0); } } const _c0 = ["*"]; export class TileComponent extends CoreBaseComponent { constructor(injector) { super(injector); /** * If true, sets content to take up 100% the height of the tile */ this.fillTile = false; /** * Determines whether the tile should be tab focusable */ this.isFocusable = true; /** * Determines whether to use the custom template. */ this.customTemplate = false; } get logSourceName() { return 'TileComponent'; } } /** @nocollapse */ TileComponent.ɵfac = function TileComponent_Factory(t) { return new (t || TileComponent)(i0.ɵɵdirectiveInject(i0.Injector)); }; /** @nocollapse */ TileComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TileComponent, selectors: [["sme-tile"]], hostVars: 4, hostBindings: function TileComponent_HostBindings(rf, ctx) { if (rf & 2) { i0.ɵɵclassProp("sme-tile-fill", ctx.fillTile)("sme-tile-focusable", ctx.isFocusable); } }, inputs: { tileHeader: "tileHeader", tileImageSrc: "tileImageSrc", fillTile: "fillTile", isFocusable: "isFocusable", customTemplate: "customTemplate" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0, decls: 4, vars: 2, consts: [["contentTemplate", ""], ["class", "sme-padding-inset-md sme-arrange-stack-h sme-focus-zone", 3, "tileHeader", "tileImageSrc", 4, "ngIf"], [4, "ngIf"], [1, "sme-padding-inset-md", "sme-arrange-stack-h", "sme-focus-zone", 3, "tileHeader", "tileImageSrc"], [4, "ngTemplateOutlet"], [1, "sme-padding-inset-md", "sme-position-stretch", "sme-focus-zone"]], template: function TileComponent_Template(rf, ctx) { if (rf & 1) { i0.ɵɵprojectionDef(); i0.ɵɵtemplate(0, TileComponent_ng_template_0_Template, 1, 0, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor); i0.ɵɵtemplate(2, TileComponent_sme_tile_content_2_Template, 2, 4, "sme-tile-content", 1); i0.ɵɵtemplate(3, TileComponent_ng_container_3_Template, 3, 2, "ng-container", 2); } if (rf & 2) { i0.ɵɵadvance(2); i0.ɵɵproperty("ngIf", !ctx.customTemplate); i0.ɵɵadvance(1); i0.ɵɵproperty("ngIf", ctx.customTemplate); } }, dependencies: [i1.NgIf, i1.NgTemplateOutlet, i2.TileContentComponent], encapsulation: 2 }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TileComponent, [{ type: Component, args: [{ selector: 'sme-tile', template: "<ng-template #contentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n\r\n<sme-tile-content *ngIf=\"!customTemplate\" class=\"sme-padding-inset-md sme-arrange-stack-h sme-focus-zone\"\r\n [attr.tabindex]=\"isFocusable ? 0 : null\" [tileHeader]=\"tileHeader\"\r\n [tileImageSrc]=\"tileImageSrc\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</sme-tile-content>\r\n\r\n<ng-container *ngIf=\"customTemplate\">\r\n <div class=\"sme-padding-inset-md sme-position-stretch sme-focus-zone\" [attr.tabindex]=\"isFocusable ? 0 : null\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n </div>\r\n</ng-container>" }] }], function () { return [{ type: i0.Injector }]; }, { tileHeader: [{ type: Input }], tileImageSrc: [{ type: Input }], fillTile: [{ type: HostBinding, args: ['class.sme-tile-fill'] }, { type: Input }], isFocusable: [{ type: HostBinding, args: ['class.sme-tile-focusable'] }, { type: Input }], customTemplate: [{ type: Input }] }); })(); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGlsZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9hbmd1bGFyL3NyYy9jb250cm9scy90aWxlL3RpbGUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vYW5ndWxhci9zcmMvY29udHJvbHMvdGlsZS90aWxlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsV0FBVyxFQUFFLFFBQVEsRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDeEUsT0FBTyxFQUFFLGlC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