UNPKG

@angular-mdc/web

Version:
69 lines (65 loc) 2.08 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 */ import { Directive, ElementRef, Input, NgModule } from '@angular/core'; /** * @fileoverview added by tsickle * Generated from: elevation/elevation.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class MdcElevation { /** * @param {?} elementRef */ constructor(elementRef) { this.elementRef = elementRef; this.mdcElevation = 0; } /** * @param {?} changes * @return {?} */ ngOnChanges(changes) { /** @type {?} */ const change = changes['mdcElevation']; if (change.currentValue < 0 || change.currentValue > 24) { throw new Error(`Valid mdc-elevation values are 0 through 24`); } if (!change.isFirstChange()) { this.elementRef.nativeElement.classList.remove(`mdc-elevation--z${change.previousValue}`); } this.elementRef.nativeElement.classList.add(`mdc-elevation--z${change.currentValue}`); } } MdcElevation.decorators = [ { type: Directive, args: [{ selector: '[mdcElevation]', exportAs: 'mdcElevation' },] }, ]; /** @nocollapse */ MdcElevation.ctorParameters = () => [ { type: ElementRef } ]; MdcElevation.propDecorators = { mdcElevation: [{ type: Input }] }; /** * @fileoverview added by tsickle * Generated from: elevation/module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class MdcElevationModule { } MdcElevationModule.decorators = [ { type: NgModule, args: [{ exports: [MdcElevation], declarations: [MdcElevation] },] }, ]; export { MdcElevation, MdcElevationModule }; //# sourceMappingURL=elevation.js.map