1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00
This commit is contained in:
Mark Otto 2018-03-31 13:59:37 -07:00
parent cf71363649
commit b744ba2c08
50 changed files with 10008 additions and 10534 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

10
assets/js/docs.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -28,22 +28,38 @@ function _createClass(Constructor, protoProps, staticProps) {
return Constructor;
}
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
return obj;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}
return target;
};
return _extends.apply(this, arguments);
}
function _inheritsLoose(subClass, superClass) {
@ -65,8 +81,9 @@ var Util = function ($$$1) {
* Private TransitionEnd Helpers
* ------------------------------------------------------------------------
*/
var transition = false;
var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
var TRANSITION_END = 'transitionend';
var MAX_UID = 1000000;
var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
function toType(obj) {
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
@ -74,8 +91,8 @@ var Util = function ($$$1) {
function getSpecialTransitionEndEvent() {
return {
bindType: transition.end,
delegateType: transition.end,
bindType: TRANSITION_END,
delegateType: TRANSITION_END,
handle: function handle(event) {
if ($$$1(event.target).is(this)) {
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
@ -86,16 +103,6 @@ var Util = function ($$$1) {
};
}
function transitionEndTest() {
if (typeof window !== 'undefined' && window.QUnit) {
return false;
}
return {
end: 'transitionend'
};
}
function transitionEndEmulator(duration) {
var _this = this;
@ -112,13 +119,9 @@ var Util = function ($$$1) {
}
function setTransitionEndSupport() {
transition = transitionEndTest();
$$$1.fn.emulateTransitionEnd = transitionEndEmulator;
if (Util.supportsTransitionEnd()) {
$$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
}
}
/**
* --------------------------------------------------------------------------
* Public Util Api
@ -150,14 +153,32 @@ var Util = function ($$$1) {
return null;
}
},
getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
if (!element) {
return 0;
} // Get transition-duration of the element
var transitionDuration = $$$1(element).css('transition-duration');
var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
},
reflow: function reflow(element) {
return element.offsetHeight;
},
triggerTransitionEnd: function triggerTransitionEnd(element) {
$$$1(element).trigger(transition.end);
$$$1(element).trigger(TRANSITION_END);
},
// TODO: Remove in v5
supportsTransitionEnd: function supportsTransitionEnd() {
return Boolean(transition);
return Boolean(TRANSITION_END);
},
isElement: function isElement(obj) {
return (obj[0] || obj).nodeType;
@ -199,7 +220,6 @@ var Alert = function ($$$1) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 150;
var Selector = {
DISMISS: '[data-dismiss="alert"]'
};
@ -277,15 +297,16 @@ var Alert = function ($$$1) {
$$$1(element).removeClass(ClassName.SHOW);
if (!Util.supportsTransitionEnd() || !$$$1(element).hasClass(ClassName.FADE)) {
if (!$$$1(element).hasClass(ClassName.FADE)) {
this._destroyElement(element);
return;
}
var transitionDuration = Util.getTransitionDurationFromElement(element);
$$$1(element).one(Util.TRANSITION_END, function (event) {
return _this._destroyElement(element, event);
}).emulateTransitionEnd(TRANSITION_DURATION);
}).emulateTransitionEnd(transitionDuration);
};
_proto._destroyElement = function _destroyElement(element) {
@ -325,6 +346,7 @@ var Alert = function ($$$1) {
return VERSION;
}
}]);
return Alert;
}();
/**
@ -476,6 +498,7 @@ var Button = function ($$$1) {
return VERSION;
}
}]);
return Button;
}();
/**
@ -540,7 +563,6 @@ var Carousel = function ($$$1) {
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
var MILLISECONDS_MULTIPLIER = 1000;
var Default = {
interval: 5000,
keyboard: true,
@ -610,7 +632,6 @@ var Carousel = function ($$$1) {
this._config = this._getConfig(config);
this._element = $$$1(element)[0];
this._indicatorsElement = $$$1(this._element).find(Selector.INDICATORS)[0];
this._transitionDuration = this._getTransitionDuration();
this._addEventListeners();
} // Getters
@ -644,7 +665,7 @@ var Carousel = function ($$$1) {
this._isPaused = true;
}
if ($$$1(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
if ($$$1(this._element).find(Selector.NEXT_PREV)[0]) {
Util.triggerTransitionEnd(this._element);
this.cycle(true);
}
@ -712,25 +733,11 @@ var Carousel = function ($$$1) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
Util.typeCheckConfig(NAME, config, DefaultType);
return config;
};
_proto._getTransitionDuration = function _getTransitionDuration() {
// Get transition-duration of first element in the carousel
var transitionDuration = $$$1(this._element).find(Selector.ITEM).css('transition-duration'); // Return 0 carousel item is not found
if (!transitionDuration) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0]; // Multiply by 1000 if transition-duration is defined in seconds
return transitionDuration.indexOf('ms') > -1 ? parseFloat(transitionDuration) : parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
};
_proto._addEventListeners = function _addEventListeners() {
var _this2 = this;
@ -897,11 +904,12 @@ var Carousel = function ($$$1) {
to: nextElementIndex
});
if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.SLIDE)) {
if ($$$1(this._element).hasClass(ClassName.SLIDE)) {
$$$1(nextElement).addClass(orderClassName);
Util.reflow(nextElement);
$$$1(activeElement).addClass(directionalClassName);
$$$1(nextElement).addClass(directionalClassName);
var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
$$$1(activeElement).one(Util.TRANSITION_END, function () {
$$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
$$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
@ -909,7 +917,7 @@ var Carousel = function ($$$1) {
setTimeout(function () {
return $$$1(_this3._element).trigger(slidEvent);
}, 0);
}).emulateTransitionEnd(this._transitionDuration);
}).emulateTransitionEnd(transitionDuration);
} else {
$$$1(activeElement).removeClass(ClassName.ACTIVE);
$$$1(nextElement).addClass(ClassName.ACTIVE);
@ -927,10 +935,10 @@ var Carousel = function ($$$1) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
var _config = _extends({}, Default, $$$1(this).data());
var _config = _objectSpread({}, Default, $$$1(this).data());
if (typeof config === 'object') {
_config = _extends({}, _config, config);
_config = _objectSpread({}, _config, config);
}
var action = typeof config === 'string' ? config : _config.slide;
@ -968,7 +976,8 @@ var Carousel = function ($$$1) {
return;
}
var config = _extends({}, $$$1(target).data(), $$$1(this).data());
var config = _objectSpread({}, $$$1(target).data(), $$$1(this).data());
var slideIndex = this.getAttribute('data-slide-to');
if (slideIndex) {
@ -995,6 +1004,7 @@ var Carousel = function ($$$1) {
return Default;
}
}]);
return Carousel;
}();
/**
@ -1048,7 +1058,6 @@ var Collapse = function ($$$1) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 600;
var Default = {
toggle: true,
parent: ''
@ -1190,14 +1199,10 @@ var Collapse = function ($$$1) {
$$$1(_this._element).trigger(Event.SHOWN);
};
if (!Util.supportsTransitionEnd()) {
complete();
return;
}
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
var scrollSize = "scroll" + capitalizedDimension;
$$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
this._element.style[dimension] = this._element[scrollSize] + "px";
};
@ -1245,13 +1250,8 @@ var Collapse = function ($$$1) {
};
this._element.style[dimension] = '';
if (!Util.supportsTransitionEnd()) {
complete();
return;
}
$$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
};
_proto.setTransitioning = function setTransitioning(isTransitioning) {
@ -1269,7 +1269,7 @@ var Collapse = function ($$$1) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
config.toggle = Boolean(config.toggle); // Coerce string values
Util.typeCheckConfig(NAME, config, DefaultType);
@ -1324,7 +1324,7 @@ var Collapse = function ($$$1) {
var $this = $$$1(this);
var data = $this.data(DATA_KEY);
var _config = _extends({}, Default, $this.data(), typeof config === 'object' && config);
var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config);
if (!data && _config.toggle && /show|hide/.test(config)) {
_config.toggle = false;
@ -1356,6 +1356,7 @@ var Collapse = function ($$$1) {
return Default;
}
}]);
return Collapse;
}();
/**
@ -1455,7 +1456,7 @@ var Dropdown = function ($$$1) {
FORM_CHILD: '.dropdown form',
MENU: '.dropdown-menu',
NAVBAR_NAV: '.navbar-nav',
VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled)'
VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
};
var AttachmentMap = {
TOP: 'top-start',
@ -1612,7 +1613,7 @@ var Dropdown = function ($$$1) {
};
_proto._getConfig = function _getConfig(config) {
config = _extends({}, this.constructor.Default, $$$1(this._element).data(), config);
config = _objectSpread({}, this.constructor.Default, $$$1(this._element).data(), config);
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
return config;
};
@ -1659,7 +1660,7 @@ var Dropdown = function ($$$1) {
if (typeof this._config.offset === 'function') {
offsetConf.fn = function (data) {
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets) || {});
data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
return data;
};
} else {
@ -1845,6 +1846,7 @@ var Dropdown = function ($$$1) {
return DefaultType;
}
}]);
return Dropdown;
}();
/**
@ -1898,8 +1900,6 @@ var Modal = function ($$$1) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 300;
var BACKDROP_TRANSITION_DURATION = 150;
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
var Default = {
@ -1978,7 +1978,7 @@ var Modal = function ($$$1) {
return;
}
if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE)) {
if ($$$1(this._element).hasClass(ClassName.FADE)) {
this._isTransitioning = true;
}
@ -2040,7 +2040,7 @@ var Modal = function ($$$1) {
}
this._isShown = false;
var transition = Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE);
var transition = $$$1(this._element).hasClass(ClassName.FADE);
if (transition) {
this._isTransitioning = true;
@ -2056,9 +2056,10 @@ var Modal = function ($$$1) {
$$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);
if (transition) {
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$$$1(this._element).one(Util.TRANSITION_END, function (event) {
return _this2._hideModal(event);
}).emulateTransitionEnd(TRANSITION_DURATION);
}).emulateTransitionEnd(transitionDuration);
} else {
this._hideModal();
}
@ -2083,7 +2084,7 @@ var Modal = function ($$$1) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
Util.typeCheckConfig(NAME, config, DefaultType);
return config;
};
@ -2091,7 +2092,7 @@ var Modal = function ($$$1) {
_proto._showElement = function _showElement(relatedTarget) {
var _this3 = this;
var transition = Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE);
var transition = $$$1(this._element).hasClass(ClassName.FADE);
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
// Don't move modal's DOM position
@ -2128,7 +2129,8 @@ var Modal = function ($$$1) {
};
if (transition) {
$$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
} else {
transitionComplete();
}
@ -2206,7 +2208,6 @@ var Modal = function ($$$1) {
var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
if (this._isShown && this._config.backdrop) {
var doAnimate = Util.supportsTransitionEnd() && animate;
this._backdrop = document.createElement('div');
this._backdrop.className = ClassName.BACKDROP;
@ -2232,7 +2233,7 @@ var Modal = function ($$$1) {
}
});
if (doAnimate) {
if (animate) {
Util.reflow(this._backdrop);
}
@ -2242,12 +2243,13 @@ var Modal = function ($$$1) {
return;
}
if (!doAnimate) {
if (!animate) {
callback();
return;
}
$$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
$$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
} else if (!this._isShown && this._backdrop) {
$$$1(this._backdrop).removeClass(ClassName.SHOW);
@ -2259,8 +2261,10 @@ var Modal = function ($$$1) {
}
};
if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE)) {
$$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
if ($$$1(this._element).hasClass(ClassName.FADE)) {
var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
$$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
} else {
callbackRemove();
}
@ -2367,7 +2371,7 @@ var Modal = function ($$$1) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
var _config = _extends({}, Modal.Default, $$$1(this).data(), typeof config === 'object' && config);
var _config = _objectSpread({}, Modal.Default, $$$1(this).data(), typeof config === 'object' && config);
if (!data) {
data = new Modal(this, _config);
@ -2397,6 +2401,7 @@ var Modal = function ($$$1) {
return Default;
}
}]);
return Modal;
}();
/**
@ -2416,7 +2421,7 @@ var Modal = function ($$$1) {
target = $$$1(selector)[0];
}
var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _extends({}, $$$1(target).data(), $$$1(this).data());
var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $$$1(target).data(), $$$1(this).data());
if (this.tagName === 'A' || this.tagName === 'AREA') {
event.preventDefault();
@ -2472,7 +2477,6 @@ var Tooltip = function ($$$1) {
var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = "." + DATA_KEY;
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 150;
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var DefaultType = {
@ -2735,8 +2739,9 @@ var Tooltip = function ($$$1) {
}
};
if (Util.supportsTransitionEnd() && $$$1(this.tip).hasClass(ClassName.FADE)) {
$$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
if ($$$1(this.tip).hasClass(ClassName.FADE)) {
var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
$$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}
@ -2786,8 +2791,9 @@ var Tooltip = function ($$$1) {
this._activeTrigger[Trigger.FOCUS] = false;
this._activeTrigger[Trigger.HOVER] = false;
if (Util.supportsTransitionEnd() && $$$1(this.tip).hasClass(ClassName.FADE)) {
$$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
if ($$$1(this.tip).hasClass(ClassName.FADE)) {
var transitionDuration = Util.getTransitionDurationFromElement(tip);
$$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}
@ -2878,7 +2884,7 @@ var Tooltip = function ($$$1) {
});
if (this.config.selector) {
this.config = _extends({}, this.config, {
this.config = _objectSpread({}, this.config, {
trigger: 'manual',
selector: ''
});
@ -2972,7 +2978,7 @@ var Tooltip = function ($$$1) {
};
_proto._getConfig = function _getConfig(config) {
config = _extends({}, this.constructor.Default, $$$1(this.element).data(), config);
config = _objectSpread({}, this.constructor.Default, $$$1(this.element).data(), config);
if (typeof config.delay === 'number') {
config.delay = {
@ -3099,6 +3105,7 @@ var Tooltip = function ($$$1) {
return DefaultType;
}
}]);
return Tooltip;
}();
/**
@ -3139,15 +3146,18 @@ var Popover = function ($$$1) {
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var CLASS_PREFIX = 'bs-popover';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var Default = _extends({}, Tooltip.Default, {
var Default = _objectSpread({}, Tooltip.Default, {
placement: 'right',
trigger: 'click',
content: '',
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});
var DefaultType = _extends({}, Tooltip.DefaultType, {
var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
content: '(string|element|function)'
});
var ClassName = {
FADE: 'fade',
SHOW: 'show'
@ -3292,6 +3302,7 @@ var Popover = function ($$$1) {
return DefaultType;
}
}]);
return Popover;
}(Tooltip);
/**
@ -3453,7 +3464,7 @@ var ScrollSpy = function ($$$1) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
if (typeof config.target !== 'string') {
var id = $$$1(config.target).attr('id');
@ -3588,6 +3599,7 @@ var ScrollSpy = function ($$$1) {
return Default;
}
}]);
return ScrollSpy;
}();
/**
@ -3642,7 +3654,6 @@ var Tab = function ($$$1) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 150;
var Event = {
HIDE: "hide" + EVENT_KEY,
HIDDEN: "hidden" + EVENT_KEY,
@ -3761,14 +3772,15 @@ var Tab = function ($$$1) {
}
var active = activeElements[0];
var isTransitioning = callback && Util.supportsTransitionEnd() && active && $$$1(active).hasClass(ClassName.FADE);
var isTransitioning = callback && active && $$$1(active).hasClass(ClassName.FADE);
var complete = function complete() {
return _this2._transitionComplete(element, active, callback);
};
if (active && isTransitioning) {
$$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(active);
$$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}
@ -3839,6 +3851,7 @@ var Tab = function ($$$1) {
return VERSION;
}
}]);
return Tab;
}();
/**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -35,7 +35,6 @@ h1, h2, h3, h4, h5, h6 {
}
.nav-scroller .nav {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: nowrap;
@ -61,7 +60,6 @@ h1, h2, h3, h4, h5, h6 {
.flex-auto {
-ms-flex: 0 0 auto;
-webkit-box-flex: 0;
flex: 0 0 auto;
}

View file

@ -32,7 +32,6 @@ body {
body {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
color: #fff;
text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);

View file

@ -10,10 +10,8 @@ body {
body {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-align: center;
-webkit-box-align: center;
align-items: center;
padding-top: 40px;
padding-bottom: 40px;

View file

@ -39,7 +39,6 @@ body {
}
.nav-scroller .nav {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: nowrap;

View file

@ -67,13 +67,11 @@
.flex-equal > * {
-ms-flex: 1;
-webkit-box-flex: 1;
flex: 1;
}
@media (min-width: 768px) {
.flex-md-equal > * {
-ms-flex: 1;
-webkit-box-flex: 1;
flex: 1;
}
}

View file

@ -5,10 +5,8 @@ body {
body {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-align: center;
-webkit-box-align: center;
align-items: center;
padding-top: 40px;
padding-bottom: 40px;

6
js/dist/alert.js vendored
View file

@ -20,7 +20,6 @@ var Alert = function ($) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 150;
var Selector = {
DISMISS: '[data-dismiss="alert"]'
};
@ -98,15 +97,16 @@ var Alert = function ($) {
$(element).removeClass(ClassName.SHOW);
if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
if (!$(element).hasClass(ClassName.FADE)) {
this._destroyElement(element);
return;
}
var transitionDuration = Util.getTransitionDurationFromElement(element);
$(element).one(Util.TRANSITION_END, function (event) {
return _this._destroyElement(element, event);
}).emulateTransitionEnd(TRANSITION_DURATION);
}).emulateTransitionEnd(transitionDuration);
};
_proto._destroyElement = function _destroyElement(element) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

35
js/dist/carousel.js vendored
View file

@ -1,4 +1,6 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@ -28,7 +30,6 @@ var Carousel = function ($) {
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
var MILLISECONDS_MULTIPLIER = 1000;
var Default = {
interval: 5000,
keyboard: true,
@ -98,7 +99,6 @@ var Carousel = function ($) {
this._config = this._getConfig(config);
this._element = $(element)[0];
this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
this._transitionDuration = this._getTransitionDuration();
this._addEventListeners();
} // Getters
@ -132,7 +132,7 @@ var Carousel = function ($) {
this._isPaused = true;
}
if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
if ($(this._element).find(Selector.NEXT_PREV)[0]) {
Util.triggerTransitionEnd(this._element);
this.cycle(true);
}
@ -200,25 +200,11 @@ var Carousel = function ($) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
Util.typeCheckConfig(NAME, config, DefaultType);
return config;
};
_proto._getTransitionDuration = function _getTransitionDuration() {
// Get transition-duration of first element in the carousel
var transitionDuration = $(this._element).find(Selector.ITEM).css('transition-duration'); // Return 0 carousel item is not found
if (!transitionDuration) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0]; // Multiply by 1000 if transition-duration is defined in seconds
return transitionDuration.indexOf('ms') > -1 ? parseFloat(transitionDuration) : parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
};
_proto._addEventListeners = function _addEventListeners() {
var _this2 = this;
@ -385,11 +371,12 @@ var Carousel = function ($) {
to: nextElementIndex
});
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) {
if ($(this._element).hasClass(ClassName.SLIDE)) {
$(nextElement).addClass(orderClassName);
Util.reflow(nextElement);
$(activeElement).addClass(directionalClassName);
$(nextElement).addClass(directionalClassName);
var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
$(activeElement).one(Util.TRANSITION_END, function () {
$(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
$(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
@ -397,7 +384,7 @@ var Carousel = function ($) {
setTimeout(function () {
return $(_this3._element).trigger(slidEvent);
}, 0);
}).emulateTransitionEnd(this._transitionDuration);
}).emulateTransitionEnd(transitionDuration);
} else {
$(activeElement).removeClass(ClassName.ACTIVE);
$(nextElement).addClass(ClassName.ACTIVE);
@ -415,10 +402,10 @@ var Carousel = function ($) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _config = _extends({}, Default, $(this).data());
var _config = _objectSpread({}, Default, $(this).data());
if (typeof config === 'object') {
_config = _extends({}, _config, config);
_config = _objectSpread({}, _config, config);
}
var action = typeof config === 'string' ? config : _config.slide;
@ -456,7 +443,7 @@ var Carousel = function ($) {
return;
}
var config = _extends({}, $(target).data(), $(this).data());
var config = _objectSpread({}, $(target).data(), $(this).data());
var slideIndex = this.getAttribute('data-slide-to');

File diff suppressed because one or more lines are too long

26
js/dist/collapse.js vendored
View file

@ -1,4 +1,6 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@ -22,7 +24,6 @@ var Collapse = function ($) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 600;
var Default = {
toggle: true,
parent: ''
@ -164,14 +165,10 @@ var Collapse = function ($) {
$(_this._element).trigger(Event.SHOWN);
};
if (!Util.supportsTransitionEnd()) {
complete();
return;
}
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
var scrollSize = "scroll" + capitalizedDimension;
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
this._element.style[dimension] = this._element[scrollSize] + "px";
};
@ -219,13 +216,8 @@ var Collapse = function ($) {
};
this._element.style[dimension] = '';
if (!Util.supportsTransitionEnd()) {
complete();
return;
}
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
};
_proto.setTransitioning = function setTransitioning(isTransitioning) {
@ -243,7 +235,7 @@ var Collapse = function ($) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
config.toggle = Boolean(config.toggle); // Coerce string values
Util.typeCheckConfig(NAME, config, DefaultType);
@ -298,7 +290,7 @@ var Collapse = function ($) {
var $this = $(this);
var data = $this.data(DATA_KEY);
var _config = _extends({}, Default, $this.data(), typeof config === 'object' && config);
var _config = _objectSpread({}, Default, $this.data(), typeof config === 'object' && config);
if (!data && _config.toggle && /show|hide/.test(config)) {
_config.toggle = false;

File diff suppressed because one or more lines are too long

10
js/dist/dropdown.js vendored
View file

@ -1,4 +1,6 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@ -60,7 +62,7 @@ var Dropdown = function ($) {
FORM_CHILD: '.dropdown form',
MENU: '.dropdown-menu',
NAVBAR_NAV: '.navbar-nav',
VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled)'
VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
};
var AttachmentMap = {
TOP: 'top-start',
@ -217,7 +219,7 @@ var Dropdown = function ($) {
};
_proto._getConfig = function _getConfig(config) {
config = _extends({}, this.constructor.Default, $(this._element).data(), config);
config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
return config;
};
@ -264,7 +266,7 @@ var Dropdown = function ($) {
if (typeof this._config.offset === 'function') {
offsetConf.fn = function (data) {
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets) || {});
data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
return data;
};
} else {

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"sources":["../src/index.js"],"names":["$","TypeError","version","fn","jquery","split","minMajor","ltMajor","minMinor","minPatch","maxMajor","Error"],"mappings":"AAaA;;;;;;AAOA,CAAC,UAACA,CAAD,EAAO;AACN,MAAI,OAAOA,CAAP,KAAa,WAAjB,EAA8B;AAC5B,UAAM,IAAIC,SAAJ,CAAc,kGAAd,CAAN;AACD;;AAED,MAAMC,UAAUF,EAAEG,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,UAAU,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;;AAEA,MAAIR,QAAQ,CAAR,IAAaK,OAAb,IAAwBL,QAAQ,CAAR,IAAaM,QAArC,IAAiDN,QAAQ,CAAR,MAAeI,QAAf,IAA2BJ,QAAQ,CAAR,MAAeM,QAA1C,IAAsDN,QAAQ,CAAR,IAAaO,QAApH,IAAgIP,QAAQ,CAAR,KAAcQ,QAAlJ,EAA4J;AAC1J,UAAM,IAAIC,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAfD,EAeGX,CAfH","file":"index.js","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(($) => {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n})($)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"]}
{"version":3,"sources":["../src/index.js"],"names":["$","TypeError","version","fn","jquery","split","minMajor","ltMajor","minMinor","minPatch","maxMajor","Error"],"mappings":"AAaA;;;;;;AAOA,CAAC,UAACA,CAAD,EAAO;AACN,MAAI,OAAOA,CAAP,KAAa,WAAjB,EAA8B;AAC5B,UAAM,IAAIC,SAAJ,CAAc,kGAAd,CAAN;AACD;;AAED,MAAMC,UAAUF,EAAEG,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,UAAU,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;;AAEA,MAAIR,QAAQ,CAAR,IAAaK,OAAb,IAAwBL,QAAQ,CAAR,IAAaM,QAArC,IAAiDN,QAAQ,CAAR,MAAeI,QAAf,IAA2BJ,QAAQ,CAAR,MAAeM,QAA1C,IAAsDN,QAAQ,CAAR,IAAaO,QAApH,IAAgIP,QAAQ,CAAR,KAAcQ,QAAlJ,EAA4J;AAC1J,UAAM,IAAIC,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAfD,EAeGX,CAfH","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(($) => {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n})($)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"],"file":"index.js"}

38
js/dist/modal.js vendored
View file

@ -1,4 +1,6 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@ -22,8 +24,6 @@ var Modal = function ($) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 300;
var BACKDROP_TRANSITION_DURATION = 150;
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
var Default = {
@ -102,7 +102,7 @@ var Modal = function ($) {
return;
}
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
if ($(this._element).hasClass(ClassName.FADE)) {
this._isTransitioning = true;
}
@ -164,7 +164,7 @@ var Modal = function ($) {
}
this._isShown = false;
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
var transition = $(this._element).hasClass(ClassName.FADE);
if (transition) {
this._isTransitioning = true;
@ -180,9 +180,10 @@ var Modal = function ($) {
$(this._dialog).off(Event.MOUSEDOWN_DISMISS);
if (transition) {
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$(this._element).one(Util.TRANSITION_END, function (event) {
return _this2._hideModal(event);
}).emulateTransitionEnd(TRANSITION_DURATION);
}).emulateTransitionEnd(transitionDuration);
} else {
this._hideModal();
}
@ -207,7 +208,7 @@ var Modal = function ($) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
Util.typeCheckConfig(NAME, config, DefaultType);
return config;
};
@ -215,7 +216,7 @@ var Modal = function ($) {
_proto._showElement = function _showElement(relatedTarget) {
var _this3 = this;
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
var transition = $(this._element).hasClass(ClassName.FADE);
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
// Don't move modal's DOM position
@ -252,7 +253,8 @@ var Modal = function ($) {
};
if (transition) {
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
$(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
} else {
transitionComplete();
}
@ -330,7 +332,6 @@ var Modal = function ($) {
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
if (this._isShown && this._config.backdrop) {
var doAnimate = Util.supportsTransitionEnd() && animate;
this._backdrop = document.createElement('div');
this._backdrop.className = ClassName.BACKDROP;
@ -356,7 +357,7 @@ var Modal = function ($) {
}
});
if (doAnimate) {
if (animate) {
Util.reflow(this._backdrop);
}
@ -366,12 +367,13 @@ var Modal = function ($) {
return;
}
if (!doAnimate) {
if (!animate) {
callback();
return;
}
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
$(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
} else if (!this._isShown && this._backdrop) {
$(this._backdrop).removeClass(ClassName.SHOW);
@ -383,8 +385,10 @@ var Modal = function ($) {
}
};
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
if ($(this._element).hasClass(ClassName.FADE)) {
var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
$(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
} else {
callbackRemove();
}
@ -491,7 +495,7 @@ var Modal = function ($) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _config = _extends({}, Modal.Default, $(this).data(), typeof config === 'object' && config);
var _config = _objectSpread({}, Modal.Default, $(this).data(), typeof config === 'object' && config);
if (!data) {
data = new Modal(this, _config);
@ -541,7 +545,7 @@ var Modal = function ($) {
target = $(selector)[0];
}
var config = $(target).data(DATA_KEY) ? 'toggle' : _extends({}, $(target).data(), $(this).data());
var config = $(target).data(DATA_KEY) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
if (this.tagName === 'A' || this.tagName === 'AREA') {
event.preventDefault();

File diff suppressed because one or more lines are too long

8
js/dist/popover.js vendored
View file

@ -4,7 +4,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
/**
* --------------------------------------------------------------------------
@ -26,14 +28,14 @@ var Popover = function ($) {
var CLASS_PREFIX = 'bs-popover';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var Default = _extends({}, Tooltip.Default, {
var Default = _objectSpread({}, Tooltip.Default, {
placement: 'right',
trigger: 'click',
content: '',
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});
var DefaultType = _extends({}, Tooltip.DefaultType, {
var DefaultType = _objectSpread({}, Tooltip.DefaultType, {
content: '(string|element|function)'
});

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,6 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@ -144,7 +146,7 @@ var ScrollSpy = function ($) {
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
config = _objectSpread({}, Default, config);
if (typeof config.target !== 'string') {
var id = $(config.target).attr('id');

File diff suppressed because one or more lines are too long

6
js/dist/tab.js vendored
View file

@ -20,7 +20,6 @@ var Tab = function ($) {
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 150;
var Event = {
HIDE: "hide" + EVENT_KEY,
HIDDEN: "hidden" + EVENT_KEY,
@ -139,14 +138,15 @@ var Tab = function ($) {
}
var active = activeElements[0];
var isTransitioning = callback && Util.supportsTransitionEnd() && active && $(active).hasClass(ClassName.FADE);
var isTransitioning = callback && active && $(active).hasClass(ClassName.FADE);
var complete = function complete() {
return _this2._transitionComplete(element, active, callback);
};
if (active && isTransitioning) {
$(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
var transitionDuration = Util.getTransitionDurationFromElement(active);
$(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}

2
js/dist/tab.js.map vendored

File diff suppressed because one or more lines are too long

19
js/dist/tooltip.js vendored
View file

@ -1,4 +1,6 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@ -21,7 +23,6 @@ var Tooltip = function ($) {
var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = "." + DATA_KEY;
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 150;
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var DefaultType = {
@ -284,8 +285,9 @@ var Tooltip = function ($) {
}
};
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
if ($(this.tip).hasClass(ClassName.FADE)) {
var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
$(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}
@ -335,8 +337,9 @@ var Tooltip = function ($) {
this._activeTrigger[Trigger.FOCUS] = false;
this._activeTrigger[Trigger.HOVER] = false;
if (Util.supportsTransitionEnd() && $(this.tip).hasClass(ClassName.FADE)) {
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
if ($(this.tip).hasClass(ClassName.FADE)) {
var transitionDuration = Util.getTransitionDurationFromElement(tip);
$(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
} else {
complete();
}
@ -427,7 +430,7 @@ var Tooltip = function ($) {
});
if (this.config.selector) {
this.config = _extends({}, this.config, {
this.config = _objectSpread({}, this.config, {
trigger: 'manual',
selector: ''
});
@ -521,7 +524,7 @@ var Tooltip = function ($) {
};
_proto._getConfig = function _getConfig(config) {
config = _extends({}, this.constructor.Default, $(this.element).data(), config);
config = _objectSpread({}, this.constructor.Default, $(this.element).data(), config);
if (typeof config.delay === 'number') {
config.delay = {

File diff suppressed because one or more lines are too long

45
js/dist/util.js vendored
View file

@ -10,8 +10,9 @@ var Util = function ($) {
* Private TransitionEnd Helpers
* ------------------------------------------------------------------------
*/
var transition = false;
var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
var TRANSITION_END = 'transitionend';
var MAX_UID = 1000000;
var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
function toType(obj) {
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
@ -19,8 +20,8 @@ var Util = function ($) {
function getSpecialTransitionEndEvent() {
return {
bindType: transition.end,
delegateType: transition.end,
bindType: TRANSITION_END,
delegateType: TRANSITION_END,
handle: function handle(event) {
if ($(event.target).is(this)) {
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
@ -31,16 +32,6 @@ var Util = function ($) {
};
}
function transitionEndTest() {
if (typeof window !== 'undefined' && window.QUnit) {
return false;
}
return {
end: 'transitionend'
};
}
function transitionEndEmulator(duration) {
var _this = this;
@ -57,13 +48,9 @@ var Util = function ($) {
}
function setTransitionEndSupport() {
transition = transitionEndTest();
$.fn.emulateTransitionEnd = transitionEndEmulator;
if (Util.supportsTransitionEnd()) {
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
}
}
/**
* --------------------------------------------------------------------------
* Public Util Api
@ -95,14 +82,32 @@ var Util = function ($) {
return null;
}
},
getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
if (!element) {
return 0;
} // Get transition-duration of the element
var transitionDuration = $(element).css('transition-duration');
var floatTransitionDuration = parseFloat(transitionDuration); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration) {
return 0;
} // If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER;
},
reflow: function reflow(element) {
return element.offsetHeight;
},
triggerTransitionEnd: function triggerTransitionEnd(element) {
$(element).trigger(transition.end);
$(element).trigger(TRANSITION_END);
},
// TODO: Remove in v5
supportsTransitionEnd: function supportsTransitionEnd() {
return Boolean(transition);
return Boolean(TRANSITION_END);
},
isElement: function isElement(obj) {
return (obj[0] || obj).nodeType;

2
js/dist/util.js.map vendored

File diff suppressed because one or more lines are too long

6
package-lock.json generated
View file

@ -701,7 +701,7 @@
},
"@sinonjs/formatio": {
"version": "2.0.0",
"resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz",
"resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz",
"integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==",
"dev": true,
"requires": {
@ -1286,7 +1286,7 @@
},
"babel-eslint": {
"version": "8.2.2",
"resolved": "http://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz",
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz",
"integrity": "sha512-Qt2lz2egBxNYWqN9JIO2z4NOOf8i4b5JS6CFoYrOZZTDssueiV1jH/jsefyg+86SeNY3rB361/mi3kE1WK2WYQ==",
"dev": true,
"requires": {
@ -3602,7 +3602,7 @@
},
"event-stream": {
"version": "3.3.4",
"resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
"integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
"dev": true,
"requires": {