mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
1 line
No EOL
22 KiB
Text
1 line
No EOL
22 KiB
Text
{"version":3,"file":"tab.js","sources":["../src/util/index.js","../src/tab.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'\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 prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getSelector = 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() : null\n }\n\n return selector\n}\n\nconst getSelectorFromElement = element => {\n const selector = getSelector(element)\n\n if (selector) {\n return document.querySelector(selector) ? selector : null\n }\n\n return null\n}\n\nconst getElementFromSelector = element => {\n const selector = getSelector(element)\n\n return selector ? document.querySelector(selector) : null\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\nconst noop = () => function () {}\n\nconst reflow = element => element.offsetHeight\n\nconst getjQuery = () => {\n const { jQuery } = window\n\n if (jQuery && !document.body.hasAttribute('data-no-jquery')) {\n return jQuery\n }\n\n return null\n}\n\nexport {\n getjQuery,\n TRANSITION_END,\n getUID,\n getSelectorFromElement,\n getElementFromSelector,\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): tab.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n getjQuery,\n TRANSITION_END,\n emulateTransitionEnd,\n getElementFromSelector,\n getTransitionDurationFromElement,\n makeArray,\n reflow\n} from './util/index'\nimport Data from './dom/data'\nimport EventHandler from './dom/event-handler'\nimport SelectorEngine from './dom/selector-engine'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tab'\nconst VERSION = '4.3.1'\nconst DATA_KEY = 'bs.tab'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst Event = {\n HIDE: `hide${EVENT_KEY}`,\n HIDDEN: `hidden${EVENT_KEY}`,\n SHOW: `show${EVENT_KEY}`,\n SHOWN: `shown${EVENT_KEY}`,\n CLICK_DATA_API: `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_MENU: 'dropdown-menu',\n ACTIVE: 'active',\n DISABLED: 'disabled',\n FADE: 'fade',\n SHOW: 'show'\n}\n\nconst Selector = {\n DROPDOWN: '.dropdown',\n NAV_LIST_GROUP: '.nav, .list-group',\n ACTIVE: '.active',\n ACTIVE_UL: ':scope > li > .active',\n DATA_TOGGLE: '[data-toggle=\"tab\"], [data-toggle=\"pill\"], [data-toggle=\"list\"]',\n DROPDOWN_TOGGLE: '.dropdown-toggle',\n DROPDOWN_ACTIVE_CHILD: ':scope > .dropdown-menu .active'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tab {\n constructor(element) {\n this._element = element\n\n Data.setData(this._element, DATA_KEY, this)\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n show() {\n if ((this._element.parentNode &&\n this._element.parentNode.nodeType === Node.ELEMENT_NODE &&\n this._element.classList.contains(ClassName.ACTIVE)) ||\n this._element.classList.contains(ClassName.DISABLED)) {\n return\n }\n\n let previous\n const target = getElementFromSelector(this._element)\n const listElement = SelectorEngine.closest(this._element, Selector.NAV_LIST_GROUP)\n\n if (listElement) {\n const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE\n previous = makeArray(SelectorEngine.find(itemSelector, listElement))\n previous = previous[previous.length - 1]\n }\n\n let hideEvent = null\n\n if (previous) {\n hideEvent = EventHandler.trigger(previous, Event.HIDE, {\n relatedTarget: this._element\n })\n }\n\n const showEvent = EventHandler.trigger(this._element, Event.SHOW, {\n relatedTarget: previous\n })\n\n if (showEvent.defaultPrevented ||\n (hideEvent !== null && hideEvent.defaultPrevented)) {\n return\n }\n\n this._activate(\n this._element,\n listElement\n )\n\n const complete = () => {\n EventHandler.trigger(previous, Event.HIDDEN, {\n relatedTarget: this._element\n })\n EventHandler.trigger(this._element, Event.SHOWN, {\n relatedTarget: previous\n })\n }\n\n if (target) {\n this._activate(target, target.parentNode, complete)\n } else {\n complete()\n }\n }\n\n dispose() {\n Data.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _activate(element, container, callback) {\n const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ?\n SelectorEngine.find(Selector.ACTIVE_UL, container) :\n SelectorEngine.children(container, Selector.ACTIVE)\n\n const active = activeElements[0]\n const isTransitioning = callback &&\n (active && active.classList.contains(ClassName.FADE))\n\n const complete = () => this._transitionComplete(\n element,\n active,\n callback\n )\n\n if (active && isTransitioning) {\n const transitionDuration = getTransitionDurationFromElement(active)\n active.classList.remove(ClassName.SHOW)\n\n EventHandler.one(active, TRANSITION_END, complete)\n emulateTransitionEnd(active, transitionDuration)\n } else {\n complete()\n }\n }\n\n _transitionComplete(element, active, callback) {\n if (active) {\n active.classList.remove(ClassName.ACTIVE)\n\n const dropdownChild = SelectorEngine.findOne(Selector.DROPDOWN_ACTIVE_CHILD, active.parentNode)\n\n if (dropdownChild) {\n dropdownChild.classList.remove(ClassName.ACTIVE)\n }\n\n if (active.getAttribute('role') === 'tab') {\n active.setAttribute('aria-selected', false)\n }\n }\n\n element.classList.add(ClassName.ACTIVE)\n if (element.getAttribute('role') === 'tab') {\n element.setAttribute('aria-selected', true)\n }\n\n reflow(element)\n\n if (element.classList.contains(ClassName.FADE)) {\n element.classList.add(ClassName.SHOW)\n }\n\n if (element.parentNode && element.parentNode.classList.contains(ClassName.DROPDOWN_MENU)) {\n const dropdownElement = SelectorEngine.closest(element, Selector.DROPDOWN)\n\n if (dropdownElement) {\n makeArray(SelectorEngine.find(Selector.DROPDOWN_TOGGLE))\n .forEach(dropdown => dropdown.classList.add(ClassName.ACTIVE))\n }\n\n element.setAttribute('aria-expanded', true)\n }\n\n if (callback) {\n callback()\n }\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Data.getData(this, DATA_KEY) || new Tab(this)\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(document, Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n\n const data = Data.getData(this, DATA_KEY) || new Tab(this)\n data.show()\n})\n\nconst $ = getjQuery()\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .tab to jQuery only if jQuery is present\n */\n/* istanbul ignore if */\nif ($) {\n const JQUERY_NO_CONFLICT = $.fn[NAME]\n $.fn[NAME] = Tab.jQueryInterface\n $.fn[NAME].Constructor = Tab\n $.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tab.jQueryInterface\n }\n}\n\nexport default Tab\n"],"names":["MILLISECONDS_MULTIPLIER","TRANSITION_END","getSelector","element","selector","getAttribute","hrefAttr","trim","getElementFromSelector","document","querySelector","getTransitionDurationFromElement","window","getComputedStyle","transitionDuration","transitionDelay","floatTransitionDuration","parseFloat","floatTransitionDelay","split","triggerTransitionEnd","evt","createEvent","initEvent","dispatchEvent","emulateTransitionEnd","duration","called","durationPadding","emulatedDuration","listener","removeEventListener","addEventListener","setTimeout","makeArray","nodeList","slice","call","reflow","offsetHeight","getjQuery","jQuery","body","hasAttribute","NAME","VERSION","DATA_KEY","EVENT_KEY","DATA_API_KEY","Event","HIDE","HIDDEN","SHOW","SHOWN","CLICK_DATA_API","ClassName","DROPDOWN_MENU","ACTIVE","DISABLED","FADE","Selector","DROPDOWN","NAV_LIST_GROUP","ACTIVE_UL","DATA_TOGGLE","DROPDOWN_TOGGLE","DROPDOWN_ACTIVE_CHILD","Tab","_element","Data","setData","show","parentNode","nodeType","Node","ELEMENT_NODE","classList","contains","previous","target","listElement","SelectorEngine","closest","itemSelector","nodeName","find","length","hideEvent","EventHandler","trigger","relatedTarget","showEvent","defaultPrevented","_activate","complete","dispose","removeData","container","callback","activeElements","children","active","isTransitioning","_transitionComplete","remove","one","dropdownChild","findOne","setAttribute","add","dropdownElement","forEach","dropdown","jQueryInterface","config","each","data","getData","TypeError","getInstance","on","event","preventDefault","$","JQUERY_NO_CONFLICT","fn","Constructor","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;AAOA,EACA,IAAMA,uBAAuB,GAAG,IAAhC;EACA,IAAMC,cAAc,GAAG,eAAvB;;EAmBA,IAAMC,WAAW,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