UNPKG

@angular2-material/toolbar

Version:
84 lines (82 loc) 4.68 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { NgModule, Component, ChangeDetectionStrategy, Input, ViewEncapsulation, Directive } from '@angular/core'; import { Renderer } from '@angular/core'; import { ElementRef } from '@angular/core'; export var MdToolbarRow = (function () { function MdToolbarRow() { } MdToolbarRow = __decorate([ Directive({ selector: 'md-toolbar-row' }), __metadata('design:paramtypes', []) ], MdToolbarRow); return MdToolbarRow; }()); export var MdToolbar = (function () { function MdToolbar(elementRef, renderer) { this.elementRef = elementRef; this.renderer = renderer; } Object.defineProperty(MdToolbar.prototype, "color", { get: function () { return this._color; }, set: function (value) { this._updateColor(value); }, enumerable: true, configurable: true }); MdToolbar.prototype._updateColor = function (newColor) { this._setElementColor(this._color, false); this._setElementColor(newColor, true); this._color = newColor; }; MdToolbar.prototype._setElementColor = function (color, isAdd) { if (color != null && color != '') { this.renderer.setElementClass(this.elementRef.nativeElement, "md-" + color, isAdd); } }; __decorate([ Input(), __metadata('design:type', String) ], MdToolbar.prototype, "color", null); MdToolbar = __decorate([ Component({selector: 'md-toolbar', template: "<div class=\"md-toolbar-layout\"> <md-toolbar-row> <ng-content></ng-content> </md-toolbar-row> <ng-content select=\"md-toolbar-row\"></ng-content> </div>", styles: ["/** * Mixin that creates a new stacking context. * see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context */ /** * This mixin hides an element visually. * That means it's still accessible for screen-readers but not visible in view. */ /** * Forces an element to grow to fit floated contents; used as as an alternative to * `overflow: hidden;` because it doesn't cut off contents. */ /** * A mixin, which generates temporary ink ripple on a given component. * When $bindToParent is set to true, it will check for the focused class on the same selector as you included * that mixin. * It is also possible to specify the color palette of the temporary ripple. By default it uses the * accent palette for its background. */ md-toolbar { display: flex; box-sizing: border-box; width: 100%; min-height: 64px; font-size: 20px; font-weight: 400; font-family: Roboto, \"Helvetica Neue\", sans-serif; padding: 0 16px; flex-direction: column; background: whitesmoke; color: rgba(0, 0, 0, 0.87); } md-toolbar.md-primary { background: #009688; color: white; } md-toolbar.md-accent { background: #9c27b0; color: rgba(255, 255, 255, 0.870588); } md-toolbar.md-warn { background: #f44336; color: white; } md-toolbar md-toolbar-row { display: flex; box-sizing: border-box; width: 100%; height: 64px; flex-direction: row; align-items: center; } /*# sourceMappingURL=toolbar.css.map */ "], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None }), __metadata('design:paramtypes', [ElementRef, Renderer]) ], MdToolbar); return MdToolbar; }()); export var MdToolbarModule = (function () { function MdToolbarModule() { } MdToolbarModule.forRoot = function () { return { ngModule: MdToolbarModule, providers: [] }; }; MdToolbarModule = __decorate([ NgModule({ exports: [MdToolbar, MdToolbarRow], declarations: [MdToolbar, MdToolbarRow], }), __metadata('design:paramtypes', []) ], MdToolbarModule); return MdToolbarModule; }()); //# sourceMappingURL=toolbar.js.map