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 line
9.8 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="modal",c="4.0.0",d="bs.modal",h=".".concat(d),j=".data-api",l=a.fn[b],m=300,n=150,o=27,p={backdrop:!0,keyboard:!0,focus:!0,show:!0},q={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},r={HIDE:"hide".concat(h),HIDDEN:"hidden".concat(h),SHOW:"show".concat(h),SHOWN:"shown".concat(h),FOCUSIN:"focusin".concat(h),RESIZE:"resize".concat(h),CLICK_DISMISS:"click.dismiss".concat(h),KEYDOWN_DISMISS:"keydown.dismiss".concat(h),MOUSEUP_DISMISS:"mouseup.dismiss".concat(h),MOUSEDOWN_DISMISS:"mousedown.dismiss".concat(h),CLICK_DATA_API:"click".concat(h).concat(j)},s={SCROLLBAR_MEASURER:"modal-scrollbar-measure",BACKDROP:"modal-backdrop",OPEN:"modal-open",FADE:"fade",SHOW:"show"},t={DIALOG:".modal-dialog",DATA_TOGGLE:'[data-toggle="modal"]',DATA_DISMISS:'[data-dismiss="modal"]',FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"},u=function(){function j(b,c){g(this,j),this._config=this._getConfig(c),this._element=b,this._dialog=a(b).find(t.DIALOG)[0],this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._originalBodyPadding=0,this._scrollbarWidth=0}return i(j,[{key:"toggle",value:function(a){return this._isShown?this.hide():this.show(a)}},{key:"show",value:function(b){var c=this;if(!this._isTransitioning&&!this._isShown){k["default"].supportsTransitionEnd()&&a(this._element).hasClass(s.FADE)&&(this._isTransitioning=!0);var d=a.Event(r.SHOW,{relatedTarget:b});a(this._element).trigger(d),this._isShown||d.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),a(document.body).addClass(s.OPEN),this._setEscapeEvent(),this._setResizeEvent(),a(this._element).on(r.CLICK_DISMISS,t.DATA_DISMISS,function(a){return c.hide(a)}),a(this._dialog).on(r.MOUSEDOWN_DISMISS,function(){a(c._element).one(r.MOUSEUP_DISMISS,function(b){a(b.target).is(c._element)&&(c._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return c._showElement(b)}))}}},{key:"hide",value:function(b){var c=this;if(b&&b.preventDefault(),!this._isTransitioning&&this._isShown){var d=a.Event(r.HIDE);if(a(this._element).trigger(d),this._isShown&&!d.isDefaultPrevented()){this._isShown=!1;var e=k["default"].supportsTransitionEnd()&&a(this._element).hasClass(s.FADE);e&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),a(document).off(r.FOCUSIN),a(this._element).removeClass(s.SHOW),a(this._element).off(r.CLICK_DISMISS),a(this._dialog).off(r.MOUSEDOWN_DISMISS),e?a(this._element).one(k["default"].TRANSITION_END,function(a){return c._hideModal(a)}).emulateTransitionEnd(m):this._hideModal()}}}},{key:"dispose",value:function(){a.removeData(this._element,d),a(window,document,this._element,this._backdrop).off(h),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._scrollbarWidth=null}},{key:"handleUpdate",value:function(){this._adjustDialog()}},{key:"_getConfig",value:function(a){return a=f({},p,a),k["default"].typeCheckConfig(