| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081 |
- /**
- * @license
- * Copyright Google LLC All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- */
- (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('@angular/cdk/bidi'), require('@angular/cdk/coercion'), require('@angular/material/core'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/platform'), require('@angular/platform-browser/animations'), require('@angular/common'), require('@angular/cdk/observers')) :
- typeof define === 'function' && define.amd ? define('@angular/material/form-field', ['exports', '@angular/core', '@angular/animations', '@angular/cdk/bidi', '@angular/cdk/coercion', '@angular/material/core', 'rxjs', 'rxjs/operators', '@angular/cdk/platform', '@angular/platform-browser/animations', '@angular/common', '@angular/cdk/observers'], factory) :
- (factory((global.ng = global.ng || {}, global.ng.material = global.ng.material || {}, global.ng.material.formField = {}),global.ng.core,global.ng.animations,global.ng.cdk.bidi,global.ng.cdk.coercion,global.ng.material.core,global.rxjs,global.rxjs.operators,global.ng.cdk.platform,global.ng.platformBrowser.animations,global.ng.common,global.ng.cdk.observers));
- }(this, (function (exports,core,animations,bidi,coercion,core$1,rxjs,operators,platform,animations$1,common,observers) { '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(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
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextUniqueId = 0;
- /**
- * Single error message to be shown underneath the form field.
- */
- var MatError = /** @class */ (function () {
- function MatError() {
- this.id = "mat-error-" + nextUniqueId++;
- }
- MatError.decorators = [
- { type: core.Directive, args: [{
- selector: 'mat-error',
- host: {
- 'class': 'mat-error',
- 'role': 'alert',
- '[attr.id]': 'id',
- }
- },] },
- ];
- MatError.propDecorators = {
- id: [{ type: core.Input }]
- };
- return MatError;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Animations used by the MatFormField.
- * \@docs-private
- * @type {?}
- */
- var matFormFieldAnimations = {
- /**
- * Animation that transitions the form field's error and hint messages.
- */
- transitionMessages: animations.trigger('transitionMessages', [
- // TODO(mmalerba): Use angular animations for label animation as well.
- animations.state('enter', animations.style({ opacity: 1, transform: 'translateY(0%)' })),
- animations.transition('void => enter', [
- animations.style({ opacity: 0, transform: 'translateY(-100%)' }),
- animations.animate('300ms cubic-bezier(0.55, 0, 0.55, 0.2)'),
- ]),
- ])
- };
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * An interface which allows a control to work inside of a `MatFormField`.
- * @abstract
- * @template T
- */
- var /**
- * An interface which allows a control to work inside of a `MatFormField`.
- * @abstract
- * @template T
- */
- MatFormFieldControl = /** @class */ (function () {
- function MatFormFieldControl() {
- }
- return MatFormFieldControl;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * \@docs-private
- * @return {?}
- */
- function getMatFormFieldPlaceholderConflictError() {
- return Error('Placeholder attribute and child element were both specified.');
- }
- /**
- * \@docs-private
- * @param {?} align
- * @return {?}
- */
- function getMatFormFieldDuplicatedHintError(align) {
- return Error("A hint was already declared for 'align=\"" + align + "\"'.");
- }
- /**
- * \@docs-private
- * @return {?}
- */
- function getMatFormFieldMissingControlError() {
- return Error('mat-form-field must contain a MatFormFieldControl.');
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextUniqueId$1 = 0;
- /**
- * Hint text to be shown underneath the form field control.
- */
- var MatHint = /** @class */ (function () {
- function MatHint() {
- /**
- * Whether to align the hint label at the start or end of the line.
- */
- this.align = 'start';
- /**
- * Unique ID for the hint. Used for the aria-describedby on the form field control.
- */
- this.id = "mat-hint-" + nextUniqueId$1++;
- }
- MatHint.decorators = [
- { type: core.Directive, args: [{
- selector: 'mat-hint',
- host: {
- 'class': 'mat-hint',
- '[class.mat-right]': 'align == "end"',
- '[attr.id]': 'id',
- // Remove align attribute to prevent it from interfering with layout.
- '[attr.align]': 'null',
- }
- },] },
- ];
- MatHint.propDecorators = {
- align: [{ type: core.Input }],
- id: [{ type: core.Input }]
- };
- return MatHint;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * The floating label for a `mat-form-field`.
- */
- var MatLabel = /** @class */ (function () {
- function MatLabel() {
- }
- MatLabel.decorators = [
- { type: core.Directive, args: [{
- selector: 'mat-label'
- },] },
- ];
- return MatLabel;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * The placeholder text for an `MatFormField`.
- * @deprecated Use `<mat-label>` to specify the label and the `placeholder` attribute to specify the
- * placeholder.
- * \@breaking-change 8.0.0
- */
- var MatPlaceholder = /** @class */ (function () {
- function MatPlaceholder() {
- }
- MatPlaceholder.decorators = [
- { type: core.Directive, args: [{
- selector: 'mat-placeholder'
- },] },
- ];
- return MatPlaceholder;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Prefix to be placed in front of the form field.
- */
- var MatPrefix = /** @class */ (function () {
- function MatPrefix() {
- }
- MatPrefix.decorators = [
- { type: core.Directive, args: [{
- selector: '[matPrefix]',
- },] },
- ];
- return MatPrefix;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * Suffix to be placed at the end of the form field.
- */
- var MatSuffix = /** @class */ (function () {
- function MatSuffix() {
- }
- MatSuffix.decorators = [
- { type: core.Directive, args: [{
- selector: '[matSuffix]',
- },] },
- ];
- return MatSuffix;
- }());
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /** @type {?} */
- var nextUniqueId$2 = 0;
- /** @type {?} */
- var floatingLabelScale = 0.75;
- /** @type {?} */
- var outlineGapPadding = 5;
- /**
- * Boilerplate for applying mixins to MatFormField.
- * \@docs-private
- */
- var /**
- * Boilerplate for applying mixins to MatFormField.
- * \@docs-private
- */
- MatFormFieldBase = /** @class */ (function () {
- function MatFormFieldBase(_elementRef) {
- this._elementRef = _elementRef;
- }
- return MatFormFieldBase;
- }());
- /**
- * Base class to which we're applying the form field mixins.
- * \@docs-private
- * @type {?}
- */
- var _MatFormFieldMixinBase = core$1.mixinColor(MatFormFieldBase, 'primary');
- /**
- * Injection token that can be used to configure the
- * default options for all form field within an app.
- * @type {?}
- */
- var MAT_FORM_FIELD_DEFAULT_OPTIONS = new core.InjectionToken('MAT_FORM_FIELD_DEFAULT_OPTIONS');
- /**
- * Container for form controls that applies Material Design styling and behavior.
- */
- var MatFormField = /** @class */ (function (_super) {
- __extends(MatFormField, _super);
- function MatFormField(_elementRef, _changeDetectorRef, labelOptions, _dir, _defaults, _platform, _ngZone, _animationMode) {
- var _this = _super.call(this, _elementRef) || this;
- _this._elementRef = _elementRef;
- _this._changeDetectorRef = _changeDetectorRef;
- _this._dir = _dir;
- _this._defaults = _defaults;
- _this._platform = _platform;
- _this._ngZone = _ngZone;
- /**
- * Whether the outline gap needs to be calculated
- * immediately on the next change detection run.
- */
- _this._outlineGapCalculationNeededImmediately = false;
- /**
- * Whether the outline gap needs to be calculated next time the zone has stabilized.
- */
- _this._outlineGapCalculationNeededOnStable = false;
- _this._destroyed = new rxjs.Subject();
- /**
- * Override for the logic that disables the label animation in certain cases.
- */
- _this._showAlwaysAnimate = false;
- /**
- * State of the mat-hint and mat-error animations.
- */
- _this._subscriptAnimationState = '';
- _this._hintLabel = '';
- // Unique id for the hint label.
- _this._hintLabelId = "mat-hint-" + nextUniqueId$2++;
- // Unique id for the internal form field label.
- _this._labelId = "mat-form-field-label-" + nextUniqueId$2++;
- _this._labelOptions = labelOptions ? labelOptions : {};
- _this.floatLabel = _this._labelOptions.float || 'auto';
- _this._animationsEnabled = _animationMode !== 'NoopAnimations';
- // Set the default through here so we invoke the setter on the first run.
- _this.appearance = (_defaults && _defaults.appearance) ? _defaults.appearance : 'legacy';
- return _this;
- }
- Object.defineProperty(MatFormField.prototype, "appearance", {
- /** The form-field appearance style. */
- get: /**
- * The form-field appearance style.
- * @return {?}
- */
- function () { return this._appearance; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- /** @type {?} */
- var oldValue = this._appearance;
- this._appearance = value || (this._defaults && this._defaults.appearance) || 'legacy';
- if (this._appearance === 'outline' && oldValue !== value) {
- this._outlineGapCalculationNeededOnStable = true;
- }
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatFormField.prototype, "hideRequiredMarker", {
- /** Whether the required marker should be hidden. */
- get: /**
- * Whether the required marker should be hidden.
- * @return {?}
- */
- function () { return this._hideRequiredMarker; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._hideRequiredMarker = coercion.coerceBooleanProperty(value);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatFormField.prototype, "_shouldAlwaysFloat", {
- /** Whether the floating label should always float or not. */
- get: /**
- * Whether the floating label should always float or not.
- * @return {?}
- */
- function () {
- return this.floatLabel === 'always' && !this._showAlwaysAnimate;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatFormField.prototype, "_canLabelFloat", {
- /** Whether the label can float or not. */
- get: /**
- * Whether the label can float or not.
- * @return {?}
- */
- function () { return this.floatLabel !== 'never'; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatFormField.prototype, "hintLabel", {
- /** Text for the form field hint. */
- get: /**
- * Text for the form field hint.
- * @return {?}
- */
- function () { return this._hintLabel; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._hintLabel = value;
- this._processHints();
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatFormField.prototype, "floatLabel", {
- /**
- * Whether the label should always float, never float or float as the user types.
- *
- * Note: only the legacy appearance supports the `never` option. `never` was originally added as a
- * way to make the floating label emulate the behavior of a standard input placeholder. However
- * the form field now supports both floating labels and placeholders. Therefore in the non-legacy
- * appearances the `never` option has been disabled in favor of just using the placeholder.
- */
- get: /**
- * Whether the label should always float, never float or float as the user types.
- *
- * Note: only the legacy appearance supports the `never` option. `never` was originally added as a
- * way to make the floating label emulate the behavior of a standard input placeholder. However
- * the form field now supports both floating labels and placeholders. Therefore in the non-legacy
- * appearances the `never` option has been disabled in favor of just using the placeholder.
- * @return {?}
- */
- function () {
- return this.appearance !== 'legacy' && this._floatLabel === 'never' ? 'auto' : this._floatLabel;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- if (value !== this._floatLabel) {
- this._floatLabel = value || this._labelOptions.float || 'auto';
- this._changeDetectorRef.markForCheck();
- }
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatFormField.prototype, "_control", {
- get: /**
- * @return {?}
- */
- function () {
- // TODO(crisbeto): we need this hacky workaround in order to support both Ivy
- // and ViewEngine. We should clean this up once Ivy is the default renderer.
- return this._explicitFormFieldControl || this._controlNonStatic || this._controlStatic;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._explicitFormFieldControl = value;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatFormField.prototype, "_labelChild", {
- get: /**
- * @return {?}
- */
- function () {
- return this._labelChildNonStatic || this._labelChildStatic;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Gets an ElementRef for the element that a overlay attached to the form-field should be
- * positioned relative to.
- */
- /**
- * Gets an ElementRef for the element that a overlay attached to the form-field should be
- * positioned relative to.
- * @return {?}
- */
- MatFormField.prototype.getConnectedOverlayOrigin = /**
- * Gets an ElementRef for the element that a overlay attached to the form-field should be
- * positioned relative to.
- * @return {?}
- */
- function () {
- return this._connectionContainerRef || this._elementRef;
- };
- /**
- * @return {?}
- */
- MatFormField.prototype.ngAfterContentInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- this._validateControlChild();
- /** @type {?} */
- var control = this._control;
- if (control.controlType) {
- this._elementRef.nativeElement.classList.add("mat-form-field-type-" + control.controlType);
- }
- // Subscribe to changes in the child control state in order to update the form field UI.
- control.stateChanges.pipe(operators.startWith((/** @type {?} */ (null)))).subscribe((/**
- * @return {?}
- */
- function () {
- _this._validatePlaceholders();
- _this._syncDescribedByIds();
- _this._changeDetectorRef.markForCheck();
- }));
- // Run change detection if the value changes.
- if (control.ngControl && control.ngControl.valueChanges) {
- control.ngControl.valueChanges
- .pipe(operators.takeUntil(this._destroyed))
- .subscribe((/**
- * @return {?}
- */
- function () { return _this._changeDetectorRef.markForCheck(); }));
- }
- // Note that we have to run outside of the `NgZone` explicitly,
- // in order to avoid throwing users into an infinite loop
- // if `zone-patch-rxjs` is included.
- this._ngZone.runOutsideAngular((/**
- * @return {?}
- */
- function () {
- _this._ngZone.onStable.asObservable().pipe(operators.takeUntil(_this._destroyed)).subscribe((/**
- * @return {?}
- */
- function () {
- if (_this._outlineGapCalculationNeededOnStable) {
- _this.updateOutlineGap();
- }
- }));
- }));
- // Run change detection and update the outline if the suffix or prefix changes.
- rxjs.merge(this._prefixChildren.changes, this._suffixChildren.changes).subscribe((/**
- * @return {?}
- */
- function () {
- _this._outlineGapCalculationNeededOnStable = true;
- _this._changeDetectorRef.markForCheck();
- }));
- // Re-validate when the number of hints changes.
- this._hintChildren.changes.pipe(operators.startWith(null)).subscribe((/**
- * @return {?}
- */
- function () {
- _this._processHints();
- _this._changeDetectorRef.markForCheck();
- }));
- // Update the aria-described by when the number of errors changes.
- this._errorChildren.changes.pipe(operators.startWith(null)).subscribe((/**
- * @return {?}
- */
- function () {
- _this._syncDescribedByIds();
- _this._changeDetectorRef.markForCheck();
- }));
- if (this._dir) {
- this._dir.change.pipe(operators.takeUntil(this._destroyed)).subscribe((/**
- * @return {?}
- */
- function () { return _this.updateOutlineGap(); }));
- }
- };
- /**
- * @return {?}
- */
- MatFormField.prototype.ngAfterContentChecked = /**
- * @return {?}
- */
- function () {
- this._validateControlChild();
- if (this._outlineGapCalculationNeededImmediately) {
- this.updateOutlineGap();
- }
- };
- /**
- * @return {?}
- */
- MatFormField.prototype.ngAfterViewInit = /**
- * @return {?}
- */
- function () {
- // Avoid animations on load.
- this._subscriptAnimationState = 'enter';
- this._changeDetectorRef.detectChanges();
- };
- /**
- * @return {?}
- */
- MatFormField.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this._destroyed.next();
- this._destroyed.complete();
- };
- /** Determines whether a class from the NgControl should be forwarded to the host element. */
- /**
- * Determines whether a class from the NgControl should be forwarded to the host element.
- * @param {?} prop
- * @return {?}
- */
- MatFormField.prototype._shouldForward = /**
- * Determines whether a class from the NgControl should be forwarded to the host element.
- * @param {?} prop
- * @return {?}
- */
- function (prop) {
- /** @type {?} */
- var ngControl = this._control ? this._control.ngControl : null;
- return ngControl && ngControl[prop];
- };
- /**
- * @return {?}
- */
- MatFormField.prototype._hasPlaceholder = /**
- * @return {?}
- */
- function () {
- return !!(this._control && this._control.placeholder || this._placeholderChild);
- };
- /**
- * @return {?}
- */
- MatFormField.prototype._hasLabel = /**
- * @return {?}
- */
- function () {
- return !!this._labelChild;
- };
- /**
- * @return {?}
- */
- MatFormField.prototype._shouldLabelFloat = /**
- * @return {?}
- */
- function () {
- return this._canLabelFloat && (this._control.shouldLabelFloat || this._shouldAlwaysFloat);
- };
- /**
- * @return {?}
- */
- MatFormField.prototype._hideControlPlaceholder = /**
- * @return {?}
- */
- function () {
- // In the legacy appearance the placeholder is promoted to a label if no label is given.
- return this.appearance === 'legacy' && !this._hasLabel() ||
- this._hasLabel() && !this._shouldLabelFloat();
- };
- /**
- * @return {?}
- */
- MatFormField.prototype._hasFloatingLabel = /**
- * @return {?}
- */
- function () {
- // In the legacy appearance the placeholder is promoted to a label if no label is given.
- return this._hasLabel() || this.appearance === 'legacy' && this._hasPlaceholder();
- };
- /** Determines whether to display hints or errors. */
- /**
- * Determines whether to display hints or errors.
- * @return {?}
- */
- MatFormField.prototype._getDisplayedMessages = /**
- * Determines whether to display hints or errors.
- * @return {?}
- */
- function () {
- return (this._errorChildren && this._errorChildren.length > 0 &&
- this._control.errorState) ? 'error' : 'hint';
- };
- /** Animates the placeholder up and locks it in position. */
- /**
- * Animates the placeholder up and locks it in position.
- * @return {?}
- */
- MatFormField.prototype._animateAndLockLabel = /**
- * Animates the placeholder up and locks it in position.
- * @return {?}
- */
- function () {
- var _this = this;
- if (this._hasFloatingLabel() && this._canLabelFloat) {
- // If animations are disabled, we shouldn't go in here,
- // because the `transitionend` will never fire.
- if (this._animationsEnabled) {
- this._showAlwaysAnimate = true;
- rxjs.fromEvent(this._label.nativeElement, 'transitionend').pipe(operators.take(1)).subscribe((/**
- * @return {?}
- */
- function () {
- _this._showAlwaysAnimate = false;
- }));
- }
- this.floatLabel = 'always';
- this._changeDetectorRef.markForCheck();
- }
- };
- /**
- * Ensure that there is only one placeholder (either `placeholder` attribute on the child control
- * or child element with the `mat-placeholder` directive).
- */
- /**
- * Ensure that there is only one placeholder (either `placeholder` attribute on the child control
- * or child element with the `mat-placeholder` directive).
- * @private
- * @return {?}
- */
- MatFormField.prototype._validatePlaceholders = /**
- * Ensure that there is only one placeholder (either `placeholder` attribute on the child control
- * or child element with the `mat-placeholder` directive).
- * @private
- * @return {?}
- */
- function () {
- if (this._control.placeholder && this._placeholderChild) {
- throw getMatFormFieldPlaceholderConflictError();
- }
- };
- /** Does any extra processing that is required when handling the hints. */
- /**
- * Does any extra processing that is required when handling the hints.
- * @private
- * @return {?}
- */
- MatFormField.prototype._processHints = /**
- * Does any extra processing that is required when handling the hints.
- * @private
- * @return {?}
- */
- function () {
- this._validateHints();
- this._syncDescribedByIds();
- };
- /**
- * Ensure that there is a maximum of one of each `<mat-hint>` alignment specified, with the
- * attribute being considered as `align="start"`.
- */
- /**
- * Ensure that there is a maximum of one of each `<mat-hint>` alignment specified, with the
- * attribute being considered as `align="start"`.
- * @private
- * @return {?}
- */
- MatFormField.prototype._validateHints = /**
- * Ensure that there is a maximum of one of each `<mat-hint>` alignment specified, with the
- * attribute being considered as `align="start"`.
- * @private
- * @return {?}
- */
- function () {
- var _this = this;
- if (this._hintChildren) {
- /** @type {?} */
- var startHint_1;
- /** @type {?} */
- var endHint_1;
- this._hintChildren.forEach((/**
- * @param {?} hint
- * @return {?}
- */
- function (hint) {
- if (hint.align === 'start') {
- if (startHint_1 || _this.hintLabel) {
- throw getMatFormFieldDuplicatedHintError('start');
- }
- startHint_1 = hint;
- }
- else if (hint.align === 'end') {
- if (endHint_1) {
- throw getMatFormFieldDuplicatedHintError('end');
- }
- endHint_1 = hint;
- }
- }));
- }
- };
- /**
- * Sets the list of element IDs that describe the child control. This allows the control to update
- * its `aria-describedby` attribute accordingly.
- */
- /**
- * Sets the list of element IDs that describe the child control. This allows the control to update
- * its `aria-describedby` attribute accordingly.
- * @private
- * @return {?}
- */
- MatFormField.prototype._syncDescribedByIds = /**
- * Sets the list of element IDs that describe the child control. This allows the control to update
- * its `aria-describedby` attribute accordingly.
- * @private
- * @return {?}
- */
- function () {
- if (this._control) {
- /** @type {?} */
- var ids = [];
- if (this._getDisplayedMessages() === 'hint') {
- /** @type {?} */
- var startHint = this._hintChildren ?
- this._hintChildren.find((/**
- * @param {?} hint
- * @return {?}
- */
- function (hint) { return hint.align === 'start'; })) : null;
- /** @type {?} */
- var endHint = this._hintChildren ?
- this._hintChildren.find((/**
- * @param {?} hint
- * @return {?}
- */
- function (hint) { return hint.align === 'end'; })) : null;
- if (startHint) {
- ids.push(startHint.id);
- }
- else if (this._hintLabel) {
- ids.push(this._hintLabelId);
- }
- if (endHint) {
- ids.push(endHint.id);
- }
- }
- else if (this._errorChildren) {
- ids = this._errorChildren.map((/**
- * @param {?} error
- * @return {?}
- */
- function (error) { return error.id; }));
- }
- this._control.setDescribedByIds(ids);
- }
- };
- /** Throws an error if the form field's control is missing. */
- /**
- * Throws an error if the form field's control is missing.
- * @protected
- * @return {?}
- */
- MatFormField.prototype._validateControlChild = /**
- * Throws an error if the form field's control is missing.
- * @protected
- * @return {?}
- */
- function () {
- if (!this._control) {
- throw getMatFormFieldMissingControlError();
- }
- };
- /**
- * Updates the width and position of the gap in the outline. Only relevant for the outline
- * appearance.
- */
- /**
- * Updates the width and position of the gap in the outline. Only relevant for the outline
- * appearance.
- * @return {?}
- */
- MatFormField.prototype.updateOutlineGap = /**
- * Updates the width and position of the gap in the outline. Only relevant for the outline
- * appearance.
- * @return {?}
- */
- function () {
- /** @type {?} */
- var labelEl = this._label ? this._label.nativeElement : null;
- if (this.appearance !== 'outline' || !labelEl || !labelEl.children.length ||
- !labelEl.textContent.trim()) {
- return;
- }
- if (!this._platform.isBrowser) {
- // getBoundingClientRect isn't available on the server.
- return;
- }
- // If the element is not present in the DOM, the outline gap will need to be calculated
- // the next time it is checked and in the DOM.
- if (!(/** @type {?} */ (document.documentElement)).contains(this._elementRef.nativeElement)) {
- this._outlineGapCalculationNeededImmediately = true;
- return;
- }
- /** @type {?} */
- var startWidth = 0;
- /** @type {?} */
- var gapWidth = 0;
- /** @type {?} */
- var container = this._connectionContainerRef.nativeElement;
- /** @type {?} */
- var startEls = container.querySelectorAll('.mat-form-field-outline-start');
- /** @type {?} */
- var gapEls = container.querySelectorAll('.mat-form-field-outline-gap');
- if (this._label && this._label.nativeElement.children.length) {
- /** @type {?} */
- var containerRect = container.getBoundingClientRect();
- // If the container's width and height are zero, it means that the element is
- // invisible and we can't calculate the outline gap. Mark the element as needing
- // to be checked the next time the zone stabilizes. We can't do this immediately
- // on the next change detection, because even if the element becomes visible,
- // the `ClientRect` won't be reclaculated immediately. We reset the
- // `_outlineGapCalculationNeededImmediately` flag some we don't run the checks twice.
- if (containerRect.width === 0 && containerRect.height === 0) {
- this._outlineGapCalculationNeededOnStable = true;
- this._outlineGapCalculationNeededImmediately = false;
- return;
- }
- /** @type {?} */
- var containerStart = this._getStartEnd(containerRect);
- /** @type {?} */
- var labelStart = this._getStartEnd(labelEl.children[0].getBoundingClientRect());
- /** @type {?} */
- var labelWidth = 0;
- for (var _i = 0, _a = labelEl.children; _i < _a.length; _i++) {
- var child = _a[_i];
- labelWidth += child.offsetWidth;
- }
- startWidth = labelStart - containerStart - outlineGapPadding;
- gapWidth = labelWidth > 0 ? labelWidth * floatingLabelScale + outlineGapPadding * 2 : 0;
- }
- for (var i = 0; i < startEls.length; i++) {
- startEls.item(i).style.width = startWidth + "px";
- }
- for (var i = 0; i < gapEls.length; i++) {
- gapEls.item(i).style.width = gapWidth + "px";
- }
- this._outlineGapCalculationNeededOnStable =
- this._outlineGapCalculationNeededImmediately = false;
- };
- /** Gets the start end of the rect considering the current directionality. */
- /**
- * Gets the start end of the rect considering the current directionality.
- * @private
- * @param {?} rect
- * @return {?}
- */
- MatFormField.prototype._getStartEnd = /**
- * Gets the start end of the rect considering the current directionality.
- * @private
- * @param {?} rect
- * @return {?}
- */
- function (rect) {
- return this._dir && this._dir.value === 'rtl' ? rect.right : rect.left;
- };
- MatFormField.decorators = [
- { type: core.Component, args: [{selector: 'mat-form-field',
- exportAs: 'matFormField',
- template: "<div class=\"mat-form-field-wrapper\"><div class=\"mat-form-field-flex\" #connectionContainer (click)=\"_control.onContainerClick && _control.onContainerClick($event)\"><ng-container *ngIf=\"appearance == 'outline'\"><div class=\"mat-form-field-outline\"><div class=\"mat-form-field-outline-start\"></div><div class=\"mat-form-field-outline-gap\"></div><div class=\"mat-form-field-outline-end\"></div></div><div class=\"mat-form-field-outline mat-form-field-outline-thick\"><div class=\"mat-form-field-outline-start\"></div><div class=\"mat-form-field-outline-gap\"></div><div class=\"mat-form-field-outline-end\"></div></div></ng-container><div class=\"mat-form-field-prefix\" *ngIf=\"_prefixChildren.length\"><ng-content select=\"[matPrefix]\"></ng-content></div><div class=\"mat-form-field-infix\" #inputContainer><ng-content></ng-content><span class=\"mat-form-field-label-wrapper\"><label class=\"mat-form-field-label\" (cdkObserveContent)=\"updateOutlineGap()\" [cdkObserveContentDisabled]=\"appearance != 'outline'\" [id]=\"_labelId\" [attr.for]=\"_control.id\" [attr.aria-owns]=\"_control.id\" [class.mat-empty]=\"_control.empty && !_shouldAlwaysFloat\" [class.mat-form-field-empty]=\"_control.empty && !_shouldAlwaysFloat\" [class.mat-accent]=\"color == 'accent'\" [class.mat-warn]=\"color == 'warn'\" #label *ngIf=\"_hasFloatingLabel()\" [ngSwitch]=\"_hasLabel()\"><ng-container *ngSwitchCase=\"false\"><ng-content select=\"mat-placeholder\"></ng-content><span>{{_control.placeholder}}</span></ng-container><ng-content select=\"mat-label\" *ngSwitchCase=\"true\"></ng-content><span class=\"mat-placeholder-required mat-form-field-required-marker\" aria-hidden=\"true\" *ngIf=\"!hideRequiredMarker && _control.required && !_control.disabled\"> *</span></label></span></div><div class=\"mat-form-field-suffix\" *ngIf=\"_suffixChildren.length\"><ng-content select=\"[matSuffix]\"></ng-content></div></div><div class=\"mat-form-field-underline\" #underline *ngIf=\"appearance != 'outline'\"><span class=\"mat-form-field-ripple\" [class.mat-accent]=\"color == 'accent'\" [class.mat-warn]=\"color == 'warn'\"></span></div><div class=\"mat-form-field-subscript-wrapper\" [ngSwitch]=\"_getDisplayedMessages()\"><div *ngSwitchCase=\"'error'\" [@transitionMessages]=\"_subscriptAnimationState\"><ng-content select=\"mat-error\"></ng-content></div><div class=\"mat-form-field-hint-wrapper\" *ngSwitchCase=\"'hint'\" [@transitionMessages]=\"_subscriptAnimationState\"><div *ngIf=\"hintLabel\" [id]=\"_hintLabelId\" class=\"mat-hint\">{{hintLabel}}</div><ng-content select=\"mat-hint:not([align='end'])\"></ng-content><div class=\"mat-form-field-hint-spacer\"></div><ng-content select=\"mat-hint[align='end']\"></ng-content></div></div></div>",
- // MatInput is a directive and can't have styles, so we need to include its styles here
- // in form-field-input.css. The MatInput styles are fairly minimal so it shouldn't be a
- // big deal for people who aren't using MatInput.
- styles: [".mat-form-field{display:inline-block;position:relative;text-align:left}[dir=rtl] .mat-form-field{text-align:right}.mat-form-field-wrapper{position:relative}.mat-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-form-field-prefix,.mat-form-field-suffix{white-space:nowrap;flex:none;position:relative}.mat-form-field-infix{display:block;position:relative;flex:auto;min-width:0;width:180px}@media (-ms-high-contrast:active){.mat-form-field-infix{border-image:linear-gradient(transparent,transparent)}}.mat-form-field-label-wrapper{position:absolute;left:0;box-sizing:content-box;width:100%;height:100%;overflow:hidden;pointer-events:none}[dir=rtl] .mat-form-field-label-wrapper{left:auto;right:0}.mat-form-field-label{position:absolute;left:0;font:inherit;pointer-events:none;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transform-origin:0 0;transition:transform .4s cubic-bezier(.25,.8,.25,1),color .4s cubic-bezier(.25,.8,.25,1),width .4s cubic-bezier(.25,.8,.25,1);display:none}[dir=rtl] .mat-form-field-label{transform-origin:100% 0;left:auto;right:0}.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label,.mat-form-field-empty.mat-form-field-label{display:block}.mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:block;transition:none}.mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-form-field-can-float .mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:block}.mat-form-field-label:not(.mat-form-field-empty){transition:none}.mat-form-field-underline{position:absolute;width:100%;pointer-events:none;transform:scaleY(1.0001)}.mat-form-field-ripple{position:absolute;left:0;width:100%;transform-origin:50%;transform:scaleX(.5);opacity:0;transition:background-color .3s cubic-bezier(.55,0,.55,.2)}.mat-form-field.mat-focused .mat-form-field-ripple,.mat-form-field.mat-form-field-invalid .mat-form-field-ripple{opacity:1;transform:scaleX(1);transition:transform .3s cubic-bezier(.25,.8,.25,1),opacity .1s cubic-bezier(.25,.8,.25,1),background-color .3s cubic-bezier(.25,.8,.25,1)}.mat-form-field-subscript-wrapper{position:absolute;box-sizing:border-box;width:100%;overflow:hidden}.mat-form-field-label-wrapper .mat-icon,.mat-form-field-subscript-wrapper .mat-icon{width:1em;height:1em;font-size:inherit;vertical-align:baseline}.mat-form-field-hint-wrapper{display:flex}.mat-form-field-hint-spacer{flex:1 0 1em}.mat-error{display:block}.mat-form-field-control-wrapper{position:relative}.mat-form-field._mat-animation-noopable .mat-form-field-label,.mat-form-field._mat-animation-noopable .mat-form-field-ripple{transition:none} .mat-form-field-appearance-fill .mat-form-field-flex{border-radius:4px 4px 0 0;padding:.75em .75em 0 .75em}@media (-ms-high-contrast:active){.mat-form-field-appearance-fill .mat-form-field-flex{outline:solid 1px}}.mat-form-field-appearance-fill .mat-form-field-underline::before{content:'';display:block;position:absolute;bottom:0;height:1px;width:100%}.mat-form-field-appearance-fill .mat-form-field-ripple{bottom:0;height:2px}@media (-ms-high-contrast:active){.mat-form-field-appearance-fill .mat-form-field-ripple{height:0;border-top:solid 2px}}.mat-form-field-appearance-fill:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-fill._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{transition:none}.mat-form-field-appearance-fill .mat-form-field-subscript-wrapper{padding:0 1em} .mat-input-element{font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:100%;max-width:100%;vertical-align:bottom;text-align:inherit}.mat-input-element:-moz-ui-invalid{box-shadow:none}.mat-input-element::-ms-clear,.mat-input-element::-ms-reveal{display:none}.mat-input-element,.mat-input-element::-webkit-search-cancel-button,.mat-input-element::-webkit-search-decoration,.mat-input-element::-webkit-search-results-button,.mat-input-element::-webkit-search-results-decoration{-webkit-appearance:none}.mat-input-element::-webkit-caps-lock-indicator,.mat-input-element::-webkit-contacts-auto-fill-button,.mat-input-element::-webkit-credentials-auto-fill-button{visibility:hidden}.mat-input-element[type=date]::after,.mat-input-element[type=datetime-local]::after,.mat-input-element[type=datetime]::after,.mat-input-element[type=month]::after,.mat-input-element[type=time]::after,.mat-input-element[type=week]::after{content:' ';white-space:pre;width:1px}.mat-input-element::-webkit-calendar-picker-indicator,.mat-input-element::-webkit-clear-button,.mat-input-element::-webkit-inner-spin-button{font-size:.75em}.mat-input-element::placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-input-element::-moz-placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::-moz-placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-input-element::-webkit-input-placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::-webkit-input-placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-input-element:-ms-input-placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element:-ms-input-placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-form-field-hide-placeholder .mat-input-element::placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}.mat-form-field-hide-placeholder .mat-input-element::-moz-placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}.mat-form-field-hide-placeholder .mat-input-element::-webkit-input-placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}.mat-form-field-hide-placeholder .mat-input-element:-ms-input-placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}textarea.mat-input-element{resize:vertical;overflow:auto}textarea.mat-input-element.cdk-textarea-autosize{resize:none}textarea.mat-input-element{padding:2px 0;margin:-2px 0}select.mat-input-element{-moz-appearance:none;-webkit-appearance:none;position:relative;background-color:transparent;display:inline-flex;box-sizing:border-box;padding-top:1em;top:-1em;margin-bottom:-1em}select.mat-input-element::-ms-expand{display:none}select.mat-input-element::-moz-focus-inner{border:0}select.mat-input-element:not(:disabled){cursor:pointer}select.mat-input-element::-ms-value{color:inherit;background:0 0}@media (-ms-high-contrast:active){.mat-focused select.mat-input-element::-ms-value{color:inherit}}.mat-form-field-type-mat-native-select .mat-form-field-infix::after{content:'';width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;position:absolute;top:50%;right:0;margin-top:-2.5px;pointer-events:none}[dir=rtl] .mat-form-field-type-mat-native-select .mat-form-field-infix::after{right:auto;left:0}.mat-form-field-type-mat-native-select .mat-input-element{padding-right:15px}[dir=rtl] .mat-form-field-type-mat-native-select .mat-input-element{padding-right:0;padding-left:15px}.mat-form-field-type-mat-native-select .mat-form-field-label-wrapper{max-width:calc(100% - 10px)}.mat-form-field-type-mat-native-select.mat-form-field-appearance-outline .mat-form-field-infix::after{margin-top:-5px}.mat-form-field-type-mat-native-select.mat-form-field-appearance-fill .mat-form-field-infix::after{margin-top:-10px} .mat-form-field-appearance-legacy .mat-form-field-label{transform:perspective(100px);-ms-transform:none}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon{width:1em}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button{font:inherit;vertical-align:baseline}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button .mat-icon{font-size:inherit}.mat-form-field-appearance-legacy .mat-form-field-underline{height:1px}@media (-ms-high-contrast:active){.mat-form-field-appearance-legacy .mat-form-field-underline{height:0;border-top:solid 1px}}.mat-form-field-appearance-legacy .mat-form-field-ripple{top:0;height:2px;overflow:hidden}@media (-ms-high-contrast:active){.mat-form-field-appearance-legacy .mat-form-field-ripple{height:0;border-top:solid 2px}}.mat-form-field-appearance-legacy.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}@media (-ms-high-contrast:active){.mat-form-field-appearance-legacy.mat-form-field-disabled .mat-form-field-underline{border-top-style:dotted;border-top-width:2px}}.mat-form-field-appearance-legacy.mat-form-field-invalid:not(.mat-focused) .mat-form-field-ripple{height:1px} .mat-form-field-appearance-outline .mat-form-field-wrapper{margin:.25em 0}.mat-form-field-appearance-outline .mat-form-field-flex{padding:0 .75em 0 .75em;margin-top:-.25em;position:relative}.mat-form-field-appearance-outline .mat-form-field-prefix,.mat-form-field-appearance-outline .mat-form-field-suffix{top:.25em}.mat-form-field-appearance-outline .mat-form-field-outline{display:flex;position:absolute;top:.25em;left:0;right:0;bottom:0;pointer-events:none}.mat-form-field-appearance-outline .mat-form-field-outline-end,.mat-form-field-appearance-outline .mat-form-field-outline-start{border:1px solid currentColor;min-width:5px}.mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:5px 0 0 5px;border-right-style:none}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-right-style:solid;border-left-style:none;border-radius:0 5px 5px 0}.mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 5px 5px 0;border-left-style:none;flex-grow:1}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-left-style:solid;border-right-style:none;border-radius:5px 0 0 5px}.mat-form-field-appearance-outline .mat-form-field-outline-gap{border-radius:.000001px;border:1px solid currentColor;border-left-style:none;border-right-style:none}.mat-form-field-appearance-outline.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-outline-gap{border-top-color:transparent}.mat-form-field-appearance-outline .mat-form-field-outline-thick{opacity:0}.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-end,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-gap,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-start{border-width:2px;transition:border-color .3s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline{opacity:0;transition:opacity .1s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline-thick{opacity:1}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover .mat-form-field-outline{opacity:0;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover .mat-form-field-outline-thick{opacity:1}.mat-form-field-appearance-outline .mat-form-field-subscript-wrapper{padding:0 1em}.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-end,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-gap,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-start,.mat-form-field-appearance-outline._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-outline{transition:none} .mat-form-field-appearance-standard .mat-form-field-flex{padding-top:.75em}.mat-form-field-appearance-standard .mat-form-field-underline{height:1px}@media (-ms-high-contrast:active){.mat-form-field-appearance-standard .mat-form-field-underline{height:0;border-top:solid 1px}}.mat-form-field-appearance-standard .mat-form-field-ripple{bottom:0;height:2px}@media (-ms-high-contrast:active){.mat-form-field-appearance-standard .mat-form-field-ripple{height:0;border-top:2px}}.mat-form-field-appearance-standard.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}@media (-ms-high-contrast:active){.mat-form-field-appearance-standard.mat-form-field-disabled .mat-form-field-underline{border-top-style:dotted;border-top-width:2px}}.mat-form-field-appearance-standard:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-standard._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{transition:none}"],
- animations: [matFormFieldAnimations.transitionMessages],
- host: {
- 'class': 'mat-form-field',
- '[class.mat-form-field-appearance-standard]': 'appearance == "standard"',
- '[class.mat-form-field-appearance-fill]': 'appearance == "fill"',
- '[class.mat-form-field-appearance-outline]': 'appearance == "outline"',
- '[class.mat-form-field-appearance-legacy]': 'appearance == "legacy"',
- '[class.mat-form-field-invalid]': '_control.errorState',
- '[class.mat-form-field-can-float]': '_canLabelFloat',
- '[class.mat-form-field-should-float]': '_shouldLabelFloat()',
- '[class.mat-form-field-has-label]': '_hasFloatingLabel()',
- '[class.mat-form-field-hide-placeholder]': '_hideControlPlaceholder()',
- '[class.mat-form-field-disabled]': '_control.disabled',
- '[class.mat-form-field-autofilled]': '_control.autofilled',
- '[class.mat-focused]': '_control.focused',
- '[class.mat-accent]': 'color == "accent"',
- '[class.mat-warn]': 'color == "warn"',
- '[class.ng-untouched]': '_shouldForward("untouched")',
- '[class.ng-touched]': '_shouldForward("touched")',
- '[class.ng-pristine]': '_shouldForward("pristine")',
- '[class.ng-dirty]': '_shouldForward("dirty")',
- '[class.ng-valid]': '_shouldForward("valid")',
- '[class.ng-invalid]': '_shouldForward("invalid")',
- '[class.ng-pending]': '_shouldForward("pending")',
- '[class._mat-animation-noopable]': '!_animationsEnabled',
- },
- inputs: ['color'],
- encapsulation: core.ViewEncapsulation.None,
- changeDetection: core.ChangeDetectionStrategy.OnPush,
- },] },
- ];
- /** @nocollapse */
- MatFormField.ctorParameters = function () { return [
- { type: core.ElementRef },
- { type: core.ChangeDetectorRef },
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [core$1.MAT_LABEL_GLOBAL_OPTIONS,] }] },
- { type: bidi.Directionality, decorators: [{ type: core.Optional }] },
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [MAT_FORM_FIELD_DEFAULT_OPTIONS,] }] },
- { type: platform.Platform },
- { type: core.NgZone },
- { type: String, decorators: [{ type: core.Optional }, { type: core.Inject, args: [animations$1.ANIMATION_MODULE_TYPE,] }] }
- ]; };
- MatFormField.propDecorators = {
- appearance: [{ type: core.Input }],
- hideRequiredMarker: [{ type: core.Input }],
- hintLabel: [{ type: core.Input }],
- floatLabel: [{ type: core.Input }],
- underlineRef: [{ type: core.ViewChild, args: ['underline', { static: false },] }],
- _connectionContainerRef: [{ type: core.ViewChild, args: ['connectionContainer', { static: true },] }],
- _inputContainerRef: [{ type: core.ViewChild, args: ['inputContainer', { static: false },] }],
- _label: [{ type: core.ViewChild, args: ['label', { static: false },] }],
- _controlNonStatic: [{ type: core.ContentChild, args: [MatFormFieldControl, { static: false },] }],
- _controlStatic: [{ type: core.ContentChild, args: [MatFormFieldControl, { static: true },] }],
- _labelChildNonStatic: [{ type: core.ContentChild, args: [MatLabel, { static: false },] }],
- _labelChildStatic: [{ type: core.ContentChild, args: [MatLabel, { static: true },] }],
- _placeholderChild: [{ type: core.ContentChild, args: [MatPlaceholder, { static: false },] }],
- _errorChildren: [{ type: core.ContentChildren, args: [MatError,] }],
- _hintChildren: [{ type: core.ContentChildren, args: [MatHint,] }],
- _prefixChildren: [{ type: core.ContentChildren, args: [MatPrefix,] }],
- _suffixChildren: [{ type: core.ContentChildren, args: [MatSuffix,] }]
- };
- return MatFormField;
- }(_MatFormFieldMixinBase));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var MatFormFieldModule = /** @class */ (function () {
- function MatFormFieldModule() {
- }
- MatFormFieldModule.decorators = [
- { type: core.NgModule, args: [{
- declarations: [
- MatError,
- MatFormField,
- MatHint,
- MatLabel,
- MatPlaceholder,
- MatPrefix,
- MatSuffix,
- ],
- imports: [
- common.CommonModule,
- observers.ObserversModule,
- ],
- exports: [
- MatError,
- MatFormField,
- MatHint,
- MatLabel,
- MatPlaceholder,
- MatPrefix,
- MatSuffix,
- ],
- },] },
- ];
- return MatFormFieldModule;
- }());
- exports.MatFormFieldModule = MatFormFieldModule;
- exports.MatError = MatError;
- exports.MAT_FORM_FIELD_DEFAULT_OPTIONS = MAT_FORM_FIELD_DEFAULT_OPTIONS;
- exports.MatFormField = MatFormField;
- exports.MatFormFieldControl = MatFormFieldControl;
- exports.getMatFormFieldPlaceholderConflictError = getMatFormFieldPlaceholderConflictError;
- exports.getMatFormFieldDuplicatedHintError = getMatFormFieldDuplicatedHintError;
- exports.getMatFormFieldMissingControlError = getMatFormFieldMissingControlError;
- exports.MatHint = MatHint;
- exports.MatPlaceholder = MatPlaceholder;
- exports.MatPrefix = MatPrefix;
- exports.MatSuffix = MatSuffix;
- exports.MatLabel = MatLabel;
- exports.matFormFieldAnimations = matFormFieldAnimations;
- Object.defineProperty(exports, '__esModule', { value: true });
- })));
- //# sourceMappingURL=material-form-field.umd.js.map
|