diff options
author | Mark Otto <markdotto@gmail.com> | 2017-12-23 03:21:54 +0300 |
---|---|---|
committer | Mark Otto <markdotto@gmail.com> | 2017-12-23 03:21:54 +0300 |
commit | 935d45f461e8448b8862e16cde35a3737d6649fd (patch) | |
tree | 9a3cedbc41384726b709041a552490de08c2f085 /dist/js/bootstrap.js | |
parent | 13150872c6637d0d224aa9d14fe8e103aff3139e (diff) |
dist
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r-- | dist/js/bootstrap.js | 128 |
1 files changed, 73 insertions, 55 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index a5183049b1..7516d60729 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -3,8 +3,11 @@ * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -var bootstrap = (function (exports,$,Popper) { -'use strict'; +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) : + typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) : + (factory((global.bootstrap = {}),global.jQuery,global.Popper)); +}(this, (function (exports,$,Popper) { 'use strict'; $ = $ && $.hasOwnProperty('default') ? $['default'] : $; Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; @@ -25,6 +28,24 @@ 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]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; @@ -45,12 +66,7 @@ var Util = function ($$$1) { * ------------------------------------------------------------------------ */ var transition = false; - var MAX_UID = 1000000; - var TransitionEndEvent = { - WebkitTransition: 'webkitTransitionEnd', - transition: 'transitionend' // shoutout AngusCroll (https://goo.gl/pxwQGp) - - }; + var MAX_UID = 1000000; // shoutout AngusCroll (https://goo.gl/pxwQGp) function toType(obj) { return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); @@ -75,17 +91,9 @@ var Util = function ($$$1) { return false; } - var el = document.createElement('bootstrap'); - - for (var name in TransitionEndEvent) { - if (typeof el.style[name] !== 'undefined') { - return { - end: TransitionEndEvent[name] - }; - } - } - - return false; + return { + end: 'transitionend' + }; } function transitionEndEmulator(duration) { @@ -715,7 +723,7 @@ var Carousel = function ($$$1) { _proto._getConfig = function _getConfig(config) { - config = $$$1.extend({}, Default, config); + config = _extends({}, Default, config); Util.typeCheckConfig(NAME, config, DefaultType); return config; }; @@ -917,10 +925,10 @@ var Carousel = function ($$$1) { return this.each(function () { var data = $$$1(this).data(DATA_KEY); - var _config = $$$1.extend({}, Default, $$$1(this).data()); + var _config = _extends({}, Default, $$$1(this).data()); if (typeof config === 'object') { - $$$1.extend(_config, config); + _config = _extends({}, _config, config); } var action = typeof config === 'string' ? config : _config.slide; @@ -958,7 +966,7 @@ var Carousel = function ($$$1) { return; } - var config = $$$1.extend({}, $$$1(target).data(), $$$1(this).data()); + var config = _extends({}, $$$1(target).data(), $$$1(this).data()); var slideIndex = this.getAttribute('data-slide-to'); if (slideIndex) { @@ -1257,7 +1265,7 @@ var Collapse = function ($$$1) { _proto._getConfig = function _getConfig(config) { - config = $$$1.extend({}, Default, config); + config = _extends({}, Default, config); config.toggle = Boolean(config.toggle); // coerce string values Util.typeCheckConfig(NAME, config, DefaultType); @@ -1312,7 +1320,7 @@ var Collapse = function ($$$1) { var $this = $$$1(this); var data = $this.data(DATA_KEY); - var _config = $$$1.extend({}, Default, $this.data(), typeof config === 'object' && config); + var _config = _extends({}, Default, $this.data(), typeof config === 'object' && config); if (!data && _config.toggle && /show|hide/.test(config)) { _config.toggle = false; @@ -1435,7 +1443,8 @@ var Dropdown = function ($$$1) { DROPRIGHT: 'dropright', DROPLEFT: 'dropleft', MENURIGHT: 'dropdown-menu-right', - MENULEFT: 'dropdown-menu-left' + MENULEFT: 'dropdown-menu-left', + POSITION_STATIC: 'position-static' }; var Selector = { DATA_TOGGLE: '[data-toggle="dropdown"]', @@ -1456,11 +1465,13 @@ var Dropdown = function ($$$1) { }; var Default = { offset: 0, - flip: true + flip: true, + boundary: 'scrollParent' }; var DefaultType = { offset: '(number|string|function)', - flip: 'boolean' + flip: 'boolean', + boundary: '(string|element)' /** * ------------------------------------------------------------------------ * Class Definition @@ -1527,6 +1538,13 @@ var Dropdown = function ($$$1) { if ($$$1(this._menu).hasClass(ClassName.MENULEFT) || $$$1(this._menu).hasClass(ClassName.MENURIGHT)) { element = parent; } + } // If boundary is not `scrollParent`, then set position to `static` + // to allow the menu to "escape" the scroll parent's boundaries + // https://github.com/twbs/bootstrap/issues/24251 + + + if (this._config.boundary !== 'scrollParent') { + $$$1(parent).addClass(ClassName.POSITION_STATIC); } this._popper = new Popper(element, this._menu, this._getPopperConfig()); @@ -1582,7 +1600,7 @@ var Dropdown = function ($$$1) { }; _proto._getConfig = function _getConfig(config) { - config = $$$1.extend({}, this.constructor.Default, $$$1(this._element).data(), config); + config = _extends({}, this.constructor.Default, $$$1(this._element).data(), config); Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); return config; }; @@ -1629,7 +1647,7 @@ var Dropdown = function ($$$1) { if (typeof this._config.offset === 'function') { offsetConf.fn = function (data) { - data.offsets = $$$1.extend({}, data.offsets, _this2._config.offset(data.offsets) || {}); + data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets) || {}); return data; }; } else { @@ -1642,6 +1660,9 @@ var Dropdown = function ($$$1) { offset: offsetConf, flip: { enabled: this._config.flip + }, + preventOverflow: { + boundariesElement: this._config.boundary } } }; @@ -2042,7 +2063,7 @@ var Modal = function ($$$1) { _proto._getConfig = function _getConfig(config) { - config = $$$1.extend({}, Default, config); + config = _extends({}, Default, config); Util.typeCheckConfig(NAME, config, DefaultType); return config; }; @@ -2326,7 +2347,7 @@ var Modal = function ($$$1) { return this.each(function () { var data = $$$1(this).data(DATA_KEY); - var _config = $$$1.extend({}, Modal.Default, $$$1(this).data(), typeof config === 'object' && config); + var _config = _extends({}, Modal.Default, $$$1(this).data(), typeof config === 'object' && config); if (!data) { data = new Modal(this, _config); @@ -2375,7 +2396,7 @@ var Modal = function ($$$1) { target = $$$1(selector)[0]; } - var config = $$$1(target).data(DATA_KEY) ? 'toggle' : $$$1.extend({}, $$$1(target).data(), $$$1(this).data()); + var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _extends({}, $$$1(target).data(), $$$1(this).data()); if (this.tagName === 'A' || this.tagName === 'AREA') { event.preventDefault(); @@ -2445,7 +2466,8 @@ var Tooltip = function ($$$1) { placement: '(string|function)', offset: '(number|string)', container: '(string|element|boolean)', - fallbackPlacement: '(string|array)' + fallbackPlacement: '(string|array)', + boundary: '(string|element)' }; var AttachmentMap = { AUTO: 'auto', @@ -2465,7 +2487,8 @@ var Tooltip = function ($$$1) { placement: 'top', offset: 0, container: false, - fallbackPlacement: 'flip' + fallbackPlacement: 'flip', + boundary: 'scrollParent' }; var HoverState = { SHOW: 'show', @@ -2655,6 +2678,9 @@ var Tooltip = function ($$$1) { }, arrow: { element: Selector.ARROW + }, + preventOverflow: { + boundariesElement: this.config.boundary } }, onCreate: function onCreate(data) { @@ -2832,7 +2858,7 @@ var Tooltip = function ($$$1) { }); if (this.config.selector) { - this.config = $$$1.extend({}, this.config, { + this.config = _extends({}, this.config, { trigger: 'manual', selector: '' }); @@ -2926,7 +2952,7 @@ var Tooltip = function ($$$1) { }; _proto._getConfig = function _getConfig(config) { - config = $$$1.extend({}, this.constructor.Default, $$$1(this.element).data(), config); + config = _extends({}, this.constructor.Default, $$$1(this.element).data(), config); if (typeof config.delay === 'number') { config.delay = { @@ -3093,13 +3119,13 @@ 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 = $$$1.extend({}, Tooltip.Default, { + var Default = _extends({}, 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 = $$$1.extend({}, Tooltip.DefaultType, { + var DefaultType = _extends({}, Tooltip.DefaultType, { content: '(string|element|function)' }); var ClassName = { @@ -3407,7 +3433,7 @@ var ScrollSpy = function ($$$1) { _proto._getConfig = function _getConfig(config) { - config = $$$1.extend({}, Default, config); + config = _extends({}, Default, config); if (typeof config.target !== 'string') { var id = $$$1(config.target).attr('id'); @@ -3718,7 +3744,7 @@ var Tab = function ($$$1) { var isTransitioning = callback && Util.supportsTransitionEnd() && active && $$$1(active).hasClass(ClassName.FADE); var complete = function complete() { - return _this2._transitionComplete(element, active, isTransitioning, callback); + return _this2._transitionComplete(element, active, callback); }; if (active && isTransitioning) { @@ -3726,15 +3752,11 @@ var Tab = function ($$$1) { } else { complete(); } - - if (active) { - $$$1(active).removeClass(ClassName.SHOW); - } }; - _proto._transitionComplete = function _transitionComplete(element, active, isTransitioning, callback) { + _proto._transitionComplete = function _transitionComplete(element, active, callback) { if (active) { - $$$1(active).removeClass(ClassName.ACTIVE); + $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE); var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0]; if (dropdownChild) { @@ -3752,12 +3774,8 @@ var Tab = function ($$$1) { element.setAttribute('aria-selected', true); } - if (isTransitioning) { - Util.reflow(element); - $$$1(element).addClass(ClassName.SHOW); - } else { - $$$1(element).removeClass(ClassName.FADE); - } + Util.reflow(element); + $$$1(element).addClass(ClassName.SHOW); if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) { var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0]; @@ -3868,7 +3886,7 @@ exports.Scrollspy = ScrollSpy; exports.Tab = Tab; exports.Tooltip = Tooltip; -return exports; +Object.defineProperty(exports, '__esModule', { value: true }); -}({},jQuery,Popper)); +}))); //# sourceMappingURL=bootstrap.js.map |