bootstrap.esm.js 144 KB
Newer Older
XhmikosR's avatar
XhmikosR committed
4001
          return _this5.toggle(event);
XhmikosR's avatar
XhmikosR committed
4002
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4003
      } else if (trigger !== Trigger.MANUAL) {
XhmikosR's avatar
XhmikosR committed
4004
4005
4006
4007
        var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
        var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
        EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
          return _this5._enter(event);
XhmikosR's avatar
XhmikosR committed
4008
        });
XhmikosR's avatar
XhmikosR committed
4009
4010
        EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
          return _this5._leave(event);
XhmikosR's avatar
XhmikosR committed
4011
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4012
4013
      }
    });
Mark Otto's avatar
dist v5    
Mark Otto committed
4014
4015

    this._hideModalHandler = function () {
XhmikosR's avatar
XhmikosR committed
4016
4017
      if (_this5.element) {
        _this5.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
4018
      }
Mark Otto's avatar
dist v5    
Mark Otto committed
4019
4020
4021
    };

    EventHandler.on(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler);
XhmikosR's avatar
Dist.  
XhmikosR committed
4022
4023

    if (this.config.selector) {
4024
      this.config = _objectSpread2({}, this.config, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4025
4026
4027
4028
4029
4030
        trigger: 'manual',
        selector: ''
      });
    } else {
      this._fixTitle();
    }
XhmikosR's avatar
XhmikosR committed
4031
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4032

XhmikosR's avatar
XhmikosR committed
4033
4034
  _proto._fixTitle = function _fixTitle() {
    var titleType = typeof this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
4035
4036
4037
4038
4039

    if (this.element.getAttribute('title') || titleType !== 'string') {
      this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
      this.element.setAttribute('title', '');
    }
XhmikosR's avatar
XhmikosR committed
4040
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4041

XhmikosR's avatar
XhmikosR committed
4042
4043
  _proto._enter = function _enter(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

    if (event) {
      context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
    }

    if (context.getTipElement().classList.contains(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
      context._hoverState = HoverState.SHOW;
      return;
    }

    clearTimeout(context._timeout);
    context._hoverState = HoverState.SHOW;

    if (!context.config.delay || !context.config.delay.show) {
      context.show();
      return;
    }

XhmikosR's avatar
XhmikosR committed
4068
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4069
4070
4071
4072
      if (context._hoverState === HoverState.SHOW) {
        context.show();
      }
    }, context.config.delay.show);
XhmikosR's avatar
XhmikosR committed
4073
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4074

XhmikosR's avatar
XhmikosR committed
4075
4076
  _proto._leave = function _leave(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

    if (event) {
      context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
    }

    if (context._isWithActiveTrigger()) {
      return;
    }

    clearTimeout(context._timeout);
    context._hoverState = HoverState.OUT;

    if (!context.config.delay || !context.config.delay.hide) {
      context.hide();
      return;
    }

XhmikosR's avatar
XhmikosR committed
4100
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4101
4102
4103
4104
      if (context._hoverState === HoverState.OUT) {
        context.hide();
      }
    }, context.config.delay.hide);
XhmikosR's avatar
XhmikosR committed
4105
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4106

XhmikosR's avatar
XhmikosR committed
4107
4108
  _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
    for (var trigger in this._activeTrigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4109
4110
4111
4112
4113
4114
      if (this._activeTrigger[trigger]) {
        return true;
      }
    }

    return false;
XhmikosR's avatar
XhmikosR committed
4115
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4116

XhmikosR's avatar
XhmikosR committed
4117
4118
4119
  _proto._getConfig = function _getConfig(config) {
    var dataAttributes = Manipulator.getDataAttributes(this.element);
    Object.keys(dataAttributes).forEach(function (dataAttr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4120
4121
4122
4123
4124
4125
4126
4127
4128
      if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
        delete dataAttributes[dataAttr];
      }
    });

    if (config && typeof config.container === 'object' && config.container.jquery) {
      config.container = config.container[0];
    }

