diff --git a/README.md b/README.md index 0a64f41..8c5eb06 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Web Component for easily creating layouts with sticky anchor navigation tabs and ## Important information about versioning **Component versions 23.x were deprecated in order to follow Semanting Versioning practices. Please use latest version 2.x for Vaadin 23+ and version 3.x for Vaadin 24.5.** +## Since version 4.0.0 + +- The component has been migrated to Lit +- When the application does not load the Aura or Lumo theme, the component uses a minimal set of functional styles that provide a foundation for a custom theme. +- `ThemableMixin` has been removed from the component, and injecting styles into the component's shadow root using `registerStyles` is no longer supported. Use global CSS to style the component using part names and CSS variables instead. + ## Compatibility - Version 1.x.x -> Vaadin 14+ diff --git a/demo/demo-icons.js b/demo/demo-icons.js index bdb5bf1..14c2f26 100644 --- a/demo/demo-icons.js +++ b/demo/demo-icons.js @@ -1,18 +1,7 @@ /* eslint-disable max-len */ import { html } from '@polymer/polymer/polymer-element.js'; -import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js'; import '@vaadin/vaadin-lumo-styles/vaadin-iconset.js' -registerStyles( - 'vaadin-button', - css` - [part] ::slotted(vaadin-icon[icon^='vcf-demo:']) { - padding: 0.25em; - box-sizing: border-box !important; - } - ` -); - const template = html` diff --git a/demo/demo.js b/demo/demo.js index 6f6b552..f7fb21c 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -3,7 +3,6 @@ import '@polymer/iron-demo-helpers/demo-snippet'; import '@vaadin/button'; import '@vaadin/text-field'; import '@vaadin/vaadin-lumo-styles/icons'; -import '@vaadin/vaadin-lumo-styles/typography'; import '../vcf-anchor-nav'; import './demo-icons'; diff --git a/demo/index.html b/demo/index.html index 5debe22..230071e 100644 --- a/demo/index.html +++ b/demo/index.html @@ -5,6 +5,7 @@ vcf-anchor-nav demo + @@ -144,6 +145,11 @@ z-index: 1; } + #copyVaadinButton vaadin-icon { + padding: 0.25em; + box-sizing: border-box !important; + } + .code code:not(.main) { font-family: 'Fira Code', monospace; font-size: 12px; diff --git a/lib/common-js-modules.esm.js b/lib/common-js-modules.esm.js deleted file mode 100644 index d113d1f..0000000 --- a/lib/common-js-modules.esm.js +++ /dev/null @@ -1,1968 +0,0 @@ -/** - * Copyright 2016 Google Inc. All Rights Reserved. - * - * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE. - * - * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - */ -(function() { - -// Exit early if we're not running in a browser. -if (typeof window !== 'object') { - return; -} - -// Exit early if all IntersectionObserver and IntersectionObserverEntry -// features are natively supported. -if ('IntersectionObserver' in window && - 'IntersectionObserverEntry' in window && - 'intersectionRatio' in window.IntersectionObserverEntry.prototype) { - - // Minimal polyfill for Edge 15's lack of `isIntersecting` - // See: https://github.com/w3c/IntersectionObserver/issues/211 - if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) { - Object.defineProperty(window.IntersectionObserverEntry.prototype, - 'isIntersecting', { - get: function () { - return this.intersectionRatio > 0; - } - }); - } - return; -} - - -/** - * A local reference to the document. - */ -var document = window.document; - - -/** - * An IntersectionObserver registry. This registry exists to hold a strong - * reference to IntersectionObserver instances currently observing a target - * element. Without this registry, instances without another reference may be - * garbage collected. - */ -var registry = []; - -/** - * The signal updater for cross-origin intersection. When not null, it means - * that the polyfill is configured to work in a cross-origin mode. - * @type {function(DOMRect|ClientRect, DOMRect|ClientRect)} - */ -var crossOriginUpdater = null; - -/** - * The current cross-origin intersection. Only used in the cross-origin mode. - * @type {DOMRect|ClientRect} - */ -var crossOriginRect = null; - - -/** - * Creates the global IntersectionObserverEntry constructor. - * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry - * @param {Object} entry A dictionary of instance properties. - * @constructor - */ -function IntersectionObserverEntry(entry) { - this.time = entry.time; - this.target = entry.target; - this.rootBounds = ensureDOMRect(entry.rootBounds); - this.boundingClientRect = ensureDOMRect(entry.boundingClientRect); - this.intersectionRect = ensureDOMRect(entry.intersectionRect || getEmptyRect()); - this.isIntersecting = !!entry.intersectionRect; - - // Calculates the intersection ratio. - var targetRect = this.boundingClientRect; - var targetArea = targetRect.width * targetRect.height; - var intersectionRect = this.intersectionRect; - var intersectionArea = intersectionRect.width * intersectionRect.height; - - // Sets intersection ratio. - if (targetArea) { - // Round the intersection ratio to avoid floating point math issues: - // https://github.com/w3c/IntersectionObserver/issues/324 - this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4)); - } else { - // If area is zero and is intersecting, sets to 1, otherwise to 0 - this.intersectionRatio = this.isIntersecting ? 1 : 0; - } -} - - -/** - * Creates the global IntersectionObserver constructor. - * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface - * @param {Function} callback The function to be invoked after intersection - * changes have queued. The function is not invoked if the queue has - * been emptied by calling the `takeRecords` method. - * @param {Object=} opt_options Optional configuration options. - * @constructor - */ -function IntersectionObserver(callback, opt_options) { - - var options = opt_options || {}; - - if (typeof callback != 'function') { - throw new Error('callback must be a function'); - } - - if (options.root && options.root.nodeType != 1) { - throw new Error('root must be an Element'); - } - - // Binds and throttles `this._checkForIntersections`. - this._checkForIntersections = throttle( - this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT); - - // Private properties. - this._callback = callback; - this._observationTargets = []; - this._queuedEntries = []; - this._rootMarginValues = this._parseRootMargin(options.rootMargin); - - // Public properties. - this.thresholds = this._initThresholds(options.threshold); - this.root = options.root || null; - this.rootMargin = this._rootMarginValues.map(function(margin) { - return margin.value + margin.unit; - }).join(' '); - - /** @private @const {!Array} */ - this._monitoringDocuments = []; - /** @private @const {!Array} */ - this._monitoringUnsubscribes = []; -} - - -/** - * The minimum interval within which the document will be checked for - * intersection changes. - */ -IntersectionObserver.prototype.THROTTLE_TIMEOUT = 100; - - -/** - * The frequency in which the polyfill polls for intersection changes. - * this can be updated on a per instance basis and must be set prior to - * calling `observe` on the first target. - */ -IntersectionObserver.prototype.POLL_INTERVAL = null; - -/** - * Use a mutation observer on the root element - * to detect intersection changes. - */ -IntersectionObserver.prototype.USE_MUTATION_OBSERVER = true; - - -/** - * Sets up the polyfill in the cross-origin mode. The result is the - * updater function that accepts two arguments: `boundingClientRect` and - * `intersectionRect` - just as these fields would be available to the - * parent via `IntersectionObserverEntry`. This function should be called - * each time the iframe receives intersection information from the parent - * window, e.g. via messaging. - * @return {function(DOMRect|ClientRect, DOMRect|ClientRect)} - */ -IntersectionObserver._setupCrossOriginUpdater = function() { - if (!crossOriginUpdater) { - /** - * @param {DOMRect|ClientRect} boundingClientRect - * @param {DOMRect|ClientRect} intersectionRect - */ - crossOriginUpdater = function(boundingClientRect, intersectionRect) { - if (!boundingClientRect || !intersectionRect) { - crossOriginRect = getEmptyRect(); - } else { - crossOriginRect = convertFromParentRect(boundingClientRect, intersectionRect); - } - registry.forEach(function(observer) { - observer._checkForIntersections(); - }); - }; - } - return crossOriginUpdater; -}; - - -/** - * Resets the cross-origin mode. - */ -IntersectionObserver._resetCrossOriginUpdater = function() { - crossOriginUpdater = null; - crossOriginRect = null; -}; - - -/** - * Starts observing a target element for intersection changes based on - * the thresholds values. - * @param {Element} target The DOM element to observe. - */ -IntersectionObserver.prototype.observe = function(target) { - var isTargetAlreadyObserved = this._observationTargets.some(function(item) { - return item.element == target; - }); - - if (isTargetAlreadyObserved) { - return; - } - - if (!(target && target.nodeType == 1)) { - throw new Error('target must be an Element'); - } - - this._registerInstance(); - this._observationTargets.push({element: target, entry: null}); - this._monitorIntersections(target.ownerDocument); - this._checkForIntersections(); -}; - - -/** - * Stops observing a target element for intersection changes. - * @param {Element} target The DOM element to observe. - */ -IntersectionObserver.prototype.unobserve = function(target) { - this._observationTargets = - this._observationTargets.filter(function(item) { - return item.element != target; - }); - this._unmonitorIntersections(target.ownerDocument); - if (this._observationTargets.length == 0) { - this._unregisterInstance(); - } -}; - - -/** - * Stops observing all target elements for intersection changes. - */ -IntersectionObserver.prototype.disconnect = function() { - this._observationTargets = []; - this._unmonitorAllIntersections(); - this._unregisterInstance(); -}; - - -/** - * Returns any queue entries that have not yet been reported to the - * callback and clears the queue. This can be used in conjunction with the - * callback to obtain the absolute most up-to-date intersection information. - * @return {Array} The currently queued entries. - */ -IntersectionObserver.prototype.takeRecords = function() { - var records = this._queuedEntries.slice(); - this._queuedEntries = []; - return records; -}; - - -/** - * Accepts the threshold value from the user configuration object and - * returns a sorted array of unique threshold values. If a value is not - * between 0 and 1 and error is thrown. - * @private - * @param {Array|number=} opt_threshold An optional threshold value or - * a list of threshold values, defaulting to [0]. - * @return {Array} A sorted list of unique and valid threshold values. - */ -IntersectionObserver.prototype._initThresholds = function(opt_threshold) { - var threshold = opt_threshold || [0]; - if (!Array.isArray(threshold)) threshold = [threshold]; - - return threshold.sort().filter(function(t, i, a) { - if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) { - throw new Error('threshold must be a number between 0 and 1 inclusively'); - } - return t !== a[i - 1]; - }); -}; - - -/** - * Accepts the rootMargin value from the user configuration object - * and returns an array of the four margin values as an object containing - * the value and unit properties. If any of the values are not properly - * formatted or use a unit other than px or %, and error is thrown. - * @private - * @param {string=} opt_rootMargin An optional rootMargin value, - * defaulting to '0px'. - * @return {Array} An array of margin objects with the keys - * value and unit. - */ -IntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) { - var marginString = opt_rootMargin || '0px'; - var margins = marginString.split(/\s+/).map(function(margin) { - var parts = /^(-?\d*\.?\d+)(px|%)$/.exec(margin); - if (!parts) { - throw new Error('rootMargin must be specified in pixels or percent'); - } - return {value: parseFloat(parts[1]), unit: parts[2]}; - }); - - // Handles shorthand. - margins[1] = margins[1] || margins[0]; - margins[2] = margins[2] || margins[0]; - margins[3] = margins[3] || margins[1]; - - return margins; -}; - - -/** - * Starts polling for intersection changes if the polling is not already - * happening, and if the page's visibility state is visible. - * @param {!Document} doc - * @private - */ -IntersectionObserver.prototype._monitorIntersections = function(doc) { - var win = doc.defaultView; - if (!win) { - // Already destroyed. - return; - } - if (this._monitoringDocuments.indexOf(doc) != -1) { - // Already monitoring. - return; - } - - // Private state for monitoring. - var callback = this._checkForIntersections; - var monitoringInterval = null; - var domObserver = null; - - // If a poll interval is set, use polling instead of listening to - // resize and scroll events or DOM mutations. - if (this.POLL_INTERVAL) { - monitoringInterval = win.setInterval(callback, this.POLL_INTERVAL); - } else { - addEvent(win, 'resize', callback, true); - addEvent(doc, 'scroll', callback, true); - if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in win) { - domObserver = new win.MutationObserver(callback); - domObserver.observe(doc, { - attributes: true, - childList: true, - characterData: true, - subtree: true - }); - } - } - - this._monitoringDocuments.push(doc); - this._monitoringUnsubscribes.push(function() { - // Get the window object again. When a friendly iframe is destroyed, it - // will be null. - var win = doc.defaultView; - - if (win) { - if (monitoringInterval) { - win.clearInterval(monitoringInterval); - } - removeEvent(win, 'resize', callback, true); - } - - removeEvent(doc, 'scroll', callback, true); - if (domObserver) { - domObserver.disconnect(); - } - }); - - // Also monitor the parent. - if (doc != (this.root && this.root.ownerDocument || document)) { - var frame = getFrameElement(doc); - if (frame) { - this._monitorIntersections(frame.ownerDocument); - } - } -}; - - -/** - * Stops polling for intersection changes. - * @param {!Document} doc - * @private - */ -IntersectionObserver.prototype._unmonitorIntersections = function(doc) { - var index = this._monitoringDocuments.indexOf(doc); - if (index == -1) { - return; - } - - var rootDoc = (this.root && this.root.ownerDocument || document); - - // Check if any dependent targets are still remaining. - var hasDependentTargets = - this._observationTargets.some(function(item) { - var itemDoc = item.element.ownerDocument; - // Target is in this context. - if (itemDoc == doc) { - return true; - } - // Target is nested in this context. - while (itemDoc && itemDoc != rootDoc) { - var frame = getFrameElement(itemDoc); - itemDoc = frame && frame.ownerDocument; - if (itemDoc == doc) { - return true; - } - } - return false; - }); - if (hasDependentTargets) { - return; - } - - // Unsubscribe. - var unsubscribe = this._monitoringUnsubscribes[index]; - this._monitoringDocuments.splice(index, 1); - this._monitoringUnsubscribes.splice(index, 1); - unsubscribe(); - - // Also unmonitor the parent. - if (doc != rootDoc) { - var frame = getFrameElement(doc); - if (frame) { - this._unmonitorIntersections(frame.ownerDocument); - } - } -}; - - -/** - * Stops polling for intersection changes. - * @param {!Document} doc - * @private - */ -IntersectionObserver.prototype._unmonitorAllIntersections = function() { - var unsubscribes = this._monitoringUnsubscribes.slice(0); - this._monitoringDocuments.length = 0; - this._monitoringUnsubscribes.length = 0; - for (var i = 0; i < unsubscribes.length; i++) { - unsubscribes[i](); - } -}; - - -/** - * Scans each observation target for intersection changes and adds them - * to the internal entries queue. If new entries are found, it - * schedules the callback to be invoked. - * @private - */ -IntersectionObserver.prototype._checkForIntersections = function() { - if (!this.root && crossOriginUpdater && !crossOriginRect) { - // Cross origin monitoring, but no initial data available yet. - return; - } - - var rootIsInDom = this._rootIsInDom(); - var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect(); - - this._observationTargets.forEach(function(item) { - var target = item.element; - var targetRect = getBoundingClientRect(target); - var rootContainsTarget = this._rootContainsTarget(target); - var oldEntry = item.entry; - var intersectionRect = rootIsInDom && rootContainsTarget && - this._computeTargetAndRootIntersection(target, targetRect, rootRect); - - var newEntry = item.entry = new IntersectionObserverEntry({ - time: now(), - target: target, - boundingClientRect: targetRect, - rootBounds: crossOriginUpdater && !this.root ? null : rootRect, - intersectionRect: intersectionRect - }); - - if (!oldEntry) { - this._queuedEntries.push(newEntry); - } else if (rootIsInDom && rootContainsTarget) { - // If the new entry intersection ratio has crossed any of the - // thresholds, add a new entry. - if (this._hasCrossedThreshold(oldEntry, newEntry)) { - this._queuedEntries.push(newEntry); - } - } else { - // If the root is not in the DOM or target is not contained within - // root but the previous entry for this target had an intersection, - // add a new record indicating removal. - if (oldEntry && oldEntry.isIntersecting) { - this._queuedEntries.push(newEntry); - } - } - }, this); - - if (this._queuedEntries.length) { - this._callback(this.takeRecords(), this); - } -}; - - -/** - * Accepts a target and root rect computes the intersection between then - * following the algorithm in the spec. - * TODO(philipwalton): at this time clip-path is not considered. - * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo - * @param {Element} target The target DOM element - * @param {Object} targetRect The bounding rect of the target. - * @param {Object} rootRect The bounding rect of the root after being - * expanded by the rootMargin value. - * @return {?Object} The final intersection rect object or undefined if no - * intersection is found. - * @private - */ -IntersectionObserver.prototype._computeTargetAndRootIntersection = - function(target, targetRect, rootRect) { - // If the element isn't displayed, an intersection can't happen. - if (window.getComputedStyle(target).display == 'none') return; - - var intersectionRect = targetRect; - var parent = getParentNode(target); - var atRoot = false; - - while (!atRoot && parent) { - var parentRect = null; - var parentComputedStyle = parent.nodeType == 1 ? - window.getComputedStyle(parent) : {}; - - // If the parent isn't displayed, an intersection can't happen. - if (parentComputedStyle.display == 'none') return null; - - if (parent == this.root || parent.nodeType == /* DOCUMENT */ 9) { - atRoot = true; - if (parent == this.root || parent == document) { - if (crossOriginUpdater && !this.root) { - if (!crossOriginRect || - crossOriginRect.width == 0 && crossOriginRect.height == 0) { - // A 0-size cross-origin intersection means no-intersection. - parent = null; - parentRect = null; - intersectionRect = null; - } else { - parentRect = crossOriginRect; - } - } else { - parentRect = rootRect; - } - } else { - // Check if there's a frame that can be navigated to. - var frame = getParentNode(parent); - var frameRect = frame && getBoundingClientRect(frame); - var frameIntersect = - frame && - this._computeTargetAndRootIntersection(frame, frameRect, rootRect); - if (frameRect && frameIntersect) { - parent = frame; - parentRect = convertFromParentRect(frameRect, frameIntersect); - } else { - parent = null; - intersectionRect = null; - } - } - } else { - // If the element has a non-visible overflow, and it's not the - // or element, update the intersection rect. - // Note: and cannot be clipped to a rect that's not also - // the document rect, so no need to compute a new intersection. - var doc = parent.ownerDocument; - if (parent != doc.body && - parent != doc.documentElement && - parentComputedStyle.overflow != 'visible') { - parentRect = getBoundingClientRect(parent); - } - } - - // If either of the above conditionals set a new parentRect, - // calculate new intersection data. - if (parentRect) { - intersectionRect = computeRectIntersection(parentRect, intersectionRect); - } - if (!intersectionRect) break; - parent = parent && getParentNode(parent); - } - return intersectionRect; -}; - - -/** - * Returns the root rect after being expanded by the rootMargin value. - * @return {ClientRect} The expanded root rect. - * @private - */ -IntersectionObserver.prototype._getRootRect = function() { - var rootRect; - if (this.root) { - rootRect = getBoundingClientRect(this.root); - } else { - // Use / instead of window since scroll bars affect size. - var html = document.documentElement; - var body = document.body; - rootRect = { - top: 0, - left: 0, - right: html.clientWidth || body.clientWidth, - width: html.clientWidth || body.clientWidth, - bottom: html.clientHeight || body.clientHeight, - height: html.clientHeight || body.clientHeight - }; - } - return this._expandRectByRootMargin(rootRect); -}; - - -/** - * Accepts a rect and expands it by the rootMargin value. - * @param {DOMRect|ClientRect} rect The rect object to expand. - * @return {ClientRect} The expanded rect. - * @private - */ -IntersectionObserver.prototype._expandRectByRootMargin = function(rect) { - var margins = this._rootMarginValues.map(function(margin, i) { - return margin.unit == 'px' ? margin.value : - margin.value * (i % 2 ? rect.width : rect.height) / 100; - }); - var newRect = { - top: rect.top - margins[0], - right: rect.right + margins[1], - bottom: rect.bottom + margins[2], - left: rect.left - margins[3] - }; - newRect.width = newRect.right - newRect.left; - newRect.height = newRect.bottom - newRect.top; - - return newRect; -}; - - -/** - * Accepts an old and new entry and returns true if at least one of the - * threshold values has been crossed. - * @param {?IntersectionObserverEntry} oldEntry The previous entry for a - * particular target element or null if no previous entry exists. - * @param {IntersectionObserverEntry} newEntry The current entry for a - * particular target element. - * @return {boolean} Returns true if a any threshold has been crossed. - * @private - */ -IntersectionObserver.prototype._hasCrossedThreshold = - function(oldEntry, newEntry) { - - // To make comparing easier, an entry that has a ratio of 0 - // but does not actually intersect is given a value of -1 - var oldRatio = oldEntry && oldEntry.isIntersecting ? - oldEntry.intersectionRatio || 0 : -1; - var newRatio = newEntry.isIntersecting ? - newEntry.intersectionRatio || 0 : -1; - - // Ignore unchanged ratios - if (oldRatio === newRatio) return; - - for (var i = 0; i < this.thresholds.length; i++) { - var threshold = this.thresholds[i]; - - // Return true if an entry matches a threshold or if the new ratio - // and the old ratio are on the opposite sides of a threshold. - if (threshold == oldRatio || threshold == newRatio || - threshold < oldRatio !== threshold < newRatio) { - return true; - } - } -}; - - -/** - * Returns whether or not the root element is an element and is in the DOM. - * @return {boolean} True if the root element is an element and is in the DOM. - * @private - */ -IntersectionObserver.prototype._rootIsInDom = function() { - return !this.root || containsDeep(document, this.root); -}; - - -/** - * Returns whether or not the target element is a child of root. - * @param {Element} target The target element to check. - * @return {boolean} True if the target element is a child of root. - * @private - */ -IntersectionObserver.prototype._rootContainsTarget = function(target) { - return containsDeep(this.root || document, target) && - (!this.root || this.root.ownerDocument == target.ownerDocument); -}; - - -/** - * Adds the instance to the global IntersectionObserver registry if it isn't - * already present. - * @private - */ -IntersectionObserver.prototype._registerInstance = function() { - if (registry.indexOf(this) < 0) { - registry.push(this); - } -}; - - -/** - * Removes the instance from the global IntersectionObserver registry. - * @private - */ -IntersectionObserver.prototype._unregisterInstance = function() { - var index = registry.indexOf(this); - if (index != -1) registry.splice(index, 1); -}; - - -/** - * Returns the result of the performance.now() method or null in browsers - * that don't support the API. - * @return {number} The elapsed time since the page was requested. - */ -function now() { - return window.performance && performance.now && performance.now(); -} - - -/** - * Throttles a function and delays its execution, so it's only called at most - * once within a given time period. - * @param {Function} fn The function to throttle. - * @param {number} timeout The amount of time that must pass before the - * function can be called again. - * @return {Function} The throttled function. - */ -function throttle(fn, timeout) { - var timer = null; - return function () { - if (!timer) { - timer = setTimeout(function() { - fn(); - timer = null; - }, timeout); - } - }; -} - - -/** - * Adds an event handler to a DOM node ensuring cross-browser compatibility. - * @param {Node} node The DOM node to add the event handler to. - * @param {string} event The event name. - * @param {Function} fn The event handler to add. - * @param {boolean} opt_useCapture Optionally adds the even to the capture - * phase. Note: this only works in modern browsers. - */ -function addEvent(node, event, fn, opt_useCapture) { - if (typeof node.addEventListener == 'function') { - node.addEventListener(event, fn, opt_useCapture || false); - } - else if (typeof node.attachEvent == 'function') { - node.attachEvent('on' + event, fn); - } -} - - -/** - * Removes a previously added event handler from a DOM node. - * @param {Node} node The DOM node to remove the event handler from. - * @param {string} event The event name. - * @param {Function} fn The event handler to remove. - * @param {boolean} opt_useCapture If the event handler was added with this - * flag set to true, it should be set to true here in order to remove it. - */ -function removeEvent(node, event, fn, opt_useCapture) { - if (typeof node.removeEventListener == 'function') { - node.removeEventListener(event, fn, opt_useCapture || false); - } - else if (typeof node.detatchEvent == 'function') { - node.detatchEvent('on' + event, fn); - } -} - - -/** - * Returns the intersection between two rect objects. - * @param {Object} rect1 The first rect. - * @param {Object} rect2 The second rect. - * @return {?Object|?ClientRect} The intersection rect or undefined if no - * intersection is found. - */ -function computeRectIntersection(rect1, rect2) { - var top = Math.max(rect1.top, rect2.top); - var bottom = Math.min(rect1.bottom, rect2.bottom); - var left = Math.max(rect1.left, rect2.left); - var right = Math.min(rect1.right, rect2.right); - var width = right - left; - var height = bottom - top; - - return (width >= 0 && height >= 0) && { - top: top, - bottom: bottom, - left: left, - right: right, - width: width, - height: height - } || null; -} - - -/** - * Shims the native getBoundingClientRect for compatibility with older IE. - * @param {Element} el The element whose bounding rect to get. - * @return {DOMRect|ClientRect} The (possibly shimmed) rect of the element. - */ -function getBoundingClientRect(el) { - var rect; - - try { - rect = el.getBoundingClientRect(); - } catch (err) { - // Ignore Windows 7 IE11 "Unspecified error" - // https://github.com/w3c/IntersectionObserver/pull/205 - } - - if (!rect) return getEmptyRect(); - - // Older IE - if (!(rect.width && rect.height)) { - rect = { - top: rect.top, - right: rect.right, - bottom: rect.bottom, - left: rect.left, - width: rect.right - rect.left, - height: rect.bottom - rect.top - }; - } - return rect; -} - - -/** - * Returns an empty rect object. An empty rect is returned when an element - * is not in the DOM. - * @return {ClientRect} The empty rect. - */ -function getEmptyRect() { - return { - top: 0, - bottom: 0, - left: 0, - right: 0, - width: 0, - height: 0 - }; -} - - -/** - * Ensure that the result has all of the necessary fields of the DOMRect. - * Specifically this ensures that `x` and `y` fields are set. - * - * @param {?DOMRect|?ClientRect} rect - * @return {?DOMRect} - */ -function ensureDOMRect(rect) { - // A `DOMRect` object has `x` and `y` fields. - if (!rect || 'x' in rect) { - return rect; - } - // A IE's `ClientRect` type does not have `x` and `y`. The same is the case - // for internally calculated Rect objects. For the purposes of - // `IntersectionObserver`, it's sufficient to simply mirror `left` and `top` - // for these fields. - return { - top: rect.top, - y: rect.top, - bottom: rect.bottom, - left: rect.left, - x: rect.left, - right: rect.right, - width: rect.width, - height: rect.height - }; -} - - -/** - * Inverts the intersection and bounding rect from the parent (frame) BCR to - * the local BCR space. - * @param {DOMRect|ClientRect} parentBoundingRect The parent's bound client rect. - * @param {DOMRect|ClientRect} parentIntersectionRect The parent's own intersection rect. - * @return {ClientRect} The local root bounding rect for the parent's children. - */ -function convertFromParentRect(parentBoundingRect, parentIntersectionRect) { - var top = parentIntersectionRect.top - parentBoundingRect.top; - var left = parentIntersectionRect.left - parentBoundingRect.left; - return { - top: top, - left: left, - height: parentIntersectionRect.height, - width: parentIntersectionRect.width, - bottom: top + parentIntersectionRect.height, - right: left + parentIntersectionRect.width - }; -} - - -/** - * Checks to see if a parent element contains a child element (including inside - * shadow DOM). - * @param {Node} parent The parent element. - * @param {Node} child The child element. - * @return {boolean} True if the parent node contains the child node. - */ -function containsDeep(parent, child) { - var node = child; - while (node) { - if (node == parent) return true; - - node = getParentNode(node); - } - return false; -} - - -/** - * Gets the parent node of an element or its host element if the parent node - * is a shadow root. - * @param {Node} node The node whose parent to get. - * @return {Node|null} The parent node or null if no parent exists. - */ -function getParentNode(node) { - var parent = node.parentNode; - - if (node.nodeType == /* DOCUMENT */ 9 && node != document) { - // If this node is a document node, look for the embedding frame. - return getFrameElement(node); - } - - if (parent && parent.nodeType == 11 && parent.host) { - // If the parent is a shadow root, return the host element. - return parent.host; - } - - if (parent && parent.assignedSlot) { - // If the parent is distributed in a , return the parent of a slot. - return parent.assignedSlot.parentNode; - } - - return parent; -} - - -/** - * Returns the embedding frame element, if any. - * @param {!Document} doc - * @return {!Element} - */ -function getFrameElement(doc) { - try { - return doc.defaultView && doc.defaultView.frameElement || null; - } catch (e) { - // Ignore the error. - return null; - } -} - - -// Exposes the constructors globally. -window.IntersectionObserver = IntersectionObserver; -window.IntersectionObserverEntry = IntersectionObserverEntry; - -}()); - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var stickyfill = createCommonjsModule(function (module) { -(function(window, document) { - - /* - * 1. Check if the browser supports `position: sticky` natively or is too old to run the polyfill. - * If either of these is the case set `seppuku` flag. It will be checked later to disable key features - * of the polyfill, but the API will remain functional to avoid breaking things. - */ - - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - var seppuku = false; - - var isWindowDefined = typeof window !== 'undefined'; - - // The polyfill can’t function properly without `window` or `window.getComputedStyle`. - if (!isWindowDefined || !window.getComputedStyle) seppuku = true; - // Dont’t get in a way if the browser supports `position: sticky` natively. - else { - (function () { - var testNode = document.createElement('div'); - - if (['', '-webkit-', '-moz-', '-ms-'].some(function (prefix) { - try { - testNode.style.position = prefix + 'sticky'; - } catch (e) {} - - return testNode.style.position != ''; - })) seppuku = true; - })(); - } - - /* - * 2. “Global” vars used across the polyfill - */ - var isInitialized = false; - - // Check if Shadow Root constructor exists to make further checks simpler - var shadowRootExists = typeof ShadowRoot !== 'undefined'; - - // Last saved scroll position - var scroll = { - top: null, - left: null - }; - - // Array of created Sticky instances - var stickies = []; - - /* - * 3. Utility functions - */ - function extend(targetObj, sourceObject) { - for (var key in sourceObject) { - if (sourceObject.hasOwnProperty(key)) { - targetObj[key] = sourceObject[key]; - } - } - } - - function parseNumeric(val) { - return parseFloat(val) || 0; - } - - function getDocOffsetTop(node) { - var docOffsetTop = 0; - - while (node) { - docOffsetTop += node.offsetTop; - node = node.offsetParent; - } - - return docOffsetTop; - } - - /* - * 4. Sticky class - */ - - var Sticky = function () { - function Sticky(node) { - _classCallCheck(this, Sticky); - - if (!(node instanceof HTMLElement)) throw new Error('First argument must be HTMLElement'); - if (stickies.some(function (sticky) { - return sticky._node === node; - })) throw new Error('Stickyfill is already applied to this node'); - - this._node = node; - this._stickyMode = null; - this._active = false; - - stickies.push(this); - - this.refresh(); - } - - _createClass(Sticky, [{ - key: 'refresh', - value: function refresh() { - if (seppuku || this._removed) return; - if (this._active) this._deactivate(); - - var node = this._node; - - /* - * 1. Save node computed props - */ - var nodeComputedStyle = getComputedStyle(node); - var nodeComputedProps = { - position: nodeComputedStyle.position, - top: nodeComputedStyle.top, - display: nodeComputedStyle.display, - marginTop: nodeComputedStyle.marginTop, - marginBottom: nodeComputedStyle.marginBottom, - marginLeft: nodeComputedStyle.marginLeft, - marginRight: nodeComputedStyle.marginRight, - cssFloat: nodeComputedStyle.cssFloat - }; - - /* - * 2. Check if the node can be activated - */ - if (isNaN(parseFloat(nodeComputedProps.top)) || nodeComputedProps.display == 'table-cell' || nodeComputedProps.display == 'none') return; - - this._active = true; - - /* - * 3. Check if the current node position is `sticky`. If it is, it means that the browser supports sticky positioning, - * but the polyfill was force-enabled. We set the node’s position to `static` before continuing, so that the node - * is in it’s initial position when we gather its params. - */ - var originalPosition = node.style.position; - if (nodeComputedStyle.position == 'sticky' || nodeComputedStyle.position == '-webkit-sticky') node.style.position = 'static'; - - /* - * 4. Get necessary node parameters - */ - var referenceNode = node.parentNode; - var parentNode = shadowRootExists && referenceNode instanceof ShadowRoot ? referenceNode.host : referenceNode; - var nodeWinOffset = node.getBoundingClientRect(); - var parentWinOffset = parentNode.getBoundingClientRect(); - var parentComputedStyle = getComputedStyle(parentNode); - - this._parent = { - node: parentNode, - styles: { - position: parentNode.style.position - }, - offsetHeight: parentNode.offsetHeight - }; - this._offsetToWindow = { - left: nodeWinOffset.left, - right: document.documentElement.clientWidth - nodeWinOffset.right - }; - this._offsetToParent = { - top: nodeWinOffset.top - parentWinOffset.top - parseNumeric(parentComputedStyle.borderTopWidth), - left: nodeWinOffset.left - parentWinOffset.left - parseNumeric(parentComputedStyle.borderLeftWidth), - right: -nodeWinOffset.right + parentWinOffset.right - parseNumeric(parentComputedStyle.borderRightWidth) - }; - this._styles = { - position: originalPosition, - top: node.style.top, - bottom: node.style.bottom, - left: node.style.left, - right: node.style.right, - width: node.style.width, - marginTop: node.style.marginTop, - marginLeft: node.style.marginLeft, - marginRight: node.style.marginRight - }; - - var nodeTopValue = parseNumeric(nodeComputedProps.top); - this._limits = { - start: nodeWinOffset.top + window.pageYOffset - nodeTopValue, - end: parentWinOffset.top + window.pageYOffset + parentNode.offsetHeight - parseNumeric(parentComputedStyle.borderBottomWidth) - node.offsetHeight - nodeTopValue - parseNumeric(nodeComputedProps.marginBottom) - }; - - /* - * 5. Ensure that the node will be positioned relatively to the parent node - */ - var parentPosition = parentComputedStyle.position; - - if (parentPosition != 'absolute' && parentPosition != 'relative') { - parentNode.style.position = 'relative'; - } - - /* - * 6. Recalc node position. - * It’s important to do this before clone injection to avoid scrolling bug in Chrome. - */ - this._recalcPosition(); - - /* - * 7. Create a clone - */ - var clone = this._clone = {}; - clone.node = document.createElement('div'); - - // Apply styles to the clone - extend(clone.node.style, { - width: nodeWinOffset.right - nodeWinOffset.left + 'px', - height: nodeWinOffset.bottom - nodeWinOffset.top + 'px', - marginTop: nodeComputedProps.marginTop, - marginBottom: nodeComputedProps.marginBottom, - marginLeft: nodeComputedProps.marginLeft, - marginRight: nodeComputedProps.marginRight, - cssFloat: nodeComputedProps.cssFloat, - padding: 0, - border: 0, - borderSpacing: 0, - fontSize: '1em', - position: 'static' - }); - - referenceNode.insertBefore(clone.node, node); - clone.docOffsetTop = getDocOffsetTop(clone.node); - } - }, { - key: '_recalcPosition', - value: function _recalcPosition() { - if (!this._active || this._removed) return; - - var stickyMode = scroll.top <= this._limits.start ? 'start' : scroll.top >= this._limits.end ? 'end' : 'middle'; - - if (this._stickyMode == stickyMode) return; - - switch (stickyMode) { - case 'start': - extend(this._node.style, { - position: 'absolute', - left: this._offsetToParent.left + 'px', - right: this._offsetToParent.right + 'px', - top: this._offsetToParent.top + 'px', - bottom: 'auto', - width: 'auto', - marginLeft: 0, - marginRight: 0, - marginTop: 0 - }); - break; - - case 'middle': - extend(this._node.style, { - position: 'fixed', - left: this._offsetToWindow.left + 'px', - right: this._offsetToWindow.right + 'px', - top: this._styles.top, - bottom: 'auto', - width: 'auto', - marginLeft: 0, - marginRight: 0, - marginTop: 0 - }); - break; - - case 'end': - extend(this._node.style, { - position: 'absolute', - left: this._offsetToParent.left + 'px', - right: this._offsetToParent.right + 'px', - top: 'auto', - bottom: 0, - width: 'auto', - marginLeft: 0, - marginRight: 0 - }); - break; - } - - this._stickyMode = stickyMode; - } - }, { - key: '_fastCheck', - value: function _fastCheck() { - if (!this._active || this._removed) return; - - if (Math.abs(getDocOffsetTop(this._clone.node) - this._clone.docOffsetTop) > 1 || Math.abs(this._parent.node.offsetHeight - this._parent.offsetHeight) > 1) this.refresh(); - } - }, { - key: '_deactivate', - value: function _deactivate() { - var _this = this; - - if (!this._active || this._removed) return; - - this._clone.node.parentNode.removeChild(this._clone.node); - delete this._clone; - - extend(this._node.style, this._styles); - delete this._styles; - - // Check whether element’s parent node is used by other stickies. - // If not, restore parent node’s styles. - if (!stickies.some(function (sticky) { - return sticky !== _this && sticky._parent && sticky._parent.node === _this._parent.node; - })) { - extend(this._parent.node.style, this._parent.styles); - } - delete this._parent; - - this._stickyMode = null; - this._active = false; - - delete this._offsetToWindow; - delete this._offsetToParent; - delete this._limits; - } - }, { - key: 'remove', - value: function remove() { - var _this2 = this; - - this._deactivate(); - - stickies.some(function (sticky, index) { - if (sticky._node === _this2._node) { - stickies.splice(index, 1); - return true; - } - }); - - this._removed = true; - } - }]); - - return Sticky; - }(); - - /* - * 5. Stickyfill API - */ - - - var Stickyfill = { - stickies: stickies, - Sticky: Sticky, - - forceSticky: function forceSticky() { - seppuku = false; - init(); - - this.refreshAll(); - }, - addOne: function addOne(node) { - // Check whether it’s a node - if (!(node instanceof HTMLElement)) { - // Maybe it’s a node list of some sort? - // Take first node from the list then - if (node.length && node[0]) node = node[0];else return; - } - - // Check if Stickyfill is already applied to the node - // and return existing sticky - for (var i = 0; i < stickies.length; i++) { - if (stickies[i]._node === node) return stickies[i]; - } - - // Create and return new sticky - return new Sticky(node); - }, - add: function add(nodeList) { - // If it’s a node make an array of one node - if (nodeList instanceof HTMLElement) nodeList = [nodeList]; - // Check if the argument is an iterable of some sort - if (!nodeList.length) return; - - // Add every element as a sticky and return an array of created Sticky instances - var addedStickies = []; - - var _loop = function _loop(i) { - var node = nodeList[i]; - - // If it’s not an HTMLElement – create an empty element to preserve 1-to-1 - // correlation with input list - if (!(node instanceof HTMLElement)) { - addedStickies.push(void 0); - return 'continue'; - } - - // If Stickyfill is already applied to the node - // add existing sticky - if (stickies.some(function (sticky) { - if (sticky._node === node) { - addedStickies.push(sticky); - return true; - } - })) return 'continue'; - - // Create and add new sticky - addedStickies.push(new Sticky(node)); - }; - - for (var i = 0; i < nodeList.length; i++) { - var _ret2 = _loop(i); - - if (_ret2 === 'continue') continue; - } - - return addedStickies; - }, - refreshAll: function refreshAll() { - stickies.forEach(function (sticky) { - return sticky.refresh(); - }); - }, - removeOne: function removeOne(node) { - // Check whether it’s a node - if (!(node instanceof HTMLElement)) { - // Maybe it’s a node list of some sort? - // Take first node from the list then - if (node.length && node[0]) node = node[0];else return; - } - - // Remove the stickies bound to the nodes in the list - stickies.some(function (sticky) { - if (sticky._node === node) { - sticky.remove(); - return true; - } - }); - }, - remove: function remove(nodeList) { - // If it’s a node make an array of one node - if (nodeList instanceof HTMLElement) nodeList = [nodeList]; - // Check if the argument is an iterable of some sort - if (!nodeList.length) return; - - // Remove the stickies bound to the nodes in the list - - var _loop2 = function _loop2(i) { - var node = nodeList[i]; - - stickies.some(function (sticky) { - if (sticky._node === node) { - sticky.remove(); - return true; - } - }); - }; - - for (var i = 0; i < nodeList.length; i++) { - _loop2(i); - } - }, - removeAll: function removeAll() { - while (stickies.length) { - stickies[0].remove(); - } - } - }; - - /* - * 6. Setup events (unless the polyfill was disabled) - */ - function init() { - if (isInitialized) { - return; - } - - isInitialized = true; - - // Watch for scroll position changes and trigger recalc/refresh if needed - function checkScroll() { - if (window.pageXOffset != scroll.left) { - scroll.top = window.pageYOffset; - scroll.left = window.pageXOffset; - - Stickyfill.refreshAll(); - } else if (window.pageYOffset != scroll.top) { - scroll.top = window.pageYOffset; - scroll.left = window.pageXOffset; - - // recalc position for all stickies - stickies.forEach(function (sticky) { - return sticky._recalcPosition(); - }); - } - } - - checkScroll(); - window.addEventListener('scroll', checkScroll); - - // Watch for window resizes and device orientation changes and trigger refresh - window.addEventListener('resize', Stickyfill.refreshAll); - window.addEventListener('orientationchange', Stickyfill.refreshAll); - - //Fast dirty check for layout changes every 500ms - var fastCheckTimer = void 0; - - function startFastCheckTimer() { - fastCheckTimer = setInterval(function () { - stickies.forEach(function (sticky) { - return sticky._fastCheck(); - }); - }, 500); - } - - function stopFastCheckTimer() { - clearInterval(fastCheckTimer); - } - - var docHiddenKey = void 0; - var visibilityChangeEventName = void 0; - - if ('hidden' in document) { - docHiddenKey = 'hidden'; - visibilityChangeEventName = 'visibilitychange'; - } else if ('webkitHidden' in document) { - docHiddenKey = 'webkitHidden'; - visibilityChangeEventName = 'webkitvisibilitychange'; - } - - if (visibilityChangeEventName) { - if (!document[docHiddenKey]) startFastCheckTimer(); - - document.addEventListener(visibilityChangeEventName, function () { - if (document[docHiddenKey]) { - stopFastCheckTimer(); - } else { - startFastCheckTimer(); - } - }); - } else startFastCheckTimer(); - } - - if (!seppuku) init(); - - /* - * 7. Expose Stickyfill - */ - if (module.exports) { - module.exports = Stickyfill; - } else if (isWindowDefined) { - window.Stickyfill = Stickyfill; - } - -})(window, document); -}); - -var smoothscroll = createCommonjsModule(function (module, exports) { -/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */ -(function () { - - // polyfill - function polyfill() { - // aliases - var w = window; - var d = document; - - // return if scroll behavior is supported and polyfill is not forced - if ( - 'scrollBehavior' in d.documentElement.style && - w.__forceSmoothScrollPolyfill__ !== true - ) { - return; - } - - // globals - var Element = w.HTMLElement || w.Element; - var SCROLL_TIME = 468; - - // object gathering original scroll methods - var original = { - scroll: w.scroll || w.scrollTo, - scrollBy: w.scrollBy, - elementScroll: Element.prototype.scroll || scrollElement, - scrollIntoView: Element.prototype.scrollIntoView - }; - - // define timing method - var now = - w.performance && w.performance.now - ? w.performance.now.bind(w.performance) - : Date.now; - - /** - * indicates if a the current browser is made by Microsoft - * @method isMicrosoftBrowser - * @param {String} userAgent - * @returns {Boolean} - */ - function isMicrosoftBrowser(userAgent) { - var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/']; - - return new RegExp(userAgentPatterns.join('|')).test(userAgent); - } - - /* - * IE has rounding bug rounding down clientHeight and clientWidth and - * rounding up scrollHeight and scrollWidth causing false positives - * on hasScrollableSpace - */ - var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0; - - /** - * changes scroll position inside an element - * @method scrollElement - * @param {Number} x - * @param {Number} y - * @returns {undefined} - */ - function scrollElement(x, y) { - this.scrollLeft = x; - this.scrollTop = y; - } - - /** - * returns result of applying ease math function to a number - * @method ease - * @param {Number} k - * @returns {Number} - */ - function ease(k) { - return 0.5 * (1 - Math.cos(Math.PI * k)); - } - - /** - * indicates if a smooth behavior should be applied - * @method shouldBailOut - * @param {Number|Object} firstArg - * @returns {Boolean} - */ - function shouldBailOut(firstArg) { - if ( - firstArg === null || - typeof firstArg !== 'object' || - firstArg.behavior === undefined || - firstArg.behavior === 'auto' || - firstArg.behavior === 'instant' - ) { - // first argument is not an object/null - // or behavior is auto, instant or undefined - return true; - } - - if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') { - // first argument is an object and behavior is smooth - return false; - } - - // throw error when behavior is not supported - throw new TypeError( - 'behavior member of ScrollOptions ' + - firstArg.behavior + - ' is not a valid value for enumeration ScrollBehavior.' - ); - } - - /** - * indicates if an element has scrollable space in the provided axis - * @method hasScrollableSpace - * @param {Node} el - * @param {String} axis - * @returns {Boolean} - */ - function hasScrollableSpace(el, axis) { - if (axis === 'Y') { - return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight; - } - - if (axis === 'X') { - return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth; - } - } - - /** - * indicates if an element has a scrollable overflow property in the axis - * @method canOverflow - * @param {Node} el - * @param {String} axis - * @returns {Boolean} - */ - function canOverflow(el, axis) { - var overflowValue = w.getComputedStyle(el, null)['overflow' + axis]; - - return overflowValue === 'auto' || overflowValue === 'scroll'; - } - - /** - * indicates if an element can be scrolled in either axis - * @method isScrollable - * @param {Node} el - * @param {String} axis - * @returns {Boolean} - */ - function isScrollable(el) { - var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y'); - var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X'); - - return isScrollableY || isScrollableX; - } - - /** - * finds scrollable parent of an element - * @method findScrollableParent - * @param {Node} el - * @returns {Node} el - */ - function findScrollableParent(el) { - while (el !== d.body && isScrollable(el) === false) { - el = el.parentNode || el.host; - } - - return el; - } - - /** - * self invoked function that, given a context, steps through scrolling - * @method step - * @param {Object} context - * @returns {undefined} - */ - function step(context) { - var time = now(); - var value; - var currentX; - var currentY; - var elapsed = (time - context.startTime) / SCROLL_TIME; - - // avoid elapsed times higher than one - elapsed = elapsed > 1 ? 1 : elapsed; - - // apply easing to elapsed time - value = ease(elapsed); - - currentX = context.startX + (context.x - context.startX) * value; - currentY = context.startY + (context.y - context.startY) * value; - - context.method.call(context.scrollable, currentX, currentY); - - // scroll more if we have not reached our destination - if (currentX !== context.x || currentY !== context.y) { - w.requestAnimationFrame(step.bind(w, context)); - } - } - - /** - * scrolls window or element with a smooth behavior - * @method smoothScroll - * @param {Object|Node} el - * @param {Number} x - * @param {Number} y - * @returns {undefined} - */ - function smoothScroll(el, x, y) { - var scrollable; - var startX; - var startY; - var method; - var startTime = now(); - - // define scroll context - if (el === d.body) { - scrollable = w; - startX = w.scrollX || w.pageXOffset; - startY = w.scrollY || w.pageYOffset; - method = original.scroll; - } else { - scrollable = el; - startX = el.scrollLeft; - startY = el.scrollTop; - method = scrollElement; - } - - // scroll looping over a frame - step({ - scrollable: scrollable, - method: method, - startTime: startTime, - startX: startX, - startY: startY, - x: x, - y: y - }); - } - - // ORIGINAL METHODS OVERRIDES - // w.scroll and w.scrollTo - w.scroll = w.scrollTo = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - original.scroll.call( - w, - arguments[0].left !== undefined - ? arguments[0].left - : typeof arguments[0] !== 'object' - ? arguments[0] - : w.scrollX || w.pageXOffset, - // use top prop, second argument if present or fallback to scrollY - arguments[0].top !== undefined - ? arguments[0].top - : arguments[1] !== undefined - ? arguments[1] - : w.scrollY || w.pageYOffset - ); - - return; - } - - // LET THE SMOOTHNESS BEGIN! - smoothScroll.call( - w, - d.body, - arguments[0].left !== undefined - ? ~~arguments[0].left - : w.scrollX || w.pageXOffset, - arguments[0].top !== undefined - ? ~~arguments[0].top - : w.scrollY || w.pageYOffset - ); - }; - - // w.scrollBy - w.scrollBy = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0])) { - original.scrollBy.call( - w, - arguments[0].left !== undefined - ? arguments[0].left - : typeof arguments[0] !== 'object' ? arguments[0] : 0, - arguments[0].top !== undefined - ? arguments[0].top - : arguments[1] !== undefined ? arguments[1] : 0 - ); - - return; - } - - // LET THE SMOOTHNESS BEGIN! - smoothScroll.call( - w, - d.body, - ~~arguments[0].left + (w.scrollX || w.pageXOffset), - ~~arguments[0].top + (w.scrollY || w.pageYOffset) - ); - }; - - // Element.prototype.scroll and Element.prototype.scrollTo - Element.prototype.scroll = Element.prototype.scrollTo = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - // if one number is passed, throw error to match Firefox implementation - if (typeof arguments[0] === 'number' && arguments[1] === undefined) { - throw new SyntaxError('Value could not be converted'); - } - - original.elementScroll.call( - this, - // use left prop, first number argument or fallback to scrollLeft - arguments[0].left !== undefined - ? ~~arguments[0].left - : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft, - // use top prop, second argument or fallback to scrollTop - arguments[0].top !== undefined - ? ~~arguments[0].top - : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop - ); - - return; - } - - var left = arguments[0].left; - var top = arguments[0].top; - - // LET THE SMOOTHNESS BEGIN! - smoothScroll.call( - this, - this, - typeof left === 'undefined' ? this.scrollLeft : ~~left, - typeof top === 'undefined' ? this.scrollTop : ~~top - ); - }; - - // Element.prototype.scrollBy - Element.prototype.scrollBy = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - original.elementScroll.call( - this, - arguments[0].left !== undefined - ? ~~arguments[0].left + this.scrollLeft - : ~~arguments[0] + this.scrollLeft, - arguments[0].top !== undefined - ? ~~arguments[0].top + this.scrollTop - : ~~arguments[1] + this.scrollTop - ); - - return; - } - - this.scroll({ - left: ~~arguments[0].left + this.scrollLeft, - top: ~~arguments[0].top + this.scrollTop, - behavior: arguments[0].behavior - }); - }; - - // Element.prototype.scrollIntoView - Element.prototype.scrollIntoView = function() { - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - original.scrollIntoView.call( - this, - arguments[0] === undefined ? true : arguments[0] - ); - - return; - } - - // LET THE SMOOTHNESS BEGIN! - var scrollableParent = findScrollableParent(this); - var parentRects = scrollableParent.getBoundingClientRect(); - var clientRects = this.getBoundingClientRect(); - - if (scrollableParent !== d.body) { - // reveal element inside parent - smoothScroll.call( - this, - scrollableParent, - scrollableParent.scrollLeft + clientRects.left - parentRects.left, - scrollableParent.scrollTop + clientRects.top - parentRects.top - ); - - // reveal parent in viewport unless is fixed - if (w.getComputedStyle(scrollableParent).position !== 'fixed') { - w.scrollBy({ - left: parentRects.left, - top: parentRects.top, - behavior: 'smooth' - }); - } - } else { - // reveal element in viewport - w.scrollBy({ - left: clientRects.left, - top: clientRects.top, - behavior: 'smooth' - }); - } - }; - } - - { - // commonjs - module.exports = { polyfill: polyfill }; - } - -}()); -}); -smoothscroll.polyfill; - -const smoothScrollPolyfill = smoothscroll.polyfill; - -var commonJsModules = { smoothScrollPolyfill, stickyPolyfill: stickyfill }; -var commonJsModules_1 = commonJsModules.smoothScrollPolyfill; -var commonJsModules_2 = commonJsModules.stickyPolyfill; - -export { commonJsModules as default, commonJsModules_1 as smoothScrollPolyfill, commonJsModules_2 as stickyPolyfill }; -//# sourceMappingURL=common-js-modules.esm.js.map diff --git a/lib/common-js-modules.esm.js.map b/lib/common-js-modules.esm.js.map deleted file mode 100644 index f17f714..0000000 --- a/lib/common-js-modules.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common-js-modules.esm.js","sources":["../node_modules/intersection-observer/intersection-observer.js","../node_modules/stickyfilljs/dist/stickyfill.js","../node_modules/smoothscroll-polyfill/dist/smoothscroll.js","common-js-modules.js"],"sourcesContent":["/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.\n *\n * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n *\n */\n(function() {\n'use strict';\n\n// Exit early if we're not running in a browser.\nif (typeof window !== 'object') {\n return;\n}\n\n// Exit early if all IntersectionObserver and IntersectionObserverEntry\n// features are natively supported.\nif ('IntersectionObserver' in window &&\n 'IntersectionObserverEntry' in window &&\n 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\n\n // Minimal polyfill for Edge 15's lack of `isIntersecting`\n // See: https://github.com/w3c/IntersectionObserver/issues/211\n if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {\n Object.defineProperty(window.IntersectionObserverEntry.prototype,\n 'isIntersecting', {\n get: function () {\n return this.intersectionRatio > 0;\n }\n });\n }\n return;\n}\n\n\n/**\n * A local reference to the document.\n */\nvar document = window.document;\n\n\n/**\n * An IntersectionObserver registry. This registry exists to hold a strong\n * reference to IntersectionObserver instances currently observing a target\n * element. Without this registry, instances without another reference may be\n * garbage collected.\n */\nvar registry = [];\n\n/**\n * The signal updater for cross-origin intersection. When not null, it means\n * that the polyfill is configured to work in a cross-origin mode.\n * @type {function(DOMRect|ClientRect, DOMRect|ClientRect)}\n */\nvar crossOriginUpdater = null;\n\n/**\n * The current cross-origin intersection. Only used in the cross-origin mode.\n * @type {DOMRect|ClientRect}\n */\nvar crossOriginRect = null;\n\n\n/**\n * Creates the global IntersectionObserverEntry constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry\n * @param {Object} entry A dictionary of instance properties.\n * @constructor\n */\nfunction IntersectionObserverEntry(entry) {\n this.time = entry.time;\n this.target = entry.target;\n this.rootBounds = ensureDOMRect(entry.rootBounds);\n this.boundingClientRect = ensureDOMRect(entry.boundingClientRect);\n this.intersectionRect = ensureDOMRect(entry.intersectionRect || getEmptyRect());\n this.isIntersecting = !!entry.intersectionRect;\n\n // Calculates the intersection ratio.\n var targetRect = this.boundingClientRect;\n var targetArea = targetRect.width * targetRect.height;\n var intersectionRect = this.intersectionRect;\n var intersectionArea = intersectionRect.width * intersectionRect.height;\n\n // Sets intersection ratio.\n if (targetArea) {\n // Round the intersection ratio to avoid floating point math issues:\n // https://github.com/w3c/IntersectionObserver/issues/324\n this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));\n } else {\n // If area is zero and is intersecting, sets to 1, otherwise to 0\n this.intersectionRatio = this.isIntersecting ? 1 : 0;\n }\n}\n\n\n/**\n * Creates the global IntersectionObserver constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface\n * @param {Function} callback The function to be invoked after intersection\n * changes have queued. The function is not invoked if the queue has\n * been emptied by calling the `takeRecords` method.\n * @param {Object=} opt_options Optional configuration options.\n * @constructor\n */\nfunction IntersectionObserver(callback, opt_options) {\n\n var options = opt_options || {};\n\n if (typeof callback != 'function') {\n throw new Error('callback must be a function');\n }\n\n if (options.root && options.root.nodeType != 1) {\n throw new Error('root must be an Element');\n }\n\n // Binds and throttles `this._checkForIntersections`.\n this._checkForIntersections = throttle(\n this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);\n\n // Private properties.\n this._callback = callback;\n this._observationTargets = [];\n this._queuedEntries = [];\n this._rootMarginValues = this._parseRootMargin(options.rootMargin);\n\n // Public properties.\n this.thresholds = this._initThresholds(options.threshold);\n this.root = options.root || null;\n this.rootMargin = this._rootMarginValues.map(function(margin) {\n return margin.value + margin.unit;\n }).join(' ');\n\n /** @private @const {!Array} */\n this._monitoringDocuments = [];\n /** @private @const {!Array} */\n this._monitoringUnsubscribes = [];\n}\n\n\n/**\n * The minimum interval within which the document will be checked for\n * intersection changes.\n */\nIntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;\n\n\n/**\n * The frequency in which the polyfill polls for intersection changes.\n * this can be updated on a per instance basis and must be set prior to\n * calling `observe` on the first target.\n */\nIntersectionObserver.prototype.POLL_INTERVAL = null;\n\n/**\n * Use a mutation observer on the root element\n * to detect intersection changes.\n */\nIntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;\n\n\n/**\n * Sets up the polyfill in the cross-origin mode. The result is the\n * updater function that accepts two arguments: `boundingClientRect` and\n * `intersectionRect` - just as these fields would be available to the\n * parent via `IntersectionObserverEntry`. This function should be called\n * each time the iframe receives intersection information from the parent\n * window, e.g. via messaging.\n * @return {function(DOMRect|ClientRect, DOMRect|ClientRect)}\n */\nIntersectionObserver._setupCrossOriginUpdater = function() {\n if (!crossOriginUpdater) {\n /**\n * @param {DOMRect|ClientRect} boundingClientRect\n * @param {DOMRect|ClientRect} intersectionRect\n */\n crossOriginUpdater = function(boundingClientRect, intersectionRect) {\n if (!boundingClientRect || !intersectionRect) {\n crossOriginRect = getEmptyRect();\n } else {\n crossOriginRect = convertFromParentRect(boundingClientRect, intersectionRect);\n }\n registry.forEach(function(observer) {\n observer._checkForIntersections();\n });\n };\n }\n return crossOriginUpdater;\n};\n\n\n/**\n * Resets the cross-origin mode.\n */\nIntersectionObserver._resetCrossOriginUpdater = function() {\n crossOriginUpdater = null;\n crossOriginRect = null;\n};\n\n\n/**\n * Starts observing a target element for intersection changes based on\n * the thresholds values.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.observe = function(target) {\n var isTargetAlreadyObserved = this._observationTargets.some(function(item) {\n return item.element == target;\n });\n\n if (isTargetAlreadyObserved) {\n return;\n }\n\n if (!(target && target.nodeType == 1)) {\n throw new Error('target must be an Element');\n }\n\n this._registerInstance();\n this._observationTargets.push({element: target, entry: null});\n this._monitorIntersections(target.ownerDocument);\n this._checkForIntersections();\n};\n\n\n/**\n * Stops observing a target element for intersection changes.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.unobserve = function(target) {\n this._observationTargets =\n this._observationTargets.filter(function(item) {\n return item.element != target;\n });\n this._unmonitorIntersections(target.ownerDocument);\n if (this._observationTargets.length == 0) {\n this._unregisterInstance();\n }\n};\n\n\n/**\n * Stops observing all target elements for intersection changes.\n */\nIntersectionObserver.prototype.disconnect = function() {\n this._observationTargets = [];\n this._unmonitorAllIntersections();\n this._unregisterInstance();\n};\n\n\n/**\n * Returns any queue entries that have not yet been reported to the\n * callback and clears the queue. This can be used in conjunction with the\n * callback to obtain the absolute most up-to-date intersection information.\n * @return {Array} The currently queued entries.\n */\nIntersectionObserver.prototype.takeRecords = function() {\n var records = this._queuedEntries.slice();\n this._queuedEntries = [];\n return records;\n};\n\n\n/**\n * Accepts the threshold value from the user configuration object and\n * returns a sorted array of unique threshold values. If a value is not\n * between 0 and 1 and error is thrown.\n * @private\n * @param {Array|number=} opt_threshold An optional threshold value or\n * a list of threshold values, defaulting to [0].\n * @return {Array} A sorted list of unique and valid threshold values.\n */\nIntersectionObserver.prototype._initThresholds = function(opt_threshold) {\n var threshold = opt_threshold || [0];\n if (!Array.isArray(threshold)) threshold = [threshold];\n\n return threshold.sort().filter(function(t, i, a) {\n if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {\n throw new Error('threshold must be a number between 0 and 1 inclusively');\n }\n return t !== a[i - 1];\n });\n};\n\n\n/**\n * Accepts the rootMargin value from the user configuration object\n * and returns an array of the four margin values as an object containing\n * the value and unit properties. If any of the values are not properly\n * formatted or use a unit other than px or %, and error is thrown.\n * @private\n * @param {string=} opt_rootMargin An optional rootMargin value,\n * defaulting to '0px'.\n * @return {Array} An array of margin objects with the keys\n * value and unit.\n */\nIntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) {\n var marginString = opt_rootMargin || '0px';\n var margins = marginString.split(/\\s+/).map(function(margin) {\n var parts = /^(-?\\d*\\.?\\d+)(px|%)$/.exec(margin);\n if (!parts) {\n throw new Error('rootMargin must be specified in pixels or percent');\n }\n return {value: parseFloat(parts[1]), unit: parts[2]};\n });\n\n // Handles shorthand.\n margins[1] = margins[1] || margins[0];\n margins[2] = margins[2] || margins[0];\n margins[3] = margins[3] || margins[1];\n\n return margins;\n};\n\n\n/**\n * Starts polling for intersection changes if the polling is not already\n * happening, and if the page's visibility state is visible.\n * @param {!Document} doc\n * @private\n */\nIntersectionObserver.prototype._monitorIntersections = function(doc) {\n var win = doc.defaultView;\n if (!win) {\n // Already destroyed.\n return;\n }\n if (this._monitoringDocuments.indexOf(doc) != -1) {\n // Already monitoring.\n return;\n }\n\n // Private state for monitoring.\n var callback = this._checkForIntersections;\n var monitoringInterval = null;\n var domObserver = null;\n\n // If a poll interval is set, use polling instead of listening to\n // resize and scroll events or DOM mutations.\n if (this.POLL_INTERVAL) {\n monitoringInterval = win.setInterval(callback, this.POLL_INTERVAL);\n } else {\n addEvent(win, 'resize', callback, true);\n addEvent(doc, 'scroll', callback, true);\n if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in win) {\n domObserver = new win.MutationObserver(callback);\n domObserver.observe(doc, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n });\n }\n }\n\n this._monitoringDocuments.push(doc);\n this._monitoringUnsubscribes.push(function() {\n // Get the window object again. When a friendly iframe is destroyed, it\n // will be null.\n var win = doc.defaultView;\n\n if (win) {\n if (monitoringInterval) {\n win.clearInterval(monitoringInterval);\n }\n removeEvent(win, 'resize', callback, true);\n }\n\n removeEvent(doc, 'scroll', callback, true);\n if (domObserver) {\n domObserver.disconnect();\n }\n });\n\n // Also monitor the parent.\n if (doc != (this.root && this.root.ownerDocument || document)) {\n var frame = getFrameElement(doc);\n if (frame) {\n this._monitorIntersections(frame.ownerDocument);\n }\n }\n};\n\n\n/**\n * Stops polling for intersection changes.\n * @param {!Document} doc\n * @private\n */\nIntersectionObserver.prototype._unmonitorIntersections = function(doc) {\n var index = this._monitoringDocuments.indexOf(doc);\n if (index == -1) {\n return;\n }\n\n var rootDoc = (this.root && this.root.ownerDocument || document);\n\n // Check if any dependent targets are still remaining.\n var hasDependentTargets =\n this._observationTargets.some(function(item) {\n var itemDoc = item.element.ownerDocument;\n // Target is in this context.\n if (itemDoc == doc) {\n return true;\n }\n // Target is nested in this context.\n while (itemDoc && itemDoc != rootDoc) {\n var frame = getFrameElement(itemDoc);\n itemDoc = frame && frame.ownerDocument;\n if (itemDoc == doc) {\n return true;\n }\n }\n return false;\n });\n if (hasDependentTargets) {\n return;\n }\n\n // Unsubscribe.\n var unsubscribe = this._monitoringUnsubscribes[index];\n this._monitoringDocuments.splice(index, 1);\n this._monitoringUnsubscribes.splice(index, 1);\n unsubscribe();\n\n // Also unmonitor the parent.\n if (doc != rootDoc) {\n var frame = getFrameElement(doc);\n if (frame) {\n this._unmonitorIntersections(frame.ownerDocument);\n }\n }\n};\n\n\n/**\n * Stops polling for intersection changes.\n * @param {!Document} doc\n * @private\n */\nIntersectionObserver.prototype._unmonitorAllIntersections = function() {\n var unsubscribes = this._monitoringUnsubscribes.slice(0);\n this._monitoringDocuments.length = 0;\n this._monitoringUnsubscribes.length = 0;\n for (var i = 0; i < unsubscribes.length; i++) {\n unsubscribes[i]();\n }\n};\n\n\n/**\n * Scans each observation target for intersection changes and adds them\n * to the internal entries queue. If new entries are found, it\n * schedules the callback to be invoked.\n * @private\n */\nIntersectionObserver.prototype._checkForIntersections = function() {\n if (!this.root && crossOriginUpdater && !crossOriginRect) {\n // Cross origin monitoring, but no initial data available yet.\n return;\n }\n\n var rootIsInDom = this._rootIsInDom();\n var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();\n\n this._observationTargets.forEach(function(item) {\n var target = item.element;\n var targetRect = getBoundingClientRect(target);\n var rootContainsTarget = this._rootContainsTarget(target);\n var oldEntry = item.entry;\n var intersectionRect = rootIsInDom && rootContainsTarget &&\n this._computeTargetAndRootIntersection(target, targetRect, rootRect);\n\n var newEntry = item.entry = new IntersectionObserverEntry({\n time: now(),\n target: target,\n boundingClientRect: targetRect,\n rootBounds: crossOriginUpdater && !this.root ? null : rootRect,\n intersectionRect: intersectionRect\n });\n\n if (!oldEntry) {\n this._queuedEntries.push(newEntry);\n } else if (rootIsInDom && rootContainsTarget) {\n // If the new entry intersection ratio has crossed any of the\n // thresholds, add a new entry.\n if (this._hasCrossedThreshold(oldEntry, newEntry)) {\n this._queuedEntries.push(newEntry);\n }\n } else {\n // If the root is not in the DOM or target is not contained within\n // root but the previous entry for this target had an intersection,\n // add a new record indicating removal.\n if (oldEntry && oldEntry.isIntersecting) {\n this._queuedEntries.push(newEntry);\n }\n }\n }, this);\n\n if (this._queuedEntries.length) {\n this._callback(this.takeRecords(), this);\n }\n};\n\n\n/**\n * Accepts a target and root rect computes the intersection between then\n * following the algorithm in the spec.\n * TODO(philipwalton): at this time clip-path is not considered.\n * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo\n * @param {Element} target The target DOM element\n * @param {Object} targetRect The bounding rect of the target.\n * @param {Object} rootRect The bounding rect of the root after being\n * expanded by the rootMargin value.\n * @return {?Object} The final intersection rect object or undefined if no\n * intersection is found.\n * @private\n */\nIntersectionObserver.prototype._computeTargetAndRootIntersection =\n function(target, targetRect, rootRect) {\n // If the element isn't displayed, an intersection can't happen.\n if (window.getComputedStyle(target).display == 'none') return;\n\n var intersectionRect = targetRect;\n var parent = getParentNode(target);\n var atRoot = false;\n\n while (!atRoot && parent) {\n var parentRect = null;\n var parentComputedStyle = parent.nodeType == 1 ?\n window.getComputedStyle(parent) : {};\n\n // If the parent isn't displayed, an intersection can't happen.\n if (parentComputedStyle.display == 'none') return null;\n\n if (parent == this.root || parent.nodeType == /* DOCUMENT */ 9) {\n atRoot = true;\n if (parent == this.root || parent == document) {\n if (crossOriginUpdater && !this.root) {\n if (!crossOriginRect ||\n crossOriginRect.width == 0 && crossOriginRect.height == 0) {\n // A 0-size cross-origin intersection means no-intersection.\n parent = null;\n parentRect = null;\n intersectionRect = null;\n } else {\n parentRect = crossOriginRect;\n }\n } else {\n parentRect = rootRect;\n }\n } else {\n // Check if there's a frame that can be navigated to.\n var frame = getParentNode(parent);\n var frameRect = frame && getBoundingClientRect(frame);\n var frameIntersect =\n frame &&\n this._computeTargetAndRootIntersection(frame, frameRect, rootRect);\n if (frameRect && frameIntersect) {\n parent = frame;\n parentRect = convertFromParentRect(frameRect, frameIntersect);\n } else {\n parent = null;\n intersectionRect = null;\n }\n }\n } else {\n // If the element has a non-visible overflow, and it's not the \n // or element, update the intersection rect.\n // Note: and cannot be clipped to a rect that's not also\n // the document rect, so no need to compute a new intersection.\n var doc = parent.ownerDocument;\n if (parent != doc.body &&\n parent != doc.documentElement &&\n parentComputedStyle.overflow != 'visible') {\n parentRect = getBoundingClientRect(parent);\n }\n }\n\n // If either of the above conditionals set a new parentRect,\n // calculate new intersection data.\n if (parentRect) {\n intersectionRect = computeRectIntersection(parentRect, intersectionRect);\n }\n if (!intersectionRect) break;\n parent = parent && getParentNode(parent);\n }\n return intersectionRect;\n};\n\n\n/**\n * Returns the root rect after being expanded by the rootMargin value.\n * @return {ClientRect} The expanded root rect.\n * @private\n */\nIntersectionObserver.prototype._getRootRect = function() {\n var rootRect;\n if (this.root) {\n rootRect = getBoundingClientRect(this.root);\n } else {\n // Use / instead of window since scroll bars affect size.\n var html = document.documentElement;\n var body = document.body;\n rootRect = {\n top: 0,\n left: 0,\n right: html.clientWidth || body.clientWidth,\n width: html.clientWidth || body.clientWidth,\n bottom: html.clientHeight || body.clientHeight,\n height: html.clientHeight || body.clientHeight\n };\n }\n return this._expandRectByRootMargin(rootRect);\n};\n\n\n/**\n * Accepts a rect and expands it by the rootMargin value.\n * @param {DOMRect|ClientRect} rect The rect object to expand.\n * @return {ClientRect} The expanded rect.\n * @private\n */\nIntersectionObserver.prototype._expandRectByRootMargin = function(rect) {\n var margins = this._rootMarginValues.map(function(margin, i) {\n return margin.unit == 'px' ? margin.value :\n margin.value * (i % 2 ? rect.width : rect.height) / 100;\n });\n var newRect = {\n top: rect.top - margins[0],\n right: rect.right + margins[1],\n bottom: rect.bottom + margins[2],\n left: rect.left - margins[3]\n };\n newRect.width = newRect.right - newRect.left;\n newRect.height = newRect.bottom - newRect.top;\n\n return newRect;\n};\n\n\n/**\n * Accepts an old and new entry and returns true if at least one of the\n * threshold values has been crossed.\n * @param {?IntersectionObserverEntry} oldEntry The previous entry for a\n * particular target element or null if no previous entry exists.\n * @param {IntersectionObserverEntry} newEntry The current entry for a\n * particular target element.\n * @return {boolean} Returns true if a any threshold has been crossed.\n * @private\n */\nIntersectionObserver.prototype._hasCrossedThreshold =\n function(oldEntry, newEntry) {\n\n // To make comparing easier, an entry that has a ratio of 0\n // but does not actually intersect is given a value of -1\n var oldRatio = oldEntry && oldEntry.isIntersecting ?\n oldEntry.intersectionRatio || 0 : -1;\n var newRatio = newEntry.isIntersecting ?\n newEntry.intersectionRatio || 0 : -1;\n\n // Ignore unchanged ratios\n if (oldRatio === newRatio) return;\n\n for (var i = 0; i < this.thresholds.length; i++) {\n var threshold = this.thresholds[i];\n\n // Return true if an entry matches a threshold or if the new ratio\n // and the old ratio are on the opposite sides of a threshold.\n if (threshold == oldRatio || threshold == newRatio ||\n threshold < oldRatio !== threshold < newRatio) {\n return true;\n }\n }\n};\n\n\n/**\n * Returns whether or not the root element is an element and is in the DOM.\n * @return {boolean} True if the root element is an element and is in the DOM.\n * @private\n */\nIntersectionObserver.prototype._rootIsInDom = function() {\n return !this.root || containsDeep(document, this.root);\n};\n\n\n/**\n * Returns whether or not the target element is a child of root.\n * @param {Element} target The target element to check.\n * @return {boolean} True if the target element is a child of root.\n * @private\n */\nIntersectionObserver.prototype._rootContainsTarget = function(target) {\n return containsDeep(this.root || document, target) &&\n (!this.root || this.root.ownerDocument == target.ownerDocument);\n};\n\n\n/**\n * Adds the instance to the global IntersectionObserver registry if it isn't\n * already present.\n * @private\n */\nIntersectionObserver.prototype._registerInstance = function() {\n if (registry.indexOf(this) < 0) {\n registry.push(this);\n }\n};\n\n\n/**\n * Removes the instance from the global IntersectionObserver registry.\n * @private\n */\nIntersectionObserver.prototype._unregisterInstance = function() {\n var index = registry.indexOf(this);\n if (index != -1) registry.splice(index, 1);\n};\n\n\n/**\n * Returns the result of the performance.now() method or null in browsers\n * that don't support the API.\n * @return {number} The elapsed time since the page was requested.\n */\nfunction now() {\n return window.performance && performance.now && performance.now();\n}\n\n\n/**\n * Throttles a function and delays its execution, so it's only called at most\n * once within a given time period.\n * @param {Function} fn The function to throttle.\n * @param {number} timeout The amount of time that must pass before the\n * function can be called again.\n * @return {Function} The throttled function.\n */\nfunction throttle(fn, timeout) {\n var timer = null;\n return function () {\n if (!timer) {\n timer = setTimeout(function() {\n fn();\n timer = null;\n }, timeout);\n }\n };\n}\n\n\n/**\n * Adds an event handler to a DOM node ensuring cross-browser compatibility.\n * @param {Node} node The DOM node to add the event handler to.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to add.\n * @param {boolean} opt_useCapture Optionally adds the even to the capture\n * phase. Note: this only works in modern browsers.\n */\nfunction addEvent(node, event, fn, opt_useCapture) {\n if (typeof node.addEventListener == 'function') {\n node.addEventListener(event, fn, opt_useCapture || false);\n }\n else if (typeof node.attachEvent == 'function') {\n node.attachEvent('on' + event, fn);\n }\n}\n\n\n/**\n * Removes a previously added event handler from a DOM node.\n * @param {Node} node The DOM node to remove the event handler from.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to remove.\n * @param {boolean} opt_useCapture If the event handler was added with this\n * flag set to true, it should be set to true here in order to remove it.\n */\nfunction removeEvent(node, event, fn, opt_useCapture) {\n if (typeof node.removeEventListener == 'function') {\n node.removeEventListener(event, fn, opt_useCapture || false);\n }\n else if (typeof node.detatchEvent == 'function') {\n node.detatchEvent('on' + event, fn);\n }\n}\n\n\n/**\n * Returns the intersection between two rect objects.\n * @param {Object} rect1 The first rect.\n * @param {Object} rect2 The second rect.\n * @return {?Object|?ClientRect} The intersection rect or undefined if no\n * intersection is found.\n */\nfunction computeRectIntersection(rect1, rect2) {\n var top = Math.max(rect1.top, rect2.top);\n var bottom = Math.min(rect1.bottom, rect2.bottom);\n var left = Math.max(rect1.left, rect2.left);\n var right = Math.min(rect1.right, rect2.right);\n var width = right - left;\n var height = bottom - top;\n\n return (width >= 0 && height >= 0) && {\n top: top,\n bottom: bottom,\n left: left,\n right: right,\n width: width,\n height: height\n } || null;\n}\n\n\n/**\n * Shims the native getBoundingClientRect for compatibility with older IE.\n * @param {Element} el The element whose bounding rect to get.\n * @return {DOMRect|ClientRect} The (possibly shimmed) rect of the element.\n */\nfunction getBoundingClientRect(el) {\n var rect;\n\n try {\n rect = el.getBoundingClientRect();\n } catch (err) {\n // Ignore Windows 7 IE11 \"Unspecified error\"\n // https://github.com/w3c/IntersectionObserver/pull/205\n }\n\n if (!rect) return getEmptyRect();\n\n // Older IE\n if (!(rect.width && rect.height)) {\n rect = {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n }\n return rect;\n}\n\n\n/**\n * Returns an empty rect object. An empty rect is returned when an element\n * is not in the DOM.\n * @return {ClientRect} The empty rect.\n */\nfunction getEmptyRect() {\n return {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n width: 0,\n height: 0\n };\n}\n\n\n/**\n * Ensure that the result has all of the necessary fields of the DOMRect.\n * Specifically this ensures that `x` and `y` fields are set.\n *\n * @param {?DOMRect|?ClientRect} rect\n * @return {?DOMRect}\n */\nfunction ensureDOMRect(rect) {\n // A `DOMRect` object has `x` and `y` fields.\n if (!rect || 'x' in rect) {\n return rect;\n }\n // A IE's `ClientRect` type does not have `x` and `y`. The same is the case\n // for internally calculated Rect objects. For the purposes of\n // `IntersectionObserver`, it's sufficient to simply mirror `left` and `top`\n // for these fields.\n return {\n top: rect.top,\n y: rect.top,\n bottom: rect.bottom,\n left: rect.left,\n x: rect.left,\n right: rect.right,\n width: rect.width,\n height: rect.height\n };\n}\n\n\n/**\n * Inverts the intersection and bounding rect from the parent (frame) BCR to\n * the local BCR space.\n * @param {DOMRect|ClientRect} parentBoundingRect The parent's bound client rect.\n * @param {DOMRect|ClientRect} parentIntersectionRect The parent's own intersection rect.\n * @return {ClientRect} The local root bounding rect for the parent's children.\n */\nfunction convertFromParentRect(parentBoundingRect, parentIntersectionRect) {\n var top = parentIntersectionRect.top - parentBoundingRect.top;\n var left = parentIntersectionRect.left - parentBoundingRect.left;\n return {\n top: top,\n left: left,\n height: parentIntersectionRect.height,\n width: parentIntersectionRect.width,\n bottom: top + parentIntersectionRect.height,\n right: left + parentIntersectionRect.width\n };\n}\n\n\n/**\n * Checks to see if a parent element contains a child element (including inside\n * shadow DOM).\n * @param {Node} parent The parent element.\n * @param {Node} child The child element.\n * @return {boolean} True if the parent node contains the child node.\n */\nfunction containsDeep(parent, child) {\n var node = child;\n while (node) {\n if (node == parent) return true;\n\n node = getParentNode(node);\n }\n return false;\n}\n\n\n/**\n * Gets the parent node of an element or its host element if the parent node\n * is a shadow root.\n * @param {Node} node The node whose parent to get.\n * @return {Node|null} The parent node or null if no parent exists.\n */\nfunction getParentNode(node) {\n var parent = node.parentNode;\n\n if (node.nodeType == /* DOCUMENT */ 9 && node != document) {\n // If this node is a document node, look for the embedding frame.\n return getFrameElement(node);\n }\n\n if (parent && parent.nodeType == 11 && parent.host) {\n // If the parent is a shadow root, return the host element.\n return parent.host;\n }\n\n if (parent && parent.assignedSlot) {\n // If the parent is distributed in a , return the parent of a slot.\n return parent.assignedSlot.parentNode;\n }\n\n return parent;\n}\n\n\n/**\n * Returns the embedding frame element, if any.\n * @param {!Document} doc\n * @return {!Element}\n */\nfunction getFrameElement(doc) {\n try {\n return doc.defaultView && doc.defaultView.frameElement || null;\n } catch (e) {\n // Ignore the error.\n return null;\n }\n}\n\n\n// Exposes the constructors globally.\nwindow.IntersectionObserver = IntersectionObserver;\nwindow.IntersectionObserverEntry = IntersectionObserverEntry;\n\n}());\n","/*!\r\n * Stickyfill – `position: sticky` polyfill\r\n * v. 2.1.0 | https://github.com/wilddeer/stickyfill\r\n * MIT License\r\n */\r\n\r\n;(function(window, document) {\r\n 'use strict';\r\n \r\n /*\r\n * 1. Check if the browser supports `position: sticky` natively or is too old to run the polyfill.\r\n * If either of these is the case set `seppuku` flag. It will be checked later to disable key features\r\n * of the polyfill, but the API will remain functional to avoid breaking things.\r\n */\r\n \r\n var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\r\n \r\n function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\r\n \r\n var seppuku = false;\r\n \r\n var isWindowDefined = typeof window !== 'undefined';\r\n \r\n // The polyfill can’t function properly without `window` or `window.getComputedStyle`.\r\n if (!isWindowDefined || !window.getComputedStyle) seppuku = true;\r\n // Dont’t get in a way if the browser supports `position: sticky` natively.\r\n else {\r\n (function () {\r\n var testNode = document.createElement('div');\r\n \r\n if (['', '-webkit-', '-moz-', '-ms-'].some(function (prefix) {\r\n try {\r\n testNode.style.position = prefix + 'sticky';\r\n } catch (e) {}\r\n \r\n return testNode.style.position != '';\r\n })) seppuku = true;\r\n })();\r\n }\r\n \r\n /*\r\n * 2. “Global” vars used across the polyfill\r\n */\r\n var isInitialized = false;\r\n \r\n // Check if Shadow Root constructor exists to make further checks simpler\r\n var shadowRootExists = typeof ShadowRoot !== 'undefined';\r\n \r\n // Last saved scroll position\r\n var scroll = {\r\n top: null,\r\n left: null\r\n };\r\n \r\n // Array of created Sticky instances\r\n var stickies = [];\r\n \r\n /*\r\n * 3. Utility functions\r\n */\r\n function extend(targetObj, sourceObject) {\r\n for (var key in sourceObject) {\r\n if (sourceObject.hasOwnProperty(key)) {\r\n targetObj[key] = sourceObject[key];\r\n }\r\n }\r\n }\r\n \r\n function parseNumeric(val) {\r\n return parseFloat(val) || 0;\r\n }\r\n \r\n function getDocOffsetTop(node) {\r\n var docOffsetTop = 0;\r\n \r\n while (node) {\r\n docOffsetTop += node.offsetTop;\r\n node = node.offsetParent;\r\n }\r\n \r\n return docOffsetTop;\r\n }\r\n \r\n /*\r\n * 4. Sticky class\r\n */\r\n \r\n var Sticky = function () {\r\n function Sticky(node) {\r\n _classCallCheck(this, Sticky);\r\n \r\n if (!(node instanceof HTMLElement)) throw new Error('First argument must be HTMLElement');\r\n if (stickies.some(function (sticky) {\r\n return sticky._node === node;\r\n })) throw new Error('Stickyfill is already applied to this node');\r\n \r\n this._node = node;\r\n this._stickyMode = null;\r\n this._active = false;\r\n \r\n stickies.push(this);\r\n \r\n this.refresh();\r\n }\r\n \r\n _createClass(Sticky, [{\r\n key: 'refresh',\r\n value: function refresh() {\r\n if (seppuku || this._removed) return;\r\n if (this._active) this._deactivate();\r\n \r\n var node = this._node;\r\n \r\n /*\r\n * 1. Save node computed props\r\n */\r\n var nodeComputedStyle = getComputedStyle(node);\r\n var nodeComputedProps = {\r\n position: nodeComputedStyle.position,\r\n top: nodeComputedStyle.top,\r\n display: nodeComputedStyle.display,\r\n marginTop: nodeComputedStyle.marginTop,\r\n marginBottom: nodeComputedStyle.marginBottom,\r\n marginLeft: nodeComputedStyle.marginLeft,\r\n marginRight: nodeComputedStyle.marginRight,\r\n cssFloat: nodeComputedStyle.cssFloat\r\n };\r\n \r\n /*\r\n * 2. Check if the node can be activated\r\n */\r\n if (isNaN(parseFloat(nodeComputedProps.top)) || nodeComputedProps.display == 'table-cell' || nodeComputedProps.display == 'none') return;\r\n \r\n this._active = true;\r\n \r\n /*\r\n * 3. Check if the current node position is `sticky`. If it is, it means that the browser supports sticky positioning,\r\n * but the polyfill was force-enabled. We set the node’s position to `static` before continuing, so that the node\r\n * is in it’s initial position when we gather its params.\r\n */\r\n var originalPosition = node.style.position;\r\n if (nodeComputedStyle.position == 'sticky' || nodeComputedStyle.position == '-webkit-sticky') node.style.position = 'static';\r\n \r\n /*\r\n * 4. Get necessary node parameters\r\n */\r\n var referenceNode = node.parentNode;\r\n var parentNode = shadowRootExists && referenceNode instanceof ShadowRoot ? referenceNode.host : referenceNode;\r\n var nodeWinOffset = node.getBoundingClientRect();\r\n var parentWinOffset = parentNode.getBoundingClientRect();\r\n var parentComputedStyle = getComputedStyle(parentNode);\r\n \r\n this._parent = {\r\n node: parentNode,\r\n styles: {\r\n position: parentNode.style.position\r\n },\r\n offsetHeight: parentNode.offsetHeight\r\n };\r\n this._offsetToWindow = {\r\n left: nodeWinOffset.left,\r\n right: document.documentElement.clientWidth - nodeWinOffset.right\r\n };\r\n this._offsetToParent = {\r\n top: nodeWinOffset.top - parentWinOffset.top - parseNumeric(parentComputedStyle.borderTopWidth),\r\n left: nodeWinOffset.left - parentWinOffset.left - parseNumeric(parentComputedStyle.borderLeftWidth),\r\n right: -nodeWinOffset.right + parentWinOffset.right - parseNumeric(parentComputedStyle.borderRightWidth)\r\n };\r\n this._styles = {\r\n position: originalPosition,\r\n top: node.style.top,\r\n bottom: node.style.bottom,\r\n left: node.style.left,\r\n right: node.style.right,\r\n width: node.style.width,\r\n marginTop: node.style.marginTop,\r\n marginLeft: node.style.marginLeft,\r\n marginRight: node.style.marginRight\r\n };\r\n \r\n var nodeTopValue = parseNumeric(nodeComputedProps.top);\r\n this._limits = {\r\n start: nodeWinOffset.top + window.pageYOffset - nodeTopValue,\r\n end: parentWinOffset.top + window.pageYOffset + parentNode.offsetHeight - parseNumeric(parentComputedStyle.borderBottomWidth) - node.offsetHeight - nodeTopValue - parseNumeric(nodeComputedProps.marginBottom)\r\n };\r\n \r\n /*\r\n * 5. Ensure that the node will be positioned relatively to the parent node\r\n */\r\n var parentPosition = parentComputedStyle.position;\r\n \r\n if (parentPosition != 'absolute' && parentPosition != 'relative') {\r\n parentNode.style.position = 'relative';\r\n }\r\n \r\n /*\r\n * 6. Recalc node position.\r\n * It’s important to do this before clone injection to avoid scrolling bug in Chrome.\r\n */\r\n this._recalcPosition();\r\n \r\n /*\r\n * 7. Create a clone\r\n */\r\n var clone = this._clone = {};\r\n clone.node = document.createElement('div');\r\n \r\n // Apply styles to the clone\r\n extend(clone.node.style, {\r\n width: nodeWinOffset.right - nodeWinOffset.left + 'px',\r\n height: nodeWinOffset.bottom - nodeWinOffset.top + 'px',\r\n marginTop: nodeComputedProps.marginTop,\r\n marginBottom: nodeComputedProps.marginBottom,\r\n marginLeft: nodeComputedProps.marginLeft,\r\n marginRight: nodeComputedProps.marginRight,\r\n cssFloat: nodeComputedProps.cssFloat,\r\n padding: 0,\r\n border: 0,\r\n borderSpacing: 0,\r\n fontSize: '1em',\r\n position: 'static'\r\n });\r\n \r\n referenceNode.insertBefore(clone.node, node);\r\n clone.docOffsetTop = getDocOffsetTop(clone.node);\r\n }\r\n }, {\r\n key: '_recalcPosition',\r\n value: function _recalcPosition() {\r\n if (!this._active || this._removed) return;\r\n \r\n var stickyMode = scroll.top <= this._limits.start ? 'start' : scroll.top >= this._limits.end ? 'end' : 'middle';\r\n \r\n if (this._stickyMode == stickyMode) return;\r\n \r\n switch (stickyMode) {\r\n case 'start':\r\n extend(this._node.style, {\r\n position: 'absolute',\r\n left: this._offsetToParent.left + 'px',\r\n right: this._offsetToParent.right + 'px',\r\n top: this._offsetToParent.top + 'px',\r\n bottom: 'auto',\r\n width: 'auto',\r\n marginLeft: 0,\r\n marginRight: 0,\r\n marginTop: 0\r\n });\r\n break;\r\n \r\n case 'middle':\r\n extend(this._node.style, {\r\n position: 'fixed',\r\n left: this._offsetToWindow.left + 'px',\r\n right: this._offsetToWindow.right + 'px',\r\n top: this._styles.top,\r\n bottom: 'auto',\r\n width: 'auto',\r\n marginLeft: 0,\r\n marginRight: 0,\r\n marginTop: 0\r\n });\r\n break;\r\n \r\n case 'end':\r\n extend(this._node.style, {\r\n position: 'absolute',\r\n left: this._offsetToParent.left + 'px',\r\n right: this._offsetToParent.right + 'px',\r\n top: 'auto',\r\n bottom: 0,\r\n width: 'auto',\r\n marginLeft: 0,\r\n marginRight: 0\r\n });\r\n break;\r\n }\r\n \r\n this._stickyMode = stickyMode;\r\n }\r\n }, {\r\n key: '_fastCheck',\r\n value: function _fastCheck() {\r\n if (!this._active || this._removed) return;\r\n \r\n if (Math.abs(getDocOffsetTop(this._clone.node) - this._clone.docOffsetTop) > 1 || Math.abs(this._parent.node.offsetHeight - this._parent.offsetHeight) > 1) this.refresh();\r\n }\r\n }, {\r\n key: '_deactivate',\r\n value: function _deactivate() {\r\n var _this = this;\r\n \r\n if (!this._active || this._removed) return;\r\n \r\n this._clone.node.parentNode.removeChild(this._clone.node);\r\n delete this._clone;\r\n \r\n extend(this._node.style, this._styles);\r\n delete this._styles;\r\n \r\n // Check whether element’s parent node is used by other stickies.\r\n // If not, restore parent node’s styles.\r\n if (!stickies.some(function (sticky) {\r\n return sticky !== _this && sticky._parent && sticky._parent.node === _this._parent.node;\r\n })) {\r\n extend(this._parent.node.style, this._parent.styles);\r\n }\r\n delete this._parent;\r\n \r\n this._stickyMode = null;\r\n this._active = false;\r\n \r\n delete this._offsetToWindow;\r\n delete this._offsetToParent;\r\n delete this._limits;\r\n }\r\n }, {\r\n key: 'remove',\r\n value: function remove() {\r\n var _this2 = this;\r\n \r\n this._deactivate();\r\n \r\n stickies.some(function (sticky, index) {\r\n if (sticky._node === _this2._node) {\r\n stickies.splice(index, 1);\r\n return true;\r\n }\r\n });\r\n \r\n this._removed = true;\r\n }\r\n }]);\r\n \r\n return Sticky;\r\n }();\r\n \r\n /*\r\n * 5. Stickyfill API\r\n */\r\n \r\n \r\n var Stickyfill = {\r\n stickies: stickies,\r\n Sticky: Sticky,\r\n \r\n forceSticky: function forceSticky() {\r\n seppuku = false;\r\n init();\r\n \r\n this.refreshAll();\r\n },\r\n addOne: function addOne(node) {\r\n // Check whether it’s a node\r\n if (!(node instanceof HTMLElement)) {\r\n // Maybe it’s a node list of some sort?\r\n // Take first node from the list then\r\n if (node.length && node[0]) node = node[0];else return;\r\n }\r\n \r\n // Check if Stickyfill is already applied to the node\r\n // and return existing sticky\r\n for (var i = 0; i < stickies.length; i++) {\r\n if (stickies[i]._node === node) return stickies[i];\r\n }\r\n \r\n // Create and return new sticky\r\n return new Sticky(node);\r\n },\r\n add: function add(nodeList) {\r\n // If it’s a node make an array of one node\r\n if (nodeList instanceof HTMLElement) nodeList = [nodeList];\r\n // Check if the argument is an iterable of some sort\r\n if (!nodeList.length) return;\r\n \r\n // Add every element as a sticky and return an array of created Sticky instances\r\n var addedStickies = [];\r\n \r\n var _loop = function _loop(i) {\r\n var node = nodeList[i];\r\n \r\n // If it’s not an HTMLElement – create an empty element to preserve 1-to-1\r\n // correlation with input list\r\n if (!(node instanceof HTMLElement)) {\r\n addedStickies.push(void 0);\r\n return 'continue';\r\n }\r\n \r\n // If Stickyfill is already applied to the node\r\n // add existing sticky\r\n if (stickies.some(function (sticky) {\r\n if (sticky._node === node) {\r\n addedStickies.push(sticky);\r\n return true;\r\n }\r\n })) return 'continue';\r\n \r\n // Create and add new sticky\r\n addedStickies.push(new Sticky(node));\r\n };\r\n \r\n for (var i = 0; i < nodeList.length; i++) {\r\n var _ret2 = _loop(i);\r\n \r\n if (_ret2 === 'continue') continue;\r\n }\r\n \r\n return addedStickies;\r\n },\r\n refreshAll: function refreshAll() {\r\n stickies.forEach(function (sticky) {\r\n return sticky.refresh();\r\n });\r\n },\r\n removeOne: function removeOne(node) {\r\n // Check whether it’s a node\r\n if (!(node instanceof HTMLElement)) {\r\n // Maybe it’s a node list of some sort?\r\n // Take first node from the list then\r\n if (node.length && node[0]) node = node[0];else return;\r\n }\r\n \r\n // Remove the stickies bound to the nodes in the list\r\n stickies.some(function (sticky) {\r\n if (sticky._node === node) {\r\n sticky.remove();\r\n return true;\r\n }\r\n });\r\n },\r\n remove: function remove(nodeList) {\r\n // If it’s a node make an array of one node\r\n if (nodeList instanceof HTMLElement) nodeList = [nodeList];\r\n // Check if the argument is an iterable of some sort\r\n if (!nodeList.length) return;\r\n \r\n // Remove the stickies bound to the nodes in the list\r\n \r\n var _loop2 = function _loop2(i) {\r\n var node = nodeList[i];\r\n \r\n stickies.some(function (sticky) {\r\n if (sticky._node === node) {\r\n sticky.remove();\r\n return true;\r\n }\r\n });\r\n };\r\n \r\n for (var i = 0; i < nodeList.length; i++) {\r\n _loop2(i);\r\n }\r\n },\r\n removeAll: function removeAll() {\r\n while (stickies.length) {\r\n stickies[0].remove();\r\n }\r\n }\r\n };\r\n \r\n /*\r\n * 6. Setup events (unless the polyfill was disabled)\r\n */\r\n function init() {\r\n if (isInitialized) {\r\n return;\r\n }\r\n \r\n isInitialized = true;\r\n \r\n // Watch for scroll position changes and trigger recalc/refresh if needed\r\n function checkScroll() {\r\n if (window.pageXOffset != scroll.left) {\r\n scroll.top = window.pageYOffset;\r\n scroll.left = window.pageXOffset;\r\n \r\n Stickyfill.refreshAll();\r\n } else if (window.pageYOffset != scroll.top) {\r\n scroll.top = window.pageYOffset;\r\n scroll.left = window.pageXOffset;\r\n \r\n // recalc position for all stickies\r\n stickies.forEach(function (sticky) {\r\n return sticky._recalcPosition();\r\n });\r\n }\r\n }\r\n \r\n checkScroll();\r\n window.addEventListener('scroll', checkScroll);\r\n \r\n // Watch for window resizes and device orientation changes and trigger refresh\r\n window.addEventListener('resize', Stickyfill.refreshAll);\r\n window.addEventListener('orientationchange', Stickyfill.refreshAll);\r\n \r\n //Fast dirty check for layout changes every 500ms\r\n var fastCheckTimer = void 0;\r\n \r\n function startFastCheckTimer() {\r\n fastCheckTimer = setInterval(function () {\r\n stickies.forEach(function (sticky) {\r\n return sticky._fastCheck();\r\n });\r\n }, 500);\r\n }\r\n \r\n function stopFastCheckTimer() {\r\n clearInterval(fastCheckTimer);\r\n }\r\n \r\n var docHiddenKey = void 0;\r\n var visibilityChangeEventName = void 0;\r\n \r\n if ('hidden' in document) {\r\n docHiddenKey = 'hidden';\r\n visibilityChangeEventName = 'visibilitychange';\r\n } else if ('webkitHidden' in document) {\r\n docHiddenKey = 'webkitHidden';\r\n visibilityChangeEventName = 'webkitvisibilitychange';\r\n }\r\n \r\n if (visibilityChangeEventName) {\r\n if (!document[docHiddenKey]) startFastCheckTimer();\r\n \r\n document.addEventListener(visibilityChangeEventName, function () {\r\n if (document[docHiddenKey]) {\r\n stopFastCheckTimer();\r\n } else {\r\n startFastCheckTimer();\r\n }\r\n });\r\n } else startFastCheckTimer();\r\n }\r\n \r\n if (!seppuku) init();\r\n \r\n /*\r\n * 7. Expose Stickyfill\r\n */\r\n if (typeof module != 'undefined' && module.exports) {\r\n module.exports = Stickyfill;\r\n } else if (isWindowDefined) {\r\n window.Stickyfill = Stickyfill;\r\n }\r\n \r\n})(window, document);","/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */\n(function () {\n 'use strict';\n\n // polyfill\n function polyfill() {\n // aliases\n var w = window;\n var d = document;\n\n // return if scroll behavior is supported and polyfill is not forced\n if (\n 'scrollBehavior' in d.documentElement.style &&\n w.__forceSmoothScrollPolyfill__ !== true\n ) {\n return;\n }\n\n // globals\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n // object gathering original scroll methods\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elementScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n // define timing method\n var now =\n w.performance && w.performance.now\n ? w.performance.now.bind(w.performance)\n : Date.now;\n\n /**\n * indicates if a the current browser is made by Microsoft\n * @method isMicrosoftBrowser\n * @param {String} userAgent\n * @returns {Boolean}\n */\n function isMicrosoftBrowser(userAgent) {\n var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];\n\n return new RegExp(userAgentPatterns.join('|')).test(userAgent);\n }\n\n /*\n * IE has rounding bug rounding down clientHeight and clientWidth and\n * rounding up scrollHeight and scrollWidth causing false positives\n * on hasScrollableSpace\n */\n var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} firstArg\n * @returns {Boolean}\n */\n function shouldBailOut(firstArg) {\n if (\n firstArg === null ||\n typeof firstArg !== 'object' ||\n firstArg.behavior === undefined ||\n firstArg.behavior === 'auto' ||\n firstArg.behavior === 'instant'\n ) {\n // first argument is not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError(\n 'behavior member of ScrollOptions ' +\n firstArg.behavior +\n ' is not a valid value for enumeration ScrollBehavior.'\n );\n }\n\n /**\n * indicates if an element has scrollable space in the provided axis\n * @method hasScrollableSpace\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function hasScrollableSpace(el, axis) {\n if (axis === 'Y') {\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\n }\n\n if (axis === 'X') {\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\n }\n }\n\n /**\n * indicates if an element has a scrollable overflow property in the axis\n * @method canOverflow\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function canOverflow(el, axis) {\n var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];\n\n return overflowValue === 'auto' || overflowValue === 'scroll';\n }\n\n /**\n * indicates if an element can be scrolled in either axis\n * @method isScrollable\n * @param {Node} el\n * @param {String} axis\n * @returns {Boolean}\n */\n function isScrollable(el) {\n var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');\n var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');\n\n return isScrollableY || isScrollableX;\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n while (el !== d.body && isScrollable(el) === false) {\n el = el.parentNode || el.host;\n }\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n * @returns {undefined}\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window or element with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n * @returns {undefined}\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n // ORIGINAL METHODS OVERRIDES\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scroll.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object'\n ? arguments[0]\n : w.scrollX || w.pageXOffset,\n // use top prop, second argument if present or fallback to scrollY\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined\n ? arguments[1]\n : w.scrollY || w.pageYOffset\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : w.scrollX || w.pageXOffset,\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : w.scrollY || w.pageYOffset\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left !== undefined\n ? arguments[0].left\n : typeof arguments[0] !== 'object' ? arguments[0] : 0,\n arguments[0].top !== undefined\n ? arguments[0].top\n : arguments[1] !== undefined ? arguments[1] : 0\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n // if one number is passed, throw error to match Firefox implementation\n if (typeof arguments[0] === 'number' && arguments[1] === undefined) {\n throw new SyntaxError('Value could not be converted');\n }\n\n original.elementScroll.call(\n this,\n // use left prop, first number argument or fallback to scrollLeft\n arguments[0].left !== undefined\n ? ~~arguments[0].left\n : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,\n // use top prop, second argument or fallback to scrollTop\n arguments[0].top !== undefined\n ? ~~arguments[0].top\n : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop\n );\n\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'undefined' ? this.scrollLeft : ~~left,\n typeof top === 'undefined' ? this.scrollTop : ~~top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n // avoid action when no arguments are passed\n if (arguments[0] === undefined) {\n return;\n }\n\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.elementScroll.call(\n this,\n arguments[0].left !== undefined\n ? ~~arguments[0].left + this.scrollLeft\n : ~~arguments[0] + this.scrollLeft,\n arguments[0].top !== undefined\n ? ~~arguments[0].top + this.scrollTop\n : ~~arguments[1] + this.scrollTop\n );\n\n return;\n }\n\n this.scroll({\n left: ~~arguments[0].left + this.scrollLeft,\n top: ~~arguments[0].top + this.scrollTop,\n behavior: arguments[0].behavior\n });\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0]) === true) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n\n // reveal parent in viewport unless is fixed\n if (w.getComputedStyle(scrollableParent).position !== 'fixed') {\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n }\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }\n\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n // commonjs\n module.exports = { polyfill: polyfill };\n } else {\n // global\n polyfill();\n }\n\n}());\n","require('intersection-observer');\nconst stickyPolyfill = require('stickyfilljs');\nconst smoothScrollPolyfill = require('smoothscroll-polyfill').polyfill;\n\nmodule.exports = { smoothScrollPolyfill, stickyPolyfill };\n"],"names":["require$$1","stickyPolyfill"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,WAAW;AAEZ;AACA;AACA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAChC,EAAE,OAAO;AACT,CAAC;AACD;AACA;AACA;AACA,IAAI,sBAAsB,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AAc,GAAE;;;;;;"} \ No newline at end of file diff --git a/lib/common-js-modules.js b/lib/common-js-modules.js deleted file mode 100644 index 86a6e14..0000000 --- a/lib/common-js-modules.js +++ /dev/null @@ -1,5 +0,0 @@ -require('intersection-observer'); -const stickyPolyfill = require('stickyfilljs'); -const smoothScrollPolyfill = require('smoothscroll-polyfill').polyfill; - -module.exports = { smoothScrollPolyfill, stickyPolyfill }; diff --git a/package.json b/package.json index b391df4..84ebff5 100644 --- a/package.json +++ b/package.json @@ -16,19 +16,18 @@ "vcf-anchor-nav", "web-components", "web-component", - "polymer" + "lit" ], "scripts": { "test": "wct", "lint": "eslint src/*.js", "prestart": "polymer analyze src/*.js > analysis.json", - "start": "polymer serve -o", + "start": "web-dev-server --node-resolve --open demo/", "build:prod": "run-s build:api build:demo", "build:api": "npm run prestart && polymer build", "build:demo": "webpack", "build:lib": "rollup -c", - "publish": "node util/publish.js", - "prepare": "npm run build:lib" + "publish": "node util/publish.js" }, "husky": { "hooks": { @@ -43,15 +42,9 @@ ] }, "dependencies": { - "@juggle/resize-observer": "^3.1.3", - "@polymer/polymer": "^3.0.0", - "@vaadin/component-base": "^24.1.1", - "@vaadin/tabs": "^24.1.1", - "@vaadin/vaadin-lumo-styles": "^24.1.1", - "@vaadin/vaadin-themable-mixin": "^24.1.1", - "intersection-observer": "^0.10.0", - "smoothscroll-polyfill": "^0.4.4", - "stickyfilljs": "^2.1.0" + "@vaadin/component-base": "^25.0.0-beta2", + "@vaadin/tabs": "^25.0.0-beta2", + "@vaadin/vaadin-themable-mixin": "^25.0.0-beta2" }, "devDependencies": { "@babel/core": "^7.5.5", @@ -60,11 +53,11 @@ "@polymer/iron-component-page": "^4.0.1", "@polymer/iron-demo-helpers": "^3.0.0-pre.19", "@polymer/test-fixture": "^4.0.2", - "@rollup/plugin-commonjs": "^11.1.0", - "@rollup/plugin-node-resolve": "^7.1.3", "@vaadin-component-factory/vcf-element-util": "^0.2.8", - "@vaadin/button": "^24.1.1", - "@vaadin/text-field": "^24.1.1", + "@vaadin/button": "^25.0.0-beta2", + "@vaadin/text-field": "^25.0.0-beta2", + "@vaadin/vaadin-lumo-styles": "^25.0.0-beta2", + "@web/dev-server": "^0.4.6", "@webcomponents/webcomponentsjs": "^2.0.0", "babel-eslint": "^10.0.2", "babel-loader": "^8.0.6", @@ -91,7 +84,6 @@ "prettier": "^1.17.1", "prompt": "^1.0.0", "replace-in-file": "^4.1.2", - "rollup": "^2.10.2", "shelljs": "^0.8.3", "terser-webpack-plugin": "^1.4.1", "uglify-template-string-loader": "^1.1.1", @@ -108,7 +100,6 @@ "files": [ "lib", "src", - "theme", "vcf-anchor-nav.js" ], "homepage": "https://github.com/vaadin-component-factory/vcf-anchor-nav#readme", diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index c391869..0000000 --- a/rollup.config.js +++ /dev/null @@ -1,18 +0,0 @@ -import resolve from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; - -const plugins = [resolve(), commonjs()]; - -const config = [ - { - input: 'lib/common-js-modules.js', - output: { - format: 'es', - file: 'lib/common-js-modules.esm.js', - sourcemap: true - }, - plugins - } -]; - -export default config; diff --git a/src/vcf-anchor-nav-section.js b/src/vcf-anchor-nav-section.js index 4961946..d5d62d9 100644 --- a/src/vcf-anchor-nav-section.js +++ b/src/vcf-anchor-nav-section.js @@ -1,6 +1,6 @@ -import { PolymerElement, html } from '@polymer/polymer/polymer-element.js'; -import { ThemableMixin } from '@vaadin/vaadin-themable-mixin'; +import { LitElement, html, css } from 'lit'; import { ElementMixin } from '@vaadin/component-base/src/element-mixin'; +import { ThemeDetectionMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-detection-mixin'; /** * `` @@ -17,7 +17,9 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin'; * Custom property | Description | Default * ----------------|-------------|------------- * `--anchor-nav-section-border-width` | `border-width` of section. | `0` - * `--anchor-nav-section-border-color` | `border-color` of section. | `var(--lumo-contrast-10pct)` + * `--anchor-nav-section-border-color` | `border-color` of section. | `#666` + * `--anchor-nav-section-header-padding` | `padding` of the "header" part. | `1rem` + * `--anchor-nav-section-content-padding` | `padding` of the "content" part. | `1rem` * * The following shadow DOM parts are available for styling: * @@ -28,10 +30,10 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin'; * * @memberof Vaadin * @mixes ElementMixin - * @mixes ThemableMixin + * @mixes ThemeDetectionMixin * @demo demo/index.html */ -class AnchorNavSectionElement extends ElementMixin(ThemableMixin(PolymerElement)) { +class AnchorNavSectionElement extends ThemeDetectionMixin(ElementMixin(LitElement)) { static get is() { return 'vcf-anchor-nav-section'; } @@ -40,35 +42,36 @@ class AnchorNavSectionElement extends ElementMixin(ThemableMixin(PolymerElement) return el.tagName === `${AnchorNavSectionElement.is}`.toUpperCase(); } - static get template() { - return html` - - - -
- -
+ static get styles() { + return css` + :host { + --anchor-nav-section-border-width: 0; + --anchor-nav-section-border-color: #666; + --anchor-nav-section-header-padding: 1rem; + --anchor-nav-section-content-padding: 1rem; + outline: none; + } + + :host(:not(:last-of-type)) { + border-bottom: var(--anchor-nav-section-border-width) solid var(--anchor-nav-section-border-color); + } + + ::slotted([slot='header']) { + margin: 0; + padding: var(--anchor-nav-section-header-padding); + } + + #content { + padding: var(--anchor-nav-section-content-padding); + } + + /* Lumo theme */ + + :host([data-application-theme='lumo']) { + --anchor-nav-section-border-color: var(--lumo-contrast-10pct); + --anchor-nav-section-header-padding: var(--lumo-space-m); + --anchor-nav-section-content-padding: var(--lumo-space-m); + } `; } @@ -80,8 +83,7 @@ class AnchorNavSectionElement extends ElementMixin(ThemableMixin(PolymerElement) * @type {String} */ name: { - type: String, - observer: '_nameChanged' + type: String }, /** * Id of corresponding tab element. @@ -89,23 +91,40 @@ class AnchorNavSectionElement extends ElementMixin(ThemableMixin(PolymerElement) */ tabId: { type: String, - reflectToAttribute: true + reflect: true, + attribute: 'tab-id' } }; } constructor() { super(); - this.name = this.name || this.defaultName; + this.name = ''; + this.tabId = ''; + } + + render() { + return html` + + +
+ +
+ `; } - ready() { - super.ready(); + firstUpdated() { + this.name = this.name || this.defaultName; this._createHeader(); this.setAttribute('tabindex', '-1'); this.setAttribute('role', 'region'); this.setAttribute('aria-labelledby', this.headerId); - this.$.tabSlot.addEventListener('slotchange', e => this._onTabSlotChange(e)); + + const tabSlot = this.shadowRoot.querySelector('#tabSlot'); + tabSlot.addEventListener('slotchange', e => this._onTabSlotChange(e)); + this.addEventListener('focus', e => { if (AnchorNavSectionElement.isSame(e.target)) { this.dispatchEvent(new CustomEvent('section-focus')); @@ -113,6 +132,13 @@ class AnchorNavSectionElement extends ElementMixin(ThemableMixin(PolymerElement) }); } + updated(changedProperties) { + super.updated(changedProperties); + if (changedProperties.has('name')) { + this._nameChanged(this.name); + } + } + _createHeader() { const customHeader = this.querySelector('[slot="header"]'); if (customHeader) { @@ -190,8 +216,9 @@ class AnchorNavSectionElement extends ElementMixin(ThemableMixin(PolymerElement) _onTabSlotChange() { const tab = this.tab; - if (this.nav && this.nav.$ && tab) { + if (this.nav && tab) { tab.removeAttribute('slot'); + tab.__isCustomTab = true; this.tabId = tab.id; this.nav.querySelector('vaadin-tabs').appendChild(tab); @@ -205,7 +232,7 @@ class AnchorNavSectionElement extends ElementMixin(ThemableMixin(PolymerElement) // Set default tab this._setDefaultId(); const tab = this.tab; - if (tab && tab.id === this.defaultTabId) { + if (tab && !tab.__isCustomTab && tab.id === this.defaultTabId) { let a = tab.querySelector('a'); if (!a) { const url = new URL(location); diff --git a/src/vcf-anchor-nav.js b/src/vcf-anchor-nav.js index c931489..a35fc31 100644 --- a/src/vcf-anchor-nav.js +++ b/src/vcf-anchor-nav.js @@ -1,8 +1,6 @@ -import { html, PolymerElement } from '@polymer/polymer/polymer-element'; -import { ThemableMixin } from '@vaadin/vaadin-themable-mixin'; +import { LitElement, html, css } from 'lit'; import { ElementMixin } from '@vaadin/component-base/src/element-mixin'; -import { smoothScrollPolyfill, stickyPolyfill } from '../lib/common-js-modules.esm'; -import { ResizeObserver } from '@juggle/resize-observer'; +import { ThemeDetectionMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-detection-mixin'; import '@vaadin/tabs/vaadin-tabs'; import '@vaadin/tabs/vaadin-tab'; @@ -29,10 +27,12 @@ import '@vaadin/tabs/vaadin-tab'; * * Custom property | Description | Default * ----------------|-------------|------------- - * `--anchor-nav-inner-max-width` | `max-width` of "container" part. | `auto` - * `--anchor-nav-inner-background` | `background` of "container" part. | `#ffffff` - * `--anchor-nav-inner-padding` | `padding` of "container" part. | `0 0 20vh 0` - * `--anchor-nav-tabs-stuck-box-shadow` | `box-shadow` of "tabs" part when stuck to top of viewport. | `0 4px 5px -6px rgba(0, 0, 0, 0.4)` + * `--anchor-nav-header-padding` | `padding` of the slotted "header" content. | `0 1rem` + * `--anchor-nav-inner-max-width` | `max-width` of the "container" part. | `auto` + * `--anchor-nav-inner-background` | `background` of the "container" part. | `#ffffff` + * `--anchor-nav-inner-padding` | `padding` of the "container" part. | `0` + * `--anchor-nav-tabs-background` | `background` of the slotted "tabs" content. | `#fff` + * `--anchor-nav-tabs-stuck-box-shadow` | `box-shadow` of slotted "tabs" content when stuck to top of viewport. | `0 4px 5px -6px rgba(0, 0, 0, 0.4)` * * The following shadow DOM parts are available for styling: * @@ -44,93 +44,94 @@ import '@vaadin/tabs/vaadin-tab'; * * @memberof Vaadin * @mixes ElementMixin - * @mixes ThemableMixin + * @mixes ThemeDetectionMixin * @demo demo/index.html */ -export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement)) { - static get template() { - return html` - -
- - - -
+ :host([theme~='expand-last']) ::slotted(vcf-anchor-nav-section:last-of-type) { + min-height: var(--_expand-last-height); + } + + /* Lumo theme */ + + :host([data-application-theme='lumo']) { + --anchor-nav-header-padding: 0 var(--lumo-space-m); + --anchor-nav-inner-background: var(--lumo-base-color); + --anchor-nav-tabs-background: var(--lumo-base-color); + } `; } @@ -154,7 +155,7 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) */ selectedId: { type: String, - observer: '_selectedIdChanged' + attribute: 'selected-id' }, /** @@ -163,8 +164,7 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) */ selectedIndex: { type: Number, - value: 0, - observer: '_selectedIndexChanged' + attribute: 'selected-index' }, /** @@ -173,7 +173,7 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) */ fullscreen: { type: Boolean, - reflectToAttribute: true + reflect: true }, /** @@ -182,7 +182,7 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) */ disablePreserveOnRefresh: { type: Boolean, - value: false + attribute: 'disable-preserve-on-refresh' }, /** @@ -191,7 +191,7 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) */ smoothScroll: { type: Boolean, - value: true + attribute: 'smooth-scroll' }, /** * Set to true to disable history of internal navigation so that @@ -200,13 +200,22 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) */ noHistory: { type: Boolean, - value: false, - reflectToAttribute: true, - notify: true + reflect: true, + attribute: 'no-history' } }; } + constructor() { + super(); + this.selectedId = ''; + this.selectedIndex = 0; + this.fullscreen = false; + this.disablePreserveOnRefresh = false; + this.smoothScroll = true; + this.noHistory = false; + } + /** * Returns array of the slotted section elements. * @returns {Array} @@ -221,7 +230,8 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) * @returns {HTMLElement} */ get header() { - return this.$.headerSlot.assignedNodes()[0] || null; + const headerSlot = this.shadowRoot && this.shadowRoot.querySelector('#headerSlot'); + return (headerSlot && headerSlot.assignedNodes()[0]) || null; } get _tabHeight() { @@ -245,14 +255,10 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) this.appendChild(vaadinTabs); } - ready() { - super.ready(); + firstUpdated() { this._createVaadinTabs(); this._verticalTabs = false; - // Add polyfills - smoothScrollPolyfill(); - stickyPolyfill.add(this.querySelector('vaadin-tabs')); // Init observers this._initTabsStuckAttribute(); @@ -260,9 +266,13 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) this._initContainerResizeObserver(); // Add slotchange listeners - this.$.slot.addEventListener('slotchange', () => this._onSlotChange()); - this.$.tabsSlot.addEventListener('slotchange', e => this._onTabsSlotChange(e)); - this.$.headerSlot.addEventListener('slotchange', () => this._onHeaderSlotChange()); + const slotElement = this.shadowRoot.querySelector('#slot'); + const tabsSlotElement = this.shadowRoot.querySelector('#tabsSlot'); + const headerSlotElement = this.shadowRoot.querySelector('#headerSlot'); + + slotElement.addEventListener('slotchange', () => this._onSlotChange()); + tabsSlotElement.addEventListener('slotchange', e => this._onTabsSlotChange(e)); + headerSlotElement.addEventListener('slotchange', () => this._onHeaderSlotChange()); this._toggleNoHistory(this.noHistory); // Add popstate listener @@ -281,6 +291,28 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) }); } + updated(changedProperties) { + super.updated(changedProperties); + if (changedProperties.has('selectedId')) { + this._selectedIdChanged(this.selectedId); + } + if (changedProperties.has('selectedIndex')) { + this._selectedIndexChanged(this.selectedIndex); + } + } + + render() { + return html` +
+ + + +
+ `; + } + _toggleNoHistory(noHistory) { if (noHistory) { this._enableNoHistory(); @@ -462,7 +494,8 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) } }); }); - observer.observe(this.$.container); + const container = this.shadowRoot.querySelector('#container'); + if (container) observer.observe(container); } _initWindowResizeListener() { @@ -562,14 +595,18 @@ export class AnchorNavElement extends ElementMixin(ThemableMixin(PolymerElement) if (tab) tab.selected = true; // Horizontally scroll tabs when selected changes if (tabs.hasAttribute('overflow') && this.sections.length) { - const leftOffset = tabs.root.querySelector('[part="back-button"]').clientWidth * 2; + const scrollElement = tabs.shadowRoot && tabs.shadowRoot.querySelector('[part="tabs"]'); + const backButton = tabs.shadowRoot && tabs.shadowRoot.querySelector('[part="back-button"]'); + const leftOffset = backButton ? backButton.clientWidth * 2 : 0; const topOffset = this.sections[0].offsetTop; const scrollRatio = (this.sections[this.selectedIndex].offsetTop - topOffset) / (this.scrollHeight - topOffset); - const left = tabs.$.scroll.scrollWidth * scrollRatio; - tabs.$.scroll.scrollTo({ - left: left && left - leftOffset, - behavior: this._firstTabSelect ? 'auto' : 'smooth' - }); + if (scrollElement) { + const left = scrollElement.scrollWidth * scrollRatio; + scrollElement.scrollTo({ + left: left && left - leftOffset, + behavior: this._firstTabSelect ? 'auto' : 'smooth' + }); + } this._firstTabSelect = false; } this.dispatchEvent(new CustomEvent('selected-changed', { detail: { index: this.selectedIndex, id: this.selectedId } }));