UNPKG

@angular-mdc/web

Version:
8 lines 5.59 kB
/** * @license * Copyright (c) Dominic Carretto * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/trimox/angular-mdc-web/blob/master/LICENSE */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/cdk/coercion"),require("@angular-mdc/web/ripple")):"function"==typeof define&&define.amd?define("@angular-mdc/web/card",["exports","@angular/core","@angular/cdk/coercion","@angular-mdc/web/ripple"],t):t(((e=e||self).ng=e.ng||{},e.ng.web=e.ng.web||{},e.ng.web.card={}),e.ng.core,e.ng.cdk.coercion,e.ng.web.ripple)}(this,(function(e,t,n,r){"use strict";var c=function(){function e(e){this.elementRef=e}return e.decorators=[{type:t.Directive,args:[{selector:"mdc-card-media-content, [mdcCardMediaContent]",exportAs:"mdcCardMediaContent",host:{class:"mdc-card__media-content"}}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e}(),o=function(){function e(e){this.elementRef=e,this._square=!1,this._wide=!1}return Object.defineProperty(e.prototype,"square",{get:function(){return this._square},set:function(e){this._square=n.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wide",{get:function(){return this._wide},set:function(e){this._wide=n.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"mdc-card-media, [mdcCardMedia]",exportAs:"mdcCardMedia",host:{class:"mdc-card__media","[class.mdc-card__media--square]":"square","[class.mdc-card__media--16-9]":"wide"},template:"<ng-content></ng-content>",encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={square:[{type:t.Input}],wide:[{type:t.Input}]},e}(),a=function(){function e(e,t){this._ripple=e,this.elementRef=t,this._ripple=new r.MdcRipple(this.elementRef),this._ripple.init()}return e.prototype.ngOnDestroy=function(){this._ripple.destroy()},e.decorators=[{type:t.Component,args:[{selector:"mdc-card-primary-action, [mdcCardPrimaryAction]",exportAs:"mdcCardPrimaryAction",host:{class:"mdc-card__primary-action"},template:"<ng-content></ng-content>",encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush,providers:[r.MdcRipple]}]}],e.ctorParameters=function(){return[{type:r.MdcRipple},{type:t.ElementRef}]},e}(),i=function(){function e(e){this.elementRef=e,this._fullBleed=!1}return Object.defineProperty(e.prototype,"fullBleed",{get:function(){return this._fullBleed},set:function(e){this._fullBleed=n.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"mdc-card-actions, [mdcCardActions]",template:"<ng-content></ng-content>",exportAs:"mdcCardActions",host:{class:"mdc-card__actions","[class.mdc-card__actions--full-bleed]":"fullBleed"},encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={fullBleed:[{type:t.Input}]},e}(),s=function(){function e(e){this.elementRef=e}return e.decorators=[{type:t.Directive,args:[{selector:"mdc-card-action-buttons, [mdcCardActionButtons]",exportAs:"mdcCardActionButtons",host:{class:"mdc-card__action-buttons"}}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e}(),d=function(){function e(e){this.elementRef=e}return e.decorators=[{type:t.Directive,args:[{selector:"mdc-card-action-icons, [mdcCardActionIcons]",exportAs:"mdcCardActionIcons",host:{class:"mdc-card__action-icons"}}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e}(),u=function(){function e(e){this.elementRef=e,this._action=""}return Object.defineProperty(e.prototype,"action",{get:function(){return this._action},set:function(e){e&&("button"===e?(this.elementRef.nativeElement.classList.remove("mdc-card__action--icon"),this.elementRef.nativeElement.classList.add("mdc-card__action--button")):"icon"===e&&(this.elementRef.nativeElement.classList.remove("mdc-card__action--button"),this.elementRef.nativeElement.classList.add("mdc-card__action--icon"),this.elementRef.nativeElement.setAttribute("tabIndex","0"),this.elementRef.nativeElement.setAttribute("role","button")),this._action=e)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Directive,args:[{selector:"[mdcCardAction]",host:{class:"mdc-card__action"}}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={action:[{type:t.Input,args:["mdcCardAction"]}]},e}(),l=function(){function e(e){this.elementRef=e,this._outlined=!1}return Object.defineProperty(e.prototype,"outlined",{get:function(){return this._outlined},set:function(e){this._outlined=n.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"mdc-card",exportAs:"mdcCard",host:{class:"mdc-card","[class.mdc-card--outlined]":"outlined"},template:"<ng-content></ng-content>",encapsulation:t.ViewEncapsulation.None,changeDetection:t.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={outlined:[{type:t.Input}]},e}(),p=[l,u,s,d,i,o,c,a],m=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:p,declarations:p}]}],e}();e.MdcCard=l,e.MdcCardAction=u,e.MdcCardActionButtons=s,e.MdcCardActionIcons=d,e.MdcCardActions=i,e.MdcCardMedia=o,e.MdcCardMediaContent=c,e.MdcCardModule=m,e.MdcCardPrimaryAction=a,Object.defineProperty(e,"__esModule",{value:!0})}));