| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/overlay"),require("@angular/cdk/a11y"),require("@angular/common"),require("@angular/core"),require("@angular/material/core"),require("@angular/cdk/scrolling"),require("@angular/cdk/bidi"),require("@angular/cdk/coercion"),require("@angular/cdk/keycodes"),require("@angular/cdk/layout"),require("@angular/cdk/platform"),require("@angular/cdk/portal"),require("rxjs"),require("rxjs/operators"),require("@angular/animations")):"function"==typeof define&&define.amd?define("@angular/material/tooltip",["exports","@angular/cdk/overlay","@angular/cdk/a11y","@angular/common","@angular/core","@angular/material/core","@angular/cdk/scrolling","@angular/cdk/bidi","@angular/cdk/coercion","@angular/cdk/keycodes","@angular/cdk/layout","@angular/cdk/platform","@angular/cdk/portal","rxjs","rxjs/operators","@angular/animations"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.tooltip={}),t.ng.cdk.overlay,t.ng.cdk.a11y,t.ng.common,t.ng.core,t.ng.material.core,t.ng.cdk.scrolling,t.ng.cdk.bidi,t.ng.cdk.coercion,t.ng.cdk.keycodes,t.ng.cdk.layout,t.ng.cdk.platform,t.ng.cdk.portal,t.rxjs,t.rxjs.operators,t.ng.animations)}(this,(function(t,e,i,o,n,s,r,a,l,p,c,h,u,d,_,f){"use strict"; |
| var m={tooltipState:f.trigger("state",[f.state("initial, void, hidden",f.style({opacity:0,transform:"scale(0)"})),f.state("visible",f.style({transform:"scale(1)"})),f.transition("* => visible",f.animate("200ms cubic-bezier(0, 0, 0.2, 1)",f.keyframes([f.style({opacity:0,transform:"scale(0)",offset:0}),f.style({opacity:.5,transform:"scale(0.99)",offset:.5}),f.style({opacity:1,transform:"scale(1)",offset:1})]))),f.transition("* => hidden",f.animate("100ms cubic-bezier(0, 0, 0.2, 1)",f.style({opacity:0})))])},g=h.normalizePassiveListenerOptions({passive:!0}),v=new n.InjectionToken("mat-tooltip-scroll-strategy");function b(t){return function(){return t.scrollStrategies.reposition({scrollThrottle:20})}}var T={provide:v,deps:[e.Overlay],useFactory:b},I=new n.InjectionToken("mat-tooltip-default-options",{providedIn:"root",factory:k});function k(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}var O=function(){function t(t,e,i,o,n,s,r,a,l,c,h,u){var _=this;this._overlay=t,this._elementRef=e,this._scrollDispatcher=i,this._viewContainerRef=o,this._ngZone=n,this._platform=s,this._ariaDescriber=r,this._focusMonitor=a,this._dir=c,this._defaultOptions=h,this._position="below",this._disabled=!1,this._viewInitialized=!1,this._pointerExitEventsInitialized=!1,this.showDelay=this._defaultOptions.showDelay,this.hideDelay=this._defaultOptions.hideDelay,this.touchGestures="auto",this._message="",this._passiveListeners=[],this._destroyed=new d.Subject,this._handleKeydown=function(t){_._isTooltipVisible()&&t.keyCode===p.ESCAPE&&!p.hasModifierKey(t)&&(t.preventDefault(),t.stopPropagation(),_._ngZone.run((function(){return _.hide(0)})))},this._scrollStrategy=l,h&&(h.position&&(this.position=h.position),h.touchGestures&&(this.touchGestures=h.touchGestures)),n.runOutsideAngular((function(){e.nativeElement.addEventListener("keydown",_._handleKeydown)}))}return Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(),this._tooltipInstance&&this._tooltipInstance.show(0),this._overlayRef.updatePosition()))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=l.coerceBooleanProperty(t),this._disabled?this.hide(0):this._setupPointerEnterEventsIfNeeded()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},set:function(t){var e=this;this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this._message,"tooltip"),this._message=null!=t?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage(),this._ngZone.runOutsideAngular((function(){Promise.resolve().then((function(){e._ariaDescriber.describe(e._elementRef.nativeElement,e.message,"tooltip")}))})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tooltipClass",{get:function(){return this._tooltipClass},set:function(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(_.takeUntil(this._destroyed)).subscribe((function(e){e?"keyboard"===e&&t._ngZone.run((function(){return t.show()})):t._ngZone.run((function(){return t.hide(0)}))}))},t.prototype.ngOnDestroy=function(){var t=this._elementRef.nativeElement;clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),t.removeEventListener("keydown",this._handleKeydown),this._passiveListeners.forEach((function(e){var i=y(e,2);t.removeEventListener(i[0],i[1],g)})),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t)},t.prototype.show=function(t){var e=this;if(void 0===t&&(t=this.showDelay),!this.disabled&&this.message&&(!this._isTooltipVisible()||this._tooltipInstance._showTimeoutId||this._tooltipInstance._hideTimeoutId)){var i=this._createOverlay();this._detach(),this._portal=this._portal||new u.ComponentPortal(E,this._viewContainerRef),this._tooltipInstance=i.attach(this._portal).instance,this._tooltipInstance.afterHidden().pipe(_.takeUntil(this._destroyed)).subscribe((function(){return e._detach()})),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),this._tooltipInstance.show(t)}},t.prototype.hide=function(t){void 0===t&&(t=this.hideDelay),this._tooltipInstance&&this._tooltipInstance.hide(t)},t.prototype.toggle=function(){this._isTooltipVisible()?this.hide():this.show()},t.prototype._isTooltipVisible=function(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()},t.prototype._createOverlay=function(){var t=this;if(this._overlayRef)return this._overlayRef;var e=this._scrollDispatcher.getAncestorScrollContainers(this._elementRef),i=this._overlay.position().flexibleConnectedTo(this._elementRef).withTransformOriginOn(".mat-tooltip").withFlexibleDimensions(!1).withViewportMargin(8).withScrollableContainers(e);return i.positionChanges.pipe(_.takeUntil(this._destroyed)).subscribe((function(e){t._tooltipInstance&&e.scrollableViewProperties.isOverlayClipped&&t._tooltipInstance.isVisible()&&t._ngZone.run((function(){return t.hide(0)}))})),this._overlayRef=this._overlay.create({direction:this._dir,positionStrategy:i,panelClass:"mat-tooltip-panel",scrollStrategy:this._scrollStrategy()}),this._updatePosition(),this._overlayRef.detachments().pipe(_.takeUntil(this._destroyed)).subscribe((function(){return t._detach()})),this._overlayRef},t.prototype._detach=function(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null},t.prototype._updatePosition=function(){var t=this._overlayRef.getConfig().positionStrategy,e=this._getOrigin(),i=this._getOverlayPosition();t.withPositions([Object.assign(Object.assign({},e.main),i.main),Object.assign(Object.assign({},e.fallback),i.fallback)])},t.prototype._getOrigin=function(){var t,e=!this._dir||"ltr"==this._dir.value,i=this.position;"above"==i||"below"==i?t={originX:"center",originY:"above"==i?"top":"bottom"}:"before"==i||"left"==i&&e||"right"==i&&!e?t={originX:"start",originY:"center"}:("after"==i||"right"==i&&e||"left"==i&&!e)&&(t={originX:"end",originY:"center"});var o=this._invertPosition(t.originX,t.originY);return{main:t,fallback:{originX:o.x,originY:o.y}}},t.prototype._getOverlayPosition=function(){var t,e=!this._dir||"ltr"==this._dir.value,i=this.position;"above"==i?t={overlayX:"center",overlayY:"bottom"}:"below"==i?t={overlayX:"center",overlayY:"top"}:"before"==i||"left"==i&&e||"right"==i&&!e?t={overlayX:"end",overlayY:"center"}:("after"==i||"right"==i&&e||"left"==i&&!e)&&(t={overlayX:"start",overlayY:"center"});var o=this._invertPosition(t.overlayX,t.overlayY);return{main:t,fallback:{overlayX:o.x,overlayY:o.y}}},t.prototype._updateTooltipMessage=function(){var t=this;this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),this._ngZone.onMicrotaskEmpty.pipe(_.take(1),_.takeUntil(this._destroyed)).subscribe((function(){t._tooltipInstance&&t._overlayRef.updatePosition()})))},t.prototype._setTooltipClass=function(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t,this._tooltipInstance._markForCheck())},t.prototype._invertPosition=function(t,e){return"above"===this.position||"below"===this.position?"top"===e?e="bottom":"bottom"===e&&(e="top"):"end"===t?t="start":"start"===t&&(t="end"),{x:t,y:e}},t.prototype._setupPointerEnterEventsIfNeeded=function(){var t=this;!this._disabled&&this.message&&this._viewInitialized&&!this._passiveListeners.length&&(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",function(){t._setupPointerExitEventsIfNeeded(),t.show()}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",function(){t._setupPointerExitEventsIfNeeded(),clearTimeout(t._touchstartTimeout),t._touchstartTimeout=setTimeout((function(){return t.show()}),500)}])),this._addListeners(this._passiveListeners))},t.prototype._setupPointerExitEventsIfNeeded=function(){var t,e=this;if(!this._pointerExitEventsInitialized){this._pointerExitEventsInitialized=!0;var i=[];if(this._platformSupportsMouseEvents())i.push(["mouseleave",function(){return e.hide()}],["wheel",function(t){return e._wheelListener(t)}]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();var o=function(){clearTimeout(e._touchstartTimeout),e.hide(e._defaultOptions.touchendHideDelay)};i.push(["touchend",o],["touchcancel",o])}this._addListeners(i),(t=this._passiveListeners).push.apply(t,function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}(i))}},t.prototype._addListeners=function(t){var e=this;t.forEach((function(t){var i=y(t,2);e._elementRef.nativeElement.addEventListener(i[0],i[1],g)}))},t.prototype._platformSupportsMouseEvents=function(){return!this._platform.IOS&&!this._platform.ANDROID},t.prototype._wheelListener=function(t){if(this._isTooltipVisible()){var e=(this._document||document).elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e===i||i.contains(e)||this.hide()}},t.prototype._disableNativeGesturesIfNecessary=function(){var t=this.touchGestures;if("off"!==t){var e=this._elementRef.nativeElement,i=e.style;("on"===t||"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName)&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),"on"!==t&&e.draggable||(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent"}},t}();O.decorators=[{type:n.Directive,args:[{selector:"[matTooltip]",exportAs:"matTooltip",host:{class:"mat-tooltip-trigger"}}]}],O.ctorParameters=function(){return[{type:e.Overlay},{type:n.ElementRef},{type:r.ScrollDispatcher},{type:n.ViewContainerRef},{type:n.NgZone},{type:h.Platform},{type:i.AriaDescriber},{type:i.FocusMonitor},{type:void 0,decorators:[{type:n.Inject,args:[v]}]},{type:a.Directionality,decorators:[{type:n.Optional}]},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[I]}]},{type:void 0,decorators:[{type:n.Inject,args:[o.DOCUMENT]}]}]},O.propDecorators={position:[{type:n.Input,args:["matTooltipPosition"]}],disabled:[{type:n.Input,args:["matTooltipDisabled"]}],showDelay:[{type:n.Input,args:["matTooltipShowDelay"]}],hideDelay:[{type:n.Input,args:["matTooltipHideDelay"]}],touchGestures:[{type:n.Input,args:["matTooltipTouchGestures"]}],message:[{type:n.Input,args:["matTooltip"]}],tooltipClass:[{type:n.Input,args:["matTooltipClass"]}]};var w,E=function(){function t(t,e){this._changeDetectorRef=t,this._breakpointObserver=e,this._visibility="initial",this._closeOnInteraction=!1,this._onHide=new d.Subject,this._isHandset=this._breakpointObserver.observe(c.Breakpoints.Handset)}return t.prototype.show=function(t){var e=this;this._hideTimeoutId&&(clearTimeout(this._hideTimeoutId),this._hideTimeoutId=null),this._closeOnInteraction=!0,this._showTimeoutId=setTimeout((function(){e._visibility="visible",e._showTimeoutId=null,e._markForCheck()}),t)},t.prototype.hide=function(t){var e=this;this._showTimeoutId&&(clearTimeout(this._showTimeoutId),this._showTimeoutId=null),this._hideTimeoutId=setTimeout((function(){e._visibility="hidden",e._hideTimeoutId=null,e._markForCheck()}),t)},t.prototype.afterHidden=function(){return this._onHide},t.prototype.isVisible=function(){return"visible"===this._visibility},t.prototype.ngOnDestroy=function(){this._onHide.complete()},t.prototype._animationStart=function(){this._closeOnInteraction=!1},t.prototype._animationDone=function(t){var e=t.toState;"hidden"!==e||this.isVisible()||this._onHide.next(),"visible"!==e&&"hidden"!==e||(this._closeOnInteraction=!0)},t.prototype._handleBodyInteraction=function(){this._closeOnInteraction&&this.hide(0)},t.prototype._markForCheck=function(){this._changeDetectorRef.markForCheck()},t}();E.decorators=[{type:n.Component,args:[{selector:"mat-tooltip-component",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',encapsulation:n.ViewEncapsulation.None,changeDetection:n.ChangeDetectionStrategy.OnPush,animations:[m.tooltipState],host:{"[style.zoom]":'_visibility === "visible" ? 1 : null',"(body:click)":"this._handleBodyInteraction()","(body:auxclick)":"this._handleBodyInteraction()","aria-hidden":"true"},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"]}]}],E.ctorParameters=function(){return[{type:n.ChangeDetectorRef},{type:c.BreakpointObserver}]},(w=function w(){}).decorators=[{type:n.NgModule,args:[{imports:[i.A11yModule,o.CommonModule,e.OverlayModule,s.MatCommonModule],exports:[O,E,s.MatCommonModule,r.CdkScrollableModule],declarations:[O,E],entryComponents:[E],providers:[T]}]}], |