UNPKG

@angular/material

Version:
29 lines (27 loc) 4.81 kB
!function(o,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/material/core"),require("@angular/cdk/platform"),require("@angular/common")):"function"==typeof define&&define.amd?define("@angular/material/toolbar",["exports","@angular/core","@angular/material/core","@angular/cdk/platform","@angular/common"],t):t(((o=o||self).ng=o.ng||{},o.ng.material=o.ng.material||{},o.ng.material.toolbar={}),o.ng.core,o.ng.material.core,o.ng.cdk.platform,o.ng.common)}(this,(function(o,t,e,r,n){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var a=function(o,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])})(o,t)},i=e.mixinColor((function l(o){this._elementRef=o})),s=function(){function o(){}return o.decorators=[{type:t.Directive,args:[{selector:"mat-toolbar-row",exportAs:"matToolbarRow",host:{class:"mat-toolbar-row"}}]}],o}(),c=function(o){function e(t,e,r){var n=o.call(this,t)||this;return n._platform=e,n._document=r,n}return function i(o,t){function e(){this.constructor=o}a(o,t),o.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}(e,o),e.prototype.ngAfterViewInit=function(){var o=this;t.isDevMode()&&this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe((function(){return o._checkToolbarMixedModes()})))},e.prototype._checkToolbarMixedModes=function(){var o=this;this._toolbarRows.length&&Array.from(this._elementRef.nativeElement.childNodes).filter((function(o){return!(o.classList&&o.classList.contains("mat-toolbar-row"))})).filter((function(t){return t.nodeType!==(o._document?o._document.COMMENT_NODE:8)})).some((function(o){return!(!o.textContent||!o.textContent.trim())}))&&m()},e.decorators=[{type:t.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:t.ChangeDetectionStrategy.OnPush,encapsulation:t.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:t.ElementRef},{type:r.Platform},{type:void 0,decorators:[{type:t.Inject,args:[n.DOCUMENT]}]}]},e.propDecorators={_toolbarRows:[{type:t.ContentChildren,args:[s,{descendants:!0}]}]},e}(i);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 o(){}return o.decorators=[{type:t.NgModule,args:[{imports:[e.MatCommonModule],exports:[c,s,e.MatCommonModule],declarations:[c,s]}]}],o}(); /** * @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 */o.MatToolbar=c,o.MatToolbarModule=u,o.MatToolbarRow=s,o.throwToolbarMixedModesError=m,Object.defineProperty(o,"__esModule",{value:!0})}));