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.
 
 
 
 
 

1 lines
6.1 KiB

define(["exports","jquery","./util"],function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(a)}function f(){return f=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d])}return a},f.apply(this,arguments)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function h(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function i(a,b,c){return b&&h(a.prototype,b),c&&h(a,c),a}Object.defineProperty(a,"__esModule",{value:!0});var j=d(b),k=d(c),l=function(a){var b="collapse",c="4.0.0",d="bs.collapse",h=".".concat(d),j=".data-api",l=a.fn[b],m=600,n={toggle:!0,parent:""},o={toggle:"boolean",parent:"(string|element)"},p={SHOW:"show".concat(h),SHOWN:"shown".concat(h),HIDE:"hide".concat(h),HIDDEN:"hidden".concat(h),CLICK_DATA_API:"click".concat(h).concat(j)},q={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},r={WIDTH:"width",HEIGHT:"height"},s={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},t=function(){function h(b,c){g(this,h),this._isTransitioning=!1,this._element=b,this._config=this._getConfig(c),this._triggerArray=a.makeArray(a('[data-toggle="collapse"][href="#'.concat(b.id,'"],')+'[data-toggle="collapse"][data-target="#'.concat(b.id,'"]')));for(var d=a(s.DATA_TOGGLE),e=0;e<d.length;e++){var f=d[e],i=k["default"].getSelectorFromElement(f);null!==i&&a(i).filter(b).length>0&&(this._selector=i,this._triggerArray.push(f))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return i(h,[{key:"toggle",value:function(){a(this._element).hasClass(q.SHOW)?this.hide():this.show()}},{key:"show",value:function(){var b=this;if(!this._isTransitioning&&!a(this._element).hasClass(q.SHOW)){var c,e;if(this._parent&&(c=a.makeArray(a(this._parent).find(s.ACTIVES).filter('[data-parent="'.concat(this._config.parent,'"]'))),0===c.length&&(c=null)),!(c&&(e=a(c).not(this._selector).data(d),e&&e._isTransitioning))){var f=a.Event(p.SHOW);if(a(this._element).trigger(f),!f.isDefaultPrevented()){c&&(h._jQueryInterface.call(a(c).not(this._selector),"hide"),e||a(c).data(d,null));var g=this._getDimension();a(this._element).removeClass(q.COLLAPSE).addClass(q.COLLAPSING),this._element.style[g]=0,this._triggerArray.length>0&&a(this._triggerArray).removeClass(q.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var i=function(){a(b._element).removeClass(q.COLLAPSING).addClass(q.COLLAPSE).addClass(q.SHOW),b._element.style[g]="",b.setTransitioning(!1),a(b._element).trigger(p.SHOWN)};if(!k["default"].supportsTransitionEnd())return void i();var j=g[0].toUpperCase()+g.slice(1),l="scroll".concat(j);a(this._element).one(k["default"].TRANSITION_END,i).emulateTransitionEnd(m),this._element.style[g]="".concat(this._element[l],"px")}}}}},{key:"hide",value:function(){var b=this;if(!this._isTransitioning&&a(this._element).hasClass(q.SHOW)){var c=a.Event(p.HIDE);if(a(this._element).trigger(c),!c.isDefaultPrevented()){var d=this._getDimension();if(this._element.style[d]="".concat(this._element.getBoundingClientRect()[d],"px"),k["default"].reflow(this._element),a(this._element).addClass(q.COLLAPSING).removeClass(q.COLLAPSE).removeClass(q.SHOW),this._triggerArray.length>0)for(var e=0;e<this._triggerArray.length;e++){var f=this._triggerArray[e],g=k["default"].getSelectorFromElement(f);if(null!==g){var h=a(g);h.hasClass(q.SHOW)||a(f).addClass(q.COLLAPSED).attr("aria-expanded",!1)}}this.setTransitioning(!0);var i=function(){b.setTransitioning(!1),a(b._element).removeClass(q.COLLAPSING).addClass(q.COLLAPSE).trigger(p.HIDDEN)};return this._element.style[d]="",k["default"].supportsTransitionEnd()?void a(this._element).one(k["default"].TRANSITION_END,i).emulateTransitionEnd(m):void i()}}}},{key:"setTransitioning",value:function(a){this._isTransitioning=a}},{key:"dispose",value:function(){a.removeData(this._element,d),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null}},{key:"_getConfig",value:function(a){return a=f({},n,a),a.toggle=Boolean(a.toggle),k["default"].typeCheckConfig(b,a,o),a}},{key:"_getDimension",value:function(){var b=a(this._element).hasClass(r.WIDTH);return b?r.WIDTH:r.HEIGHT}},{key:"_getParent",value:function(){var b=this,c=null;k["default"].isElement(this._config.parent)?(c=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(c=this._config.parent[0])):c=a(this._config.parent)[0];var d='[data-toggle="collapse"][data-parent="'.concat(this._config.parent,'"]');return a(c).find(d).each(function(a,c){b._addAriaAndCollapsedClass(h._getTargetFromElement(c),[c])}),c}},{key:"_addAriaAndCollapsedClass",value:function(b,c){if(b){var d=a(b).hasClass(q.SHOW);c.length>0&&a(c).toggleClass(q.COLLAPSED,!d).attr("aria-expanded",d)}}}],[{key:"_getTargetFromElement",value:function(b){var c=k["default"].getSelectorFromElement(b);return c?a(c)[0]:null}},{key:"_jQueryInterface",value:function(b){return this.each(function(){var c=a(this),g=c.data(d),i=f({},n,c.data(),"object"===e(b)&&b);if(!g&&i.toggle&&/show|hide/.test(b)&&(i.toggle=!1),g||(g=new h(this,i),c.data(d,g)),"string"==typeof b){if("undefined"==typeof g[b])throw new TypeError('No method named "'.concat(b,'"'));g[b]()}})}},{key:"VERSION",get:function(){return c}},{key:"Default",get:function(){return n}}]),h}();return a(document).on(p.CLICK_DATA_API,s.DATA_TOGGLE,function(b){"A"===b.currentTarget.tagName&&b.preventDefault();var c=a(this),e=k["default"].getSelectorFromElement(this);a(e).each(function(){var b=a(this),e=b.data(d),f=e?"toggle":c.data();t._jQueryInterface.call(b,f)})}),a.fn[b]=t._jQueryInterface,a.fn[b].Constructor=t,a.fn[b].noConflict=function(){return a.fn[b]=l,t._jQueryInterface},t}(j["default"]);a["default"]=l});