4129
    config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152

    if (typeof config.delay === 'number') {
      config.delay = {
        show: config.delay,
        hide: config.delay
      };
    }

    if (typeof config.title === 'number') {
      config.title = config.title.toString();
    }

    if (typeof config.content === 'number') {
      config.content = config.content.toString();
    }

    typeCheckConfig(NAME$6, config, this.constructor.DefaultType);

    if (config.sanitize) {
      config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4153
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4154

XhmikosR's avatar
XhmikosR committed
4155
4156
  _proto._getDelegateConfig = function _getDelegateConfig() {
    var config = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
4157
4158

    if (this.config) {
XhmikosR's avatar
XhmikosR committed
4159
      for (var key in this.config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4160
4161
4162
4163
4164
4165
4166
        if (this.constructor.Default[key] !== this.config[key]) {
          config[key] = this.config[key];
        }
      }
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4167
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4168

XhmikosR's avatar
XhmikosR committed
4169
4170
4171
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
XhmikosR's avatar
Dist.  
XhmikosR committed
4172
4173

    if (tabClass !== null && tabClass.length) {
XhmikosR's avatar
XhmikosR committed
4174
4175
4176
4177
4178
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4179
    }
XhmikosR's avatar
XhmikosR committed
4180
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4181

XhmikosR's avatar
XhmikosR committed
4182
4183
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
    var popperInstance = popperData.instance;
XhmikosR's avatar
Dist.  
XhmikosR committed
4184
4185
4186
4187
    this.tip = popperInstance.popper;

    this._cleanTipClass();

4188
    this._addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
XhmikosR committed
4189
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4190

XhmikosR's avatar
XhmikosR committed
4191
4192
4193
  _proto._fixTransition = function _fixTransition() {
    var tip = this.getTipElement();
    var initConfigAnimation = this.config.animation;
XhmikosR's avatar
Dist.  
XhmikosR committed
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204

    if (tip.getAttribute('x-placement') !== null) {
      return;
    }

    tip.classList.remove(ClassName$6.FADE);
    this.config.animation = false;
    this.hide();
    this.show();
    this.config.animation = initConfigAnimation;
  } // Static
XhmikosR's avatar
XhmikosR committed
4205
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4206

XhmikosR's avatar
XhmikosR committed
4207
  Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4208
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4209
      var data = Data.getData(this, DATA_KEY$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4210

XhmikosR's avatar
XhmikosR committed
4211
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222

      if (!data && /dispose|hide/.test(config)) {
        return;
      }

      if (!data) {
        data = new Tooltip(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4223
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4224
4225
4226
4227
4228
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4229
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4230

XhmikosR's avatar
XhmikosR committed
4231
  Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4232
    return Data.getData(element, DATA_KEY$6);
XhmikosR's avatar
XhmikosR committed
4233
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4234

XhmikosR's avatar
XhmikosR committed
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
  _createClass(Tooltip, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$6;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$4;
    }
  }, {
    key: "NAME",
    get: function get() {
      return NAME$6;
    }
  }, {
    key: "DATA_KEY",
    get: function get() {
      return DATA_KEY$6;
    }
  }, {
    key: "Event",
    get: function get() {
      return Event$7;
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$6;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$4;
    }
  }]);

  return Tooltip;
}();
XhmikosR's avatar
XhmikosR committed
4274
4275

var $$7 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4276
4277
4278
4279
4280
4281
4282
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tooltip to jQuery only if jQuery is present
 */

4283
4284
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4285
4286
4287
4288
if ($$7) {
  var JQUERY_NO_CONFLICT$6 = $$7.fn[NAME$6];
  $$7.fn[NAME$6] = Tooltip.jQueryInterface;
  $$7.fn[NAME$6].Constructor = Tooltip;
XhmikosR's avatar
Dist.  
XhmikosR committed
4289

XhmikosR's avatar
XhmikosR committed
4290
4291
4292
  $$7.fn[NAME$6].noConflict = function () {
    $$7.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
    return Tooltip.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4293
4294
4295
4296
4297
4298
4299
4300
4301
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4302
4303
4304
4305
4306
4307
var NAME$7 = 'popover';
var VERSION$7 = '4.3.1';
var DATA_KEY$7 = 'bs.popover';
var EVENT_KEY$7 = "." + DATA_KEY$7;
var CLASS_PREFIX$1 = 'bs-popover';
var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
XhmikosR's avatar
Dist.  
XhmikosR committed
4308

4309
var Default$5 = _objectSpread2({}, Tooltip.Default, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4310
4311
4312
4313
4314
4315
  placement: 'right',
  trigger: 'click',
  content: '',
  template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});

4316
var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4317
4318
4319
  content: '(string|element|function)'
});

XhmikosR's avatar
XhmikosR committed
4320
var ClassName$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4321
4322
4323
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4324
var Selector$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4325
4326
4327
  TITLE: '.popover-header',
  CONTENT: '.popover-body'
};
XhmikosR's avatar
XhmikosR committed
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
var Event$8 = {
  HIDE: "hide" + EVENT_KEY$7,
  HIDDEN: "hidden" + EVENT_KEY$7,
  SHOW: "show" + EVENT_KEY$7,
  SHOWN: "shown" + EVENT_KEY$7,
  INSERTED: "inserted" + EVENT_KEY$7,
  CLICK: "click" + EVENT_KEY$7,
  FOCUSIN: "focusin" + EVENT_KEY$7,
  FOCUSOUT: "focusout" + EVENT_KEY$7,
  MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  MOUSELEAVE: "mouseleave" + EVENT_KEY$7
XhmikosR's avatar
Dist.  
XhmikosR committed
4339
4340
4341
4342
4343
4344
4345
4346
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4347
4348
4349
4350
var Popover =
/*#__PURE__*/
function (_Tooltip) {
  _inheritsLoose(Popover, _Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4351

XhmikosR's avatar
XhmikosR committed
4352
4353
  function Popover() {
    return _Tooltip.apply(this, arguments) || this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4354
4355
  }

XhmikosR's avatar
XhmikosR committed
4356
  var _proto = Popover.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4357

XhmikosR's avatar
XhmikosR committed
4358
4359
  // Overrides
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4360
    return this.getTitle() || this._getContent();
XhmikosR's avatar
XhmikosR committed
4361
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4362

XhmikosR's avatar
XhmikosR committed
4363
4364
  _proto.setContent = function setContent() {
    var tip = this.getTipElement(); // we use append for html objects to maintain js events
XhmikosR's avatar
Dist.  
XhmikosR committed
4365
4366
4367

    this.setElementContent(SelectorEngine.findOne(Selector$7.TITLE, tip), this.getTitle());

XhmikosR's avatar
XhmikosR committed
4368
    var content = this._getContent();
XhmikosR's avatar
Dist.  
XhmikosR committed
4369
4370
4371
4372
4373
4374
4375
4376

    if (typeof content === 'function') {
      content = content.call(this.element);
    }

    this.setElementContent(SelectorEngine.findOne(Selector$7.CONTENT, tip), content);
    tip.classList.remove(ClassName$7.FADE);
    tip.classList.remove(ClassName$7.SHOW);
XhmikosR's avatar
XhmikosR committed
4377
4378
4379
4380
  };

  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment);
XhmikosR's avatar
Dist.  
XhmikosR committed
4381
  } // Private
XhmikosR's avatar
XhmikosR committed
4382
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4383

XhmikosR's avatar
XhmikosR committed
4384
  _proto._getContent = function _getContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4385
    return this.element.getAttribute('data-content') || this.config.content;
XhmikosR's avatar
XhmikosR committed
4386
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4387

XhmikosR's avatar
XhmikosR committed
4388
4389
4390
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4391
4392

    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4393
4394
4395
4396
4397
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4398
4399
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4400
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4401

XhmikosR's avatar
XhmikosR committed
4402
  Popover.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4403
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4404
      var data = Data.getData(this, DATA_KEY$7);
XhmikosR's avatar
Dist.  
XhmikosR committed
4405

XhmikosR's avatar
XhmikosR committed
4406
      var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418

      if (!data && /dispose|hide/.test(config)) {
        return;
      }

      if (!data) {
        data = new Popover(this, _config);
        Data.setData(this, DATA_KEY$7, data);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4419
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4420
4421
4422
4423
4424
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4425
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4426

XhmikosR's avatar
XhmikosR committed
4427
  Popover.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4428
    return Data.getData(element, DATA_KEY$7);
XhmikosR's avatar
XhmikosR committed
4429
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4430

XhmikosR's avatar
XhmikosR committed
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
  _createClass(Popover, null, [{
    key: "VERSION",
    // Getters
    get: function get() {
      return VERSION$7;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$5;
    }
  }, {
    key: "NAME",
    get: function get() {
      return NAME$7;
    }
  }, {
    key: "DATA_KEY",
    get: function get() {
      return DATA_KEY$7;
    }
  }, {
    key: "Event",
    get: function get() {
      return Event$8;
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$7;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$5;
    }
  }]);

  return Popover;
}(Tooltip);
XhmikosR's avatar
XhmikosR committed
4471
4472

var $$8 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4473
4474
4475
4476
4477
4478
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4479
4480
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4481
4482
4483
4484
if ($$8) {
  var JQUERY_NO_CONFLICT$7 = $$8.fn[NAME$7];
  $$8.fn[NAME$7] = Popover.jQueryInterface;
  $$8.fn[NAME$7].Constructor = Popover;
XhmikosR's avatar
Dist.  
XhmikosR committed
4485

XhmikosR's avatar
XhmikosR committed
4486
4487
4488
  $$8.fn[NAME$7].noConflict = function () {
    $$8.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
    return Popover.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4489
4490
4491
4492
4493
4494
4495
4496
4497
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4498
4499
4500
4501
4502
4503
var NAME$8 = 'scrollspy';
var VERSION$8 = '4.3.1';
var DATA_KEY$8 = 'bs.scrollspy';
var EVENT_KEY$8 = "." + DATA_KEY$8;
var DATA_API_KEY$6 = '.data-api';
var Default$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4504
4505
4506
4507
  offset: 10,
  method: 'auto',
  target: ''
};
XhmikosR's avatar
XhmikosR committed
4508
var DefaultType$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4509
4510
4511
4512
  offset: 'number',
  method: 'string',
  target: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
4513
4514
4515
4516
var Event$9 = {
  ACTIVATE: "activate" + EVENT_KEY$8,
  SCROLL: "scroll" + EVENT_KEY$8,
  LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
XhmikosR's avatar
Dist.  
XhmikosR committed
4517
};
XhmikosR's avatar
XhmikosR committed
4518
var ClassName$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4519
4520
4521
  DROPDOWN_ITEM: 'dropdown-item',
  ACTIVE: 'active'
};
XhmikosR's avatar
XhmikosR committed
4522
var Selector$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4523
4524
4525
4526
4527
4528
4529
4530
  DATA_SPY: '[data-spy="scroll"]',
  NAV_LIST_GROUP: '.nav, .list-group',
  NAV_LINKS: '.nav-link',
  NAV_ITEMS: '.nav-item',
  LIST_ITEMS: '.list-group-item',
  DROPDOWN: '.dropdown',
  DROPDOWN_TOGGLE: '.dropdown-toggle'
};
XhmikosR's avatar
XhmikosR committed
4531
var OffsetMethod = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
  OFFSET: 'offset',
  POSITION: 'position'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4542
