bootstrap.js 125 KB
Newer Older
XhmikosR's avatar
Dist    
XhmikosR committed
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
    }]);

    return Tab;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


  $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
    event.preventDefault();

    Tab._jQueryInterface.call($(this), 'show');
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

  $.fn[NAME$9] = Tab._jQueryInterface;
  $.fn[NAME$9].Constructor = Tab;

  $.fn[NAME$9].noConflict = function () {
    $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
    return Tab._jQueryInterface;
  };
Jacob Thornton's avatar
Jacob Thornton committed
4030
4031

  /**
Mark Otto's avatar
dist    
Mark Otto committed
4032
   * --------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
4033
   * Bootstrap (v4.1.3): toast.js
Mark Otto's avatar
dist    
Mark Otto committed
4034
4035
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Jacob Thornton's avatar
Jacob Thornton committed
4036
   */
Mark Otto's avatar
dist    
Mark Otto committed
4037

XhmikosR's avatar
Dist    
XhmikosR committed
4038
  var Toast = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
4039
4040
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
4041
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
4042
4043
     * ------------------------------------------------------------------------
     */
XhmikosR's avatar
Dist    
XhmikosR committed
4044
    var NAME = 'toast';
Mark Otto's avatar
Mark Otto committed
4045
    var VERSION = '4.1.3';
XhmikosR's avatar
Dist    
XhmikosR committed
4046
    var DATA_KEY = 'bs.toast';
Mark Otto's avatar
dist    
Mark Otto committed
4047
4048
4049
    var EVENT_KEY = "." + DATA_KEY;
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var Event = {
XhmikosR's avatar
Dist    
XhmikosR committed
4050
      CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
Mark Otto's avatar
dist    
Mark Otto committed
4051
4052
4053
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
XhmikosR's avatar
Dist    
XhmikosR committed
4054
      SHOWN: "shown" + EVENT_KEY
Mark Otto's avatar
dist    
Mark Otto committed
4055
4056
4057
    };
    var ClassName = {
      FADE: 'fade',
XhmikosR's avatar
Dist    
XhmikosR committed
4058
      HIDE: 'hide',
Mark Otto's avatar
dist    
Mark Otto committed
4059
4060
      SHOW: 'show'
    };
XhmikosR's avatar
Dist    
XhmikosR committed
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
    var DefaultType = {
      animation: 'boolean',
      autohide: 'boolean',
      delay: 'number'
    };
    var Default = {
      animation: true,
      autohide: true,
      delay: 500
    };
Mark Otto's avatar
dist    
Mark Otto committed
4071
    var Selector = {
XhmikosR's avatar
Dist    
XhmikosR committed
4072
      DATA_DISMISS: '[data-dismiss="toast"]'
Mark Otto's avatar
dist    
Mark Otto committed
4073
4074
4075
4076
4077
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Jacob Thornton's avatar
Jacob Thornton committed
4078

Mark Otto's avatar
dist    
Mark Otto committed
4079
    };
Jacob Thornton's avatar
Jacob Thornton committed
4080

XhmikosR's avatar
Dist    
XhmikosR committed
4081
    var Toast =
