From 114a0ee193ffe7869c8369f25ef4dcc44929fbf5 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 23 Jul 2019 23:13:50 -0700 Subject: Rebuild the dist to pickup new utilities file (#29105) Dist after adding new utils file --- dist/js/bootstrap.js | 211 ++++++++++++++++++++++++--------------------------- 1 file changed, 98 insertions(+), 113 deletions(-) (limited to 'dist/js/bootstrap.js') diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 4b9a42577..1742ea408 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -42,20 +42,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; @@ -748,10 +763,6 @@ element = document.documentElement; } - if (typeof selector !== 'string') { - return null; - } - return find.call(element, selector); }, findOne: function findOne$1(selector, element) { @@ -759,29 +770,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; @@ -796,17 +795,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; @@ -921,8 +912,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); }; @@ -988,6 +979,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; @@ -1142,7 +1135,6 @@ if (!data) { data = new Button(button); - Data.setData(button, DATA_KEY$1, data); } data.toggle(); @@ -1168,6 +1160,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; @@ -1223,7 +1217,7 @@ return {}; } - var attributes = _objectSpread({}, element.dataset); + var attributes = _objectSpread2({}, element.dataset); Object.keys(attributes).forEach(function (key) { attributes[key] = normalizeData(attributes[key]); @@ -1466,7 +1460,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default, config); + config = _objectSpread2({}, Default, {}, config); typeCheckConfig(NAME$2, config, DefaultType); return config; }; @@ -1509,7 +1503,7 @@ }); } - if (this._config.touch) { + if (this._config.touch && this._touchSupported) { this._addTouchEventListeners(); } }; @@ -1517,10 +1511,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; @@ -1769,10 +1759,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; @@ -1814,7 +1804,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'); @@ -1871,6 +1861,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; @@ -2147,7 +2139,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); @@ -2176,7 +2168,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; }; @@ -2200,15 +2195,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; @@ -2293,6 +2283,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; @@ -2555,21 +2547,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() { @@ -2604,7 +2590,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 { @@ -2836,6 +2822,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; @@ -2992,7 +2980,7 @@ var hideEvent = EventHandler.trigger(this._element, Event$6.HIDE); - if (!this._isShown || hideEvent.defaultPrevented) { + if (hideEvent.defaultPrevented) { return; } @@ -3055,7 +3043,7 @@ ; _proto._getConfig = function _getConfig(config) { - config = _objectSpread({}, Default$3, config); + config = _objectSpread2({}, Default$3, {}, config); typeCheckConfig(NAME$5, config, DefaultType$3); return config; }; @@ -3135,7 +3123,7 @@ _this5.hide(); } }); - } else if (!this._isShown) { + } else { EventHandler.off(this._element, Event$6.KEYDOWN_DISMISS); } }; @@ -3144,8 +3132,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); @@ -3175,11 +3163,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) { @@ -3219,10 +3205,6 @@ this._backdrop.classList.add(ClassName$5.SHOW); - if (!callback) { - return; - } - if (!animate) { callback(); return; @@ -3237,9 +3219,7 @@ var callbackRemove = function callbackRemove() { _this8._removeBackdrop(); - if (callback) { - callback(); - } + callback(); }; if (this._element.classList.contains(ClassName$5.FADE)) { @@ -3250,7 +3230,7 @@ } else { callbackRemove(); } - } else if (callback) { + } else { callback(); } } // ---------------------------------------------------------------------- @@ -3356,7 +3336,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); @@ -3402,14 +3382,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(); @@ -3430,6 +3404,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); } @@ -3439,8 +3415,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; @@ -3565,7 +3544,7 @@ }; for (var i = 0, len = elements.length; i < len; i++) { - var _ret = _loop(i, len); + var _ret = _loop(i); if (_ret === "continue") continue; } @@ -3794,7 +3773,7 @@ var attachment = this._getAttachment(placement); - this.addAttachmentClass(attachment); + this._addAttachmentClass(attachment); var container = this._getContainer(); @@ -3863,7 +3842,7 @@ } }; - _proto.hide = function hide(callback) { + _proto.hide = function hide() { var _this2 = this; var tip = this.getTipElement(); @@ -3879,13 +3858,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); @@ -3929,10 +3902,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; @@ -3956,7 +3925,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 @@ -3996,6 +3965,10 @@ } // Private ; + _proto._addAttachmentClass = function _addAttachmentClass(attachment) { + this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment); + }; + _proto._getOffset = function _getOffset() { var _this3 = this; @@ -4003,7 +3976,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 { @@ -4059,7 +4032,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: '' }); @@ -4164,7 +4137,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 = { @@ -4223,7 +4196,7 @@ this._cleanTipClass(); - this.addAttachmentClass(this._getAttachment(popperData.placement)); + this._addAttachmentClass(this._getAttachment(popperData.placement)); }; _proto._fixTransition = function _fixTransition() { @@ -4316,6 +4289,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]; @@ -4341,14 +4316,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: '' }); - var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { + var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, { content: '(string|element|function)' }); @@ -4509,6 +4484,8 @@ * ------------------------------------------------------------------------ */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$7 = jQuery.fn[NAME$7]; @@ -4652,7 +4629,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; @@ -4823,6 +4800,8 @@ * ------------------------------------------------------------------------ */ + /* istanbul ignore if */ + if (typeof jQuery !== 'undefined') { var JQUERY_NO_CONFLICT$8 = jQuery.fn[NAME$8]; jQuery.fn[NAME$8] = ScrollSpy._jQueryInterface; @@ -5060,6 +5039,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; @@ -5160,6 +5141,8 @@ this._element.classList.remove(ClassName$a.HIDE); + reflow(this._element); + this._element.classList.add(ClassName$a.SHOWING); if (this._config.animation) { @@ -5217,7 +5200,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; }; @@ -5281,6 +5264,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]; -- cgit v1.2.3