{"version":3,"file":"eventhandler.js","sources":["../../src/util/index.js","../../src/dom/eventHandler.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.jQuery\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 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 (err) {\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 element.dispatchEvent(new Event(TRANSITION_END))\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' : 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): dom/eventHandler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n jQuery as $\n} from '../util/index'\nimport Polyfill from './polyfill'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/\nconst stripNameRegex = /\\..*/\nconst keyEventRegex = /^key/\nconst stripUidRegex = /::\\d+$/\nconst eventRegistry = {} // Events storage\nlet uidEvent = 1\nconst customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n}\nconst nativeEvents = [\n 'click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu',\n 'mousewheel', 'DOMMouseScroll',\n 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend',\n 'keydown', 'keypress', 'keyup',\n 'orientationchange',\n 'touchstart', 'touchmove', 'touchend', 'touchcancel',\n 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel',\n 'gesturestart', 'gesturechange', 'gestureend',\n 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout',\n 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange',\n 'error', 'abort', 'scroll'\n]\n\n/**\n * ------------------------------------------------------------------------\n * Private methods\n * ------------------------------------------------------------------------\n */\n\nfunction getUidEvent(element, uid) {\n return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++\n}\n\nfunction getEvent(element) {\n const uid = getUidEvent(element)\n element.uidEvent = uid\n\n return eventRegistry[uid] = eventRegistry[uid] || {}\n}\n\nfunction fixEvent(event, element) {\n // Add which for key events\n if (event.which === null && keyEventRegex.test(event.type)) {\n event.which = event.charCode !== null ? event.charCode : event.keyCode\n }\n\n event.delegateTarget = element\n}\n\nfunction bootstrapHandler(element, fn) {\n return function handler(event) {\n fixEvent(event, element)\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn)\n }\n\n return fn.apply(element, [event])\n }\n}\n\nfunction bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector)\n\n for (let target = event.target; target && target !== this; target = target.parentNode) {\n for (let i = domElements.length; i--;) {\n if (domElements[i] === target) {\n fixEvent(event, target)\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn)\n }\n\n return fn.apply(target, [event])\n }\n }\n }\n\n // To please ESLint\n return null\n }\n}\n\nfunction findHandler(events, handler, delegationSelector = null) {\n const uidList = Object.keys(events)\n\n for (let i = 0; i < uidList.length; i++) {\n const uid = uidList[i]\n const event = events[uid]\n\n if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {\n return events[uid]\n }\n }\n\n return null\n}\n\nfunction normalizeParams(originalTypeEvent, handler, delegationFn) {\n const delegation = typeof handler === 'string'\n const originalHandler = delegation ? delegationFn : handler\n\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n let typeEvent = originalTypeEvent.replace(stripNameRegex, '')\n const custom = customEvents[typeEvent]\n\n if (custom) {\n typeEvent = custom\n }\n\n const isNative = nativeEvents.indexOf(typeEvent) > -1\n\n if (!isNative) {\n typeEvent = originalTypeEvent\n }\n\n return [delegation, originalHandler, typeEvent]\n}\n\nfunction addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n if (!handler) {\n handler = delegationFn\n delegationFn = null\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)\n const events = getEvent(element)\n const handlers = events[typeEvent] || (events[typeEvent] = {})\n const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null)\n\n if (previousFn) {\n previousFn.oneOff = previousFn.oneOff && oneOff\n\n return\n }\n\n const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''))\n const fn = !delegation ? bootstrapHandler(element, handler) : bootstrapDelegationHandler(element, handler, delegationFn)\n\n fn.delegationSelector = delegation ? handler : null\n fn.originalHandler = originalHandler\n fn.oneOff = oneOff\n fn.uidEvent = uid\n handlers[uid] = fn\n\n element.addEventListener(typeEvent, fn, delegation)\n}\n\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector)\n\n if (fn === null) {\n return\n }\n\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))\n delete events[typeEvent][fn.uidEvent]\n}\n\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {}\n\n Object.keys(storeElementEvent)\n .forEach((handlerKey) => {\n if (handlerKey.indexOf(namespace) > -1) {\n const event = storeElementEvent[handlerKey]\n\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)\n }\n })\n}\n\nconst EventHandler = {\n on(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, false)\n },\n\n one(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, true)\n },\n\n off(element, originalTypeEvent, handler, delegationFn) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)\n const inNamespace = typeEvent !== originalTypeEvent\n const events = getEvent(element)\n const isNamespace = originalTypeEvent.charAt(0) === '.'\n\n if (typeof originalHandler !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!events || !events[typeEvent]) {\n return\n }\n\n removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null)\n return\n }\n\n if (isNamespace) {\n Object.keys(events)\n .forEach((elementEvent) => {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.substr(1))\n })\n }\n\n const storeElementEvent = events[typeEvent] || {}\n Object.keys(storeElementEvent)\n .forEach((keyHandlers) => {\n const handlerKey = keyHandlers.replace(stripUidRegex, '')\n\n if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) {\n const event = storeElementEvent[keyHandlers]\n\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)\n }\n })\n },\n\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null\n }\n\n const typeEvent = event.replace(stripNameRegex, '')\n const inNamespace = event !== typeEvent\n const isNative = nativeEvents.indexOf(typeEvent) > -1\n\n let jQueryEvent\n let bubbles = true\n let nativeDispatch = true\n let defaultPrevented = false\n let evt = null\n\n if (inNamespace && typeof $ !== 'undefined') {\n jQueryEvent = $.Event(event, args)\n\n $(element).trigger(jQueryEvent)\n bubbles = !jQueryEvent.isPropagationStopped()\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()\n defaultPrevented = jQueryEvent.isDefaultPrevented()\n }\n\n if (isNative) {\n evt = document.createEvent('HTMLEvents')\n evt.initEvent(typeEvent, bubbles, true)\n } else {\n evt = new CustomEvent(event, {\n bubbles,\n cancelable: true\n })\n }\n\n // merge custom informations in our event\n if (typeof args !== 'undefined') {\n Object.keys(args)\n .forEach((key) => {\n Object.defineProperty(evt, key, {\n get() {\n return args[key]\n }\n })\n })\n }\n\n if (defaultPrevented) {\n evt.preventDefault()\n\n if (!Polyfill.defaultPreventedPreservedOnDispatch) {\n Object.defineProperty(evt, 'defaultPrevented', {\n get: () => true\n })\n }\n }\n\n if (nativeDispatch) {\n element.dispatchEvent(evt)\n }\n\n if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {\n jQueryEvent.preventDefault()\n }\n\n return evt\n }\n}\n\nexport default EventHandler\n"],"names":["jQuery","window","namespaceRegex","stripNameRegex","keyEventRegex","stripUidRegex","eventRegistry","uidEvent","customEvents","mouseenter","mouseleave","nativeEvents","getUidEvent","element","uid","getEvent","fixEvent","event","which","test","type","charCode","keyCode","delegateTarget","bootstrapHandler","fn","handler","oneOff","EventHandler","off","apply","bootstrapDelegationHandler","selector","domElements","querySelectorAll","target","parentNode","i","length","findHandler","events","delegationSelector","uidList","Object","keys","originalHandler","normalizeParams","originalTypeEvent","delegationFn","delegation","typeEvent","replace","custom","isNative","indexOf","addHandler","handlers","previousFn","addEventListener","removeHandler","removeEventListener","Boolean","removeNamespacedHandlers","namespace","storeElementEvent","forEach","handlerKey","on","one","inNamespace","isNamespace","charAt","elementEvent","substr","keyHandlers","trigger","args","jQueryEvent","bubbles","nativeDispatch","defaultPrevented","evt","$","Event","isPropagationStopped","isImmediatePropagationStopped","isDefaultPrevented","document","createEvent","initEvent","CustomEvent","cancelable","key","defineProperty","get","preventDefault","Polyfill","defaultPreventedPreservedOnDispatch","dispatchEvent"],"mappings":";;;;;;;;;;;;;EAAA;;;;;;AAOA,EAGA,IAAMA,MAAM,GAAGC,MAAM,CAACD,MAAtB;;ECVA;;;;;;AAOA,EAKA;;;;;;EAMA,IAAME,cAAc,GAAG,oBAAvB;EACA,IAAMC,cAAc,GAAG,MAAvB;EACA,IAAMC,aAAa,GAAI,MAAvB;EACA,IAAMC,aAAa,GAAI,QAAvB;EACA,IAAMC,aAAa,GAAI,EAAvB;;EACA,IAAIC,QAAQ,GAAW,CAAvB;EACA,IAAMC,YAAY,GAAK;EACrBC,EAAAA,UAAU,EAAE,WADS;EAErBC,EAAAA,UAAU,EAAE;EAFS,CAAvB;EAIA,IAAMC,YAAY,GAAK,CACrB,OADqB,EACZ,UADY,EACA,SADA,EACW,WADX,EACwB,aADxB,EAErB,YAFqB,EAEP,gBAFO,EAGrB,WAHqB,EAGR,UAHQ,EAGI,WAHJ,EAGiB,aAHjB,EAGgC,WAHhC,EAIrB,SAJqB,EAIV,UAJU,EAIE,OAJF,EAKrB,mBALqB,EAMrB,YANqB,EAMP,WANO,EAMM,UANN,EAMkB,aANlB,EAOrB,aAPqB,EAON,aAPM,EAOS,WAPT,EAOsB,cAPtB,EAOsC,eAPtC,EAQrB,cARqB,EAQL,eARK,EAQY,YARZ,EASrB,OATqB,EASZ,MATY,EASJ,QATI,EASM,OATN,EASe,QATf,EASyB,QATzB,EASmC,SATnC,EAS8C,UAT9C,EAUrB,MAVqB,EAUb,QAVa,EAUH,cAV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