angular-walkthrough
Advanced tools
Comparing version 0.6.14 to 0.6.15
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],e):e(t.angularWalkthrough={},t.ng.core,t.ng.common)}(this,function(t,a,e){"use strict";var n=function(t){return"true"===t||!0===t},h=function(t,e){this.component=t,this.focusElement=e},l=function(){function n(t,e,o,n){void 0===t&&(t=0),this.top=t,this.right=e,this.bottom=o,this.left=n,void 0===e&&(this.right=t),void 0===o&&(this.bottom=t),void 0===n&&void 0===e?this.left=t:void 0===n&&(this.left=e)}return n.parsePoints=function(t){var e;if(t.match(/^\d+(?:\s+\d+)*$/)){var o=t.split(/\s+/).map(function(t){return parseFloat(t)});e=new n(o[0],o[1],o[2],o[3])}return e||new n},n}(),i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])};function s(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function o(){throw Error("Host already has a portal attached")}var r,c=function(){function t(){}return t.prototype.attach=function(t){return null==t&&function(){throw Error("Attempting to attach a portal to a null PortalOutlet")}(),t.hasAttached()&&o(),(this._attachedHost=t).attach(this)},t.prototype.detach=function(){var t=this._attachedHost;null==t?function(){throw Error("Attempting to detach a portal that is not attached to a host")}():(this._attachedHost=null,t.detach())},Object.defineProperty(t.prototype,"isAttached",{get:function(){return null!=this._attachedHost},enumerable:!0,configurable:!0}),t.prototype.setAttachedHost=function(t){this._attachedHost=t},t}(),p=function(i){function t(t,e,o){var n=i.call(this)||this;return n.component=t,n.viewContainerRef=e,n.injector=o,n}return s(t,i),t}(c),u=function(i){function t(t,e,o){var n=i.call(this)||this;return n.templateRef=t,n.viewContainerRef=e,n.context=o,n}return s(t,i),Object.defineProperty(t.prototype,"origin",{get:function(){return this.templateRef.elementRef},enumerable:!0,configurable:!0}),t.prototype.attach=function(t,e){return void 0===e&&(e=this.context),this.context=e,i.prototype.attach.call(this,t)},t.prototype.detach=function(){return this.context=void 0,i.prototype.detach.call(this)},t}(c),f=function(){function t(){this._isDisposed=!1}return t.prototype.hasAttached=function(){return!!this._attachedPortal},t.prototype.attach=function(t){return t||function(){throw Error("Must provide a portal to attach")}(),this.hasAttached()&&o(),this._isDisposed&&function(){throw Error("This PortalOutlet has already been disposed")}(),t instanceof p?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof u?(this._attachedPortal=t,this.attachTemplatePortal(t)):void function(){throw Error("Attempting to attach an unknown Portal type. BasePortalOutlet accepts either a ComponentPortal or a TemplatePortal.")}()},t.prototype.detach=function(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()},t.prototype.dispose=function(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0},t.prototype.setDisposeFn=function(t){this._disposeFn=t},t.prototype._invokeDisposeFn=function(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)},t}(),d=(function(r){function t(t,e,o,n){var i=r.call(this)||this;return i.outletElement=t,i._componentFactoryResolver=e,i._appRef=o,i._defaultInjector=n,i}s(t,r),t.prototype.attachComponentPortal=function(t){var e,o=this,n=this._componentFactoryResolver.resolveComponentFactory(t.component);return t.viewContainerRef?(e=t.viewContainerRef.createComponent(n,t.viewContainerRef.length,t.injector||t.viewContainerRef.parentInjector),this.setDisposeFn(function(){return e.destroy()})):(e=n.create(t.injector||this._defaultInjector),this._appRef.attachView(e.hostView),this.setDisposeFn(function(){o._appRef.detachView(e.hostView),e.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(e)),e},t.prototype.attachTemplatePortal=function(t){var e=this,o=t.viewContainerRef,n=o.createEmbeddedView(t.templateRef,t.context);return n.detectChanges(),n.rootNodes.forEach(function(t){return e.outletElement.appendChild(t)}),this.setDisposeFn(function(){var t=o.indexOf(n);-1!==t&&o.remove(t)}),n},t.prototype.dispose=function(){r.prototype.dispose.call(this),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)},t.prototype._getComponentRootNode=function(t){return t.hostView.rootNodes[0]}}(f),function(o){function t(t,e){return o.call(this,t,e)||this}return s(t,o),t.decorators=[{type:a.Directive,args:[{selector:"[cdk-portal], [cdkPortal], [portal]",exportAs:"cdkPortal"}]}],t.ctorParameters=function(){return[{type:a.TemplateRef},{type:a.ViewContainerRef}]},t}(u)),g=function(i){function t(t,e){var o=i.call(this)||this;return o._componentFactoryResolver=t,o._viewContainerRef=e,o._isInitialized=!1,o.attached=new a.EventEmitter,o}return s(t,i),Object.defineProperty(t.prototype,"_deprecatedPortal",{get:function(){return this.portal},set:function(t){this.portal=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_deprecatedPortalHost",{get:function(){return this.portal},set:function(t){this.portal=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"portal",{get:function(){return this._attachedPortal},set:function(t){(!this.hasAttached()||t||this._isInitialized)&&(this.hasAttached()&&i.prototype.detach.call(this),t&&i.prototype.attach.call(this,t),this._attachedPortal=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"attachedRef",{get:function(){return this._attachedRef},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this._isInitialized=!0},t.prototype.ngOnDestroy=function(){i.prototype.dispose.call(this),this._attachedPortal=null,this._attachedRef=null},t.prototype.attachComponentPortal=function(t){t.setAttachedHost(this);var e=null!=t.viewContainerRef?t.viewContainerRef:this._viewContainerRef,o=this._componentFactoryResolver.resolveComponentFactory(t.component),n=e.createComponent(o,e.length,t.injector||e.parentInjector);return i.prototype.setDisposeFn.call(this,function(){return n.destroy()}),this._attachedPortal=t,this._attachedRef=n,this.attached.emit(n),n},t.prototype.attachTemplatePortal=function(t){var e=this;t.setAttachedHost(this);var o=this._viewContainerRef.createEmbeddedView(t.templateRef,t.context);return i.prototype.setDisposeFn.call(this,function(){return e._viewContainerRef.clear()}),this._attachedPortal=t,this._attachedRef=o,this.attached.emit(o),o},t.decorators=[{type:a.Directive,args:[{selector:"[cdkPortalOutlet], [cdkPortalHost], [portalHost]",exportAs:"cdkPortalOutlet, cdkPortalHost",inputs:["portal: cdkPortalOutlet"]}]}],t.ctorParameters=function(){return[{type:a.ComponentFactoryResolver},{type:a.ViewContainerRef}]},t.propDecorators={_deprecatedPortal:[{type:a.Input,args:["portalHost"]}],_deprecatedPortalHost:[{type:a.Input,args:["cdkPortalHost"]}],attached:[{type:a.Output,args:["attached"]}]},t}(f),m=function(){function t(){}return t.decorators=[{type:a.NgModule,args:[{exports:[d,g],declarations:[d,g]}]}],t.ctorParameters=function(){return[]},t}(),w=function(){function t(t,e){this._parentInjector=t,this._customTokens=e}return t.prototype.get=function(t,e){var o=this._customTokens.get(t);return void 0!==o?o:this._parentInjector.get(t,e)},t}(),y=function(){function t(){var e=this;this._preventDefault=function(t){(t=t||window.event).preventDefault&&t.preventDefault(),t.returnValue=!1}.bind(this),this._overflowRegex=/(auto|scroll)/,this._preventDefaultForScrollKeys=function(t){if(32<=t.keyCode&&t.keyCode<=40)return e._preventDefault(t),!1}.bind(this)}return t.prototype.retrieveCoordinates=function(t,e){var o=t.getBoundingClientRect(),n=window.getComputedStyle(t),i={top:o.top-(e?e.top:0),height:o.height,width:o.width,left:o.left-(e?e.left:0),margin:{top:parseFloat(n.marginTop),right:parseFloat(n.marginRight),bottom:parseFloat(n.marginBottom),left:parseFloat(n.marginLeft)}};return i.top+=this.getTop(),i},t.prototype.getTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop},t.prototype.getDocumentHeight=function(){var t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight);return Math.max(this.getHeightOfPage()+this.getTop(),t)},t.prototype.scrollIntoViewIfOutOfView=function(t,e){void 0===e&&(e=0);for(var o=this.getTop(),n=this.getHeightOfPage(),i=0,r=t;r&&r!==document.body;)i+=r.offsetTop,r=r.offsetParent;if(o+n<i+t.offsetHeight)t.scrollIntoView(!1);else if(i<o)t.scrollIntoView(!0),window.scrollBy(0,-30);else for(var s=t;s&&s!==document.body;){if(r=this.getScrollParent(s),s.offsetTop+s.offsetHeight-r.scrollTop>r.offsetHeight||s.offsetLeft+s.offsetWidth-r.scrollLeft>r.offsetWidth){t.scrollIntoView(),window.scrollBy(0,-30);break}s=r}},t.prototype.scrollToTopElement=function(t,e,o){if(t&&e){var n=this.retrieveCoordinates(t,o),i=this.retrieveCoordinates(e,o),r=Math.min(n.left,i.left),s=Math.min(n.top,i.top);window.scrollTo(r-20,s-20)}},t.prototype.getScrollParent=function(t){var e,o=getComputedStyle(t),n="absolute"===o.position;if("fixed"!==o.position)for(var i=t.parentElement;i&&i!==document.body;){if(o=getComputedStyle(i),(!n||"static"!==o.position)&&this._overflowRegex.test(o.overflow+o.overflowY+o.overflowX)){e=i;break}i=i.parentElement}return e||document.body},t.prototype.getHeightOfPage=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},t.decorators=[{type:a.Injectable}],t}(),_=function(){this.previous="Previous",this.next="Next",this.close="Close"},v=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])},function(t,e){function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});function b(){throw Error("Attempting to attach walkthrough content after content is already attached")}var k=function(r){function t(t,e,o,n){var i=r.call(this)||this;return i.viewContainerRef=t,i._walkthroughService=e,i._renderer=o,i._el=n,i.show=!1,i.pause=!1,i.hasHighlightZone=!1,i.hasHighlight=!1,i.hasBackdrop=!1,i.hasGlow=!1,i.hasPrevious=!1,i.hasNext=!1,i.hasFinish=!1,i.hasCloseButton=!1,i.hasCloseAnywhere=!0,i.hasArrow=!1,i.arrowMarkerDist=7,i.marginZonePx=new l,i.text=new _,i}return v(t,r),Object.defineProperty(t.prototype,"id",{get:function(){return this.parent?this.parent.id+"-container":null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hide",{get:function(){return!this.show},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{get:function(){return this.hasCloseAnywhere},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"backdrop",{get:function(){return!this.hasHighlightZone&&this.hasBackdrop},enumerable:!0,configurable:!0}),t.prototype.click=function(){this.hasCloseAnywhere&&this.show&&this.close()},t.prototype.clickZone=function(t){this.parent&&this.hasClickable&&this.parent.focusClick(t,this)},t.prototype.attachComponentPortal=function(t){return this._portalHost.hasAttached()&&b(),this._portalHost.attachComponentPortal(t)},t.prototype.attachTemplatePortal=function(t){return this._portalHost.hasAttached()&&b(),this._portalHost.attachTemplatePortal(t)},t.prototype.setHeight=function(){this._renderer.setStyle(this._el.nativeElement,"height",this._walkthroughService.getDocumentHeight()+"px")},t.prototype.hightlightZone=function(t,e,o,n,i){var r=this,s=this.zone.nativeElement,a=s.style,h=window.getComputedStyle(s,null);if("linear"===o&&0<n&&"auto"!==h.left){this.hideOther=!0;var l=n/20,c=parseInt(h.left,10),p=e+parseInt(h.top,10),u=parseInt(h.width,10),f=parseInt(h.height,10),d=(t.left-c)/20,g=(t.top-p)/20,m=(t.width-u)/20,w=(t.height-f)/20,y=0;this.show=!0,a.borderRadius="50%";var _=setInterval(function(){a.left=c+d*y+"px",a.top=p+g*y+"px",a.width=u+m*y+"px",a.height=f+w*y+"px",20<=y++&&(clearInterval(_),r.hideOther=!1,i())},l)}else a.left=t.left+"px",a.top=t.top+"px",a.width=t.width+"px",a.height=t.height+"px",i()},t.prototype.hightlightZoneStyling=function(t){var e=this.zone.nativeElement.style;if(this.radius)if(Number(this.radius)===parseFloat(this.radius))e.borderRadius=this.radius+"%";else if("auto"===this.radius){var o=window.getComputedStyle(t,null);e.borderTopLeftRadius=o.borderTopLeftRadius,e.borderTopRightRadius=o.borderTopRightRadius,e.borderBottomLeftRadius=o.borderBottomLeftRadius,e.borderBottomRightRadius=o.borderBottomRightRadius}else e.borderRadius=this.radius;else e.borderRadius=""},t.prototype.contentBlockPosition=function(t,e,o,n,i){var r=this.contentBlock.nativeElement,s=this._walkthroughService.retrieveCoordinates(r),a=s.width+s.margin.left+s.margin.right,h=s.height+s.margin.top+s.margin.bottom,l=!1;if(this.hasHighlightZone){var c=t.left,p=window.innerWidth-t.left-t.width;if(c<a&&p<a&&(l=!0),("top"===o||"center"===o||"bottom"===o)&&!l)if("center"===e)Math.max(p,c)<a+(window.innerWidth-a)/2&&(e=c<p?"right":"left");else("left"===e&&c<a||"right"===e&&p<a)&&(o="bottom"===o||t.top<h?"below":"above")}if(l&&(e="center"),r.style.right="",r.style.left="","left"===e){if(r.style.left="0",this.hasHighlightZone){var u=t.left-a;n&&n<u&&(r.style.left=t.left-a-n+"px")}}else if("center"===e)r.style.left=window.innerWidth/2-a/2+"px";else if("right"===e&&(r.style.right="0",this.hasHighlightZone)){u=window.innerWidth-t.left-t.width-a;n&&n<u&&(r.style.right="",r.style.left=t.left+t.width+n+"px")}if(this.hasHighlightZone){var f=this._walkthroughService.retrieveCoordinates(r).left+a/2;if(this._arrowPosition=f>t.left-x.minimalMargin&&f<t.left+t.width+x.minimalMargin?"topBottom":"leftRight",o&&!l){u=0;switch(this._contentPosition=o){case"above":u=t.top,r.style.top=i<u?t.top-h-i+"px":"0",this._arrowPosition="topBottom";break;case"top":r.style.top=t.top+"px";break;case"center":r.style.top=t.top+t.height/2-h/2+"px";break;case"bottom":r.style.top=t.top+t.height-h+"px";break;case"below":u=this._walkthroughService.getDocumentHeight()-t.top+t.height,r.style.top=i<u?t.top+t.height+i+"px":this._walkthroughService.getDocumentHeight()-h+"px",this._arrowPosition="topBottom"}}else"below"===o||t.top<h?(r.style.top=t.top+t.height+x.minimalMargin+"px",this._contentPosition="below"):(r.style.top=t.top-h-x.minimalMargin+"px",this._contentPosition="above")}else r.style.top=this._walkthroughService.getHeightOfPage()/2-h/2+"px"},t.prototype.arrowPosition=function(t,e){var o,n,i=this.contentBlock.nativeElement,r=this._walkthroughService.retrieveCoordinates(i),s=r.left+r.width/2,a=r.top+r.height,h=t.left,l=t.top+this.marginZonePx.top;switch(this._contentPosition){case"top":case"center":case"bottom":s=r.left>t.left?r.left:r.left+r.width,a-=r.height/2;break;case"below":a-=r.height}if("topBottom"===this._arrowPosition)h+=t.width/2,"below"===this._contentPosition?l+=t.height+6:l-=6,n=(s+h)/2,o=(a+l)/2,this.arrowPath="M"+s+","+a+" Q"+s+","+o+" "+n+","+o+" Q"+h+","+o+" "+h+","+l;else{s>t.left?h+=t.width+this.arrowMarkerDist:h-=this.arrowMarkerDist,n=(s+h)/2,o=(a+(l+=t.height/2))/2;var c=s,p=a;"top"===this._contentPosition||"bottom"===this._contentPosition?(c=r.left+r.width/2,p="top"===this._contentPosition?r.top+r.height:r.top,"top"===this._contentPosition&&p<l-x.minimalMargin||"bottom"===this._contentPosition&&p>l+x.minimalMargin?this.arrowPath="M"+c+","+p+" Q"+c+","+l+" "+h+","+l:this.arrowPath="M"+s+","+a+" Q"+n+","+a+" "+n+","+o+" Q"+n+","+l+" "+h+","+l):this.arrowPath="M"+c+","+p+" Q"+c+","+l+" "+h+","+l}},t.prototype.stop=function(){this.parent&&!this.pause&&this.show&&(this.show=!1,this.pause=!0)},t.prototype.continue=function(t){void 0===t&&(t=!1),this.parent&&this.pause&&(this.show=!0,this.pause=!1,t&&(this.parent.focusElementSelector&&!document.querySelector(this.parent.focusElementSelector)?this.close(!1,!1):this.parent.refresh()))},t.prototype.open=function(){this.show=!0},t.prototype.previous=function(){this.close(!1,!1);for(var t=this.parent;t;){if(t.previousStep&&!t.previousStep.disabled)return void t.loadPrevioustStep();if(!t.previousStep)break;t=t.previousStep}this.parent=t,this.close(!0,!0)},t.prototype.next=function(){this.close(!1,!1);for(var t=this.parent;t;){if(t.nextStep&&!t.nextStep.disabled)return void t.loadNextStep();if(!t.nextStep)break;t=t.nextStep}this.parent=t,this.close(!0,!0)},t.prototype.close=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0),this._portalHost.dispose(),this.show=!1,this.parent&&this.parent.hide(t,e)},t.decorators=[{type:a.Component,args:[{selector:"walkthrough-container",styles:[":host { display: block; position: absolute; z-index: 1; top: 0; left: 0; width: 99.9%; min-height: 100%; } :host.hide { display: none; } :host.cursor { cursor: pointer; } :host.backdrop { background-color: rgba(0, 0, 0, 0.6); } button { background: none; border: 0; color: #FFF; } .wkt-zone { position: absolute; } .wkt-zone.hide { display: none; } .wkt-zone.backdrop { box-shadow: 0 0 0 2200px rgba(0, 0, 0, 0.6); } .wkt-zone.glow { box-shadow: 0 0 4px 2px #FFFF66, 0 0 9px 0 #FFFF66, 0 0 36px #FFFF66; } .wkt-zone.clickable { cursor: pointer; } .wkt-zone.highlight { -webkit-animation: highlight .45s 4; animation: highlight .45s 4; } .wkt-container { position: relative; } .wkt-content-block { position: absolute; margin: 1em; padding: 6px; z-index: 1; color: #FFF; min-width: calc(320px - 2em); } .wkt-content-block.hide { display: none; } .wkt-content-block.darken { background-color: rgba(0, 0, 0, 0.6); } .wkt-close + .wkt-content { margin-top: 1.3em; } .wkt-close { position: absolute; right: 1em; cursor: pointer; } .wkt-navigate { display: flex; flex-wrap: wrap; justify-content: center; } .wkt-navigate > button { padding: 6px; font-size: 120%; } .wkt-navigate > button:hover { cursor: pointer; text-decoration: underline; } .wkt-previous-link::before { content: '<< '; } .wkt-next-link::after { content: ' >>'; } span.hide { display: none; } svg { overflow: visible; position: absolute; top: -1px; left: -1px; border: 1px solid transparent; } #wkt-arrow > path { stroke-width: 0; } .wkt-arrow-path { stroke-width: 2px; fill: none; } @-webkit-keyframes highlight { 0% { background-color: none; } 50% { background-color: rgba(255, 255, 255, 0.8); } 100% { background-color: none; } } @keyframes highlight { 0% { background-color: none; } 50% { background-color: rgba(255, 255, 255, 0.8); } 100% { background-color: none; } } @media screen and (min-width: 1920px), screen and (min-height: 1920px) { .wkt-zone.backdrop { box-shadow: 0 0 0 4400px rgba(0, 0, 0, 0.6); } } @media screen and (min-width: 3840px), screen and (min-height: 3840px) { .wkt-zone.backdrop { box-shadow: 0 0 0 8800px rgba(0, 0, 0, 0.6); } } _:default:not(:root:root), .wkt-zone.backdrop { box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.6) !important; } "],template:'<div class="wkt-container"> <div class="wkt-zone" #zone (click)="clickZone($event)" [class.hide]="!hasHighlightZone" [class.backdrop]="hasBackdrop" [class.glow]="hasGlow" [class.clickable]="hasClickable" [class.highlight]="hasHighlight" [style.padding]="marginZone"></div> <div class="wkt-content-block" [class.hide]="hideOther" [class.darken]="contentStyle === \'draken\'" #contentBlock> <button type="button" class="wkt-close" *ngIf="hasCloseButton" (click)="close()">✖</button> <div class="wkt-content"> <p *ngIf="contentText">{{contentText}}</p> <ng-template cdkPortalHost></ng-template> </div> <div class="wkt-navigate" *ngIf="hasPrevious||hasNext||hasFinish"> <button type="button" class="wkt-previous-link" *ngIf="hasPrevious" (click)="previous()">{{text.previous}}</button> <button type="button" class="wkt-next-link" *ngIf="hasNext" (click)="next()">{{text.next}}</button> <button type="button" class="wkt-finish-link" *ngIf="hasFinish" (click)="close(true)">{{text.close}}</button> </div> </div> <span *ngIf="hasArrow" [class.hide]="hideOther"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"> <defs> <marker id="wkt-arrow" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="strokeWidth" orient="auto" markerWidth="10" markerHeight="10"> <polyline points="0,0 10,5 0,10 5,5" stroke-width="0" [attr.fill]="arrowColor || \'#FFF\'" /> </marker> </defs> <path class="wkt-arrow-path" [attr.d]="arrowPath" [attr.stroke]="arrowColor || \'#FFF\'" marker-end="url(#wkt-arrow)" /> </svg> </span> </div>'}]}],t.ctorParameters=function(){return[{type:a.ViewContainerRef},{type:y},{type:a.Renderer2},{type:a.ElementRef}]},t.propDecorators={_portalHost:[{type:a.ViewChild,args:[g]}],content:[{type:a.ViewChild,args:["content"]}],contentBlock:[{type:a.ViewChild,args:["contentBlock"]}],zone:[{type:a.ViewChild,args:["zone"]}],id:[{type:a.HostBinding,args:["attr.id"]}],hide:[{type:a.HostBinding,args:["class.hide"]}],cursor:[{type:a.HostBinding,args:["class.cursor"]}],backdrop:[{type:a.HostBinding,args:["class.backdrop"]}],click:[{type:a.HostListener,args:["click"]}]},t}(f),C=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},P=0,x=function(){function s(t,e,o,n,i){this._componentFactoryResolver=t,this._applicationRef=e,this._injector=o,this._renderer=n,this._walkthroughService=i,this.closed=new a.EventEmitter,this.finished=new a.EventEmitter,this.ready=new a.EventEmitter,this.focusElementCSSClass=void 0,this.typeSelector="element",this.contentStyle="draken",this.animation="none",this.animationDelays=0,this._uid="walkthrough-"+P++,this._readyHasBeenEmited=!1,this._display=!1,this._hasHighlightAnimation=!1,this._hasBackdrop=!1,this._hasGlow=!1,this._hasFinish=!1,this._hasArrow=!1,this._hasCloseButton=!1,this._hasCloseAnywhere=!0,this._disabled=!1,this._marginZonePx=new l,this._alignContent="left",this._verticalAlignContent="top",this._contentSpacing=0,this._verticalContentSpacing=50}return Object.defineProperty(s.prototype,"marginZone",{get:function(){return this._marginZone},set:function(t){this._marginZone!==t&&(null===t&&(this._marginZone=null),this._marginZonePx=l.parsePoints(t),null!==this._marginZonePx&&(this._marginZone=t))},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"arrowColor",{get:function(){return this._arrowColor},set:function(t){this._arrowColor!==t&&(this._arrowColor=t,this._getInstance()&&(this._getInstance().arrowColor=this._arrowColor))},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t||this._uid},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"alignContent",{get:function(){return this._alignContent},set:function(t){this._alignContent!==t?(this._alignContent=t,this._updateElementPositions(this._getInstance())):this._alignContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"verticalAlignContent",{get:function(){return this._verticalAlignContent},set:function(t){this._verticalAlignContent!==t?(this._verticalAlignContent=t,this._updateElementPositions(this._getInstance())):this._verticalAlignContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"contentSpacing",{get:function(){return this._contentSpacing},set:function(t){t=Math.max(s.minimalMargin,t),this._contentSpacing!==t?(this._contentSpacing=1*t,this._updateElementPositions(this._getInstance())):this._contentSpacing=1*t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"verticalContentSpacing",{get:function(){return this._verticalContentSpacing},set:function(t){t=Math.max(s.minimalMargin,t),this._verticalContentSpacing!==t?(this._verticalContentSpacing=1*t,this._updateElementPositions(this._getInstance())):this._verticalContentSpacing=1*t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"closeButton",{get:function(){return this._hasCloseButton},set:function(t){this._hasCloseButton=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"closeAnywhere",{get:function(){return this._hasCloseAnywhere},set:function(t){this._hasCloseAnywhere=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"showArrow",{get:function(){return this._hasArrow},set:function(t){this._hasArrow=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"finishButton",{get:function(){return this._hasFinish},set:function(t){this._hasFinish=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"focusHighlightAnimation",{get:function(){return this._hasHighlightAnimation},set:function(t){this._hasHighlightAnimation=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"focusBackdrop",{get:function(){return this._hasBackdrop},set:function(t){this._hasBackdrop=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"focusGlow",{get:function(){return this._hasGlow},set:function(t){this._hasGlow=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"disabled",{get:function(){return this._disabled},set:function(t){var e=this;this._disabled=t;var o=this._getInstance();o&&setTimeout(function(){o.hasPrevious=e._hasPreviousStep(o),o.hasNext=e._hasNextStep(o),o.hasNext?o.hasFinish=o.parent.finishButton:o.hasFinish=!0},50)},enumerable:!0,configurable:!0}),s.walkthroughStop=function(){s._walkthroughContainer&&s._walkthroughContainer.instance.stop()},s.walkthroughHasShow=function(){return!!s._walkthroughContainer&&s._walkthroughContainer.instance.show},s.walkthroughHasPause=function(){return!!s._walkthroughContainer&&s._walkthroughContainer.instance.pause},s.walkthroughContinue=function(){s._walkthroughContainer&&s._walkthroughContainer.instance.continue(!0)},s.walkthroughNext=function(){s._walkthroughContainer&&s._walkthroughContainer.instance.next()},s.walkthroughPrevious=function(){s._walkthroughContainer&&s._walkthroughContainer.instance.previous()},s.prototype.resize=function(){s._walkthroughContainer&&this._display&&!s.walkthroughHasPause()&&this._elementLocations()},s.prototype.ngAfterViewInit=function(){var t=this;s._walkthroughContainer||s._walkthroughContainerCreating||(s._walkthroughContainerCreating=!0,setTimeout(function(){s._walkthroughContainer=t._appendComponentToBody(k)},0))},s.prototype.next=function(t,e){void 0===t&&(t=void 0),void 0===e&&(e=void 0),t&&(this.closed=t),e&&(this.finished=e),this.open()},s.prototype.refresh=function(){this._getInstance().pause||this._elementLocations()},s.prototype.open=function(){this._getInstance().pause?console.warn("Another walkthrough is in pause. Please close it before."):this._elementLocations()},s.prototype.loadPrevioustStep=function(){var t=this;setTimeout(function(){t.previousStep._next(t.closed,t.finished)},0)},s.prototype.loadNextStep=function(){var t=this;setTimeout(function(){t.nextStep._next(t.closed,t.finished)},0)},s.prototype.hide=function(t,e){var o=this;void 0===t&&(t=!1),void 0===e&&(e=!0),this._display=!1,this.focusElementCSSClass&&this._renderer.removeClass(this._focusElement,this.focusElementCSSClass),e&&setTimeout(function(){o.closed.emit(t),o.nextStep||o.finished.emit(new h(o,o._focusElement))},20)},s.prototype._show=function(){this._display=!0},s.prototype._next=function(t,e){void 0===t&&(t=void 0),void 0===e&&(e=void 0),t&&(this.closed=t),e&&(this.finished=e),this.open()},s.prototype._getInstance=function(){return s._walkthroughContainer?s._walkthroughContainer.instance:null},s.prototype._appendComponentToBody=function(t){var e=this._componentFactoryResolver.resolveComponentFactory(t).create(this._injector);this._applicationRef.attachView(e.hostView);var o=e.hostView.rootNodes[0];return document.body.appendChild(o),e},s.prototype._attachWalkthroughContent=function(t,e){if(t instanceof a.TemplateRef)e.attachTemplatePortal(new u(t,null));else{var o=new WeakMap;o.set(k,e);var n=new w(this._injector,o);e.attachComponentPortal(new p(t,void 0,n))}},s.prototype._elementLocations=function(){this._getFocusElement();var t=this._focusElement;if(t){if(this._walkthroughService.scrollIntoViewIfOutOfView(t),this._offsetCoordinates=this._walkthroughService.retrieveCoordinates(t,this._marginZonePx),"zone"===this.typeSelector){var e=this._walkthroughService.retrieveCoordinates(this._focusElementEnd,this._marginZonePx);this._offsetCoordinates.height=e.top-this._offsetCoordinates.top+e.height,this._offsetCoordinates.width=e.left-this._offsetCoordinates.left+e.width}}else this._offsetCoordinates=null;this._setFocus()},s.prototype._getFocusElement=function(){var t=this.focusElementSelector?document.querySelectorAll(this.focusElementSelector):null;if(t&&0<t.length)if(1<t.length){for(var e=t.length,o=0;o<e;o++)if(t[o].offsetHeight){this._focusElement=t[o],o=t.length;break}if("zone"===this.typeSelector){for(o=e-1;0<=o;o--)if(t[o].offsetHeight){this._focusElementEnd=t[o],o=t.length;break}this._focusElement===this._focusElementEnd&&(this.typeSelector="element")}}else this._focusElement=t[0],this.typeSelector="element";else this._focusElement=null},s.prototype._setFocus=function(){var t=this,e=this._getInstance();if(e){var o=window.pageXOffset;this._initStylingTemplate(e),setTimeout(function(){t._focusElement&&e.zone?e.hightlightZone(t._offsetCoordinates,o-window.pageXOffset,t.animation,t.animationDelays,t._setFocusContinue.bind(t)):t._setFocusContinue()},20)}},s.prototype._setFocusContinue=function(){var t=this,e=this._getInstance();this._display||(this._attachContentTemplate(),this._initContentTemplate(e)),setTimeout(function(){e.hightlightZoneStyling(t._focusElement),t._updateElementPositions(e)},0)},s.prototype._updateElementPositions=function(i){var r=this;s._walkthroughContainer&&this._getInstance()&&setTimeout(function(){i.contentBlockPosition(r._offsetCoordinates,r._alignContent,r._verticalAlignContent,r._contentSpacing,r._verticalContentSpacing),null!==r._focusElement&&r._hasArrow&&i.arrowPosition(r._offsetCoordinates,r._verticalContentSpacing),r.focusElementCSSClass&&r._renderer.addClass(r._focusElement,r.focusElementCSSClass),setTimeout(function(){r._getInstance().setHeight(),r._readyHasBeenEmited||(r._readyHasBeenEmited=!0,r.ready.emit(new h(r,r._focusElement)));var t,e=i.contentBlock.nativeElement;if(null!=r._focusElement){var o=r._walkthroughService.retrieveCoordinates(e),n=r._walkthroughService.retrieveCoordinates(r._focusElement);o.height+n.height>window.innerHeight?(e.scrollIntoView(!0),t=o.top>n.top?-o.height/2:+o.height/2):(o.top>n.top?window.scrollTo(n.left,n.top):e.scrollIntoView(!0),t=-s.minimalMargin)}else e.scrollIntoView(!0),t=-s.minimalMargin;window.scrollBy(0,t)},50)},0)},s.prototype._attachContentTemplate=function(){this.contentTemplate&&this._attachWalkthroughContent(this.contentTemplate,this._getInstance())},s.prototype._initStylingTemplate=function(t){var e=null!==this._focusElement;t.parent=this,t.open(),t.hasHighlightZone=e,t.hasClickable=e&&"function"==typeof this.focusClick,t.hasHighlight=e&&this._hasHighlightAnimation,t.hasBackdrop=this._hasBackdrop,t.hasGlow=e&&this._hasGlow},s.prototype._initContentTemplate=function(t){var e=null!==this._focusElement;t.hasPrevious=this._hasPreviousStep(t),t.hasNext=this._hasNextStep(t),t.hasCloseButton=this._hasCloseButton,t.hasCloseAnywhere=this._hasCloseAnywhere,t.hasFinish=this._hasFinish||!t.hasNext,t.hasArrow=e&&this._hasArrow,t.arrowColor=this.arrowColor,t.radius=this.radius,t.marginZone=this._marginZone?this._marginZone.replace(/(\d+)/g,"$1px"):null,t.marginZonePx=this._marginZonePx,t.contentText=this.contentText,t.contentStyle=this.contentStyle,t.text=this.texts?C({},new _,this.texts):new _,this._show()},s.prototype._hasPreviousStep=function(t){if(t.parent)for(var e=t.parent.previousStep;e;){if(!e.disabled)return!0;e=e.previousStep}return!1},s.prototype._hasNextStep=function(t){if(t.parent)for(var e=t.parent.nextStep;e;){if(!e.disabled)return!0;e=e.nextStep}return!1},s._walkthroughContainer=null,s._walkthroughContainerCreating=!1,s.minimalMargin=30,s.decorators=[{type:a.Component,args:[{selector:"ng-walkthrough",template:""}]}],s.ctorParameters=function(){return[{type:a.ComponentFactoryResolver},{type:a.ApplicationRef},{type:a.Injector},{type:a.Renderer2},{type:y}]},s.propDecorators={closed:[{type:a.Output}],finished:[{type:a.Output}],ready:[{type:a.Output}],focusElementCSSClass:[{type:a.Input}],focusElementSelector:[{type:a.Input}],typeSelector:[{type:a.Input}],focusClick:[{type:a.Input}],radius:[{type:a.Input}],previousStep:[{type:a.Input}],nextStep:[{type:a.Input}],texts:[{type:a.Input}],contentTemplate:[{type:a.Input}],contentText:[{type:a.Input}],contentStyle:[{type:a.Input}],marginZone:[{type:a.Input}],arrowColor:[{type:a.Input}],animation:[{type:a.Input}],animationDelays:[{type:a.Input}],id:[{type:a.Input}],alignContent:[{type:a.Input}],verticalAlignContent:[{type:a.Input}],contentSpacing:[{type:a.Input}],verticalContentSpacing:[{type:a.Input}],closeButton:[{type:a.Input}],closeAnywhere:[{type:a.Input}],showArrow:[{type:a.Input}],finishButton:[{type:a.Input}],focusHighlightAnimation:[{type:a.Input}],focusBackdrop:[{type:a.Input}],focusGlow:[{type:a.Input}],disabled:[{type:a.Input}],resize:[{type:a.HostListener,args:["window:resize"]}]},s}(),S=0,I=function(){function t(){this.closed=new a.EventEmitter,this.finished=new a.EventEmitter,this.contentStyle="draken",this.marginZone=null,this._uid="walkthrough-flow-"+S++}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t||this._uid},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;setTimeout(function(){t.init()},0)},t.prototype.init=function(){var e=this,o=null;this.walkthroughComponents.forEach(function(t){o&&((t.previousStep=o).nextStep=t),o=t,e.closed&&(t.closed=e.closed),e.finished&&(t.finished=e.finished),!t.contentStyle&&e.contentStyle&&(t.contentStyle=e.contentStyle),!t.arrowColor&&e.arrowColor&&(t.arrowColor=e.arrowColor),!t.marginZone&&e.marginZone&&(t.marginZone=e.marginZone),!t.showArrow&&n(e.showArrow)&&(t.showArrow=e.showArrow),!t.closeButton&&n(e.closeButton)&&(t.closeButton=e.closeButton),t.closeAnywhere&&!n(e.closeAnywhere)&&(t.closeAnywhere=e.closeAnywhere),!t.finishButton&&n(e.finishButton)&&(t.finishButton=e.finishButton),!t.focusBackdrop&&n(e.focusBackdrop)&&(t.focusBackdrop=e.focusBackdrop),!t.focusGlow&&n(e.focusGlow)&&(t.focusGlow=e.focusGlow),!t.radius&&e.radius&&(t.radius=e.radius),!t.texts&&e.texts&&(t.texts=e.texts)}),o.finishButton=!0},t.prototype.start=function(){this.walkthroughComponents.first.open()},t.decorators=[{type:a.Component,args:[{selector:"ng-walkthrough-flow",template:""}]}],t.ctorParameters=function(){return[]},t.propDecorators={walkthroughComponents:[{type:a.ContentChildren,args:[x]}],id:[{type:a.Input}],closed:[{type:a.Output}],finished:[{type:a.Output}],contentStyle:[{type:a.Input}],arrowColor:[{type:a.Input}],marginZone:[{type:a.Input}],showArrow:[{type:a.Input}],closeButton:[{type:a.Input}],closeAnywhere:[{type:a.Input}],finishButton:[{type:a.Input}],focusBackdrop:[{type:a.Input}],focusGlow:[{type:a.Input}],radius:[{type:a.Input}],texts:[{type:a.Input}]},t}(),E=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:a.NgModule,args:[{declarations:[I,x,k],exports:[I,x,k],imports:[e.CommonModule,m],entryComponents:[k],providers:[y]}]}],t}();t.booleanValue=n,t.WalkthroughEvent=h,t.WalkthroughMargin=l,t.WalkthroughComponent=x,t.WalkthroughFlowComponent=I,t.throwWalkthroughContentAlreadyAttachedError=b,t.WalkthroughContainerComponent=k,t.WalkthroughText=_,t.WalkthroughModule=E,t.ɵa=y,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],e):e(t.angularWalkthrough={},t.ng.core,t.ng.common)}(this,function(t,e,o){"use strict";var n=function(t){return"true"===t||!0===t},i=function(){return function(t,e){this.component=t,this.focusElement=e}}(),r=function(){function t(t,e,o,n){void 0===t&&(t=0),this.top=t,this.right=e,this.bottom=o,this.left=n,void 0===e&&(this.right=t),void 0===o&&(this.bottom=t),void 0===n&&void 0===e?this.left=t:void 0===n&&(this.left=e)}return t.parsePoints=function(e){var o;if(e.match(/^\d+(?:\s+\d+)*$/)){var n=e.split(/\s+/).map(function(t){return parseFloat(t)});o=new t(n[0],n[1],n[2],n[3])}return o||new t},t}(),s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])};function a(t,e){function o(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function h(){throw Error("Host already has a portal attached")}var l,c=function(){function t(){}return t.prototype.attach=function(t){return null==t&&function(){throw Error("Attempting to attach a portal to a null PortalOutlet")}(),t.hasAttached()&&h(),this._attachedHost=t,t.attach(this)},t.prototype.detach=function(){var t=this._attachedHost;null==t?function(){throw Error("Attempting to detach a portal that is not attached to a host")}():(this._attachedHost=null,t.detach())},Object.defineProperty(t.prototype,"isAttached",{get:function(){return null!=this._attachedHost},enumerable:!0,configurable:!0}),t.prototype.setAttachedHost=function(t){this._attachedHost=t},t}(),p=function(t){function e(e,o,n){var i=t.call(this)||this;return i.component=e,i.viewContainerRef=o,i.injector=n,i}return a(e,t),e}(c),u=function(t){function e(e,o,n){var i=t.call(this)||this;return i.templateRef=e,i.viewContainerRef=o,i.context=n,i}return a(e,t),Object.defineProperty(e.prototype,"origin",{get:function(){return this.templateRef.elementRef},enumerable:!0,configurable:!0}),e.prototype.attach=function(e,o){return void 0===o&&(o=this.context),this.context=o,t.prototype.attach.call(this,e)},e.prototype.detach=function(){return this.context=void 0,t.prototype.detach.call(this)},e}(c),f=function(){function t(){this._isDisposed=!1}return t.prototype.hasAttached=function(){return!!this._attachedPortal},t.prototype.attach=function(t){return t||function(){throw Error("Must provide a portal to attach")}(),this.hasAttached()&&h(),this._isDisposed&&function(){throw Error("This PortalOutlet has already been disposed")}(),t instanceof p?(this._attachedPortal=t,this.attachComponentPortal(t)):t instanceof u?(this._attachedPortal=t,this.attachTemplatePortal(t)):void function(){throw Error("Attempting to attach an unknown Portal type. BasePortalOutlet accepts either a ComponentPortal or a TemplatePortal.")}()},t.prototype.detach=function(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()},t.prototype.dispose=function(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0},t.prototype.setDisposeFn=function(t){this._disposeFn=t},t.prototype._invokeDisposeFn=function(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)},t}(),d=(function(t){function e(e,o,n,i){var r=t.call(this)||this;return r.outletElement=e,r._componentFactoryResolver=o,r._appRef=n,r._defaultInjector=i,r}a(e,t),e.prototype.attachComponentPortal=function(t){var e,o=this,n=this._componentFactoryResolver.resolveComponentFactory(t.component);return t.viewContainerRef?(e=t.viewContainerRef.createComponent(n,t.viewContainerRef.length,t.injector||t.viewContainerRef.parentInjector),this.setDisposeFn(function(){return e.destroy()})):(e=n.create(t.injector||this._defaultInjector),this._appRef.attachView(e.hostView),this.setDisposeFn(function(){o._appRef.detachView(e.hostView),e.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(e)),e},e.prototype.attachTemplatePortal=function(t){var e=this,o=t.viewContainerRef,n=o.createEmbeddedView(t.templateRef,t.context);return n.detectChanges(),n.rootNodes.forEach(function(t){return e.outletElement.appendChild(t)}),this.setDisposeFn(function(){var t=o.indexOf(n);-1!==t&&o.remove(t)}),n},e.prototype.dispose=function(){t.prototype.dispose.call(this),null!=this.outletElement.parentNode&&this.outletElement.parentNode.removeChild(this.outletElement)},e.prototype._getComponentRootNode=function(t){return t.hostView.rootNodes[0]}}(f),function(t){function o(e,o){return t.call(this,e,o)||this}return a(o,t),o.decorators=[{type:e.Directive,args:[{selector:"[cdk-portal], [cdkPortal], [portal]",exportAs:"cdkPortal"}]}],o.ctorParameters=function(){return[{type:e.TemplateRef},{type:e.ViewContainerRef}]},o}(u)),g=function(t){function o(o,n){var i=t.call(this)||this;return i._componentFactoryResolver=o,i._viewContainerRef=n,i._isInitialized=!1,i.attached=new e.EventEmitter,i}return a(o,t),Object.defineProperty(o.prototype,"_deprecatedPortal",{get:function(){return this.portal},set:function(t){this.portal=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_deprecatedPortalHost",{get:function(){return this.portal},set:function(t){this.portal=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"portal",{get:function(){return this._attachedPortal},set:function(e){(!this.hasAttached()||e||this._isInitialized)&&(this.hasAttached()&&t.prototype.detach.call(this),e&&t.prototype.attach.call(this,e),this._attachedPortal=e)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"attachedRef",{get:function(){return this._attachedRef},enumerable:!0,configurable:!0}),o.prototype.ngOnInit=function(){this._isInitialized=!0},o.prototype.ngOnDestroy=function(){t.prototype.dispose.call(this),this._attachedPortal=null,this._attachedRef=null},o.prototype.attachComponentPortal=function(e){e.setAttachedHost(this);var o=null!=e.viewContainerRef?e.viewContainerRef:this._viewContainerRef,n=this._componentFactoryResolver.resolveComponentFactory(e.component),i=o.createComponent(n,o.length,e.injector||o.parentInjector);return t.prototype.setDisposeFn.call(this,function(){return i.destroy()}),this._attachedPortal=e,this._attachedRef=i,this.attached.emit(i),i},o.prototype.attachTemplatePortal=function(e){var o=this;e.setAttachedHost(this);var n=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context);return t.prototype.setDisposeFn.call(this,function(){return o._viewContainerRef.clear()}),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n},o.decorators=[{type:e.Directive,args:[{selector:"[cdkPortalOutlet], [cdkPortalHost], [portalHost]",exportAs:"cdkPortalOutlet, cdkPortalHost",inputs:["portal: cdkPortalOutlet"]}]}],o.ctorParameters=function(){return[{type:e.ComponentFactoryResolver},{type:e.ViewContainerRef}]},o.propDecorators={_deprecatedPortal:[{type:e.Input,args:["portalHost"]}],_deprecatedPortalHost:[{type:e.Input,args:["cdkPortalHost"]}],attached:[{type:e.Output,args:["attached"]}]},o}(f),m=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{exports:[d,g],declarations:[d,g]}]}],t.ctorParameters=function(){return[]},t}(),w=function(){function t(t,e){this._parentInjector=t,this._customTokens=e}return t.prototype.get=function(t,e){var o=this._customTokens.get(t);return void 0!==o?o:this._parentInjector.get(t,e)},t}(),y=function(){function t(){var t=this;this._preventDefault=function(t){(t=t||window.event).preventDefault&&t.preventDefault(),t.returnValue=!1}.bind(this),this._overflowRegex=/(auto|scroll)/,this._preventDefaultForScrollKeys=function(e){if(e.keyCode>=32&&e.keyCode<=40)return t._preventDefault(e),!1}.bind(this)}return t.prototype.retrieveCoordinates=function(t,e){var o=t.getBoundingClientRect(),n=window.getComputedStyle(t),i={top:o.top-(e?e.top:0),height:o.height,width:o.width,left:o.left-(e?e.left:0),margin:{top:parseFloat(n.marginTop),right:parseFloat(n.marginRight),bottom:parseFloat(n.marginBottom),left:parseFloat(n.marginLeft)}};return i.top+=this.getTop(),i},t.prototype.getTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop},t.prototype.getDocumentHeight=function(){var t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight);return Math.max(this.getHeightOfPage()+this.getTop(),t)},t.prototype.scrollIntoViewIfOutOfView=function(t,e){void 0===e&&(e=0);for(var o=this.getTop(),n=this.getHeightOfPage(),i=0,r=t;r&&r!==document.body;)i+=r.offsetTop,r=r.offsetParent;if(o+n<i+t.offsetHeight)t.scrollIntoView(!1);else if(i<o)t.scrollIntoView(!0),window.scrollBy(0,-30);else for(var s=t;s&&s!==document.body;){if(r=this.getScrollParent(s),s.offsetTop+s.offsetHeight-r.scrollTop>r.offsetHeight||s.offsetLeft+s.offsetWidth-r.scrollLeft>r.offsetWidth){t.scrollIntoView(),window.scrollBy(0,-30);break}s=r}},t.prototype.scrollToTopElement=function(t,e,o){if(t&&e){var n=this.retrieveCoordinates(t,o),i=this.retrieveCoordinates(e,o),r=Math.min(n.left,i.left),s=Math.min(n.top,i.top);window.scrollTo(r-20,s-20)}},t.prototype.getScrollParent=function(t){var e,o=getComputedStyle(t),n="absolute"===o.position;if("fixed"!==o.position)for(var i=t.parentElement;i&&i!==document.body;){if(o=getComputedStyle(i),(!n||"static"!==o.position)&&this._overflowRegex.test(o.overflow+o.overflowY+o.overflowX)){e=i;break}i=i.parentElement}return e||document.body},t.prototype.getHeightOfPage=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[]},t}(),_=function(){return function(){this.previous="Previous",this.next="Next",this.close="Close"}}(),v=(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])},function(t,e){function o(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});function b(){throw Error("Attempting to attach walkthrough content after content is already attached")}var k=function(t){function o(e,o,n,i){var s=t.call(this)||this;return s.viewContainerRef=e,s._walkthroughService=o,s._renderer=n,s._el=i,s.show=!1,s.pause=!1,s.hasHighlightZone=!1,s.hasHighlight=!1,s.hasBackdrop=!1,s.hasGlow=!1,s.hasPrevious=!1,s.hasNext=!1,s.hasFinish=!1,s.hasCloseButton=!1,s.hasCloseAnywhere=!0,s.hasArrow=!1,s.arrowMarkerDist=7,s.marginZonePx=new r,s.text=new _,s}return v(o,t),Object.defineProperty(o.prototype,"id",{get:function(){return this.parent?this.parent.id+"-container":null},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"hide",{get:function(){return!this.show},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"cursor",{get:function(){return this.hasCloseAnywhere},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"backdrop",{get:function(){return!this.hasHighlightZone&&this.hasBackdrop},enumerable:!0,configurable:!0}),o.prototype.click=function(){this.hasCloseAnywhere&&this.show&&this.close()},o.prototype.clickZone=function(t){this.parent&&this.hasClickable&&this.parent.focusClick(t,this)},o.prototype.attachComponentPortal=function(t){return this._portalHost.hasAttached()&&b(),this._portalHost.attachComponentPortal(t)},o.prototype.attachTemplatePortal=function(t){return this._portalHost.hasAttached()&&b(),this._portalHost.attachTemplatePortal(t)},o.prototype.setHeight=function(){this._renderer.setStyle(this._el.nativeElement,"height",this._walkthroughService.getDocumentHeight()+"px")},o.prototype.hightlightZone=function(t,e,o,n,i){var r=this,s=this.zone.nativeElement,a=s.style,h=window.getComputedStyle(s,null);if("linear"===o&&n>0&&"auto"!==h.left){this.hideOther=!0;var l=n/20,c=parseInt(h.left,10),p=e+parseInt(h.top,10),u=parseInt(h.width,10),f=parseInt(h.height,10),d=(t.left-c)/20,g=(t.top-p)/20,m=(t.width-u)/20,w=(t.height-f)/20,y=0;this.show=!0,a.borderRadius="50%";var _=setInterval(function(){a.left=c+d*y+"px",a.top=p+g*y+"px",a.width=u+m*y+"px",a.height=f+w*y+"px",y++>=20&&(clearInterval(_),r.hideOther=!1,i())},l)}else a.left=t.left+"px",a.top=t.top+"px",a.width=t.width+"px",a.height=t.height+"px",i()},o.prototype.hightlightZoneStyling=function(t){if(t){var e=this.zone.nativeElement.style;if(this.radius)if(Number(this.radius)===parseFloat(this.radius))e.borderRadius=this.radius+"%";else if("auto"===this.radius){var o=window.getComputedStyle(t,null);e.borderTopLeftRadius=o.borderTopLeftRadius,e.borderTopRightRadius=o.borderTopRightRadius,e.borderBottomLeftRadius=o.borderBottomLeftRadius,e.borderBottomRightRadius=o.borderBottomRightRadius}else e.borderRadius=this.radius;else e.borderRadius=""}},o.prototype.contentBlockPosition=function(t,e,o,n,i){var r=this.contentBlock.nativeElement,s=this._walkthroughService.retrieveCoordinates(r),a=s.width+s.margin.left+s.margin.right,h=s.height+s.margin.top+s.margin.bottom,l=!1;if(this.hasHighlightZone){var c=t.left,p=window.innerWidth-t.left-t.width;if(c<a&&p<a&&(l=!0),("top"===o||"center"===o||"bottom"===o)&&!l)if("center"===e)Math.max(p,c)<a+(window.innerWidth-a)/2&&(e=p>c?"right":"left");else("left"===e&&c<a||"right"===e&&p<a)&&(o="bottom"===o||t.top<h?"below":"above")}if(l&&(e="center"),r.style.right="",r.style.left="","left"===e){if(r.style.left="0",this.hasHighlightZone){var u=t.left-a;n&&u>n&&(r.style.left=t.left-a-n+"px")}}else if("center"===e)r.style.left=window.innerWidth/2-a/2+"px";else if("right"===e&&(r.style.right="0",this.hasHighlightZone)){u=window.innerWidth-t.left-t.width-a;n&&u>n&&(r.style.right="",r.style.left=t.left+t.width+n+"px")}if(this.hasHighlightZone){var f=this._walkthroughService.retrieveCoordinates(r).left+a/2;if(this._arrowPosition=f>t.left-x.minimalMargin&&f<t.left+t.width+x.minimalMargin?"topBottom":"leftRight",o&&!l){u=0;switch(this._contentPosition=o,o){case"above":u=t.top,r.style.top=u>i?t.top-h-i+"px":"0",this._arrowPosition="topBottom";break;case"top":r.style.top=t.top+"px";break;case"center":r.style.top=t.top+t.height/2-h/2+"px";break;case"bottom":r.style.top=t.top+t.height-h+"px";break;case"below":u=this._walkthroughService.getDocumentHeight()-t.top+t.height,r.style.top=u>i?t.top+t.height+i+"px":this._walkthroughService.getDocumentHeight()-h+"px",this._arrowPosition="topBottom"}}else"below"===o||t.top<h?(r.style.top=t.top+t.height+x.minimalMargin+"px",this._contentPosition="below"):(r.style.top=t.top-h-x.minimalMargin+"px",this._contentPosition="above")}else r.style.top=this._walkthroughService.getHeightOfPage()/2-h/2+"px"},o.prototype.arrowPosition=function(t,e){var o,n,i=this.contentBlock.nativeElement,r=this._walkthroughService.retrieveCoordinates(i),s=r.left+r.width/2,a=r.top+r.height,h=t.left,l=t.top+this.marginZonePx.top;switch(this._contentPosition){case"top":case"center":case"bottom":s=r.left>t.left?r.left:r.left+r.width,a-=r.height/2;break;case"below":a-=r.height}if("topBottom"===this._arrowPosition)h+=t.width/2,"below"===this._contentPosition?l+=t.height+6:l-=6,n=(s+h)/2,o=(a+l)/2,this.arrowPath="M"+s+","+a+" Q"+s+","+o+" "+n+","+o+" Q"+h+","+o+" "+h+","+l;else{s>t.left?h+=t.width+this.arrowMarkerDist:h-=this.arrowMarkerDist,n=(s+h)/2,o=(a+(l+=t.height/2))/2;var c=s,p=a;"top"===this._contentPosition||"bottom"===this._contentPosition?(c=r.left+r.width/2,p="top"===this._contentPosition?r.top+r.height:r.top,"top"===this._contentPosition&&p<l-x.minimalMargin||"bottom"===this._contentPosition&&p>l+x.minimalMargin?this.arrowPath="M"+c+","+p+" Q"+c+","+l+" "+h+","+l:this.arrowPath="M"+s+","+a+" Q"+n+","+a+" "+n+","+o+" Q"+n+","+l+" "+h+","+l):this.arrowPath="M"+c+","+p+" Q"+c+","+l+" "+h+","+l}},o.prototype.stop=function(){this.parent&&!this.pause&&this.show&&(this.show=!1,this.pause=!0)},o.prototype.continue=function(t){void 0===t&&(t=!1),this.parent&&this.pause&&(this.show=!0,this.pause=!1,t&&(this.parent.focusElementSelector&&!document.querySelector(this.parent.focusElementSelector)?this.close(!1,!1):this.parent.refresh()))},o.prototype.open=function(){this.show=!0},o.prototype.previous=function(){this.close(!1,!1);for(var t=this.parent;t;){if(t.previousStep&&!t.previousStep.disabled)return void t.loadPrevioustStep();if(!t.previousStep)break;t=t.previousStep}this.parent=t,this.close(!0,!0)},o.prototype.next=function(){this.close(!1,!1);for(var t=this.parent;t;){if(t.nextStep&&!t.nextStep.disabled)return void t.loadNextStep();if(!t.nextStep)break;t=t.nextStep}this.parent=t,this.close(!0,!0)},o.prototype.close=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0),this._portalHost.dispose(),this.show=!1,this.parent&&this.parent.hide(t,e)},o.decorators=[{type:e.Component,args:[{selector:"walkthrough-container",styles:[":host { display: block; position: absolute; z-index: 1; top: 0; left: 0; width: 99.9%; min-height: 100%; } :host.hide { display: none; } :host.cursor { cursor: pointer; } :host.backdrop { background-color: rgba(0, 0, 0, 0.6); } button { background: none; border: 0; color: #FFF; } .wkt-zone { position: absolute; } .wkt-zone.hide { display: none; } .wkt-zone.backdrop { box-shadow: 0 0 0 2200px rgba(0, 0, 0, 0.6); } .wkt-zone.glow { box-shadow: 0 0 4px 2px #FFFF66, 0 0 9px 0 #FFFF66, 0 0 36px #FFFF66; } .wkt-zone.clickable { cursor: pointer; } .wkt-zone.highlight { -webkit-animation: highlight .45s 4; animation: highlight .45s 4; } .wkt-container { position: relative; } .wkt-content-block { position: absolute; margin: 1em; padding: 6px; z-index: 1; color: #FFF; min-width: calc(320px - 2em); } .wkt-content-block.hide { display: none; } .wkt-content-block.darken { background-color: rgba(0, 0, 0, 0.6); } .wkt-close + .wkt-content { margin-top: 1.3em; } .wkt-close { position: absolute; right: 1em; cursor: pointer; } .wkt-navigate { display: flex; flex-wrap: wrap; justify-content: center; } .wkt-navigate > button { padding: 6px; font-size: 120%; } .wkt-navigate > button:hover { cursor: pointer; text-decoration: underline; } .wkt-previous-link::before { content: '<< '; } .wkt-next-link::after { content: ' >>'; } span.hide { display: none; } svg { overflow: visible; position: absolute; top: -1px; left: -1px; border: 1px solid transparent; } #wkt-arrow > path { stroke-width: 0; } .wkt-arrow-path { stroke-width: 2px; fill: none; } @-webkit-keyframes highlight { 0% { background-color: none; } 50% { background-color: rgba(255, 255, 255, 0.8); } 100% { background-color: none; } } @keyframes highlight { 0% { background-color: none; } 50% { background-color: rgba(255, 255, 255, 0.8); } 100% { background-color: none; } } @media screen and (min-width: 1920px), screen and (min-height: 1920px) { .wkt-zone.backdrop { box-shadow: 0 0 0 4400px rgba(0, 0, 0, 0.6); } } @media screen and (min-width: 3840px), screen and (min-height: 3840px) { .wkt-zone.backdrop { box-shadow: 0 0 0 8800px rgba(0, 0, 0, 0.6); } } _:default:not(:root:root), .wkt-zone.backdrop { box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.6) !important; } "],template:'<div class="wkt-container"> <div class="wkt-zone" #zone (click)="clickZone($event)" [class.hide]="!hasHighlightZone" [class.backdrop]="hasBackdrop" [class.glow]="hasGlow" [class.clickable]="hasClickable" [class.highlight]="hasHighlight" [style.padding]="marginZone"></div> <div class="wkt-content-block" [class.hide]="hideOther" [class.darken]="contentStyle === \'draken\'" #contentBlock> <button type="button" class="wkt-close" *ngIf="hasCloseButton" (click)="close()">✖</button> <div class="wkt-content"> <p *ngIf="contentText">{{contentText}}</p> <ng-template cdkPortalHost></ng-template> </div> <div class="wkt-navigate" *ngIf="hasPrevious||hasNext||hasFinish"> <button type="button" class="wkt-previous-link" *ngIf="hasPrevious" (click)="previous()">{{text.previous}}</button> <button type="button" class="wkt-next-link" *ngIf="hasNext" (click)="next()">{{text.next}}</button> <button type="button" class="wkt-finish-link" *ngIf="hasFinish" (click)="close(true)">{{text.close}}</button> </div> </div> <span *ngIf="hasArrow" [class.hide]="hideOther"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"> <defs> <marker id="wkt-arrow" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="strokeWidth" orient="auto" markerWidth="10" markerHeight="10"> <polyline points="0,0 10,5 0,10 5,5" stroke-width="0" [attr.fill]="arrowColor || \'#FFF\'" /> </marker> </defs> <path class="wkt-arrow-path" [attr.d]="arrowPath" [attr.stroke]="arrowColor || \'#FFF\'" marker-end="url(#wkt-arrow)" /> </svg> </span> </div>'}]}],o.ctorParameters=function(){return[{type:e.ViewContainerRef},{type:y},{type:e.Renderer2},{type:e.ElementRef}]},o.propDecorators={_portalHost:[{type:e.ViewChild,args:[g]}],content:[{type:e.ViewChild,args:["content"]}],contentBlock:[{type:e.ViewChild,args:["contentBlock"]}],zone:[{type:e.ViewChild,args:["zone"]}],id:[{type:e.HostBinding,args:["attr.id"]}],hide:[{type:e.HostBinding,args:["class.hide"]}],cursor:[{type:e.HostBinding,args:["class.cursor"]}],backdrop:[{type:e.HostBinding,args:["class.backdrop"]}],click:[{type:e.HostListener,args:["click"]}]},o}(f),C=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},P=0,x=function(){function t(t,o,n,i,s){this._componentFactoryResolver=t,this._applicationRef=o,this._injector=n,this._renderer=i,this._walkthroughService=s,this.closed=new e.EventEmitter,this.finished=new e.EventEmitter,this.ready=new e.EventEmitter,this.focusElementCSSClass=void 0,this.typeSelector="element",this.contentStyle="draken",this.animation="none",this.animationDelays=0,this._uid="walkthrough-"+P++,this._readyHasBeenEmited=!1,this._display=!1,this._hasHighlightAnimation=!1,this._hasBackdrop=!1,this._hasGlow=!1,this._hasFinish=!1,this._hasArrow=!1,this._hasCloseButton=!1,this._hasCloseAnywhere=!0,this._disabled=!1,this._marginZonePx=new r,this._alignContent="left",this._verticalAlignContent="top",this._contentSpacing=0,this._verticalContentSpacing=50}return Object.defineProperty(t.prototype,"marginZone",{get:function(){return this._marginZone},set:function(t){this._marginZone!==t&&(null===t&&(this._marginZone=null),this._marginZonePx=r.parsePoints(t),null!==this._marginZonePx&&(this._marginZone=t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"arrowColor",{get:function(){return this._arrowColor},set:function(t){this._arrowColor!==t&&(this._arrowColor=t,this._getInstance()&&(this._getInstance().arrowColor=this._arrowColor))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t||this._uid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alignContent",{get:function(){return this._alignContent},set:function(t){this._alignContent!==t?(this._alignContent=t,this._updateElementPositions(this._getInstance())):this._alignContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"verticalAlignContent",{get:function(){return this._verticalAlignContent},set:function(t){this._verticalAlignContent!==t?(this._verticalAlignContent=t,this._updateElementPositions(this._getInstance())):this._verticalAlignContent=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentSpacing",{get:function(){return this._contentSpacing},set:function(e){e=Math.max(t.minimalMargin,e),this._contentSpacing!==e?(this._contentSpacing=1*e,this._updateElementPositions(this._getInstance())):this._contentSpacing=1*e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"verticalContentSpacing",{get:function(){return this._verticalContentSpacing},set:function(e){e=Math.max(t.minimalMargin,e),this._verticalContentSpacing!==e?(this._verticalContentSpacing=1*e,this._updateElementPositions(this._getInstance())):this._verticalContentSpacing=1*e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closeButton",{get:function(){return this._hasCloseButton},set:function(t){this._hasCloseButton=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"closeAnywhere",{get:function(){return this._hasCloseAnywhere},set:function(t){this._hasCloseAnywhere=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showArrow",{get:function(){return this._hasArrow},set:function(t){this._hasArrow=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"finishButton",{get:function(){return this._hasFinish},set:function(t){this._hasFinish=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focusHighlightAnimation",{get:function(){return this._hasHighlightAnimation},set:function(t){this._hasHighlightAnimation=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focusBackdrop",{get:function(){return this._hasBackdrop},set:function(t){this._hasBackdrop=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focusGlow",{get:function(){return this._hasGlow},set:function(t){this._hasGlow=n(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){var e=this;this._disabled=t;var o=this._getInstance();o&&setTimeout(function(){o.hasPrevious=e._hasPreviousStep(o),o.hasNext=e._hasNextStep(o),o.hasNext?o.hasFinish=o.parent.finishButton:o.hasFinish=!0},50)},enumerable:!0,configurable:!0}),t.walkthroughStop=function(){t._walkthroughContainer&&t._walkthroughContainer.instance.stop()},t.walkthroughHasShow=function(){return!!t._walkthroughContainer&&t._walkthroughContainer.instance.show},t.walkthroughHasPause=function(){return!!t._walkthroughContainer&&t._walkthroughContainer.instance.pause},t.walkthroughContinue=function(){t._walkthroughContainer&&t._walkthroughContainer.instance.continue(!0)},t.walkthroughNext=function(){t._walkthroughContainer&&t._walkthroughContainer.instance.next()},t.walkthroughPrevious=function(){t._walkthroughContainer&&t._walkthroughContainer.instance.previous()},t.prototype.resize=function(){t._walkthroughContainer&&this._display&&!t.walkthroughHasPause()&&this._elementLocations()},t.prototype.ngAfterViewInit=function(){var e=this;t._walkthroughContainer||t._walkthroughContainerCreating||(t._walkthroughContainerCreating=!0,setTimeout(function(){t._walkthroughContainer=e._appendComponentToBody(k)},0))},t.prototype.next=function(t,e){void 0===t&&(t=void 0),void 0===e&&(e=void 0),t&&(this.closed=t),e&&(this.finished=e),this.open()},t.prototype.refresh=function(){this._getInstance().pause||this._elementLocations()},t.prototype.open=function(){this._getInstance().pause?console.warn("Another walkthrough is in pause. Please close it before."):this._elementLocations()},t.prototype.loadPrevioustStep=function(){var t=this;setTimeout(function(){t.previousStep._next(t.closed,t.finished)},0)},t.prototype.loadNextStep=function(){var t=this;setTimeout(function(){t.nextStep._next(t.closed,t.finished)},0)},t.prototype.hide=function(t,e){var o=this;void 0===t&&(t=!1),void 0===e&&(e=!0),this._display=!1,this.focusElementCSSClass&&this._renderer.removeClass(this._focusElement,this.focusElementCSSClass),e&&setTimeout(function(){o.closed.emit(t),o.nextStep||o.finished.emit(new i(o,o._focusElement))},20)},t.prototype._show=function(){this._display=!0},t.prototype._next=function(t,e){void 0===t&&(t=void 0),void 0===e&&(e=void 0),t&&(this.closed=t),e&&(this.finished=e),this.open()},t.prototype._getInstance=function(){return t._walkthroughContainer?t._walkthroughContainer.instance:null},t.prototype._appendComponentToBody=function(t){var e=this._componentFactoryResolver.resolveComponentFactory(t).create(this._injector);this._applicationRef.attachView(e.hostView);var o=e.hostView.rootNodes[0];return document.body.appendChild(o),e},t.prototype._attachWalkthroughContent=function(t,o){if(t instanceof e.TemplateRef)o.attachTemplatePortal(new u(t,null));else{var n=new WeakMap;n.set(k,o);var i=new w(this._injector,n);o.attachComponentPortal(new p(t,void 0,i))}},t.prototype._elementLocations=function(){this._getFocusElement();var t=this._focusElement;if(t){if(this._walkthroughService.scrollIntoViewIfOutOfView(t),this._offsetCoordinates=this._walkthroughService.retrieveCoordinates(t,this._marginZonePx),"zone"===this.typeSelector){var e=this._walkthroughService.retrieveCoordinates(this._focusElementEnd,this._marginZonePx);this._offsetCoordinates.height=e.top-this._offsetCoordinates.top+e.height,this._offsetCoordinates.width=e.left-this._offsetCoordinates.left+e.width}}else this._offsetCoordinates=null;this._setFocus()},t.prototype._getFocusElement=function(){var t=this.focusElementSelector?document.querySelectorAll(this.focusElementSelector):null;if(t&&t.length>0)if(t.length>1){for(var e=t.length,o=0;o<e;o++)if(t[o].offsetHeight){this._focusElement=t[o],o=t.length;break}if("zone"===this.typeSelector){for(o=e-1;o>=0;o--)if(t[o].offsetHeight){this._focusElementEnd=t[o],o=t.length;break}this._focusElement===this._focusElementEnd&&(this.typeSelector="element")}}else this._focusElement=t[0],this.typeSelector="element";else this._focusElement=null},t.prototype._setFocus=function(){var t=this,e=this._getInstance();if(e){var o=window.pageXOffset;this._initStylingTemplate(e),setTimeout(function(){t._focusElement&&e.zone?e.hightlightZone(t._offsetCoordinates,o-window.pageXOffset,t.animation,t.animationDelays,t._setFocusContinue.bind(t)):t._setFocusContinue()},20)}},t.prototype._setFocusContinue=function(){var t=this,e=this._getInstance();this._display||(this._attachContentTemplate(),this._initContentTemplate(e)),setTimeout(function(){e.hightlightZoneStyling(t._focusElement),t._updateElementPositions(e)},0)},t.prototype._updateElementPositions=function(e){var o=this;t._walkthroughContainer&&this._getInstance()&&setTimeout(function(){e.contentBlockPosition(o._offsetCoordinates,o._alignContent,o._verticalAlignContent,o._contentSpacing,o._verticalContentSpacing),null!==o._focusElement&&o._hasArrow&&e.arrowPosition(o._offsetCoordinates,o._verticalContentSpacing),o.focusElementCSSClass&&o._renderer.addClass(o._focusElement,o.focusElementCSSClass),setTimeout(function(){o._getInstance().setHeight(),o._readyHasBeenEmited||(o._readyHasBeenEmited=!0,o.ready.emit(new i(o,o._focusElement)));var n,r=e.contentBlock.nativeElement;if(null!=o._focusElement){var s=o._walkthroughService.retrieveCoordinates(r),a=o._walkthroughService.retrieveCoordinates(o._focusElement);s.height+a.height>window.innerHeight?(r.scrollIntoView(!0),n=s.top>a.top?-s.height/2:+s.height/2):s.top>a.top?(window.scrollTo(a.left,a.top),n=-t.minimalMargin):(r.scrollIntoView(!0),n=-t.minimalMargin)}else r.scrollIntoView(!0),n=-t.minimalMargin;window.scrollBy(0,n)},50)},0)},t.prototype._attachContentTemplate=function(){this.contentTemplate&&this._attachWalkthroughContent(this.contentTemplate,this._getInstance())},t.prototype._initStylingTemplate=function(t){var e=null!==this._focusElement;t.parent=this,t.open(),t.hasHighlightZone=e,t.hasClickable=e&&"function"==typeof this.focusClick,t.hasHighlight=e&&this._hasHighlightAnimation,t.hasBackdrop=this._hasBackdrop,t.hasGlow=e&&this._hasGlow},t.prototype._initContentTemplate=function(t){var e=null!==this._focusElement;t.hasPrevious=this._hasPreviousStep(t),t.hasNext=this._hasNextStep(t),t.hasCloseButton=this._hasCloseButton,t.hasCloseAnywhere=this._hasCloseAnywhere,t.hasFinish=this._hasFinish||!t.hasNext,t.hasArrow=e&&this._hasArrow,t.arrowColor=this.arrowColor,t.radius=this.radius,t.marginZone=this._marginZone?this._marginZone.replace(/(\d+)/g,"$1px"):null,t.marginZonePx=this._marginZonePx,t.contentText=this.contentText,t.contentStyle=this.contentStyle,t.text=this.texts?C({},new _,this.texts):new _,this._show()},t.prototype._hasPreviousStep=function(t){if(t.parent)for(var e=t.parent.previousStep;e;){if(!e.disabled)return!0;e=e.previousStep}return!1},t.prototype._hasNextStep=function(t){if(t.parent)for(var e=t.parent.nextStep;e;){if(!e.disabled)return!0;e=e.nextStep}return!1},t._walkthroughContainer=null,t._walkthroughContainerCreating=!1,t.minimalMargin=30,t.decorators=[{type:e.Component,args:[{selector:"ng-walkthrough",template:""}]}],t.ctorParameters=function(){return[{type:e.ComponentFactoryResolver},{type:e.ApplicationRef},{type:e.Injector},{type:e.Renderer2},{type:y}]},t.propDecorators={closed:[{type:e.Output}],finished:[{type:e.Output}],ready:[{type:e.Output}],focusElementCSSClass:[{type:e.Input}],focusElementSelector:[{type:e.Input}],typeSelector:[{type:e.Input}],focusClick:[{type:e.Input}],radius:[{type:e.Input}],previousStep:[{type:e.Input}],nextStep:[{type:e.Input}],texts:[{type:e.Input}],contentTemplate:[{type:e.Input}],contentText:[{type:e.Input}],contentStyle:[{type:e.Input}],marginZone:[{type:e.Input}],arrowColor:[{type:e.Input}],animation:[{type:e.Input}],animationDelays:[{type:e.Input}],id:[{type:e.Input}],alignContent:[{type:e.Input}],verticalAlignContent:[{type:e.Input}],contentSpacing:[{type:e.Input}],verticalContentSpacing:[{type:e.Input}],closeButton:[{type:e.Input}],closeAnywhere:[{type:e.Input}],showArrow:[{type:e.Input}],finishButton:[{type:e.Input}],focusHighlightAnimation:[{type:e.Input}],focusBackdrop:[{type:e.Input}],focusGlow:[{type:e.Input}],disabled:[{type:e.Input}],resize:[{type:e.HostListener,args:["window:resize"]}]},t}(),S=0,I=function(){function t(){this.closed=new e.EventEmitter,this.finished=new e.EventEmitter,this.contentStyle="draken",this.marginZone=null,this._uid="walkthrough-flow-"+S++}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},set:function(t){this._id=t||this._uid},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;setTimeout(function(){t.init()},0)},t.prototype.init=function(){var t=this,e=null;this.walkthroughComponents.forEach(function(o){e&&(o.previousStep=e,e.nextStep=o),e=o,t.closed&&(o.closed=t.closed),t.finished&&(o.finished=t.finished),!o.contentStyle&&t.contentStyle&&(o.contentStyle=t.contentStyle),!o.arrowColor&&t.arrowColor&&(o.arrowColor=t.arrowColor),!o.marginZone&&t.marginZone&&(o.marginZone=t.marginZone),!o.showArrow&&n(t.showArrow)&&(o.showArrow=t.showArrow),!o.closeButton&&n(t.closeButton)&&(o.closeButton=t.closeButton),o.closeAnywhere&&!n(t.closeAnywhere)&&(o.closeAnywhere=t.closeAnywhere),!o.finishButton&&n(t.finishButton)&&(o.finishButton=t.finishButton),!o.focusBackdrop&&n(t.focusBackdrop)&&(o.focusBackdrop=t.focusBackdrop),!o.focusGlow&&n(t.focusGlow)&&(o.focusGlow=t.focusGlow),!o.radius&&t.radius&&(o.radius=t.radius),!o.texts&&t.texts&&(o.texts=t.texts)}),e.finishButton=!0},t.prototype.start=function(){this.walkthroughComponents.first.open()},t.decorators=[{type:e.Component,args:[{selector:"ng-walkthrough-flow",template:""}]}],t.ctorParameters=function(){return[]},t.propDecorators={walkthroughComponents:[{type:e.ContentChildren,args:[x]}],id:[{type:e.Input}],closed:[{type:e.Output}],finished:[{type:e.Output}],contentStyle:[{type:e.Input}],arrowColor:[{type:e.Input}],marginZone:[{type:e.Input}],showArrow:[{type:e.Input}],closeButton:[{type:e.Input}],closeAnywhere:[{type:e.Input}],finishButton:[{type:e.Input}],focusBackdrop:[{type:e.Input}],focusGlow:[{type:e.Input}],radius:[{type:e.Input}],texts:[{type:e.Input}]},t}(),E=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:e.NgModule,args:[{declarations:[I,x,k],exports:[I,x,k],imports:[o.CommonModule,m],entryComponents:[k],providers:[y]}]}],t.ctorParameters=function(){return[]},t}();t.booleanValue=n,t.WalkthroughEvent=i,t.WalkthroughMargin=r,t.WalkthroughComponent=x,t.WalkthroughFlowComponent=I,t.throwWalkthroughContentAlreadyAttachedError=b,t.WalkthroughContainerComponent=k,t.WalkthroughText=_,t.WalkthroughModule=E,t.ɵa=y,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=angular-walkthrough.umd.min.js.map |
{ | ||
"name": "angular-walkthrough", | ||
"version": "0.6.14", | ||
"version": "0.6.15", | ||
"description": "Walkthrough, an Angular library", | ||
@@ -100,2 +100,2 @@ "baseUrl": "./", | ||
"homepage": "https://github.com/Zefling/ng-walkthrough#readme" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
927707
8584