@angular-mdc/web
Version:
83 lines (77 loc) • 3.19 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 (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define('@angular-mdc/web/elevation', ['exports', '@angular/core'], factory) :
(global = global || self, factory((global.ng = global.ng || {}, global.ng.web = global.ng.web || {}, global.ng.web.elevation = {}), global.ng.core));
}(this, (function (exports, core) { 'use strict';
/**
* @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: core.Directive, args: [{
selector: '[mdcElevation]',
exportAs: 'mdcElevation'
},] },
];
/** @nocollapse */
MdcElevation.ctorParameters = function () { return [
{ type: core.ElementRef }
]; };
MdcElevation.propDecorators = {
mdcElevation: [{ type: core.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: core.NgModule, args: [{
exports: [MdcElevation],
declarations: [MdcElevation]
},] },
];
return MdcElevationModule;
}());
exports.MdcElevation = MdcElevation;
exports.MdcElevationModule = MdcElevationModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=web-elevation.umd.js.map