UNPKG

@angular/material

Version:
22 lines 3.92 kB
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("@angular/material/core"),require("tslib"),require("@angular/cdk/platform"),require("@angular/common")):"function"==typeof define&&define.amd?define("@angular/material/toolbar",["exports","@angular/core","@angular/material/core","tslib","@angular/cdk/platform","@angular/common"],o):o(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.toolbar={}),t.ng.core,t.ng.material.core,t.tslib,t.ng.cdk.platform,t.ng.common)}(this,(function(t,o,e,r,a,n){"use strict"; /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */var l=e.mixinColor((function i(t){this._elementRef=t})),s=function(){function t(){}return t.decorators=[{type:o.Directive,args:[{selector:"mat-toolbar-row",exportAs:"matToolbarRow",host:{class:"mat-toolbar-row"}}]}],t}(),c=function(t){function e(o,e,r){var a=t.call(this,o)||this;return a._platform=e,a._document=r,a}return r.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;o.isDevMode()&&this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe((function(){return t._checkToolbarMixedModes()})))},e.prototype._checkToolbarMixedModes=function(){var t=this;this._toolbarRows.length&&Array.from(this._elementRef.nativeElement.childNodes).filter((function(t){return!(t.classList&&t.classList.contains("mat-toolbar-row"))})).filter((function(o){return o.nodeType!==(t._document?t._document.COMMENT_NODE:8)})).some((function(t){return!(!t.textContent||!t.textContent.trim())}))&&m()},e.decorators=[{type:o.Component,args:[{selector:"mat-toolbar",exportAs:"matToolbar",template:'<ng-content></ng-content>\n<ng-content select="mat-toolbar-row"></ng-content>\n',inputs:["color"],host:{class:"mat-toolbar","[class.mat-toolbar-multiple-rows]":"_toolbarRows.length > 0","[class.mat-toolbar-single-row]":"_toolbarRows.length === 0"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None,styles:[".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}.mat-toolbar-multiple-rows{min-height:64px}.mat-toolbar-row,.mat-toolbar-single-row{height:64px}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:56px}.mat-toolbar-row,.mat-toolbar-single-row{height:56px}}\n"]}]}],e.ctorParameters=function(){return[{type:o.ElementRef},{type:a.Platform},{type:void 0,decorators:[{type:o.Inject,args:[n.DOCUMENT]}]}]},e.propDecorators={_toolbarRows:[{type:o.ContentChildren,args:[s,{descendants:!0}]}]},e}(l);function m(){throw Error("MatToolbar: Attempting to combine different toolbar modes. Either specify multiple `<mat-toolbar-row>` elements explicitly or just place content inside of a `<mat-toolbar>` for a single row.")} /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */var u=function(){function t(){}return t.decorators=[{type:o.NgModule,args:[{imports:[e.MatCommonModule],exports:[c,s,e.MatCommonModule],declarations:[c,s]}]}],t}(); /** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */t.MatToolbar=c,t.MatToolbarModule=u,t.MatToolbarRow=s,t.throwToolbarMixedModesError=m,Object.defineProperty(t,"__esModule",{value:!0})}));