UNPKG

@angular-mdc/web

Version:
22 lines (20 loc) 3.78 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("rxjs"),require("rxjs/operators"),require("@angular-mdc/web/base"),require("@material/line-ripple")):"function"==typeof define&&define.amd?define("@angular-mdc/web/line-ripple",["exports","@angular/core","rxjs","rxjs/operators","@angular-mdc/web/base","@material/line-ripple"],t):t(((e=e||self).ng=e.ng||{},e.ng.web=e.ng.web||{},e.ng.web.lineRipple={}),e.ng.core,e.rxjs,e.rxjs.operators,e.ng.web.base,e.mdc.lineRipple)}(this,(function(e,t,n,r,o,i){"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 s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var u=function(e){function o(t,r){var o=e.call(this,r)||this;return o._ngZone=t,o.elementRef=r,o._destroy=new n.Subject,o}return function(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(o,e),o.prototype.getDefaultFoundation=function(){var e=this,t={addClass:function(t){return e._getHostElement().classList.add(t)},removeClass:function(t){return e._getHostElement().classList.remove(t)},hasClass:function(t){return e._getHostElement().classList.contains(t)},setStyle:function(t,n){return e._getHostElement().style.setProperty(t,n)},registerEventHandler:function(){},deregisterEventHandler:function(){}};return new i.MDCLineRippleFoundation(t)},o.prototype.ngOnInit=function(){this._loadListeners()},o.prototype.destroy=function(){this._destroy.next(),this._destroy.complete()},o.prototype.ngOnDestroy=function(){this.destroy()},o.prototype.activate=function(){this._foundation.activate()},o.prototype.deactivate=function(){this._foundation.deactivate()},o.prototype.setRippleCenter=function(e){this._foundation.setRippleCenter(e)},o.prototype._loadListeners=function(){var e=this;this._ngZone.runOutsideAngular((function(){return n.fromEvent(e._getHostElement(),"transitionend").pipe(r.takeUntil(e._destroy),r.filter((function(t){return t.target===e._getHostElement()}))).subscribe((function(t){return e._ngZone.run((function(){return e._foundation.handleTransitionEnd(t)}))}))}))},o.prototype._getHostElement=function(){return this.elementRef.nativeElement},o.decorators=[{type:t.Directive,args:[{selector:"[mdcLineRipple], mdc-line-ripple",exportAs:"mdcLineRipple",host:{class:"mdc-line-ripple"}}]}],o.ctorParameters=function(){return[{type:t.NgZone},{type:t.ElementRef}]},o}(o.MDCComponent),a=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{exports:[u],declarations:[u]}]}],e}();e.MdcLineRipple=u,e.MdcLineRippleModule=a,Object.defineProperty(e,"__esModule",{value:!0})}));