UNPKG

igot-cb-tour-guide

Version:
1 lines 65.1 kB
{"version":3,"file":"igot-cb-tour-guide.mjs","sources":["../../../projects/ngx-guided-tour/src/lib/guided-tour.constants.ts","../../../projects/ngx-guided-tour/src/lib/windowref.service.ts","../../../projects/ngx-guided-tour/src/lib/guided-tour.service.ts","../../../projects/ngx-guided-tour/src/lib/guided-tour.component.ts","../../../projects/ngx-guided-tour/src/lib/guided-tour.component.html","../../../projects/ngx-guided-tour/src/lib/guided-tour.module.ts","../../../projects/ngx-guided-tour/src/public_api.ts","../../../projects/ngx-guided-tour/src/igot-cb-tour-guide.ts"],"sourcesContent":["\nexport interface TourStep {\n icon?: string,\n connectorDirection?: string,\n nextBtnClass?: string,\n backBtnClass?: string,\n skipBtnClass?: string,\n containerClass?: string,\n isMobile?: boolean;\n class?: string,\n /** Selector for element that will be highlighted */\n selector?: string;\n /** Tour title text */\n title?: string;\n /** Tour step text */\n content: string;\n /** Where the tour step will appear next to the selected element */\n orientation?: Orientation | OrientationConfiguration[];\n /** Action that happens when the step is opened */\n action?: () => void;\n /** Action that happens when the step is closed */\n closeAction?: () => void;\n /** Skips this step, this is so you do not have create multiple tour configurations based on user settings/configuration */\n skipStep?: boolean;\n /** Adds some padding for things like sticky headers when scrolling to an element */\n scrollAdjustment?: number;\n /** Adds default padding around tour highlighting. Does not need to be true for highlightPadding to work */\n useHighlightPadding?: boolean;\n /** Adds padding around tour highlighting in pixels, this overwrites the default for this step. Is not dependent on useHighlightPadding being true */\n highlightPadding?: number;\n}\n\nexport interface GuidedTour {\n /** Identifier for tour */\n tourId: string;\n /** Use orb to start tour */\n useOrb?: boolean;\n /** Steps fo the tour */\n steps: TourStep[];\n nextCallback?: (currentStep: number, stepObject: object) => void;\n prevCallback?: (currentStep: number, stepObject: object) => void;\n /** Function will be called when tour is skipped */\n skipCallback?: (stepSkippedOn: number) => void;\n /** Function will be called when tour is completed */\n completeCallback?: () => void;\n /** Minimum size of screen in pixels before the tour is run, if the tour is resized below this value the user will be told to resize */\n minimumScreenSize?: number;\n /** Dialog shown if the window width is smaller than the defined minimum screen size. */\n resizeDialog?: {\n /** Resize dialog title text */\n title?: string;\n /** Resize dialog text */\n content: string;\n }\n /**\n * Prevents the tour from advancing by clicking the backdrop.\n * This should only be set if you are completely sure your tour is displaying correctly on all screen sizes otherwise a user can get stuck.\n */\n preventBackdropFromAdvancing?: boolean;\n}\n\nexport interface OrientationConfiguration {\n /** Where the tour step will appear next to the selected element */\n orientationDirection: Orientation;\n /** When this orientation configuration starts in pixels */\n maximumSize?: number;\n}\n\nexport class Orientation {\n public static readonly Bottom = 'bottom';\n public static readonly BottomLeft = 'bottom-left';\n public static readonly BottomRight = 'bottom-right';\n public static readonly Center = 'center';\n public static readonly Left = 'left';\n public static readonly Right = 'right';\n public static readonly Top = 'top';\n public static readonly TopLeft = 'top-left';\n public static readonly TopRight = 'top-right';\n}\n\nexport enum ProgressIndicatorLocation {\n InsideNextButton = 'inside-next-button',\n TopOfTourBlock = 'top-of-tour-block',\n None = 'none',\n Dots = 'dots'\n} \n","import { Inject, Injectable, PLATFORM_ID } from \"@angular/core\";\nimport { isPlatformBrowser } from \"@angular/common\";\n\nfunction getWindow(): any {\n return window;\n}\n\nfunction getMockWindow(): any {\n return {\n innerWidth: 0,\n innerHeight: 0,\n scrollY: 0,\n scrollX: 0,\n pageYOffset: 0,\n pageXOffset: 0,\n scroll: () => {},\n scrollTo: () => {},\n addEventListener: () => {},\n removeEventListener: () => {},\n }\n}\n\n@Injectable()\nexport class WindowRefService {\n private readonly isBrowser: boolean = false;\n\n get nativeWindow(): any {\n if (this.isBrowser) {\n return getWindow();\n } else {\n return getMockWindow();\n }\n }\n\n constructor(@Inject(PLATFORM_ID) platformId) {\n this.isBrowser = isPlatformBrowser(platformId);\n }\n}\n","import { debounceTime } from 'rxjs/operators';\nimport { ErrorHandler, Inject, Injectable } from '@angular/core';\nimport { Observable, Subject, fromEvent } from 'rxjs';\nimport { GuidedTour, TourStep, Orientation, OrientationConfiguration } from './guided-tour.constants';\nimport { cloneDeep } from 'lodash';\nimport { DOCUMENT } from \"@angular/common\";\nimport { WindowRefService } from \"./windowref.service\";\n\n@Injectable()\nexport class GuidedTourService {\n public guidedTourCurrentStepStream: Observable<TourStep>;\n public guidedTourOrbShowingStream: Observable<boolean>;\n\n private _guidedTourCurrentStepSubject = new Subject<TourStep>();\n private _guidedTourOrbShowingSubject = new Subject<boolean>();\n private _currentTourStepIndex = 0;\n private _currentTour: GuidedTour = null;\n private _onFirstStep = true;\n private _onLastStep = true;\n private _onResizeMessage = false;\n\n constructor(\n public errorHandler: ErrorHandler,\n private windowRef: WindowRefService,\n @Inject(DOCUMENT) private dom\n ) {\n this.guidedTourCurrentStepStream = this._guidedTourCurrentStepSubject.asObservable();\n this.guidedTourOrbShowingStream = this._guidedTourOrbShowingSubject.asObservable();\n\n fromEvent(this.windowRef.nativeWindow, 'resize').pipe(debounceTime(200)).subscribe(() => {\n if (this._currentTour && this._currentTourStepIndex > -1) {\n if (this._currentTour.minimumScreenSize && this._currentTour.minimumScreenSize >= this.windowRef.nativeWindow.innerWidth) {\n this._onResizeMessage = true;\n const dialog = this._currentTour.resizeDialog || {\n title: 'Please resize',\n content: 'You have resized the tour to a size that is too small to continue. Please resize the browser to a larger size to continue the tour or close the tour.'\n };\n\n this._guidedTourCurrentStepSubject.next(dialog);\n } else {\n this._onResizeMessage = false;\n this._guidedTourCurrentStepSubject.next(this.getPreparedTourStep(this._currentTourStepIndex));\n }\n }\n });\n }\n\n public nextStep(): void {\n if (this._currentTour.steps[this._currentTourStepIndex].closeAction) {\n this._currentTour.steps[this._currentTourStepIndex].closeAction();\n }\n if (this._currentTour.steps[this._currentTourStepIndex + 1]) {\n this._currentTourStepIndex++;\n this._setFirstAndLast();\n if (this._currentTour.steps[this._currentTourStepIndex].action) {\n this._currentTour.steps[this._currentTourStepIndex].action();\n // Usually an action is opening something so we need to give it time to render.\n setTimeout(() => {\n if (this._checkSelectorValidity()) {\n this._guidedTourCurrentStepSubject.next(this.getPreparedTourStep(this._currentTourStepIndex));\n } else {\n this.nextStep();\n }\n });\n } else {\n if (this._checkSelectorValidity()) {\n this._guidedTourCurrentStepSubject.next(this.getPreparedTourStep(this._currentTourStepIndex));\n } else {\n this.nextStep();\n }\n }\n if (this._currentTour.nextCallback) {\n this._currentTour.nextCallback(this._currentTourStepIndex, this._currentTour.steps[this._currentTourStepIndex]);\n }\n } else {\n if (this._currentTour.completeCallback) {\n this._currentTour.completeCallback();\n }\n this.resetTour();\n }\n }\n\n public backStep(): void {\n if (this._currentTour.steps[this._currentTourStepIndex].closeAction) {\n this._currentTour.steps[this._currentTourStepIndex].closeAction();\n }\n if (this._currentTour.steps[this._currentTourStepIndex - 1]) {\n this._currentTourStepIndex--;\n this._setFirstAndLast();\n if (this._currentTour.steps[this._currentTourStepIndex].action) {\n this._currentTour.steps[this._currentTourStepIndex].action();\n setTimeout(() => {\n if (this._checkSelectorValidity()) {\n this._guidedTourCurrentStepSubject.next(this.getPreparedTourStep(this._currentTourStepIndex));\n } else {\n this.backStep();\n }\n });\n } else {\n if (this._checkSelectorValidity()) {\n this._guidedTourCurrentStepSubject.next(this.getPreparedTourStep(this._currentTourStepIndex));\n } else {\n this.backStep();\n }\n }\n if (this._currentTour.nextCallback) {\n this._currentTour.prevCallback(this._currentTourStepIndex, this._currentTour.steps[this._currentTourStepIndex]);\n }\n } else {\n this.resetTour();\n }\n }\n\n public skipTour(): void {\n if (this._currentTour.skipCallback) {\n this._currentTour.skipCallback(this._currentTourStepIndex);\n }\n this.resetTour();\n }\n\n public resetTour(): void {\n this.dom.body.classList.remove('tour-open');\n this._currentTour = null;\n this._currentTourStepIndex = 0;\n this._guidedTourCurrentStepSubject.next(null);\n }\n\n public startTour(tour: GuidedTour): void {\n this._currentTour = cloneDeep(tour);\n this._currentTour.steps = this._currentTour.steps.filter(step => !step.skipStep);\n this._currentTourStepIndex = 0;\n this._setFirstAndLast();\n this._guidedTourOrbShowingSubject.next(this._currentTour.useOrb);\n if (\n this._currentTour.steps.length > 0\n && (!this._currentTour.minimumScreenSize\n || (this.windowRef.nativeWindow.innerWidth >= this._currentTour.minimumScreenSize))\n ) {\n if (!this._currentTour.useOrb) {\n this.dom.body.classList.add('tour-open');\n }\n if (this._currentTour.steps[this._currentTourStepIndex].action) {\n this._currentTour.steps[this._currentTourStepIndex].action();\n }\n if (this._checkSelectorValidity()) {\n this._guidedTourCurrentStepSubject.next(this.getPreparedTourStep(this._currentTourStepIndex));\n } else {\n this.nextStep();\n }\n }\n }\n\n public activateOrb(): void {\n this._guidedTourOrbShowingSubject.next(false);\n this.dom.body.classList.add('tour-open');\n }\n\n private _setFirstAndLast(): void {\n this._onLastStep = (this._currentTour.steps.length - 1) === this._currentTourStepIndex;\n this._onFirstStep = this._currentTourStepIndex === 0;\n }\n\n private _checkSelectorValidity(): boolean {\n if (this._currentTour.steps[this._currentTourStepIndex].selector) {\n const selectedElement = this.dom.querySelector(this._currentTour.steps[this._currentTourStepIndex].selector);\n if (!selectedElement) {\n this.errorHandler.handleError(\n // If error handler is configured this should not block the browser.\n new Error(`Error finding selector ${this._currentTour.steps[this._currentTourStepIndex].selector} on step ${this._currentTourStepIndex + 1} during guided tour: ${this._currentTour.tourId}`)\n );\n return false;\n }\n }\n return true;\n }\n\n public get onLastStep(): boolean {\n return this._onLastStep;\n }\n\n public get onFirstStep(): boolean {\n return this._onFirstStep;\n }\n\n public get onResizeMessage(): boolean {\n return this._onResizeMessage;\n }\n\n public get currentTourStepDisplay(): number {\n return this._currentTourStepIndex + 1;\n }\n\n public get currentTourStepCount(): number {\n return this._currentTour && this._currentTour.steps ? this._currentTour.steps.length : 0;\n }\n\n public get preventBackdropFromAdvancing(): boolean {\n return this._currentTour && this._currentTour.preventBackdropFromAdvancing;\n }\n\n private getPreparedTourStep(index: number): TourStep {\n return this.setTourOrientation(this._currentTour.steps[index]);\n }\n\n private setTourOrientation(step: TourStep): TourStep {\n const convertedStep = cloneDeep(step);\n if (\n convertedStep.orientation\n && !(typeof convertedStep.orientation === 'string')\n && (convertedStep.orientation as OrientationConfiguration[]).length\n ) {\n (convertedStep.orientation as OrientationConfiguration[]).sort((a: OrientationConfiguration, b: OrientationConfiguration) => {\n if (!b.maximumSize) {\n return 1;\n }\n if (!a.maximumSize) {\n return -1;\n }\n return b.maximumSize - a.maximumSize;\n });\n\n let currentOrientation: Orientation = Orientation.Top;\n (convertedStep.orientation as OrientationConfiguration[]).forEach(\n (orientationConfig: OrientationConfiguration) => {\n if (!orientationConfig.maximumSize || this.windowRef.nativeWindow.innerWidth <= orientationConfig.maximumSize) {\n currentOrientation = orientationConfig.orientationDirection;\n }\n }\n );\n\n convertedStep.orientation = currentOrientation;\n }\n return convertedStep;\n }\n}\n","import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild, ViewEncapsulation, TemplateRef, Inject } from '@angular/core';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { DOCUMENT } from '@angular/common';\nimport { Orientation, TourStep, ProgressIndicatorLocation } from './guided-tour.constants';\nimport { GuidedTourService } from './guided-tour.service';\nimport { WindowRefService } from \"./windowref.service\";\n\n@Component({\n selector: 'ngx-guided-tour',\n templateUrl: './guided-tour.component.html',\n styleUrls: ['./guided-tour.component.scss'],\n encapsulation: ViewEncapsulation.None\n})\nexport class GuidedTourComponent implements AfterViewInit, OnDestroy {\n @Input() public topOfPageAdjustment?= 0;\n @Input() public tourStepWidth?= 300;\n @Input() public minimalTourStepWidth?= 200;\n @Input() public skipText?= 'Skip';\n @Input() public nextText?= 'Next';\n @Input() public doneText?= 'Done';\n @Input() public closeText?= 'Close';\n @Input() public backText?= 'Back';\n @Input() public progressIndicatorLocation?: ProgressIndicatorLocation = ProgressIndicatorLocation.InsideNextButton;\n @Input() public progressIndicator?: TemplateRef<any> = undefined;\n @ViewChild('tourStep', { static: false }) public tourStep: ElementRef;\n public highlightPadding = 4;\n public currentTourStep: TourStep = null;\n public selectedElementRect: DOMRect = null;\n public isOrbShowing = false;\n public progressIndicatorLocations = ProgressIndicatorLocation;\n\n private resizeSubscription: Subscription;\n private scrollSubscription: Subscription;\n\n constructor(\n public guidedTourService: GuidedTourService,\n private windowRef: WindowRefService,\n @Inject(DOCUMENT) private dom: any\n ) { }\n\n private get maxWidthAdjustmentForTourStep(): number {\n return this.tourStepWidth - this.minimalTourStepWidth;\n }\n\n private get widthAdjustmentForScreenBound(): number {\n if (!this.tourStep) {\n return 0;\n }\n let adjustment = 0;\n if (this.calculatedLeftPosition < 0) {\n adjustment = -this.calculatedLeftPosition;\n }\n if (this.calculatedLeftPosition > this.windowRef.nativeWindow.innerWidth - this.tourStepWidth) {\n adjustment = this.calculatedLeftPosition - (this.windowRef.nativeWindow.innerWidth - this.tourStepWidth);\n }\n\n return Math.min(this.maxWidthAdjustmentForTourStep, adjustment);\n }\n\n public get calculatedTourStepWidth() {\n return this.tourStepWidth - this.widthAdjustmentForScreenBound;\n }\n\n public ngAfterViewInit(): void {\n this.guidedTourService.guidedTourCurrentStepStream.subscribe((step: TourStep) => {\n this.currentTourStep = step;\n if (step && step.selector) {\n const selectedElement = this.dom.querySelector(step.selector);\n if (selectedElement) {\n this.scrollToAndSetElement();\n } else {\n this.selectedElementRect = null;\n }\n } else {\n this.selectedElementRect = null;\n }\n });\n\n this.guidedTourService.guidedTourOrbShowingStream.subscribe((value: boolean) => {\n this.isOrbShowing = value;\n });\n\n this.resizeSubscription = fromEvent(this.windowRef.nativeWindow, 'resize').subscribe(() => {\n this.updateStepLocation();\n });\n\n this.scrollSubscription = fromEvent(this.windowRef.nativeWindow, 'scroll').subscribe(() => {\n this.updateStepLocation();\n });\n }\n\n public ngOnDestroy(): void {\n this.resizeSubscription.unsubscribe();\n this.scrollSubscription.unsubscribe();\n }\n\n public scrollToAndSetElement(): void {\n this.updateStepLocation();\n // Allow things to render to scroll to the correct location\n setTimeout(() => {\n if (!this.isOrbShowing && !this.isTourOnScreen()) {\n if (this.selectedElementRect && this.isBottom()) {\n // Scroll so the element is on the top of the screen.\n const topPos = ((this.windowRef.nativeWindow.scrollY + this.selectedElementRect.top) - this.topOfPageAdjustment)\n - (this.currentTourStep.scrollAdjustment ? this.currentTourStep.scrollAdjustment : 0)\n + this.getStepScreenAdjustment();\n try {\n this.windowRef.nativeWindow.scrollTo({\n left: null,\n top: topPos,\n behavior: 'smooth'\n });\n } catch (err) {\n if (err instanceof TypeError) {\n this.windowRef.nativeWindow.scroll(0, topPos);\n } else {\n throw err;\n }\n }\n } else {\n // Scroll so the element is on the bottom of the screen.\n const topPos = (this.windowRef.nativeWindow.scrollY + this.selectedElementRect.top + this.selectedElementRect.height)\n - this.windowRef.nativeWindow.innerHeight\n + (this.currentTourStep.scrollAdjustment ? this.currentTourStep.scrollAdjustment : 0)\n - this.getStepScreenAdjustment();\n try {\n this.windowRef.nativeWindow.scrollTo({\n left: null,\n top: topPos,\n behavior: 'smooth'\n });\n } catch (err) {\n if (err instanceof TypeError) {\n this.windowRef.nativeWindow.scroll(0, topPos);\n } else {\n throw err;\n }\n }\n }\n }\n });\n }\n\n public handleOrb(): void {\n this.guidedTourService.activateOrb();\n if (this.currentTourStep && this.currentTourStep.selector) {\n this.scrollToAndSetElement();\n }\n }\n\n private isTourOnScreen(): boolean {\n return this.tourStep\n && this.elementInViewport(this.dom.querySelector(this.currentTourStep.selector))\n && this.elementInViewport(this.tourStep.nativeElement);\n }\n\n // Modified from https://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport\n private elementInViewport(element: HTMLElement): boolean {\n let top = element.offsetTop;\n const height = element.offsetHeight;\n\n while (element.offsetParent) {\n element = (element.offsetParent as HTMLElement);\n top += element.offsetTop;\n }\n if (this.isBottom()) {\n return (\n top >= (this.windowRef.nativeWindow.pageYOffset\n + this.topOfPageAdjustment\n + (this.currentTourStep.scrollAdjustment ? this.currentTourStep.scrollAdjustment : 0)\n + this.getStepScreenAdjustment())\n && (top + height) <= (this.windowRef.nativeWindow.pageYOffset + this.windowRef.nativeWindow.innerHeight)\n );\n } else {\n return (\n top >= (this.windowRef.nativeWindow.pageYOffset + this.topOfPageAdjustment - this.getStepScreenAdjustment())\n && (top + height + (this.currentTourStep.scrollAdjustment ? this.currentTourStep.scrollAdjustment : 0)) <= (this.windowRef.nativeWindow.pageYOffset + this.windowRef.nativeWindow.innerHeight)\n );\n }\n }\n\n public backdropClick(event: Event): void {\n if (this.guidedTourService.preventBackdropFromAdvancing) {\n event.stopPropagation();\n } else {\n this.guidedTourService.nextStep();\n }\n }\n\n public updateStepLocation(): void {\n if (this.currentTourStep && this.currentTourStep.selector) {\n const selectedElement = this.dom.querySelector(this.currentTourStep.selector);\n if (selectedElement && typeof selectedElement.getBoundingClientRect === 'function') {\n this.selectedElementRect = (selectedElement.getBoundingClientRect() as DOMRect);\n } else {\n this.selectedElementRect = null;\n }\n } else {\n this.selectedElementRect = null;\n }\n }\n\n private isBottom(): boolean {\n return this.currentTourStep.orientation\n && (this.currentTourStep.orientation === Orientation.Bottom\n || this.currentTourStep.orientation === Orientation.BottomLeft\n || this.currentTourStep.orientation === Orientation.BottomRight);\n }\n\n public get topPosition(): number {\n const paddingAdjustment = this.getHighlightPadding();\n\n if (this.isBottom()) {\n return this.selectedElementRect.top + this.selectedElementRect.height + paddingAdjustment;\n }\n\n return this.selectedElementRect.top - this.getHighlightPadding();\n }\n\n public get orbTopPosition(): number {\n if (this.isBottom()) {\n return this.selectedElementRect.top + this.selectedElementRect.height;\n }\n\n if (\n this.currentTourStep.orientation === Orientation.Right\n || this.currentTourStep.orientation === Orientation.Left\n ) {\n return (this.selectedElementRect.top + (this.selectedElementRect.height / 2));\n }\n\n return this.selectedElementRect.top;\n }\n\n private get calculatedLeftPosition(): number {\n const paddingAdjustment = this.getHighlightPadding();\n\n if (\n this.currentTourStep.orientation === Orientation.TopRight\n || this.currentTourStep.orientation === Orientation.BottomRight\n ) {\n return (this.selectedElementRect.right - this.tourStepWidth);\n }\n\n if (\n this.currentTourStep.orientation === Orientation.TopLeft\n || this.currentTourStep.orientation === Orientation.BottomLeft\n ) {\n return (this.selectedElementRect.left);\n }\n\n if (this.currentTourStep.orientation === Orientation.Left) {\n return this.selectedElementRect.left - this.tourStepWidth - paddingAdjustment;\n }\n\n if (this.currentTourStep.orientation === Orientation.Right) {\n return (this.selectedElementRect.left + this.selectedElementRect.width + paddingAdjustment);\n }\n\n return (this.selectedElementRect.right - (this.selectedElementRect.width / 2) - (this.tourStepWidth / 2));\n }\n\n public get leftPosition(): number {\n if (this.calculatedLeftPosition >= 0) {\n return this.calculatedLeftPosition;\n }\n const adjustment = Math.max(0, -this.calculatedLeftPosition)\n const maxAdjustment = Math.min(this.maxWidthAdjustmentForTourStep, adjustment);\n return this.calculatedLeftPosition + maxAdjustment;\n }\n\n public get orbLeftPosition(): number {\n if (\n this.currentTourStep.orientation === Orientation.TopRight\n || this.currentTourStep.orientation === Orientation.BottomRight\n ) {\n return this.selectedElementRect.right;\n }\n\n if (\n this.currentTourStep.orientation === Orientation.TopLeft\n || this.currentTourStep.orientation === Orientation.BottomLeft\n ) {\n return this.selectedElementRect.left;\n }\n\n if (this.currentTourStep.orientation === Orientation.Left) {\n return this.selectedElementRect.left;\n }\n\n if (this.currentTourStep.orientation === Orientation.Right) {\n return (this.selectedElementRect.left + this.selectedElementRect.width);\n }\n\n return (this.selectedElementRect.right - (this.selectedElementRect.width / 2));\n }\n\n public get transform(): string {\n if (\n !this.currentTourStep.orientation\n || this.currentTourStep.orientation === Orientation.Top\n || this.currentTourStep.orientation === Orientation.TopRight\n || this.currentTourStep.orientation === Orientation.TopLeft\n ) {\n return 'translateY(-100%)';\n }\n return null;\n }\n\n public get orbTransform(): string {\n if (\n !this.currentTourStep.orientation\n || this.currentTourStep.orientation === Orientation.Top\n || this.currentTourStep.orientation === Orientation.Bottom\n || this.currentTourStep.orientation === Orientation.TopLeft\n || this.currentTourStep.orientation === Orientation.BottomLeft\n ) {\n return 'translateY(-50%)';\n }\n\n if (\n this.currentTourStep.orientation === Orientation.TopRight\n || this.currentTourStep.orientation === Orientation.BottomRight\n ) {\n return 'translate(-100%, -50%)';\n }\n\n if (\n this.currentTourStep.orientation === Orientation.Right\n || this.currentTourStep.orientation === Orientation.Left\n ) {\n return 'translate(-50%, -50%)';\n }\n\n return null;\n }\n\n public get overlayTop(): number {\n if (this.selectedElementRect) {\n return this.selectedElementRect.top - this.getHighlightPadding();\n }\n return 0;\n }\n\n public get overlayLeft(): number {\n if (this.selectedElementRect) {\n return this.selectedElementRect.left - this.getHighlightPadding();\n }\n return 0;\n }\n\n public get overlayHeight(): number {\n if (this.selectedElementRect) {\n return this.selectedElementRect.height + (this.getHighlightPadding() * 2);\n }\n return 0;\n }\n\n public get overlayWidth(): number {\n if (this.selectedElementRect) {\n return this.selectedElementRect.width + (this.getHighlightPadding() * 2);\n }\n return 0;\n }\n\n private getHighlightPadding(): number {\n let paddingAdjustment = this.currentTourStep.useHighlightPadding ? this.highlightPadding : 0;\n if (this.currentTourStep.highlightPadding) {\n paddingAdjustment = this.currentTourStep.highlightPadding;\n }\n return paddingAdjustment;\n }\n\n // This calculates a value to add or subtract so the step should not be off screen.\n private getStepScreenAdjustment(): number {\n if (\n this.currentTourStep.orientation === Orientation.Left\n || this.currentTourStep.orientation === Orientation.Right\n ) {\n return 0;\n }\n\n const scrollAdjustment = this.currentTourStep.scrollAdjustment ? this.currentTourStep.scrollAdjustment : 0;\n const tourStepHeight = typeof this.tourStep.nativeElement.getBoundingClientRect === 'function' ? this.tourStep.nativeElement.getBoundingClientRect().height : 0;\n const elementHeight = this.selectedElementRect.height + scrollAdjustment + tourStepHeight;\n\n if ((this.windowRef.nativeWindow.innerHeight - this.topOfPageAdjustment) < elementHeight) {\n return elementHeight - (this.windowRef.nativeWindow.innerHeight - this.topOfPageAdjustment);\n }\n return 0;\n }\n}\n","<div *ngIf=\"currentTourStep && selectedElementRect && isOrbShowing\" (mouseenter)=\"handleOrb()\"\n class=\"tour-orb tour-{{ currentTourStep.orientation }}\" [style.top.px]=\"orbTopPosition\"\n [style.left.px]=\"orbLeftPosition\" [style.transform]=\"orbTransform\">\n <div class=\"tour-orb-ring\"></div>\n</div>\n<div *ngIf=\"currentTourStep && !isOrbShowing\">\n <div class=\"guided-tour-user-input-mask\" (click)=\"backdropClick($event)\"></div>\n <div class=\"\" [attr.class]=\"'guided-tour-spotlight-overlay ' + currentTourStep?.class\" [style.top.px]=\"overlayTop\"\n [style.left.px]=\"overlayLeft\" [style.height.px]=\"overlayHeight\" [style.width.px]=\"overlayWidth\">\n </div>\n</div>\n<div *ngIf=\"currentTourStep && !isOrbShowing\">\n <div #tourStep *ngIf=\"currentTourStep\"\n class=\"tour-step tour-{{ currentTourStep.orientation}} {{currentTourStep?.containerClass}}\" [ngClass]=\"{\n 'page-tour-step': !currentTourStep.selector,\n 'right-panel': currentTourStep.connectorDirection == 'right',\n 'left-panel': currentTourStep.connectorDirection == 'left',\n 'bottom-panel': currentTourStep.connectorDirection == 'bottom',\n 'top-panel': currentTourStep.connectorDirection == 'top'\n }\" [style.top.px]=\"(currentTourStep.selector && selectedElementRect ? topPosition : null)\"\n [style.left.px]=\"(currentTourStep.selector && selectedElementRect ? leftPosition : null)\"\n [style.width.px]=\"(currentTourStep.selector && selectedElementRect ? calculatedTourStepWidth : null)\"\n [style.transform]=\"(currentTourStep.selector && selectedElementRect ? transform : null)\">\n\n <div *ngIf=\"currentTourStep.isMobile && currentTourStep.connectorDirection == 'bottom'\" class=\"tour-buttons tour-button-container\">\n <div class=\"tour-actions-button-container\">\n <button *ngIf=\"!guidedTourService.onFirstStep && !guidedTourService.onResizeMessage\"\n [attr.class]=\"currentTourStep?.backBtnClass + ' back-button'\" (click)=\"guidedTourService.backStep()\">\n {{ backText }}\n </button>\n </div>\n <button *ngIf=\"!guidedTourService.onLastStep && !guidedTourService.onResizeMessage\" class=\"next-button\"\n (click)=\"guidedTourService.nextStep()\">\n {{ nextText }}\n <ng-container *ngIf=\"progressIndicatorLocation === progressIndicatorLocations.InsideNextButton\">\n <ng-container *ngTemplateOutlet=\"progress\"></ng-container>\n </ng-container>\n </button>\n <button *ngIf=\"guidedTourService.onLastStep\" [attr.class]=\"currentTourStep?.nextBtnClass + ' next-button'\"\n (click)=\"guidedTourService.nextStep()\">\n {{ doneText }}\n </button>\n <button *ngIf=\"guidedTourService.onResizeMessage\" class=\"next-button\" (click)=\"guidedTourService.resetTour()\">\n {{ closeText }}\n </button>\n\n </div>\n\n <div *ngIf=\"currentTourStep.selector\" class=\"tour-arrow\"></div>\n <div class=\"tour-block\">\n <div class=\"arrow\" [ngClass]=\"{\n 'right-connector': (currentTourStep.selector && currentTourStep.connectorDirection == 'right'),\n 'left-connector': (currentTourStep.selector && currentTourStep.connectorDirection == 'left'),\n 'bottom-connector': (currentTourStep.selector && currentTourStep.connectorDirection == 'bottom'),\n 'top-connector': (currentTourStep.selector && currentTourStep.connectorDirection == 'top')\n }\">\n <div class=\"circle\"></div>\n <div class=\"circle-start-dot\"></div>\n <div class=\"triangle\"></div>\n </div>\n\n <div *ngIf=\"progressIndicatorLocation === progressIndicatorLocations.TopOfTourBlock\n && !guidedTourService.onResizeMessage\" class=\"tour-progress-indicator\">\n <ng-container *ngTemplateOutlet=\"progress\"></ng-container>\n </div>\n <div class=\"tour-image\" *ngIf=\"currentTourStep.icon && currentTourStep.selector\">\n <mat-icon>{{currentTourStep.icon}}</mat-icon>\n </div>\n <h3 class=\"tour-title\" *ngIf=\"currentTourStep.title && currentTourStep.selector\">\n {{ currentTourStep.title }}\n </h3>\n <h2 class=\"tour-title\" *ngIf=\"currentTourStep.title && !currentTourStep.selector\">\n {{ currentTourStep.title }}\n </h2>\n <div class=\"tour-content\" [innerHTML]=\"currentTourStep.content\"></div>\n <div *ngIf=\"!currentTourStep.isMobile\" class=\"tour-buttons tour-button-container\">\n <!-- <div class=\"tour-skip-container\">\n <button *ngIf=\"!guidedTourService.onResizeMessage\"\n (click)=\"guidedTourService.skipTour()\"\n [attr.class]=\"currentTourStep?.skipBtnClass + ' skip-button link-button'\">\n {{ skipText }}\n </button>\n </div> -->\n <div class=\"tour-actions-button-container\">\n <button *ngIf=\"!guidedTourService.onFirstStep && !guidedTourService.onResizeMessage\"\n [attr.class]=\"currentTourStep?.backBtnClass + ' back-button'\" (click)=\"guidedTourService.backStep()\">\n {{ backText }}\n </button>\n </div>\n <button *ngIf=\"!guidedTourService.onLastStep && !guidedTourService.onResizeMessage\" class=\"next-button\"\n (click)=\"guidedTourService.nextStep()\">\n {{ nextText }}\n <ng-container *ngIf=\"progressIndicatorLocation === progressIndicatorLocations.InsideNextButton\">\n <ng-container *ngTemplateOutlet=\"progress\"></ng-container>\n </ng-container>\n </button>\n <button *ngIf=\"guidedTourService.onLastStep\" [attr.class]=\"currentTourStep?.nextBtnClass + ' next-button'\"\n (click)=\"guidedTourService.nextStep()\">\n {{ doneText }}\n </button>\n <button *ngIf=\"guidedTourService.onResizeMessage\" class=\"next-button\" (click)=\"guidedTourService.resetTour()\">\n {{ closeText }}\n </button>\n\n </div>\n\n\n <div class=\"progress-container\">\n <ng-container *ngIf=\"progressIndicatorLocation === progressIndicatorLocations.Dots\">\n <ng-container *ngTemplateOutlet=\"progress\"></ng-container>\n </ng-container>\n </div>\n\n </div>\n <div *ngIf=\"currentTourStep.isMobile && currentTourStep.connectorDirection != 'bottom'\" class=\"tour-buttons tour-button-container\">\n <div class=\"tour-actions-button-container\">\n <button *ngIf=\"!guidedTourService.onFirstStep && !guidedTourService.onResizeMessage\"\n [attr.class]=\"currentTourStep?.backBtnClass + ' back-button'\" (click)=\"guidedTourService.backStep()\">\n {{ backText }}\n </button>\n </div>\n <button *ngIf=\"!guidedTourService.onLastStep && !guidedTourService.onResizeMessage\" class=\"next-button\"\n (click)=\"guidedTourService.nextStep()\">\n {{ nextText }}\n <ng-container *ngIf=\"progressIndicatorLocation === progressIndicatorLocations.InsideNextButton\">\n <ng-container *ngTemplateOutlet=\"progress\"></ng-container>\n </ng-container>\n </button>\n <button *ngIf=\"guidedTourService.onLastStep\" [attr.class]=\"currentTourStep?.nextBtnClass + ' next-button'\"\n (click)=\"guidedTourService.nextStep()\">\n {{ doneText }}\n </button>\n <button *ngIf=\"guidedTourService.onResizeMessage\" class=\"next-button\" (click)=\"guidedTourService.resetTour()\">\n {{ closeText }}\n </button>\n\n </div>\n </div>\n <ng-template #progress>\n <ng-container *ngTemplateOutlet=\"\n progressIndicator || defaultProgressIndicator; \n context: { currentStepNumber: guidedTourService.currentTourStepDisplay, totalSteps: guidedTourService.currentTourStepCount }\n \"></ng-container>\n </ng-template>\n <ng-template #defaultProgressIndicator let-currentStepNumber=\"currentStepNumber\" let-totalSteps=\"totalSteps\">\n <!-- <ng-container *ngIf=\"progressIndicatorLocation === progressIndicatorLocations.InsideNextButton\">&nbsp;</ng-container>{{ currentStepNumber }}/{{ totalSteps }} -->\n <ng-container *ngIf=\"progressIndicatorLocation === progressIndicatorLocations.Dots\">\n <div class=\"pagination\">\n <li class=\"nav-dots\">\n <ng-container *ngFor=\"let dot of [].constructor(totalSteps); first as isFirst; index as i\">\n <label [ngClass]=\"(currentStepNumber == (i+1)) ? 'nav-dot-active': ''\" class=\"nav-dot\"\n id=\"img-dot-+{{i}}+{{currentStepNumber}}\"></label>\n </ng-container>\n </li>\n </div>\n </ng-container>\n </ng-template>","import { GuidedTourService } from './guided-tour.service';\nimport { GuidedTourComponent } from './guided-tour.component';\nimport { NgModule, ErrorHandler } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { WindowRefService } from './windowref.service';\nimport { MatIconModule } from '@angular/material/icon';\n\n@NgModule({\n declarations: [GuidedTourComponent],\n imports: [CommonModule, MatIconModule],\n providers: [WindowRefService],\n exports: [GuidedTourComponent]\n})\nexport class GuidedTourModule {\n public static forRoot(): any {\n return {\n ngModule: GuidedTourModule,\n providers: [ErrorHandler, GuidedTourService],\n };\n }\n}\n","/*\n * Public API Surface of ngx-guided-tour\n */\n\nexport * from './lib/guided-tour.module';\nexport * from './lib/guided-tour.component';\nexport * from './lib/guided-tour.service';\nexport * from './lib/guided-tour.constants';\nexport * from './lib/windowref.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MAoEa,WAAW,CAAA;AACb,IAAA,OAAgB,MAAM,GAAG,QAAQ,CAAC;AAClC,IAAA,OAAgB,UAAU,GAAG,aAAa,CAAC;AAC3C,IAAA,OAAgB,WAAW,GAAG,cAAc,CAAC;AAC7C,IAAA,OAAgB,MAAM,GAAG,QAAQ,CAAC;AAClC,IAAA,OAAgB,IAAI,GAAG,MAAM,CAAC;AAC9B,IAAA,OAAgB,KAAK,GAAG,OAAO,CAAC;AAChC,IAAA,OAAgB,GAAG,GAAG,KAAK,CAAC;AAC5B,IAAA,OAAgB,OAAO,GAAG,UAAU,CAAC;AACrC,IAAA,OAAgB,QAAQ,GAAG,WAAW,CAAC;;IAGtC,0BAKX;AALD,CAAA,UAAY,yBAAyB,EAAA;AACjC,IAAA,yBAAA,CAAA,kBAAA,CAAA,GAAA,oBAAuC,CAAA;AACvC,IAAA,yBAAA,CAAA,gBAAA,CAAA,GAAA,mBAAoC,CAAA;AACpC,IAAA,yBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,yBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACjB,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,GAKpC,EAAA,CAAA,CAAA;;AClFD,SAAS,SAAS,GAAA;AACd,IAAA,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAS,aAAa,GAAA;IAClB,OAAO;AACH,QAAA,UAAU,EAAE,CAAC;AACb,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,OAAO,EAAE,CAAC;AACV,QAAA,OAAO,EAAE,CAAC;AACV,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,WAAW,EAAE,CAAC;AACd,QAAA,MAAM,EAAE,MAAK,GAAG;AAChB,QAAA,QAAQ,EAAE,MAAK,GAAG;AAClB,QAAA,gBAAgB,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