diff options
Diffstat (limited to 'dist/js/bootstrap.bundle.js')
| -rw-r--r-- | dist/js/bootstrap.bundle.js | 211 |
1 files changed, 98 insertions, 113 deletions
diff --git a/dist/js/bootstrap.bundle.js b/dist/js/bootstrap.bundle.js index 94580378f..4e2541f91 100644 --- a/dist/js/bootstrap.bundle.js +++ b/dist/js/bootstrap.bundle.js @@ -40,20 +40,35 @@ return obj; } - function _objectSpread(target) { + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(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; - })); + if (i % 2) { + ownKeys(source, true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(source).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); } return target; @@ -746,10 +761,6 @@ element = document.documentElement; } - if (typeof selector !== 'string') { - return null; - } - return find.call(element, selector); }, findOne: function findOne$1(selector, element) { @@ -757,29 +768,17 @@ element = document.documentElement; } - if (typeof selector !== 'string') { - return null; - } - return findOne.call(element, selector); }, children: function children(element, selector) { var _this = this; - if (typeof selector !== 'string') { - return null; - } - var children = makeArray(element.children); return children.filter(function (child) { return _this.matches(child, selector); }); }, parents: function parents(element, selector) { - if (typeof selector !== 'string') { - return null; - } - var parents = []; var ancestor = element.parentNode; @@ -794,17 +793,9 @@ return parents; }, closest: function closest$1(element, selector) { - if (typeof selector !== 'string') { - return null; - } - return closest.call(element, selector); }, prev: function prev(element, selector) { - if (typeof selector !== 'string') { - return null; - } - var siblings = []; var previous = element.previousSibling; @@ -919,8 +910,8 @@ } var transitionDuration = getTransitionDurationFromElement(element); - EventHandler.one(element, TRANSITION_END, function (event) { - return _this._destroyElement(element, event); + EventHandler.one(element, TRANSITION_END, function () { + return _this._destroyElement(element); }); emulateTransitionEnd(element, transitionDuration); }; @@ -986,6 +977,8 @@ * add .alert to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT = jQuery.fn[NAME]; jQuery.fn[NAME] = Alert._jQueryInterface; @@ -1140,7 +1133,6 @@ if (!data) { data = new Button(button); - Data.setData(button, DATA_KEY$1, data); } data.toggle(); @@ -1166,6 +1158,8 @@ * add .button to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$1 = jQuery.fn[NAME$1]; jQuery.fn[NAME$1] = Button._jQueryInterface; @@ -1221,7 +1215,7 @@ return {}; } - var attributes = _objectSpread({}, element.dataset); + var attributes = _objectSpread2({}, element.dataset); Object.keys(attributes).forEach(function (key) { attributes[key] = normalizeData(attributes[key]); @@ -1464,7 +1458,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default, config); + config = _objectSpread2({}, Default, {}, config); typeCheckConfig(NAME$2, config, DefaultType); return config; }; @@ -1507,7 +1501,7 @@ }); } - if (this._config.touch) { + if (this._config.touch && this._touchSupported) { this._addTouchEventListeners(); } }; @@ -1515,10 +1509,6 @@ _proto._addTouchEventListeners = function _addTouchEventListeners() { var _this3 = this; - if (!this._touchSupported) { - return; - } - var start = function start(event) { if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) { _this3.touchStartX = event.clientX; @@ -1767,10 +1757,10 @@ Carousel._carouselInterface = function _carouselInterface(element, config) { var data = Data.getData(element, DATA_KEY$2); - var _config = _objectSpread({}, Default, Manipulator.getDataAttributes(element)); + var _config = _objectSpread2({}, Default, {}, Manipulator.getDataAttributes(element)); if (typeof config === 'object') { - _config = _objectSpread({}, _config, config); + _config = _objectSpread2({}, _config, {}, config); } var action = typeof config === 'string' ? config : _config.slide; @@ -1812,7 +1802,7 @@ return; } - var config = _objectSpread({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this)); + var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this)); var slideIndex = this.getAttribute('data-slide-to'); @@ -1869,6 +1859,8 @@ * add .carousel to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$2 = jQuery.fn[NAME$2]; jQuery.fn[NAME$2] = Carousel._jQueryInterface; @@ -2145,7 +2137,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default$1, config); + config = _objectSpread2({}, Default$1, {}, config); config.toggle = Boolean(config.toggle); // Coerce string values typeCheckConfig(NAME$3, config, DefaultType$1); @@ -2174,7 +2166,10 @@ var selector = "[data-toggle=\"collapse\"][data-parent=\"" + parent + "\"]"; makeArray(SelectorEngine.find(selector, parent)).forEach(function (element) { - _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); + var selector = getSelectorFromElement(element); + var selected = selector ? SelectorEngine.findOne(selector) : null; + + _this3._addAriaAndCollapsedClass(selected, [element]); }); return parent; }; @@ -2198,15 +2193,10 @@ } // Static ; - Collapse._getTargetFromElement = function _getTargetFromElement(element) { - var selector = getSelectorFromElement(element); - return selector ? SelectorEngine.findOne(selector) : null; - }; - Collapse._collapseInterface = function _collapseInterface(element, config) { var data = Data.getData(element, DATA_KEY$3); - var _config = _objectSpread({}, Default$1, Manipulator.getDataAttributes(element), typeof config === 'object' && config ? config : {}); + var _config = _objectSpread2({}, Default$1, {}, Manipulator.getDataAttributes(element), {}, typeof config === 'object' && config ? config : {}); if (!data && _config.toggle && /show|hide/.test(config)) { _config.toggle = false; @@ -2291,6 +2281,8 @@ * add .collapse to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$3 = jQuery.fn[NAME$3]; jQuery.fn[NAME$3] = Collapse._jQueryInterface; @@ -5155,21 +5147,15 @@ }; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, this.constructor.Default, Manipulator.getDataAttributes(this._element), config); + config = _objectSpread2({}, this.constructor.Default, {}, Manipulator.getDataAttributes(this._element), {}, config); typeCheckConfig(NAME$4, config, this.constructor.DefaultType); return config; }; _proto._getMenuElement = function _getMenuElement() { - if (!this._menu) { - var parent = Dropdown._getParentFromElement(this._element); - - if (parent) { - this._menu = SelectorEngine.findOne(Selector$4.MENU, parent); - } - } + var parent = Dropdown._getParentFromElement(this._element); - return this._menu; + return SelectorEngine.findOne(Selector$4.MENU, parent); }; _proto._getPlacement = function _getPlacement() { @@ -5204,7 +5190,7 @@ if (typeof this._config.offset === 'function') { offset.fn = function (data) { - data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); + data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {}); return data; }; } else { @@ -5436,6 +5422,8 @@ * add .dropdown to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$4 = jQuery.fn[NAME$4]; jQuery.fn[NAME$4] = Dropdown._jQueryInterface; @@ -5592,7 +5580,7 @@ var hideEvent = EventHandler.trigger(this._element, Event$6.HIDE); - if (!this._isShown || hideEvent.defaultPrevented) { + if (hideEvent.defaultPrevented) { return; } @@ -5655,7 +5643,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default$3, config); + config = _objectSpread2({}, Default$3, {}, config); typeCheckConfig(NAME$5, config, DefaultType$3); return config; }; @@ -5735,7 +5723,7 @@ _this5.hide(); } }); - } else if (!this._isShown) { + } else { EventHandler.off(this._element, Event$6.KEYDOWN_DISMISS); } }; @@ -5744,8 +5732,8 @@ var _this6 = this; if (this._isShown) { - EventHandler.on(window, Event$6.RESIZE, function (event) { - return _this6.handleUpdate(event); + EventHandler.on(window, Event$6.RESIZE, function () { + return _this6._adjustDialog(); }); } else { EventHandler.off(window, Event$6.RESIZE); @@ -5775,11 +5763,9 @@ }; _proto._removeBackdrop = function _removeBackdrop() { - if (this._backdrop) { - this._backdrop.parentNode.removeChild(this._backdrop); + this._backdrop.parentNode.removeChild(this._backdrop); - this._backdrop = null; - } + this._backdrop = null; }; _proto._showBackdrop = function _showBackdrop(callback) { @@ -5819,10 +5805,6 @@ this._backdrop.classList.add(ClassName$5.SHOW); - if (!callback) { - return; - } - if (!animate) { callback(); return; @@ -5837,9 +5819,7 @@ var callbackRemove = function callbackRemove() { _this8._removeBackdrop(); - if (callback) { - callback(); - } + callback(); }; if (this._element.classList.contains(ClassName$5.FADE)) { @@ -5850,7 +5830,7 @@ } else { callbackRemove(); } - } else if (callback) { + } else { callback(); } } // ---------------------------------------------------------------------- @@ -5956,7 +5936,7 @@ return this.each(function () { var data = Data.getData(this, DATA_KEY$5); - var _config = _objectSpread({}, Default$3, Manipulator.getDataAttributes(this), typeof config === 'object' && config ? config : {}); + var _config = _objectSpread2({}, Default$3, {}, Manipulator.getDataAttributes(this), {}, typeof config === 'object' && config ? config : {}); if (!data) { data = new Modal(this, _config); @@ -6002,14 +5982,8 @@ EventHandler.on(document, Event$6.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { var _this10 = this; - var target; var selector = getSelectorFromElement(this); - - if (selector) { - target = SelectorEngine.findOne(selector); - } - - var config = Data.getData(target, DATA_KEY$5) ? 'toggle' : _objectSpread({}, Manipulator.getDataAttributes(target), Manipulator.getDataAttributes(this)); + var target = SelectorEngine.findOne(selector); if (this.tagName === 'A' || this.tagName === 'AREA') { event.preventDefault(); @@ -6030,6 +6004,8 @@ var data = Data.getData(target, DATA_KEY$5); if (!data) { + var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this)); + data = new Modal(target, config); } @@ -6039,8 +6015,11 @@ * ------------------------------------------------------------------------ * jQuery * ------------------------------------------------------------------------ + * add .modal to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$5 = jQuery.fn[NAME$5]; jQuery.fn[NAME$5] = Modal._jQueryInterface; @@ -6165,7 +6144,7 @@ }; for (var i = 0, len = elements.length; i < len; i++) { - var _ret = _loop(i, len); + var _ret = _loop(i); if (_ret === "continue") continue; } @@ -6394,7 +6373,7 @@ var attachment = this._getAttachment(placement); - this.addAttachmentClass(attachment); + this._addAttachmentClass(attachment); var container = this._getContainer(); @@ -6463,7 +6442,7 @@ } }; - _proto.hide = function hide(callback) { + _proto.hide = function hide() { var _this2 = this; var tip = this.getTipElement(); @@ -6479,13 +6458,7 @@ EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN); - if (_this2._popper !== null) { - _this2._popper.destroy(); - } - - if (callback) { - callback(); - } + _this2._popper.destroy(); }; var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE); @@ -6529,10 +6502,6 @@ return Boolean(this.getTitle()); }; - _proto.addAttachmentClass = function addAttachmentClass(attachment) { - this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment); - }; - _proto.getTipElement = function getTipElement() { if (this.tip) { return this.tip; @@ -6556,7 +6525,7 @@ return; } - if (typeof content === 'object' && (content.nodeType || content.jquery)) { + if (typeof content === 'object' && isElement(content)) { if (content.jquery) { content = content[0]; } // content is a DOM node or a jQuery @@ -6596,6 +6565,10 @@ } // Private ; + _proto._addAttachmentClass = function _addAttachmentClass(attachment) { + this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment); + }; + _proto._getOffset = function _getOffset() { var _this3 = this; @@ -6603,7 +6576,7 @@ if (typeof this.config.offset === 'function') { offset.fn = function (data) { - data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); + data.offsets = _objectSpread2({}, data.offsets, {}, _this3.config.offset(data.offsets, _this3.element) || {}); return data; }; } else { @@ -6659,7 +6632,7 @@ EventHandler.on(SelectorEngine.closest(this.element, '.modal'), 'hide.bs.modal', this._hideModalHandler); if (this.config.selector) { - this.config = _objectSpread({}, this.config, { + this.config = _objectSpread2({}, this.config, { trigger: 'manual', selector: '' }); @@ -6764,7 +6737,7 @@ config.container = config.container[0]; } - config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); + config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {}); if (typeof config.delay === 'number') { config.delay = { @@ -6823,7 +6796,7 @@ this._cleanTipClass(); - this.addAttachmentClass(this._getAttachment(popperData.placement)); + this._addAttachmentClass(this._getAttachment(popperData.placement)); }; _proto._fixTransition = function _fixTransition() { @@ -6916,6 +6889,8 @@ * add .tooltip to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$6 = jQuery.fn[NAME$6]; @@ -6941,14 +6916,14 @@ var CLASS_PREFIX$1 = 'bs-popover'; var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); - var Default$5 = _objectSpread({}, Tooltip.Default, { + var Default$5 = _objectSpread2({}, Tooltip.Default, { 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>' }); - var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { + var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, { content: '(string|element|function)' }); @@ -7109,6 +7084,8 @@ * ------------------------------------------------------------------------ */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$7 = jQuery.fn[NAME$7]; @@ -7252,7 +7229,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {}); + config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {}); if (typeof config.target !== 'string') { var id = config.target.id; @@ -7423,6 +7400,8 @@ * ------------------------------------------------------------------------ */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$8 = jQuery.fn[NAME$8]; jQuery.fn[NAME$8] = ScrollSpy._jQueryInterface; @@ -7660,6 +7639,8 @@ * add .tab to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$9 = jQuery.fn[NAME$9]; jQuery.fn[NAME$9] = Tab._jQueryInterface; @@ -7760,6 +7741,8 @@ this._element.classList.remove(ClassName$a.HIDE); + reflow(this._element); + this._element.classList.add(ClassName$a.SHOWING); if (this._config.animation) { @@ -7817,7 +7800,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default$7, Manipulator.getDataAttributes(this._element), typeof config === 'object' && config ? config : {}); + config = _objectSpread2({}, Default$7, {}, Manipulator.getDataAttributes(this._element), {}, typeof config === 'object' && config ? config : {}); typeCheckConfig(NAME$a, config, this.constructor.DefaultType); return config; }; @@ -7881,6 +7864,8 @@ * add .toast to jQuery only if jQuery is present */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$a = jQuery.fn[NAME$a]; |
