| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792 |
- /**
- * @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/cdk/text-field'), require('@angular/core'), require('@angular/cdk/coercion'), require('@angular/cdk/platform'), require('@angular/forms'), require('@angular/material/core'), require('@angular/material/form-field'), require('rxjs'), require('@angular/common')) :
- typeof define === 'function' && define.amd ? define('@angular/material/input', ['exports', '@angular/cdk/text-field', '@angular/core', '@angular/cdk/coercion', '@angular/cdk/platform', '@angular/forms', '@angular/material/core', '@angular/material/form-field', 'rxjs', '@angular/common'], factory) :
- (factory((global.ng = global.ng || {}, global.ng.material = global.ng.material || {}, global.ng.material.input = {}),global.ng.cdk.textField,global.ng.core,global.ng.cdk.coercion,global.ng.cdk.platform,global.ng.forms,global.ng.material.core,global.ng.material.formField,global.rxjs,global.ng.common));
- }(this, (function (exports,textField,core,coercion,platform,forms,core$1,formField,rxjs,common) { '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
- */
- /**
- * Directive to automatically resize a textarea to fit its content.
- * @deprecated Use `cdkTextareaAutosize` from `\@angular/cdk/text-field` instead.
- * \@breaking-change 8.0.0
- */
- var MatTextareaAutosize = /** @class */ (function (_super) {
- __extends(MatTextareaAutosize, _super);
- function MatTextareaAutosize() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(MatTextareaAutosize.prototype, "matAutosizeMinRows", {
- get: /**
- * @return {?}
- */
- function () { return this.minRows; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this.minRows = value; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatTextareaAutosize.prototype, "matAutosizeMaxRows", {
- get: /**
- * @return {?}
- */
- function () { return this.maxRows; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this.maxRows = value; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatTextareaAutosize.prototype, "matAutosize", {
- get: /**
- * @return {?}
- */
- function () { return this.enabled; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this.enabled = value; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatTextareaAutosize.prototype, "matTextareaAutosize", {
- get: /**
- * @return {?}
- */
- function () { return this.enabled; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this.enabled = value; },
- enumerable: true,
- configurable: true
- });
- MatTextareaAutosize.decorators = [
- { type: core.Directive, args: [{
- selector: 'textarea[mat-autosize], textarea[matTextareaAutosize]',
- exportAs: 'matTextareaAutosize',
- inputs: ['cdkAutosizeMinRows', 'cdkAutosizeMaxRows'],
- host: {
- 'class': 'cdk-textarea-autosize mat-autosize',
- // Textarea elements that have the directive applied should have a single row by default.
- // Browsers normally show two rows by default and therefore this limits the minRows binding.
- 'rows': '1',
- '(input)': '_noopInputHandler()',
- },
- },] },
- ];
- MatTextareaAutosize.propDecorators = {
- matAutosizeMinRows: [{ type: core.Input }],
- matAutosizeMaxRows: [{ type: core.Input }],
- matAutosize: [{ type: core.Input, args: ['mat-autosize',] }],
- matTextareaAutosize: [{ type: core.Input }]
- };
- return MatTextareaAutosize;
- }(textField.CdkTextareaAutosize));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * \@docs-private
- * @param {?} type
- * @return {?}
- */
- function getMatInputUnsupportedTypeError(type) {
- return Error("Input type \"" + type + "\" isn't supported by matInput.");
- }
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- /**
- * This token is used to inject the object whose value should be set into `MatInput`. If none is
- * provided, the native `HTMLInputElement` is used. Directives like `MatDatepickerInput` can provide
- * themselves for this token, in order to make `MatInput` delegate the getting and setting of the
- * value to them.
- * @type {?}
- */
- var MAT_INPUT_VALUE_ACCESSOR = new core.InjectionToken('MAT_INPUT_VALUE_ACCESSOR');
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- // Invalid input type. Using one of these will throw an MatInputUnsupportedTypeError.
- /** @type {?} */
- var MAT_INPUT_INVALID_TYPES = [
- 'button',
- 'checkbox',
- 'file',
- 'hidden',
- 'image',
- 'radio',
- 'range',
- 'reset',
- 'submit'
- ];
- /** @type {?} */
- var nextUniqueId = 0;
- // Boilerplate for applying mixins to MatInput.
- /**
- * \@docs-private
- */
- var
- // Boilerplate for applying mixins to MatInput.
- /**
- * \@docs-private
- */
- MatInputBase = /** @class */ (function () {
- function MatInputBase(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) {
- this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
- this._parentForm = _parentForm;
- this._parentFormGroup = _parentFormGroup;
- this.ngControl = ngControl;
- }
- return MatInputBase;
- }());
- /** @type {?} */
- var _MatInputMixinBase = core$1.mixinErrorState(MatInputBase);
- /**
- * Directive that allows a native input to work inside a `MatFormField`.
- */
- var MatInput = /** @class */ (function (_super) {
- __extends(MatInput, _super);
- function MatInput(_elementRef, _platform, ngControl, _parentForm, _parentFormGroup, _defaultErrorStateMatcher, inputValueAccessor, _autofillMonitor, ngZone) {
- var _this = _super.call(this, _defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl) || this;
- _this._elementRef = _elementRef;
- _this._platform = _platform;
- _this.ngControl = ngControl;
- _this._autofillMonitor = _autofillMonitor;
- _this._uid = "mat-input-" + nextUniqueId++;
- /**
- * Whether the component is being rendered on the server.
- */
- _this._isServer = false;
- /**
- * Whether the component is a native html select.
- */
- _this._isNativeSelect = false;
- /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- */
- _this.focused = false;
- /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- */
- _this.stateChanges = new rxjs.Subject();
- /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- */
- _this.controlType = 'mat-input';
- /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- */
- _this.autofilled = false;
- _this._disabled = false;
- _this._required = false;
- _this._type = 'text';
- _this._readonly = false;
- _this._neverEmptyInputTypes = [
- 'date',
- 'datetime',
- 'datetime-local',
- 'month',
- 'time',
- 'week'
- ].filter((/**
- * @param {?} t
- * @return {?}
- */
- function (t) { return platform.getSupportedInputTypes().has(t); }));
- /** @type {?} */
- var element = _this._elementRef.nativeElement;
- // If no input value accessor was explicitly specified, use the element as the input value
- // accessor.
- _this._inputValueAccessor = inputValueAccessor || element;
- _this._previousNativeValue = _this.value;
- // Force setter to be called in case id was not specified.
- _this.id = _this.id;
- // On some versions of iOS the caret gets stuck in the wrong place when holding down the delete
- // key. In order to get around this we need to "jiggle" the caret loose. Since this bug only
- // exists on iOS, we only bother to install the listener on iOS.
- if (_platform.IOS) {
- ngZone.runOutsideAngular((/**
- * @return {?}
- */
- function () {
- _elementRef.nativeElement.addEventListener('keyup', (/**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- /** @type {?} */
- var el = (/** @type {?} */ (event.target));
- if (!el.value && !el.selectionStart && !el.selectionEnd) {
- // Note: Just setting `0, 0` doesn't fix the issue. Setting
- // `1, 1` fixes it for the first time that you type text and
- // then hold delete. Toggling to `1, 1` and then back to
- // `0, 0` seems to completely fix it.
- el.setSelectionRange(1, 1);
- el.setSelectionRange(0, 0);
- }
- }));
- }));
- }
- _this._isServer = !_this._platform.isBrowser;
- _this._isNativeSelect = element.nodeName.toLowerCase() === 'select';
- if (_this._isNativeSelect) {
- _this.controlType = ((/** @type {?} */ (element))).multiple ? 'mat-native-select-multiple' :
- 'mat-native-select';
- }
- return _this;
- }
- Object.defineProperty(MatInput.prototype, "disabled", {
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- get: /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- function () {
- if (this.ngControl && this.ngControl.disabled !== null) {
- return this.ngControl.disabled;
- }
- return this._disabled;
- },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._disabled = coercion.coerceBooleanProperty(value);
- // Browsers may not fire the blur event if the input is disabled too quickly.
- // Reset from here to ensure that the element doesn't become stuck.
- if (this.focused) {
- this.focused = false;
- this.stateChanges.next();
- }
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatInput.prototype, "id", {
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- get: /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- function () { return this._id; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this._id = value || this._uid; },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatInput.prototype, "required", {
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- get: /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- function () { return this._required; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this._required = coercion.coerceBooleanProperty(value); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatInput.prototype, "type", {
- /** Input type of the element. */
- get: /**
- * Input type of the element.
- * @return {?}
- */
- function () { return this._type; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- this._type = value || 'text';
- this._validateType();
- // When using Angular inputs, developers are no longer able to set the properties on the native
- // input element. To ensure that bindings for `type` work, we need to sync the setter
- // with the native property. Textarea elements don't support the type property or attribute.
- if (!this._isTextarea() && platform.getSupportedInputTypes().has(this._type)) {
- ((/** @type {?} */ (this._elementRef.nativeElement))).type = this._type;
- }
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatInput.prototype, "value", {
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- get: /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- function () { return this._inputValueAccessor.value; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) {
- if (value !== this.value) {
- this._inputValueAccessor.value = value;
- this.stateChanges.next();
- }
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatInput.prototype, "readonly", {
- /** Whether the element is readonly. */
- get: /**
- * Whether the element is readonly.
- * @return {?}
- */
- function () { return this._readonly; },
- set: /**
- * @param {?} value
- * @return {?}
- */
- function (value) { this._readonly = coercion.coerceBooleanProperty(value); },
- enumerable: true,
- configurable: true
- });
- /**
- * @return {?}
- */
- MatInput.prototype.ngOnInit = /**
- * @return {?}
- */
- function () {
- var _this = this;
- if (this._platform.isBrowser) {
- this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe((/**
- * @param {?} event
- * @return {?}
- */
- function (event) {
- _this.autofilled = event.isAutofilled;
- _this.stateChanges.next();
- }));
- }
- };
- /**
- * @return {?}
- */
- MatInput.prototype.ngOnChanges = /**
- * @return {?}
- */
- function () {
- this.stateChanges.next();
- };
- /**
- * @return {?}
- */
- MatInput.prototype.ngOnDestroy = /**
- * @return {?}
- */
- function () {
- this.stateChanges.complete();
- if (this._platform.isBrowser) {
- this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
- }
- };
- /**
- * @return {?}
- */
- MatInput.prototype.ngDoCheck = /**
- * @return {?}
- */
- function () {
- if (this.ngControl) {
- // We need to re-evaluate this on every change detection cycle, because there are some
- // error triggers that we can't subscribe to (e.g. parent form submissions). This means
- // that whatever logic is in here has to be super lean or we risk destroying the performance.
- this.updateErrorState();
- }
- // We need to dirty-check the native element's value, because there are some cases where
- // we won't be notified when it changes (e.g. the consumer isn't using forms or they're
- // updating the value using `emitEvent: false`).
- this._dirtyCheckNativeValue();
- };
- /** Focuses the input. */
- /**
- * Focuses the input.
- * @param {?=} options
- * @return {?}
- */
- MatInput.prototype.focus = /**
- * Focuses the input.
- * @param {?=} options
- * @return {?}
- */
- function (options) {
- this._elementRef.nativeElement.focus(options);
- };
- /** Callback for the cases where the focused state of the input changes. */
- /**
- * Callback for the cases where the focused state of the input changes.
- * @param {?} isFocused
- * @return {?}
- */
- MatInput.prototype._focusChanged = /**
- * Callback for the cases where the focused state of the input changes.
- * @param {?} isFocused
- * @return {?}
- */
- function (isFocused) {
- if (isFocused !== this.focused && (!this.readonly || !isFocused)) {
- this.focused = isFocused;
- this.stateChanges.next();
- }
- };
- /**
- * @return {?}
- */
- MatInput.prototype._onInput = /**
- * @return {?}
- */
- function () {
- // This is a noop function and is used to let Angular know whenever the value changes.
- // Angular will run a new change detection each time the `input` event has been dispatched.
- // It's necessary that Angular recognizes the value change, because when floatingLabel
- // is set to false and Angular forms aren't used, the placeholder won't recognize the
- // value changes and will not disappear.
- // Listening to the input event wouldn't be necessary when the input is using the
- // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.
- };
- /** Does some manual dirty checking on the native input `value` property. */
- /**
- * Does some manual dirty checking on the native input `value` property.
- * @protected
- * @return {?}
- */
- MatInput.prototype._dirtyCheckNativeValue = /**
- * Does some manual dirty checking on the native input `value` property.
- * @protected
- * @return {?}
- */
- function () {
- /** @type {?} */
- var newValue = this._elementRef.nativeElement.value;
- if (this._previousNativeValue !== newValue) {
- this._previousNativeValue = newValue;
- this.stateChanges.next();
- }
- };
- /** Make sure the input is a supported type. */
- /**
- * Make sure the input is a supported type.
- * @protected
- * @return {?}
- */
- MatInput.prototype._validateType = /**
- * Make sure the input is a supported type.
- * @protected
- * @return {?}
- */
- function () {
- if (MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1) {
- throw getMatInputUnsupportedTypeError(this._type);
- }
- };
- /** Checks whether the input type is one of the types that are never empty. */
- /**
- * Checks whether the input type is one of the types that are never empty.
- * @protected
- * @return {?}
- */
- MatInput.prototype._isNeverEmpty = /**
- * Checks whether the input type is one of the types that are never empty.
- * @protected
- * @return {?}
- */
- function () {
- return this._neverEmptyInputTypes.indexOf(this._type) > -1;
- };
- /** Checks whether the input is invalid based on the native validation. */
- /**
- * Checks whether the input is invalid based on the native validation.
- * @protected
- * @return {?}
- */
- MatInput.prototype._isBadInput = /**
- * Checks whether the input is invalid based on the native validation.
- * @protected
- * @return {?}
- */
- function () {
- // The `validity` property won't be present on platform-server.
- /** @type {?} */
- var validity = ((/** @type {?} */ (this._elementRef.nativeElement))).validity;
- return validity && validity.badInput;
- };
- /** Determines if the component host is a textarea. */
- /**
- * Determines if the component host is a textarea.
- * @protected
- * @return {?}
- */
- MatInput.prototype._isTextarea = /**
- * Determines if the component host is a textarea.
- * @protected
- * @return {?}
- */
- function () {
- return this._elementRef.nativeElement.nodeName.toLowerCase() === 'textarea';
- };
- Object.defineProperty(MatInput.prototype, "empty", {
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- get: /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- function () {
- return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() &&
- !this.autofilled;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(MatInput.prototype, "shouldLabelFloat", {
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- get: /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- function () {
- if (this._isNativeSelect) {
- // For a single-selection `<select>`, the label should float when the selected option has
- // a non-empty display value. For a `<select multiple>`, the label *always* floats to avoid
- // overlapping the label with the options.
- /** @type {?} */
- var selectElement = (/** @type {?} */ (this._elementRef.nativeElement));
- /** @type {?} */
- var firstOption = selectElement.options[0];
- // On most browsers the `selectedIndex` will always be 0, however on IE and Edge it'll be
- // -1 if the `value` is set to something, that isn't in the list of options, at a later point.
- return this.focused || selectElement.multiple || !this.empty ||
- !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label);
- }
- else {
- return this.focused || !this.empty;
- }
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @param {?} ids
- * @return {?}
- */
- MatInput.prototype.setDescribedByIds = /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @param {?} ids
- * @return {?}
- */
- function (ids) {
- this._ariaDescribedby = ids.join(' ');
- };
- /**
- * Implemented as part of MatFormFieldControl.
- * @docs-private
- */
- /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- MatInput.prototype.onContainerClick = /**
- * Implemented as part of MatFormFieldControl.
- * \@docs-private
- * @return {?}
- */
- function () {
- // Do not re-focus the input element if the element is already focused. Otherwise it can happen
- // that someone clicks on a time input and the cursor resets to the "hours" field while the
- // "minutes" field was actually clicked. See: https://github.com/angular/components/issues/12849
- if (!this.focused) {
- this.focus();
- }
- };
- MatInput.decorators = [
- { type: core.Directive, args: [{
- selector: "input[matInput], textarea[matInput], select[matNativeControl],\n input[matNativeControl], textarea[matNativeControl]",
- exportAs: 'matInput',
- host: {
- /**
- * \@breaking-change 8.0.0 remove .mat-form-field-autofill-control in favor of AutofillMonitor.
- */
- 'class': 'mat-input-element mat-form-field-autofill-control',
- '[class.mat-input-server]': '_isServer',
- // Native input properties that are overwritten by Angular inputs need to be synced with
- // the native input element. Otherwise property bindings for those don't work.
- '[attr.id]': 'id',
- '[attr.placeholder]': 'placeholder',
- '[disabled]': 'disabled',
- '[required]': 'required',
- '[attr.readonly]': 'readonly && !_isNativeSelect || null',
- '[attr.aria-describedby]': '_ariaDescribedby || null',
- '[attr.aria-invalid]': 'errorState',
- '[attr.aria-required]': 'required.toString()',
- '(blur)': '_focusChanged(false)',
- '(focus)': '_focusChanged(true)',
- '(input)': '_onInput()',
- },
- providers: [{ provide: formField.MatFormFieldControl, useExisting: MatInput }],
- },] },
- ];
- /** @nocollapse */
- MatInput.ctorParameters = function () { return [
- { type: core.ElementRef },
- { type: platform.Platform },
- { type: forms.NgControl, decorators: [{ type: core.Optional }, { type: core.Self }] },
- { type: forms.NgForm, decorators: [{ type: core.Optional }] },
- { type: forms.FormGroupDirective, decorators: [{ type: core.Optional }] },
- { type: core$1.ErrorStateMatcher },
- { type: undefined, decorators: [{ type: core.Optional }, { type: core.Self }, { type: core.Inject, args: [MAT_INPUT_VALUE_ACCESSOR,] }] },
- { type: textField.AutofillMonitor },
- { type: core.NgZone }
- ]; };
- MatInput.propDecorators = {
- disabled: [{ type: core.Input }],
- id: [{ type: core.Input }],
- placeholder: [{ type: core.Input }],
- required: [{ type: core.Input }],
- type: [{ type: core.Input }],
- errorStateMatcher: [{ type: core.Input }],
- value: [{ type: core.Input }],
- readonly: [{ type: core.Input }]
- };
- return MatInput;
- }(_MatInputMixinBase));
- /**
- * @fileoverview added by tsickle
- * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
- */
- var MatInputModule = /** @class */ (function () {
- function MatInputModule() {
- }
- MatInputModule.decorators = [
- { type: core.NgModule, args: [{
- declarations: [MatInput, MatTextareaAutosize],
- imports: [
- common.CommonModule,
- textField.TextFieldModule,
- formField.MatFormFieldModule,
- ],
- exports: [
- textField.TextFieldModule,
- // We re-export the `MatFormFieldModule` since `MatInput` will almost always
- // be used together with `MatFormField`.
- formField.MatFormFieldModule,
- MatInput,
- MatTextareaAutosize,
- ],
- providers: [core$1.ErrorStateMatcher],
- },] },
- ];
- return MatInputModule;
- }());
- exports.MatTextareaAutosize = MatTextareaAutosize;
- exports.MatInput = MatInput;
- exports.getMatInputUnsupportedTypeError = getMatInputUnsupportedTypeError;
- exports.MatInputModule = MatInputModule;
- exports.MAT_INPUT_VALUE_ACCESSOR = MAT_INPUT_VALUE_ACCESSOR;
- Object.defineProperty(exports, '__esModule', { value: true });
- })));
- //# sourceMappingURL=material-input.umd.js.map
|