You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
9.1 KiB
2 lines
9.1 KiB
define ("theme_ilb/bootstrap/dropdown",["exports","jquery","core/popper","./util"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=e(b);c=e(c);d=e(d);function e(a){return a&&a.__esModule?a:{default:a}}function f(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){f=function(a){return typeof a}}else{f=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return f(a)}function g(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function h(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){g(Object(c),!0).forEach(function(b){i(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{g(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function i(a,b,c){if(b in a){Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0})}else{a[b]=c}return a}function j(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function k(a,b){for(var c=0,d;c<b.length;c++){d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;if("value"in d)d.writable=!0;Object.defineProperty(a,d.key,d)}}function l(a,b,c){if(b)k(a.prototype,b);if(c)k(a,c);return a}var m="bs.dropdown",n=".".concat(m),o=".data-api",p=b.default.fn.dropdown,q=27,r=32,s=9,t=38,u=40,v=new RegExp("".concat(t,"|").concat(u,"|").concat(q)),w="hide".concat(n),x="hidden".concat(n),y="show".concat(n),z="shown".concat(n),A="click".concat(n),B="click".concat(n).concat(o),C="keydown".concat(n).concat(o),D="keyup".concat(n).concat(o),E="disabled",F="show",G="dropdown-menu-right",H="[data-toggle=\"dropdown\"]",I=".dropdown-menu",J={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},K={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},L=function(){function a(b,c){j(this,a);this._element=b;this._popper=null;this._config=this._getConfig(c);this._menu=this._getMenuElement();this._inNavbar=this._detectNavbar();this._addEventListeners()}l(a,[{key:"toggle",value:function toggle(){if(this._element.disabled||(0,b.default)(this._element).hasClass(E)){return}var c=(0,b.default)(this._menu).hasClass(F);a._clearMenus();if(c){return}this.show(!0)}},{key:"show",value:function show(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:!1;if(this._element.disabled||(0,b.default)(this._element).hasClass(E)||(0,b.default)(this._menu).hasClass(F)){return}var f={relatedTarget:this._element},g=b.default.Event(y,f),h=a._getParentFromElement(this._element);(0,b.default)(h).trigger(g);if(g.isDefaultPrevented()){return}if(!this._inNavbar&&e){if("undefined"==typeof c.default){throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)")}var i=this._element;if("parent"===this._config.reference){i=h}else if(d.default.isElement(this._config.reference)){i=this._config.reference;if("undefined"!=typeof this._config.reference.jquery){i=this._config.reference[0]}}if("scrollParent"!==this._config.boundary){(0,b.default)(h).addClass("position-static")}this._popper=new c.default(i,this._menu,this._getPopperConfig())}if("ontouchstart"in document.documentElement&&0===(0,b.default)(h).closest(".navbar-nav").length){(0,b.default)(document.body).children().on("mouseover",null,b.default.noop)}this._element.focus();this._element.setAttribute("aria-expanded",!0);(0,b.default)(this._menu).toggleClass(F);(0,b.default)(h).toggleClass(F).trigger(b.default.Event(z,f))}},{key:"hide",value:function hide(){if(this._element.disabled||(0,b.default)(this._element).hasClass(E)||!(0,b.default)(this._menu).hasClass(F)){return}var c={relatedTarget:this._element},d=b.default.Event(w,c),e=a._getParentFromElement(this._element);(0,b.default)(e).trigger(d);if(d.isDefaultPrevented()){return}if(this._popper){this._popper.destroy()}(0,b.default)(this._menu).toggleClass(F);(0,b.default)(e).toggleClass(F).trigger(b.default.Event(x,c))}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,m);(0,b.default)(this._element).off(n);this._element=null;this._menu=null;if(null!==this._popper){this._popper.destroy();this._popper=null}}},{key:"update",value:function update(){this._inNavbar=this._detectNavbar();if(null!==this._popper){this._popper.scheduleUpdate()}}},{key:"_addEventListeners",value:function _addEventListeners(){var a=this;(0,b.default)(this._element).on(A,function(b){b.preventDefault();b.stopPropagation();a.toggle()})}},{key:"_getConfig",value:function _getConfig(a){a=h({},this.constructor.Default,{},(0,b.default)(this._element).data(),{},a);d.default.typeCheckConfig("dropdown",a,this.constructor.DefaultType);return a}},{key:"_getMenuElement",value:function _getMenuElement(){if(!this._menu){var b=a._getParentFromElement(this._element);if(b){this._menu=b.querySelector(I)}}return this._menu}},{key:"_getPlacement",value:function _getPlacement(){var a=(0,b.default)(this._element.parentNode),c="bottom-start";if(a.hasClass("dropup")){c=(0,b.default)(this._menu).hasClass(G)?"top-end":"top-start"}else if(a.hasClass("dropright")){c="right-start"}else if(a.hasClass("dropleft")){c="left-start"}else if((0,b.default)(this._menu).hasClass(G)){c="bottom-end"}return c}},{key:"_detectNavbar",value:function _detectNavbar(){return 0<(0,b.default)(this._element).closest(".navbar").length}},{key:"_getOffset",value:function _getOffset(){var a=this,b={};if("function"==typeof this._config.offset){b.fn=function(b){b.offsets=h({},b.offsets,{},a._config.offset(b.offsets,a._element)||{});return b}}else{b.offset=this._config.offset}return b}},{key:"_getPopperConfig",value:function _getPopperConfig(){var a={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};if("static"===this._config.display){a.modifiers.applyStyle={enabled:!1}}return h({},a,{},this._config.popperConfig)}}],[{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this).data(m),e="object"===f(c)?c:null;if(!d){d=new a(this,e);(0,b.default)(this).data(m,d)}if("string"==typeof c){if("undefined"==typeof d[c]){throw new TypeError("No method named \"".concat(c,"\""))}d[c]()}})}},{key:"_clearMenus",value:function _clearMenus(c){if(c&&(c.which===3||"keyup"===c.type&&c.which!==s)){return}for(var d=[].slice.call(document.querySelectorAll(H)),e=0,f=d.length;e<f;e++){var g=a._getParentFromElement(d[e]),h=(0,b.default)(d[e]).data(m),j={relatedTarget:d[e]};if(c&&"click"===c.type){j.clickEvent=c}if(!h){continue}var k=h._menu;if(!(0,b.default)(g).hasClass(F)){continue}if(c&&("click"===c.type&&/input|textarea/i.test(c.target.tagName)||"keyup"===c.type&&c.which===s)&&b.default.contains(g,c.target)){continue}var l=b.default.Event(w,j);(0,b.default)(g).trigger(l);if(l.isDefaultPrevented()){continue}if("ontouchstart"in document.documentElement){(0,b.default)(document.body).children().off("mouseover",null,b.default.noop)}d[e].setAttribute("aria-expanded","false");if(h._popper){h._popper.destroy()}(0,b.default)(k).removeClass(F);(0,b.default)(g).removeClass(F).trigger(b.default.Event(x,j))}}},{key:"_getParentFromElement",value:function _getParentFromElement(a){var b,c=d.default.getSelectorFromElement(a);if(c){b=document.querySelector(c)}return b||a.parentNode}},{key:"_dataApiKeydownHandler",value:function _dataApiKeydownHandler(c){if(/input|textarea/i.test(c.target.tagName)?c.which===r||c.which!==q&&(c.which!==u&&c.which!==t||(0,b.default)(c.target).closest(I).length):!v.test(c.which)){return}if(this.disabled||(0,b.default)(this).hasClass(E)){return}var d=a._getParentFromElement(this),e=(0,b.default)(d).hasClass(F);if(!e&&c.which===q){return}c.preventDefault();c.stopPropagation();if(!e||c.which===q||c.which===r){if(c.which===q){(0,b.default)(d.querySelector(H)).trigger("focus")}(0,b.default)(this).trigger("click");return}var f=[].slice.call(d.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter(function(a){return(0,b.default)(a).is(":visible")});if(0===f.length){return}var g=f.indexOf(c.target);if(c.which===t&&0<g){g--}if(c.which===u&&g<f.length-1){g++}if(0>g){g=0}f[g].focus()}},{key:"VERSION",get:function get(){return"4.6.0"}},{key:"Default",get:function get(){return J}},{key:"DefaultType",get:function get(){return K}}]);return a}();(0,b.default)(document).on(C,H,L._dataApiKeydownHandler).on(C,I,L._dataApiKeydownHandler).on("".concat(B," ").concat(D),L._clearMenus).on(B,H,function(a){a.preventDefault();a.stopPropagation();L._jQueryInterface.call((0,b.default)(this),"toggle")}).on(B,".dropdown form",function(a){a.stopPropagation()});b.default.fn.dropdown=L._jQueryInterface;b.default.fn.dropdown.Constructor=L;b.default.fn.dropdown.noConflict=function(){b.default.fn.dropdown=p;return L._jQueryInterface};a.default=L;return a.default});
|
|
//# sourceMappingURL=dropdown.min.js.map
|
|
|