module-C9K6ZqpI.mjs 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970
  1. import * as i0 from '@angular/core';
  2. import { InjectionToken, inject, ElementRef, NgZone, Injector, ViewContainerRef, afterNextRender, Directive, Input, ChangeDetectorRef, ANIMATION_MODULE_TYPE, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
  3. import { AriaDescriber, FocusMonitor, A11yModule } from '@angular/cdk/a11y';
  4. import { Overlay, ScrollDispatcher, OverlayModule } from '@angular/cdk/overlay';
  5. import { CdkScrollableModule } from '@angular/cdk/scrolling';
  6. import { takeUntil } from 'rxjs/operators';
  7. import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
  8. import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
  9. import { DOCUMENT, NgClass } from '@angular/common';
  10. import { normalizePassiveListenerOptions, Platform } from '@angular/cdk/platform';
  11. import { Directionality } from '@angular/cdk/bidi';
  12. import { ComponentPortal } from '@angular/cdk/portal';
  13. import { Subject } from 'rxjs';
  14. import { M as MatCommonModule } from './common-module-WayjW0Pb.mjs';
  15. /** Time in ms to throttle repositioning after scroll events. */
  16. const SCROLL_THROTTLE_MS = 20;
  17. /**
  18. * Creates an error to be thrown if the user supplied an invalid tooltip position.
  19. * @docs-private
  20. */
  21. function getMatTooltipInvalidPositionError(position) {
  22. return Error(`Tooltip position "${position}" is invalid.`);
  23. }
  24. /** Injection token that determines the scroll handling while a tooltip is visible. */
  25. const MAT_TOOLTIP_SCROLL_STRATEGY = new InjectionToken('mat-tooltip-scroll-strategy', {
  26. providedIn: 'root',
  27. factory: () => {
  28. const overlay = inject(Overlay);
  29. return () => overlay.scrollStrategies.reposition({ scrollThrottle: SCROLL_THROTTLE_MS });
  30. },
  31. });
  32. /**
  33. * @docs-private
  34. * @deprecated No longer used, will be removed.
  35. * @breaking-change 21.0.0
  36. */
  37. function MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY(overlay) {
  38. return () => overlay.scrollStrategies.reposition({ scrollThrottle: SCROLL_THROTTLE_MS });
  39. }
  40. /**
  41. * @docs-private
  42. * @deprecated No longer used, will be removed.
  43. * @breaking-change 21.0.0
  44. */
  45. 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. /**
  51. * @docs-private
  52. * @deprecated No longer used, will be removed.
  53. * @breaking-change 21.0.0
  54. */
  55. function MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY() {
  56. return {
  57. showDelay: 0,
  58. hideDelay: 0,
  59. touchendHideDelay: 1500,
  60. };
  61. }
  62. /** Injection token to be used to override the default options for `matTooltip`. */
  63. const MAT_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken('mat-tooltip-default-options', {
  64. providedIn: 'root',
  65. factory: MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY,
  66. });
  67. /**
  68. * CSS class that will be attached to the overlay panel.
  69. * @deprecated
  70. * @breaking-change 13.0.0 remove this variable
  71. */
  72. const TOOLTIP_PANEL_CLASS = 'mat-mdc-tooltip-panel';
  73. const PANEL_CLASS = 'tooltip-panel';
  74. /** Options used to bind passive event listeners. */
  75. const passiveListenerOptions = normalizePassiveListenerOptions({ passive: true });
  76. // These constants were taken from MDC's `numbers` object. We can't import them from MDC,
  77. // because they have some top-level references to `window` which break during SSR.
  78. const MIN_VIEWPORT_TOOLTIP_THRESHOLD = 8;
  79. const UNBOUNDED_ANCHOR_GAP = 8;
  80. const MIN_HEIGHT = 24;
  81. const MAX_WIDTH = 200;
  82. /**
  83. * Directive that attaches a material design tooltip to the host element. Animates the showing and
  84. * hiding of a tooltip provided position (defaults to below the element).
  85. *
  86. * https://material.io/design/components/tooltips.html
  87. */
  88. class MatTooltip {
  89. _elementRef = inject(ElementRef);
  90. _ngZone = inject(NgZone);
  91. _platform = inject(Platform);
  92. _ariaDescriber = inject(AriaDescriber);
  93. _focusMonitor = inject(FocusMonitor);
  94. _dir = inject(Directionality);
  95. _injector = inject(Injector);
  96. _viewContainerRef = inject(ViewContainerRef);
  97. _defaultOptions = inject(MAT_TOOLTIP_DEFAULT_OPTIONS, {
  98. optional: true,
  99. });
  100. _overlayRef;
  101. _tooltipInstance;
  102. _portal;
  103. _position = 'below';
  104. _positionAtOrigin = false;
  105. _disabled = false;
  106. _tooltipClass;
  107. _viewInitialized = false;
  108. _pointerExitEventsInitialized = false;
  109. _tooltipComponent = TooltipComponent;
  110. _viewportMargin = 8;
  111. _currentPosition;
  112. _cssClassPrefix = 'mat-mdc';
  113. _ariaDescriptionPending;
  114. _dirSubscribed = false;
  115. /** Allows the user to define the position of the tooltip relative to the parent element */
  116. get position() {
  117. return this._position;
  118. }
  119. set position(value) {
  120. if (value !== this._position) {
  121. this._position = value;
  122. if (this._overlayRef) {
  123. this._updatePosition(this._overlayRef);
  124. this._tooltipInstance?.show(0);
  125. this._overlayRef.updatePosition();
  126. }
  127. }
  128. }
  129. /**
  130. * Whether tooltip should be relative to the click or touch origin
  131. * instead of outside the element bounding box.
  132. */
  133. get positionAtOrigin() {
  134. return this._positionAtOrigin;
  135. }
  136. set positionAtOrigin(value) {
  137. this._positionAtOrigin = coerceBooleanProperty(value);
  138. this._detach();
  139. this._overlayRef = null;
  140. }
  141. /** Disables the display of the tooltip. */
  142. get disabled() {
  143. return this._disabled;
  144. }
  145. set disabled(value) {
  146. const isDisabled = coerceBooleanProperty(value);
  147. if (this._disabled !== isDisabled) {
  148. this._disabled = isDisabled;
  149. // If tooltip is disabled, hide immediately.
  150. if (isDisabled) {
  151. this.hide(0);
  152. }
  153. else {
  154. this._setupPointerEnterEventsIfNeeded();
  155. }
  156. this._syncAriaDescription(this.message);
  157. }
  158. }
  159. /** The default delay in ms before showing the tooltip after show is called */
  160. get showDelay() {
  161. return this._showDelay;
  162. }
  163. set showDelay(value) {
  164. this._showDelay = coerceNumberProperty(value);
  165. }
  166. _showDelay;
  167. /** The default delay in ms before hiding the tooltip after hide is called */
  168. get hideDelay() {
  169. return this._hideDelay;
  170. }
  171. set hideDelay(value) {
  172. this._hideDelay = coerceNumberProperty(value);
  173. if (this._tooltipInstance) {
  174. this._tooltipInstance._mouseLeaveHideDelay = this._hideDelay;
  175. }
  176. }
  177. _hideDelay;
  178. /**
  179. * How touch gestures should be handled by the tooltip. On touch devices the tooltip directive
  180. * uses a long press gesture to show and hide, however it can conflict with the native browser
  181. * gestures. To work around the conflict, Angular Material disables native gestures on the
  182. * trigger, but that might not be desirable on particular elements (e.g. inputs and draggable
  183. * elements). The different values for this option configure the touch event handling as follows:
  184. * - `auto` - Enables touch gestures for all elements, but tries to avoid conflicts with native
  185. * browser gestures on particular elements. In particular, it allows text selection on inputs
  186. * and textareas, and preserves the native browser dragging on elements marked as `draggable`.
  187. * - `on` - Enables touch gestures for all elements and disables native
  188. * browser gestures with no exceptions.
  189. * - `off` - Disables touch gestures. Note that this will prevent the tooltip from
  190. * showing on touch devices.
  191. */
  192. touchGestures = 'auto';
  193. /** The message to be displayed in the tooltip */
  194. get message() {
  195. return this._message;
  196. }
  197. set message(value) {
  198. const oldMessage = this._message;
  199. // If the message is not a string (e.g. number), convert it to a string and trim it.
  200. // Must convert with `String(value)`, not `${value}`, otherwise Closure Compiler optimises
  201. // away the string-conversion: https://github.com/angular/components/issues/20684
  202. this._message = value != null ? String(value).trim() : '';
  203. if (!this._message && this._isTooltipVisible()) {
  204. this.hide(0);
  205. }
  206. else {
  207. this._setupPointerEnterEventsIfNeeded();
  208. this._updateTooltipMessage();
  209. }
  210. this._syncAriaDescription(oldMessage);
  211. }
  212. _message = '';
  213. /** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */
  214. get tooltipClass() {
  215. return this._tooltipClass;
  216. }
  217. set tooltipClass(value) {
  218. this._tooltipClass = value;
  219. if (this._tooltipInstance) {
  220. this._setTooltipClass(this._tooltipClass);
  221. }
  222. }
  223. /** Manually-bound passive event listeners. */
  224. _passiveListeners = [];
  225. /** Timer started at the last `touchstart` event. */
  226. _touchstartTimeout = null;
  227. /** Emits when the component is destroyed. */
  228. _destroyed = new Subject();
  229. /** Whether ngOnDestroyed has been called. */
  230. _isDestroyed = false;
  231. constructor() {
  232. const defaultOptions = this._defaultOptions;
  233. if (defaultOptions) {
  234. this._showDelay = defaultOptions.showDelay;
  235. this._hideDelay = defaultOptions.hideDelay;
  236. if (defaultOptions.position) {
  237. this.position = defaultOptions.position;
  238. }
  239. if (defaultOptions.positionAtOrigin) {
  240. this.positionAtOrigin = defaultOptions.positionAtOrigin;
  241. }
  242. if (defaultOptions.touchGestures) {
  243. this.touchGestures = defaultOptions.touchGestures;
  244. }
  245. if (defaultOptions.tooltipClass) {
  246. this.tooltipClass = defaultOptions.tooltipClass;
  247. }
  248. }
  249. this._viewportMargin = MIN_VIEWPORT_TOOLTIP_THRESHOLD;
  250. }
  251. ngAfterViewInit() {
  252. // This needs to happen after view init so the initial values for all inputs have been set.
  253. this._viewInitialized = true;
  254. this._setupPointerEnterEventsIfNeeded();
  255. this._focusMonitor
  256. .monitor(this._elementRef)
  257. .pipe(takeUntil(this._destroyed))
  258. .subscribe(origin => {
  259. // Note that the focus monitor runs outside the Angular zone.
  260. if (!origin) {
  261. this._ngZone.run(() => this.hide(0));
  262. }
  263. else if (origin === 'keyboard') {
  264. this._ngZone.run(() => this.show());
  265. }
  266. });
  267. }
  268. /**
  269. * Dispose the tooltip when destroyed.
  270. */
  271. ngOnDestroy() {
  272. const nativeElement = this._elementRef.nativeElement;
  273. // Optimization: Do not call clearTimeout unless there is an active timer.
  274. if (this._touchstartTimeout) {
  275. clearTimeout(this._touchstartTimeout);
  276. }
  277. if (this._overlayRef) {
  278. this._overlayRef.dispose();
  279. this._tooltipInstance = null;
  280. }
  281. // Clean up the event listeners set in the constructor
  282. this._passiveListeners.forEach(([event, listener]) => {
  283. nativeElement.removeEventListener(event, listener, passiveListenerOptions);
  284. });
  285. this._passiveListeners.length = 0;
  286. this._destroyed.next();
  287. this._destroyed.complete();
  288. this._isDestroyed = true;
  289. this._ariaDescriber.removeDescription(nativeElement, this.message, 'tooltip');
  290. this._focusMonitor.stopMonitoring(nativeElement);
  291. }
  292. /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */
  293. show(delay = this.showDelay, origin) {
  294. if (this.disabled || !this.message || this._isTooltipVisible()) {
  295. this._tooltipInstance?._cancelPendingAnimations();
  296. return;
  297. }
  298. const overlayRef = this._createOverlay(origin);
  299. this._detach();
  300. this._portal =
  301. this._portal || new ComponentPortal(this._tooltipComponent, this._viewContainerRef);
  302. const instance = (this._tooltipInstance = overlayRef.attach(this._portal).instance);
  303. instance._triggerElement = this._elementRef.nativeElement;
  304. instance._mouseLeaveHideDelay = this._hideDelay;
  305. instance
  306. .afterHidden()
  307. .pipe(takeUntil(this._destroyed))
  308. .subscribe(() => this._detach());
  309. this._setTooltipClass(this._tooltipClass);
  310. this._updateTooltipMessage();
  311. instance.show(delay);
  312. }
  313. /** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */
  314. hide(delay = this.hideDelay) {
  315. const instance = this._tooltipInstance;
  316. if (instance) {
  317. if (instance.isVisible()) {
  318. instance.hide(delay);
  319. }
  320. else {
  321. instance._cancelPendingAnimations();
  322. this._detach();
  323. }
  324. }
  325. }
  326. /** Shows/hides the tooltip */
  327. toggle(origin) {
  328. this._isTooltipVisible() ? this.hide() : this.show(undefined, origin);
  329. }
  330. /** Returns true if the tooltip is currently visible to the user */
  331. _isTooltipVisible() {
  332. return !!this._tooltipInstance && this._tooltipInstance.isVisible();
  333. }
  334. /** Create the overlay config and position strategy */
  335. _createOverlay(origin) {
  336. if (this._overlayRef) {
  337. const existingStrategy = this._overlayRef.getConfig()
  338. .positionStrategy;
  339. if ((!this.positionAtOrigin || !origin) && existingStrategy._origin instanceof ElementRef) {
  340. return this._overlayRef;
  341. }
  342. this._detach();
  343. }
  344. const scrollableAncestors = this._injector
  345. .get(ScrollDispatcher)
  346. .getAncestorScrollContainers(this._elementRef);
  347. const overlay = this._injector.get(Overlay);
  348. // Create connected position strategy that listens for scroll events to reposition.
  349. const strategy = overlay
  350. .position()
  351. .flexibleConnectedTo(this.positionAtOrigin ? origin || this._elementRef : this._elementRef)
  352. .withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`)
  353. .withFlexibleDimensions(false)
  354. .withViewportMargin(this._viewportMargin)
  355. .withScrollableContainers(scrollableAncestors);
  356. strategy.positionChanges.pipe(takeUntil(this._destroyed)).subscribe(change => {
  357. this._updateCurrentPositionClass(change.connectionPair);
  358. if (this._tooltipInstance) {
  359. if (change.scrollableViewProperties.isOverlayClipped && this._tooltipInstance.isVisible()) {
  360. // After position changes occur and the overlay is clipped by
  361. // a parent scrollable then close the tooltip.
  362. this._ngZone.run(() => this.hide(0));
  363. }
  364. }
  365. });
  366. this._overlayRef = overlay.create({
  367. direction: this._dir,
  368. positionStrategy: strategy,
  369. panelClass: `${this._cssClassPrefix}-${PANEL_CLASS}`,
  370. scrollStrategy: this._injector.get(MAT_TOOLTIP_SCROLL_STRATEGY)(),
  371. });
  372. this._updatePosition(this._overlayRef);
  373. this._overlayRef
  374. .detachments()
  375. .pipe(takeUntil(this._destroyed))
  376. .subscribe(() => this._detach());
  377. this._overlayRef
  378. .outsidePointerEvents()
  379. .pipe(takeUntil(this._destroyed))
  380. .subscribe(() => this._tooltipInstance?._handleBodyInteraction());
  381. this._overlayRef
  382. .keydownEvents()
  383. .pipe(takeUntil(this._destroyed))
  384. .subscribe(event => {
  385. if (this._isTooltipVisible() && event.keyCode === ESCAPE && !hasModifierKey(event)) {
  386. event.preventDefault();
  387. event.stopPropagation();
  388. this._ngZone.run(() => this.hide(0));
  389. }
  390. });
  391. if (this._defaultOptions?.disableTooltipInteractivity) {
  392. this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`);
  393. }
  394. if (!this._dirSubscribed) {
  395. this._dirSubscribed = true;
  396. this._dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {
  397. if (this._overlayRef) {
  398. this._updatePosition(this._overlayRef);
  399. }
  400. });
  401. }
  402. return this._overlayRef;
  403. }
  404. /** Detaches the currently-attached tooltip. */
  405. _detach() {
  406. if (this._overlayRef && this._overlayRef.hasAttached()) {
  407. this._overlayRef.detach();
  408. }
  409. this._tooltipInstance = null;
  410. }
  411. /** Updates the position of the current tooltip. */
  412. _updatePosition(overlayRef) {
  413. const position = overlayRef.getConfig().positionStrategy;
  414. const origin = this._getOrigin();
  415. const overlay = this._getOverlayPosition();
  416. position.withPositions([
  417. this._addOffset({ ...origin.main, ...overlay.main }),
  418. this._addOffset({ ...origin.fallback, ...overlay.fallback }),
  419. ]);
  420. }
  421. /** Adds the configured offset to a position. Used as a hook for child classes. */
  422. _addOffset(position) {
  423. const offset = UNBOUNDED_ANCHOR_GAP;
  424. const isLtr = !this._dir || this._dir.value == 'ltr';
  425. if (position.originY === 'top') {
  426. position.offsetY = -offset;
  427. }
  428. else if (position.originY === 'bottom') {
  429. position.offsetY = offset;
  430. }
  431. else if (position.originX === 'start') {
  432. position.offsetX = isLtr ? -offset : offset;
  433. }
  434. else if (position.originX === 'end') {
  435. position.offsetX = isLtr ? offset : -offset;
  436. }
  437. return position;
  438. }
  439. /**
  440. * Returns the origin position and a fallback position based on the user's position preference.
  441. * The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`).
  442. */
  443. _getOrigin() {
  444. const isLtr = !this._dir || this._dir.value == 'ltr';
  445. const position = this.position;
  446. let originPosition;
  447. if (position == 'above' || position == 'below') {
  448. originPosition = { originX: 'center', originY: position == 'above' ? 'top' : 'bottom' };
  449. }
  450. else if (position == 'before' ||
  451. (position == 'left' && isLtr) ||
  452. (position == 'right' && !isLtr)) {
  453. originPosition = { originX: 'start', originY: 'center' };
  454. }
  455. else if (position == 'after' ||
  456. (position == 'right' && isLtr) ||
  457. (position == 'left' && !isLtr)) {
  458. originPosition = { originX: 'end', originY: 'center' };
  459. }
  460. else if (typeof ngDevMode === 'undefined' || ngDevMode) {
  461. throw getMatTooltipInvalidPositionError(position);
  462. }
  463. const { x, y } = this._invertPosition(originPosition.originX, originPosition.originY);
  464. return {
  465. main: originPosition,
  466. fallback: { originX: x, originY: y },
  467. };
  468. }
  469. /** Returns the overlay position and a fallback position based on the user's preference */
  470. _getOverlayPosition() {
  471. const isLtr = !this._dir || this._dir.value == 'ltr';
  472. const position = this.position;
  473. let overlayPosition;
  474. if (position == 'above') {
  475. overlayPosition = { overlayX: 'center', overlayY: 'bottom' };
  476. }
  477. else if (position == 'below') {
  478. overlayPosition = { overlayX: 'center', overlayY: 'top' };
  479. }
  480. else if (position == 'before' ||
  481. (position == 'left' && isLtr) ||
  482. (position == 'right' && !isLtr)) {
  483. overlayPosition = { overlayX: 'end', overlayY: 'center' };
  484. }
  485. else if (position == 'after' ||
  486. (position == 'right' && isLtr) ||
  487. (position == 'left' && !isLtr)) {
  488. overlayPosition = { overlayX: 'start', overlayY: 'center' };
  489. }
  490. else if (typeof ngDevMode === 'undefined' || ngDevMode) {
  491. throw getMatTooltipInvalidPositionError(position);
  492. }
  493. const { x, y } = this._invertPosition(overlayPosition.overlayX, overlayPosition.overlayY);
  494. return {
  495. main: overlayPosition,
  496. fallback: { overlayX: x, overlayY: y },
  497. };
  498. }
  499. /** Updates the tooltip message and repositions the overlay according to the new message length */
  500. _updateTooltipMessage() {
  501. // Must wait for the message to be painted to the tooltip so that the overlay can properly
  502. // calculate the correct positioning based on the size of the text.
  503. if (this._tooltipInstance) {
  504. this._tooltipInstance.message = this.message;
  505. this._tooltipInstance._markForCheck();
  506. afterNextRender(() => {
  507. if (this._tooltipInstance) {
  508. this._overlayRef.updatePosition();
  509. }
  510. }, {
  511. injector: this._injector,
  512. });
  513. }
  514. }
  515. /** Updates the tooltip class */
  516. _setTooltipClass(tooltipClass) {
  517. if (this._tooltipInstance) {
  518. this._tooltipInstance.tooltipClass = tooltipClass;
  519. this._tooltipInstance._markForCheck();
  520. }
  521. }
  522. /** Inverts an overlay position. */
  523. _invertPosition(x, y) {
  524. if (this.position === 'above' || this.position === 'below') {
  525. if (y === 'top') {
  526. y = 'bottom';
  527. }
  528. else if (y === 'bottom') {
  529. y = 'top';
  530. }
  531. }
  532. else {
  533. if (x === 'end') {
  534. x = 'start';
  535. }
  536. else if (x === 'start') {
  537. x = 'end';
  538. }
  539. }
  540. return { x, y };
  541. }
  542. /** Updates the class on the overlay panel based on the current position of the tooltip. */
  543. _updateCurrentPositionClass(connectionPair) {
  544. const { overlayY, originX, originY } = connectionPair;
  545. let newPosition;
  546. // If the overlay is in the middle along the Y axis,
  547. // it means that it's either before or after.
  548. if (overlayY === 'center') {
  549. // Note that since this information is used for styling, we want to
  550. // resolve `start` and `end` to their real values, otherwise consumers
  551. // would have to remember to do it themselves on each consumption.
  552. if (this._dir && this._dir.value === 'rtl') {
  553. newPosition = originX === 'end' ? 'left' : 'right';
  554. }
  555. else {
  556. newPosition = originX === 'start' ? 'left' : 'right';
  557. }
  558. }
  559. else {
  560. newPosition = overlayY === 'bottom' && originY === 'top' ? 'above' : 'below';
  561. }
  562. if (newPosition !== this._currentPosition) {
  563. const overlayRef = this._overlayRef;
  564. if (overlayRef) {
  565. const classPrefix = `${this._cssClassPrefix}-${PANEL_CLASS}-`;
  566. overlayRef.removePanelClass(classPrefix + this._currentPosition);
  567. overlayRef.addPanelClass(classPrefix + newPosition);
  568. }
  569. this._currentPosition = newPosition;
  570. }
  571. }
  572. /** Binds the pointer events to the tooltip trigger. */
  573. _setupPointerEnterEventsIfNeeded() {
  574. // Optimization: Defer hooking up events if there's no message or the tooltip is disabled.
  575. if (this._disabled ||
  576. !this.message ||
  577. !this._viewInitialized ||
  578. this._passiveListeners.length) {
  579. return;
  580. }
  581. // The mouse events shouldn't be bound on mobile devices, because they can prevent the
  582. // first tap from firing its click event or can cause the tooltip to open for clicks.
  583. if (this._platformSupportsMouseEvents()) {
  584. this._passiveListeners.push([
  585. 'mouseenter',
  586. event => {
  587. this._setupPointerExitEventsIfNeeded();
  588. let point = undefined;
  589. if (event.x !== undefined && event.y !== undefined) {
  590. point = event;
  591. }
  592. this.show(undefined, point);
  593. },
  594. ]);
  595. }
  596. else if (this.touchGestures !== 'off') {
  597. this._disableNativeGesturesIfNecessary();
  598. this._passiveListeners.push([
  599. 'touchstart',
  600. event => {
  601. const touch = event.targetTouches?.[0];
  602. const origin = touch ? { x: touch.clientX, y: touch.clientY } : undefined;
  603. // Note that it's important that we don't `preventDefault` here,
  604. // because it can prevent click events from firing on the element.
  605. this._setupPointerExitEventsIfNeeded();
  606. if (this._touchstartTimeout) {
  607. clearTimeout(this._touchstartTimeout);
  608. }
  609. const DEFAULT_LONGPRESS_DELAY = 500;
  610. this._touchstartTimeout = setTimeout(() => {
  611. this._touchstartTimeout = null;
  612. this.show(undefined, origin);
  613. }, this._defaultOptions?.touchLongPressShowDelay ?? DEFAULT_LONGPRESS_DELAY);
  614. },
  615. ]);
  616. }
  617. this._addListeners(this._passiveListeners);
  618. }
  619. _setupPointerExitEventsIfNeeded() {
  620. if (this._pointerExitEventsInitialized) {
  621. return;
  622. }
  623. this._pointerExitEventsInitialized = true;
  624. const exitListeners = [];
  625. if (this._platformSupportsMouseEvents()) {
  626. exitListeners.push([
  627. 'mouseleave',
  628. event => {
  629. const newTarget = event.relatedTarget;
  630. if (!newTarget || !this._overlayRef?.overlayElement.contains(newTarget)) {
  631. this.hide();
  632. }
  633. },
  634. ], ['wheel', event => this._wheelListener(event)]);
  635. }
  636. else if (this.touchGestures !== 'off') {
  637. this._disableNativeGesturesIfNecessary();
  638. const touchendListener = () => {
  639. if (this._touchstartTimeout) {
  640. clearTimeout(this._touchstartTimeout);
  641. }
  642. this.hide(this._defaultOptions?.touchendHideDelay);
  643. };
  644. exitListeners.push(['touchend', touchendListener], ['touchcancel', touchendListener]);
  645. }
  646. this._addListeners(exitListeners);
  647. this._passiveListeners.push(...exitListeners);
  648. }
  649. _addListeners(listeners) {
  650. listeners.forEach(([event, listener]) => {
  651. this._elementRef.nativeElement.addEventListener(event, listener, passiveListenerOptions);
  652. });
  653. }
  654. _platformSupportsMouseEvents() {
  655. return !this._platform.IOS && !this._platform.ANDROID;
  656. }
  657. /** Listener for the `wheel` event on the element. */
  658. _wheelListener(event) {
  659. if (this._isTooltipVisible()) {
  660. const elementUnderPointer = this._injector
  661. .get(DOCUMENT)
  662. .elementFromPoint(event.clientX, event.clientY);
  663. const element = this._elementRef.nativeElement;
  664. // On non-touch devices we depend on the `mouseleave` event to close the tooltip, but it
  665. // won't fire if the user scrolls away using the wheel without moving their cursor. We
  666. // work around it by finding the element under the user's cursor and closing the tooltip
  667. // if it's not the trigger.
  668. if (elementUnderPointer !== element && !element.contains(elementUnderPointer)) {
  669. this.hide();
  670. }
  671. }
  672. }
  673. /** Disables the native browser gestures, based on how the tooltip has been configured. */
  674. _disableNativeGesturesIfNecessary() {
  675. const gestures = this.touchGestures;
  676. if (gestures !== 'off') {
  677. const element = this._elementRef.nativeElement;
  678. const style = element.style;
  679. // If gestures are set to `auto`, we don't disable text selection on inputs and
  680. // textareas, because it prevents the user from typing into them on iOS Safari.
  681. if (gestures === 'on' || (element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA')) {
  682. style.userSelect =
  683. style.msUserSelect =
  684. style.webkitUserSelect =
  685. style.MozUserSelect =
  686. 'none';
  687. }
  688. // If we have `auto` gestures and the element uses native HTML dragging,
  689. // we don't set `-webkit-user-drag` because it prevents the native behavior.
  690. if (gestures === 'on' || !element.draggable) {
  691. style.webkitUserDrag = 'none';
  692. }
  693. style.touchAction = 'none';
  694. style.webkitTapHighlightColor = 'transparent';
  695. }
  696. }
  697. /** Updates the tooltip's ARIA description based on it current state. */
  698. _syncAriaDescription(oldMessage) {
  699. if (this._ariaDescriptionPending) {
  700. return;
  701. }
  702. this._ariaDescriptionPending = true;
  703. this._ariaDescriber.removeDescription(this._elementRef.nativeElement, oldMessage, 'tooltip');
  704. // The `AriaDescriber` has some functionality that avoids adding a description if it's the
  705. // same as the `aria-label` of an element, however we can't know whether the tooltip trigger
  706. // has a data-bound `aria-label` or when it'll be set for the first time. We can avoid the
  707. // issue by deferring the description by a tick so Angular has time to set the `aria-label`.
  708. if (!this._isDestroyed) {
  709. afterNextRender({
  710. write: () => {
  711. this._ariaDescriptionPending = false;
  712. if (this.message && !this.disabled) {
  713. this._ariaDescriber.describe(this._elementRef.nativeElement, this.message, 'tooltip');
  714. }
  715. },
  716. }, { injector: this._injector });
  717. }
  718. }
  719. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  720. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: MatTooltip, isStandalone: true, selector: "[matTooltip]", inputs: { position: ["matTooltipPosition", "position"], positionAtOrigin: ["matTooltipPositionAtOrigin", "positionAtOrigin"], disabled: ["matTooltipDisabled", "disabled"], showDelay: ["matTooltipShowDelay", "showDelay"], hideDelay: ["matTooltipHideDelay", "hideDelay"], touchGestures: ["matTooltipTouchGestures", "touchGestures"], message: ["matTooltip", "message"], tooltipClass: ["matTooltipClass", "tooltipClass"] }, host: { properties: { "class.mat-mdc-tooltip-disabled": "disabled" }, classAttribute: "mat-mdc-tooltip-trigger" }, exportAs: ["matTooltip"], ngImport: i0 });
  721. }
  722. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatTooltip, decorators: [{
  723. type: Directive,
  724. args: [{
  725. selector: '[matTooltip]',
  726. exportAs: 'matTooltip',
  727. host: {
  728. 'class': 'mat-mdc-tooltip-trigger',
  729. '[class.mat-mdc-tooltip-disabled]': 'disabled',
  730. },
  731. }]
  732. }], ctorParameters: () => [], propDecorators: { position: [{
  733. type: Input,
  734. args: ['matTooltipPosition']
  735. }], positionAtOrigin: [{
  736. type: Input,
  737. args: ['matTooltipPositionAtOrigin']
  738. }], disabled: [{
  739. type: Input,
  740. args: ['matTooltipDisabled']
  741. }], showDelay: [{
  742. type: Input,
  743. args: ['matTooltipShowDelay']
  744. }], hideDelay: [{
  745. type: Input,
  746. args: ['matTooltipHideDelay']
  747. }], touchGestures: [{
  748. type: Input,
  749. args: ['matTooltipTouchGestures']
  750. }], message: [{
  751. type: Input,
  752. args: ['matTooltip']
  753. }], tooltipClass: [{
  754. type: Input,
  755. args: ['matTooltipClass']
  756. }] } });
  757. /**
  758. * Internal component that wraps the tooltip's content.
  759. * @docs-private
  760. */
  761. class TooltipComponent {
  762. _changeDetectorRef = inject(ChangeDetectorRef);
  763. _elementRef = inject(ElementRef);
  764. /* Whether the tooltip text overflows to multiple lines */
  765. _isMultiline = false;
  766. /** Message to display in the tooltip */
  767. message;
  768. /** Classes to be added to the tooltip. Supports the same syntax as `ngClass`. */
  769. tooltipClass;
  770. /** The timeout ID of any current timer set to show the tooltip */
  771. _showTimeoutId;
  772. /** The timeout ID of any current timer set to hide the tooltip */
  773. _hideTimeoutId;
  774. /** Element that caused the tooltip to open. */
  775. _triggerElement;
  776. /** Amount of milliseconds to delay the closing sequence. */
  777. _mouseLeaveHideDelay;
  778. /** Whether animations are currently disabled. */
  779. _animationsDisabled;
  780. /** Reference to the internal tooltip element. */
  781. _tooltip;
  782. /** Whether interactions on the page should close the tooltip */
  783. _closeOnInteraction = false;
  784. /** Whether the tooltip is currently visible. */
  785. _isVisible = false;
  786. /** Subject for notifying that the tooltip has been hidden from the view */
  787. _onHide = new Subject();
  788. /** Name of the show animation and the class that toggles it. */
  789. _showAnimation = 'mat-mdc-tooltip-show';
  790. /** Name of the hide animation and the class that toggles it. */
  791. _hideAnimation = 'mat-mdc-tooltip-hide';
  792. constructor() {
  793. const animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
  794. this._animationsDisabled = animationMode === 'NoopAnimations';
  795. }
  796. /**
  797. * Shows the tooltip with an animation originating from the provided origin
  798. * @param delay Amount of milliseconds to the delay showing the tooltip.
  799. */
  800. show(delay) {
  801. // Cancel the delayed hide if it is scheduled
  802. if (this._hideTimeoutId != null) {
  803. clearTimeout(this._hideTimeoutId);
  804. }
  805. this._showTimeoutId = setTimeout(() => {
  806. this._toggleVisibility(true);
  807. this._showTimeoutId = undefined;
  808. }, delay);
  809. }
  810. /**
  811. * Begins the animation to hide the tooltip after the provided delay in ms.
  812. * @param delay Amount of milliseconds to delay showing the tooltip.
  813. */
  814. hide(delay) {
  815. // Cancel the delayed show if it is scheduled
  816. if (this._showTimeoutId != null) {
  817. clearTimeout(this._showTimeoutId);
  818. }
  819. this._hideTimeoutId = setTimeout(() => {
  820. this._toggleVisibility(false);
  821. this._hideTimeoutId = undefined;
  822. }, delay);
  823. }
  824. /** Returns an observable that notifies when the tooltip has been hidden from view. */
  825. afterHidden() {
  826. return this._onHide;
  827. }
  828. /** Whether the tooltip is being displayed. */
  829. isVisible() {
  830. return this._isVisible;
  831. }
  832. ngOnDestroy() {
  833. this._cancelPendingAnimations();
  834. this._onHide.complete();
  835. this._triggerElement = null;
  836. }
  837. /**
  838. * Interactions on the HTML body should close the tooltip immediately as defined in the
  839. * material design spec.
  840. * https://material.io/design/components/tooltips.html#behavior
  841. */
  842. _handleBodyInteraction() {
  843. if (this._closeOnInteraction) {
  844. this.hide(0);
  845. }
  846. }
  847. /**
  848. * Marks that the tooltip needs to be checked in the next change detection run.
  849. * Mainly used for rendering the initial text before positioning a tooltip, which
  850. * can be problematic in components with OnPush change detection.
  851. */
  852. _markForCheck() {
  853. this._changeDetectorRef.markForCheck();
  854. }
  855. _handleMouseLeave({ relatedTarget }) {
  856. if (!relatedTarget || !this._triggerElement.contains(relatedTarget)) {
  857. if (this.isVisible()) {
  858. this.hide(this._mouseLeaveHideDelay);
  859. }
  860. else {
  861. this._finalizeAnimation(false);
  862. }
  863. }
  864. }
  865. /**
  866. * Callback for when the timeout in this.show() gets completed.
  867. * This method is only needed by the mdc-tooltip, and so it is only implemented
  868. * in the mdc-tooltip, not here.
  869. */
  870. _onShow() {
  871. this._isMultiline = this._isTooltipMultiline();
  872. this._markForCheck();
  873. }
  874. /** Whether the tooltip text has overflown to the next line */
  875. _isTooltipMultiline() {
  876. const rect = this._elementRef.nativeElement.getBoundingClientRect();
  877. return rect.height > MIN_HEIGHT && rect.width >= MAX_WIDTH;
  878. }
  879. /** Event listener dispatched when an animation on the tooltip finishes. */
  880. _handleAnimationEnd({ animationName }) {
  881. if (animationName === this._showAnimation || animationName === this._hideAnimation) {
  882. this._finalizeAnimation(animationName === this._showAnimation);
  883. }
  884. }
  885. /** Cancels any pending animation sequences. */
  886. _cancelPendingAnimations() {
  887. if (this._showTimeoutId != null) {
  888. clearTimeout(this._showTimeoutId);
  889. }
  890. if (this._hideTimeoutId != null) {
  891. clearTimeout(this._hideTimeoutId);
  892. }
  893. this._showTimeoutId = this._hideTimeoutId = undefined;
  894. }
  895. /** Handles the cleanup after an animation has finished. */
  896. _finalizeAnimation(toVisible) {
  897. if (toVisible) {
  898. this._closeOnInteraction = true;
  899. }
  900. else if (!this.isVisible()) {
  901. this._onHide.next();
  902. }
  903. }
  904. /** Toggles the visibility of the tooltip element. */
  905. _toggleVisibility(isVisible) {
  906. // We set the classes directly here ourselves so that toggling the tooltip state
  907. // isn't bound by change detection. This allows us to hide it even if the
  908. // view ref has been detached from the CD tree.
  909. const tooltip = this._tooltip.nativeElement;
  910. const showClass = this._showAnimation;
  911. const hideClass = this._hideAnimation;
  912. tooltip.classList.remove(isVisible ? hideClass : showClass);
  913. tooltip.classList.add(isVisible ? showClass : hideClass);
  914. if (this._isVisible !== isVisible) {
  915. this._isVisible = isVisible;
  916. this._changeDetectorRef.markForCheck();
  917. }
  918. // It's common for internal apps to disable animations using `* { animation: none !important }`
  919. // which can break the opening sequence. Try to detect such cases and work around them.
  920. if (isVisible && !this._animationsDisabled && typeof getComputedStyle === 'function') {
  921. const styles = getComputedStyle(tooltip);
  922. // Use `getPropertyValue` to avoid issues with property renaming.
  923. if (styles.getPropertyValue('animation-duration') === '0s' ||
  924. styles.getPropertyValue('animation-name') === 'none') {
  925. this._animationsDisabled = true;
  926. }
  927. }
  928. if (isVisible) {
  929. this._onShow();
  930. }
  931. if (this._animationsDisabled) {
  932. tooltip.classList.add('_mat-animation-noopable');
  933. this._finalizeAnimation(isVisible);
  934. }
  935. }
  936. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
  937. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: TooltipComponent, isStandalone: true, selector: "mat-tooltip-component", host: { attributes: { "aria-hidden": "true" }, listeners: { "mouseleave": "_handleMouseLeave($event)" } }, viewQueries: [{ propertyName: "_tooltip", first: true, predicate: ["tooltip"], descendants: true, static: true }], ngImport: i0, template: "<div\n #tooltip\n class=\"mdc-tooltip mat-mdc-tooltip\"\n [ngClass]=\"tooltipClass\"\n (animationend)=\"_handleAnimationEnd($event)\"\n [class.mdc-tooltip--multiline]=\"_isMultiline\">\n <div class=\"mat-mdc-tooltip-surface mdc-tooltip__surface\">{{message}}</div>\n</div>\n", styles: [".mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:\"\";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mdc-plain-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mdc-plain-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-plain-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mdc-plain-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mdc-plain-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mdc-plain-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mdc-plain-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  938. }
  939. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: TooltipComponent, decorators: [{
  940. type: Component,
  941. args: [{ selector: 'mat-tooltip-component', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
  942. '(mouseleave)': '_handleMouseLeave($event)',
  943. 'aria-hidden': 'true',
  944. }, imports: [NgClass], template: "<div\n #tooltip\n class=\"mdc-tooltip mat-mdc-tooltip\"\n [ngClass]=\"tooltipClass\"\n (animationend)=\"_handleAnimationEnd($event)\"\n [class.mdc-tooltip--multiline]=\"_isMultiline\">\n <div class=\"mat-mdc-tooltip-surface mdc-tooltip__surface\">{{message}}</div>\n</div>\n", styles: [".mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:\"\";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mdc-plain-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mdc-plain-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-plain-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mdc-plain-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mdc-plain-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mdc-plain-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mdc-plain-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}\n"] }]
  945. }], ctorParameters: () => [], propDecorators: { _tooltip: [{
  946. type: ViewChild,
  947. args: ['tooltip', {
  948. // Use a static query here since we interact directly with
  949. // the DOM which can happen before `ngAfterViewInit`.
  950. static: true,
  951. }]
  952. }] } });
  953. class MatTooltipModule {
  954. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  955. static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.6", ngImport: i0, type: MatTooltipModule, imports: [A11yModule, OverlayModule, MatCommonModule, MatTooltip, TooltipComponent], exports: [MatTooltip, TooltipComponent, MatCommonModule, CdkScrollableModule] });
  956. static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatTooltipModule, providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER], imports: [A11yModule, OverlayModule, MatCommonModule, MatCommonModule, CdkScrollableModule] });
  957. }
  958. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatTooltipModule, decorators: [{
  959. type: NgModule,
  960. args: [{
  961. imports: [A11yModule, OverlayModule, MatCommonModule, MatTooltip, TooltipComponent],
  962. exports: [MatTooltip, TooltipComponent, MatCommonModule, CdkScrollableModule],
  963. providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER],
  964. }]
  965. }] });
  966. export { MAT_TOOLTIP_SCROLL_STRATEGY as M, SCROLL_THROTTLE_MS as S, TOOLTIP_PANEL_CLASS as T, MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY as a, MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER as b, MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY as c, MAT_TOOLTIP_DEFAULT_OPTIONS as d, MatTooltip as e, TooltipComponent as f, getMatTooltipInvalidPositionError as g, MatTooltipModule as h };
  967. //# sourceMappingURL=module-C9K6ZqpI.mjs.map