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
7.4 KiB
2 lines
7.4 KiB
define ("theme_ilb/bootstrap/collapse",["exports","jquery","./util"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(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 g(a){for(var b=1,c;b<arguments.length;b++){c=null!=arguments[b]?arguments[b]:{};if(b%2){f(Object(c),!0).forEach(function(b){h(a,b,c[b])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(a,Object.getOwnPropertyDescriptors(c))}else{f(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}}return a}function h(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.collapse",n=".".concat(m),o=b.default.fn.collapse,p={toggle:!0,parent:""},q={toggle:"boolean",parent:"(string|element)"},r="show".concat(n),s="shown".concat(n),t="hide".concat(n),u="hidden".concat(n),v="click".concat(n).concat(".data-api"),w="show",x="collapse",y="collapsing",z="collapsed",A="width",B="[data-toggle=\"collapse\"]",C=function(){function a(b,d){j(this,a);this._isTransitioning=!1;this._element=b;this._config=this._getConfig(d);this._triggerArray=[].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#".concat(b.id,"\"],")+"[data-toggle=\"collapse\"][data-target=\"#".concat(b.id,"\"]")));for(var e=[].slice.call(document.querySelectorAll(B)),f=0,g=e.length;f<g;f++){var h=e[f],k=c.default.getSelectorFromElement(h),l=[].slice.call(document.querySelectorAll(k)).filter(function(a){return a===b});if(null!==k&&0<l.length){this._selector=k;this._triggerArray.push(h)}}this._parent=this._config.parent?this._getParent():null;if(!this._config.parent){this._addAriaAndCollapsedClass(this._element,this._triggerArray)}if(this._config.toggle){this.toggle()}}l(a,[{key:"toggle",value:function toggle(){if((0,b.default)(this._element).hasClass(w)){this.hide()}else{this.show()}}},{key:"show",value:function show(){var d=this;if(this._isTransitioning||(0,b.default)(this._element).hasClass(w)){return}var e,f;if(this._parent){e=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter(function(a){if("string"==typeof d._config.parent){return a.getAttribute("data-parent")===d._config.parent}return a.classList.contains(x)});if(0===e.length){e=null}}if(e){f=(0,b.default)(e).not(this._selector).data(m);if(f&&f._isTransitioning){return}}var g=b.default.Event(r);(0,b.default)(this._element).trigger(g);if(g.isDefaultPrevented()){return}if(e){a._jQueryInterface.call((0,b.default)(e).not(this._selector),"hide");if(!f){(0,b.default)(e).data(m,null)}}var h=this._getDimension();(0,b.default)(this._element).removeClass(x).addClass(y);this._element.style[h]=0;if(this._triggerArray.length){(0,b.default)(this._triggerArray).removeClass(z).attr("aria-expanded",!0)}this.setTransitioning(!0);var i=function(){(0,b.default)(d._element).removeClass(y).addClass("".concat(x," ").concat(w));d._element.style[h]="";d.setTransitioning(!1);(0,b.default)(d._element).trigger(s)},j=h[0].toUpperCase()+h.slice(1),k="scroll".concat(j),l=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,i).emulateTransitionEnd(l);this._element.style[h]="".concat(this._element[k],"px")}},{key:"hide",value:function hide(){var a=this;if(this._isTransitioning||!(0,b.default)(this._element).hasClass(w)){return}var d=b.default.Event(t);(0,b.default)(this._element).trigger(d);if(d.isDefaultPrevented()){return}var e=this._getDimension();this._element.style[e]="".concat(this._element.getBoundingClientRect()[e],"px");c.default.reflow(this._element);(0,b.default)(this._element).addClass(y).removeClass("".concat(x," ").concat(w));var f=this._triggerArray.length;if(0<f){for(var l=0;l<f;l++){var g=this._triggerArray[l],h=c.default.getSelectorFromElement(g);if(null!==h){var i=(0,b.default)([].slice.call(document.querySelectorAll(h)));if(!i.hasClass(w)){(0,b.default)(g).addClass(z).attr("aria-expanded",!1)}}}}this.setTransitioning(!0);var j=function(){a.setTransitioning(!1);(0,b.default)(a._element).removeClass(y).addClass(x).trigger(u)};this._element.style[e]="";var k=c.default.getTransitionDurationFromElement(this._element);(0,b.default)(this._element).one(c.default.TRANSITION_END,j).emulateTransitionEnd(k)}},{key:"setTransitioning",value:function setTransitioning(a){this._isTransitioning=a}},{key:"dispose",value:function dispose(){b.default.removeData(this._element,m);this._config=null;this._parent=null;this._element=null;this._triggerArray=null;this._isTransitioning=null}},{key:"_getConfig",value:function _getConfig(a){a=g({},p,{},a);a.toggle=!!a.toggle;c.default.typeCheckConfig("collapse",a,q);return a}},{key:"_getDimension",value:function _getDimension(){var a=(0,b.default)(this._element).hasClass(A);return a?A:"height"}},{key:"_getParent",value:function _getParent(){var d=this,e;if(c.default.isElement(this._config.parent)){e=this._config.parent;if("undefined"!=typeof this._config.parent.jquery){e=this._config.parent[0]}}else{e=document.querySelector(this._config.parent)}var f="[data-toggle=\"collapse\"][data-parent=\"".concat(this._config.parent,"\"]"),g=[].slice.call(e.querySelectorAll(f));(0,b.default)(g).each(function(b,c){d._addAriaAndCollapsedClass(a._getTargetFromElement(c),[c])});return e}},{key:"_addAriaAndCollapsedClass",value:function _addAriaAndCollapsedClass(a,c){var d=(0,b.default)(a).hasClass(w);if(c.length){(0,b.default)(c).toggleClass(z,!d).attr("aria-expanded",d)}}}],[{key:"_getTargetFromElement",value:function _getTargetFromElement(a){var b=c.default.getSelectorFromElement(a);return b?document.querySelector(b):null}},{key:"_jQueryInterface",value:function _jQueryInterface(c){return this.each(function(){var d=(0,b.default)(this),f=d.data(m),h=g({},p,{},d.data(),{},"object"===e(c)&&c?c:{});if(!f&&h.toggle&&"string"==typeof c&&/show|hide/.test(c)){h.toggle=!1}if(!f){f=new a(this,h);d.data(m,f)}if("string"==typeof c){if("undefined"==typeof f[c]){throw new TypeError("No method named \"".concat(c,"\""))}f[c]()}})}},{key:"VERSION",get:function get(){return"4.6.0"}},{key:"Default",get:function get(){return p}}]);return a}();(0,b.default)(document).on(v,B,function(a){if("A"===a.currentTarget.tagName){a.preventDefault()}var d=(0,b.default)(this),e=c.default.getSelectorFromElement(this),f=[].slice.call(document.querySelectorAll(e));(0,b.default)(f).each(function(){var a=(0,b.default)(this),c=a.data(m),e=c?"toggle":d.data();C._jQueryInterface.call(a,e)})});b.default.fn.collapse=C._jQueryInterface;b.default.fn.collapse.Constructor=C;b.default.fn.collapse.noConflict=function(){b.default.fn.collapse=o;return C._jQueryInterface};a.default=C;return a.default});
|
|
//# sourceMappingURL=collapse.min.js.map
|
|
|