Mark Otto's avatar
dist    
Mark Otto committed
4082
4083
    /*#__PURE__*/
    function () {
XhmikosR's avatar
Dist    
XhmikosR committed
4084
      function Toast(element, config) {
Mark Otto's avatar
dist    
Mark Otto committed
4085
        this._element = element;
XhmikosR's avatar
Dist    
XhmikosR committed
4086
4087
4088
4089
        this._config = this._getConfig(config);
        this._timeout = null;

        this._setListeners();
Mark Otto's avatar
dist    
Mark Otto committed
4090
      } // Getters
Jacob Thornton's avatar
Jacob Thornton committed
4091
4092


XhmikosR's avatar
Dist    
XhmikosR committed
4093
      var _proto = Toast.prototype;
Jacob Thornton's avatar
Jacob Thornton committed
4094

Mark Otto's avatar
dist    
Mark Otto committed
4095
4096
4097
      // Public
      _proto.show = function show() {
        var _this = this;
Johann-S's avatar
build    
Johann-S committed
4098

XhmikosR's avatar
Dist    
XhmikosR committed
4099
4100
4101
4102
        $$$1(this._element).trigger(Event.SHOW);

        if (this._config.animation) {
          this._element.classList.add(ClassName.FADE);
Mark Otto's avatar
dist    
Mark Otto committed
4103
        }
Jacob Thornton's avatar
Jacob Thornton committed
4104

XhmikosR's avatar
Dist    
XhmikosR committed
4105
4106
        var complete = function complete() {
          $$$1(_this._element).trigger(Event.SHOWN);
Jacob Thornton's avatar
Jacob Thornton committed
4107

XhmikosR's avatar
Dist    
XhmikosR committed
4108
4109
4110
4111
          if (_this._config.autohide) {
            _this.hide();
          }
        };
Mark Otto's avatar
dist    
Mark Otto committed
4112

XhmikosR's avatar
Dist    
XhmikosR committed
4113
        this._element.classList.add(ClassName.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
4114

XhmikosR's avatar
Dist    
XhmikosR committed
4115
4116
4117
4118
4119
        if (this._config.animation) {
          var transitionDuration = Util.getTransitionDurationFromElement(this._element);
          $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
        } else {
          complete();
Mark Otto's avatar
dist    
Mark Otto committed
4120
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4121
      };
Mark Otto's avatar
dist    
Mark Otto committed
4122

XhmikosR's avatar
Dist    
XhmikosR committed
4123
4124
      _proto.hide = function hide(withoutTimeout) {
        var _this2 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4125

XhmikosR's avatar
Dist    
XhmikosR committed
4126
        if (!this._element.classList.contains(ClassName.SHOW)) {
Mark Otto's avatar
dist    
Mark Otto committed
4127
4128
          return;
        }
Mark Otto's avatar
dist    
Mark Otto committed
4129

XhmikosR's avatar
Dist    
XhmikosR committed
4130
        $$$1(this._element).trigger(Event.HIDE);
Mark Otto's avatar
dist    
Mark Otto committed
4131

XhmikosR's avatar
Dist    
XhmikosR committed
4132
4133
        if (withoutTimeout) {
          this._close();
Mark Otto's avatar
dist    
Mark Otto committed
4134
        } else {
XhmikosR's avatar
Dist    
XhmikosR committed
4135
4136
4137
          this._timeout = setTimeout(function () {
            _this2._close();
          }, this._config.delay);
Mark Otto's avatar
dist    
Mark Otto committed
4138
        }
Mark Otto's avatar
dist    
Mark Otto committed
4139
4140
      };

Mark Otto's avatar
dist    
Mark Otto committed
4141
      _proto.dispose = function dispose() {
XhmikosR's avatar
Dist    
XhmikosR committed
4142
4143
4144
4145
4146
4147
4148
4149
        clearTimeout(this._timeout);
        this._timeout = null;

        if (this._element.classList.contains(ClassName.SHOW)) {
          this._element.classList.remove(ClassName.SHOW);
        }

        $$$1(this._element).off(Event.CLICK_DISMISS);
Mark Otto's avatar
dist    
Mark Otto committed
4150
4151
        $$$1.removeData(this._element, DATA_KEY);
        this._element = null;
XhmikosR's avatar
Dist    
XhmikosR committed
4152
        this._config = null;
Mark Otto's avatar
dist    
Mark Otto committed
4153
      }; // Private
Mark Otto's avatar
dist    
Mark Otto committed
4154

Jacob Thornton's avatar
Jacob Thornton committed
4155

XhmikosR's avatar
Dist    
XhmikosR committed
4156
4157
4158
4159
4160
      _proto._getConfig = function _getConfig(config) {
        config = _objectSpread({}, Default, $$$1(this._element).data(), typeof config === 'object' && config ? config : {});
        Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
        return config;
      };
Jacob Thornton's avatar
Jacob Thornton committed
4161

XhmikosR's avatar
Dist    
XhmikosR committed
4162
4163
      _proto._setListeners = function _setListeners() {
        var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4164

XhmikosR's avatar
Dist    
XhmikosR committed
4165
4166
4167
4168
        $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function () {
          return _this3.hide(true);
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
4169

XhmikosR's avatar
Dist    
XhmikosR committed
4170
4171
      _proto._close = function _close() {
        var _this4 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4172

Mark Otto's avatar
dist    
Mark Otto committed
4173
        var complete = function complete() {
XhmikosR's avatar
Dist    
XhmikosR committed
4174
          $$$1(_this4._element).trigger(Event.HIDDEN);
Mark Otto's avatar
dist    
Mark Otto committed
4175
        };
Mark Otto's avatar
dist    
Mark Otto committed
4176

XhmikosR's avatar
Dist    
XhmikosR committed
4177
4178
4179
4180
4181
        this._element.classList.remove(ClassName.SHOW);

        if (this._config.animation) {
          var transitionDuration = Util.getTransitionDurationFromElement(this._element);
          $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
Mark Otto's avatar
dist    
Mark Otto committed
4182
4183
4184
4185
        } else {
          complete();
        }
      }; // Static
Mark Otto's avatar
dist    
Mark Otto committed
4186

Johann-S's avatar
build    
Johann-S committed
4187

XhmikosR's avatar
Dist    
XhmikosR committed
4188
      Toast._jQueryInterface = function _jQueryInterface(config) {
Mark Otto's avatar
dist    
Mark Otto committed
4189
        return this.each(function () {
XhmikosR's avatar
Dist    
XhmikosR committed
4190
4191
4192
4193
          var $element = $$$1(this);
          var data = $element.data(DATA_KEY);

          var _config = typeof config === 'object' && config;
Jacob Thornton's avatar
Jacob Thornton committed
4194

Mark Otto's avatar
dist    
Mark Otto committed
4195
          if (!data) {
XhmikosR's avatar
Dist    
XhmikosR committed
4196
4197
            data = new Toast(this, _config);
            $element.data(DATA_KEY, data);
Mark Otto's avatar
dist    
Mark Otto committed
4198
          }
Jacob Thornton's avatar
Jacob Thornton committed
4199

Mark Otto's avatar
dist    
Mark Otto committed
4200
4201
4202
4203
          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Jacob Thornton's avatar
Jacob Thornton committed
4204

XhmikosR's avatar
Dist    
XhmikosR committed
4205
            data[config](this);
Mark Otto's avatar
grunt    
Mark Otto committed
4206
          }
Mark Otto's avatar
dist    
Mark Otto committed
4207
4208
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
4209

XhmikosR's avatar
Dist    
XhmikosR committed
4210
      _createClass(Toast, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
4211
4212
4213
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
grunt    
Mark Otto committed
4214
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4215
4216
4217
4218
4219
      }, {
        key: "DefaultType",
        get: function get() {
          return DefaultType;
        }
Mark Otto's avatar
dist    
Mark Otto committed
4220
      }]);
Mark Otto's avatar
grunt    
Mark Otto committed
4221

XhmikosR's avatar
Dist    
XhmikosR committed
4222
      return Toast;
Mark Otto's avatar
dist    
Mark Otto committed
4223
4224
4225
4226
4227
4228
    }();
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Jacob Thornton's avatar
Jacob Thornton committed
4229

XhmikosR's avatar
Dist    
XhmikosR committed
4230
4231
4232

    $$$1.fn[NAME] = Toast._jQueryInterface;
    $$$1.fn[NAME].Constructor = Toast;
Mark Otto's avatar
dist    
Mark Otto committed
4233

Mark Otto's avatar
dist    
Mark Otto committed
4234
4235
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
XhmikosR's avatar
Dist    
XhmikosR committed
4236
      return Toast._jQueryInterface;
Mark Otto's avatar
dist    
Mark Otto committed
4237
    };
Jacob Thornton's avatar
Jacob Thornton committed
4238

XhmikosR's avatar
Dist    
XhmikosR committed
4239
    return Toast;
Mark Otto's avatar
dist    
Mark Otto committed
4240
  }($);
Mark Otto's avatar
grunt    
Mark Otto committed
4241

Mark Otto's avatar
dist    
Mark Otto committed
4242
4243
  /**
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
4244
   * Bootstrap (v4.1.3): index.js
Mark Otto's avatar
dist    
Mark Otto committed
4245
4246
4247
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
4248

XhmikosR's avatar
Dist    
XhmikosR committed
4249
4250
  (function () {
    if (typeof $ === 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
4251
4252
      throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
    }
Mark Otto's avatar
dist    
Mark Otto committed
4253

XhmikosR's avatar
Dist    
XhmikosR committed
4254
    var version = $.fn.jquery.split(' ')[0].split('.');
Mark Otto's avatar
dist    
Mark Otto committed
4255
4256
4257
4258
4259
    var minMajor = 1;
    var ltMajor = 2;
    var minMinor = 9;
    var minPatch = 1;
    var maxMajor = 4;
Mark Otto's avatar
dist    
Mark Otto committed
4260

Mark Otto's avatar
dist    
Mark Otto committed
4261
4262
4263
    if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
      throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
    }
XhmikosR's avatar
Dist    
XhmikosR committed
4264
  })();
Mark Otto's avatar
dist    
Mark Otto committed
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275

  exports.Util = Util;
  exports.Alert = Alert;
  exports.Button = Button;
  exports.Carousel = Carousel;
  exports.Collapse = Collapse;
  exports.Dropdown = Dropdown;
  exports.Modal = Modal;
  exports.Popover = Popover;
  exports.Scrollspy = ScrollSpy;
  exports.Tab = Tab;
XhmikosR's avatar
Dist    
XhmikosR committed
4276
  exports.Toast = Toast;
Mark Otto's avatar
dist    
Mark Otto committed
4277
4278
4279
  exports.Tooltip = Tooltip;

  Object.defineProperty(exports, '__esModule', { value: true });
Mark Otto's avatar
dist    
Mark Otto committed
4280

Mark Otto's avatar
dist    
Mark Otto committed
4281
})));
Mark Otto's avatar
dist    
Mark Otto committed
4282
//# sourceMappingURL=bootstrap.js.map
For faster browsing, not all history is shown. View entire blame