@angular-mdc/web
Version:
179 lines (165 loc) • 7.48 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'), require('@angular-mdc/web/floating-label'), require('@angular-mdc/web/base'), require('@material/notched-outline')) :
typeof define === 'function' && define.amd ? define('@angular-mdc/web/notched-outline', ['exports', '@angular/core', '@angular-mdc/web/floating-label', '@angular-mdc/web/base', '@material/notched-outline'], factory) :
(global = global || self, factory((global.ng = global.ng || {}, global.ng.web = global.ng.web || {}, global.ng.web.notchedOutline = {}), global.ng.core, global.ng.web.floatingLabel, global.ng.web.base, global.mdc.notchedOutline));
}(this, (function (exports, core, floatingLabel, base, notchedOutline) { '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.
***************************************************************************** */
/* global Reflect, Promise */
var _extendStatics = function extendStatics(d, b) {
_extendStatics = Object.setPrototypeOf || {
__proto__: []
} instanceof Array && function (d, b) {
d.__proto__ = b;
} || function (d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) d[p] = b[p];
}
};
return _extendStatics(d, b);
};
function __extends(d, b) {
_extendStatics(d, b);
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
/**
* @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 notchedOutline.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: core.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: core.ChangeDetectionStrategy.OnPush,
encapsulation: core.ViewEncapsulation.None
},] },
];
/** @nocollapse */
MdcNotchedOutline.ctorParameters = function () { return [
{ type: core.ElementRef }
]; };
MdcNotchedOutline.propDecorators = {
label: [{ type: core.Input }],
for: [{ type: core.Input }],
_notchElement: [{ type: core.ViewChild, args: ['notch', { static: false },] }],
floatingLabel: [{ type: core.ViewChild, args: [floatingLabel.MdcFloatingLabel, { static: false },] }]
};
return MdcNotchedOutline;
}(base.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: core.NgModule, args: [{
imports: [floatingLabel.MdcFloatingLabelModule],
exports: [MdcNotchedOutline],
declarations: [MdcNotchedOutline]
},] },
];
return MdcNotchedOutlineModule;
}());
exports.MdcNotchedOutline = MdcNotchedOutline;
exports.MdcNotchedOutlineModule = MdcNotchedOutlineModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=web-notched-outline.umd.js.map