4543
4544
4545
4546
4547
var ScrollSpy =
/*#__PURE__*/
function () {
  function ScrollSpy(element, config) {
    var _this = this;

XhmikosR's avatar
Dist.  
XhmikosR committed
4548
4549
4550
    this._element = element;
    this._scrollElement = element.tagName === 'BODY' ? window : element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4551
    this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " ." + ClassName$8.DROPDOWN_ITEM);
XhmikosR's avatar
Dist.  
XhmikosR committed
4552
4553
4554
4555
    this._offsets = [];
    this._targets = [];
    this._activeTarget = null;
    this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4556
4557
4558
    EventHandler.on(this._scrollElement, Event$9.SCROLL, function (event) {
      return _this._process(event);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4559
4560
4561
4562
4563
4564
4565
4566
    this.refresh();

    this._process();

    Data.setData(element, DATA_KEY$8, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4567
  var _proto = ScrollSpy.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4568

XhmikosR's avatar
XhmikosR committed
4569
4570
4571
  // Public
  _proto.refresh = function refresh() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4572

XhmikosR's avatar
XhmikosR committed
4573
4574
4575
    var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
    var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
    var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
4576
4577
4578
    this._offsets = [];
    this._targets = [];
    this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4579
4580
4581
4582
    var targets = makeArray(SelectorEngine.find(this._selector));
    targets.map(function (element) {
      var target;
      var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4583
4584
4585
4586
4587
4588

      if (targetSelector) {
        target = SelectorEngine.findOne(targetSelector);
      }

      if (target) {
XhmikosR's avatar
XhmikosR committed
4589
        var targetBCR = target.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
4590
4591
4592
4593
4594
4595
4596

        if (targetBCR.width || targetBCR.height) {
          return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
        }
      }

      return null;
XhmikosR's avatar
XhmikosR committed
4597
4598
4599
4600
4601
4602
4603
4604
    }).filter(function (item) {
      return item;
    }).sort(function (a, b) {
      return a[0] - b[0];
    }).forEach(function (item) {
      _this2._offsets.push(item[0]);

      _this2._targets.push(item[1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4605
    });
XhmikosR's avatar
XhmikosR committed
4606
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4607

XhmikosR's avatar
XhmikosR committed
4608
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
    Data.removeData(this._element, DATA_KEY$8);
    EventHandler.off(this._scrollElement, EVENT_KEY$8);
    this._element = null;
    this._scrollElement = null;
    this._config = null;
    this._selector = null;
    this._offsets = null;
    this._targets = null;
    this._activeTarget = null;
    this._scrollHeight = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4620
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4621

XhmikosR's avatar
XhmikosR committed
4622
  _proto._getConfig = function _getConfig(config) {
4623
    config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4624
4625

    if (typeof config.target !== 'string') {
XhmikosR's avatar
XhmikosR committed
4626
      var id = config.target.id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4627
4628
4629
4630
4631
4632

      if (!id) {
        id = getUID(NAME$8);
        config.target.id = id;
      }

XhmikosR's avatar
XhmikosR committed
4633
      config.target = "#" + id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4634
4635
4636
4637
    }

    typeCheckConfig(NAME$8, config, DefaultType$6);
    return config;
XhmikosR's avatar
XhmikosR committed
4638
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4639

XhmikosR's avatar
XhmikosR committed
4640
  _proto._getScrollTop = function _getScrollTop() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4641
    return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
XhmikosR's avatar
XhmikosR committed
4642
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4643

XhmikosR's avatar
XhmikosR committed
4644
  _proto._getScrollHeight = function _getScrollHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4645
    return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
XhmikosR's avatar
XhmikosR committed
4646
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4647

XhmikosR's avatar
XhmikosR committed
4648
  _proto._getOffsetHeight = function _getOffsetHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4649
    return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
XhmikosR's avatar
XhmikosR committed
4650
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4651

XhmikosR's avatar
XhmikosR committed
4652
4653
  _proto._process = function _process() {
    var scrollTop = this._getScrollTop() + this._config.offset;
XhmikosR's avatar
Dist.  
XhmikosR committed
4654

XhmikosR's avatar
XhmikosR committed
4655
    var scrollHeight = this._getScrollHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4656

XhmikosR's avatar
XhmikosR committed
4657
    var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4658
4659
4660
4661
4662
4663

    if (this._scrollHeight !== scrollHeight) {
      this.refresh();
    }

    if (scrollTop >= maxScroll) {
XhmikosR's avatar
XhmikosR committed
4664
      var target = this._targets[this._targets.length - 1];
XhmikosR's avatar
Dist.  
XhmikosR committed
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680

      if (this._activeTarget !== target) {
        this._activate(target);
      }

      return;
    }

    if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
      this._activeTarget = null;

      this._clear();

      return;
    }

XhmikosR's avatar
XhmikosR committed
4681
    var offsetLength = this._offsets.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
4682

XhmikosR's avatar
XhmikosR committed
4683
4684
    for (var i = offsetLength; i--;) {
      var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4685
4686
4687
4688
4689

      if (isActiveTarget) {
        this._activate(this._targets[i]);
      }
    }
XhmikosR's avatar
XhmikosR committed
4690
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4691

XhmikosR's avatar
XhmikosR committed
4692
  _proto._activate = function _activate(target) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4693
4694
4695
4696
    this._activeTarget = target;

    this._clear();

XhmikosR's avatar
XhmikosR committed
4697
4698
4699
    var queries = this._selector.split(',').map(function (selector) {
      return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4700

XhmikosR's avatar
XhmikosR committed
4701
    var link = SelectorEngine.findOne(queries.join(','));
XhmikosR's avatar
Dist.  
XhmikosR committed
4702
4703
4704
4705
4706
4707
4708

    if (link.classList.contains(ClassName$8.DROPDOWN_ITEM)) {
      SelectorEngine.findOne(Selector$8.DROPDOWN_TOGGLE, SelectorEngine.closest(link, Selector$8.DROPDOWN)).classList.add(ClassName$8.ACTIVE);
      link.classList.add(ClassName$8.ACTIVE);
    } else {
      // Set triggered link as active
      link.classList.add(ClassName$8.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4709
      SelectorEngine.parents(link, Selector$8.NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4710
4711
        // Set triggered links parents as active
        // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
XhmikosR's avatar
XhmikosR committed
4712
4713
4714
        SelectorEngine.prev(listGroup, Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).forEach(function (item) {
          return item.classList.add(ClassName$8.ACTIVE);
        }); // Handle special case when .nav-link is inside .nav-item
XhmikosR's avatar
Dist.  
XhmikosR committed
4715

XhmikosR's avatar
XhmikosR committed
4716
4717
4718
4719
        SelectorEngine.prev(listGroup, Selector$8.NAV_ITEMS).forEach(function (navItem) {
          SelectorEngine.children(navItem, Selector$8.NAV_LINKS).forEach(function (item) {
            return item.classList.add(ClassName$8.ACTIVE);
          });
XhmikosR's avatar
Dist.  
XhmikosR committed
4720
4721
4722
4723
4724
4725
4726
        });
      });
    }

    EventHandler.trigger(this._scrollElement, Event$9.ACTIVATE, {
      relatedTarget: target
    });
XhmikosR's avatar
XhmikosR committed
4727
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4728

XhmikosR's avatar
XhmikosR committed
4729
4730
4731
4732
4733
4734
  _proto._clear = function _clear() {
    makeArray(SelectorEngine.find(this._selector)).filter(function (node) {
      return node.classList.contains(ClassName$8.ACTIVE);
    }).forEach(function (node) {
      return node.classList.remove(ClassName$8.ACTIVE);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4735
  } // Static
XhmikosR's avatar
XhmikosR committed
4736
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4737

XhmikosR's avatar
XhmikosR committed
4738
  ScrollSpy.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4739
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4740
      var data = Data.getData(this, DATA_KEY$8);
XhmikosR's avatar
Dist.  
XhmikosR committed
4741

XhmikosR's avatar
XhmikosR committed
4742
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4743
4744
4745
4746
4747
4748
4749

      if (!data) {
        data = new ScrollSpy(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4750
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4751
4752
4753
4754
4755
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4756
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4757

XhmikosR's avatar
XhmikosR committed
4758
  ScrollSpy.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4759
    return Data.getData(element, DATA_KEY$8);
XhmikosR's avatar
XhmikosR committed
4760
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4761

XhmikosR's avatar
XhmikosR committed
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
  _createClass(ScrollSpy, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$8;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$6;
    }
  }]);

  return ScrollSpy;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4776
4777
4778
4779
4780
4781
4782
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4783
4784
4785
4786
EventHandler.on(window, Event$9.LOAD_DATA_API, function () {
  makeArray(SelectorEngine.find(Selector$8.DATA_SPY)).forEach(function (spy) {
    return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
4787
});
XhmikosR's avatar
XhmikosR committed
4788
var $$9 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4789
4790
4791
4792
4793
4794
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4795
4796
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4797
4798
4799
4800
if ($$9) {
  var JQUERY_NO_CONFLICT$8 = $$9.fn[NAME$8];
  $$9.fn[NAME$8] = ScrollSpy.jQueryInterface;
  $$9.fn[NAME$8].Constructor = ScrollSpy;
XhmikosR's avatar
Dist.  
XhmikosR committed
4801

XhmikosR's avatar
XhmikosR committed
4802
4803
4804
  $$9.fn[NAME$8].noConflict = function () {
    $$9.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4805
4806
4807
4808
4809
4810
4811
4812
4813
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
var NAME$9 = 'tab';
var VERSION$9 = '4.3.1';
var DATA_KEY$9 = 'bs.tab';
var EVENT_KEY$9 = "." + DATA_KEY$9;
var DATA_API_KEY$7 = '.data-api';
var Event$a = {
  HIDE: "hide" + EVENT_KEY$9,
  HIDDEN: "hidden" + EVENT_KEY$9,
  SHOW: "show" + EVENT_KEY$9,
  SHOWN: "shown" + EVENT_KEY$9,
  CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
XhmikosR's avatar
Dist.  
XhmikosR committed
4825
};
XhmikosR's avatar
XhmikosR committed
4826
var ClassName$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4827
4828
4829
4830
4831
4832
  DROPDOWN_MENU: 'dropdown-menu',
  ACTIVE: 'active',
  DISABLED: 'disabled',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4833
var Selector$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
  DROPDOWN: '.dropdown',
  NAV_LIST_GROUP: '.nav, .list-group',
  ACTIVE: '.active',
  ACTIVE_UL: ':scope > li > .active',
  DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  DROPDOWN_TOGGLE: '.dropdown-toggle',
  DROPDOWN_ACTIVE_CHILD: ':scope > .dropdown-menu .active'
  /**
   * ------------------------------------------------------------------------
   * Class Definition
   * ------------------------------------------------------------------------
   */

};

XhmikosR's avatar
XhmikosR committed
4849
4850
4851
4852
var Tab =
/*#__PURE__*/
function () {
  function Tab(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4853
4854
4855
4856
4857
    this._element = element;
    Data.setData(this._element, DATA_KEY$9, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4858
  var _proto = Tab.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4859

XhmikosR's avatar
XhmikosR committed
4860
4861
4862
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4863
4864
4865
4866
4867

    if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(ClassName$9.ACTIVE) || this._element.classList.contains(ClassName$9.DISABLED)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
4868
    var previous;
XhmikosR's avatar
XhmikosR committed
4869
    var target = getElementFromSelector(this._element);
XhmikosR's avatar
XhmikosR committed
4870
    var listElement = SelectorEngine.closest(this._element, Selector$9.NAV_LIST_GROUP);
XhmikosR's avatar
Dist.  
XhmikosR committed
4871
4872

    if (listElement) {
XhmikosR's avatar
XhmikosR committed
4873
      var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
XhmikosR's avatar
Dist.  
XhmikosR committed
4874
4875
4876
4877
      previous = makeArray(SelectorEngine.find(itemSelector, listElement));
      previous = previous[previous.length - 1];
    }

XhmikosR's avatar
XhmikosR committed
4878
    var hideEvent = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4879
4880
4881
4882
4883
4884
4885

    if (previous) {
      hideEvent = EventHandler.trigger(previous, Event$a.HIDE, {
        relatedTarget: this._element
      });
    }

XhmikosR's avatar
XhmikosR committed
4886
    var showEvent = EventHandler.trigger(this._element, Event$a.SHOW, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4887
4888
4889
4890
4891
4892
4893
4894
4895
      relatedTarget: previous
    });

    if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
      return;
    }

    this._activate(this._element, listElement);

XhmikosR's avatar
XhmikosR committed
4896
    var complete = function complete() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4897
      EventHandler.trigger(previous, Event$a.HIDDEN, {
XhmikosR's avatar
XhmikosR committed
4898
        relatedTarget: _this._element
XhmikosR's avatar
Dist.  
XhmikosR committed
4899
      });
XhmikosR's avatar
XhmikosR committed
4900
      EventHandler.trigger(_this._element, Event$a.SHOWN, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4901
4902
4903
4904
4905
4906
4907
4908
4909
        relatedTarget: previous
      });
    };

    if (target) {
      this._activate(target, target.parentNode, complete);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4910
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4911

XhmikosR's avatar
XhmikosR committed
4912
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4913
4914
4915
    Data.removeData(this._element, DATA_KEY$9);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4916
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4917

XhmikosR's avatar
XhmikosR committed
4918
4919
  _proto._activate = function _activate(element, container, callback) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4920

XhmikosR's avatar
XhmikosR committed
4921
4922
4923
    var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(Selector$9.ACTIVE_UL, container) : SelectorEngine.children(container, Selector$9.ACTIVE);
    var active = activeElements[0];
    var isTransitioning = callback && active && active.classList.contains(ClassName$9.FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
4924

XhmikosR's avatar
XhmikosR committed
4925
4926
4927
    var complete = function complete() {
      return _this2._transitionComplete(element, active, callback);
    };
XhmikosR's avatar
Dist.  
XhmikosR committed
4928
4929

    if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4930
      var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
Dist.  
XhmikosR committed
4931
4932
4933
4934
4935
4936
      active.classList.remove(ClassName$9.SHOW);
      EventHandler.one(active, TRANSITION_END, complete);
      emulateTransitionEnd(active, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4937
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4938

XhmikosR's avatar
XhmikosR committed
4939
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4940
4941
    if (active) {
      active.classList.remove(ClassName$9.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4942
      var dropdownChild = SelectorEngine.findOne(Selector$9.DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist.  
XhmikosR committed
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965

      if (dropdownChild) {
        dropdownChild.classList.remove(ClassName$9.ACTIVE);
      }

      if (active.getAttribute('role') === 'tab') {
        active.setAttribute('aria-selected', false);
      }
    }

    element.classList.add(ClassName$9.ACTIVE);

    if (element.getAttribute('role') === 'tab') {
      element.setAttribute('aria-selected', true);
    }

    reflow(element);

    if (element.classList.contains(ClassName$9.FADE)) {
      element.classList.add(ClassName$9.SHOW);
    }

    if (element.parentNode && element.parentNode.classList.contains(ClassName$9.DROPDOWN_MENU)) {
XhmikosR's avatar
XhmikosR committed
4966
      var dropdownElement = SelectorEngine.closest(element, Selector$9.DROPDOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
4967
4968

      if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4969
4970
4971
        makeArray(SelectorEngine.find(Selector$9.DROPDOWN_TOGGLE)).forEach(function (dropdown) {
          return dropdown.classList.add(ClassName$9.ACTIVE);
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4972
4973
4974
4975
4976
4977
4978
4979
4980
      }

      element.setAttribute('aria-expanded', true);
    }

    if (callback) {
      callback();
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4981
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4982

XhmikosR's avatar
XhmikosR committed
4983
  Tab.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4984
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4985
      var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4986
4987
4988

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4989
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4990
4991
4992
4993
4994
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4995
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4996

XhmikosR's avatar
XhmikosR committed
4997
  Tab.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4998
    return Data.getData(element, DATA_KEY$9);
XhmikosR's avatar
XhmikosR committed
4999
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5000

For faster browsing, not all history is shown. View entire blame