@angular-mdc/web
Version:
22 lines (20 loc) • 3.77 kB
JavaScript
/**
* @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(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular-mdc/web/base"),require("@material/floating-label")):"function"==typeof define&&define.amd?define("@angular-mdc/web/floating-label",["exports","@angular/core","rxjs","rxjs/operators","@angular-mdc/web/base","@material/floating-label"],e):e(((t=t||self).ng=t.ng||{},t.ng.web=t.ng.web||{},t.ng.web.floatingLabel={}),t.ng.core,t.rxjs,t.rxjs.operators,t.ng.web.base,t.mdc.floatingLabel)}(this,(function(t,e,n,o,r,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 a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var s=function(t){function r(e,o){var r=t.call(this,o)||this;return r._ngZone=e,r.elementRef=o,r._destroy=new n.Subject,r}return function(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(r,t),r.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t._getHostElement().classList.add(e)},removeClass:function(e){return t._getHostElement().classList.remove(e)},getWidth:function(){return t._getHostElement().scrollWidth},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}};return new i.MDCFloatingLabelFoundation(e)},r.prototype.ngAfterContentInit=function(){this._loadListeners()},r.prototype.ngOnDestroy=function(){this._destroy.next(),this._destroy.complete()},r.prototype.getWidth=function(){return this._foundation.getWidth()},r.prototype.shake=function(t){this._foundation.shake(t)},r.prototype.float=function(t){this._foundation.float(t)},r.prototype._loadListeners=function(){var t=this;this._ngZone.runOutsideAngular((function(){return n.fromEvent(t._getHostElement(),"animationend").pipe(o.takeUntil(t._destroy),o.filter((function(e){return e.target===t._getHostElement()}))).subscribe((function(){return t._ngZone.run((function(){return t._getHostElement().classList.remove(i.cssClasses.LABEL_SHAKE)}))}))}))},r.prototype._getHostElement=function(){return this.elementRef.nativeElement},r.decorators=[{type:e.Directive,args:[{selector:"label[mdcFloatingLabel], mdc-floating-label",exportAs:"mdcFloatingLabel",host:{class:"mdc-floating-label","[for]":"for"}}]}],r.ctorParameters=function(){return[{type:e.NgZone},{type:e.ElementRef}]},r.propDecorators={for:[{type:e.Input}]},r}(r.MDCComponent),l=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{exports:[s],declarations:[s]}]}],t}();t.MdcFloatingLabel=s,t.MdcFloatingLabelModule=l,Object.defineProperty(t,"__esModule",{value:!0})}));