source: trip-planner-front/node_modules/@angular/material/esm2015/tooltip/tooltip.js@ 6a3a178

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

initial commit

  • Property mode set to 100644
File size: 101.9 KB
Line 
1import { AriaDescriber, FocusMonitor } from '@angular/cdk/a11y';
2import { Directionality } from '@angular/cdk/bidi';
3import { coerceBooleanProperty } from '@angular/cdk/coercion';
4import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
5import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
6import { Overlay, } from '@angular/cdk/overlay';
7import { Platform, normalizePassiveListenerOptions } from '@angular/cdk/platform';
8import { ComponentPortal } from '@angular/cdk/portal';
9import { ScrollDispatcher } from '@angular/cdk/scrolling';
10import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Directive, ElementRef, Inject, InjectionToken, Input, NgZone, Optional, ViewContainerRef, ViewEncapsulation, } from '@angular/core';
11import { DOCUMENT } from '@angular/common';
12import { Subject } from 'rxjs';
13import { take, takeUntil } from 'rxjs/operators';
14import { matTooltipAnimations } from './tooltip-animations';
15/** Time in ms to throttle repositioning after scroll events. */
16export const SCROLL_THROTTLE_MS = 20;
17/**
18 * CSS class that will be attached to the overlay panel.
19 * @deprecated
20 * @breaking-change 13.0.0 remove this variable
21 */
22export const TOOLTIP_PANEL_CLASS = 'mat-tooltip-panel';
23const PANEL_CLASS = 'tooltip-panel';
24/** Options used to bind passive event listeners. */
25const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
26/**
27 * Time between the user putting the pointer on a tooltip
28 * trigger and the long press event being fired.
29 */
30const LONGPRESS_DELAY = 500;
31/**
32 * Creates an error to be thrown if the user supplied an invalid tooltip position.
33 * @docs-private
34 */
35export function getMatTooltipInvalidPositionError(position) {
36 return Error(`Tooltip position "${position}" is invalid.`);
37}
38/** Injection token that determines the scroll handling while a tooltip is visible. */
39export const MAT_TOOLTIP_SCROLL_STRATEGY = new InjectionToken('mat-tooltip-scroll-strategy');
40/** @docs-private */
41export function MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY(overlay) {
42 return () => overlay.scrollStrategies.reposition({ scrollThrottle: SCROLL_THROTTLE_MS });
43}
44/** @docs-private */
45export const MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER = {
46 provide: MAT_TOOLTIP_SCROLL_STRATEGY,
47 deps: [Overlay],
48 useFactory: MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY,
49};
50/** Injection token to be used to override the default options for `matTooltip`. */
51export const MAT_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken('mat-tooltip-default-options', {
52 providedIn: 'root',
53 factory: MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY
54});
55/** @docs-private */
56export function MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY() {
57 return {
58 showDelay: 0,
59 hideDelay: 0,
60 touchendHideDelay: 1500,
61 };
62}
63export class _MatTooltipBase {
64 constructor(_overlay, _elementRef, _scrollDispatcher, _viewContainerRef, _ngZone, _platform, _ariaDescriber, _focusMonitor, scrollStrategy, _dir, _defaultOptions, _document) {
65 this._overlay = _overlay;
66 this._elementRef = _elementRef;
67 this._scrollDispatcher = _scrollDispatcher;
68 this._viewContainerRef = _viewContainerRef;
69 this._ngZone = _ngZone;
70 this._platform = _platform;
71 this._ariaDescriber = _ariaDescriber;
72 this._focusMonitor = _focusMonitor;
73 this._dir = _dir;
74 this._defaultOptions = _defaultOptions;
75 this._position = 'below';
76 this._disabled = false;
77 this._viewInitialized = false;
78 this._pointerExitEventsInitialized = false;
79 this._viewportMargin = 8;
80 this._cssClassPrefix = 'mat';
81 /** The default delay in ms before showing the tooltip after show is called */
82 this.showDelay = this._defaultOptions.showDelay;
83 /** The default delay in ms before hiding the tooltip after hide is called */
84 this.hideDelay = this._defaultOptions.hideDelay;
85 /**
86 * How touch gestures should be handled by the tooltip. On touch devices the tooltip directive
87 * uses a long press gesture to show and hide, however it can conflict with the native browser
88 * gestures. To work around the conflict, Angular Material disables native gestures on the
89 * trigger, but that might not be desirable on particular elements (e.g. inputs and draggable
90 * elements). The different values for this option configure the touch event handling as follows:
91 * - `auto` - Enables touch gestures for all elements, but tries to avoid conflicts with native
92 * browser gestures on particular elements. In particular, it allows text selection on inputs
93 * and textareas, and preserves the native browser dragging on elements marked as `draggable`.
94 * - `on` - Enables touch gestures for all elements and disables native
95 * browser gestures with no exceptions.
96 * - `off` - Disables touch gestures. Note that this will prevent the tooltip from
97 * showing on touch devices.
98 */
99 this.touchGestures = 'auto';
100 this._message = '';
101 /** Manually-bound passive event listeners. */
102 this._passiveListeners = [];
103 /** Emits when the component is destroyed. */
104 this._destroyed = new Subject();
105 /**
106 * Handles the keydown events on the host element.
107 * Needs to be an arrow function so that we can use it in addEventListener.
108 */
109 this._handleKeydown = (event) => {
110 if (this._isTooltipVisible() && event.keyCode === ESCAPE && !hasModifierKey(event)) {
111 event.preventDefault();
112 event.stopPropagation();
113 this._ngZone.run(() => this.hide(0));
114 }
115 };
116 this._scrollStrategy = scrollStrategy;
117 this._document = _document;
118 if (_defaultOptions) {
119 if (_defaultOptions.position) {
120 this.position = _defaultOptions.position;
121 }
122 if (_defaultOptions.touchGestures) {
123 this.touchGestures = _defaultOptions.touchGestures;
124 }
125 }
126 _dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {
127 if (this._overlayRef) {
128 this._updatePosition(this._overlayRef);
129 }
130 });
131 _ngZone.runOutsideAngular(() => {
132 _elementRef.nativeElement.addEventListener('keydown', this._handleKeydown);
133 });
134 }
135 /** Allows the user to define the position of the tooltip relative to the parent element */
136 get position() { return this._position; }
137 set position(value) {
138 var _a;
139 if (value !== this._position) {
140 this._position = value;
141 if (this._overlayRef) {
142 this._updatePosition(this._overlayRef);
143 (_a = this._tooltipInstance) === null || _a === void 0 ? void 0 : _a.show(0);
144 this._overlayRef.updatePosition();
145 }
146 }
147 }
148 /** Disables the display of the tooltip. */
149 get disabled() { return this._disabled; }
150 set disabled(value) {
151 this._disabled = coerceBooleanProperty(value);
152 // If tooltip is disabled, hide immediately.
153 if (this._disabled) {
154 this.hide(0);
155 }
156 else {
157 this._setupPointerEnterEventsIfNeeded();
158 }
159 }
160 /** The message to be displayed in the tooltip */
161 get message() { return this._message; }
162 set message(value) {
163 this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this._message, 'tooltip');
164 // If the message is not a string (e.g. number), convert it to a string and trim it.
165 // Must convert with `String(value)`, not `${value}`, otherwise Closure Compiler optimises
166 // away the string-conversion: https://github.com/angular/components/issues/20684
167 this._message = value != null ? String(value).trim() : '';
168 if (!this._message && this._isTooltipVisible()) {
169 this.hide(0);
170 }
171 else {
172 this._setupPointerEnterEventsIfNeeded();
173 this._updateTooltipMessage();
174 this._ngZone.runOutsideAngular(() => {
175 // The `AriaDescriber` has some functionality that avoids adding a description if it's the
176 // same as the `aria-label` of an element, however we can't know whether the tooltip trigger
177 // has a data-bound `aria-label` or when it'll be set for the first time. We can avoid the
178 // issue by deferring the description by a tick so Angular has time to set the `aria-label`.
179 Promise.resolve().then(() => {
180 this._ariaDescriber.describe(this._elementRef.nativeElement, this.message, 'tooltip');
181 });
182 });
183 }
184 }
185 /** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */
186 get tooltipClass() { return this._tooltipClass; }
187 set tooltipClass(value) {
188 this._tooltipClass = value;
189 if (this._tooltipInstance) {
190 this._setTooltipClass(this._tooltipClass);
191 }
192 }
193 ngAfterViewInit() {
194 // This needs to happen after view init so the initial values for all inputs have been set.
195 this._viewInitialized = true;
196 this._setupPointerEnterEventsIfNeeded();
197 this._focusMonitor.monitor(this._elementRef)
198 .pipe(takeUntil(this._destroyed))
199 .subscribe(origin => {
200 // Note that the focus monitor runs outside the Angular zone.
201 if (!origin) {
202 this._ngZone.run(() => this.hide(0));
203 }
204 else if (origin === 'keyboard') {
205 this._ngZone.run(() => this.show());
206 }
207 });
208 }
209 /**
210 * Dispose the tooltip when destroyed.
211 */
212 ngOnDestroy() {
213 const nativeElement = this._elementRef.nativeElement;
214 clearTimeout(this._touchstartTimeout);
215 if (this._overlayRef) {
216 this._overlayRef.dispose();
217 this._tooltipInstance = null;
218 }
219 // Clean up the event listeners set in the constructor
220 nativeElement.removeEventListener('keydown', this._handleKeydown);
221 this._passiveListeners.forEach(([event, listener]) => {
222 nativeElement.removeEventListener(event, listener, passiveListenerOptions);
223 });
224 this._passiveListeners.length = 0;
225 this._destroyed.next();
226 this._destroyed.complete();
227 this._ariaDescriber.removeDescription(nativeElement, this.message, 'tooltip');
228 this._focusMonitor.stopMonitoring(nativeElement);
229 }
230 /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
231 show(delay = this.showDelay) {
232 if (this.disabled || !this.message || (this._isTooltipVisible() &&
233 !this._tooltipInstance._showTimeoutId && !this._tooltipInstance._hideTimeoutId)) {
234 return;
235 }
236 const overlayRef = this._createOverlay();
237 this._detach();
238 this._portal = this._portal ||
239 new ComponentPortal(this._tooltipComponent, this._viewContainerRef);
240 this._tooltipInstance = overlayRef.attach(this._portal).instance;
241 this._tooltipInstance.afterHidden()
242 .pipe(takeUntil(this._destroyed))
243 .subscribe(() => this._detach());
244 this._setTooltipClass(this._tooltipClass);
245 this._updateTooltipMessage();
246 this._tooltipInstance.show(delay);
247 }
248 /** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */
249 hide(delay = this.hideDelay) {
250 if (this._tooltipInstance) {
251 this._tooltipInstance.hide(delay);
252 }
253 }
254 /** Shows/hides the tooltip */
255 toggle() {
256 this._isTooltipVisible() ? this.hide() : this.show();
257 }
258 /** Returns true if the tooltip is currently visible to the user */
259 _isTooltipVisible() {
260 return !!this._tooltipInstance && this._tooltipInstance.isVisible();
261 }
262 /** Create the overlay config and position strategy */
263 _createOverlay() {
264 if (this._overlayRef) {
265 return this._overlayRef;
266 }
267 const scrollableAncestors = this._scrollDispatcher.getAncestorScrollContainers(this._elementRef);
268 // Create connected position strategy that listens for scroll events to reposition.
269 const strategy = this._overlay.position()
270 .flexibleConnectedTo(this._elementRef)
271 .withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`)
272 .withFlexibleDimensions(false)
273 .withViewportMargin(this._viewportMargin)
274 .withScrollableContainers(scrollableAncestors);
275 strategy.positionChanges.pipe(takeUntil(this._destroyed)).subscribe(change => {
276 this._updateCurrentPositionClass(change.connectionPair);
277 if (this._tooltipInstance) {
278 if (change.scrollableViewProperties.isOverlayClipped && this._tooltipInstance.isVisible()) {
279 // After position changes occur and the overlay is clipped by
280 // a parent scrollable then close the tooltip.
281 this._ngZone.run(() => this.hide(0));
282 }
283 }
284 });
285 this._overlayRef = this._overlay.create({
286 direction: this._dir,
287 positionStrategy: strategy,
288 panelClass: `${this._cssClassPrefix}-${PANEL_CLASS}`,
289 scrollStrategy: this._scrollStrategy()
290 });
291 this._updatePosition(this._overlayRef);
292 this._overlayRef.detachments()
293 .pipe(takeUntil(this._destroyed))
294 .subscribe(() => this._detach());
295 this._overlayRef.outsidePointerEvents()
296 .pipe(takeUntil(this._destroyed))
297 .subscribe(() => { var _a; return (_a = this._tooltipInstance) === null || _a === void 0 ? void 0 : _a._handleBodyInteraction(); });
298 return this._overlayRef;
299 }
300 /** Detaches the currently-attached tooltip. */
301 _detach() {
302 if (this._overlayRef && this._overlayRef.hasAttached()) {
303 this._overlayRef.detach();
304 }
305 this._tooltipInstance = null;
306 }
307 /** Updates the position of the current tooltip. */
308 _updatePosition(overlayRef) {
309 const position = overlayRef.getConfig().positionStrategy;
310 const origin = this._getOrigin();
311 const overlay = this._getOverlayPosition();
312 position.withPositions([
313 this._addOffset(Object.assign(Object.assign({}, origin.main), overlay.main)),
314 this._addOffset(Object.assign(Object.assign({}, origin.fallback), overlay.fallback))
315 ]);
316 }
317 /** Adds the configured offset to a position. Used as a hook for child classes. */
318 _addOffset(position) {
319 return position;
320 }
321 /**
322 * Returns the origin position and a fallback position based on the user's position preference.
323 * The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
324 */
325 _getOrigin() {
326 const isLtr = !this._dir || this._dir.value == 'ltr';
327 const position = this.position;
328 let originPosition;
329 if (position == 'above' || position == 'below') {
330 originPosition = { originX: 'center', originY: position == 'above' ? 'top' : 'bottom' };
331 }
332 else if (position == 'before' ||
333 (position == 'left' && isLtr) ||
334 (position == 'right' && !isLtr)) {
335 originPosition = { originX: 'start', originY: 'center' };
336 }
337 else if (position == 'after' ||
338 (position == 'right' && isLtr) ||
339 (position == 'left' && !isLtr)) {
340 originPosition = { originX: 'end', originY: 'center' };
341 }
342 else if (typeof ngDevMode === 'undefined' || ngDevMode) {
343 throw getMatTooltipInvalidPositionError(position);
344 }
345 const { x, y } = this._invertPosition(originPosition.originX, originPosition.originY);
346 return {
347 main: originPosition,
348 fallback: { originX: x, originY: y }
349 };
350 }
351 /** Returns the overlay position and a fallback position based on the user's preference */
352 _getOverlayPosition() {
353 const isLtr = !this._dir || this._dir.value == 'ltr';
354 const position = this.position;
355 let overlayPosition;
356 if (position == 'above') {
357 overlayPosition = { overlayX: 'center', overlayY: 'bottom' };
358 }
359 else if (position == 'below') {
360 overlayPosition = { overlayX: 'center', overlayY: 'top' };
361 }
362 else if (position == 'before' ||
363 (position == 'left' && isLtr) ||
364 (position == 'right' && !isLtr)) {
365 overlayPosition = { overlayX: 'end', overlayY: 'center' };
366 }
367 else if (position == 'after' ||
368 (position == 'right' && isLtr) ||
369 (position == 'left' && !isLtr)) {
370 overlayPosition = { overlayX: 'start', overlayY: 'center' };
371 }
372 else if (typeof ngDevMode === 'undefined' || ngDevMode) {
373 throw getMatTooltipInvalidPositionError(position);
374 }
375 const { x, y } = this._invertPosition(overlayPosition.overlayX, overlayPosition.overlayY);
376 return {
377 main: overlayPosition,
378 fallback: { overlayX: x, overlayY: y }
379 };
380 }
381 /** Updates the tooltip message and repositions the overlay according to the new message length */
382 _updateTooltipMessage() {
383 // Must wait for the message to be painted to the tooltip so that the overlay can properly
384 // calculate the correct positioning based on the size of the text.
385 if (this._tooltipInstance) {
386 this._tooltipInstance.message = this.message;
387 this._tooltipInstance._markForCheck();
388 this._ngZone.onMicrotaskEmpty.pipe(take(1), takeUntil(this._destroyed)).subscribe(() => {
389 if (this._tooltipInstance) {
390 this._overlayRef.updatePosition();
391 }
392 });
393 }
394 }
395 /** Updates the tooltip class */
396 _setTooltipClass(tooltipClass) {
397 if (this._tooltipInstance) {
398 this._tooltipInstance.tooltipClass = tooltipClass;
399 this._tooltipInstance._markForCheck();
400 }
401 }
402 /** Inverts an overlay position. */
403 _invertPosition(x, y) {
404 if (this.position === 'above' || this.position === 'below') {
405 if (y === 'top') {
406 y = 'bottom';
407 }
408 else if (y === 'bottom') {
409 y = 'top';
410 }
411 }
412 else {
413 if (x === 'end') {
414 x = 'start';
415 }
416 else if (x === 'start') {
417 x = 'end';
418 }
419 }
420 return { x, y };
421 }
422 /** Updates the class on the overlay panel based on the current position of the tooltip. */
423 _updateCurrentPositionClass(connectionPair) {
424 const { overlayY, originX, originY } = connectionPair;
425 let newPosition;
426 // If the overlay is in the middle along the Y axis,
427 // it means that it's either before or after.
428 if (overlayY === 'center') {
429 // Note that since this information is used for styling, we want to
430 // resolve `start` and `end` to their real values, otherwise consumers
431 // would have to remember to do it themselves on each consumption.
432 if (this._dir && this._dir.value === 'rtl') {
433 newPosition = originX === 'end' ? 'left' : 'right';
434 }
435 else {
436 newPosition = originX === 'start' ? 'left' : 'right';
437 }
438 }
439 else {
440 newPosition = overlayY === 'bottom' && originY === 'top' ? 'above' : 'below';
441 }
442 if (newPosition !== this._currentPosition) {
443 const overlayRef = this._overlayRef;
444 if (overlayRef) {
445 const classPrefix = `${this._cssClassPrefix}-${PANEL_CLASS}-`;
446 overlayRef.removePanelClass(classPrefix + this._currentPosition);
447 overlayRef.addPanelClass(classPrefix + newPosition);
448 }
449 this._currentPosition = newPosition;
450 }
451 }
452 /** Binds the pointer events to the tooltip trigger. */
453 _setupPointerEnterEventsIfNeeded() {
454 // Optimization: Defer hooking up events if there's no message or the tooltip is disabled.
455 if (this._disabled || !this.message || !this._viewInitialized ||
456 this._passiveListeners.length) {
457 return;
458 }
459 // The mouse events shouldn't be bound on mobile devices, because they can prevent the
460 // first tap from firing its click event or can cause the tooltip to open for clicks.
461 if (this._platformSupportsMouseEvents()) {
462 this._passiveListeners
463 .push(['mouseenter', () => {
464 this._setupPointerExitEventsIfNeeded();
465 this.show();
466 }]);
467 }
468 else if (this.touchGestures !== 'off') {
469 this._disableNativeGesturesIfNecessary();
470 this._passiveListeners
471 .push(['touchstart', () => {
472 // Note that it's important that we don't `preventDefault` here,
473 // because it can prevent click events from firing on the element.
474 this._setupPointerExitEventsIfNeeded();
475 clearTimeout(this._touchstartTimeout);
476 this._touchstartTimeout = setTimeout(() => this.show(), LONGPRESS_DELAY);
477 }]);
478 }
479 this._addListeners(this._passiveListeners);
480 }
481 _setupPointerExitEventsIfNeeded() {
482 if (this._pointerExitEventsInitialized) {
483 return;
484 }
485 this._pointerExitEventsInitialized = true;
486 const exitListeners = [];
487 if (this._platformSupportsMouseEvents()) {
488 exitListeners.push(['mouseleave', () => this.hide()], ['wheel', event => this._wheelListener(event)]);
489 }
490 else if (this.touchGestures !== 'off') {
491 this._disableNativeGesturesIfNecessary();
492 const touchendListener = () => {
493 clearTimeout(this._touchstartTimeout);
494 this.hide(this._defaultOptions.touchendHideDelay);
495 };
496 exitListeners.push(['touchend', touchendListener], ['touchcancel', touchendListener]);
497 }
498 this._addListeners(exitListeners);
499 this._passiveListeners.push(...exitListeners);
500 }
501 _addListeners(listeners) {
502 listeners.forEach(([event, listener]) => {
503 this._elementRef.nativeElement.addEventListener(event, listener, passiveListenerOptions);
504 });
505 }
506 _platformSupportsMouseEvents() {
507 return !this._platform.IOS && !this._platform.ANDROID;
508 }
509 /** Listener for the `wheel` event on the element. */
510 _wheelListener(event) {
511 if (this._isTooltipVisible()) {
512 const elementUnderPointer = this._document.elementFromPoint(event.clientX, event.clientY);
513 const element = this._elementRef.nativeElement;
514 // On non-touch devices we depend on the `mouseleave` event to close the tooltip, but it
515 // won't fire if the user scrolls away using the wheel without moving their cursor. We
516 // work around it by finding the element under the user's cursor and closing the tooltip
517 // if it's not the trigger.
518 if (elementUnderPointer !== element && !element.contains(elementUnderPointer)) {
519 this.hide();
520 }
521 }
522 }
523 /** Disables the native browser gestures, based on how the tooltip has been configured. */
524 _disableNativeGesturesIfNecessary() {
525 const gestures = this.touchGestures;
526 if (gestures !== 'off') {
527 const element = this._elementRef.nativeElement;
528 const style = element.style;
529 // If gestures are set to `auto`, we don't disable text selection on inputs and
530 // textareas, because it prevents the user from typing into them on iOS Safari.
531 if (gestures === 'on' || (element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA')) {
532 style.userSelect = style.msUserSelect = style.webkitUserSelect =
533 style.MozUserSelect = 'none';
534 }
535 // If we have `auto` gestures and the element uses native HTML dragging,
536 // we don't set `-webkit-user-drag` because it prevents the native behavior.
537 if (gestures === 'on' || !element.draggable) {
538 style.webkitUserDrag = 'none';
539 }
540 style.touchAction = 'none';
541 style.webkitTapHighlightColor = 'transparent';
542 }
543 }
544}
545_MatTooltipBase.decorators = [
546 { type: Directive }
547];
548_MatTooltipBase.ctorParameters = () => [
549 { type: Overlay },
550 { type: ElementRef },
551 { type: ScrollDispatcher },
552 { type: ViewContainerRef },
553 { type: NgZone },
554 { type: Platform },
555 { type: AriaDescriber },
556 { type: FocusMonitor },
557 { type: undefined },
558 { type: Directionality },
559 { type: undefined },
560 { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
561];
562_MatTooltipBase.propDecorators = {
563 position: [{ type: Input, args: ['matTooltipPosition',] }],
564 disabled: [{ type: Input, args: ['matTooltipDisabled',] }],
565 showDelay: [{ type: Input, args: ['matTooltipShowDelay',] }],
566 hideDelay: [{ type: Input, args: ['matTooltipHideDelay',] }],
567 touchGestures: [{ type: Input, args: ['matTooltipTouchGestures',] }],
568 message: [{ type: Input, args: ['matTooltip',] }],
569 tooltipClass: [{ type: Input, args: ['matTooltipClass',] }]
570};
571/**
572 * Directive that attaches a material design tooltip to the host element. Animates the showing and
573 * hiding of a tooltip provided position (defaults to below the element).
574 *
575 * https://material.io/design/components/tooltips.html
576 */
577export class MatTooltip extends _MatTooltipBase {
578 constructor(overlay, elementRef, scrollDispatcher, viewContainerRef, ngZone, platform, ariaDescriber, focusMonitor, scrollStrategy, dir, defaultOptions, _document) {
579 super(overlay, elementRef, scrollDispatcher, viewContainerRef, ngZone, platform, ariaDescriber, focusMonitor, scrollStrategy, dir, defaultOptions, _document);
580 this._tooltipComponent = TooltipComponent;
581 }
582}
583MatTooltip.decorators = [
584 { type: Directive, args: [{
585 selector: '[matTooltip]',
586 exportAs: 'matTooltip',
587 host: {
588 'class': 'mat-tooltip-trigger'
589 }
590 },] }
591];
592MatTooltip.ctorParameters = () => [
593 { type: Overlay },
594 { type: ElementRef },
595 { type: ScrollDispatcher },
596 { type: ViewContainerRef },
597 { type: NgZone },
598 { type: Platform },
599 { type: AriaDescriber },
600 { type: FocusMonitor },
601 { type: undefined, decorators: [{ type: Inject, args: [MAT_TOOLTIP_SCROLL_STRATEGY,] }] },
602 { type: Directionality, decorators: [{ type: Optional }] },
603 { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_TOOLTIP_DEFAULT_OPTIONS,] }] },
604 { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
605];
606export class _TooltipComponentBase {
607 constructor(_changeDetectorRef) {
608 this._changeDetectorRef = _changeDetectorRef;
609 /** Property watched by the animation framework to show or hide the tooltip */
610 this._visibility = 'initial';
611 /** Whether interactions on the page should close the tooltip */
612 this._closeOnInteraction = false;
613 /** Subject for notifying that the tooltip has been hidden from the view */
614 this._onHide = new Subject();
615 }
616 /**
617 * Shows the tooltip with an animation originating from the provided origin
618 * @param delay Amount of milliseconds to the delay showing the tooltip.
619 */
620 show(delay) {
621 // Cancel the delayed hide if it is scheduled
622 clearTimeout(this._hideTimeoutId);
623 // Body interactions should cancel the tooltip if there is a delay in showing.
624 this._closeOnInteraction = true;
625 this._showTimeoutId = setTimeout(() => {
626 this._visibility = 'visible';
627 this._showTimeoutId = undefined;
628 this._onShow();
629 // Mark for check so if any parent component has set the
630 // ChangeDetectionStrategy to OnPush it will be checked anyways
631 this._markForCheck();
632 }, delay);
633 }
634 /**
635 * Begins the animation to hide the tooltip after the provided delay in ms.
636 * @param delay Amount of milliseconds to delay showing the tooltip.
637 */
638 hide(delay) {
639 // Cancel the delayed show if it is scheduled
640 clearTimeout(this._showTimeoutId);
641 this._hideTimeoutId = setTimeout(() => {
642 this._visibility = 'hidden';
643 this._hideTimeoutId = undefined;
644 // Mark for check so if any parent component has set the
645 // ChangeDetectionStrategy to OnPush it will be checked anyways
646 this._markForCheck();
647 }, delay);
648 }
649 /** Returns an observable that notifies when the tooltip has been hidden from view. */
650 afterHidden() {
651 return this._onHide;
652 }
653 /** Whether the tooltip is being displayed. */
654 isVisible() {
655 return this._visibility === 'visible';
656 }
657 ngOnDestroy() {
658 clearTimeout(this._showTimeoutId);
659 clearTimeout(this._hideTimeoutId);
660 this._onHide.complete();
661 }
662 _animationStart() {
663 this._closeOnInteraction = false;
664 }
665 _animationDone(event) {
666 const toState = event.toState;
667 if (toState === 'hidden' && !this.isVisible()) {
668 this._onHide.next();
669 }
670 if (toState === 'visible' || toState === 'hidden') {
671 this._closeOnInteraction = true;
672 }
673 }
674 /**
675 * Interactions on the HTML body should close the tooltip immediately as defined in the
676 * material design spec.
677 * https://material.io/design/components/tooltips.html#behavior
678 */
679 _handleBodyInteraction() {
680 if (this._closeOnInteraction) {
681 this.hide(0);
682 }
683 }
684 /**
685 * Marks that the tooltip needs to be checked in the next change detection run.
686 * Mainly used for rendering the initial text before positioning a tooltip, which
687 * can be problematic in components with OnPush change detection.
688 */
689 _markForCheck() {
690 this._changeDetectorRef.markForCheck();
691 }
692 /**
693 * Callback for when the timeout in this.show() gets completed.
694 * This method is only needed by the mdc-tooltip, and so it is only implemented
695 * in the mdc-tooltip, not here.
696 */
697 _onShow() { }
698}
699_TooltipComponentBase.decorators = [
700 { type: Directive }
701];
702_TooltipComponentBase.ctorParameters = () => [
703 { type: ChangeDetectorRef }
704];
705/**
706 * Internal component that wraps the tooltip's content.
707 * @docs-private
708 */
709export class TooltipComponent extends _TooltipComponentBase {
710 constructor(changeDetectorRef, _breakpointObserver) {
711 super(changeDetectorRef);
712 this._breakpointObserver = _breakpointObserver;
713 /** Stream that emits whether the user has a handset-sized display. */
714 this._isHandset = this._breakpointObserver.observe(Breakpoints.Handset);
715 }
716}
717TooltipComponent.decorators = [
718 { type: Component, args: [{
719 selector: 'mat-tooltip-component',
720 template: "<div class=\"mat-tooltip\"\n [ngClass]=\"tooltipClass\"\n [class.mat-tooltip-handset]=\"(_isHandset | async)?.matches\"\n [@state]=\"_visibility\"\n (@state.start)=\"_animationStart()\"\n (@state.done)=\"_animationDone($event)\">{{message}}</div>\n",
721 encapsulation: ViewEncapsulation.None,
722 changeDetection: ChangeDetectionStrategy.OnPush,
723 animations: [matTooltipAnimations.tooltipState],
724 host: {
725 // Forces the element to have a layout in IE and Edge. This fixes issues where the element
726 // won't be rendered if the animations are disabled or there is no web animations polyfill.
727 '[style.zoom]': '_visibility === "visible" ? 1 : null',
728 'aria-hidden': 'true',
729 },
730 styles: [".mat-tooltip-panel{pointer-events:none !important}.mat-tooltip{color:#fff;border-radius:4px;margin:14px;max-width:250px;padding-left:8px;padding-right:8px;overflow:hidden;text-overflow:ellipsis}.cdk-high-contrast-active .mat-tooltip{outline:solid 1px}.mat-tooltip-handset{margin:24px;padding-left:16px;padding-right:16px}\n"]
731 },] }
732];
733TooltipComponent.ctorParameters = () => [
734 { type: ChangeDetectorRef },
735 { type: BreakpointObserver }
736];
737//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC90b29sdGlw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