Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@progress/kendo-angular-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
834
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progress/kendo-angular-tooltip - npm Package Compare versions

Comparing version 0.4.0-dev.201806131424 to 0.4.0

2

dist/systemjs/kendo-angular-tooltip.js

@@ -1,1 +0,1 @@

System.register("@progress/kendo-angular-tooltip",["tslib","@angular/core","rxjs/operators/take","rxjs/operators/debounceTime","rxjs/observable/fromEvent","rxjs/operators/filter","@progress/kendo-angular-popup","@progress/kendo-angular-l10n","@angular/common"],function(s){var o,i,n,r,p,a,l,u,c;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){o=e(t)},function(t){i=e(t)},function(t){n=e(t)},function(t){r=e(t)},function(t){p=e(t)},function(t){a=e(t)},function(t){l=e(t)},function(t){u=e(t)},function(t){c=e(t)}],execute:function(){!function(o){var i={};function n(t){if(i[t])return i[t].exports;var e=i[t]={exports:{},id:t,loaded:!1};return o[t].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}n.m=o,n.c=i,n.p="",n(0)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(1);e.TooltipDirective=i.TooltipDirective;var n=o(13);e.TooltipModule=n.TooltipModule;var r=o(9);e.TooltipSettings=r.TooltipSettings,e.TOOLTIP_SETTINGS=r.TOOLTIP_SETTINGS,function(t){for(var e in t)s(e,t[e])}(e)},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3),r=o(4),p=o(5),s=o(6),a=o(7),l=o(8),u=o(9),c=o(10),h=o(11),d=o(12),f=function(){function t(t,e,o,i,n){var r=this;this.tooltipWrapper=t,this.ngZone=e,this.popupService=o,this.localizationService=i,this.filter="[title]",this.position="top",this.showOn="hover",this.showAfter=100,this.callout=!0,this.closable=!1,this.offset=6,this.anchor=null,this.validPositions=["top","bottom","right","left"],this.validShowOptions=["hover","click","none"],this.direction=i.rtl?"rtl":"ltr",n&&(this.position=n.position,this.callout=n.callout,this.showOn=n.showOn),this.ngZone.runOutsideAngular(function(){var t=r.tooltipWrapper.nativeElement;r.anchorTitleSubscription=p.fromEvent(t,"mouseover").pipe(a.filter(function(){return""!==r.filter})).subscribe(function(t){var e=h.closest(t.target,r.filter);e&&r.hideElementTitle(e)}),r.mouseOverSubscription=p.fromEvent(t,"mouseover").pipe(s.debounceTime(100),a.filter(function(){return""!==r.filter})).subscribe(function(t){return r.onMouseOver(t)}),r.mouseOutSubscription=p.fromEvent(t,"mouseout").pipe(s.debounceTime(100)).subscribe(function(t){return r.onMouseOut(t)})})}return Object.defineProperty(t.prototype,"tooltipTemplate",{get:function(){return this.template},set:function(t){this.template=t},enumerable:!0,configurable:!0}),t.prototype.show=function(t){var e=this,o={nativeElement:t};if(this.anchor=t,"hover"===this.showOn){if(this.popupRef)return;clearTimeout(this.showTimeout),this.showTimeout=window.setTimeout(function(){return e.showContent(o)},this.showAfter)}else this.hideElementTitle(this.anchor),this.showContent(o)},t.prototype.hide=function(){clearTimeout(this.showTimeout),this.anchor&&this.anchor.getAttribute("data-title")&&(this.anchor.setAttribute("title",this.anchor.getAttribute("data-title")),this.anchor.setAttribute("data-title","")),this.popupMouseOutSubscription&&this.popupMouseOutSubscription.unsubscribe(),this.closeClickSubscription&&this.closeClickSubscription.unsubscribe(),this.closePopup()},t.prototype.toggle=function(t,e){this.anchor!==t&&this.hide(),this.anchor===t&&"click"===this.showOn&&this.hide(),void 0===e&&(e=!this.popupRef),e?this.show(t):this.hide()},t.prototype.ngOnInit=function(){var o=this;this.verifyProperties(),this.dynamicRTLSubscription=this.localizationService.changes.subscribe(function(t){var e=t.rtl;return o.direction=e?"rtl":"ltr"})},t.prototype.ngOnChanges=function(t){t.showOn&&this.subscribeClick()},t.prototype.ngOnDestroy=function(){this.hide(),this.template=null,this.anchorTitleSubscription.unsubscribe(),this.mouseOverSubscription.unsubscribe(),this.mouseOutSubscription.unsubscribe(),this.mouseClickSubscription&&this.mouseClickSubscription.unsubscribe(),this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe(),this.popupPositionChangeSubscription&&this.popupPositionChangeSubscription.unsubscribe(),this.popupMouseOutSubscription&&this.popupMouseOutSubscription.unsubscribe()},t.prototype.showContent=function(t){var e,o=this;(t.nativeElement.getAttribute("data-title")||this.template)&&(this.ngZone.run(function(){o.openPopup(t),e=o.popupRef.content,o.bindContent(e,t)}),this.popupRef.popupAnchorViewportLeave.pipe(r.take(1)).subscribe(function(){return o.hide()}))},t.prototype.bindContent=function(t,e){var o=this,i=t.instance;this.closeClickSubscription=i.close.subscribe(function(){o.hide()}),this.template?i.templateRef=this.template:i.templateString=this.anchor.getAttribute("data-title"),this.titleTemplate&&(i.titleTemplate=this.titleTemplate),i.anchor=e,i.callout=this.callout,i.closable=this.closable,i.position=this.position,i.tooltipWidth=this.tooltipWidth,i.tooltipHeight=this.tooltipHeight},t.prototype.hideElementTitle=function(t){t.getAttribute("title")&&(t.setAttribute("data-title",t.getAttribute("title")),t.setAttribute("title",""))},t.prototype.openPopup=function(t){var i=this,e=h.align(this.position,this.offset),o=e.anchorAlign,n=e.popupAlign,r=e.popupMargin;this.popupRef=this.popupService.open({anchor:t,anchorAlign:o,animate:!1,content:c.TooltipContentComponent,collision:h.collision(this.collision,this.position),margin:r,popupAlign:n,popupClass:"k-popup-transparent"});var s=this.popupRef.content.instance;s.callout&&(this.popupPositionChangeSubscription=this.popupRef.popupPositionChange.subscribe(function(t){var e=t.flip,o=!0===e.horizontal||!0===e.vertical;s.updateCalloutPosition(i.position,o)})),"hover"===this.showOn&&this.ngZone.runOutsideAngular(function(){var t=i.popupRef.popupElement;i.popupMouseOutSubscription=p.fromEvent(t,"mouseout").subscribe(function(t){return i.onMouseOut(t)})})},t.prototype.closePopup=function(){var t=this;this.popupRef&&(this.ngZone.run(function(){return t.popupRef.close()}),this.popupRef=null,this.popupPositionChangeSubscription.unsubscribe())},t.prototype.subscribeClick=function(){var e=this;this.mouseClickSubscription&&this.mouseClickSubscription.unsubscribe(),"click"===this.showOn&&(this.mouseClickSubscription=p.fromEvent(document,"click").pipe(a.filter(function(){return""!==e.filter})).subscribe(function(t){return e.onMouseClick(t,e.tooltipWrapper.nativeElement)}))},t.prototype.onMouseClick=function(t,e){var o=t.target,i=h.closest(o,this.filter),n=this.popupRef&&this.popupRef.popupElement;if(n){if(n.contains(o))return;if(this.closable)return}e.contains(o)&&i?this.toggle(i,!0):n&&this.hide()},t.prototype.onMouseOver=function(t){var e=h.closest(t.target,this.filter);"hover"===this.showOn&&e&&this.toggle(e,!0)},t.prototype.onMouseOut=function(t){if("hover"===this.showOn&&!this.closable){var e=this.popupRef&&this.popupRef.popupElement,o=t.relatedTarget;o&&h.contains(this.anchor,o)||o&&h.contains(e,o)||this.hide()}},t.prototype.verifyProperties=function(){if(n.isDevMode()){if(!h.containsItem(this.validPositions,this.position))throw new Error("Invalid value provided for position property.The available options are 'top', 'bottom', 'left', or 'right'.");if(!h.containsItem(this.validShowOptions,this.showOn))throw new Error("Invalid value provided for showOn property.The available options are 'hover' or 'none'.")}},i.__decorate([n.HostBinding("attr.dir"),i.__metadata("design:type",String)],t.prototype,"direction",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"filter",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"position",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef)],t.prototype,"titleTemplate",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"showOn",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"showAfter",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Boolean)],t.prototype,"callout",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Boolean)],t.prototype,"closable",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"offset",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipWidth",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipHeight",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Object)],t.prototype,"collision",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef),i.__metadata("design:paramtypes",[n.TemplateRef])],t.prototype,"tooltipTemplate",null),t=i.__decorate([n.Directive({selector:"[kendoTooltip]",exportAs:"kendoTooltip",providers:[d.LocalizationService,{provide:d.L10N_PREFIX,useValue:"kendo.tooltip"}]}),i.__param(4,n.Optional()),i.__param(4,n.Inject(u.TOOLTIP_SETTINGS)),i.__metadata("design:paramtypes",[n.ElementRef,n.NgZone,l.PopupService,d.LocalizationService,u.TooltipSettings])],t)}();e.TooltipDirective=f},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e){t.exports=n},function(t,e){t.exports=p},function(t,e){t.exports=r},function(t,e){t.exports=a},function(t,e){t.exports=l},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3);e.TOOLTIP_SETTINGS=new n.InjectionToken("kendo-ui-tooltip-settings");var r=function(){function t(){this.callout=!0,this.position="top",this.showOn="hover"}return t=i.__decorate([n.Injectable()],t)}();e.TooltipSettings=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3),h=o(11),r=function(){function t(t){this.content=t,this.close=new n.EventEmitter,this.tooltipWidth=null,this.tooltipHeight=null,this.callout=!0,this.calloutStyles=function(t,e,o){var i={},n="top"===t||"bottom"===t;return o?("top"===t?i.bottom="unset":"bottom"===t?i.top="unset":"left"===t?i.right="unset":"right"===t&&(i.left="unset"),i[t]=-e+"px",i.transform=n?"rotateX(180deg)":"rotateY(180deg)"):i.transform=n?"rotateX(0deg)":"rotateY(0deg)",i}}return Object.defineProperty(t.prototype,"cssClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this.closable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cssPosition",{get:function(){return"relative"},enumerable:!0,configurable:!0}),t.prototype.calloutPositionClass=function(){return{top:"k-callout-s",left:"k-callout-e",bottom:"k-callout-n",right:"k-callout-w"}[this.position]},t.prototype.onCloseClick=function(t){t.preventDefault(),this.close.emit()},t.prototype.updateCalloutPosition=function(t,e){var o="top"===t||"bottom"===t,i=o?"width":"height",n=o?"left":"top",r=o?"marginLeft":"marginTop",s=this.content.nativeElement.lastElementChild,p=s.getBoundingClientRect()[i],a=h.getCenterOffset(this.anchor,n,i),l=h.getCenterOffset(this.content,n,i);if(1<Math.abs(l-a)){var u=l-a+p/2;s.style[r]=-u+"px"}var c=this.calloutStyles(t,p,e);Object.keys(c).forEach(function(t){s.style[t]=c[t]})},i.__decorate([n.Output(),i.__metadata("design:type",n.EventEmitter)],t.prototype,"close",void 0),i.__decorate([n.HostBinding("class.k-tooltip"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],t.prototype,"cssClass",null),i.__decorate([n.HostBinding("class.k-tooltip-closable"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],t.prototype,"className",null),i.__decorate([n.HostBinding("style.position"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],t.prototype,"cssPosition",null),i.__decorate([n.HostBinding("style.width.px"),n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipWidth",void 0),i.__decorate([n.HostBinding("style.height.px"),n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipHeight",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef)],t.prototype,"titleTemplate",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.ElementRef)],t.prototype,"anchor",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Boolean)],t.prototype,"closable",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef)],t.prototype,"templateRef",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"templateString",void 0),t=i.__decorate([n.Component({template:'\n <div class="k-tooltip-title" *ngIf="titleTemplate">\n <ng-template\n [ngIf]="titleTemplate"\n [ngTemplateOutlet]="titleTemplate"\n [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">\n </ng-template>\n </div>\n <div *ngIf="closable" class="k-tooltip-button" (click)="onCloseClick($event)">\n <a href="#" class="k-icon k-i-close" title="Close"></a>\n </div>\n\n <div class="k-tooltip-content">\n <ng-template\n [ngIf]="templateRef"\n [ngTemplateOutlet]="templateRef"\n [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">\n </ng-template>\n <ng-template\n [ngIf]="templateString">\n {{ templateString }}\n </ng-template>\n </div>\n <div class="k-callout" *ngIf="callout" [ngClass]="calloutPositionClass()"></div>\n '}),i.__metadata("design:paramtypes",[n.ElementRef])],t)}();e.TooltipContentComponent=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.align=function(t,e){var o={},i={},n={};switch(t){case"top":o={horizontal:"center",vertical:"top"},i={horizontal:"center",vertical:"bottom"},n={horizontal:0,vertical:e};break;case"bottom":o={horizontal:"center",vertical:"bottom"},i={horizontal:"center",vertical:"top"},n={horizontal:0,vertical:e};break;case"right":o={horizontal:"right",vertical:"center"},i={horizontal:"left",vertical:"center"},n={horizontal:e,vertical:0};break;case"left":o={horizontal:"left",vertical:"center"},i={horizontal:"right",vertical:"center"},n={horizontal:e,vertical:0}}return{anchorAlign:o,popupAlign:i,popupMargin:n}},e.collision=function(t,e){return t||("top"===e||"bottom"===e?{horizontal:"fit",vertical:"flip"}:{horizontal:"flip",vertical:"fit"})},e.closest=function(t,e){if(t.closest)return t.closest(e);for(var o=Element.prototype.matches?function(t,e){return t.matches(e)}:function(t,e){return t.msMatchesSelector(e)},i=t;i;){if(o(i,e))return i;i=i.parentElement}},e.contains=function(t,e){return t&&t.contains(e)},e.getCenterOffset=function(t,e,o){var i=t.nativeElement.getBoundingClientRect();return i[e]+i[o]/2},e.containsItem=function(t,e){return-1!==t.indexOf(e)}},function(t,e){t.exports=u},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3),r=o(14),s=o(1),p=o(8),a=o(10),l=[s.TooltipDirective,a.TooltipContentComponent],u=[p.PopupModule],c=function(){function t(){}return t=i.__decorate([n.NgModule({declarations:[l],entryComponents:[a.TooltipContentComponent],imports:[r.CommonModule].concat(u),exports:[l]})],t)}();e.TooltipModule=c},function(t,e){t.exports=c}])}}});
System.register("@progress/kendo-angular-tooltip",["tslib","@angular/common","@angular/core","@progress/kendo-angular-popup","rxjs/operators/take","rxjs/observable/fromEvent","rxjs/operators/filter","rxjs/operators/debounceTime","@progress/kendo-angular-l10n"],function(s){var o,i,n,r,p,a,l,u,c;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){o=e(t)},function(t){i=e(t)},function(t){n=e(t)},function(t){r=e(t)},function(t){p=e(t)},function(t){a=e(t)},function(t){l=e(t)},function(t){u=e(t)},function(t){c=e(t)}],execute:function(){!function(o){var i={};function n(t){if(i[t])return i[t].exports;var e=i[t]={exports:{},id:t,loaded:!1};return o[t].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}n.m=o,n.c=i,n.p="",n(0)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(1);e.TooltipDirective=i.TooltipDirective;var n=o(13);e.TooltipModule=n.TooltipModule;var r=o(9);e.TooltipSettings=r.TooltipSettings,e.TOOLTIP_SETTINGS=r.TOOLTIP_SETTINGS,function(t){for(var e in t)s(e,t[e])}(e)},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3),r=o(4),p=o(5),s=o(6),a=o(7),l=o(8),u=o(9),c=o(10),h=o(11),d=o(12),f=function(){function t(t,e,o,i,n){var r=this;this.tooltipWrapper=t,this.ngZone=e,this.popupService=o,this.localizationService=i,this.filter="[title]",this.position="top",this.showOn="hover",this.showAfter=100,this.callout=!0,this.closable=!1,this.offset=6,this.anchor=null,this.validPositions=["top","bottom","right","left"],this.validShowOptions=["hover","click","none"],this.direction=i.rtl?"rtl":"ltr",n&&(this.position=n.position,this.callout=n.callout,this.showOn=n.showOn),this.ngZone.runOutsideAngular(function(){var t=r.tooltipWrapper.nativeElement;r.anchorTitleSubscription=p.fromEvent(t,"mouseover").pipe(a.filter(function(){return""!==r.filter})).subscribe(function(t){var e=h.closest(t.target,r.filter);e&&r.hideElementTitle(e)}),r.mouseOverSubscription=p.fromEvent(t,"mouseover").pipe(s.debounceTime(100),a.filter(function(){return""!==r.filter})).subscribe(function(t){return r.onMouseOver(t)}),r.mouseOutSubscription=p.fromEvent(t,"mouseout").pipe(s.debounceTime(100)).subscribe(function(t){return r.onMouseOut(t)})})}return Object.defineProperty(t.prototype,"tooltipTemplate",{get:function(){return this.template},set:function(t){this.template=t},enumerable:!0,configurable:!0}),t.prototype.show=function(t){var e=this,o={nativeElement:t};if(this.anchor=t,"hover"===this.showOn){if(this.popupRef)return;clearTimeout(this.showTimeout),this.showTimeout=window.setTimeout(function(){return e.showContent(o)},this.showAfter)}else this.hideElementTitle(this.anchor),this.showContent(o)},t.prototype.hide=function(){clearTimeout(this.showTimeout),this.anchor&&this.anchor.getAttribute("data-title")&&(this.anchor.setAttribute("title",this.anchor.getAttribute("data-title")),this.anchor.setAttribute("data-title","")),this.popupMouseOutSubscription&&this.popupMouseOutSubscription.unsubscribe(),this.closeClickSubscription&&this.closeClickSubscription.unsubscribe(),this.closePopup()},t.prototype.toggle=function(t,e){this.anchor!==t&&this.hide(),this.anchor===t&&"click"===this.showOn&&this.hide(),void 0===e&&(e=!this.popupRef),e?this.show(t):this.hide()},t.prototype.ngOnInit=function(){var o=this;this.verifyProperties(),this.dynamicRTLSubscription=this.localizationService.changes.subscribe(function(t){var e=t.rtl;return o.direction=e?"rtl":"ltr"})},t.prototype.ngOnChanges=function(t){t.showOn&&this.subscribeClick()},t.prototype.ngOnDestroy=function(){this.hide(),this.template=null,this.anchorTitleSubscription.unsubscribe(),this.mouseOverSubscription.unsubscribe(),this.mouseOutSubscription.unsubscribe(),this.mouseClickSubscription&&this.mouseClickSubscription.unsubscribe(),this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe(),this.popupPositionChangeSubscription&&this.popupPositionChangeSubscription.unsubscribe(),this.popupMouseOutSubscription&&this.popupMouseOutSubscription.unsubscribe()},t.prototype.showContent=function(t){var e,o=this;(t.nativeElement.getAttribute("data-title")||this.template)&&(this.ngZone.run(function(){o.openPopup(t),e=o.popupRef.content,o.bindContent(e,t)}),this.popupRef.popupAnchorViewportLeave.pipe(r.take(1)).subscribe(function(){return o.hide()}))},t.prototype.bindContent=function(t,e){var o=this,i=t.instance;this.closeClickSubscription=i.close.subscribe(function(){o.hide()}),this.template?i.templateRef=this.template:i.templateString=this.anchor.getAttribute("data-title"),this.titleTemplate&&(i.titleTemplate=this.titleTemplate),i.anchor=e,i.callout=this.callout,i.closable=this.closable,i.position=this.position,i.tooltipWidth=this.tooltipWidth,i.tooltipHeight=this.tooltipHeight},t.prototype.hideElementTitle=function(t){t.getAttribute("title")&&(t.setAttribute("data-title",t.getAttribute("title")),t.setAttribute("title",""))},t.prototype.openPopup=function(t){var i=this,e=h.align(this.position,this.offset),o=e.anchorAlign,n=e.popupAlign,r=e.popupMargin;this.popupRef=this.popupService.open({anchor:t,anchorAlign:o,animate:!1,content:c.TooltipContentComponent,collision:h.collision(this.collision,this.position),margin:r,popupAlign:n,popupClass:"k-popup-transparent"});var s=this.popupRef.content.instance;s.callout&&(this.popupPositionChangeSubscription=this.popupRef.popupPositionChange.subscribe(function(t){var e=t.flip,o=!0===e.horizontal||!0===e.vertical;s.updateCalloutPosition(i.position,o)})),"hover"===this.showOn&&this.ngZone.runOutsideAngular(function(){var t=i.popupRef.popupElement;i.popupMouseOutSubscription=p.fromEvent(t,"mouseout").subscribe(function(t){return i.onMouseOut(t)})})},t.prototype.closePopup=function(){var t=this;this.popupRef&&(this.ngZone.run(function(){return t.popupRef.close()}),this.popupRef=null,this.popupPositionChangeSubscription.unsubscribe())},t.prototype.subscribeClick=function(){var e=this;this.mouseClickSubscription&&this.mouseClickSubscription.unsubscribe(),"click"===this.showOn&&(this.mouseClickSubscription=p.fromEvent(document,"click").pipe(a.filter(function(){return""!==e.filter})).subscribe(function(t){return e.onMouseClick(t,e.tooltipWrapper.nativeElement)}))},t.prototype.onMouseClick=function(t,e){var o=t.target,i=h.closest(o,this.filter),n=this.popupRef&&this.popupRef.popupElement;if(n){if(n.contains(o))return;if(this.closable)return}e.contains(o)&&i?this.toggle(i,!0):n&&this.hide()},t.prototype.onMouseOver=function(t){var e=h.closest(t.target,this.filter);"hover"===this.showOn&&e&&this.toggle(e,!0)},t.prototype.onMouseOut=function(t){if("hover"===this.showOn&&!this.closable){var e=this.popupRef&&this.popupRef.popupElement,o=t.relatedTarget;o&&h.contains(this.anchor,o)||o&&h.contains(e,o)||this.hide()}},t.prototype.verifyProperties=function(){if(n.isDevMode()){if(!h.containsItem(this.validPositions,this.position))throw new Error("Invalid value provided for position property.The available options are 'top', 'bottom', 'left', or 'right'.");if(!h.containsItem(this.validShowOptions,this.showOn))throw new Error("Invalid value provided for showOn property.The available options are 'hover' or 'none'.")}},i.__decorate([n.HostBinding("attr.dir"),i.__metadata("design:type",String)],t.prototype,"direction",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"filter",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"position",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef)],t.prototype,"titleTemplate",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"showOn",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"showAfter",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Boolean)],t.prototype,"callout",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Boolean)],t.prototype,"closable",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"offset",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipWidth",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipHeight",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Object)],t.prototype,"collision",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef),i.__metadata("design:paramtypes",[n.TemplateRef])],t.prototype,"tooltipTemplate",null),t=i.__decorate([n.Directive({selector:"[kendoTooltip]",exportAs:"kendoTooltip",providers:[d.LocalizationService,{provide:d.L10N_PREFIX,useValue:"kendo.tooltip"}]}),i.__param(4,n.Optional()),i.__param(4,n.Inject(u.TOOLTIP_SETTINGS)),i.__metadata("design:paramtypes",[n.ElementRef,n.NgZone,l.PopupService,d.LocalizationService,u.TooltipSettings])],t)}();e.TooltipDirective=f},function(t,e){t.exports=o},function(t,e){t.exports=n},function(t,e){t.exports=p},function(t,e){t.exports=a},function(t,e){t.exports=u},function(t,e){t.exports=l},function(t,e){t.exports=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3);e.TOOLTIP_SETTINGS=new n.InjectionToken("kendo-ui-tooltip-settings");var r=function(){function t(){this.callout=!0,this.position="top",this.showOn="hover"}return t=i.__decorate([n.Injectable()],t)}();e.TooltipSettings=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3),h=o(11),r=function(){function t(t){this.content=t,this.close=new n.EventEmitter,this.tooltipWidth=null,this.tooltipHeight=null,this.callout=!0,this.calloutStyles=function(t,e,o){var i={},n="top"===t||"bottom"===t;return o?("top"===t?i.bottom="unset":"bottom"===t?i.top="unset":"left"===t?i.right="unset":"right"===t&&(i.left="unset"),i[t]=-e+"px",i.transform=n?"rotateX(180deg)":"rotateY(180deg)"):i.transform=n?"rotateX(0deg)":"rotateY(0deg)",i}}return Object.defineProperty(t.prototype,"cssClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return this.closable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cssPosition",{get:function(){return"relative"},enumerable:!0,configurable:!0}),t.prototype.calloutPositionClass=function(){return{top:"k-callout-s",left:"k-callout-e",bottom:"k-callout-n",right:"k-callout-w"}[this.position]},t.prototype.onCloseClick=function(t){t.preventDefault(),this.close.emit()},t.prototype.updateCalloutPosition=function(t,e){var o="top"===t||"bottom"===t,i=o?"width":"height",n=o?"left":"top",r=o?"marginLeft":"marginTop",s=this.content.nativeElement.lastElementChild,p=s.getBoundingClientRect()[i],a=h.getCenterOffset(this.anchor,n,i),l=h.getCenterOffset(this.content,n,i);if(1<Math.abs(l-a)){var u=l-a+p/2;s.style[r]=-u+"px"}var c=this.calloutStyles(t,p,e);Object.keys(c).forEach(function(t){s.style[t]=c[t]})},i.__decorate([n.Output(),i.__metadata("design:type",n.EventEmitter)],t.prototype,"close",void 0),i.__decorate([n.HostBinding("class.k-tooltip"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],t.prototype,"cssClass",null),i.__decorate([n.HostBinding("class.k-tooltip-closable"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],t.prototype,"className",null),i.__decorate([n.HostBinding("style.position"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],t.prototype,"cssPosition",null),i.__decorate([n.HostBinding("style.width.px"),n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipWidth",void 0),i.__decorate([n.HostBinding("style.height.px"),n.Input(),i.__metadata("design:type",Number)],t.prototype,"tooltipHeight",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef)],t.prototype,"titleTemplate",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.ElementRef)],t.prototype,"anchor",void 0),i.__decorate([n.Input(),i.__metadata("design:type",Boolean)],t.prototype,"closable",void 0),i.__decorate([n.Input(),i.__metadata("design:type",n.TemplateRef)],t.prototype,"templateRef",void 0),i.__decorate([n.Input(),i.__metadata("design:type",String)],t.prototype,"templateString",void 0),t=i.__decorate([n.Component({template:'\n <div class="k-tooltip-title" *ngIf="titleTemplate">\n <ng-template\n [ngIf]="titleTemplate"\n [ngTemplateOutlet]="titleTemplate"\n [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">\n </ng-template>\n </div>\n <div *ngIf="closable" class="k-tooltip-button" (click)="onCloseClick($event)">\n <a href="#" class="k-icon k-i-close" title="Close"></a>\n </div>\n\n <div class="k-tooltip-content">\n <ng-template\n [ngIf]="templateRef"\n [ngTemplateOutlet]="templateRef"\n [ngTemplateOutletContext]="{ $implicit: anchor, anchor: anchor }">\n </ng-template>\n <ng-template\n [ngIf]="templateString">\n {{ templateString }}\n </ng-template>\n </div>\n <div class="k-callout" *ngIf="callout" [ngClass]="calloutPositionClass()"></div>\n '}),i.__metadata("design:paramtypes",[n.ElementRef])],t)}();e.TooltipContentComponent=r},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.align=function(t,e){var o={},i={},n={};switch(t){case"top":o={horizontal:"center",vertical:"top"},i={horizontal:"center",vertical:"bottom"},n={horizontal:0,vertical:e};break;case"bottom":o={horizontal:"center",vertical:"bottom"},i={horizontal:"center",vertical:"top"},n={horizontal:0,vertical:e};break;case"right":o={horizontal:"right",vertical:"center"},i={horizontal:"left",vertical:"center"},n={horizontal:e,vertical:0};break;case"left":o={horizontal:"left",vertical:"center"},i={horizontal:"right",vertical:"center"},n={horizontal:e,vertical:0}}return{anchorAlign:o,popupAlign:i,popupMargin:n}},e.collision=function(t,e){return t||("top"===e||"bottom"===e?{horizontal:"fit",vertical:"flip"}:{horizontal:"flip",vertical:"fit"})},e.closest=function(t,e){if(t.closest)return t.closest(e);for(var o=Element.prototype.matches?function(t,e){return t.matches(e)}:function(t,e){return t.msMatchesSelector(e)},i=t;i;){if(o(i,e))return i;i=i.parentElement}},e.contains=function(t,e){return t&&t.contains(e)},e.getCenterOffset=function(t,e,o){var i=t.nativeElement.getBoundingClientRect();return i[e]+i[o]/2},e.containsItem=function(t,e){return-1!==t.indexOf(e)}},function(t,e){t.exports=c},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=o(2),n=o(3),r=o(14),s=o(1),p=o(8),a=o(10),l=[s.TooltipDirective,a.TooltipContentComponent],u=[p.PopupModule],c=function(){function t(){}return t=i.__decorate([n.NgModule({declarations:[l],entryComponents:[a.TooltipContentComponent],imports:[r.CommonModule].concat(u),exports:[l]})],t)}();e.TooltipModule=c},function(t,e){t.exports=i}])}}});

@@ -6,3 +6,3 @@ {

"license": "SEE LICENSE IN LICENSE.md",
"version": "0.4.0-dev.201806131424",
"version": "0.4.0",
"main": "dist/npm/index.js",

@@ -9,0 +9,0 @@ "module": "dist/es/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc