bootstrap.esm.js 145 KB
Newer Older
XhmikosR's avatar
Dist.  
XhmikosR committed
4001
    return AttachmentMap$1[placement.toUpperCase()];
XhmikosR's avatar
XhmikosR committed
4002
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4003

XhmikosR's avatar
XhmikosR committed
4004
  _proto._setListeners = function _setListeners() {
XhmikosR's avatar
XhmikosR committed
4005
    var _this5 = this;
XhmikosR's avatar
XhmikosR committed
4006
4007
4008

    var triggers = this.config.trigger.split(' ');
    triggers.forEach(function (trigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4009
      if (trigger === 'click') {
XhmikosR's avatar
XhmikosR committed
4010
4011
        EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
          return _this5.toggle(event);
XhmikosR's avatar
XhmikosR committed
4012
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4013
      } else if (trigger !== Trigger.MANUAL) {
XhmikosR's avatar
XhmikosR committed
4014
4015
4016
4017
        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
4018
        });
XhmikosR's avatar
XhmikosR committed
4019
4020
        EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
          return _this5._leave(event);
XhmikosR's avatar
XhmikosR committed
4021
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4022
4023
      }
    });
Mark Otto's avatar
dist v5    
Mark Otto committed
4024
4025

    this._hideModalHandler = function () {
XhmikosR's avatar
XhmikosR committed
4026
4027
      if (_this5.element) {
        _this5.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
4028
      }
Mark Otto's avatar
dist v5    
Mark Otto committed
4029
4030
4031
    };

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

    if (this.config.selector) {
4034
      this.config = _objectSpread2({}, this.config, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4035
4036
4037
4038
4039
4040
        trigger: 'manual',
        selector: ''
      });
    } else {
      this._fixTitle();
    }
XhmikosR's avatar
XhmikosR committed
4041
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4042

XhmikosR's avatar
XhmikosR committed
4043
4044
  _proto._fixTitle = function _fixTitle() {
    var titleType = typeof this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
4045
4046
4047
4048
4049

    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
4050
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4051

XhmikosR's avatar
XhmikosR committed
4052
4053
  _proto._enter = function _enter(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
    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
4078
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4079
4080
4081
4082
      if (context._hoverState === HoverState.SHOW) {
        context.show();
      }
    }, context.config.delay.show);
XhmikosR's avatar
XhmikosR committed
4083
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4084

XhmikosR's avatar
XhmikosR committed
4085
4086
  _proto._leave = function _leave(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
    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
4110
    context._timeout = setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
4111
4112
4113
4114
      if (context._hoverState === HoverState.OUT) {
        context.hide();
      }
    }, context.config.delay.hide);
XhmikosR's avatar
XhmikosR committed
4115
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4116

XhmikosR's avatar
XhmikosR committed
4117
4118
  _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
    for (var trigger in this._activeTrigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4119
4120
4121
4122
4123
4124
      if (this._activeTrigger[trigger]) {
        return true;
      }
    }

    return false;
XhmikosR's avatar
XhmikosR committed
4125
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4126

XhmikosR's avatar
XhmikosR committed
4127
4128
4129
  _proto._getConfig = function _getConfig(config) {
    var dataAttributes = Manipulator.getDataAttributes(this.element);
    Object.keys(dataAttributes).forEach(function (dataAttr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4130
4131
4132
4133
4134
4135
4136
4137
4138
      if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
        delete dataAttributes[dataAttr];
      }
    });

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

4139
    config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162

    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
4163
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4164

XhmikosR's avatar
XhmikosR committed
4165
4166
  _proto._getDelegateConfig = function _getDelegateConfig() {
    var config = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
4167
4168

    if (this.config) {
XhmikosR's avatar
XhmikosR committed
4169
      for (var key in this.config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4170
4171
4172
4173
4174
4175
4176
        if (this.constructor.Default[key] !== this.config[key]) {
          config[key] = this.config[key];
        }
      }
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4177
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4178

XhmikosR's avatar
XhmikosR committed
4179
4180
4181
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
XhmikosR's avatar
Dist.  
XhmikosR committed
4182
4183

    if (tabClass !== null && tabClass.length) {
XhmikosR's avatar
XhmikosR committed
4184
4185
4186
4187
4188
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4189
    }
XhmikosR's avatar
XhmikosR committed
4190
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4191

XhmikosR's avatar
XhmikosR committed
4192
4193
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
    var popperInstance = popperData.instance;
XhmikosR's avatar
Dist.  
XhmikosR committed
4194
4195
4196
4197
    this.tip = popperInstance.popper;

    this._cleanTipClass();

4198
    this._addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
XhmikosR committed
4199
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4200

XhmikosR's avatar
XhmikosR committed
4201
4202
4203
  _proto._fixTransition = function _fixTransition() {
    var tip = this.getTipElement();
    var initConfigAnimation = this.config.animation;
XhmikosR's avatar
Dist.  
XhmikosR committed
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214

    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
4215
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4216

XhmikosR's avatar
XhmikosR committed
4217
  Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4218
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4219
      var data = Data.getData(this, DATA_KEY$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4220

XhmikosR's avatar
XhmikosR committed
4221
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232

      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
4233
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4234
4235
4236
4237
4238
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4239
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4240

XhmikosR's avatar
XhmikosR committed
4241
  Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4242
    return Data.getData(element, DATA_KEY$6);
XhmikosR's avatar
XhmikosR committed
4243
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4244

XhmikosR's avatar
XhmikosR committed
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
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
  _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
4284
4285

var $$7 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4286
4287
4288
4289
4290
4291
4292
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tooltip to jQuery only if jQuery is present
 */

4293
4294
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4295
4296
4297
4298
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
4299

XhmikosR's avatar
XhmikosR committed
4300
4301
4302
  $$7.fn[NAME$6].noConflict = function () {
    $$7.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
    return Tooltip.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4303
4304
4305
4306
4307
4308
4309
4310
4311
  };
}

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

XhmikosR's avatar
XhmikosR committed
4312
4313
4314
4315
4316
4317
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
4318

4319
var Default$5 = _objectSpread2({}, Tooltip.Default, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4320
4321
4322
4323
4324
4325
  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>'
});

4326
var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4327
4328
4329
  content: '(string|element|function)'
});

XhmikosR's avatar
XhmikosR committed
4330
var ClassName$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4331
4332
4333
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4334
var Selector$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4335
4336
4337
  TITLE: '.popover-header',
  CONTENT: '.popover-body'
};
XhmikosR's avatar
XhmikosR committed
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
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
4349
};
XhmikosR's avatar
XhmikosR committed
4350
4351
4352
4353
4354
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4355

XhmikosR's avatar
XhmikosR committed
4356
4357
4358
4359
var Popover =
/*#__PURE__*/
function (_Tooltip) {
  _inheritsLoose(Popover, _Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4360

XhmikosR's avatar
XhmikosR committed
4361
4362
  function Popover() {
    return _Tooltip.apply(this, arguments) || this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4363
4364
  }

XhmikosR's avatar
XhmikosR committed
4365
  var _proto = Popover.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4366

XhmikosR's avatar
XhmikosR committed
4367
4368
  // Overrides
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4369
    return this.getTitle() || this._getContent();
XhmikosR's avatar
XhmikosR committed
4370
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4371

XhmikosR's avatar
XhmikosR committed
4372
4373
  _proto.setContent = function setContent() {
    var tip = this.getTipElement(); // we use append for html objects to maintain js events
XhmikosR's avatar
Dist.  
XhmikosR committed
4374
4375
4376

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

XhmikosR's avatar
XhmikosR committed
4377
    var content = this._getContent();
XhmikosR's avatar
Dist.  
XhmikosR committed
4378
4379
4380
4381
4382
4383
4384
4385

    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
4386
4387
4388
4389
  };

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

XhmikosR's avatar
XhmikosR committed
4393
  _proto._getContent = function _getContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4394
    return this.element.getAttribute('data-content') || this.config.content;
XhmikosR's avatar
XhmikosR committed
4395
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4396

XhmikosR's avatar
XhmikosR committed
4397
4398
4399
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4400
4401

    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4402
4403
4404
4405
4406
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4407
4408
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4409
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4410

XhmikosR's avatar
XhmikosR committed
4411
  Popover.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4412
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4413
      var data = Data.getData(this, DATA_KEY$7);
XhmikosR's avatar
Dist.  
XhmikosR committed
4414

XhmikosR's avatar
XhmikosR committed
4415
      var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427

      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
4428
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4429
4430
4431
4432
4433
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4434
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4435

XhmikosR's avatar
XhmikosR committed
4436
  Popover.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4437
    return Data.getData(element, DATA_KEY$7);
XhmikosR's avatar
XhmikosR committed
4438
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4439

XhmikosR's avatar
XhmikosR committed
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
4471
4472
4473
4474
4475
4476
4477
4478
4479
  _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
4480
4481

var $$8 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4482
4483
4484
4485
4486
4487
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4488
4489
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4490
4491
4492
4493
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
4494

XhmikosR's avatar
XhmikosR committed
4495
4496
4497
  $$8.fn[NAME$7].noConflict = function () {
    $$8.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
    return Popover.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4498
4499
4500
4501
4502
4503
4504
4505
4506
  };
}

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

XhmikosR's avatar
XhmikosR committed
4507
4508
4509
4510
4511
4512
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
4513
4514
4515
4516
  offset: 10,
  method: 'auto',
  target: ''
};
XhmikosR's avatar
XhmikosR committed
4517
var DefaultType$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4518
4519
4520
4521
  offset: 'number',
  method: 'string',
  target: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
4522
4523
4524
4525
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
4526
};
XhmikosR's avatar
XhmikosR committed
4527
var ClassName$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4528
4529
4530
  DROPDOWN_ITEM: 'dropdown-item',
  ACTIVE: 'active'
};
XhmikosR's avatar
XhmikosR committed
4531
var Selector$8 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4532
4533
4534
4535
4536
4537
4538
4539
  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
4540
var OffsetMethod = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4541
4542
4543
  OFFSET: 'offset',
  POSITION: 'position'
};
XhmikosR's avatar
XhmikosR committed
4544
4545
4546
4547
4548
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4549

XhmikosR's avatar
XhmikosR committed
4550
4551
4552
4553
4554
4555
var ScrollSpy =
/*#__PURE__*/
function () {
  function ScrollSpy(element, config) {
    var _this = this;

XhmikosR's avatar
Dist.  
XhmikosR committed
4556
4557
4558
    this._element = element;
    this._scrollElement = element.tagName === 'BODY' ? window : element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4559
    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
4560
4561
4562
4563
    this._offsets = [];
    this._targets = [];
    this._activeTarget = null;
    this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4564
4565
4566
    EventHandler.on(this._scrollElement, Event$9.SCROLL, function (event) {
      return _this._process(event);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4567
4568
4569
4570
4571
4572
4573
4574
    this.refresh();

    this._process();

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


XhmikosR's avatar
XhmikosR committed
4575
  var _proto = ScrollSpy.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4576

XhmikosR's avatar
XhmikosR committed
4577
4578
4579
  // Public
  _proto.refresh = function refresh() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4580

XhmikosR's avatar
XhmikosR committed
4581
4582
4583
    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
4584
4585
4586
    this._offsets = [];
    this._targets = [];
    this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4587
4588
4589
4590
    var targets = makeArray(SelectorEngine.find(this._selector));
    targets.map(function (element) {
      var target;
      var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4591
4592
4593
4594
4595
4596

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

      if (target) {
XhmikosR's avatar
XhmikosR committed
4597
        var targetBCR = target.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
4598
4599
4600
4601
4602
4603
4604

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

      return null;
XhmikosR's avatar
XhmikosR committed
4605
4606
4607
4608
4609
4610
4611
4612
    }).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
4613
    });
XhmikosR's avatar
XhmikosR committed
4614
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4615

XhmikosR's avatar
XhmikosR committed
4616
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
    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
4628
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4629

XhmikosR's avatar
XhmikosR committed
4630
  _proto._getConfig = function _getConfig(config) {
4631
    config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4632
4633

    if (typeof config.target !== 'string') {
XhmikosR's avatar
XhmikosR committed
4634
      var id = config.target.id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4635
4636
4637
4638
4639
4640

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

XhmikosR's avatar
XhmikosR committed
4641
      config.target = "#" + id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4642
4643
4644
4645
    }

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

XhmikosR's avatar
XhmikosR committed
4648
  _proto._getScrollTop = function _getScrollTop() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4649
    return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
XhmikosR's avatar
XhmikosR committed
4650
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4651

XhmikosR's avatar
XhmikosR committed
4652
  _proto._getScrollHeight = function _getScrollHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4653
    return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
XhmikosR's avatar
XhmikosR committed
4654
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4655

XhmikosR's avatar
XhmikosR committed
4656
  _proto._getOffsetHeight = function _getOffsetHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4657
    return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
XhmikosR's avatar
XhmikosR committed
4658
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4659

XhmikosR's avatar
XhmikosR committed
4660
4661
  _proto._process = function _process() {
    var scrollTop = this._getScrollTop() + this._config.offset;
XhmikosR's avatar
Dist.  
XhmikosR committed
4662

XhmikosR's avatar
XhmikosR committed
4663
    var scrollHeight = this._getScrollHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4664

XhmikosR's avatar
XhmikosR committed
4665
    var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4666
4667
4668
4669
4670
4671

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

    if (scrollTop >= maxScroll) {
XhmikosR's avatar
XhmikosR committed
4672
      var target = this._targets[this._targets.length - 1];
XhmikosR's avatar
Dist.  
XhmikosR committed
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688

      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
4689
    var offsetLength = this._offsets.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
4690

XhmikosR's avatar
XhmikosR committed
4691
4692
    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
4693
4694
4695
4696
4697

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

XhmikosR's avatar
XhmikosR committed
4700
  _proto._activate = function _activate(target) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4701
4702
4703
4704
    this._activeTarget = target;

    this._clear();

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

XhmikosR's avatar
XhmikosR committed
4709
    var link = SelectorEngine.findOne(queries.join(','));
XhmikosR's avatar
Dist.  
XhmikosR committed
4710
4711
4712
4713
4714
4715
4716

    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
4717
      SelectorEngine.parents(link, Selector$8.NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4718
4719
        // 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
4720
4721
4722
        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
4723

XhmikosR's avatar
XhmikosR committed
4724
4725
4726
4727
        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
4728
4729
4730
4731
4732
4733
4734
        });
      });
    }

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

XhmikosR's avatar
XhmikosR committed
4737
4738
4739
4740
4741
4742
  _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
4743
  } // Static
XhmikosR's avatar
XhmikosR committed
4744
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4745

XhmikosR's avatar
XhmikosR committed
4746
  ScrollSpy.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4747
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4748
      var data = Data.getData(this, DATA_KEY$8);
XhmikosR's avatar
Dist.  
XhmikosR committed
4749

XhmikosR's avatar
XhmikosR committed
4750
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4751
4752
4753
4754
4755
4756
4757

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

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4758
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4759
4760
4761
4762
4763
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4764
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4765

XhmikosR's avatar
XhmikosR committed
4766
  ScrollSpy.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4767
    return Data.getData(element, DATA_KEY$8);
XhmikosR's avatar
XhmikosR committed
4768
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4769

XhmikosR's avatar
XhmikosR committed
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
  _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
4784
4785
4786
4787
4788
4789
4790
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4791
4792
4793
4794
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
4795
});
XhmikosR's avatar
XhmikosR committed
4796
var $$9 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4797
4798
4799
4800
4801
4802
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4803
4804
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4805
4806
4807
4808
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
4809

XhmikosR's avatar
XhmikosR committed
4810
4811
4812
  $$9.fn[NAME$8].noConflict = function () {
    $$9.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4813
4814
4815
4816
4817
4818
4819
4820
4821
  };
}

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

XhmikosR's avatar
XhmikosR committed
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
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
4833
};
XhmikosR's avatar
XhmikosR committed
4834
var ClassName$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4835
4836
4837
4838
4839
4840
  DROPDOWN_MENU: 'dropdown-menu',
  ACTIVE: 'active',
  DISABLED: 'disabled',
  FADE: 'fade',
  SHOW: 'show'
};
XhmikosR's avatar
XhmikosR committed
4841
var Selector$9 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4842
4843
4844
4845
4846
4847
4848
4849
  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'
};
XhmikosR's avatar
XhmikosR committed
4850
4851
4852
4853
4854
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4855

XhmikosR's avatar
XhmikosR committed
4856
4857
4858
4859
var Tab =
/*#__PURE__*/
function () {
  function Tab(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4860
4861
4862
4863
4864
    this._element = element;
    Data.setData(this._element, DATA_KEY$9, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4865
  var _proto = Tab.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4866

XhmikosR's avatar
XhmikosR committed
4867
4868
4869
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4870
4871
4872
4873
4874

    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
4875
    var previous;
XhmikosR's avatar
XhmikosR committed
4876
    var target = getElementFromSelector(this._element);
XhmikosR's avatar
XhmikosR committed
4877
    var listElement = SelectorEngine.closest(this._element, Selector$9.NAV_LIST_GROUP);
XhmikosR's avatar
Dist.  
XhmikosR committed
4878
4879

    if (listElement) {
XhmikosR's avatar
XhmikosR committed
4880
      var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
XhmikosR's avatar
Dist.  
XhmikosR committed
4881
4882
4883
4884
      previous = makeArray(SelectorEngine.find(itemSelector, listElement));
      previous = previous[previous.length - 1];
    }

XhmikosR's avatar
XhmikosR committed
4885
    var hideEvent = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4886
4887
4888
4889
4890
4891
4892

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

XhmikosR's avatar
XhmikosR committed
4893
    var showEvent = EventHandler.trigger(this._element, Event$a.SHOW, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4894
4895
4896
4897
4898
4899
4900
4901
4902
      relatedTarget: previous
    });

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

    this._activate(this._element, listElement);

XhmikosR's avatar
XhmikosR committed
4903
    var complete = function complete() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4904
      EventHandler.trigger(previous, Event$a.HIDDEN, {
XhmikosR's avatar
XhmikosR committed
4905
        relatedTarget: _this._element
XhmikosR's avatar
Dist.  
XhmikosR committed
4906
      });
XhmikosR's avatar
XhmikosR committed
4907
      EventHandler.trigger(_this._element, Event$a.SHOWN, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4908
4909
4910
4911
4912
4913
4914
4915
4916
        relatedTarget: previous
      });
    };

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

XhmikosR's avatar
XhmikosR committed
4919
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4920
4921
4922
    Data.removeData(this._element, DATA_KEY$9);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4923
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4924

XhmikosR's avatar
XhmikosR committed
4925
4926
  _proto._activate = function _activate(element, container, callback) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4927

XhmikosR's avatar
XhmikosR committed
4928
4929
4930
    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
4931

XhmikosR's avatar
XhmikosR committed
4932
4933
4934
    var complete = function complete() {
      return _this2._transitionComplete(element, active, callback);
    };
XhmikosR's avatar
Dist.  
XhmikosR committed
4935
4936

    if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4937
      var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
Dist.  
XhmikosR committed
4938
4939
4940
4941
4942
4943
      active.classList.remove(ClassName$9.SHOW);
      EventHandler.one(active, TRANSITION_END, complete);
      emulateTransitionEnd(active, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4944
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4945

XhmikosR's avatar
XhmikosR committed
4946
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4947
4948
    if (active) {
      active.classList.remove(ClassName$9.ACTIVE);
XhmikosR's avatar
XhmikosR committed
4949
      var dropdownChild = SelectorEngine.findOne(Selector$9.DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist.  
XhmikosR committed
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972

      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
4973
      var dropdownElement = SelectorEngine.closest(element, Selector$9.DROPDOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
4974
4975

      if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4976
4977
4978
        makeArray(SelectorEngine.find(Selector$9.DROPDOWN_TOGGLE)).forEach(function (dropdown) {
          return dropdown.classList.add(ClassName$9.ACTIVE);
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4979
4980
4981
4982
4983
4984
4985
4986
4987
      }

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

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

XhmikosR's avatar
XhmikosR committed
4990
  Tab.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4991
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4992
      var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4993
4994
4995

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4996
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4997
4998
4999
5000
        }

        data[config]();
      }
For faster browsing, not all history is shown. View entire blame