mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-13 01:08:58 +01:00
7 lines
73 KiB
JavaScript
7 lines
73 KiB
JavaScript
|
/*!
|
||
|
* Bootstrap v4.3.1 (https://getbootstrap.com/)
|
||
|
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||
|
*/
|
||
|
import Popper from"popper.js";const MAX_UID=1e6,MILLISECONDS_MULTIPLIER=1e3,TRANSITION_END="transitionend",_window=window,jQuery=_window.jQuery,toType=e=>({}).toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),getUID=e=>{do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},getSelectorFromElement=e=>{let t=e.getAttribute("data-target");if(!t||"#"===t){const n=e.getAttribute("href");t=n&&"#"!==n?n.trim():""}try{return document.querySelector(t)?t:null}catch(e){return null}},getTransitionDurationFromElement=e=>{if(!e)return 0;let t=window.getComputedStyle(e),n=t.transitionDuration,i=t.transitionDelay;const s=parseFloat(n),a=parseFloat(i);return s||a?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},triggerTransitionEnd=e=>{e.dispatchEvent(new Event(TRANSITION_END))},isElement=e=>(e[0]||e).nodeType,emulateTransitionEnd=(e,t)=>{let n=!1;const i=t+5;e.addEventListener(TRANSITION_END,function t(){n=!0,e.removeEventListener(TRANSITION_END,t)}),setTimeout(()=>{n||triggerTransitionEnd(e)},i)},typeCheckConfig=(e,t,n)=>{Object.keys(n).forEach(i=>{const s=n[i],a=t[i],o=a&&isElement(a)?"element":toType(a);if(!new RegExp(s).test(o))throw new Error(`${e.toUpperCase()}: `+`Option "${i}" provided type "${o}" `+`but expected type "${s}".`)})},makeArray=e=>e?[].slice.call(e):[],isVisible=e=>!!e&&(!!(e.style&&e.parentNode&&e.parentNode.style)&&("none"!==e.style.display&&"none"!==e.parentNode.style.display&&"hidden"!==e.style.visibility)),findShadowRoot=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?findShadowRoot(e.parentNode):null},noop=()=>(function(){}),reflow=e=>e.offsetHeight,mapData=(()=>{const e={};let t=1;return{set(n,i,s){void 0===n.key&&(n.key={key:i,id:t},t++),e[n.key.id]=s},get(t,n){if(!t||void 0===t.key)return null;const i=t.key;return i.key===n?e[i.id]:null},delete(t,n){if(void 0===t.key)return;const i=t.key;i.key===n&&(delete e[i.id],delete t.key)}}})(),Data={setData(e,t,n){mapData.set(e,t,n)},getData:(e,t)=>mapData.get(e,t),removeData(e,t){mapData.delete(e,t)}},Polyfill=(()=>{const e=(()=>{const e=new CustomEvent("Bootstrap",{cancelable:!0}),t=document.createElement("div");return t.addEventListener("Bootstrap",()=>null),e.preventDefault(),t.dispatchEvent(e),e.defaultPrevented})();let t=Element.prototype.querySelectorAll,n=Element.prototype.querySelector;const i=/:scope\b/;return(()=>{const e=document.createElement("div");try{e.querySelectorAll(":scope *")}catch(e){return!1}return!0})()||(t=function(e){if(!i.test(e))return this.querySelectorAll(e);const t=Boolean(this.id);t||(this.id=getUID("scope"));let n=null;try{e=e.replace(i,`#${this.id}`),n=this.querySelectorAll(e)}finally{t||this.removeAttribute("id")}return n},n=function(e){if(!i.test(e))return this.querySelector(e);const n=t.call(this,e);return void 0!==n[0]?n[0]:null}),{defaultPreventedPreservedOnDispatch:e,find:t,findOne:n}})(),namespaceRegex=/[^.]*(?=\..*)\.|.*/,stripNameRegex=/\..*/,keyEventRegex=/^key/,stripUidRegex=/::\d+$/,eventRegistry={};let uidEvent=1;const customEvents={mouseenter:"mouseover",mouseleave:"mouseout"},nativeEvents=["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"];function getUidEvent(e,t){return t&&`${t}::${uidEvent++}`||e.uidEvent||uidEvent++}function getEvent(e){const t=getUidEvent(e);return e.uidEvent=t,eventRegistry[t]=eventRegistry[t]||{},eventRegistry[t]}function fixEvent(e,t){null===e.which&&keyEventRegex.test(e.type)&&(e.which=null===e.charCode?e.keyCod
|
||
|
//# sourceMappingURL=bootstrap.esm.min.js.map
|