mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-13 01:08:58 +01:00
1 line
26 KiB
Plaintext
1 line
26 KiB
Plaintext
{"version":3,"file":"scrollspy.js","sources":["../src/util/index.js","../src/scrollspy.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\nconst { jQuery } = window\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nconst toType = obj => ({}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase())\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst getUID = prefix => {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getSelectorFromElement = element => {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (error) {\n return null\n }\n}\n\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let {\n transitionDuration,\n transitionDelay\n } = window.getComputedStyle(element)\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n const evt = document.createEvent('HTMLEvents')\n\n evt.initEvent(TRANSITION_END, true, true)\n element.dispatchEvent(evt)\n}\n\nconst isElement = obj => (obj[0] || obj).nodeType\n\nconst emulateTransitionEnd = (element, duration) => {\n let called = false\n const durationPadding = 5\n const emulatedDuration = duration + durationPadding\n function listener() {\n called = true\n element.removeEventListener(TRANSITION_END, listener)\n }\n\n element.addEventListener(TRANSITION_END, listener)\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(element)\n }\n }, emulatedDuration)\n}\n\nconst typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes)\n .forEach(property => {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ?\n 'element' :\n toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n })\n}\n\nconst makeArray = nodeList => {\n if (!nodeList) {\n return []\n }\n\n return [].slice.call(nodeList)\n}\n\nconst isVisible = element => {\n if (!element) {\n return false\n }\n\n if (element.style && element.parentNode && element.parentNode.style) {\n return element.style.display !== 'none' &&\n element.parentNode.style.display !== 'none' &&\n element.style.visibility !== 'hidden'\n }\n\n return false\n}\n\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return findShadowRoot(element.parentNode)\n}\n\n// eslint-disable-next-line no-empty-function\nconst noop = () => function () {}\n\nconst reflow = element => element.offsetHeight\n\nexport {\n jQuery,\n TRANSITION_END,\n getUID,\n getSelectorFromElement,\n getTransitionDurationFromElement,\n triggerTransitionEnd,\n isElement,\n emulateTransitionEnd,\n typeCheckConfig,\n makeArray,\n isVisible,\n findShadowRoot,\n noop,\n reflow\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n jQuery as $,\n getSelectorFromElement,\n getUID,\n makeArray,\n typeCheckConfig\n} from './util/index'\nimport Data from './dom/data'\nimport EventHandler from './dom/event-handler'\nimport Manipulator from './dom/manipulator'\nimport SelectorEngine from './dom/selector-engine'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'scrollspy'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst Default = {\n offset: 10,\n method: 'auto',\n target: ''\n}\n\nconst DefaultType = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n}\n\nconst Event = {\n ACTIVATE: `activate${EVENT_KEY}`,\n SCROLL: `scroll${EVENT_KEY}`,\n LOAD_DATA_API: `load${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_ITEM: 'dropdown-item',\n ACTIVE: 'active'\n}\n\nconst Selector = {\n DATA_SPY: '[data-spy=\"scroll\"]',\n NAV_LIST_GROUP: '.nav, .list-group',\n NAV_LINKS: '.nav-link',\n NAV_ITEMS: '.nav-item',\n LIST_ITEMS: '.list-group-item',\n DROPDOWN: '.dropdown',\n DROPDOWN_TOGGLE: '.dropdown-toggle'\n}\n\nconst OffsetMethod = {\n OFFSET: 'offset',\n POSITION: 'position'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass ScrollSpy {\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},` +\n `${this._config.target} ${Selector.LIST_ITEMS},` +\n `${this._config.target} .${ClassName.DROPDOWN_ITEM}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n EventHandler.on(this._scrollElement, Event.SCROLL, event => this._process(event))\n\n this.refresh()\n this._process()\n\n Data.setData(element, DATA_KEY, this)\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window ?\n OffsetMethod.OFFSET :\n OffsetMethod.POSITION\n\n const offsetMethod = this._config.method === 'auto' ?\n autoMethod :\n this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION ?\n this._getScrollTop() :\n 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = makeArray(SelectorEngine.find(this._selector))\n\n targets\n .map(element => {\n let target\n const targetSelector = getSelectorFromElement(element)\n\n if (targetSelector) {\n target = SelectorEngine.findOne(targetSelector)\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n return [\n Manipulator[offsetMethod](target).top + offsetBase,\n targetSelector\n ]\n }\n }\n\n return null\n })\n .filter(item => item)\n .sort((a, b) => a[0] - b[0])\n .forEach(item => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n Data.removeData(this._element, DATA_KEY)\n EventHandler.off(this._scrollElement, EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.target !== 'string') {\n let { id } = config.target\n if (!id) {\n id = getUID(NAME)\n config.target.id = id\n }\n\n config.target = `#${id}`\n }\n\n typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window ?\n this._scrollElement.pageYOffset :\n this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ?\n window.innerHeight :\n this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset +\n scrollHeight -\n this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n const offsetLength = this._offsets.length\n for (let i = offsetLength; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] &&\n scrollTop >= this._offsets[i] &&\n (typeof this._offsets[i + 1] === 'undefined' ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n const queries = this._selector.split(',')\n .map(selector => `${selector}[data-target=\"${target}\"],${selector}[href=\"${target}\"]`)\n\n const link = SelectorEngine.findOne(queries.join(','))\n\n if (link.classList.contains(ClassName.DROPDOWN_ITEM)) {\n SelectorEngine\n .findOne(Selector.DROPDOWN_TOGGLE, SelectorEngine.closest(link, Selector.DROPDOWN))\n .classList.add(ClassName.ACTIVE)\n\n link.classList.add(ClassName.ACTIVE)\n } else {\n // Set triggered link as active\n link.classList.add(ClassName.ACTIVE)\n\n SelectorEngine\n .parents(link, Selector.NAV_LIST_GROUP)\n .forEach(listGroup => {\n // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n SelectorEngine.prev(listGroup, `${Selector.NAV_LINKS}, ${Selector.LIST_ITEMS}`)\n .forEach(item => item.classList.add(ClassName.ACTIVE))\n\n // Handle special case when .nav-link is inside .nav-item\n SelectorEngine.prev(listGroup, Selector.NAV_ITEMS)\n .forEach(navItem => {\n SelectorEngine.children(navItem, Selector.NAV_LINKS)\n .forEach(item => item.classList.add(ClassName.ACTIVE))\n })\n })\n }\n\n EventHandler.trigger(this._scrollElement, Event.ACTIVATE, {\n relatedTarget: target\n })\n }\n\n _clear() {\n makeArray(SelectorEngine.find(this._selector))\n .filter(node => node.classList.contains(ClassName.ACTIVE))\n .forEach(node => node.classList.remove(ClassName.ACTIVE))\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = Data.getData(this, DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data) {\n data = new ScrollSpy(this, _config)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n\n static _getInstance(element) {\n return Data.getData(element, DATA_KEY)\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(window, Event.LOAD_DATA_API, () => {\n makeArray(SelectorEngine.find(Selector.DATA_SPY))\n .forEach(spy => new ScrollSpy(spy, Manipulator.getDataAttributes(spy)))\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\nif (typeof $ !== 'undefined') {\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n $.fn[NAME] = ScrollSpy._jQueryInterface\n $.fn[NAME].Constructor = ScrollSpy\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return ScrollSpy._jQueryInterface\n }\n}\n\nexport default ScrollSpy\n"],"names":["MAX_UID","window","jQuery","toType","obj","toString","call","match","toLowerCase","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","hrefAttr","trim","querySelector","error","isElement","nodeType","typeCheckConfig","componentName","config","configTypes","Object","keys","forEach","property","expectedTypes","value","valueType","RegExp","test","Error","toUpperCase","makeArray","nodeList","slice","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","Default","offset","method","target","DefaultType","Event","ACTIVATE","SCROLL","LOAD_DATA_API","ClassName","DROPDOWN_ITEM","ACTIVE","Selector","DATA_SPY","NAV_LIST_GROUP","NAV_LINKS","NAV_ITEMS","LIST_ITEMS","DROPDOWN","DROPDOWN_TOGGLE","OffsetMethod","OFFSET","POSITION","ScrollSpy","_element","_scrollElement","tagName","_config","_getConfig","_selector","_offsets","_targets","_activeTarget","_scrollHeight","EventHandler","on","event","_process","refresh","Data","setData","autoMethod","offsetMethod","offsetBase","_getScrollTop","_getScrollHeight","targets","SelectorEngine","find","map","targetSelector","findOne","targetBCR","getBoundingClientRect","width","height","Manipulator","top","filter","item","sort","a","b","push","dispose","removeData","off","id","pageYOffset","scrollTop","scrollHeight","max","body","documentElement","_getOffsetHeight","innerHeight","maxScroll","length","_activate","_clear","offsetLength","i","isActiveTarget","queries","split","link","join","classList","contains","closest","add","parents","listGroup","prev","navItem","children","trigger","relatedTarget","node","remove","_jQueryInterface","each","data","getData","TypeError","_getInstance","spy","getDataAttributes","$","JQUERY_NO_CONFLICT","fn","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;EAOA,IAAMA,OAAO,GAAG,OAAhB;AACA,gBAEmBC;MAAXC,iBAAAA;;EAGR,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,GAAG;EAAA,SAAK,GAAGC,QAAH,CAAYC,IAAZ,CAAiBF,GAAjB,EAAsBG,KAAtB,CAA4B,aAA5B,EAA2C,CAA3C,EAA8CC,WAA9C,EAAL;EAAA,CAAlB;EAEA;;;;;;;EAMA,IAAMC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