UNPKG

ngx-page-scroll-core

Version:

Animated scrolling functionality for angular written in pure typescript

1 lines 42.4 kB
{"version":3,"file":"ngx-page-scroll-core.mjs","sources":["../../../projects/ngx-page-scroll-core/src/lib/page-scroll-instance.ts","../../../projects/ngx-page-scroll-core/src/lib/providers/config.provider.ts","../../../projects/ngx-page-scroll-core/src/lib/providers/ngx-page-scroll.service.ts","../../../projects/ngx-page-scroll-core/src/lib/ngx-page-scroll-core.module.ts","../../../projects/ngx-page-scroll-core/src/public-api.ts","../../../projects/ngx-page-scroll-core/src/ngx-page-scroll-core.ts"],"sourcesContent":["import { EventEmitter } from '@angular/core';\nimport { PageScrollConfig } from './types/page-scroll.config';\nimport { PageScrollTarget } from './types/page-scroll-target';\nimport { PageScrollViews } from './types/page-scroll-view';\nimport { EasingLogic } from './types/easing-logic';\n\n/**\n * An Interface specifying the possible options to be passed into the newInstance() factory method\n */\nexport interface PageScrollOptions extends PageScrollConfig {\n /**\n * The document object of the current app\n */\n document: Document;\n\n /**\n * A specification of the DOM element to scroll to. Either a string referring to an\n * element using a valid css selector (`#target`, `.class`, `div.class`) or a HTMLElement\n * that is attached to the document's DOM tree.\n */\n scrollTarget: PageScrollTarget;\n\n /**\n * Array of HTMLElements or the body object that should be manipulated while performing\n * the scroll animation.\n */\n scrollViews?: PageScrollViews[];\n\n /**\n * Maximum speed to be used for the scroll animation. Only taken\n * into account of no duration is provided\n */\n speed?: number;\n\n /**\n * A listener to be called whenever the scroll animation stops\n */\n scrollFinishListener?: EventEmitter<boolean>;\n\n namespace?: string;\n verticalScrolling?: boolean;\n duration?: number;\n scrollOffset?: number;\n advancedInlineOffsetCalculation?: boolean;\n interruptEvents?: string[];\n interruptKeys?: string[];\n interruptible?: boolean;\n scrollInView?: boolean;\n easingLogic?: EasingLogic;\n}\n\n/**\n * Represents a scrolling action\n */\nexport class PageScrollInstance {\n\n public pageScrollOptions: PageScrollOptions;\n\n private isInlineScrolling: boolean;\n\n /* The listener that this scroll instance attaches to the body to listen for interrupt events\n We're keeping a reference to it so we can properly remove it when the animation finishes */\n private interruptListener: EventListenerOrEventListenerObject;\n\n /**\n * These properties will be set/manipulated if the scroll animation starts\n */\n /* The initial value of the scrollTop or scrollLeft position when the animation starts */\n public startScrollPosition = 0;\n /* The target value of the scrollTop or scrollLeft position for the animation (aka \"the final destination\") */\n public targetScrollPosition: number;\n /* Difference between startScrollPosition and targetScrollPosition. Pre-calculated to minimize computations during animation */\n public distanceToScroll: number;\n /* The timestamp when the animation starts/got started */\n public startTime: number;\n /* The estimate end time of the animation, calculated by startTime + duration */\n public endTime: number;\n /* The duration a started animation takes. This may match the _duration or be adjusted due to the _speed option */\n public executionDuration: number;\n /* Whether an interrupt listener is attached to the body or not */\n public interruptListenersAttached = false;\n\n /* References to the timer instance that is used to perform the scroll animation to be\n able to clear it on animation end*/\n public timer = null;\n\n /**\n * Private constructor, requires the properties assumed to be the bare minimum.\n * Use the factory methods to create instances:\n * {@link PageScrollService#create}\n */\n constructor(pageScrollOptions: PageScrollOptions) {\n if (!pageScrollOptions.scrollViews || pageScrollOptions.scrollViews.length === 0) {\n pageScrollOptions.scrollViews = [\n pageScrollOptions.document.documentElement,\n pageScrollOptions.document.body,\n pageScrollOptions.document.body.parentNode,\n ];\n this.isInlineScrolling = false;\n } else {\n this.isInlineScrolling = true;\n }\n\n this.pageScrollOptions = pageScrollOptions;\n }\n\n private static getScrollingTargetPosition(pageScrollOptions: PageScrollOptions,\n scrollTargetElement: HTMLElement): { top: number, left: number } {\n const body = pageScrollOptions.document.body;\n const docEl = pageScrollOptions.document.documentElement;\n\n const windowPageYOffset: number = pageScrollOptions.document.defaultView &&\n pageScrollOptions.document.defaultView.pageYOffset || undefined;\n const windowPageXOffset: number = pageScrollOptions.document.defaultView &&\n pageScrollOptions.document.defaultView.pageXOffset || undefined;\n\n const scrollTop = windowPageYOffset || docEl.scrollTop || body.scrollTop;\n const scrollLeft = windowPageXOffset || docEl.scrollLeft || body.scrollLeft;\n\n const clientTop = docEl.clientTop || body.clientTop || 0;\n const clientLeft = docEl.clientLeft || body.clientLeft || 0;\n\n if (scrollTargetElement === undefined || scrollTargetElement === null) {\n // No element found, so return the current position to not cause any change in scroll position\n return {top: scrollTop, left: scrollLeft};\n }\n const box = scrollTargetElement.getBoundingClientRect();\n\n const top = box.top + scrollTop - clientTop;\n const left = box.left + scrollLeft - clientLeft;\n\n return {top: Math.round(top), left: Math.round(left)};\n }\n\n private static getInlineScrollingTargetPosition(pageScrollOptions: PageScrollOptions,\n scrollTargetElement: HTMLElement): { top: number, left: number } {\n const position = {top: scrollTargetElement.offsetTop, left: scrollTargetElement.offsetLeft};\n if (pageScrollOptions.advancedInlineOffsetCalculation && pageScrollOptions.scrollViews.length === 1) {\n const accumulatedParentsPos = {top: 0, left: 0};\n // not named window to make sure we're not getting the global window variable by accident\n const theWindow = scrollTargetElement.ownerDocument.defaultView;\n let parentFound = false;\n\n // Start parent is the immediate parent\n let parent = scrollTargetElement.parentElement;\n\n // Iterate upwards all parents\n while (!parentFound && parent !== undefined && parent !== null) {\n if (theWindow.getComputedStyle(parent).getPropertyValue('position') === 'relative') {\n accumulatedParentsPos.top += parent.offsetTop;\n accumulatedParentsPos.left += parent.offsetLeft;\n }\n // Next iteration\n parent = parent.parentElement;\n parentFound = parent === pageScrollOptions.scrollViews[0];\n }\n if (parentFound) {\n // Only use the results if we found the parent, otherwise we accumulated too much anyway\n position.top += accumulatedParentsPos.top;\n position.left += accumulatedParentsPos.left;\n } else {\n /* TODO Uncomment\n if (PageScrollConfig._logLevel >= 2 || (PageScrollConfig._logLevel >= 1 && isDevMode())) {\n console.warn('Unable to find nested scrolling targets parent!');\n }*/\n }\n }\n\n return position;\n }\n\n public getScrollPropertyValue(scrollingView): number {\n if (!this.pageScrollOptions.verticalScrolling) {\n return scrollingView.scrollLeft;\n }\n\n return scrollingView.scrollTop;\n }\n\n public getScrollClientPropertyValue(scrollingView): number {\n if (!this.pageScrollOptions.verticalScrolling) {\n return scrollingView.clientWidth;\n }\n\n return scrollingView.clientHeight;\n }\n\n /**\n * Extract the exact location of the scrollTarget element.\n *\n * Extract the scrollTarget HTMLElement from the given PageScrollTarget object. The latter one may be\n * a string like \"#heading2\", then this method returns the corresponding DOM element for that id.\n *\n */\n public extractScrollTargetPosition(): { top: number, left: number } {\n const scrollTargetElement = this.getScrollTargetElement();\n\n if (scrollTargetElement === null || scrollTargetElement === undefined) {\n // Scroll target not found\n return {top: NaN, left: NaN};\n }\n\n if (this.isInlineScrolling) {\n return PageScrollInstance.getInlineScrollingTargetPosition(this.pageScrollOptions, scrollTargetElement);\n }\n\n return PageScrollInstance.getScrollingTargetPosition(this.pageScrollOptions, scrollTargetElement);\n }\n\n /**\n * Get the top offset of the scroll animation.\n * This automatically takes the offset location of the scrolling container/scrolling view\n * into account (for nested/inline scrolling).\n */\n public getCurrentOffset(): number {\n return this.pageScrollOptions.scrollOffset;\n }\n\n /**\n * Sets the \"scrollTop\" or \"scrollLeft\" property for all scrollViews to the provided value\n * @return true if at least for one ScrollTopSource the scrollTop/scrollLeft value could be set and it kept the new value.\n * false if it failed for all ScrollViews, meaning that we should stop the animation\n * (probably because we're at the end of the scrolling region)\n */\n public setScrollPosition(position: number): boolean {\n // Set the new scrollTop/scrollLeft to all scrollViews elements\n return this.pageScrollOptions.scrollViews.reduce((oneAlreadyWorked, scrollingView: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any\n const startScrollPropertyValue = this.getScrollPropertyValue(scrollingView);\n if (scrollingView && startScrollPropertyValue !== undefined && startScrollPropertyValue !== null) {\n const scrollDistance = Math.abs(startScrollPropertyValue - position);\n\n // The movement we need to perform is less than 2px\n // This we consider a small movement which some browser may not perform when\n // changing the scrollTop/scrollLeft property\n // Thus in this cases we do not stop the scroll animation, although setting the\n // scrollTop/scrollLeft value \"fails\"\n const isSmallMovement = scrollDistance < this.pageScrollOptions._minScrollDistance;\n\n if (!this.pageScrollOptions.verticalScrolling) {\n scrollingView.scrollLeft = position;\n } else {\n scrollingView.scrollTop = position;\n }\n\n // Return true if setting the new scrollTop/scrollLeft value worked\n // We consider that it worked if the new scrollTop/scrollLeft value is closer to the\n // desired scrollTop/scrollLeft than before (it might not be exactly the value we\n // set due to dpi or rounding irregularities)\n if (isSmallMovement || scrollDistance > Math.abs(this.getScrollPropertyValue(scrollingView) - position)) {\n return true;\n }\n }\n\n return oneAlreadyWorked;\n }, false);\n }\n\n /**\n * Trigger firing a animation finish event\n * @param value Whether the animation finished at the target (true) or got interrupted (false)\n */\n public fireEvent(value: boolean): void {\n if (this.pageScrollOptions.scrollFinishListener) {\n this.pageScrollOptions.scrollFinishListener.emit(value);\n }\n }\n\n /**\n * Attach the interrupt listeners to the PageScrollInstance body. The given interruptReporter\n * will be called if any of the attached events is fired.\n *\n * Possibly attached interruptListeners are automatically removed from the body before the new one will be attached.\n */\n public attachInterruptListeners(interruptReporter: InterruptReporter): void {\n if (this.interruptListenersAttached) {\n // Detach possibly existing listeners first\n this.detachInterruptListeners();\n }\n this.interruptListener = (event: Event): void => {\n interruptReporter.report(event, this);\n };\n this.pageScrollOptions.interruptEvents.forEach(\n (event: string) => this.pageScrollOptions.document.body.addEventListener(event, this.interruptListener)\n );\n this.interruptListenersAttached = true;\n }\n\n /**\n * Remove event listeners from the body and stop listening for events that might be treated as \"animation\n * interrupt\" events.\n */\n public detachInterruptListeners(): void {\n this.pageScrollOptions.interruptEvents.forEach(\n (event: string) => this.pageScrollOptions.document.body.removeEventListener(event, this.interruptListener)\n );\n this.interruptListenersAttached = false;\n }\n\n private getScrollTargetElement(): HTMLElement {\n if (typeof this.pageScrollOptions.scrollTarget === 'string') {\n const targetSelector = this.pageScrollOptions.scrollTarget as string;\n if (targetSelector.match(/^#[^\\s]+$/g) !== null) {\n // It's an id selector and a valid id, as it does not contain any white space characters\n\n return this.pageScrollOptions.document.getElementById(targetSelector.substr(1));\n }\n\n return this.pageScrollOptions.document.querySelector(targetSelector) as HTMLElement;\n }\n\n return this.pageScrollOptions.scrollTarget as HTMLElement;\n }\n}\n\n/**\n * An Interface a listener should implement to be notified about possible interrupt events\n * that happened due to user interaction while a scroll animation takes place.\n *\n * The PageScrollService provides an implementation to a PageScrollInstance to be notified\n * about scroll animation interrupts and stop related animations.\n */\nexport interface InterruptReporter {\n report(event: Event, pageScrollInstance: PageScrollInstance): void;\n}\n","import { InjectionToken } from '@angular/core';\nimport { PageScrollConfig } from '../types/page-scroll.config';\n\nexport const NGXPS_CONFIG = new InjectionToken<PageScrollConfig>(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'ngxps_config' : ''\n);\n\nexport const defaultPageScrollConfig: PageScrollConfig = {\n _interval: 10,\n _minScrollDistance: 2,\n _logLevel: 1,\n namespace: 'default',\n verticalScrolling: true,\n duration: 1250,\n scrollOffset: 0,\n advancedInlineOffsetCalculation: false,\n interruptEvents: ['mousedown', 'wheel', 'DOMMouseScroll', 'mousewheel', 'keyup', 'touchmove'],\n interruptKeys: [' ', 'Escape', 'Tab', 'Enter', 'PageUp', 'PageDown', 'Home', 'End', 'ArrowUp', 'ArrowRight', 'ArrowLeft', 'ArrowDown'],\n interruptible: true,\n scrollInView: true,\n easingLogic: (t: number, b: number, c: number, d: number): number => {\n // Linear easing\n return c * t / d + b;\n },\n};\n","import { Inject, Injectable } from '@angular/core';\n\nimport { PageScrollConfig } from '../types/page-scroll.config';\nimport { InterruptReporter, PageScrollInstance, PageScrollOptions } from '../page-scroll-instance';\nimport { defaultPageScrollConfig, NGXPS_CONFIG } from './config.provider';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PageScrollService {\n private readonly config: PageScrollConfig;\n\n private runningInstances: PageScrollInstance[] = [];\n\n private onInterrupted: InterruptReporter = {\n report: (event: Event, pageScrollInstance: PageScrollInstance): void => {\n if (!pageScrollInstance.pageScrollOptions.interruptible) {\n // Non-interruptible anyway, so do not stop anything\n return;\n }\n\n let shouldStop = true;\n\n if (event.type === 'keyup') {\n // Only stop if specific keys have been pressed, for all others don't stop anything\n if (this.config.interruptKeys.indexOf((event as KeyboardEvent).key) === -1) {\n // The pressed key is not in the list of interrupting keys\n shouldStop = false;\n }\n } else if (event.type === 'mousedown') {\n // For mousedown events we only stop the scroll animation of the mouse has\n // been clicked inside the scrolling container\n if (!pageScrollInstance.pageScrollOptions.scrollViews.some(scrollingView => scrollingView.contains(event.target as Node))) {\n // Mouse clicked an element which is not inside any of the the scrolling containers\n shouldStop = false;\n }\n }\n\n if (shouldStop) {\n this.stopAll(pageScrollInstance.pageScrollOptions.namespace);\n }\n },\n };\n\n private stopInternal(interrupted: boolean, pageScrollInstance: PageScrollInstance): boolean {\n const index: number = this.runningInstances.indexOf(pageScrollInstance);\n if (index >= 0) {\n this.runningInstances.splice(index, 1);\n }\n\n if (pageScrollInstance.interruptListenersAttached) {\n pageScrollInstance.detachInterruptListeners();\n }\n\n if (pageScrollInstance.timer) {\n // Clear/Stop the timer\n clearInterval(pageScrollInstance.timer);\n // Clear the reference to this timer\n pageScrollInstance.timer = undefined;\n pageScrollInstance.fireEvent(!interrupted);\n\n return true;\n }\n\n return false;\n }\n\n public create(options: PageScrollOptions): PageScrollInstance {\n return new PageScrollInstance({...this.config, ...options} as PageScrollOptions);\n }\n\n /**\n * Start a scroll animation. All properties of the animation are stored in the given {@link PageScrollInstance} object.\n *\n * This is the core functionality of the whole library.\n */\n // tslint:disable-next-line:cyclomatic-complexity\n public start(pageScrollInstance: PageScrollInstance): void {\n // Merge the default options in the pageScrollInstance options\n pageScrollInstance.pageScrollOptions = {...this.config, ...pageScrollInstance.pageScrollOptions} as PageScrollOptions;\n\n // Stop all possibly running scroll animations in the same namespace\n this.stopAll(pageScrollInstance.pageScrollOptions.namespace);\n\n if (pageScrollInstance.pageScrollOptions.scrollViews === null || pageScrollInstance.pageScrollOptions.scrollViews.length === 0) {\n // No scrollViews specified, thus we can't animate anything\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n if (this.config._logLevel >= 2 || this.config._logLevel >= 1) {\n console.warn('No scrollViews specified, thus ngx-page-scroll does not know which DOM elements to scroll');\n }\n }\n\n return;\n }\n\n let startScrollPositionFound = false;\n let scrollRange = pageScrollInstance.getScrollClientPropertyValue(pageScrollInstance.pageScrollOptions.scrollViews[0]);\n // Reset start scroll position to 0. If any of the scrollViews has a different one, it will be extracted next\n pageScrollInstance.startScrollPosition = 0;\n\n // Get the start scroll position from the scrollViews (e.g. if the user already scrolled down the content)\n pageScrollInstance.pageScrollOptions.scrollViews.forEach(scrollingView => {\n if (scrollingView === undefined || scrollingView === null) {\n return;\n }\n // Get the scrollTop or scrollLeft value of the first scrollingView that returns a value for its \"scrollTop\"\n // or \"scrollLeft\" property that is not undefined and unequal to 0\n\n const scrollPosition = pageScrollInstance.getScrollPropertyValue(scrollingView);\n if (!startScrollPositionFound && scrollPosition) {\n // We found a scrollingView that does not have scrollTop or scrollLeft 0\n\n // Return the scroll position value, as this will be our startScrollPosition\n pageScrollInstance.startScrollPosition = scrollPosition;\n startScrollPositionFound = true;\n\n // Remember te scrollRange of this scrollingView\n scrollRange = pageScrollInstance.getScrollClientPropertyValue(scrollingView);\n }\n });\n\n const pageScrollOffset = pageScrollInstance.getCurrentOffset();\n\n // Calculate the target position that the scroll animation should go to\n\n const scrollTargetPosition = pageScrollInstance.extractScrollTargetPosition();\n pageScrollInstance.targetScrollPosition = Math.round(\n (pageScrollInstance.pageScrollOptions.verticalScrolling ? scrollTargetPosition.top : scrollTargetPosition.left) - pageScrollOffset);\n\n // Calculate the distance we need to go in total\n pageScrollInstance.distanceToScroll = pageScrollInstance.targetScrollPosition - pageScrollInstance.startScrollPosition;\n\n if (isNaN(pageScrollInstance.distanceToScroll)) {\n // We weren't able to find the target position, maybe the element does not exist?\n\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n if (this.config._logLevel >= 2 || this.config._logLevel >= 1) {\n console.log('Scrolling not possible, as we can\\'t find the specified target');\n }\n }\n pageScrollInstance.fireEvent(false);\n\n return;\n }\n\n // We're at the final destination already\n // OR we need to scroll down but are already at the end\n // OR we need to scroll up but are at the top already\n const allReadyAtDestination = Math.abs(pageScrollInstance.distanceToScroll) < pageScrollInstance.pageScrollOptions._minScrollDistance;\n\n // Check how long we need to scroll if a speed option is given\n // Default executionDuration is the specified duration\n pageScrollInstance.executionDuration = pageScrollInstance.pageScrollOptions.duration;\n // Maybe we need to pay attention to the speed option?\n if ((pageScrollInstance.pageScrollOptions.speed !== undefined && pageScrollInstance.pageScrollOptions.speed !== null) &&\n (pageScrollInstance.pageScrollOptions.duration === undefined || pageScrollInstance.pageScrollOptions.duration === null)) {\n // Speed option is set and no duration => calculate duration based on speed and scroll distance\n pageScrollInstance.executionDuration =\n Math.abs(pageScrollInstance.distanceToScroll) / pageScrollInstance.pageScrollOptions.speed * 1000;\n }\n\n // We should go there directly, as our \"animation\" would have one big step\n // only anyway and this way we save the interval stuff\n const tooShortInterval = pageScrollInstance.executionDuration <= pageScrollInstance.pageScrollOptions._interval;\n\n if (allReadyAtDestination || tooShortInterval) {\n if (this.config._logLevel >= 2 || this.config._logLevel >= 1) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n if (allReadyAtDestination) {\n console.log('Scrolling not possible, as we can\\'t get any closer to the destination');\n } else {\n console.log('Scroll duration shorter that interval length, jumping to target');\n }\n }\n }\n pageScrollInstance.setScrollPosition(pageScrollInstance.targetScrollPosition);\n pageScrollInstance.fireEvent(true);\n\n return;\n }\n\n if (!pageScrollInstance.pageScrollOptions.scrollInView) {\n const alreadyInView = pageScrollInstance.targetScrollPosition > pageScrollInstance.startScrollPosition &&\n pageScrollInstance.targetScrollPosition <= pageScrollInstance.startScrollPosition + scrollRange;\n if (alreadyInView) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n if (this.config._logLevel >= 2 || this.config._logLevel >= 1) {\n console.log('Not scrolling, as target already in view');\n }\n }\n pageScrollInstance.fireEvent(true);\n\n return;\n }\n }\n\n // Register the interrupt listeners if we want an interruptible scroll animation\n if (pageScrollInstance.pageScrollOptions.interruptible) {\n pageScrollInstance.attachInterruptListeners(this.onInterrupted);\n }\n\n // Let's get started, get the start time...\n pageScrollInstance.startTime = new Date().getTime();\n // .. and calculate the end time (when we need to finish at last)\n pageScrollInstance.endTime = pageScrollInstance.startTime + pageScrollInstance.executionDuration;\n\n pageScrollInstance.timer = setInterval((instance: PageScrollInstance) => {\n // Take the current time\n const currentTime: number = new Date().getTime();\n\n // Determine the new scroll position\n let newScrollPosition: number;\n let stopNow = false;\n if (instance.endTime <= currentTime) {\n // We're over the time already, so go the targetScrollPosition (aka destination)\n newScrollPosition = instance.targetScrollPosition;\n stopNow = true;\n } else {\n // Calculate the scroll position based on the current time using the easing function\n newScrollPosition = Math.round(instance.pageScrollOptions.easingLogic(\n currentTime - instance.startTime,\n instance.startScrollPosition,\n instance.distanceToScroll,\n instance.executionDuration));\n }\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n if (this.config._logLevel >= 5) {\n console.warn('Scroll Position: ' + newScrollPosition);\n }\n }\n // Set the new scrollPosition to all scrollViews elements\n if (!instance.setScrollPosition(newScrollPosition)) {\n // Setting the new scrollTop/scrollLeft value failed for all ScrollViews\n // early stop the scroll animation to save resources\n stopNow = true;\n }\n\n // At the end do the internal stop maintenance and fire the pageScrollFinish event\n // (otherwise the event might arrive at \"too early\")\n if (stopNow) {\n this.stopInternal(false, instance);\n }\n\n }, this.config._interval, pageScrollInstance);\n\n // Register the instance as running one\n this.runningInstances.push(pageScrollInstance);\n }\n\n public scroll(options: PageScrollOptions): void {\n this.start(this.create(options));\n }\n\n /**\n * Stop all running scroll animations. Optionally limit to stop only the ones of specific namespace.\n */\n public stopAll(namespace?: string): boolean {\n if (this.runningInstances.length > 0) {\n let stoppedSome = false;\n\n for (let i = 0; i < this.runningInstances.length; ++i) {\n const pageScrollInstance = this.runningInstances[i];\n if (!namespace || pageScrollInstance.pageScrollOptions.namespace === namespace) {\n stoppedSome = true;\n this.stopInternal(true, pageScrollInstance);\n // Decrease the counter, as we removed an item from the array we iterate over\n i--;\n }\n }\n\n return stoppedSome;\n }\n\n return false;\n }\n\n public stop(pageScrollInstance: PageScrollInstance): boolean {\n return this.stopInternal(true, pageScrollInstance);\n }\n\n constructor(@Inject(NGXPS_CONFIG) customConfig: PageScrollConfig) {\n this.config = {...defaultPageScrollConfig, ...customConfig};\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { PageScrollService } from './providers/ngx-page-scroll.service';\nimport { NGXPS_CONFIG } from './providers/config.provider';\nimport { PageScrollConfig } from './types/page-scroll.config';\n\n@NgModule({\n providers: [\n PageScrollService,\n {provide: NGXPS_CONFIG, useValue: {}},\n ],\n})\nexport class NgxPageScrollCoreModule {\n static forRoot(config?: PageScrollConfig): ModuleWithProviders<NgxPageScrollCoreModule> {\n return {\n ngModule: NgxPageScrollCoreModule,\n providers: [PageScrollService, {provide: NGXPS_CONFIG, useValue: config}],\n };\n }\n}\n","/*\n * Public API Surface of ngx-page-scroll-core\n */\n\nexport { NgxPageScrollCoreModule } from './lib/ngx-page-scroll-core.module';\n\nexport { defaultPageScrollConfig, NGXPS_CONFIG } from './lib/providers/config.provider';\nexport { PageScrollService } from './lib/providers/ngx-page-scroll.service';\n\nexport { EasingLogic } from './lib/types/easing-logic';\nexport { PageScrollInstance, InterruptReporter, PageScrollOptions } from './lib/page-scroll-instance';\nexport { PageScrollTarget } from './lib/types/page-scroll-target';\nexport { PageScrollViews } from './lib/types/page-scroll-view';\nexport { PageScrollConfig } from './lib/types/page-scroll.config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAmDA;;AAEG;MACU,kBAAkB,CAAA;AAgC7B;;;;AAIG;AACH,IAAA,WAAA,CAAY,iBAAoC,EAAA;AA3BhD;;AAEG;;QAEI,IAAA,CAAA,mBAAmB,GAAG,CAAC;;QAYvB,IAAA,CAAA,0BAA0B,GAAG,KAAK;AAEzC;AACoC;QAC7B,IAAA,CAAA,KAAK,GAAG,IAAI;AAQjB,QAAA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