source: trip-planner-front/node_modules/@angular/material/esm2015/input/input.js@ 76712b2

Last change on this file since 76712b2 was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 54.8 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { coerceBooleanProperty } from '@angular/cdk/coercion';
9import { getSupportedInputTypes, Platform } from '@angular/cdk/platform';
10import { AutofillMonitor } from '@angular/cdk/text-field';
11import { Directive, ElementRef, HostListener, Inject, Input, NgZone, Optional, Self, } from '@angular/core';
12import { FormGroupDirective, NgControl, NgForm } from '@angular/forms';
13import { ErrorStateMatcher, mixinErrorState, } from '@angular/material/core';
14import { MatFormFieldControl, MatFormField, MAT_FORM_FIELD } from '@angular/material/form-field';
15import { Subject } from 'rxjs';
16import { getMatInputUnsupportedTypeError } from './input-errors';
17import { MAT_INPUT_VALUE_ACCESSOR } from './input-value-accessor';
18// Invalid input type. Using one of these will throw an MatInputUnsupportedTypeError.
19const MAT_INPUT_INVALID_TYPES = [
20 'button',
21 'checkbox',
22 'file',
23 'hidden',
24 'image',
25 'radio',
26 'range',
27 'reset',
28 'submit'
29];
30let nextUniqueId = 0;
31// Boilerplate for applying mixins to MatInput.
32/** @docs-private */
33const _MatInputBase = mixinErrorState(class {
34 constructor(_defaultErrorStateMatcher, _parentForm, _parentFormGroup,
35 /** @docs-private */
36 ngControl) {
37 this._defaultErrorStateMatcher = _defaultErrorStateMatcher;
38 this._parentForm = _parentForm;
39 this._parentFormGroup = _parentFormGroup;
40 this.ngControl = ngControl;
41 }
42});
43/** Directive that allows a native input to work inside a `MatFormField`. */
44export class MatInput extends _MatInputBase {
45 constructor(_elementRef, _platform, ngControl, _parentForm, _parentFormGroup, _defaultErrorStateMatcher, inputValueAccessor, _autofillMonitor, ngZone,
46 // TODO: Remove this once the legacy appearance has been removed. We only need
47 // to inject the form-field for determining whether the placeholder has been promoted.
48 _formField) {
49 super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
50 this._elementRef = _elementRef;
51 this._platform = _platform;
52 this._autofillMonitor = _autofillMonitor;
53 this._formField = _formField;
54 this._uid = `mat-input-${nextUniqueId++}`;
55 /**
56 * Implemented as part of MatFormFieldControl.
57 * @docs-private
58 */
59 this.focused = false;
60 /**
61 * Implemented as part of MatFormFieldControl.
62 * @docs-private
63 */
64 this.stateChanges = new Subject();
65 /**
66 * Implemented as part of MatFormFieldControl.
67 * @docs-private
68 */
69 this.controlType = 'mat-input';
70 /**
71 * Implemented as part of MatFormFieldControl.
72 * @docs-private
73 */
74 this.autofilled = false;
75 this._disabled = false;
76 this._required = false;
77 this._type = 'text';
78 this._readonly = false;
79 this._neverEmptyInputTypes = [
80 'date',
81 'datetime',
82 'datetime-local',
83 'month',
84 'time',
85 'week'
86 ].filter(t => getSupportedInputTypes().has(t));
87 const element = this._elementRef.nativeElement;
88 const nodeName = element.nodeName.toLowerCase();
89 // If no input value accessor was explicitly specified, use the element as the input value
90 // accessor.
91 this._inputValueAccessor = inputValueAccessor || element;
92 this._previousNativeValue = this.value;
93 // Force setter to be called in case id was not specified.
94 this.id = this.id;
95 // On some versions of iOS the caret gets stuck in the wrong place when holding down the delete
96 // key. In order to get around this we need to "jiggle" the caret loose. Since this bug only
97 // exists on iOS, we only bother to install the listener on iOS.
98 if (_platform.IOS) {
99 ngZone.runOutsideAngular(() => {
100 _elementRef.nativeElement.addEventListener('keyup', (event) => {
101 const el = event.target;
102 // Note: We specifically check for 0, rather than `!el.selectionStart`, because the two
103 // indicate different things. If the value is 0, it means that the caret is at the start
104 // of the input, whereas a value of `null` means that the input doesn't support
105 // manipulating the selection range. Inputs that don't support setting the selection range
106 // will throw an error so we want to avoid calling `setSelectionRange` on them. See:
107 // https://html.spec.whatwg.org/multipage/input.html#do-not-apply
108 if (!el.value && el.selectionStart === 0 && el.selectionEnd === 0) {
109 // Note: Just setting `0, 0` doesn't fix the issue. Setting
110 // `1, 1` fixes it for the first time that you type text and
111 // then hold delete. Toggling to `1, 1` and then back to
112 // `0, 0` seems to completely fix it.
113 el.setSelectionRange(1, 1);
114 el.setSelectionRange(0, 0);
115 }
116 });
117 });
118 }
119 this._isServer = !this._platform.isBrowser;
120 this._isNativeSelect = nodeName === 'select';
121 this._isTextarea = nodeName === 'textarea';
122 this._isInFormField = !!_formField;
123 if (this._isNativeSelect) {
124 this.controlType = element.multiple ? 'mat-native-select-multiple' :
125 'mat-native-select';
126 }
127 }
128 /**
129 * Implemented as part of MatFormFieldControl.
130 * @docs-private
131 */
132 get disabled() {
133 if (this.ngControl && this.ngControl.disabled !== null) {
134 return this.ngControl.disabled;
135 }
136 return this._disabled;
137 }
138 set disabled(value) {
139 this._disabled = coerceBooleanProperty(value);
140 // Browsers may not fire the blur event if the input is disabled too quickly.
141 // Reset from here to ensure that the element doesn't become stuck.
142 if (this.focused) {
143 this.focused = false;
144 this.stateChanges.next();
145 }
146 }
147 /**
148 * Implemented as part of MatFormFieldControl.
149 * @docs-private
150 */
151 get id() { return this._id; }
152 set id(value) { this._id = value || this._uid; }
153 /**
154 * Implemented as part of MatFormFieldControl.
155 * @docs-private
156 */
157 get required() { return this._required; }
158 set required(value) { this._required = coerceBooleanProperty(value); }
159 /** Input type of the element. */
160 get type() { return this._type; }
161 set type(value) {
162 this._type = value || 'text';
163 this._validateType();
164 // When using Angular inputs, developers are no longer able to set the properties on the native
165 // input element. To ensure that bindings for `type` work, we need to sync the setter
166 // with the native property. Textarea elements don't support the type property or attribute.
167 if (!this._isTextarea && getSupportedInputTypes().has(this._type)) {
168 this._elementRef.nativeElement.type = this._type;
169 }
170 }
171 /**
172 * Implemented as part of MatFormFieldControl.
173 * @docs-private
174 */
175 get value() { return this._inputValueAccessor.value; }
176 set value(value) {
177 if (value !== this.value) {
178 this._inputValueAccessor.value = value;
179 this.stateChanges.next();
180 }
181 }
182 /** Whether the element is readonly. */
183 get readonly() { return this._readonly; }
184 set readonly(value) { this._readonly = coerceBooleanProperty(value); }
185 ngAfterViewInit() {
186 if (this._platform.isBrowser) {
187 this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(event => {
188 this.autofilled = event.isAutofilled;
189 this.stateChanges.next();
190 });
191 }
192 }
193 ngOnChanges() {
194 this.stateChanges.next();
195 }
196 ngOnDestroy() {
197 this.stateChanges.complete();
198 if (this._platform.isBrowser) {
199 this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement);
200 }
201 }
202 ngDoCheck() {
203 if (this.ngControl) {
204 // We need to re-evaluate this on every change detection cycle, because there are some
205 // error triggers that we can't subscribe to (e.g. parent form submissions). This means
206 // that whatever logic is in here has to be super lean or we risk destroying the performance.
207 this.updateErrorState();
208 }
209 // We need to dirty-check the native element's value, because there are some cases where
210 // we won't be notified when it changes (e.g. the consumer isn't using forms or they're
211 // updating the value using `emitEvent: false`).
212 this._dirtyCheckNativeValue();
213 // We need to dirty-check and set the placeholder attribute ourselves, because whether it's
214 // present or not depends on a query which is prone to "changed after checked" errors.
215 this._dirtyCheckPlaceholder();
216 }
217 /** Focuses the input. */
218 focus(options) {
219 this._elementRef.nativeElement.focus(options);
220 }
221 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
222 // In Ivy the `host` bindings will be merged when this class is extended, whereas in
223 // ViewEngine they're overwritten.
224 // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
225 /** Callback for the cases where the focused state of the input changes. */
226 // tslint:disable:no-host-decorator-in-concrete
227 // tslint:enable:no-host-decorator-in-concrete
228 _focusChanged(isFocused) {
229 if (isFocused !== this.focused) {
230 this.focused = isFocused;
231 this.stateChanges.next();
232 }
233 }
234 // We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
235 // In Ivy the `host` bindings will be merged when this class is extended, whereas in
236 // ViewEngine they're overwritten.
237 // TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
238 // tslint:disable-next-line:no-host-decorator-in-concrete
239 _onInput() {
240 // This is a noop function and is used to let Angular know whenever the value changes.
241 // Angular will run a new change detection each time the `input` event has been dispatched.
242 // It's necessary that Angular recognizes the value change, because when floatingLabel
243 // is set to false and Angular forms aren't used, the placeholder won't recognize the
244 // value changes and will not disappear.
245 // Listening to the input event wouldn't be necessary when the input is using the
246 // FormsModule or ReactiveFormsModule, because Angular forms also listens to input events.
247 }
248 /** Does some manual dirty checking on the native input `placeholder` attribute. */
249 _dirtyCheckPlaceholder() {
250 var _a, _b;
251 // If we're hiding the native placeholder, it should also be cleared from the DOM, otherwise
252 // screen readers will read it out twice: once from the label and once from the attribute.
253 // TODO: can be removed once we get rid of the `legacy` style for the form field, because it's
254 // the only one that supports promoting the placeholder to a label.
255 const placeholder = ((_b = (_a = this._formField) === null || _a === void 0 ? void 0 : _a._hideControlPlaceholder) === null || _b === void 0 ? void 0 : _b.call(_a)) ? null : this.placeholder;
256 if (placeholder !== this._previousPlaceholder) {
257 const element = this._elementRef.nativeElement;
258 this._previousPlaceholder = placeholder;
259 placeholder ?
260 element.setAttribute('placeholder', placeholder) : element.removeAttribute('placeholder');
261 }
262 }
263 /** Does some manual dirty checking on the native input `value` property. */
264 _dirtyCheckNativeValue() {
265 const newValue = this._elementRef.nativeElement.value;
266 if (this._previousNativeValue !== newValue) {
267 this._previousNativeValue = newValue;
268 this.stateChanges.next();
269 }
270 }
271 /** Make sure the input is a supported type. */
272 _validateType() {
273 if (MAT_INPUT_INVALID_TYPES.indexOf(this._type) > -1 &&
274 (typeof ngDevMode === 'undefined' || ngDevMode)) {
275 throw getMatInputUnsupportedTypeError(this._type);
276 }
277 }
278 /** Checks whether the input type is one of the types that are never empty. */
279 _isNeverEmpty() {
280 return this._neverEmptyInputTypes.indexOf(this._type) > -1;
281 }
282 /** Checks whether the input is invalid based on the native validation. */
283 _isBadInput() {
284 // The `validity` property won't be present on platform-server.
285 let validity = this._elementRef.nativeElement.validity;
286 return validity && validity.badInput;
287 }
288 /**
289 * Implemented as part of MatFormFieldControl.
290 * @docs-private
291 */
292 get empty() {
293 return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() &&
294 !this.autofilled;
295 }
296 /**
297 * Implemented as part of MatFormFieldControl.
298 * @docs-private
299 */
300 get shouldLabelFloat() {
301 if (this._isNativeSelect) {
302 // For a single-selection `<select>`, the label should float when the selected option has
303 // a non-empty display value. For a `<select multiple>`, the label *always* floats to avoid
304 // overlapping the label with the options.
305 const selectElement = this._elementRef.nativeElement;
306 const firstOption = selectElement.options[0];
307 // On most browsers the `selectedIndex` will always be 0, however on IE and Edge it'll be
308 // -1 if the `value` is set to something, that isn't in the list of options, at a later point.
309 return this.focused || selectElement.multiple || !this.empty ||
310 !!(selectElement.selectedIndex > -1 && firstOption && firstOption.label);
311 }
312 else {
313 return this.focused || !this.empty;
314 }
315 }
316 /**
317 * Implemented as part of MatFormFieldControl.
318 * @docs-private
319 */
320 setDescribedByIds(ids) {
321 if (ids.length) {
322 this._elementRef.nativeElement.setAttribute('aria-describedby', ids.join(' '));
323 }
324 else {
325 this._elementRef.nativeElement.removeAttribute('aria-describedby');
326 }
327 }
328 /**
329 * Implemented as part of MatFormFieldControl.
330 * @docs-private
331 */
332 onContainerClick() {
333 // Do not re-focus the input element if the element is already focused. Otherwise it can happen
334 // that someone clicks on a time input and the cursor resets to the "hours" field while the
335 // "minutes" field was actually clicked. See: https://github.com/angular/components/issues/12849
336 if (!this.focused) {
337 this.focus();
338 }
339 }
340 /** Whether the form control is a native select that is displayed inline. */
341 _isInlineSelect() {
342 const element = this._elementRef.nativeElement;
343 return this._isNativeSelect && (element.multiple || element.size > 1);
344 }
345}
346MatInput.decorators = [
347 { type: Directive, args: [{
348 selector: `input[matInput], textarea[matInput], select[matNativeControl],
349 input[matNativeControl], textarea[matNativeControl]`,
350 exportAs: 'matInput',
351 host: {
352 /**
353 * @breaking-change 8.0.0 remove .mat-form-field-autofill-control in favor of AutofillMonitor.
354 */
355 'class': 'mat-input-element mat-form-field-autofill-control',
356 '[class.mat-input-server]': '_isServer',
357 // Native input properties that are overwritten by Angular inputs need to be synced with
358 // the native input element. Otherwise property bindings for those don't work.
359 '[attr.id]': 'id',
360 // At the time of writing, we have a lot of customer tests that look up the input based on its
361 // placeholder. Since we sometimes omit the placeholder attribute from the DOM to prevent screen
362 // readers from reading it twice, we have to keep it somewhere in the DOM for the lookup.
363 '[attr.data-placeholder]': 'placeholder',
364 '[disabled]': 'disabled',
365 '[required]': 'required',
366 '[attr.readonly]': 'readonly && !_isNativeSelect || null',
367 '[class.mat-native-select-inline]': '_isInlineSelect()',
368 // Only mark the input as invalid for assistive technology if it has a value since the
369 // state usually overlaps with `aria-required` when the input is empty and can be redundant.
370 '[attr.aria-invalid]': '(empty && required) ? null : errorState',
371 '[attr.aria-required]': 'required',
372 },
373 providers: [{ provide: MatFormFieldControl, useExisting: MatInput }],
374 },] }
375];
376MatInput.ctorParameters = () => [
377 { type: ElementRef },
378 { type: Platform },
379 { type: NgControl, decorators: [{ type: Optional }, { type: Self }] },
380 { type: NgForm, decorators: [{ type: Optional }] },
381 { type: FormGroupDirective, decorators: [{ type: Optional }] },
382 { type: ErrorStateMatcher },
383 { type: undefined, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [MAT_INPUT_VALUE_ACCESSOR,] }] },
384 { type: AutofillMonitor },
385 { type: NgZone },
386 { type: MatFormField, decorators: [{ type: Optional }, { type: Inject, args: [MAT_FORM_FIELD,] }] }
387];
388MatInput.propDecorators = {
389 disabled: [{ type: Input }],
390 id: [{ type: Input }],
391 placeholder: [{ type: Input }],
392 required: [{ type: Input }],
393 type: [{ type: Input }],
394 errorStateMatcher: [{ type: Input }],
395 userAriaDescribedBy: [{ type: Input, args: ['aria-describedby',] }],
396 value: [{ type: Input }],
397 readonly: [{ type: Input }],
398 _focusChanged: [{ type: HostListener, args: ['focus', ['true'],] }, { type: HostListener, args: ['blur', ['false'],] }],
399 _onInput: [{ type: HostListener, args: ['input',] }]
400};
401//# sourceMappingURL=data:application/json;base64,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