@angular-mdc/web
Version:
74 lines (70 loc) • 2.4 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
*/
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
*/
var MdcElevation = /** @class */ (function () {
function MdcElevation(elementRef) {
this.elementRef = elementRef;
this.mdcElevation = 0;
}
/**
* @param {?} changes
* @return {?}
*/
MdcElevation.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
/** @type {?} */
var 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 = function () { return [
{ type: ElementRef }
]; };
MdcElevation.propDecorators = {
mdcElevation: [{ type: Input }]
};
return MdcElevation;
}());
/**
* @fileoverview added by tsickle
* Generated from: elevation/module.ts
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var MdcElevationModule = /** @class */ (function () {
function MdcElevationModule() {
}
MdcElevationModule.decorators = [
{ type: NgModule, args: [{
exports: [MdcElevation],
declarations: [MdcElevation]
},] },
];
return MdcElevationModule;
}());
export { MdcElevation, MdcElevationModule };
//# sourceMappingURL=elevation.es5.js.map