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
7.5 KiB
1 line
7.5 KiB
6 years ago
|
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="carousel",c="4.0.0",d="bs.carousel",h=".".concat(d),j=".data-api",l=a.fn[b],m=600,n=37,o=39,p=500,q={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},r={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},s={NEXT:"next",PREV:"prev",LEFT:"left",RIGHT:"right"},t={SLIDE:"slide".concat(h),SLID:"slid".concat(h),KEYDOWN:"keydown".concat(h),MOUSEENTER:"mouseenter".concat(h),MOUSELEAVE:"mouseleave".concat(h),TOUCHEND:"touchend".concat(h),LOAD_DATA_API:"load".concat(h).concat(j),CLICK_DATA_API:"click".concat(h).concat(j)},u={CAROUSEL:"carousel",ACTIVE:"active",SLIDE:"slide",RIGHT:"carousel-item-right",LEFT:"carousel-item-left",NEXT:"carousel-item-next",PREV:"carousel-item-prev",ITEM:"carousel-item"},v={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},w=function(){function j(b,c){g(this,j),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(c),this._element=a(b)[0],this._indicatorsElement=a(this._element).find(v.INDICATORS)[0],this._addEventListeners()}return i(j,[{key:"next",value:function(){this._isSliding||this._slide(s.NEXT)}},{key:"nextWhenVisible",value:function(){!document.hidden&&a(this._element).is(":visible")&&"hidden"!==a(this._element).css("visibility")&&this.next()}},{key:"prev",value:function(){this._isSliding||this._slide(s.PREV)}},{key:"pause",value:function(b){b||(this._isPaused=!0),a(this._element).find(v.NEXT_PREV)[0]&&k["default"].supportsTransitionEnd()&&(k["default"].triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}},{key:"cycle",value:function(a){a||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}},{key:"to",value:function(b){var c=this;this._activeElement=a(this._element).find(v.ACTIVE_ITEM)[0];var d=this._getItemIndex(this._activeElement);if(!(b>this._items.length-1||b<0)){if(this._isSliding)return void a(this._element).one(t.SLID,function(){return c.to(b)});if(d===b)return this.pause(),void this.cycle();var e=b>d?s.NEXT:s.PREV;this._slide(e,this._items[b])}}},{key:"dispose",value:function(){a(this._element).off(h),a.removeData(this._element,d),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null}},{key:"_getConfig",value:function(a){return a=f({},q,a),k["default"].typeCheckConfig(b,a,r),a}},{key:"_addEventListeners",value:function(){var b=this;this._config.keyboard&&a(this._element).on(t.KEYDOWN,function(a){return b._keydown(a)}),"hover"===this._config.pause&&(a(this._element).on(t.MOUSEENTER,function(a){return b.pause(a)}).on(t.MOUSELEAVE,functi
|