1 | import { AfterViewInit } from '@angular/core';
|
2 | import { BooleanInput } from '@angular/cdk/coercion';
|
3 | import { DoCheck } from '@angular/core';
|
4 | import { ElementRef } from '@angular/core';
|
5 | import { EventEmitter } from '@angular/core';
|
6 | import * as i0 from '@angular/core';
|
7 | import { NgZone } from '@angular/core';
|
8 | import { NumberInput } from '@angular/cdk/coercion';
|
9 | import { Observable } from 'rxjs';
|
10 | import { OnDestroy } from '@angular/core';
|
11 | import { OnInit } from '@angular/core';
|
12 | import { Platform } from '@angular/cdk/platform';
|
13 |
|
14 |
|
15 | export declare type AutofillEvent = {
|
16 |
|
17 | target: Element;
|
18 |
|
19 | isAutofilled: boolean;
|
20 | };
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export declare class AutofillMonitor implements OnDestroy {
|
28 | private _platform;
|
29 | private _ngZone;
|
30 | private _monitoredElements;
|
31 | constructor(_platform: Platform, _ngZone: NgZone);
|
32 | /**
|
33 | * Monitor for changes in the autofill state of the given input element.
|
34 | * @param element The element to monitor.
|
35 | * @return A stream of autofill state changes.
|
36 | */
|
37 | monitor(element: Element): Observable<AutofillEvent>;
|
38 | /**
|
39 | * Monitor for changes in the autofill state of the given input element.
|
40 | * @param element The element to monitor.
|
41 | * @return A stream of autofill state changes.
|
42 | */
|
43 | monitor(element: ElementRef<Element>): Observable<AutofillEvent>;
|
44 | /**
|
45 | * Stop monitoring the autofill state of the given input element.
|
46 | * @param element The element to stop monitoring.
|
47 | */
|
48 | stopMonitoring(element: Element): void;
|
49 | /**
|
50 | * Stop monitoring the autofill state of the given input element.
|
51 | * @param element The element to stop monitoring.
|
52 | */
|
53 | stopMonitoring(element: ElementRef<Element>): void;
|
54 | ngOnDestroy(): void;
|
55 | static ɵfac: i0.ɵɵFactoryDeclaration<AutofillMonitor, never>;
|
56 | static ɵprov: i0.ɵɵInjectableDeclaration<AutofillMonitor>;
|
57 | }
|
58 |
|
59 | /** A directive that can be used to monitor the autofill state of an input. */
|
60 | export declare class CdkAutofill implements OnDestroy, OnInit {
|
61 | private _elementRef;
|
62 | private _autofillMonitor;
|
63 |
|
64 | readonly cdkAutofill: EventEmitter<AutofillEvent>;
|
65 | constructor(_elementRef: ElementRef<HTMLElement>, _autofillMonitor: AutofillMonitor);
|
66 | ngOnInit(): void;
|
67 | ngOnDestroy(): void;
|
68 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkAutofill, never>;
|
69 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkAutofill, "[cdkAutofill]", never, {}, { "cdkAutofill": "cdkAutofill"; }, never, never, false, never>;
|
70 | }
|
71 |
|
72 |
|
73 | export declare class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {
|
74 | private _elementRef;
|
75 | private _platform;
|
76 | private _ngZone;
|
77 |
|
78 | private _previousValue?;
|
79 | private _initialHeight;
|
80 | private readonly _destroyed;
|
81 | private _minRows;
|
82 | private _maxRows;
|
83 | private _enabled;
|
84 | |
85 |
|
86 |
|
87 |
|
88 |
|
89 | private _previousMinRows;
|
90 | private _textareaElement;
|
91 |
|
92 | get minRows(): number;
|
93 | set minRows(value: NumberInput);
|
94 |
|
95 | get maxRows(): number;
|
96 | set maxRows(value: NumberInput);
|
97 |
|
98 | get enabled(): boolean;
|
99 | set enabled(value: BooleanInput);
|
100 | get placeholder(): string;
|
101 | set placeholder(value: string);
|
102 |
|
103 | private _cachedLineHeight;
|
104 |
|
105 | private _cachedPlaceholderHeight?;
|
106 |
|
107 | protected _document?: Document;
|
108 | private _hasFocus;
|
109 | private _isViewInited;
|
110 | constructor(_elementRef: ElementRef<HTMLElement>, _platform: Platform, _ngZone: NgZone,
|
111 |
|
112 | document?: any);
|
113 | /** Sets the minimum height of the textarea as determined by minRows. */
|
114 | _setMinHeight(): void;
|
115 | /** Sets the maximum height of the textarea as determined by maxRows. */
|
116 | _setMaxHeight(): void;
|
117 | ngAfterViewInit(): void;
|
118 | ngOnDestroy(): void;
|
119 | /**
|
120 | * Cache the height of a single-row textarea if it has not already been cached.
|
121 | *
|
122 | * We need to know how large a single "row" of a textarea is in order to apply minRows and
|
123 | * maxRows. For the initial version, we will assume that the height of a single line in the
|
124 | * textarea does not ever change.
|
125 | */
|
126 | private _cacheTextareaLineHeight;
|
127 | private _measureScrollHeight;
|
128 | private _cacheTextareaPlaceholderHeight;
|
129 | /** Handles `focus` and `blur` events. */
|
130 | private _handleFocusEvent;
|
131 | ngDoCheck(): void;
|
132 | /**
|
133 | * Resize the textarea to fit its content.
|
134 | * @param force Whether to force a height recalculation. By default the height will be
|
135 | * recalculated only if the value changed since the last call.
|
136 | */
|
137 | resizeToFitContent(force?: boolean): void;
|
138 | /**
|
139 | * Resets the textarea to its original size
|
140 | */
|
141 | reset(): void;
|
142 | _noopInputHandler(): void;
|
143 | /** Access injected document if available or fallback to global document reference */
|
144 | private _getDocument;
|
145 | /** Use defaultView of injected document if available or fallback to global window reference */
|
146 | private _getWindow;
|
147 | /**
|
148 | * Scrolls a textarea to the caret position. On Firefox resizing the textarea will
|
149 | * prevent it from scrolling to the caret position. We need to re-set the selection
|
150 | * in order for it to scroll to the proper position.
|
151 | */
|
152 | private _scrollToCaretPosition;
|
153 | static ɵfac: i0.ɵɵFactoryDeclaration<CdkTextareaAutosize, [null, null, null, { optional: true; }]>;
|
154 | static ɵdir: i0.ɵɵDirectiveDeclaration<CdkTextareaAutosize, "textarea[cdkTextareaAutosize]", ["cdkTextareaAutosize"], { "minRows": { "alias": "cdkAutosizeMinRows"; "required": false; }; "maxRows": { "alias": "cdkAutosizeMaxRows"; "required": false; }; "enabled": { "alias": "cdkTextareaAutosize"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, {}, never, never, false, never>;
|
155 | }
|
156 |
|
157 | declare namespace i1 {
|
158 | export {
|
159 | AutofillEvent,
|
160 | AutofillMonitor,
|
161 | CdkAutofill
|
162 | }
|
163 | }
|
164 |
|
165 | declare namespace i2 {
|
166 | export {
|
167 | CdkTextareaAutosize
|
168 | }
|
169 | }
|
170 |
|
171 | export declare class TextFieldModule {
|
172 | static ɵfac: i0.ɵɵFactoryDeclaration<TextFieldModule, never>;
|
173 | static ɵmod: i0.ɵɵNgModuleDeclaration<TextFieldModule, [typeof i1.CdkAutofill, typeof i2.CdkTextareaAutosize], never, [typeof i1.CdkAutofill, typeof i2.CdkTextareaAutosize]>;
|
174 | static ɵinj: i0.ɵɵInjectorDeclaration<TextFieldModule>;
|
175 | }
|
176 |
|
177 | export { }
|