UNPKG

@angular-mdc/web

Version:
134 lines (130 loc) 5.18 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 { Component, ChangeDetectionStrategy, ViewEncapsulation, ElementRef, Input, ViewChild, NgModule } from '@angular/core'; import { MdcFloatingLabel, MdcFloatingLabelModule } from '@angular-mdc/web/floating-label'; import { __extends } from 'tslib'; import { MDCComponent } from '@angular-mdc/web/base'; import { MDCNotchedOutlineFoundation } from '@material/notched-outline'; /** * @fileoverview added by tsickle * Generated from: notched-outline/notched-outline.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var MdcNotchedOutline = /** @class */ (function (_super) { __extends(MdcNotchedOutline, _super); function MdcNotchedOutline(elementRef) { var _this = _super.call(this, elementRef) || this; _this.elementRef = elementRef; return _this; } /** * @return {?} */ MdcNotchedOutline.prototype.getDefaultFoundation = /** * @return {?} */ function () { var _this = this; /** @type {?} */ var adapter = { addClass: (/** * @param {?} className * @return {?} */ function (className) { return _this.elementRef.nativeElement.classList.add(className); }), removeClass: (/** * @param {?} className * @return {?} */ function (className) { return _this.elementRef.nativeElement.classList.remove(className); }), setNotchWidthProperty: (/** * @param {?} width * @return {?} */ function (width) { return _this._notchElement.nativeElement.style.setProperty('width', width + "px"); }), removeNotchWidthProperty: (/** * @return {?} */ function () { return _this._notchElement.nativeElement.style.removeProperty('width'); }) }; return new MDCNotchedOutlineFoundation(adapter); }; /** Updates classes and styles to open the notch to the specified width. */ /** * Updates classes and styles to open the notch to the specified width. * @param {?} notchWidth * @return {?} */ MdcNotchedOutline.prototype.notch = /** * Updates classes and styles to open the notch to the specified width. * @param {?} notchWidth * @return {?} */ function (notchWidth) { this._foundation.notch(notchWidth); }; /** Updates classes and styles to close the notch. */ /** * Updates classes and styles to close the notch. * @return {?} */ MdcNotchedOutline.prototype.closeNotch = /** * Updates classes and styles to close the notch. * @return {?} */ function () { this._foundation.closeNotch(); }; MdcNotchedOutline.decorators = [ { type: Component, args: [{selector: '[mdcNotchedOutline], mdc-notched-outline', exportAs: 'mdcNotchedOutline', host: { 'class': 'mdc-notched-outline', '[class.mdc-notched-outline--upgraded]': 'label', '[class.mdc-notched-outline--no-label]': '!label' }, template: "\n <span class=\"mdc-notched-outline__leading\"></span>\n <span #notch class=\"mdc-notched-outline__notch\">\n <label mdcFloatingLabel [for]=\"for\">{{label}}</label>\n </span>\n <span class=\"mdc-notched-outline__trailing\"></span>\n ", changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None },] }, ]; /** @nocollapse */ MdcNotchedOutline.ctorParameters = function () { return [ { type: ElementRef } ]; }; MdcNotchedOutline.propDecorators = { label: [{ type: Input }], for: [{ type: Input }], _notchElement: [{ type: ViewChild, args: ['notch', { static: false },] }], floatingLabel: [{ type: ViewChild, args: [MdcFloatingLabel, { static: false },] }] }; return MdcNotchedOutline; }(MDCComponent)); /** * @fileoverview added by tsickle * Generated from: notched-outline/module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var MdcNotchedOutlineModule = /** @class */ (function () { function MdcNotchedOutlineModule() { } MdcNotchedOutlineModule.decorators = [ { type: NgModule, args: [{ imports: [MdcFloatingLabelModule], exports: [MdcNotchedOutline], declarations: [MdcNotchedOutline] },] }, ]; return MdcNotchedOutlineModule; }()); export { MdcNotchedOutline, MdcNotchedOutlineModule }; //# sourceMappingURL=notched-outline.es5.js.map