0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-04 16:24:22 +01:00
Bootstrap/js/dist/util.js.map

1 line
6.8 KiB
Plaintext

{"version":3,"sources":["js/src/util.js"],"names":[],"mappings":";;;;;;;;;AAOA,IAAM,IAAI,GAAG,CAAC,UAAC,CAAC,EAAK;;;;;;;;AASnB,MAAI,UAAU,GAAG,KAAK,CAAA;;AAEtB,MAAM,kBAAkB,GAAG;AACzB,oBAAgB,EAAG,qBAAqB;AACxC,iBAAa,EAAM,eAAe;AAClC,eAAW,EAAQ,+BAA+B;AAClD,cAAU,EAAS,eAAe;GACnC,CAAA;;;AAGD,WAAS,MAAM,CAAC,GAAG,EAAE;AACnB,WAAO,CAAC,GAAE,CAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;GACvE;;AAED,WAAS,SAAS,CAAC,GAAG,EAAE;AACtB,WAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAA,CAAE,QAAQ,CAAC;GACjC;;AAED,WAAS,4BAA4B,GAAG;AACtC,WAAO;AACL,cAAQ,EAAE,UAAU,CAAC,GAAG;AACxB,kBAAY,EAAE,UAAU,CAAC,GAAG;AAC5B,YAAM,EAAE,gBAAU,KAAK,EAAE;AACvB,YAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;AAC5B,iBAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;SACtD;OACF;KACF,CAAA;GACF;;AAED,WAAS,iBAAiB,GAAG;AAC3B,QAAI,MAAM,CAAC,KAAK,EAAE;AAChB,aAAO,KAAK,CAAA;KACb;;AAED,QAAI,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAA;;AAE5C,SAAK,IAAI,IAAI,I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M,CAAC,CAAA","file":"js/src/util.js","sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst Util = (($) => {\n\n\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n let transition = false\n\n const TransitionEndEvent = {\n WebkitTransition : 'webkitTransitionEnd',\n MozTransition : 'transitionend',\n OTransition : 'oTransitionEnd otransitionend',\n transition : 'transitionend'\n }\n\n // shoutout AngusCroll (https://goo.gl/pxwQGp)\n function toType(obj) {\n return ({}).toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase()\n }\n\n function isElement(obj) {\n return (obj[0] || obj).nodeType;\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: transition.end,\n delegateType: transition.end,\n handle: function (event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments)\n }\n }\n }\n }\n\n function transitionEndTest() {\n if (window.QUnit) {\n return false\n }\n\n let el = document.createElement('bootstrap')\n\n for (var name in TransitionEndEvent) {\n if (el.style[name] !== undefined) {\n return { end: TransitionEndEvent[name] }\n }\n }\n\n return false\n }\n\n function transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, function () {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n }\n\n function setTransitionEndSupport() {\n transition = transitionEndTest()\n\n $.fn.emulateTransitionEnd = transitionEndEmulator\n\n if (Util.supportsTransitionEnd()) {\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n }\n }\n\n\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n let Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do prefix += ~~(Math.random() * 1000000)\n while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector) {\n selector = element.getAttribute('href') || ''\n selector = /^#[a-z]/i.test(selector) ? selector : null\n }\n\n return selector\n },\n\n reflow(element) {\n new Function('bs', 'return bs')(element.offsetHeight)\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(transition.end)\n },\n\n supportsTransitionEnd() {\n return !!transition\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n\n for (let property in configTypes) {\n let expectedTypes = configTypes[property]\n let value = config[property]\n let valueType\n\n if (value && isElement(value)) valueType = 'element'\n else valueType = 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\n }\n\n setTransitionEndSupport()\n\n return Util\n\n})(jQuery)\n\nexport default Util\n"]}