1 | import { _AbstractConstructor } from '@angular/material/core';
|
2 | import { AfterViewInit } from '@angular/core';
|
3 | import { BooleanInput } from '@angular/cdk/coercion';
|
4 | import { CanColor } from '@angular/material/core';
|
5 | import { CanDisable } from '@angular/material/core';
|
6 | import { ChangeDetectorRef } from '@angular/core';
|
7 | import { _Constructor } from '@angular/material/core';
|
8 | import { ControlValueAccessor } from '@angular/forms';
|
9 | import { Directionality } from '@angular/cdk/bidi';
|
10 | import { ElementRef } from '@angular/core';
|
11 | import { EventEmitter } from '@angular/core';
|
12 | import { FocusMonitor } from '@angular/cdk/a11y';
|
13 | import { HasTabIndex } from '@angular/material/core';
|
14 | import * as i0 from '@angular/core';
|
15 | import * as i2 from '@angular/common';
|
16 | import * as i3 from '@angular/material/core';
|
17 | import { NgZone } from '@angular/core';
|
18 | import { NumberInput } from '@angular/cdk/coercion';
|
19 | import { OnDestroy } from '@angular/core';
|
20 |
|
21 | declare namespace i1 {
|
22 | export {
|
23 | MAT_SLIDER_VALUE_ACCESSOR,
|
24 | MatSliderChange,
|
25 | MatSlider
|
26 | }
|
27 | }
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | export declare const MAT_SLIDER_VALUE_ACCESSOR: any;
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | export declare class MatSlider extends _MatSliderBase implements ControlValueAccessor, OnDestroy, CanDisable, CanColor, AfterViewInit, HasTabIndex {
|
41 | private _focusMonitor;
|
42 | private _changeDetectorRef;
|
43 | private _dir;
|
44 | private _ngZone;
|
45 | _animationMode?: string | undefined;
|
46 |
|
47 | get invert(): boolean;
|
48 | set invert(value: BooleanInput);
|
49 | private _invert;
|
50 |
|
51 | get max(): number;
|
52 | set max(v: NumberInput);
|
53 | private _max;
|
54 |
|
55 | get min(): number;
|
56 | set min(v: NumberInput);
|
57 | private _min;
|
58 |
|
59 | get step(): number;
|
60 | set step(v: NumberInput);
|
61 | private _step;
|
62 |
|
63 | get thumbLabel(): boolean;
|
64 | set thumbLabel(value: BooleanInput);
|
65 | private _thumbLabel;
|
66 | |
67 |
|
68 |
|
69 |
|
70 | get tickInterval(): 'auto' | number;
|
71 | set tickInterval(value: 'auto' | NumberInput);
|
72 | private _tickInterval;
|
73 |
|
74 | get value(): number;
|
75 | set value(v: NumberInput);
|
76 | private _value;
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 | displayWith: (value: number) => string | number;
|
83 |
|
84 | valueText: string;
|
85 |
|
86 | get vertical(): boolean;
|
87 | set vertical(value: BooleanInput);
|
88 | private _vertical;
|
89 |
|
90 | readonly change: EventEmitter<MatSliderChange>;
|
91 |
|
92 | readonly input: EventEmitter<MatSliderChange>;
|
93 | |
94 |
|
95 |
|
96 |
|
97 |
|
98 | readonly valueChange: EventEmitter<number | null>;
|
99 |
|
100 | get displayValue(): string | number;
|
101 |
|
102 | focus(options?: FocusOptions): void;
|
103 |
|
104 | blur(): void;
|
105 |
|
106 | onTouched: () => any;
|
107 |
|
108 | get percent(): number;
|
109 | private _percent;
|
110 | |
111 |
|
112 |
|
113 |
|
114 | _isSliding: 'keyboard' | 'pointer' | null;
|
115 | |
116 |
|
117 |
|
118 |
|
119 | _isActive: boolean;
|
120 | |
121 |
|
122 |
|
123 |
|
124 | _shouldInvertAxis(): boolean;
|
125 |
|
126 | _isMinValue(): boolean;
|
127 | |
128 |
|
129 |
|
130 |
|
131 | _getThumbGap(): 7 | 10 | 0;
|
132 |
|
133 | _getTrackBackgroundStyles(): {
|
134 | [key: string]: string;
|
135 | };
|
136 |
|
137 | _getTrackFillStyles(): {
|
138 | [key: string]: string;
|
139 | };
|
140 |
|
141 | _getTicksContainerStyles(): {
|
142 | [key: string]: string;
|
143 | };
|
144 |
|
145 | _getTicksStyles(): {
|
146 | [key: string]: string;
|
147 | };
|
148 | _getThumbContainerStyles(): {
|
149 | [key: string]: string;
|
150 | };
|
151 |
|
152 | private _tickIntervalPercent;
|
153 |
|
154 | private _sliderDimensions;
|
155 | private _controlValueAccessorChangeFn;
|
156 |
|
157 | private _roundToDecimal;
|
158 |
|
159 | private _dirChangeSubscription;
|
160 |
|
161 | private _valueOnSlideStart;
|
162 |
|
163 | private _sliderWrapper;
|
164 | |
165 |
|
166 |
|
167 |
|
168 | _shouldInvertMouseCoords(): boolean;
|
169 |
|
170 | private _getDirection;
|
171 |
|
172 | private _lastPointerEvent;
|
173 |
|
174 | protected _document: Document;
|
175 | |
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 | private _touchId;
|
183 | constructor(elementRef: ElementRef, _focusMonitor: FocusMonitor, _changeDetectorRef: ChangeDetectorRef, _dir: Directionality, tabIndex: string, _ngZone: NgZone, _document: any, _animationMode?: string | undefined);
|
184 | ngAfterViewInit(): void;
|
185 | ngOnDestroy(): void;
|
186 | _onMouseenter(): void;
|
187 | _onFocus(): void;
|
188 | _onBlur(): void;
|
189 | _onKeydown(event: KeyboardEvent): void;
|
190 | _onKeyup(): void;
|
191 | /** Called when the user has put their pointer down on the slider. */
|
192 | private _pointerDown;
|
193 | /**
|
194 | * Called when the user has moved their pointer after
|
195 | * starting to drag. Bound on the document level.
|
196 | */
|
197 | private _pointerMove;
|
198 | /** Called when the user has lifted their pointer. Bound on the document level. */
|
199 | private _pointerUp;
|
200 | /** Called when the window has lost focus. */
|
201 | private _windowBlur;
|
202 | /** Use defaultView of injected document if available or fallback to global window reference */
|
203 | private _getWindow;
|
204 | /**
|
205 | * Binds our global move and end events. They're bound at the document level and only while
|
206 | * dragging so that the user doesn't have to keep their pointer exactly over the slider
|
207 | * as they're swiping across the screen.
|
208 | */
|
209 | private _bindGlobalEvents;
|
210 | /** Removes any global event listeners that we may have added. */
|
211 | private _removeGlobalEvents;
|
212 | /** Increments the slider by the given number of steps (negative number decrements). */
|
213 | private _increment;
|
214 | /** Calculate the new value from the new physical location. The value will always be snapped. */
|
215 | private _updateValueFromPosition;
|
216 | /** Emits a change event if the current value is different from the last emitted value. */
|
217 | private _emitChangeEvent;
|
218 | /** Emits an input event when the current value is different from the last emitted value. */
|
219 | private _emitInputEvent;
|
220 | /** Updates the amount of space between ticks as a percentage of the width of the slider. */
|
221 | private _updateTickIntervalPercent;
|
222 | /** Creates a slider change object from the specified value. */
|
223 | private _createChangeEvent;
|
224 | /** Calculates the percentage of the slider that a value is. */
|
225 | private _calculatePercentage;
|
226 | /** Calculates the value a percentage of the slider corresponds to. */
|
227 | private _calculateValue;
|
228 | /** Return a number between two numbers. */
|
229 | private _clamp;
|
230 | /**
|
231 | * Get the bounding client rect of the slider track element.
|
232 | * The track is used rather than the native element to ignore the extra space that the thumb can
|
233 | * take up.
|
234 | */
|
235 | private _getSliderDimensions;
|
236 | /**
|
237 | * Focuses the native element.
|
238 | * Currently only used to allow a blur event to fire but will be used with keyboard input later.
|
239 | */
|
240 | private _focusHostElement;
|
241 | /** Blurs the native element. */
|
242 | private _blurHostElement;
|
243 | /**
|
244 | * Sets the model value. Implemented as part of ControlValueAccessor.
|
245 | * @param value
|
246 | */
|
247 | writeValue(value: any): void;
|
248 | /**
|
249 | * Registers a callback to be triggered when the value has changed.
|
250 | * Implemented as part of ControlValueAccessor.
|
251 | * @param fn Callback to be registered.
|
252 | */
|
253 | registerOnChange(fn: (value: any) => void): void;
|
254 | /**
|
255 | * Registers a callback to be triggered when the component is touched.
|
256 | * Implemented as part of ControlValueAccessor.
|
257 | * @param fn Callback to be registered.
|
258 | */
|
259 | registerOnTouched(fn: any): void;
|
260 | /**
|
261 | * Sets whether the component should be disabled.
|
262 | * Implemented as part of ControlValueAccessor.
|
263 | * @param isDisabled
|
264 | */
|
265 | setDisabledState(isDisabled: boolean): void;
|
266 | static ɵfac: i0.ɵɵFactoryDeclaration<MatSlider, [null, null, null, { optional: true; }, { attribute: "tabindex"; }, null, null, { optional: true; }]>;
|
267 | static ɵcmp: i0.ɵɵComponentDeclaration<MatSlider, "mat-slider", ["matSlider"], { "disabled": "disabled"; "color": "color"; "tabIndex": "tabIndex"; "invert": "invert"; "max": "max"; "min": "min"; "step": "step"; "thumbLabel": "thumbLabel"; "tickInterval": "tickInterval"; "value": "value"; "displayWith": "displayWith"; "valueText": "valueText"; "vertical": "vertical"; }, { "change": "change"; "input": "input"; "valueChange": "valueChange"; }, never, never, false>;
|
268 | }
|
269 |
|
270 |
|
271 | declare const _MatSliderBase: _Constructor<HasTabIndex> & _AbstractConstructor<HasTabIndex> & _Constructor<CanColor> & _AbstractConstructor<CanColor> & _Constructor<CanDisable> & _AbstractConstructor<CanDisable> & {
|
272 | new (_elementRef: ElementRef): {
|
273 | _elementRef: ElementRef;
|
274 | };
|
275 | };
|
276 |
|
277 |
|
278 | export declare class MatSliderChange {
|
279 |
|
280 | source: MatSlider;
|
281 |
|
282 | value: number | null;
|
283 | }
|
284 |
|
285 | export declare class MatSliderModule {
|
286 | static ɵfac: i0.ɵɵFactoryDeclaration<MatSliderModule, never>;
|
287 | static ɵmod: i0.ɵɵNgModuleDeclaration<MatSliderModule, [typeof i1.MatSlider], [typeof i2.CommonModule, typeof i3.MatCommonModule], [typeof i1.MatSlider, typeof i3.MatCommonModule]>;
|
288 | static ɵinj: i0.ɵɵInjectorDeclaration<MatSliderModule>;
|
289 | }
|
290 |
|
291 | export { }
|