source: trip-planner-front/node_modules/@angular/material/esm2015/slider/slider.js@ 84d0fbb

Last change on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 120.9 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 { FocusMonitor } from '@angular/cdk/a11y';
9import { Directionality } from '@angular/cdk/bidi';
10import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
11import { DOWN_ARROW, END, HOME, LEFT_ARROW, PAGE_DOWN, PAGE_UP, RIGHT_ARROW, UP_ARROW, hasModifierKey, } from '@angular/cdk/keycodes';
12import { Attribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, forwardRef, Inject, Input, Optional, Output, ViewChild, ViewEncapsulation, NgZone, } from '@angular/core';
13import { NG_VALUE_ACCESSOR } from '@angular/forms';
14import { mixinColor, mixinDisabled, mixinTabIndex, } from '@angular/material/core';
15import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
16import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
17import { DOCUMENT } from '@angular/common';
18import { Subscription } from 'rxjs';
19const activeEventOptions = normalizePassiveListenerOptions({ passive: false });
20/**
21 * Visually, a 30px separation between tick marks looks best. This is very subjective but it is
22 * the default separation we chose.
23 */
24const MIN_AUTO_TICK_SEPARATION = 30;
25/** The thumb gap size for a disabled slider. */
26const DISABLED_THUMB_GAP = 7;
27/** The thumb gap size for a non-active slider at its minimum value. */
28const MIN_VALUE_NONACTIVE_THUMB_GAP = 7;
29/** The thumb gap size for an active slider at its minimum value. */
30const MIN_VALUE_ACTIVE_THUMB_GAP = 10;
31/**
32 * Provider Expression that allows mat-slider to register as a ControlValueAccessor.
33 * This allows it to support [(ngModel)] and [formControl].
34 * @docs-private
35 */
36export const MAT_SLIDER_VALUE_ACCESSOR = {
37 provide: NG_VALUE_ACCESSOR,
38 useExisting: forwardRef(() => MatSlider),
39 multi: true
40};
41/** A simple change event emitted by the MatSlider component. */
42export class MatSliderChange {
43}
44// Boilerplate for applying mixins to MatSlider.
45/** @docs-private */
46const _MatSliderBase = mixinTabIndex(mixinColor(mixinDisabled(class {
47 constructor(_elementRef) {
48 this._elementRef = _elementRef;
49 }
50}), 'accent'));
51/**
52 * Allows users to select from a range of values by moving the slider thumb. It is similar in
53 * behavior to the native `<input type="range">` element.
54 */
55export class MatSlider extends _MatSliderBase {
56 constructor(elementRef, _focusMonitor, _changeDetectorRef, _dir, tabIndex, _ngZone, _document, _animationMode) {
57 super(elementRef);
58 this._focusMonitor = _focusMonitor;
59 this._changeDetectorRef = _changeDetectorRef;
60 this._dir = _dir;
61 this._ngZone = _ngZone;
62 this._animationMode = _animationMode;
63 this._invert = false;
64 this._max = 100;
65 this._min = 0;
66 this._step = 1;
67 this._thumbLabel = false;
68 this._tickInterval = 0;
69 this._value = null;
70 this._vertical = false;
71 /** Event emitted when the slider value has changed. */
72 this.change = new EventEmitter();
73 /** Event emitted when the slider thumb moves. */
74 this.input = new EventEmitter();
75 /**
76 * Emits when the raw value of the slider changes. This is here primarily
77 * to facilitate the two-way binding for the `value` input.
78 * @docs-private
79 */
80 this.valueChange = new EventEmitter();
81 /** onTouch function registered via registerOnTouch (ControlValueAccessor). */
82 this.onTouched = () => { };
83 this._percent = 0;
84 /**
85 * Whether or not the thumb is sliding and what the user is using to slide it with.
86 * Used to determine if there should be a transition for the thumb and fill track.
87 */
88 this._isSliding = null;
89 /**
90 * Whether or not the slider is active (clicked or sliding).
91 * Used to shrink and grow the thumb as according to the Material Design spec.
92 */
93 this._isActive = false;
94 /** The size of a tick interval as a percentage of the size of the track. */
95 this._tickIntervalPercent = 0;
96 /** The dimensions of the slider. */
97 this._sliderDimensions = null;
98 this._controlValueAccessorChangeFn = () => { };
99 /** Subscription to the Directionality change EventEmitter. */
100 this._dirChangeSubscription = Subscription.EMPTY;
101 /** Called when the user has put their pointer down on the slider. */
102 this._pointerDown = (event) => {
103 // Don't do anything if the slider is disabled or the
104 // user is using anything other than the main mouse button.
105 if (this.disabled || this._isSliding || (!isTouchEvent(event) && event.button !== 0)) {
106 return;
107 }
108 this._ngZone.run(() => {
109 this._touchId = isTouchEvent(event) ?
110 getTouchIdForSlider(event, this._elementRef.nativeElement) : undefined;
111 const pointerPosition = getPointerPositionOnPage(event, this._touchId);
112 if (pointerPosition) {
113 const oldValue = this.value;
114 this._isSliding = 'pointer';
115 this._lastPointerEvent = event;
116 event.preventDefault();
117 this._focusHostElement();
118 this._onMouseenter(); // Simulate mouseenter in case this is a mobile device.
119 this._bindGlobalEvents(event);
120 this._focusHostElement();
121 this._updateValueFromPosition(pointerPosition);
122 this._valueOnSlideStart = oldValue;
123 // Emit a change and input event if the value changed.
124 if (oldValue != this.value) {
125 this._emitInputEvent();
126 }
127 }
128 });
129 };
130 /**
131 * Called when the user has moved their pointer after
132 * starting to drag. Bound on the document level.
133 */
134 this._pointerMove = (event) => {
135 if (this._isSliding === 'pointer') {
136 const pointerPosition = getPointerPositionOnPage(event, this._touchId);
137 if (pointerPosition) {
138 // Prevent the slide from selecting anything else.
139 event.preventDefault();
140 const oldValue = this.value;
141 this._lastPointerEvent = event;
142 this._updateValueFromPosition(pointerPosition);
143 // Native range elements always emit `input` events when the value changed while sliding.
144 if (oldValue != this.value) {
145 this._emitInputEvent();
146 }
147 }
148 }
149 };
150 /** Called when the user has lifted their pointer. Bound on the document level. */
151 this._pointerUp = (event) => {
152 if (this._isSliding === 'pointer') {
153 if (!isTouchEvent(event) || typeof this._touchId !== 'number' ||
154 // Note that we use `changedTouches`, rather than `touches` because it
155 // seems like in most cases `touches` is empty for `touchend` events.
156 findMatchingTouch(event.changedTouches, this._touchId)) {
157 event.preventDefault();
158 this._removeGlobalEvents();
159 this._isSliding = null;
160 this._touchId = undefined;
161 if (this._valueOnSlideStart != this.value && !this.disabled) {
162 this._emitChangeEvent();
163 }
164 this._valueOnSlideStart = this._lastPointerEvent = null;
165 }
166 }
167 };
168 /** Called when the window has lost focus. */
169 this._windowBlur = () => {
170 // If the window is blurred while dragging we need to stop dragging because the
171 // browser won't dispatch the `mouseup` and `touchend` events anymore.
172 if (this._lastPointerEvent) {
173 this._pointerUp(this._lastPointerEvent);
174 }
175 };
176 this._document = _document;
177 this.tabIndex = parseInt(tabIndex) || 0;
178 _ngZone.runOutsideAngular(() => {
179 const element = elementRef.nativeElement;
180 element.addEventListener('mousedown', this._pointerDown, activeEventOptions);
181 element.addEventListener('touchstart', this._pointerDown, activeEventOptions);
182 });
183 }
184 /** Whether the slider is inverted. */
185 get invert() { return this._invert; }
186 set invert(value) {
187 this._invert = coerceBooleanProperty(value);
188 }
189 /** The maximum value that the slider can have. */
190 get max() { return this._max; }
191 set max(v) {
192 this._max = coerceNumberProperty(v, this._max);
193 this._percent = this._calculatePercentage(this._value);
194 // Since this also modifies the percentage, we need to let the change detection know.
195 this._changeDetectorRef.markForCheck();
196 }
197 /** The minimum value that the slider can have. */
198 get min() { return this._min; }
199 set min(v) {
200 this._min = coerceNumberProperty(v, this._min);
201 this._percent = this._calculatePercentage(this._value);
202 // Since this also modifies the percentage, we need to let the change detection know.
203 this._changeDetectorRef.markForCheck();
204 }
205 /** The values at which the thumb will snap. */
206 get step() { return this._step; }
207 set step(v) {
208 this._step = coerceNumberProperty(v, this._step);
209 if (this._step % 1 !== 0) {
210 this._roundToDecimal = this._step.toString().split('.').pop().length;
211 }
212 // Since this could modify the label, we need to notify the change detection.
213 this._changeDetectorRef.markForCheck();
214 }
215 /** Whether or not to show the thumb label. */
216 get thumbLabel() { return this._thumbLabel; }
217 set thumbLabel(value) { this._thumbLabel = coerceBooleanProperty(value); }
218 /**
219 * How often to show ticks. Relative to the step so that a tick always appears on a step.
220 * Ex: Tick interval of 4 with a step of 3 will draw a tick every 4 steps (every 12 values).
221 */
222 get tickInterval() { return this._tickInterval; }
223 set tickInterval(value) {
224 if (value === 'auto') {
225 this._tickInterval = 'auto';
226 }
227 else if (typeof value === 'number' || typeof value === 'string') {
228 this._tickInterval = coerceNumberProperty(value, this._tickInterval);
229 }
230 else {
231 this._tickInterval = 0;
232 }
233 }
234 /** Value of the slider. */
235 get value() {
236 // If the value needs to be read and it is still uninitialized, initialize it to the min.
237 if (this._value === null) {
238 this.value = this._min;
239 }
240 return this._value;
241 }
242 set value(v) {
243 if (v !== this._value) {
244 let value = coerceNumberProperty(v, 0);
245 // While incrementing by a decimal we can end up with values like 33.300000000000004.
246 // Truncate it to ensure that it matches the label and to make it easier to work with.
247 if (this._roundToDecimal && value !== this.min && value !== this.max) {
248 value = parseFloat(value.toFixed(this._roundToDecimal));
249 }
250 this._value = value;
251 this._percent = this._calculatePercentage(this._value);
252 // Since this also modifies the percentage, we need to let the change detection know.
253 this._changeDetectorRef.markForCheck();
254 }
255 }
256 /** Whether the slider is vertical. */
257 get vertical() { return this._vertical; }
258 set vertical(value) {
259 this._vertical = coerceBooleanProperty(value);
260 }
261 /** The value to be used for display purposes. */
262 get displayValue() {
263 if (this.displayWith) {
264 // Value is never null but since setters and getters cannot have
265 // different types, the value getter is also typed to return null.
266 return this.displayWith(this.value);
267 }
268 // Note that this could be improved further by rounding something like 0.999 to 1 or
269 // 0.899 to 0.9, however it is very performance sensitive, because it gets called on
270 // every change detection cycle.
271 if (this._roundToDecimal && this.value && this.value % 1 !== 0) {
272 return this.value.toFixed(this._roundToDecimal);
273 }
274 return this.value || 0;
275 }
276 /** set focus to the host element */
277 focus(options) {
278 this._focusHostElement(options);
279 }
280 /** blur the host element */
281 blur() {
282 this._blurHostElement();
283 }
284 /** The percentage of the slider that coincides with the value. */
285 get percent() { return this._clamp(this._percent); }
286 /**
287 * Whether the axis of the slider is inverted.
288 * (i.e. whether moving the thumb in the positive x or y direction decreases the slider's value).
289 */
290 _shouldInvertAxis() {
291 // Standard non-inverted mode for a vertical slider should be dragging the thumb from bottom to
292 // top. However from a y-axis standpoint this is inverted.
293 return this.vertical ? !this.invert : this.invert;
294 }
295 /** Whether the slider is at its minimum value. */
296 _isMinValue() {
297 return this.percent === 0;
298 }
299 /**
300 * The amount of space to leave between the slider thumb and the track fill & track background
301 * elements.
302 */
303 _getThumbGap() {
304 if (this.disabled) {
305 return DISABLED_THUMB_GAP;
306 }
307 if (this._isMinValue() && !this.thumbLabel) {
308 return this._isActive ? MIN_VALUE_ACTIVE_THUMB_GAP : MIN_VALUE_NONACTIVE_THUMB_GAP;
309 }
310 return 0;
311 }
312 /** CSS styles for the track background element. */
313 _getTrackBackgroundStyles() {
314 const axis = this.vertical ? 'Y' : 'X';
315 const scale = this.vertical ? `1, ${1 - this.percent}, 1` : `${1 - this.percent}, 1, 1`;
316 const sign = this._shouldInvertMouseCoords() ? '-' : '';
317 return {
318 // scale3d avoids some rendering issues in Chrome. See #12071.
319 transform: `translate${axis}(${sign}${this._getThumbGap()}px) scale3d(${scale})`
320 };
321 }
322 /** CSS styles for the track fill element. */
323 _getTrackFillStyles() {
324 const percent = this.percent;
325 const axis = this.vertical ? 'Y' : 'X';
326 const scale = this.vertical ? `1, ${percent}, 1` : `${percent}, 1, 1`;
327 const sign = this._shouldInvertMouseCoords() ? '' : '-';
328 return {
329 // scale3d avoids some rendering issues in Chrome. See #12071.
330 transform: `translate${axis}(${sign}${this._getThumbGap()}px) scale3d(${scale})`,
331 // iOS Safari has a bug where it won't re-render elements which start of as `scale(0)` until
332 // something forces a style recalculation on it. Since we'll end up with `scale(0)` when
333 // the value of the slider is 0, we can easily get into this situation. We force a
334 // recalculation by changing the element's `display` when it goes from 0 to any other value.
335 display: percent === 0 ? 'none' : ''
336 };
337 }
338 /** CSS styles for the ticks container element. */
339 _getTicksContainerStyles() {
340 let axis = this.vertical ? 'Y' : 'X';
341 // For a horizontal slider in RTL languages we push the ticks container off the left edge
342 // instead of the right edge to avoid causing a horizontal scrollbar to appear.
343 let sign = !this.vertical && this._getDirection() == 'rtl' ? '' : '-';
344 let offset = this._tickIntervalPercent / 2 * 100;
345 return {
346 'transform': `translate${axis}(${sign}${offset}%)`
347 };
348 }
349 /** CSS styles for the ticks element. */
350 _getTicksStyles() {
351 let tickSize = this._tickIntervalPercent * 100;
352 let backgroundSize = this.vertical ? `2px ${tickSize}%` : `${tickSize}% 2px`;
353 let axis = this.vertical ? 'Y' : 'X';
354 // Depending on the direction we pushed the ticks container, push the ticks the opposite
355 // direction to re-center them but clip off the end edge. In RTL languages we need to flip the
356 // ticks 180 degrees so we're really cutting off the end edge abd not the start.
357 let sign = !this.vertical && this._getDirection() == 'rtl' ? '-' : '';
358 let rotate = !this.vertical && this._getDirection() == 'rtl' ? ' rotate(180deg)' : '';
359 let styles = {
360 'backgroundSize': backgroundSize,
361 // Without translateZ ticks sometimes jitter as the slider moves on Chrome & Firefox.
362 'transform': `translateZ(0) translate${axis}(${sign}${tickSize / 2}%)${rotate}`
363 };
364 if (this._isMinValue() && this._getThumbGap()) {
365 const shouldInvertAxis = this._shouldInvertAxis();
366 let side;
367 if (this.vertical) {
368 side = shouldInvertAxis ? 'Bottom' : 'Top';
369 }
370 else {
371 side = shouldInvertAxis ? 'Right' : 'Left';
372 }
373 styles[`padding${side}`] = `${this._getThumbGap()}px`;
374 }
375 return styles;
376 }
377 _getThumbContainerStyles() {
378 const shouldInvertAxis = this._shouldInvertAxis();
379 let axis = this.vertical ? 'Y' : 'X';
380 // For a horizontal slider in RTL languages we push the thumb container off the left edge
381 // instead of the right edge to avoid causing a horizontal scrollbar to appear.
382 let invertOffset = (this._getDirection() == 'rtl' && !this.vertical) ? !shouldInvertAxis : shouldInvertAxis;
383 let offset = (invertOffset ? this.percent : 1 - this.percent) * 100;
384 return {
385 'transform': `translate${axis}(-${offset}%)`
386 };
387 }
388 /**
389 * Whether mouse events should be converted to a slider position by calculating their distance
390 * from the right or bottom edge of the slider as opposed to the top or left.
391 */
392 _shouldInvertMouseCoords() {
393 const shouldInvertAxis = this._shouldInvertAxis();
394 return (this._getDirection() == 'rtl' && !this.vertical) ? !shouldInvertAxis : shouldInvertAxis;
395 }
396 /** The language direction for this slider element. */
397 _getDirection() {
398 return (this._dir && this._dir.value == 'rtl') ? 'rtl' : 'ltr';
399 }
400 ngAfterViewInit() {
401 this._focusMonitor
402 .monitor(this._elementRef, true)
403 .subscribe((origin) => {
404 this._isActive = !!origin && origin !== 'keyboard';
405 this._changeDetectorRef.detectChanges();
406 });
407 if (this._dir) {
408 this._dirChangeSubscription = this._dir.change.subscribe(() => {
409 this._changeDetectorRef.markForCheck();
410 });
411 }
412 }
413 ngOnDestroy() {
414 const element = this._elementRef.nativeElement;
415 element.removeEventListener('mousedown', this._pointerDown, activeEventOptions);
416 element.removeEventListener('touchstart', this._pointerDown, activeEventOptions);
417 this._lastPointerEvent = null;
418 this._removeGlobalEvents();
419 this._focusMonitor.stopMonitoring(this._elementRef);
420 this._dirChangeSubscription.unsubscribe();
421 }
422 _onMouseenter() {
423 if (this.disabled) {
424 return;
425 }
426 // We save the dimensions of the slider here so we can use them to update the spacing of the
427 // ticks and determine where on the slider click and slide events happen.
428 this._sliderDimensions = this._getSliderDimensions();
429 this._updateTickIntervalPercent();
430 }
431 _onFocus() {
432 // We save the dimensions of the slider here so we can use them to update the spacing of the
433 // ticks and determine where on the slider click and slide events happen.
434 this._sliderDimensions = this._getSliderDimensions();
435 this._updateTickIntervalPercent();
436 }
437 _onBlur() {
438 this.onTouched();
439 }
440 _onKeydown(event) {
441 if (this.disabled || hasModifierKey(event) ||
442 (this._isSliding && this._isSliding !== 'keyboard')) {
443 return;
444 }
445 const oldValue = this.value;
446 switch (event.keyCode) {
447 case PAGE_UP:
448 this._increment(10);
449 break;
450 case PAGE_DOWN:
451 this._increment(-10);
452 break;
453 case END:
454 this.value = this.max;
455 break;
456 case HOME:
457 this.value = this.min;
458 break;
459 case LEFT_ARROW:
460 // NOTE: For a sighted user it would make more sense that when they press an arrow key on an
461 // inverted slider the thumb moves in that direction. However for a blind user, nothing
462 // about the slider indicates that it is inverted. They will expect left to be decrement,
463 // regardless of how it appears on the screen. For speakers ofRTL languages, they probably
464 // expect left to mean increment. Therefore we flip the meaning of the side arrow keys for
465 // RTL. For inverted sliders we prefer a good a11y experience to having it "look right" for
466 // sighted users, therefore we do not swap the meaning.
467 this._increment(this._getDirection() == 'rtl' ? 1 : -1);
468 break;
469 case UP_ARROW:
470 this._increment(1);
471 break;
472 case RIGHT_ARROW:
473 // See comment on LEFT_ARROW about the conditions under which we flip the meaning.
474 this._increment(this._getDirection() == 'rtl' ? -1 : 1);
475 break;
476 case DOWN_ARROW:
477 this._increment(-1);
478 break;
479 default:
480 // Return if the key is not one that we explicitly handle to avoid calling preventDefault on
481 // it.
482 return;
483 }
484 if (oldValue != this.value) {
485 this._emitInputEvent();
486 this._emitChangeEvent();
487 }
488 this._isSliding = 'keyboard';
489 event.preventDefault();
490 }
491 _onKeyup() {
492 if (this._isSliding === 'keyboard') {
493 this._isSliding = null;
494 }
495 }
496 /** Use defaultView of injected document if available or fallback to global window reference */
497 _getWindow() {
498 return this._document.defaultView || window;
499 }
500 /**
501 * Binds our global move and end events. They're bound at the document level and only while
502 * dragging so that the user doesn't have to keep their pointer exactly over the slider
503 * as they're swiping across the screen.
504 */
505 _bindGlobalEvents(triggerEvent) {
506 // Note that we bind the events to the `document`, because it allows us to capture
507 // drag cancel events where the user's pointer is outside the browser window.
508 const document = this._document;
509 const isTouch = isTouchEvent(triggerEvent);
510 const moveEventName = isTouch ? 'touchmove' : 'mousemove';
511 const endEventName = isTouch ? 'touchend' : 'mouseup';
512 document.addEventListener(moveEventName, this._pointerMove, activeEventOptions);
513 document.addEventListener(endEventName, this._pointerUp, activeEventOptions);
514 if (isTouch) {
515 document.addEventListener('touchcancel', this._pointerUp, activeEventOptions);
516 }
517 const window = this._getWindow();
518 if (typeof window !== 'undefined' && window) {
519 window.addEventListener('blur', this._windowBlur);
520 }
521 }
522 /** Removes any global event listeners that we may have added. */
523 _removeGlobalEvents() {
524 const document = this._document;
525 document.removeEventListener('mousemove', this._pointerMove, activeEventOptions);
526 document.removeEventListener('mouseup', this._pointerUp, activeEventOptions);
527 document.removeEventListener('touchmove', this._pointerMove, activeEventOptions);
528 document.removeEventListener('touchend', this._pointerUp, activeEventOptions);
529 document.removeEventListener('touchcancel', this._pointerUp, activeEventOptions);
530 const window = this._getWindow();
531 if (typeof window !== 'undefined' && window) {
532 window.removeEventListener('blur', this._windowBlur);
533 }
534 }
535 /** Increments the slider by the given number of steps (negative number decrements). */
536 _increment(numSteps) {
537 this.value = this._clamp((this.value || 0) + this.step * numSteps, this.min, this.max);
538 }
539 /** Calculate the new value from the new physical location. The value will always be snapped. */
540 _updateValueFromPosition(pos) {
541 if (!this._sliderDimensions) {
542 return;
543 }
544 let offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;
545 let size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;
546 let posComponent = this.vertical ? pos.y : pos.x;
547 // The exact value is calculated from the event and used to find the closest snap value.
548 let percent = this._clamp((posComponent - offset) / size);
549 if (this._shouldInvertMouseCoords()) {
550 percent = 1 - percent;
551 }
552 // Since the steps may not divide cleanly into the max value, if the user
553 // slid to 0 or 100 percent, we jump to the min/max value. This approach
554 // is slightly more intuitive than using `Math.ceil` below, because it
555 // follows the user's pointer closer.
556 if (percent === 0) {
557 this.value = this.min;
558 }
559 else if (percent === 1) {
560 this.value = this.max;
561 }
562 else {
563 const exactValue = this._calculateValue(percent);
564 // This calculation finds the closest step by finding the closest
565 // whole number divisible by the step relative to the min.
566 const closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;
567 // The value needs to snap to the min and max.
568 this.value = this._clamp(closestValue, this.min, this.max);
569 }
570 }
571 /** Emits a change event if the current value is different from the last emitted value. */
572 _emitChangeEvent() {
573 this._controlValueAccessorChangeFn(this.value);
574 this.valueChange.emit(this.value);
575 this.change.emit(this._createChangeEvent());
576 }
577 /** Emits an input event when the current value is different from the last emitted value. */
578 _emitInputEvent() {
579 this.input.emit(this._createChangeEvent());
580 }
581 /** Updates the amount of space between ticks as a percentage of the width of the slider. */
582 _updateTickIntervalPercent() {
583 if (!this.tickInterval || !this._sliderDimensions) {
584 return;
585 }
586 if (this.tickInterval == 'auto') {
587 let trackSize = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;
588 let pixelsPerStep = trackSize * this.step / (this.max - this.min);
589 let stepsPerTick = Math.ceil(MIN_AUTO_TICK_SEPARATION / pixelsPerStep);
590 let pixelsPerTick = stepsPerTick * this.step;
591 this._tickIntervalPercent = pixelsPerTick / trackSize;
592 }
593 else {
594 this._tickIntervalPercent = this.tickInterval * this.step / (this.max - this.min);
595 }
596 }
597 /** Creates a slider change object from the specified value. */
598 _createChangeEvent(value = this.value) {
599 let event = new MatSliderChange();
600 event.source = this;
601 event.value = value;
602 return event;
603 }
604 /** Calculates the percentage of the slider that a value is. */
605 _calculatePercentage(value) {
606 return ((value || 0) - this.min) / (this.max - this.min);
607 }
608 /** Calculates the value a percentage of the slider corresponds to. */
609 _calculateValue(percentage) {
610 return this.min + percentage * (this.max - this.min);
611 }
612 /** Return a number between two numbers. */
613 _clamp(value, min = 0, max = 1) {
614 return Math.max(min, Math.min(value, max));
615 }
616 /**
617 * Get the bounding client rect of the slider track element.
618 * The track is used rather than the native element to ignore the extra space that the thumb can
619 * take up.
620 */
621 _getSliderDimensions() {
622 return this._sliderWrapper ? this._sliderWrapper.nativeElement.getBoundingClientRect() : null;
623 }
624 /**
625 * Focuses the native element.
626 * Currently only used to allow a blur event to fire but will be used with keyboard input later.
627 */
628 _focusHostElement(options) {
629 this._elementRef.nativeElement.focus(options);
630 }
631 /** Blurs the native element. */
632 _blurHostElement() {
633 this._elementRef.nativeElement.blur();
634 }
635 /**
636 * Sets the model value. Implemented as part of ControlValueAccessor.
637 * @param value
638 */
639 writeValue(value) {
640 this.value = value;
641 }
642 /**
643 * Registers a callback to be triggered when the value has changed.
644 * Implemented as part of ControlValueAccessor.
645 * @param fn Callback to be registered.
646 */
647 registerOnChange(fn) {
648 this._controlValueAccessorChangeFn = fn;
649 }
650 /**
651 * Registers a callback to be triggered when the component is touched.
652 * Implemented as part of ControlValueAccessor.
653 * @param fn Callback to be registered.
654 */
655 registerOnTouched(fn) {
656 this.onTouched = fn;
657 }
658 /**
659 * Sets whether the component should be disabled.
660 * Implemented as part of ControlValueAccessor.
661 * @param isDisabled
662 */
663 setDisabledState(isDisabled) {
664 this.disabled = isDisabled;
665 }
666}
667MatSlider.decorators = [
668 { type: Component, args: [{
669 selector: 'mat-slider',
670 exportAs: 'matSlider',
671 providers: [MAT_SLIDER_VALUE_ACCESSOR],
672 host: {
673 '(focus)': '_onFocus()',
674 '(blur)': '_onBlur()',
675 '(keydown)': '_onKeydown($event)',
676 '(keyup)': '_onKeyup()',
677 '(mouseenter)': '_onMouseenter()',
678 // On Safari starting to slide temporarily triggers text selection mode which
679 // show the wrong cursor. We prevent it by stopping the `selectstart` event.
680 '(selectstart)': '$event.preventDefault()',
681 'class': 'mat-slider mat-focus-indicator',
682 'role': 'slider',
683 '[tabIndex]': 'tabIndex',
684 '[attr.aria-disabled]': 'disabled',
685 '[attr.aria-valuemax]': 'max',
686 '[attr.aria-valuemin]': 'min',
687 '[attr.aria-valuenow]': 'value',
688 // NVDA and Jaws appear to announce the `aria-valuenow` by calculating its percentage based
689 // on its value between `aria-valuemin` and `aria-valuemax`. Due to how decimals are handled,
690 // it can cause the slider to read out a very long value like 0.20000068 if the current value
691 // is 0.2 with a min of 0 and max of 1. We work around the issue by setting `aria-valuetext`
692 // to the same value that we set on the slider's thumb which will be truncated.
693 '[attr.aria-valuetext]': 'valueText == null ? displayValue : valueText',
694 '[attr.aria-orientation]': 'vertical ? "vertical" : "horizontal"',
695 '[class.mat-slider-disabled]': 'disabled',
696 '[class.mat-slider-has-ticks]': 'tickInterval',
697 '[class.mat-slider-horizontal]': '!vertical',
698 '[class.mat-slider-axis-inverted]': '_shouldInvertAxis()',
699 // Class binding which is only used by the test harness as there is no other
700 // way for the harness to detect if mouse coordinates need to be inverted.
701 '[class.mat-slider-invert-mouse-coords]': '_shouldInvertMouseCoords()',
702 '[class.mat-slider-sliding]': '_isSliding',
703 '[class.mat-slider-thumb-label-showing]': 'thumbLabel',
704 '[class.mat-slider-vertical]': 'vertical',
705 '[class.mat-slider-min-value]': '_isMinValue()',
706 '[class.mat-slider-hide-last-tick]': 'disabled || _isMinValue() && _getThumbGap() && _shouldInvertAxis()',
707 '[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"',
708 },
709 template: "<div class=\"mat-slider-wrapper\" #sliderWrapper>\n <div class=\"mat-slider-track-wrapper\">\n <div class=\"mat-slider-track-background\" [ngStyle]=\"_getTrackBackgroundStyles()\"></div>\n <div class=\"mat-slider-track-fill\" [ngStyle]=\"_getTrackFillStyles()\"></div>\n </div>\n <div class=\"mat-slider-ticks-container\" [ngStyle]=\"_getTicksContainerStyles()\">\n <div class=\"mat-slider-ticks\" [ngStyle]=\"_getTicksStyles()\"></div>\n </div>\n <div class=\"mat-slider-thumb-container\" [ngStyle]=\"_getThumbContainerStyles()\">\n <div class=\"mat-slider-focus-ring\"></div>\n <div class=\"mat-slider-thumb\"></div>\n <div class=\"mat-slider-thumb-label\">\n <span class=\"mat-slider-thumb-label-text\">{{displayValue}}</span>\n </div>\n </div>\n</div>\n",
710 inputs: ['disabled', 'color', 'tabIndex'],
711 encapsulation: ViewEncapsulation.None,
712 changeDetection: ChangeDetectionStrategy.OnPush,
713 styles: [".mat-slider{display:inline-block;position:relative;box-sizing:border-box;padding:8px;outline:none;vertical-align:middle}.mat-slider:not(.mat-slider-disabled):active,.mat-slider.mat-slider-sliding:not(.mat-slider-disabled){cursor:-webkit-grabbing;cursor:grabbing}.mat-slider-wrapper{-webkit-print-color-adjust:exact;color-adjust:exact;position:absolute}.mat-slider-track-wrapper{position:absolute;top:0;left:0;overflow:hidden}.mat-slider-track-fill{position:absolute;transform-origin:0 0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-track-background{position:absolute;transform-origin:100% 100%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-ticks-container{position:absolute;left:0;top:0;overflow:hidden}.mat-slider-ticks{-webkit-background-clip:content-box;background-clip:content-box;background-repeat:repeat;box-sizing:border-box;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-container{position:absolute;z-index:1;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-focus-ring{position:absolute;width:30px;height:30px;border-radius:50%;transform:scale(0);opacity:0;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider.cdk-keyboard-focused .mat-slider-focus-ring,.mat-slider.cdk-program-focused .mat-slider-focus-ring{transform:scale(1);opacity:1}.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb-label,.mat-slider:not(.mat-slider-disabled):not(.mat-slider-sliding) .mat-slider-thumb{cursor:-webkit-grab;cursor:grab}.mat-slider-thumb{position:absolute;right:-10px;bottom:-10px;box-sizing:border-box;width:20px;height:20px;border:3px solid transparent;border-radius:50%;transform:scale(0.7);transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-thumb-label{display:none;align-items:center;justify-content:center;position:absolute;width:28px;height:28px;border-radius:50%;transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),border-radius 400ms cubic-bezier(0.25, 0.8, 0.25, 1),background-color 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.cdk-high-contrast-active .mat-slider-thumb-label{outline:solid 1px}.mat-slider-thumb-label-text{z-index:1;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-sliding .mat-slider-track-fill,.mat-slider-sliding .mat-slider-track-background,.mat-slider-sliding .mat-slider-thumb-container{transition-duration:0ms}.mat-slider-has-ticks .mat-slider-wrapper::after{content:\"\";position:absolute;border-width:0;border-style:solid;opacity:0;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after,.mat-slider-has-ticks:hover:not(.mat-slider-hide-last-tick) .mat-slider-wrapper::after{opacity:1}.mat-slider-has-ticks.cdk-focused:not(.mat-slider-disabled) .mat-slider-ticks,.mat-slider-has-ticks:hover:not(.mat-slider-disabled) .mat-slider-ticks{opacity:1}.mat-slider-thumb-label-showing .mat-slider-focus-ring{display:none}.mat-slider-thumb-label-showing .mat-slider-thumb-label{display:flex}.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:100% 100%}.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:0 0}.mat-slider:not(.mat-slider-disabled).cdk-focused.mat-slider-thumb-label-showing .mat-slider-thumb{transform:scale(0)}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label{border-radius:50% 50% 0}.mat-slider:not(.mat-slider-disabled).cdk-focused .mat-slider-thumb-label-text{opacity:1}.mat-slider:not(.mat-slider-disabled).cdk-mouse-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-touch-focused .mat-slider-thumb,.mat-slider:not(.mat-slider-disabled).cdk-program-focused .mat-slider-thumb{border-width:2px;transform:scale(1)}.mat-slider-disabled .mat-slider-focus-ring{transform:scale(0);opacity:0}.mat-slider-disabled .mat-slider-thumb{border-width:4px;transform:scale(0.5)}.mat-slider-disabled .mat-slider-thumb-label{display:none}.mat-slider-horizontal{height:48px;min-width:128px}.mat-slider-horizontal .mat-slider-wrapper{height:2px;top:23px;left:8px;right:8px}.mat-slider-horizontal .mat-slider-wrapper::after{height:2px;border-left-width:2px;right:0;top:0}.mat-slider-horizontal .mat-slider-track-wrapper{height:2px;width:100%}.mat-slider-horizontal .mat-slider-track-fill{height:2px;width:100%;transform:scaleX(0)}.mat-slider-horizontal .mat-slider-track-background{height:2px;width:100%;transform:scaleX(1)}.mat-slider-horizontal .mat-slider-ticks-container{height:2px;width:100%}.cdk-high-contrast-active .mat-slider-horizontal .mat-slider-ticks-container{height:0;outline:solid 2px;top:1px}.mat-slider-horizontal .mat-slider-ticks{height:2px;width:100%}.mat-slider-horizontal .mat-slider-thumb-container{width:100%;height:0;top:50%}.mat-slider-horizontal .mat-slider-focus-ring{top:-15px;right:-15px}.mat-slider-horizontal .mat-slider-thumb-label{right:-14px;top:-40px;transform:translateY(26px) scale(0.01) rotate(45deg)}.mat-slider-horizontal .mat-slider-thumb-label-text{transform:rotate(-45deg)}.mat-slider-horizontal.cdk-focused .mat-slider-thumb-label{transform:rotate(45deg)}.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label,.cdk-high-contrast-active .mat-slider-horizontal.cdk-focused .mat-slider-thumb-label-text{transform:none}.mat-slider-vertical{width:48px;min-height:128px}.mat-slider-vertical .mat-slider-wrapper{width:2px;top:8px;bottom:8px;left:23px}.mat-slider-vertical .mat-slider-wrapper::after{width:2px;border-top-width:2px;bottom:0;left:0}.mat-slider-vertical .mat-slider-track-wrapper{height:100%;width:2px}.mat-slider-vertical .mat-slider-track-fill{height:100%;width:2px;transform:scaleY(0)}.mat-slider-vertical .mat-slider-track-background{height:100%;width:2px;transform:scaleY(1)}.mat-slider-vertical .mat-slider-ticks-container{width:2px;height:100%}.cdk-high-contrast-active .mat-slider-vertical .mat-slider-ticks-container{width:0;outline:solid 2px;left:1px}.mat-slider-vertical .mat-slider-focus-ring{bottom:-15px;left:-15px}.mat-slider-vertical .mat-slider-ticks{width:2px;height:100%}.mat-slider-vertical .mat-slider-thumb-container{height:100%;width:0;left:50%}.mat-slider-vertical .mat-slider-thumb{-webkit-backface-visibility:hidden;backface-visibility:hidden}.mat-slider-vertical .mat-slider-thumb-label{bottom:-14px;left:-40px;transform:translateX(26px) scale(0.01) rotate(-45deg)}.mat-slider-vertical .mat-slider-thumb-label-text{transform:rotate(45deg)}.mat-slider-vertical.cdk-focused .mat-slider-thumb-label{transform:rotate(-45deg)}[dir=rtl] .mat-slider-wrapper::after{left:0;right:auto}[dir=rtl] .mat-slider-horizontal .mat-slider-track-fill{transform-origin:100% 100%}[dir=rtl] .mat-slider-horizontal .mat-slider-track-background{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-fill{transform-origin:0 0}[dir=rtl] .mat-slider-horizontal.mat-slider-axis-inverted .mat-slider-track-background{transform-origin:100% 100%}.mat-slider._mat-animation-noopable .mat-slider-track-fill,.mat-slider._mat-animation-noopable .mat-slider-track-background,.mat-slider._mat-animation-noopable .mat-slider-ticks,.mat-slider._mat-animation-noopable .mat-slider-thumb-container,.mat-slider._mat-animation-noopable .mat-slider-focus-ring,.mat-slider._mat-animation-noopable .mat-slider-thumb,.mat-slider._mat-animation-noopable .mat-slider-thumb-label,.mat-slider._mat-animation-noopable .mat-slider-thumb-label-text,.mat-slider._mat-animation-noopable .mat-slider-has-ticks .mat-slider-wrapper::after{transition:none}\n"]
714 },] }
715];
716MatSlider.ctorParameters = () => [
717 { type: ElementRef },
718 { type: FocusMonitor },
719 { type: ChangeDetectorRef },
720 { type: Directionality, decorators: [{ type: Optional }] },
721 { type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
722 { type: NgZone },
723 { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
724 { type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] }
725];
726MatSlider.propDecorators = {
727 invert: [{ type: Input }],
728 max: [{ type: Input }],
729 min: [{ type: Input }],
730 step: [{ type: Input }],
731 thumbLabel: [{ type: Input }],
732 tickInterval: [{ type: Input }],
733 value: [{ type: Input }],
734 displayWith: [{ type: Input }],
735 valueText: [{ type: Input }],
736 vertical: [{ type: Input }],
737 change: [{ type: Output }],
738 input: [{ type: Output }],
739 valueChange: [{ type: Output }],
740 _sliderWrapper: [{ type: ViewChild, args: ['sliderWrapper',] }]
741};
742/** Returns whether an event is a touch event. */
743function isTouchEvent(event) {
744 // This function is called for every pixel that the user has dragged so we need it to be
745 // as fast as possible. Since we only bind mouse events and touch events, we can assume
746 // that if the event's name starts with `t`, it's a touch event.
747 return event.type[0] === 't';
748}
749/** Gets the coordinates of a touch or mouse event relative to the viewport. */
750function getPointerPositionOnPage(event, id) {
751 let point;
752 if (isTouchEvent(event)) {
753 // The `identifier` could be undefined if the browser doesn't support `TouchEvent.identifier`.
754 // If that's the case, attribute the first touch to all active sliders. This should still cover
755 // the most common case while only breaking multi-touch.
756 if (typeof id === 'number') {
757 point = findMatchingTouch(event.touches, id) || findMatchingTouch(event.changedTouches, id);
758 }
759 else {
760 // `touches` will be empty for start/end events so we have to fall back to `changedTouches`.
761 point = event.touches[0] || event.changedTouches[0];
762 }
763 }
764 else {
765 point = event;
766 }
767 return point ? { x: point.clientX, y: point.clientY } : undefined;
768}
769/** Finds a `Touch` with a specific ID in a `TouchList`. */
770function findMatchingTouch(touches, id) {
771 for (let i = 0; i < touches.length; i++) {
772 if (touches[i].identifier === id) {
773 return touches[i];
774 }
775 }
776 return undefined;
777}
778/** Gets the unique ID of a touch that matches a specific slider. */
779function getTouchIdForSlider(event, sliderHost) {
780 for (let i = 0; i < event.touches.length; i++) {
781 const target = event.touches[i].target;
782 if (sliderHost === target || sliderHost.contains(target)) {
783 return event.touches[i].identifier;
784 }
785 }
786 return undefined;
787}
788//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2xpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL3NsaWRlci9zbGlkZXIudHMi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