mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
Dist (#32323)
This commit is contained in:
parent
cfd00b5eeb
commit
cfe31592d7
2
dist/css/bootstrap-grid.css.map
vendored
2
dist/css/bootstrap-grid.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap-reboot.css.map
vendored
2
dist/css/bootstrap-reboot.css.map
vendored
File diff suppressed because one or more lines are too long
@ -1914,7 +1914,6 @@ progress {
|
||||
}
|
||||
.table {
|
||||
--bs-table-bg: transparent;
|
||||
--bs-table-accent-bg: transparent;
|
||||
--bs-table-striped-color: #212529;
|
||||
--bs-table-striped-bg: rgba(0, 0, 0, 0.05);
|
||||
--bs-table-active-color: #212529;
|
||||
@ -3754,7 +3753,7 @@ textarea.form-control-lg {
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.btn-group-vertical > .btn:not(:first-child),
|
||||
.btn-group-vertical > .btn ~ .btn,
|
||||
.btn-group-vertical > .btn-group:not(:first-child) > .btn {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
@ -4397,11 +4396,9 @@ textarea.form-control-lg {
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0.5rem 1rem;
|
||||
padding: 0 0;
|
||||
margin-bottom: 1rem;
|
||||
list-style: none;
|
||||
background-color: #e9ecef;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.breadcrumb-item + .breadcrumb-item {
|
||||
@ -4411,7 +4408,7 @@ textarea.form-control-lg {
|
||||
float: left;
|
||||
padding-right: 0.5rem;
|
||||
color: #6c757d;
|
||||
content: "/";
|
||||
content: var(--bs-breadcrumb-divider, "/");
|
||||
}
|
||||
.breadcrumb-item.active {
|
||||
color: #6c757d;
|
||||
|
2
dist/css/bootstrap.css.map
vendored
2
dist/css/bootstrap.css.map
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.min.css
vendored
2
dist/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/css/bootstrap.min.css.map
vendored
2
dist/css/bootstrap.min.css.map
vendored
File diff suppressed because one or more lines are too long
817
dist/js/bootstrap.bundle.js
vendored
817
dist/js/bootstrap.bundle.js
vendored
@ -580,8 +580,48 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data.setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var DATA_KEY = 'bs.alert';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -598,15 +638,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Alert = /*#__PURE__*/function () {
|
||||
function Alert(element) {
|
||||
this._element = element;
|
||||
|
||||
if (this._element) {
|
||||
Data.setData(element, DATA_KEY, this);
|
||||
}
|
||||
} // Getters
|
||||
var Alert = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Alert, _BaseComponent);
|
||||
|
||||
function Alert() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Alert.prototype;
|
||||
|
||||
@ -621,11 +658,6 @@
|
||||
}
|
||||
|
||||
this._removeElement(rootElement);
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -688,19 +720,16 @@
|
||||
};
|
||||
};
|
||||
|
||||
Alert.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Alert, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Alert;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -739,7 +768,6 @@
|
||||
*/
|
||||
|
||||
var NAME$1 = 'button';
|
||||
var VERSION$1 = '5.0.0-alpha3';
|
||||
var DATA_KEY$1 = 'bs.button';
|
||||
var EVENT_KEY$1 = "." + DATA_KEY$1;
|
||||
var DATA_API_KEY$1 = '.data-api';
|
||||
@ -752,12 +780,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Button = /*#__PURE__*/function () {
|
||||
function Button(element) {
|
||||
this._element = element;
|
||||
Data.setData(element, DATA_KEY$1, this);
|
||||
} // Getters
|
||||
var Button = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Button, _BaseComponent);
|
||||
|
||||
function Button() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Button.prototype;
|
||||
|
||||
@ -765,11 +793,6 @@
|
||||
_proto.toggle = function toggle() {
|
||||
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
||||
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$1);
|
||||
this._element = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
@ -787,19 +810,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
Button.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$1);
|
||||
};
|
||||
|
||||
_createClass(Button, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$1;
|
||||
return DATA_KEY$1;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Button;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -1004,7 +1024,6 @@
|
||||
*/
|
||||
|
||||
var NAME$2 = 'carousel';
|
||||
var VERSION$2 = '5.0.0-alpha3';
|
||||
var DATA_KEY$2 = 'bs.carousel';
|
||||
var EVENT_KEY$2 = "." + DATA_KEY$2;
|
||||
var DATA_API_KEY$2 = '.data-api';
|
||||
@ -1072,25 +1091,29 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Carousel = /*#__PURE__*/function () {
|
||||
var Carousel = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Carousel, _BaseComponent);
|
||||
|
||||
function Carousel(element, config) {
|
||||
this._items = null;
|
||||
this._interval = null;
|
||||
this._activeElement = null;
|
||||
this._isPaused = false;
|
||||
this._isSliding = false;
|
||||
this.touchTimeout = null;
|
||||
this.touchStartX = 0;
|
||||
this.touchDeltaX = 0;
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
this._pointerEvent = Boolean(window.PointerEvent);
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._items = null;
|
||||
_this._interval = null;
|
||||
_this._activeElement = null;
|
||||
_this._isPaused = false;
|
||||
_this._isSliding = false;
|
||||
_this.touchTimeout = null;
|
||||
_this.touchStartX = 0;
|
||||
_this.touchDeltaX = 0;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, _this._element);
|
||||
_this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
_this._pointerEvent = Boolean(window.PointerEvent);
|
||||
|
||||
Data.setData(element, DATA_KEY$2, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -1149,7 +1172,7 @@
|
||||
};
|
||||
|
||||
_proto.to = function to(index) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -1161,7 +1184,7 @@
|
||||
|
||||
if (this._isSliding) {
|
||||
EventHandler.one(this._element, EVENT_SLID, function () {
|
||||
return _this.to(index);
|
||||
return _this2.to(index);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -1178,11 +1201,11 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._element, EVENT_KEY$2);
|
||||
Data.removeData(this._element, DATA_KEY$2);
|
||||
this._items = null;
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._interval = null;
|
||||
this._isPaused = null;
|
||||
this._isSliding = null;
|
||||
@ -1218,20 +1241,20 @@
|
||||
};
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._config.keyboard) {
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN, function (event) {
|
||||
return _this2._keydown(event);
|
||||
return _this3._keydown(event);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
EventHandler.on(this._element, EVENT_MOUSEENTER, function (event) {
|
||||
return _this2.pause(event);
|
||||
return _this3.pause(event);
|
||||
});
|
||||
EventHandler.on(this._element, EVENT_MOUSELEAVE, function (event) {
|
||||
return _this2.cycle(event);
|
||||
return _this3.cycle(event);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1241,33 +1264,33 @@
|
||||
};
|
||||
|
||||
_proto._addTouchEventListeners = function _addTouchEventListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var start = function start(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchStartX = event.clientX;
|
||||
} else if (!_this3._pointerEvent) {
|
||||
_this3.touchStartX = event.touches[0].clientX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchStartX = event.clientX;
|
||||
} else if (!_this4._pointerEvent) {
|
||||
_this4.touchStartX = event.touches[0].clientX;
|
||||
}
|
||||
};
|
||||
|
||||
var move = function move(event) {
|
||||
// ensure swiping with one touch and not pinching
|
||||
if (event.touches && event.touches.length > 1) {
|
||||
_this3.touchDeltaX = 0;
|
||||
_this4.touchDeltaX = 0;
|
||||
} else {
|
||||
_this3.touchDeltaX = event.touches[0].clientX - _this3.touchStartX;
|
||||
_this4.touchDeltaX = event.touches[0].clientX - _this4.touchStartX;
|
||||
}
|
||||
};
|
||||
|
||||
var end = function end(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchDeltaX = event.clientX - _this3.touchStartX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchDeltaX = event.clientX - _this4.touchStartX;
|
||||
}
|
||||
|
||||
_this3._handleSwipe();
|
||||
_this4._handleSwipe();
|
||||
|
||||
if (_this3._config.pause === 'hover') {
|
||||
if (_this4._config.pause === 'hover') {
|
||||
// If it's a touch-enabled device, mouseenter/leave are fired as
|
||||
// part of the mouse compatibility events on first tap - the carousel
|
||||
// would stop cycling until user tapped out of it;
|
||||
@ -1275,15 +1298,15 @@
|
||||
// (as if it's the second time we tap on it, mouseenter compat event
|
||||
// is NOT fired) and after a timeout (to allow for mouse compatibility
|
||||
// events to fire) we explicitly restart cycling
|
||||
_this3.pause();
|
||||
_this4.pause();
|
||||
|
||||
if (_this3.touchTimeout) {
|
||||
clearTimeout(_this3.touchTimeout);
|
||||
if (_this4.touchTimeout) {
|
||||
clearTimeout(_this4.touchTimeout);
|
||||
}
|
||||
|
||||
_this3.touchTimeout = setTimeout(function (event) {
|
||||
return _this3.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
|
||||
_this4.touchTimeout = setTimeout(function (event) {
|
||||
return _this4.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this4._config.interval);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1403,7 +1426,7 @@
|
||||
};
|
||||
|
||||
_proto._slide = function _slide(direction, element) {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -1464,9 +1487,9 @@
|
||||
nextElement.classList.remove(directionalClassName, orderClassName);
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE$1);
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE$1, orderClassName, directionalClassName);
|
||||
_this4._isSliding = false;
|
||||
_this5._isSliding = false;
|
||||
setTimeout(function () {
|
||||
EventHandler.trigger(_this4._element, EVENT_SLID, {
|
||||
EventHandler.trigger(_this5._element, EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
@ -1552,24 +1575,20 @@
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
Carousel.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$2);
|
||||
};
|
||||
|
||||
_createClass(Carousel, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$2;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$2;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Carousel;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -1615,7 +1634,6 @@
|
||||
*/
|
||||
|
||||
var NAME$3 = 'collapse';
|
||||
var VERSION$3 = '5.0.0-alpha3';
|
||||
var DATA_KEY$3 = 'bs.collapse';
|
||||
var EVENT_KEY$3 = "." + DATA_KEY$3;
|
||||
var DATA_API_KEY$3 = '.data-api';
|
||||
@ -1646,12 +1664,16 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Collapse = /*#__PURE__*/function () {
|
||||
var Collapse = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Collapse, _BaseComponent);
|
||||
|
||||
function Collapse(element, config) {
|
||||
this._isTransitioning = false;
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._isTransitioning = false;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1);
|
||||
|
||||
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||
@ -1662,23 +1684,23 @@
|
||||
});
|
||||
|
||||
if (selector !== null && filterElement.length) {
|
||||
this._selector = selector;
|
||||
_this._selector = selector;
|
||||
|
||||
this._triggerArray.push(elem);
|
||||
_this._triggerArray.push(elem);
|
||||
}
|
||||
}
|
||||
|
||||
this._parent = this._config.parent ? this._getParent() : null;
|
||||
_this._parent = _this._config.parent ? _this._getParent() : null;
|
||||
|
||||
if (!this._config.parent) {
|
||||
this._addAriaAndCollapsedClass(this._element, this._triggerArray);
|
||||
if (!_this._config.parent) {
|
||||
_this._addAriaAndCollapsedClass(_this._element, _this._triggerArray);
|
||||
}
|
||||
|
||||
if (this._config.toggle) {
|
||||
this.toggle();
|
||||
if (_this._config.toggle) {
|
||||
_this.toggle();
|
||||
}
|
||||
|
||||
Data.setData(element, DATA_KEY$3, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -1694,7 +1716,7 @@
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -1705,8 +1727,8 @@
|
||||
|
||||
if (this._parent) {
|
||||
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(function (elem) {
|
||||
if (typeof _this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this._config.parent;
|
||||
if (typeof _this2._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this2._config.parent;
|
||||
}
|
||||
|
||||
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
||||
@ -1766,15 +1788,15 @@
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
_this._element.style[dimension] = '';
|
||||
_this2._element.style[dimension] = '';
|
||||
|
||||
_this.setTransitioning(false);
|
||||
_this2.setTransitioning(false);
|
||||
|
||||
EventHandler.trigger(_this._element, EVENT_SHOWN);
|
||||
EventHandler.trigger(_this2._element, EVENT_SHOWN);
|
||||
};
|
||||
|
||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
@ -1786,7 +1808,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -1824,13 +1846,13 @@
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this2.setTransitioning(false);
|
||||
_this3.setTransitioning(false);
|
||||
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this3._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
_this3._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
|
||||
EventHandler.trigger(_this2._element, EVENT_HIDDEN);
|
||||
EventHandler.trigger(_this3._element, EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
@ -1844,10 +1866,10 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$3);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
this._parent = null;
|
||||
this._element = null;
|
||||
this._triggerArray = null;
|
||||
this._isTransitioning = null;
|
||||
} // Private
|
||||
@ -1866,7 +1888,7 @@
|
||||
};
|
||||
|
||||
_proto._getParent = function _getParent() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var parent = this._config.parent;
|
||||
|
||||
@ -1883,7 +1905,7 @@
|
||||
SelectorEngine.find(selector, parent).forEach(function (element) {
|
||||
var selected = getElementFromSelector(element);
|
||||
|
||||
_this3._addAriaAndCollapsedClass(selected, [element]);
|
||||
_this4._addAriaAndCollapsedClass(selected, [element]);
|
||||
});
|
||||
return parent;
|
||||
};
|
||||
@ -1934,24 +1956,20 @@
|
||||
});
|
||||
};
|
||||
|
||||
Collapse.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$3);
|
||||
};
|
||||
|
||||
_createClass(Collapse, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$3;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$1;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$3;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Collapse;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -4631,7 +4649,6 @@
|
||||
*/
|
||||
|
||||
var NAME$4 = 'dropdown';
|
||||
var VERSION$4 = '5.0.0-alpha3';
|
||||
var DATA_KEY$4 = 'bs.dropdown';
|
||||
var EVENT_KEY$4 = "." + DATA_KEY$4;
|
||||
var DATA_API_KEY$4 = '.data-api';
|
||||
@ -4692,17 +4709,21 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Dropdown = /*#__PURE__*/function () {
|
||||
var Dropdown = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Dropdown, _BaseComponent);
|
||||
|
||||
function Dropdown(element, config) {
|
||||
this._element = element;
|
||||
this._popper = null;
|
||||
this._config = this._getConfig(config);
|
||||
this._menu = this._getMenuElement();
|
||||
this._inNavbar = this._detectNavbar();
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._popper = null;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._menu = _this._getMenuElement();
|
||||
_this._inNavbar = _this._detectNavbar();
|
||||
|
||||
Data.setData(element, DATA_KEY$4, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -4818,9 +4839,9 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$4);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._element, EVENT_KEY$4);
|
||||
this._element = null;
|
||||
this._menu = null;
|
||||
|
||||
if (this._popper) {
|
||||
@ -4840,13 +4861,13 @@
|
||||
;
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
_this.toggle();
|
||||
_this2.toggle();
|
||||
});
|
||||
};
|
||||
|
||||
@ -4882,13 +4903,13 @@
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -5050,15 +5071,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var index = items.indexOf(event.target);
|
||||
var index = items.indexOf(event.target); // Up
|
||||
|
||||
if (event.key === ARROW_UP_KEY && index > 0) {
|
||||
// Up
|
||||
index--;
|
||||
}
|
||||
} // Down
|
||||
|
||||
|
||||
if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
|
||||
// Down
|
||||
index++;
|
||||
} // index is -1 if the first keydown is an ArrowUp
|
||||
|
||||
@ -5067,16 +5087,7 @@
|
||||
items[index].focus();
|
||||
};
|
||||
|
||||
Dropdown.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$4);
|
||||
};
|
||||
|
||||
_createClass(Dropdown, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$4;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$2;
|
||||
@ -5086,10 +5097,15 @@
|
||||
get: function get() {
|
||||
return DefaultType$2;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$4;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Dropdown;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -5139,7 +5155,6 @@
|
||||
*/
|
||||
|
||||
var NAME$5 = 'modal';
|
||||
var VERSION$5 = '5.0.0-alpha3';
|
||||
var DATA_KEY$5 = 'bs.modal';
|
||||
var EVENT_KEY$5 = "." + DATA_KEY$5;
|
||||
var DATA_API_KEY$5 = '.data-api';
|
||||
@ -5147,14 +5162,12 @@
|
||||
var Default$3 = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: true
|
||||
focus: true
|
||||
};
|
||||
var DefaultType$3 = {
|
||||
backdrop: '(boolean|string)',
|
||||
keyboard: 'boolean',
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
focus: 'boolean'
|
||||
};
|
||||
var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
|
||||
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
|
||||
@ -5186,18 +5199,22 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Modal = /*#__PURE__*/function () {
|
||||
var Modal = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Modal, _BaseComponent);
|
||||
|
||||
function Modal(element, config) {
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
|
||||
this._backdrop = null;
|
||||
this._isShown = false;
|
||||
this._isBodyOverflowing = false;
|
||||
this._ignoreBackdropClick = false;
|
||||
this._isTransitioning = false;
|
||||
this._scrollbarWidth = 0;
|
||||
Data.setData(element, DATA_KEY$5, this);
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
|
||||
_this._backdrop = null;
|
||||
_this._isShown = false;
|
||||
_this._isBodyOverflowing = false;
|
||||
_this._ignoreBackdropClick = false;
|
||||
_this._isTransitioning = false;
|
||||
_this._scrollbarWidth = 0;
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -5209,7 +5226,7 @@
|
||||
};
|
||||
|
||||
_proto.show = function show(relatedTarget) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isShown || this._isTransitioning) {
|
||||
return;
|
||||
@ -5240,23 +5257,23 @@
|
||||
this._setResizeEvent();
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
|
||||
return _this.hide(event);
|
||||
return _this2.hide(event);
|
||||
});
|
||||
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
|
||||
EventHandler.one(_this._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this._element) {
|
||||
_this._ignoreBackdropClick = true;
|
||||
EventHandler.one(_this2._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this2._element) {
|
||||
_this2._ignoreBackdropClick = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this._showBackdrop(function () {
|
||||
return _this._showElement(relatedTarget);
|
||||
return _this2._showElement(relatedTarget);
|
||||
});
|
||||
};
|
||||
|
||||
_proto.hide = function hide(event) {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
@ -5294,7 +5311,7 @@
|
||||
if (transition) {
|
||||
var transitionDuration = getTransitionDurationFromElement(this._element);
|
||||
EventHandler.one(this._element, TRANSITION_END, function (event) {
|
||||
return _this2._hideModal(event);
|
||||
return _this3._hideModal(event);
|
||||
});
|
||||
emulateTransitionEnd(this._element, transitionDuration);
|
||||
} else {
|
||||
@ -5306,16 +5323,17 @@
|
||||
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
||||
return EventHandler.off(htmlElement, EVENT_KEY$5);
|
||||
});
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
/**
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
* Do not move `document` in `htmlElements` array
|
||||
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
|
||||
|
||||
EventHandler.off(document, EVENT_FOCUSIN);
|
||||
Data.removeData(this._element, DATA_KEY$5);
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._dialog = null;
|
||||
this._backdrop = null;
|
||||
this._isShown = null;
|
||||
@ -5337,7 +5355,7 @@
|
||||
};
|
||||
|
||||
_proto._showElement = function _showElement(relatedTarget) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var transition = this._element.classList.contains(CLASS_NAME_FADE);
|
||||
|
||||
@ -5373,12 +5391,12 @@
|
||||
}
|
||||
|
||||
var transitionComplete = function transitionComplete() {
|
||||
if (_this3._config.focus) {
|
||||
_this3._element.focus();
|
||||
if (_this4._config.focus) {
|
||||
_this4._element.focus();
|
||||
}
|
||||
|
||||
_this3._isTransitioning = false;
|
||||
EventHandler.trigger(_this3._element, EVENT_SHOWN$2, {
|
||||
_this4._isTransitioning = false;
|
||||
EventHandler.trigger(_this4._element, EVENT_SHOWN$2, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
};
|
||||
@ -5393,28 +5411,28 @@
|
||||
};
|
||||
|
||||
_proto._enforceFocus = function _enforceFocus() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
|
||||
|
||||
EventHandler.on(document, EVENT_FOCUSIN, function (event) {
|
||||
if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
|
||||
_this4._element.focus();
|
||||
if (document !== event.target && _this5._element !== event.target && !_this5._element.contains(event.target)) {
|
||||
_this5._element.focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_proto._setEscapeEvent = function _setEscapeEvent() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
|
||||
if (_this5._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
if (_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
event.preventDefault();
|
||||
|
||||
_this5.hide();
|
||||
} else if (!_this5._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
_this5._triggerBackdropTransition();
|
||||
_this6.hide();
|
||||
} else if (!_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
_this6._triggerBackdropTransition();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -5423,11 +5441,11 @@
|
||||
};
|
||||
|
||||
_proto._setResizeEvent = function _setResizeEvent() {
|
||||
var _this6 = this;
|
||||
var _this7 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler.on(window, EVENT_RESIZE, function () {
|
||||
return _this6._adjustDialog();
|
||||
return _this7._adjustDialog();
|
||||
});
|
||||
} else {
|
||||
EventHandler.off(window, EVENT_RESIZE);
|
||||
@ -5435,7 +5453,7 @@
|
||||
};
|
||||
|
||||
_proto._hideModal = function _hideModal() {
|
||||
var _this7 = this;
|
||||
var _this8 = this;
|
||||
|
||||
this._element.style.display = 'none';
|
||||
|
||||
@ -5450,11 +5468,11 @@
|
||||
this._showBackdrop(function () {
|
||||
document.body.classList.remove(CLASS_NAME_OPEN);
|
||||
|
||||
_this7._resetAdjustments();
|
||||
_this8._resetAdjustments();
|
||||
|
||||
_this7._resetScrollbar();
|
||||
_this8._resetScrollbar();
|
||||
|
||||
EventHandler.trigger(_this7._element, EVENT_HIDDEN$2);
|
||||
EventHandler.trigger(_this8._element, EVENT_HIDDEN$2);
|
||||
});
|
||||
};
|
||||
|
||||
@ -5465,7 +5483,7 @@
|
||||
};
|
||||
|
||||
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||
var _this8 = this;
|
||||
var _this9 = this;
|
||||
|
||||
var animate = this._element.classList.contains(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||
|
||||
@ -5479,8 +5497,8 @@
|
||||
|
||||
document.body.appendChild(this._backdrop);
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, function (event) {
|
||||
if (_this8._ignoreBackdropClick) {
|
||||
_this8._ignoreBackdropClick = false;
|
||||
if (_this9._ignoreBackdropClick) {
|
||||
_this9._ignoreBackdropClick = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -5488,10 +5506,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (_this8._config.backdrop === 'static') {
|
||||
_this8._triggerBackdropTransition();
|
||||
if (_this9._config.backdrop === 'static') {
|
||||
_this9._triggerBackdropTransition();
|
||||
} else {
|
||||
_this8.hide();
|
||||
_this9.hide();
|
||||
}
|
||||
});
|
||||
|
||||
@ -5513,7 +5531,7 @@
|
||||
this._backdrop.classList.remove(CLASS_NAME_SHOW$2);
|
||||
|
||||
var callbackRemove = function callbackRemove() {
|
||||
_this8._removeBackdrop();
|
||||
_this9._removeBackdrop();
|
||||
|
||||
callback();
|
||||
};
|
||||
@ -5532,7 +5550,7 @@
|
||||
};
|
||||
|
||||
_proto._triggerBackdropTransition = function _triggerBackdropTransition() {
|
||||
var _this9 = this;
|
||||
var _this10 = this;
|
||||
|
||||
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
|
||||
@ -5551,13 +5569,13 @@
|
||||
var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
|
||||
EventHandler.off(this._element, TRANSITION_END);
|
||||
EventHandler.one(this._element, TRANSITION_END, function () {
|
||||
_this9._element.classList.remove(CLASS_NAME_STATIC);
|
||||
_this10._element.classList.remove(CLASS_NAME_STATIC);
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
EventHandler.one(_this9._element, TRANSITION_END, function () {
|
||||
_this9._element.style.overflowY = '';
|
||||
EventHandler.one(_this10._element, TRANSITION_END, function () {
|
||||
_this10._element.style.overflowY = '';
|
||||
});
|
||||
emulateTransitionEnd(_this9._element, modalTransitionDuration);
|
||||
emulateTransitionEnd(_this10._element, modalTransitionDuration);
|
||||
}
|
||||
});
|
||||
emulateTransitionEnd(this._element, modalTransitionDuration);
|
||||
@ -5592,7 +5610,7 @@
|
||||
};
|
||||
|
||||
_proto._setScrollbar = function _setScrollbar() {
|
||||
var _this10 = this;
|
||||
var _this11 = this;
|
||||
|
||||
if (this._isBodyOverflowing) {
|
||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||
@ -5602,14 +5620,14 @@
|
||||
var actualPadding = element.style.paddingRight;
|
||||
var calculatedPadding = window.getComputedStyle(element)['padding-right'];
|
||||
Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px";
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this11._scrollbarWidth + "px";
|
||||
}); // Adjust sticky content margin
|
||||
|
||||
SelectorEngine.find(SELECTOR_STICKY_CONTENT).forEach(function (element) {
|
||||
var actualMargin = element.style.marginRight;
|
||||
var calculatedMargin = window.getComputedStyle(element)['margin-right'];
|
||||
Manipulator.setDataAttribute(element, 'margin-right', actualMargin);
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px";
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this11._scrollbarWidth + "px";
|
||||
}); // Adjust body padding
|
||||
|
||||
var actualPadding = document.body.style.paddingRight;
|
||||
@ -5678,30 +5696,24 @@
|
||||
}
|
||||
|
||||
data[config](relatedTarget);
|
||||
} else if (_config.show) {
|
||||
data.show(relatedTarget);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Modal.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$5);
|
||||
};
|
||||
|
||||
_createClass(Modal, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$5;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$3;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$5;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Modal;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -5710,7 +5722,7 @@
|
||||
|
||||
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
|
||||
var _this11 = this;
|
||||
var _this12 = this;
|
||||
|
||||
var target = getElementFromSelector(this);
|
||||
|
||||
@ -5725,8 +5737,8 @@
|
||||
}
|
||||
|
||||
EventHandler.one(target, EVENT_HIDDEN$2, function () {
|
||||
if (isVisible(_this11)) {
|
||||
_this11.focus();
|
||||
if (isVisible(_this12)) {
|
||||
_this12.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -5897,7 +5909,6 @@
|
||||
*/
|
||||
|
||||
var NAME$6 = 'tooltip';
|
||||
var VERSION$6 = '5.0.0-alpha3';
|
||||
var DATA_KEY$6 = 'bs.tooltip';
|
||||
var EVENT_KEY$6 = "." + DATA_KEY$6;
|
||||
var CLASS_PREFIX = 'bs-tooltip';
|
||||
@ -5916,6 +5927,7 @@
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
allowList: 'object',
|
||||
@ -5930,7 +5942,7 @@
|
||||
};
|
||||
var Default$4 = {
|
||||
animation: true,
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
|
||||
trigger: 'hover focus',
|
||||
title: '',
|
||||
delay: 0,
|
||||
@ -5941,6 +5953,7 @@
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
allowList: DefaultAllowlist,
|
||||
@ -5974,26 +5987,30 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tooltip = /*#__PURE__*/function () {
|
||||
var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tooltip, _BaseComponent);
|
||||
|
||||
function Tooltip(element, config) {
|
||||
var _this;
|
||||
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
||||
} // private
|
||||
}
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this; // private
|
||||
|
||||
this._isEnabled = true;
|
||||
this._timeout = 0;
|
||||
this._hoverState = '';
|
||||
this._activeTrigger = {};
|
||||
this._popper = null; // Protected
|
||||
_this._isEnabled = true;
|
||||
_this._timeout = 0;
|
||||
_this._hoverState = '';
|
||||
_this._activeTrigger = {};
|
||||
_this._popper = null; // Protected
|
||||
|
||||
this.element = element;
|
||||
this.config = this._getConfig(config);
|
||||
this.tip = null;
|
||||
_this.config = _this._getConfig(config);
|
||||
_this.tip = null;
|
||||
|
||||
this._setListeners();
|
||||
_this._setListeners();
|
||||
|
||||
Data.setData(element, this.constructor.DATA_KEY, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -6046,9 +6063,8 @@
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
clearTimeout(this._timeout);
|
||||
Data.removeData(this.element, this.constructor.DATA_KEY);
|
||||
EventHandler.off(this.element, this.constructor.EVENT_KEY);
|
||||
EventHandler.off(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
||||
EventHandler.off(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.tip) {
|
||||
this.tip.parentNode.removeChild(this.tip);
|
||||
@ -6064,22 +6080,23 @@
|
||||
}
|
||||
|
||||
this._popper = null;
|
||||
this.element = null;
|
||||
this.config = null;
|
||||
this.tip = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this.element.style.display === 'none') {
|
||||
if (this._element.style.display === 'none') {
|
||||
throw new Error('Please use show on visible elements');
|
||||
}
|
||||
|
||||
if (this.isWithContent() && this._isEnabled) {
|
||||
var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this.element);
|
||||
var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
|
||||
var showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this._element);
|
||||
var isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
|
||||
|
||||
if (showEvent.defaultPrevented || !isInTheDom) {
|
||||
return;
|
||||
@ -6088,14 +6105,16 @@
|
||||
var tip = this.getTipElement();
|
||||
var tipId = getUID(this.constructor.NAME);
|
||||
tip.setAttribute('id', tipId);
|
||||
this.element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this._element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this.setContent();
|
||||
|
||||
if (this.config.animation) {
|
||||
tip.classList.add(CLASS_NAME_FADE$1);
|
||||
}
|
||||
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
|
||||
|
||||
var attachment = this._getAttachment(placement);
|
||||
|
||||
@ -6105,17 +6124,25 @@
|
||||
|
||||
Data.setData(tip, this.constructor.DATA_KEY, this);
|
||||
|
||||
if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
container.appendChild(tip);
|
||||
}
|
||||
|
||||
EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we add extra
|
||||
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
if (customClass) {
|
||||
var _tip$classList;
|
||||
|
||||
(_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
var _ref;
|
||||
|
||||
@ -6125,16 +6152,16 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this.config.animation) {
|
||||
_this._fixTransition();
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this._hoverState;
|
||||
_this._hoverState = null;
|
||||
EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler.trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
|
||||
if (prevHoverState === HOVER_STATE_OUT) {
|
||||
_this._leave(null, _this);
|
||||
_this2._leave(null, _this2);
|
||||
}
|
||||
};
|
||||
|
||||
@ -6149,7 +6176,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._popper) {
|
||||
return;
|
||||
@ -6158,20 +6185,20 @@
|
||||
var tip = this.getTipElement();
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
tip.parentNode.removeChild(tip);
|
||||
}
|
||||
|
||||
_this2._cleanTipClass();
|
||||
_this3._cleanTipClass();
|
||||
|
||||
_this2.element.removeAttribute('aria-describedby');
|
||||
_this3._element.removeAttribute('aria-describedby');
|
||||
|
||||
EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
|
||||
EventHandler.trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this2._popper.destroy();
|
||||
_this3._popper.destroy();
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
|
||||
var hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
||||
|
||||
if (hideEvent.defaultPrevented) {
|
||||
return;
|
||||
@ -6266,10 +6293,10 @@
|
||||
};
|
||||
|
||||
_proto.getTitle = function getTitle() {
|
||||
var title = this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (!title) {
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
|
||||
}
|
||||
|
||||
return title;
|
||||
@ -6277,7 +6304,7 @@
|
||||
;
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
@ -6295,11 +6322,11 @@
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
_this3._handlePopperPlacementChange(data);
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -6310,13 +6337,13 @@
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -6343,33 +6370,33 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
EventHandler.on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
});
|
||||
EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
EventHandler.on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this5.element) {
|
||||
_this5.hide();
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
}
|
||||
};
|
||||
|
||||
EventHandler.on(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler.on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = _extends({}, this.config, {
|
||||
@ -6382,12 +6409,18 @@
|
||||
};
|
||||
|
||||
_proto._fixTitle = function _fixTitle() {
|
||||
var title = this.element.getAttribute('title');
|
||||
var originalTitleType = typeof this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('title');
|
||||
|
||||
var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (title || originalTitleType !== 'string') {
|
||||
this.element.setAttribute('data-bs-original-title', title || '');
|
||||
this.element.setAttribute('title', '');
|
||||
this._element.setAttribute('data-bs-original-title', title || '');
|
||||
|
||||
if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
|
||||
this._element.setAttribute('aria-label', title);
|
||||
}
|
||||
|
||||
this._element.setAttribute('title', '');
|
||||
}
|
||||
};
|
||||
|
||||
@ -6467,7 +6500,7 @@
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
var dataAttributes = Manipulator.getDataAttributes(this.element);
|
||||
var dataAttributes = Manipulator.getDataAttributes(this._element);
|
||||
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
||||
if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
|
||||
delete dataAttributes[dataAttr];
|
||||
@ -6579,16 +6612,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
Tooltip.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$6);
|
||||
};
|
||||
|
||||
_createClass(Tooltip, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$6;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$4;
|
||||
@ -6621,7 +6645,7 @@
|
||||
}]);
|
||||
|
||||
return Tooltip;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
@ -6653,7 +6677,6 @@
|
||||
*/
|
||||
|
||||
var NAME$7 = 'popover';
|
||||
var VERSION$7 = '5.0.0-alpha3';
|
||||
var DATA_KEY$7 = 'bs.popover';
|
||||
var EVENT_KEY$7 = "." + DATA_KEY$7;
|
||||
var CLASS_PREFIX$1 = 'bs-popover';
|
||||
@ -6663,7 +6686,7 @@
|
||||
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>'
|
||||
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 = _extends({}, Tooltip.DefaultType, {
|
||||
@ -6714,7 +6737,7 @@
|
||||
var content = this._getContent();
|
||||
|
||||
if (typeof content === 'function') {
|
||||
content = content.call(this.element);
|
||||
content = content.call(this._element);
|
||||
}
|
||||
|
||||
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
||||
@ -6727,7 +6750,7 @@
|
||||
};
|
||||
|
||||
_proto._getContent = function _getContent() {
|
||||
return this.element.getAttribute('data-bs-content') || this.config.content;
|
||||
return this._element.getAttribute('data-bs-content') || this.config.content;
|
||||
};
|
||||
|
||||
_proto._cleanTipClass = function _cleanTipClass() {
|
||||
@ -6769,18 +6792,9 @@
|
||||
});
|
||||
};
|
||||
|
||||
Popover.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$7);
|
||||
};
|
||||
|
||||
_createClass(Popover, null, [{
|
||||
key: "VERSION",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$7;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return Default$5;
|
||||
}
|
||||
@ -6844,7 +6858,6 @@
|
||||
*/
|
||||
|
||||
var NAME$8 = 'scrollspy';
|
||||
var VERSION$8 = '5.0.0-alpha3';
|
||||
var DATA_KEY$8 = 'bs.scrollspy';
|
||||
var EVENT_KEY$8 = "." + DATA_KEY$8;
|
||||
var DATA_API_KEY$6 = '.data-api';
|
||||
@ -6878,26 +6891,29 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var ScrollSpy = /*#__PURE__*/function () {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this = this;
|
||||
var ScrollSpy = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(ScrollSpy, _BaseComponent);
|
||||
|
||||
this._element = element;
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
this._config = this._getConfig(config);
|
||||
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + ", " + this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
this._offsets = [];
|
||||
this._targets = [];
|
||||
this._activeTarget = null;
|
||||
this._scrollHeight = 0;
|
||||
EventHandler.on(this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._selector = _this._config.target + " " + SELECTOR_NAV_LINKS + ", " + _this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + _this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
_this._offsets = [];
|
||||
_this._targets = [];
|
||||
_this._activeTarget = null;
|
||||
_this._scrollHeight = 0;
|
||||
EventHandler.on(_this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
return _this._process(event);
|
||||
});
|
||||
this.refresh();
|
||||
|
||||
this._process();
|
||||
_this.refresh();
|
||||
|
||||
Data.setData(element, DATA_KEY$8, this);
|
||||
_this._process();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -6939,9 +6955,9 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$8);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._scrollElement, EVENT_KEY$8);
|
||||
this._element = null;
|
||||
this._scrollElement = null;
|
||||
this._config = null;
|
||||
this._selector = null;
|
||||
@ -7086,24 +7102,20 @@
|
||||
});
|
||||
};
|
||||
|
||||
ScrollSpy.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$8);
|
||||
};
|
||||
|
||||
_createClass(ScrollSpy, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$8;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$6;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$8;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ScrollSpy;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -7146,7 +7158,6 @@
|
||||
*/
|
||||
|
||||
var NAME$9 = 'tab';
|
||||
var VERSION$9 = '5.0.0-alpha3';
|
||||
var DATA_KEY$9 = 'bs.tab';
|
||||
var EVENT_KEY$9 = "." + DATA_KEY$9;
|
||||
var DATA_API_KEY$7 = '.data-api';
|
||||
@ -7173,12 +7184,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tab = /*#__PURE__*/function () {
|
||||
function Tab(element) {
|
||||
this._element = element;
|
||||
Data.setData(this._element, DATA_KEY$9, this);
|
||||
} // Getters
|
||||
var Tab = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tab, _BaseComponent);
|
||||
|
||||
function Tab() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Tab.prototype;
|
||||
|
||||
@ -7233,11 +7244,6 @@
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$9);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -7320,19 +7326,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
Tab.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$9);
|
||||
};
|
||||
|
||||
_createClass(Tab, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$9;
|
||||
return DATA_KEY$9;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Tab;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -7375,7 +7378,6 @@
|
||||
*/
|
||||
|
||||
var NAME$a = 'toast';
|
||||
var VERSION$a = '5.0.0-alpha3';
|
||||
var DATA_KEY$a = 'bs.toast';
|
||||
var EVENT_KEY$a = "." + DATA_KEY$a;
|
||||
var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
|
||||
@ -7404,15 +7406,19 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Toast = /*#__PURE__*/function () {
|
||||
var Toast = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Toast, _BaseComponent);
|
||||
|
||||
function Toast(element, config) {
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._timeout = null;
|
||||
var _this;
|
||||
|
||||
this._setListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._timeout = null;
|
||||
|
||||
Data.setData(element, DATA_KEY$a, this);
|
||||
_this._setListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -7420,7 +7426,7 @@
|
||||
|
||||
// Public
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4);
|
||||
|
||||
@ -7435,16 +7441,16 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
_this2._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_SHOW$6);
|
||||
_this2._element.classList.add(CLASS_NAME_SHOW$6);
|
||||
|
||||
EventHandler.trigger(_this._element, EVENT_SHOWN$4);
|
||||
EventHandler.trigger(_this2._element, EVENT_SHOWN$4);
|
||||
|
||||
if (_this._config.autohide) {
|
||||
_this._timeout = setTimeout(function () {
|
||||
_this.hide();
|
||||
}, _this._config.delay);
|
||||
if (_this2._config.autohide) {
|
||||
_this2._timeout = setTimeout(function () {
|
||||
_this2.hide();
|
||||
}, _this2._config.delay);
|
||||
}
|
||||
};
|
||||
|
||||
@ -7464,7 +7470,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._element.classList.contains(CLASS_NAME_SHOW$6)) {
|
||||
return;
|
||||
@ -7477,9 +7483,9 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this2._element.classList.add(CLASS_NAME_HIDE);
|
||||
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||
|
||||
EventHandler.trigger(_this2._element, EVENT_HIDDEN$4);
|
||||
EventHandler.trigger(_this3._element, EVENT_HIDDEN$4);
|
||||
};
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
||||
@ -7501,8 +7507,9 @@
|
||||
}
|
||||
|
||||
EventHandler.off(this._element, EVENT_CLICK_DISMISS$1);
|
||||
Data.removeData(this._element, DATA_KEY$a);
|
||||
this._element = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
} // Private
|
||||
;
|
||||
@ -7514,10 +7521,10 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
|
||||
return _this3.hide();
|
||||
return _this4.hide();
|
||||
});
|
||||
};
|
||||
|
||||
@ -7547,16 +7554,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
Toast.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$a);
|
||||
};
|
||||
|
||||
_createClass(Toast, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$a;
|
||||
}
|
||||
}, {
|
||||
key: "DefaultType",
|
||||
get: function get() {
|
||||
return DefaultType$7;
|
||||
@ -7566,10 +7564,15 @@
|
||||
get: function get() {
|
||||
return Default$7;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$a;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Toast;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
|
2
dist/js/bootstrap.bundle.js.map
vendored
2
dist/js/bootstrap.bundle.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.bundle.min.js
vendored
2
dist/js/bootstrap.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.bundle.min.js.map
vendored
2
dist/js/bootstrap.bundle.min.js.map
vendored
File diff suppressed because one or more lines are too long
817
dist/js/bootstrap.esm.js
vendored
817
dist/js/bootstrap.esm.js
vendored
@ -576,8 +576,48 @@ var EventHandler = {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data.setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var DATA_KEY = 'bs.alert';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -594,15 +634,12 @@ var CLASSNAME_SHOW = 'show';
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Alert = /*#__PURE__*/function () {
|
||||
function Alert(element) {
|
||||
this._element = element;
|
||||
|
||||
if (this._element) {
|
||||
Data.setData(element, DATA_KEY, this);
|
||||
}
|
||||
} // Getters
|
||||
var Alert = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Alert, _BaseComponent);
|
||||
|
||||
function Alert() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Alert.prototype;
|
||||
|
||||
@ -617,11 +654,6 @@ var Alert = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
this._removeElement(rootElement);
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -684,19 +716,16 @@ var Alert = /*#__PURE__*/function () {
|
||||
};
|
||||
};
|
||||
|
||||
Alert.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Alert, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Alert;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -735,7 +764,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$1 = 'button';
|
||||
var VERSION$1 = '5.0.0-alpha3';
|
||||
var DATA_KEY$1 = 'bs.button';
|
||||
var EVENT_KEY$1 = "." + DATA_KEY$1;
|
||||
var DATA_API_KEY$1 = '.data-api';
|
||||
@ -748,12 +776,12 @@ var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Button = /*#__PURE__*/function () {
|
||||
function Button(element) {
|
||||
this._element = element;
|
||||
Data.setData(element, DATA_KEY$1, this);
|
||||
} // Getters
|
||||
var Button = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Button, _BaseComponent);
|
||||
|
||||
function Button() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Button.prototype;
|
||||
|
||||
@ -761,11 +789,6 @@ var Button = /*#__PURE__*/function () {
|
||||
_proto.toggle = function toggle() {
|
||||
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
||||
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$1);
|
||||
this._element = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
@ -783,19 +806,16 @@ var Button = /*#__PURE__*/function () {
|
||||
});
|
||||
};
|
||||
|
||||
Button.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$1);
|
||||
};
|
||||
|
||||
_createClass(Button, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$1;
|
||||
return DATA_KEY$1;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Button;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -1000,7 +1020,6 @@ var SelectorEngine = {
|
||||
*/
|
||||
|
||||
var NAME$2 = 'carousel';
|
||||
var VERSION$2 = '5.0.0-alpha3';
|
||||
var DATA_KEY$2 = 'bs.carousel';
|
||||
var EVENT_KEY$2 = "." + DATA_KEY$2;
|
||||
var DATA_API_KEY$2 = '.data-api';
|
||||
@ -1068,25 +1087,29 @@ var PointerType = {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Carousel = /*#__PURE__*/function () {
|
||||
var Carousel = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Carousel, _BaseComponent);
|
||||
|
||||
function Carousel(element, config) {
|
||||
this._items = null;
|
||||
this._interval = null;
|
||||
this._activeElement = null;
|
||||
this._isPaused = false;
|
||||
this._isSliding = false;
|
||||
this.touchTimeout = null;
|
||||
this.touchStartX = 0;
|
||||
this.touchDeltaX = 0;
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
this._pointerEvent = Boolean(window.PointerEvent);
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._items = null;
|
||||
_this._interval = null;
|
||||
_this._activeElement = null;
|
||||
_this._isPaused = false;
|
||||
_this._isSliding = false;
|
||||
_this.touchTimeout = null;
|
||||
_this.touchStartX = 0;
|
||||
_this.touchDeltaX = 0;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, _this._element);
|
||||
_this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
_this._pointerEvent = Boolean(window.PointerEvent);
|
||||
|
||||
Data.setData(element, DATA_KEY$2, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -1145,7 +1168,7 @@ var Carousel = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.to = function to(index) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -1157,7 +1180,7 @@ var Carousel = /*#__PURE__*/function () {
|
||||
|
||||
if (this._isSliding) {
|
||||
EventHandler.one(this._element, EVENT_SLID, function () {
|
||||
return _this.to(index);
|
||||
return _this2.to(index);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -1174,11 +1197,11 @@ var Carousel = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._element, EVENT_KEY$2);
|
||||
Data.removeData(this._element, DATA_KEY$2);
|
||||
this._items = null;
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._interval = null;
|
||||
this._isPaused = null;
|
||||
this._isSliding = null;
|
||||
@ -1214,20 +1237,20 @@ var Carousel = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._config.keyboard) {
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN, function (event) {
|
||||
return _this2._keydown(event);
|
||||
return _this3._keydown(event);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
EventHandler.on(this._element, EVENT_MOUSEENTER, function (event) {
|
||||
return _this2.pause(event);
|
||||
return _this3.pause(event);
|
||||
});
|
||||
EventHandler.on(this._element, EVENT_MOUSELEAVE, function (event) {
|
||||
return _this2.cycle(event);
|
||||
return _this3.cycle(event);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1237,33 +1260,33 @@ var Carousel = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._addTouchEventListeners = function _addTouchEventListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var start = function start(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchStartX = event.clientX;
|
||||
} else if (!_this3._pointerEvent) {
|
||||
_this3.touchStartX = event.touches[0].clientX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchStartX = event.clientX;
|
||||
} else if (!_this4._pointerEvent) {
|
||||
_this4.touchStartX = event.touches[0].clientX;
|
||||
}
|
||||
};
|
||||
|
||||
var move = function move(event) {
|
||||
// ensure swiping with one touch and not pinching
|
||||
if (event.touches && event.touches.length > 1) {
|
||||
_this3.touchDeltaX = 0;
|
||||
_this4.touchDeltaX = 0;
|
||||
} else {
|
||||
_this3.touchDeltaX = event.touches[0].clientX - _this3.touchStartX;
|
||||
_this4.touchDeltaX = event.touches[0].clientX - _this4.touchStartX;
|
||||
}
|
||||
};
|
||||
|
||||
var end = function end(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchDeltaX = event.clientX - _this3.touchStartX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchDeltaX = event.clientX - _this4.touchStartX;
|
||||
}
|
||||
|
||||
_this3._handleSwipe();
|
||||
_this4._handleSwipe();
|
||||
|
||||
if (_this3._config.pause === 'hover') {
|
||||
if (_this4._config.pause === 'hover') {
|
||||
// If it's a touch-enabled device, mouseenter/leave are fired as
|
||||
// part of the mouse compatibility events on first tap - the carousel
|
||||
// would stop cycling until user tapped out of it;
|
||||
@ -1271,15 +1294,15 @@ var Carousel = /*#__PURE__*/function () {
|
||||
// (as if it's the second time we tap on it, mouseenter compat event
|
||||
// is NOT fired) and after a timeout (to allow for mouse compatibility
|
||||
// events to fire) we explicitly restart cycling
|
||||
_this3.pause();
|
||||
_this4.pause();
|
||||
|
||||
if (_this3.touchTimeout) {
|
||||
clearTimeout(_this3.touchTimeout);
|
||||
if (_this4.touchTimeout) {
|
||||
clearTimeout(_this4.touchTimeout);
|
||||
}
|
||||
|
||||
_this3.touchTimeout = setTimeout(function (event) {
|
||||
return _this3.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
|
||||
_this4.touchTimeout = setTimeout(function (event) {
|
||||
return _this4.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this4._config.interval);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1399,7 +1422,7 @@ var Carousel = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._slide = function _slide(direction, element) {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -1460,9 +1483,9 @@ var Carousel = /*#__PURE__*/function () {
|
||||
nextElement.classList.remove(directionalClassName, orderClassName);
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE$1);
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE$1, orderClassName, directionalClassName);
|
||||
_this4._isSliding = false;
|
||||
_this5._isSliding = false;
|
||||
setTimeout(function () {
|
||||
EventHandler.trigger(_this4._element, EVENT_SLID, {
|
||||
EventHandler.trigger(_this5._element, EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
@ -1548,24 +1571,20 @@ var Carousel = /*#__PURE__*/function () {
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
Carousel.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$2);
|
||||
};
|
||||
|
||||
_createClass(Carousel, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$2;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$2;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Carousel;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -1611,7 +1630,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$3 = 'collapse';
|
||||
var VERSION$3 = '5.0.0-alpha3';
|
||||
var DATA_KEY$3 = 'bs.collapse';
|
||||
var EVENT_KEY$3 = "." + DATA_KEY$3;
|
||||
var DATA_API_KEY$3 = '.data-api';
|
||||
@ -1642,12 +1660,16 @@ var SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="collapse"]';
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Collapse = /*#__PURE__*/function () {
|
||||
var Collapse = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Collapse, _BaseComponent);
|
||||
|
||||
function Collapse(element, config) {
|
||||
this._isTransitioning = false;
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._isTransitioning = false;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1);
|
||||
|
||||
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||
@ -1658,23 +1680,23 @@ var Collapse = /*#__PURE__*/function () {
|
||||
});
|
||||
|
||||
if (selector !== null && filterElement.length) {
|
||||
this._selector = selector;
|
||||
_this._selector = selector;
|
||||
|
||||
this._triggerArray.push(elem);
|
||||
_this._triggerArray.push(elem);
|
||||
}
|
||||
}
|
||||
|
||||
this._parent = this._config.parent ? this._getParent() : null;
|
||||
_this._parent = _this._config.parent ? _this._getParent() : null;
|
||||
|
||||
if (!this._config.parent) {
|
||||
this._addAriaAndCollapsedClass(this._element, this._triggerArray);
|
||||
if (!_this._config.parent) {
|
||||
_this._addAriaAndCollapsedClass(_this._element, _this._triggerArray);
|
||||
}
|
||||
|
||||
if (this._config.toggle) {
|
||||
this.toggle();
|
||||
if (_this._config.toggle) {
|
||||
_this.toggle();
|
||||
}
|
||||
|
||||
Data.setData(element, DATA_KEY$3, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -1690,7 +1712,7 @@ var Collapse = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -1701,8 +1723,8 @@ var Collapse = /*#__PURE__*/function () {
|
||||
|
||||
if (this._parent) {
|
||||
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(function (elem) {
|
||||
if (typeof _this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this._config.parent;
|
||||
if (typeof _this2._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this2._config.parent;
|
||||
}
|
||||
|
||||
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
||||
@ -1762,15 +1784,15 @@ var Collapse = /*#__PURE__*/function () {
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
_this._element.style[dimension] = '';
|
||||
_this2._element.style[dimension] = '';
|
||||
|
||||
_this.setTransitioning(false);
|
||||
_this2.setTransitioning(false);
|
||||
|
||||
EventHandler.trigger(_this._element, EVENT_SHOWN);
|
||||
EventHandler.trigger(_this2._element, EVENT_SHOWN);
|
||||
};
|
||||
|
||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
@ -1782,7 +1804,7 @@ var Collapse = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -1820,13 +1842,13 @@ var Collapse = /*#__PURE__*/function () {
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this2.setTransitioning(false);
|
||||
_this3.setTransitioning(false);
|
||||
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this3._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
_this3._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
|
||||
EventHandler.trigger(_this2._element, EVENT_HIDDEN);
|
||||
EventHandler.trigger(_this3._element, EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
@ -1840,10 +1862,10 @@ var Collapse = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$3);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
this._parent = null;
|
||||
this._element = null;
|
||||
this._triggerArray = null;
|
||||
this._isTransitioning = null;
|
||||
} // Private
|
||||
@ -1862,7 +1884,7 @@ var Collapse = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._getParent = function _getParent() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var parent = this._config.parent;
|
||||
|
||||
@ -1879,7 +1901,7 @@ var Collapse = /*#__PURE__*/function () {
|
||||
SelectorEngine.find(selector, parent).forEach(function (element) {
|
||||
var selected = getElementFromSelector(element);
|
||||
|
||||
_this3._addAriaAndCollapsedClass(selected, [element]);
|
||||
_this4._addAriaAndCollapsedClass(selected, [element]);
|
||||
});
|
||||
return parent;
|
||||
};
|
||||
@ -1930,24 +1952,20 @@ var Collapse = /*#__PURE__*/function () {
|
||||
});
|
||||
};
|
||||
|
||||
Collapse.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$3);
|
||||
};
|
||||
|
||||
_createClass(Collapse, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$3;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$1;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$3;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Collapse;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -2013,7 +2031,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$4 = 'dropdown';
|
||||
var VERSION$4 = '5.0.0-alpha3';
|
||||
var DATA_KEY$4 = 'bs.dropdown';
|
||||
var EVENT_KEY$4 = "." + DATA_KEY$4;
|
||||
var DATA_API_KEY$4 = '.data-api';
|
||||
@ -2074,17 +2091,21 @@ var DefaultType$2 = {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Dropdown = /*#__PURE__*/function () {
|
||||
var Dropdown = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Dropdown, _BaseComponent);
|
||||
|
||||
function Dropdown(element, config) {
|
||||
this._element = element;
|
||||
this._popper = null;
|
||||
this._config = this._getConfig(config);
|
||||
this._menu = this._getMenuElement();
|
||||
this._inNavbar = this._detectNavbar();
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._popper = null;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._menu = _this._getMenuElement();
|
||||
_this._inNavbar = _this._detectNavbar();
|
||||
|
||||
Data.setData(element, DATA_KEY$4, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -2200,9 +2221,9 @@ var Dropdown = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$4);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._element, EVENT_KEY$4);
|
||||
this._element = null;
|
||||
this._menu = null;
|
||||
|
||||
if (this._popper) {
|
||||
@ -2222,13 +2243,13 @@ var Dropdown = /*#__PURE__*/function () {
|
||||
;
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
_this.toggle();
|
||||
_this2.toggle();
|
||||
});
|
||||
};
|
||||
|
||||
@ -2264,13 +2285,13 @@ var Dropdown = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -2432,15 +2453,14 @@ var Dropdown = /*#__PURE__*/function () {
|
||||
return;
|
||||
}
|
||||
|
||||
var index = items.indexOf(event.target);
|
||||
var index = items.indexOf(event.target); // Up
|
||||
|
||||
if (event.key === ARROW_UP_KEY && index > 0) {
|
||||
// Up
|
||||
index--;
|
||||
}
|
||||
} // Down
|
||||
|
||||
|
||||
if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
|
||||
// Down
|
||||
index++;
|
||||
} // index is -1 if the first keydown is an ArrowUp
|
||||
|
||||
@ -2449,16 +2469,7 @@ var Dropdown = /*#__PURE__*/function () {
|
||||
items[index].focus();
|
||||
};
|
||||
|
||||
Dropdown.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$4);
|
||||
};
|
||||
|
||||
_createClass(Dropdown, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$4;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$2;
|
||||
@ -2468,10 +2479,15 @@ var Dropdown = /*#__PURE__*/function () {
|
||||
get: function get() {
|
||||
return DefaultType$2;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$4;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Dropdown;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -2521,7 +2537,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$5 = 'modal';
|
||||
var VERSION$5 = '5.0.0-alpha3';
|
||||
var DATA_KEY$5 = 'bs.modal';
|
||||
var EVENT_KEY$5 = "." + DATA_KEY$5;
|
||||
var DATA_API_KEY$5 = '.data-api';
|
||||
@ -2529,14 +2544,12 @@ var ESCAPE_KEY$1 = 'Escape';
|
||||
var Default$3 = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: true
|
||||
focus: true
|
||||
};
|
||||
var DefaultType$3 = {
|
||||
backdrop: '(boolean|string)',
|
||||
keyboard: 'boolean',
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
focus: 'boolean'
|
||||
};
|
||||
var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
|
||||
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
|
||||
@ -2568,18 +2581,22 @@ var SELECTOR_STICKY_CONTENT = '.sticky-top';
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Modal = /*#__PURE__*/function () {
|
||||
var Modal = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Modal, _BaseComponent);
|
||||
|
||||
function Modal(element, config) {
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
|
||||
this._backdrop = null;
|
||||
this._isShown = false;
|
||||
this._isBodyOverflowing = false;
|
||||
this._ignoreBackdropClick = false;
|
||||
this._isTransitioning = false;
|
||||
this._scrollbarWidth = 0;
|
||||
Data.setData(element, DATA_KEY$5, this);
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
|
||||
_this._backdrop = null;
|
||||
_this._isShown = false;
|
||||
_this._isBodyOverflowing = false;
|
||||
_this._ignoreBackdropClick = false;
|
||||
_this._isTransitioning = false;
|
||||
_this._scrollbarWidth = 0;
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -2591,7 +2608,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.show = function show(relatedTarget) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isShown || this._isTransitioning) {
|
||||
return;
|
||||
@ -2622,23 +2639,23 @@ var Modal = /*#__PURE__*/function () {
|
||||
this._setResizeEvent();
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
|
||||
return _this.hide(event);
|
||||
return _this2.hide(event);
|
||||
});
|
||||
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
|
||||
EventHandler.one(_this._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this._element) {
|
||||
_this._ignoreBackdropClick = true;
|
||||
EventHandler.one(_this2._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this2._element) {
|
||||
_this2._ignoreBackdropClick = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this._showBackdrop(function () {
|
||||
return _this._showElement(relatedTarget);
|
||||
return _this2._showElement(relatedTarget);
|
||||
});
|
||||
};
|
||||
|
||||
_proto.hide = function hide(event) {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
@ -2676,7 +2693,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
if (transition) {
|
||||
var transitionDuration = getTransitionDurationFromElement(this._element);
|
||||
EventHandler.one(this._element, TRANSITION_END, function (event) {
|
||||
return _this2._hideModal(event);
|
||||
return _this3._hideModal(event);
|
||||
});
|
||||
emulateTransitionEnd(this._element, transitionDuration);
|
||||
} else {
|
||||
@ -2688,16 +2705,17 @@ var Modal = /*#__PURE__*/function () {
|
||||
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
||||
return EventHandler.off(htmlElement, EVENT_KEY$5);
|
||||
});
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
/**
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
* Do not move `document` in `htmlElements` array
|
||||
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
|
||||
|
||||
EventHandler.off(document, EVENT_FOCUSIN);
|
||||
Data.removeData(this._element, DATA_KEY$5);
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._dialog = null;
|
||||
this._backdrop = null;
|
||||
this._isShown = null;
|
||||
@ -2719,7 +2737,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._showElement = function _showElement(relatedTarget) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var transition = this._element.classList.contains(CLASS_NAME_FADE);
|
||||
|
||||
@ -2755,12 +2773,12 @@ var Modal = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
var transitionComplete = function transitionComplete() {
|
||||
if (_this3._config.focus) {
|
||||
_this3._element.focus();
|
||||
if (_this4._config.focus) {
|
||||
_this4._element.focus();
|
||||
}
|
||||
|
||||
_this3._isTransitioning = false;
|
||||
EventHandler.trigger(_this3._element, EVENT_SHOWN$2, {
|
||||
_this4._isTransitioning = false;
|
||||
EventHandler.trigger(_this4._element, EVENT_SHOWN$2, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
};
|
||||
@ -2775,28 +2793,28 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._enforceFocus = function _enforceFocus() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
|
||||
|
||||
EventHandler.on(document, EVENT_FOCUSIN, function (event) {
|
||||
if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
|
||||
_this4._element.focus();
|
||||
if (document !== event.target && _this5._element !== event.target && !_this5._element.contains(event.target)) {
|
||||
_this5._element.focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_proto._setEscapeEvent = function _setEscapeEvent() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
|
||||
if (_this5._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
if (_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
event.preventDefault();
|
||||
|
||||
_this5.hide();
|
||||
} else if (!_this5._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
_this5._triggerBackdropTransition();
|
||||
_this6.hide();
|
||||
} else if (!_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
_this6._triggerBackdropTransition();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -2805,11 +2823,11 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._setResizeEvent = function _setResizeEvent() {
|
||||
var _this6 = this;
|
||||
var _this7 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler.on(window, EVENT_RESIZE, function () {
|
||||
return _this6._adjustDialog();
|
||||
return _this7._adjustDialog();
|
||||
});
|
||||
} else {
|
||||
EventHandler.off(window, EVENT_RESIZE);
|
||||
@ -2817,7 +2835,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._hideModal = function _hideModal() {
|
||||
var _this7 = this;
|
||||
var _this8 = this;
|
||||
|
||||
this._element.style.display = 'none';
|
||||
|
||||
@ -2832,11 +2850,11 @@ var Modal = /*#__PURE__*/function () {
|
||||
this._showBackdrop(function () {
|
||||
document.body.classList.remove(CLASS_NAME_OPEN);
|
||||
|
||||
_this7._resetAdjustments();
|
||||
_this8._resetAdjustments();
|
||||
|
||||
_this7._resetScrollbar();
|
||||
_this8._resetScrollbar();
|
||||
|
||||
EventHandler.trigger(_this7._element, EVENT_HIDDEN$2);
|
||||
EventHandler.trigger(_this8._element, EVENT_HIDDEN$2);
|
||||
});
|
||||
};
|
||||
|
||||
@ -2847,7 +2865,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||
var _this8 = this;
|
||||
var _this9 = this;
|
||||
|
||||
var animate = this._element.classList.contains(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||
|
||||
@ -2861,8 +2879,8 @@ var Modal = /*#__PURE__*/function () {
|
||||
|
||||
document.body.appendChild(this._backdrop);
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, function (event) {
|
||||
if (_this8._ignoreBackdropClick) {
|
||||
_this8._ignoreBackdropClick = false;
|
||||
if (_this9._ignoreBackdropClick) {
|
||||
_this9._ignoreBackdropClick = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2870,10 +2888,10 @@ var Modal = /*#__PURE__*/function () {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_this8._config.backdrop === 'static') {
|
||||
_this8._triggerBackdropTransition();
|
||||
if (_this9._config.backdrop === 'static') {
|
||||
_this9._triggerBackdropTransition();
|
||||
} else {
|
||||
_this8.hide();
|
||||
_this9.hide();
|
||||
}
|
||||
});
|
||||
|
||||
@ -2895,7 +2913,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
this._backdrop.classList.remove(CLASS_NAME_SHOW$2);
|
||||
|
||||
var callbackRemove = function callbackRemove() {
|
||||
_this8._removeBackdrop();
|
||||
_this9._removeBackdrop();
|
||||
|
||||
callback();
|
||||
};
|
||||
@ -2914,7 +2932,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._triggerBackdropTransition = function _triggerBackdropTransition() {
|
||||
var _this9 = this;
|
||||
var _this10 = this;
|
||||
|
||||
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
|
||||
@ -2933,13 +2951,13 @@ var Modal = /*#__PURE__*/function () {
|
||||
var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
|
||||
EventHandler.off(this._element, TRANSITION_END);
|
||||
EventHandler.one(this._element, TRANSITION_END, function () {
|
||||
_this9._element.classList.remove(CLASS_NAME_STATIC);
|
||||
_this10._element.classList.remove(CLASS_NAME_STATIC);
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
EventHandler.one(_this9._element, TRANSITION_END, function () {
|
||||
_this9._element.style.overflowY = '';
|
||||
EventHandler.one(_this10._element, TRANSITION_END, function () {
|
||||
_this10._element.style.overflowY = '';
|
||||
});
|
||||
emulateTransitionEnd(_this9._element, modalTransitionDuration);
|
||||
emulateTransitionEnd(_this10._element, modalTransitionDuration);
|
||||
}
|
||||
});
|
||||
emulateTransitionEnd(this._element, modalTransitionDuration);
|
||||
@ -2974,7 +2992,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._setScrollbar = function _setScrollbar() {
|
||||
var _this10 = this;
|
||||
var _this11 = this;
|
||||
|
||||
if (this._isBodyOverflowing) {
|
||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||
@ -2984,14 +3002,14 @@ var Modal = /*#__PURE__*/function () {
|
||||
var actualPadding = element.style.paddingRight;
|
||||
var calculatedPadding = window.getComputedStyle(element)['padding-right'];
|
||||
Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px";
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this11._scrollbarWidth + "px";
|
||||
}); // Adjust sticky content margin
|
||||
|
||||
SelectorEngine.find(SELECTOR_STICKY_CONTENT).forEach(function (element) {
|
||||
var actualMargin = element.style.marginRight;
|
||||
var calculatedMargin = window.getComputedStyle(element)['margin-right'];
|
||||
Manipulator.setDataAttribute(element, 'margin-right', actualMargin);
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px";
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this11._scrollbarWidth + "px";
|
||||
}); // Adjust body padding
|
||||
|
||||
var actualPadding = document.body.style.paddingRight;
|
||||
@ -3060,30 +3078,24 @@ var Modal = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
data[config](relatedTarget);
|
||||
} else if (_config.show) {
|
||||
data.show(relatedTarget);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Modal.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$5);
|
||||
};
|
||||
|
||||
_createClass(Modal, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$5;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$3;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$5;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Modal;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -3092,7 +3104,7 @@ var Modal = /*#__PURE__*/function () {
|
||||
|
||||
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
|
||||
var _this11 = this;
|
||||
var _this12 = this;
|
||||
|
||||
var target = getElementFromSelector(this);
|
||||
|
||||
@ -3107,8 +3119,8 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, functi
|
||||
}
|
||||
|
||||
EventHandler.one(target, EVENT_HIDDEN$2, function () {
|
||||
if (isVisible(_this11)) {
|
||||
_this11.focus();
|
||||
if (isVisible(_this12)) {
|
||||
_this12.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -3279,7 +3291,6 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
|
||||
*/
|
||||
|
||||
var NAME$6 = 'tooltip';
|
||||
var VERSION$6 = '5.0.0-alpha3';
|
||||
var DATA_KEY$6 = 'bs.tooltip';
|
||||
var EVENT_KEY$6 = "." + DATA_KEY$6;
|
||||
var CLASS_PREFIX = 'bs-tooltip';
|
||||
@ -3298,6 +3309,7 @@ var DefaultType$4 = {
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
allowList: 'object',
|
||||
@ -3312,7 +3324,7 @@ var AttachmentMap = {
|
||||
};
|
||||
var Default$4 = {
|
||||
animation: true,
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
|
||||
trigger: 'hover focus',
|
||||
title: '',
|
||||
delay: 0,
|
||||
@ -3323,6 +3335,7 @@ var Default$4 = {
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
allowList: DefaultAllowlist,
|
||||
@ -3356,26 +3369,30 @@ var TRIGGER_MANUAL = 'manual';
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tooltip = /*#__PURE__*/function () {
|
||||
var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tooltip, _BaseComponent);
|
||||
|
||||
function Tooltip(element, config) {
|
||||
var _this;
|
||||
|
||||
if (typeof Popper === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
||||
} // private
|
||||
}
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this; // private
|
||||
|
||||
this._isEnabled = true;
|
||||
this._timeout = 0;
|
||||
this._hoverState = '';
|
||||
this._activeTrigger = {};
|
||||
this._popper = null; // Protected
|
||||
_this._isEnabled = true;
|
||||
_this._timeout = 0;
|
||||
_this._hoverState = '';
|
||||
_this._activeTrigger = {};
|
||||
_this._popper = null; // Protected
|
||||
|
||||
this.element = element;
|
||||
this.config = this._getConfig(config);
|
||||
this.tip = null;
|
||||
_this.config = _this._getConfig(config);
|
||||
_this.tip = null;
|
||||
|
||||
this._setListeners();
|
||||
_this._setListeners();
|
||||
|
||||
Data.setData(element, this.constructor.DATA_KEY, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -3428,9 +3445,8 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
clearTimeout(this._timeout);
|
||||
Data.removeData(this.element, this.constructor.DATA_KEY);
|
||||
EventHandler.off(this.element, this.constructor.EVENT_KEY);
|
||||
EventHandler.off(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
||||
EventHandler.off(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.tip) {
|
||||
this.tip.parentNode.removeChild(this.tip);
|
||||
@ -3446,22 +3462,23 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
this._popper = null;
|
||||
this.element = null;
|
||||
this.config = null;
|
||||
this.tip = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this.element.style.display === 'none') {
|
||||
if (this._element.style.display === 'none') {
|
||||
throw new Error('Please use show on visible elements');
|
||||
}
|
||||
|
||||
if (this.isWithContent() && this._isEnabled) {
|
||||
var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this.element);
|
||||
var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
|
||||
var showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this._element);
|
||||
var isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
|
||||
|
||||
if (showEvent.defaultPrevented || !isInTheDom) {
|
||||
return;
|
||||
@ -3470,14 +3487,16 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
var tip = this.getTipElement();
|
||||
var tipId = getUID(this.constructor.NAME);
|
||||
tip.setAttribute('id', tipId);
|
||||
this.element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this._element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this.setContent();
|
||||
|
||||
if (this.config.animation) {
|
||||
tip.classList.add(CLASS_NAME_FADE$1);
|
||||
}
|
||||
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
|
||||
|
||||
var attachment = this._getAttachment(placement);
|
||||
|
||||
@ -3487,17 +3506,25 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
|
||||
Data.setData(tip, this.constructor.DATA_KEY, this);
|
||||
|
||||
if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
container.appendChild(tip);
|
||||
}
|
||||
|
||||
EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we add extra
|
||||
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper(this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
if (customClass) {
|
||||
var _tip$classList;
|
||||
|
||||
(_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
var _ref;
|
||||
|
||||
@ -3507,16 +3534,16 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this.config.animation) {
|
||||
_this._fixTransition();
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this._hoverState;
|
||||
_this._hoverState = null;
|
||||
EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler.trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
|
||||
if (prevHoverState === HOVER_STATE_OUT) {
|
||||
_this._leave(null, _this);
|
||||
_this2._leave(null, _this2);
|
||||
}
|
||||
};
|
||||
|
||||
@ -3531,7 +3558,7 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._popper) {
|
||||
return;
|
||||
@ -3540,20 +3567,20 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
var tip = this.getTipElement();
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
tip.parentNode.removeChild(tip);
|
||||
}
|
||||
|
||||
_this2._cleanTipClass();
|
||||
_this3._cleanTipClass();
|
||||
|
||||
_this2.element.removeAttribute('aria-describedby');
|
||||
_this3._element.removeAttribute('aria-describedby');
|
||||
|
||||
EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
|
||||
EventHandler.trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this2._popper.destroy();
|
||||
_this3._popper.destroy();
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
|
||||
var hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
||||
|
||||
if (hideEvent.defaultPrevented) {
|
||||
return;
|
||||
@ -3648,10 +3675,10 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.getTitle = function getTitle() {
|
||||
var title = this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (!title) {
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
|
||||
}
|
||||
|
||||
return title;
|
||||
@ -3659,7 +3686,7 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
;
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
@ -3677,11 +3704,11 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
_this3._handlePopperPlacementChange(data);
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -3692,13 +3719,13 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -3725,33 +3752,33 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
EventHandler.on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
});
|
||||
EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
EventHandler.on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this5.element) {
|
||||
_this5.hide();
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
}
|
||||
};
|
||||
|
||||
EventHandler.on(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler.on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = _extends({}, this.config, {
|
||||
@ -3764,12 +3791,18 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._fixTitle = function _fixTitle() {
|
||||
var title = this.element.getAttribute('title');
|
||||
var originalTitleType = typeof this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('title');
|
||||
|
||||
var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (title || originalTitleType !== 'string') {
|
||||
this.element.setAttribute('data-bs-original-title', title || '');
|
||||
this.element.setAttribute('title', '');
|
||||
this._element.setAttribute('data-bs-original-title', title || '');
|
||||
|
||||
if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
|
||||
this._element.setAttribute('aria-label', title);
|
||||
}
|
||||
|
||||
this._element.setAttribute('title', '');
|
||||
}
|
||||
};
|
||||
|
||||
@ -3849,7 +3882,7 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
var dataAttributes = Manipulator.getDataAttributes(this.element);
|
||||
var dataAttributes = Manipulator.getDataAttributes(this._element);
|
||||
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
||||
if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
|
||||
delete dataAttributes[dataAttr];
|
||||
@ -3961,16 +3994,7 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
});
|
||||
};
|
||||
|
||||
Tooltip.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$6);
|
||||
};
|
||||
|
||||
_createClass(Tooltip, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$6;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$4;
|
||||
@ -4003,7 +4027,7 @@ var Tooltip = /*#__PURE__*/function () {
|
||||
}]);
|
||||
|
||||
return Tooltip;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
@ -4035,7 +4059,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$7 = 'popover';
|
||||
var VERSION$7 = '5.0.0-alpha3';
|
||||
var DATA_KEY$7 = 'bs.popover';
|
||||
var EVENT_KEY$7 = "." + DATA_KEY$7;
|
||||
var CLASS_PREFIX$1 = 'bs-popover';
|
||||
@ -4045,7 +4068,7 @@ var Default$5 = _extends({}, 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>'
|
||||
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 = _extends({}, Tooltip.DefaultType, {
|
||||
@ -4096,7 +4119,7 @@ var Popover = /*#__PURE__*/function (_Tooltip) {
|
||||
var content = this._getContent();
|
||||
|
||||
if (typeof content === 'function') {
|
||||
content = content.call(this.element);
|
||||
content = content.call(this._element);
|
||||
}
|
||||
|
||||
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
||||
@ -4109,7 +4132,7 @@ var Popover = /*#__PURE__*/function (_Tooltip) {
|
||||
};
|
||||
|
||||
_proto._getContent = function _getContent() {
|
||||
return this.element.getAttribute('data-bs-content') || this.config.content;
|
||||
return this._element.getAttribute('data-bs-content') || this.config.content;
|
||||
};
|
||||
|
||||
_proto._cleanTipClass = function _cleanTipClass() {
|
||||
@ -4151,18 +4174,9 @@ var Popover = /*#__PURE__*/function (_Tooltip) {
|
||||
});
|
||||
};
|
||||
|
||||
Popover.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$7);
|
||||
};
|
||||
|
||||
_createClass(Popover, null, [{
|
||||
key: "VERSION",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$7;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return Default$5;
|
||||
}
|
||||
@ -4226,7 +4240,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$8 = 'scrollspy';
|
||||
var VERSION$8 = '5.0.0-alpha3';
|
||||
var DATA_KEY$8 = 'bs.scrollspy';
|
||||
var EVENT_KEY$8 = "." + DATA_KEY$8;
|
||||
var DATA_API_KEY$6 = '.data-api';
|
||||
@ -4260,26 +4273,29 @@ var METHOD_POSITION = 'position';
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var ScrollSpy = /*#__PURE__*/function () {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this = this;
|
||||
var ScrollSpy = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(ScrollSpy, _BaseComponent);
|
||||
|
||||
this._element = element;
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
this._config = this._getConfig(config);
|
||||
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + ", " + this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
this._offsets = [];
|
||||
this._targets = [];
|
||||
this._activeTarget = null;
|
||||
this._scrollHeight = 0;
|
||||
EventHandler.on(this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._selector = _this._config.target + " " + SELECTOR_NAV_LINKS + ", " + _this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + _this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
_this._offsets = [];
|
||||
_this._targets = [];
|
||||
_this._activeTarget = null;
|
||||
_this._scrollHeight = 0;
|
||||
EventHandler.on(_this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
return _this._process(event);
|
||||
});
|
||||
this.refresh();
|
||||
|
||||
this._process();
|
||||
_this.refresh();
|
||||
|
||||
Data.setData(element, DATA_KEY$8, this);
|
||||
_this._process();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -4321,9 +4337,9 @@ var ScrollSpy = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$8);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._scrollElement, EVENT_KEY$8);
|
||||
this._element = null;
|
||||
this._scrollElement = null;
|
||||
this._config = null;
|
||||
this._selector = null;
|
||||
@ -4468,24 +4484,20 @@ var ScrollSpy = /*#__PURE__*/function () {
|
||||
});
|
||||
};
|
||||
|
||||
ScrollSpy.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$8);
|
||||
};
|
||||
|
||||
_createClass(ScrollSpy, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$8;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$6;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$8;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ScrollSpy;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -4528,7 +4540,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$9 = 'tab';
|
||||
var VERSION$9 = '5.0.0-alpha3';
|
||||
var DATA_KEY$9 = 'bs.tab';
|
||||
var EVENT_KEY$9 = "." + DATA_KEY$9;
|
||||
var DATA_API_KEY$7 = '.data-api';
|
||||
@ -4555,12 +4566,12 @@ var SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tab = /*#__PURE__*/function () {
|
||||
function Tab(element) {
|
||||
this._element = element;
|
||||
Data.setData(this._element, DATA_KEY$9, this);
|
||||
} // Getters
|
||||
var Tab = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tab, _BaseComponent);
|
||||
|
||||
function Tab() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Tab.prototype;
|
||||
|
||||
@ -4615,11 +4626,6 @@ var Tab = /*#__PURE__*/function () {
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$9);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -4702,19 +4708,16 @@ var Tab = /*#__PURE__*/function () {
|
||||
});
|
||||
};
|
||||
|
||||
Tab.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$9);
|
||||
};
|
||||
|
||||
_createClass(Tab, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$9;
|
||||
return DATA_KEY$9;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Tab;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -4757,7 +4760,6 @@ onDOMContentLoaded(function () {
|
||||
*/
|
||||
|
||||
var NAME$a = 'toast';
|
||||
var VERSION$a = '5.0.0-alpha3';
|
||||
var DATA_KEY$a = 'bs.toast';
|
||||
var EVENT_KEY$a = "." + DATA_KEY$a;
|
||||
var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
|
||||
@ -4786,15 +4788,19 @@ var SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="toast"]';
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Toast = /*#__PURE__*/function () {
|
||||
var Toast = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Toast, _BaseComponent);
|
||||
|
||||
function Toast(element, config) {
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._timeout = null;
|
||||
var _this;
|
||||
|
||||
this._setListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._timeout = null;
|
||||
|
||||
Data.setData(element, DATA_KEY$a, this);
|
||||
_this._setListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -4802,7 +4808,7 @@ var Toast = /*#__PURE__*/function () {
|
||||
|
||||
// Public
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4);
|
||||
|
||||
@ -4817,16 +4823,16 @@ var Toast = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
_this2._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_SHOW$6);
|
||||
_this2._element.classList.add(CLASS_NAME_SHOW$6);
|
||||
|
||||
EventHandler.trigger(_this._element, EVENT_SHOWN$4);
|
||||
EventHandler.trigger(_this2._element, EVENT_SHOWN$4);
|
||||
|
||||
if (_this._config.autohide) {
|
||||
_this._timeout = setTimeout(function () {
|
||||
_this.hide();
|
||||
}, _this._config.delay);
|
||||
if (_this2._config.autohide) {
|
||||
_this2._timeout = setTimeout(function () {
|
||||
_this2.hide();
|
||||
}, _this2._config.delay);
|
||||
}
|
||||
};
|
||||
|
||||
@ -4846,7 +4852,7 @@ var Toast = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._element.classList.contains(CLASS_NAME_SHOW$6)) {
|
||||
return;
|
||||
@ -4859,9 +4865,9 @@ var Toast = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this2._element.classList.add(CLASS_NAME_HIDE);
|
||||
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||
|
||||
EventHandler.trigger(_this2._element, EVENT_HIDDEN$4);
|
||||
EventHandler.trigger(_this3._element, EVENT_HIDDEN$4);
|
||||
};
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
||||
@ -4883,8 +4889,9 @@ var Toast = /*#__PURE__*/function () {
|
||||
}
|
||||
|
||||
EventHandler.off(this._element, EVENT_CLICK_DISMISS$1);
|
||||
Data.removeData(this._element, DATA_KEY$a);
|
||||
this._element = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
} // Private
|
||||
;
|
||||
@ -4896,10 +4903,10 @@ var Toast = /*#__PURE__*/function () {
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
|
||||
return _this3.hide();
|
||||
return _this4.hide();
|
||||
});
|
||||
};
|
||||
|
||||
@ -4929,16 +4936,7 @@ var Toast = /*#__PURE__*/function () {
|
||||
});
|
||||
};
|
||||
|
||||
Toast.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$a);
|
||||
};
|
||||
|
||||
_createClass(Toast, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$a;
|
||||
}
|
||||
}, {
|
||||
key: "DefaultType",
|
||||
get: function get() {
|
||||
return DefaultType$7;
|
||||
@ -4948,10 +4946,15 @@ var Toast = /*#__PURE__*/function () {
|
||||
get: function get() {
|
||||
return Default$7;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$a;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Toast;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
|
2
dist/js/bootstrap.esm.js.map
vendored
2
dist/js/bootstrap.esm.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.esm.min.js
vendored
2
dist/js/bootstrap.esm.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.esm.min.js.map
vendored
2
dist/js/bootstrap.esm.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -584,8 +584,48 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data.setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var DATA_KEY = 'bs.alert';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -602,15 +642,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Alert = /*#__PURE__*/function () {
|
||||
function Alert(element) {
|
||||
this._element = element;
|
||||
|
||||
if (this._element) {
|
||||
Data.setData(element, DATA_KEY, this);
|
||||
}
|
||||
} // Getters
|
||||
var Alert = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Alert, _BaseComponent);
|
||||
|
||||
function Alert() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Alert.prototype;
|
||||
|
||||
@ -625,11 +662,6 @@
|
||||
}
|
||||
|
||||
this._removeElement(rootElement);
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -692,19 +724,16 @@
|
||||
};
|
||||
};
|
||||
|
||||
Alert.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Alert, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Alert;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -743,7 +772,6 @@
|
||||
*/
|
||||
|
||||
var NAME$1 = 'button';
|
||||
var VERSION$1 = '5.0.0-alpha3';
|
||||
var DATA_KEY$1 = 'bs.button';
|
||||
var EVENT_KEY$1 = "." + DATA_KEY$1;
|
||||
var DATA_API_KEY$1 = '.data-api';
|
||||
@ -756,12 +784,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Button = /*#__PURE__*/function () {
|
||||
function Button(element) {
|
||||
this._element = element;
|
||||
Data.setData(element, DATA_KEY$1, this);
|
||||
} // Getters
|
||||
var Button = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Button, _BaseComponent);
|
||||
|
||||
function Button() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Button.prototype;
|
||||
|
||||
@ -769,11 +797,6 @@
|
||||
_proto.toggle = function toggle() {
|
||||
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
||||
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$1);
|
||||
this._element = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
@ -791,19 +814,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
Button.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$1);
|
||||
};
|
||||
|
||||
_createClass(Button, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$1;
|
||||
return DATA_KEY$1;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Button;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -1008,7 +1028,6 @@
|
||||
*/
|
||||
|
||||
var NAME$2 = 'carousel';
|
||||
var VERSION$2 = '5.0.0-alpha3';
|
||||
var DATA_KEY$2 = 'bs.carousel';
|
||||
var EVENT_KEY$2 = "." + DATA_KEY$2;
|
||||
var DATA_API_KEY$2 = '.data-api';
|
||||
@ -1076,25 +1095,29 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Carousel = /*#__PURE__*/function () {
|
||||
var Carousel = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Carousel, _BaseComponent);
|
||||
|
||||
function Carousel(element, config) {
|
||||
this._items = null;
|
||||
this._interval = null;
|
||||
this._activeElement = null;
|
||||
this._isPaused = false;
|
||||
this._isSliding = false;
|
||||
this.touchTimeout = null;
|
||||
this.touchStartX = 0;
|
||||
this.touchDeltaX = 0;
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
this._pointerEvent = Boolean(window.PointerEvent);
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._items = null;
|
||||
_this._interval = null;
|
||||
_this._activeElement = null;
|
||||
_this._isPaused = false;
|
||||
_this._isSliding = false;
|
||||
_this.touchTimeout = null;
|
||||
_this.touchStartX = 0;
|
||||
_this.touchDeltaX = 0;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, _this._element);
|
||||
_this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
_this._pointerEvent = Boolean(window.PointerEvent);
|
||||
|
||||
Data.setData(element, DATA_KEY$2, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -1153,7 +1176,7 @@
|
||||
};
|
||||
|
||||
_proto.to = function to(index) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -1165,7 +1188,7 @@
|
||||
|
||||
if (this._isSliding) {
|
||||
EventHandler.one(this._element, EVENT_SLID, function () {
|
||||
return _this.to(index);
|
||||
return _this2.to(index);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -1182,11 +1205,11 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._element, EVENT_KEY$2);
|
||||
Data.removeData(this._element, DATA_KEY$2);
|
||||
this._items = null;
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._interval = null;
|
||||
this._isPaused = null;
|
||||
this._isSliding = null;
|
||||
@ -1222,20 +1245,20 @@
|
||||
};
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._config.keyboard) {
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN, function (event) {
|
||||
return _this2._keydown(event);
|
||||
return _this3._keydown(event);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
EventHandler.on(this._element, EVENT_MOUSEENTER, function (event) {
|
||||
return _this2.pause(event);
|
||||
return _this3.pause(event);
|
||||
});
|
||||
EventHandler.on(this._element, EVENT_MOUSELEAVE, function (event) {
|
||||
return _this2.cycle(event);
|
||||
return _this3.cycle(event);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1245,33 +1268,33 @@
|
||||
};
|
||||
|
||||
_proto._addTouchEventListeners = function _addTouchEventListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var start = function start(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchStartX = event.clientX;
|
||||
} else if (!_this3._pointerEvent) {
|
||||
_this3.touchStartX = event.touches[0].clientX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchStartX = event.clientX;
|
||||
} else if (!_this4._pointerEvent) {
|
||||
_this4.touchStartX = event.touches[0].clientX;
|
||||
}
|
||||
};
|
||||
|
||||
var move = function move(event) {
|
||||
// ensure swiping with one touch and not pinching
|
||||
if (event.touches && event.touches.length > 1) {
|
||||
_this3.touchDeltaX = 0;
|
||||
_this4.touchDeltaX = 0;
|
||||
} else {
|
||||
_this3.touchDeltaX = event.touches[0].clientX - _this3.touchStartX;
|
||||
_this4.touchDeltaX = event.touches[0].clientX - _this4.touchStartX;
|
||||
}
|
||||
};
|
||||
|
||||
var end = function end(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchDeltaX = event.clientX - _this3.touchStartX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchDeltaX = event.clientX - _this4.touchStartX;
|
||||
}
|
||||
|
||||
_this3._handleSwipe();
|
||||
_this4._handleSwipe();
|
||||
|
||||
if (_this3._config.pause === 'hover') {
|
||||
if (_this4._config.pause === 'hover') {
|
||||
// If it's a touch-enabled device, mouseenter/leave are fired as
|
||||
// part of the mouse compatibility events on first tap - the carousel
|
||||
// would stop cycling until user tapped out of it;
|
||||
@ -1279,15 +1302,15 @@
|
||||
// (as if it's the second time we tap on it, mouseenter compat event
|
||||
// is NOT fired) and after a timeout (to allow for mouse compatibility
|
||||
// events to fire) we explicitly restart cycling
|
||||
_this3.pause();
|
||||
_this4.pause();
|
||||
|
||||
if (_this3.touchTimeout) {
|
||||
clearTimeout(_this3.touchTimeout);
|
||||
if (_this4.touchTimeout) {
|
||||
clearTimeout(_this4.touchTimeout);
|
||||
}
|
||||
|
||||
_this3.touchTimeout = setTimeout(function (event) {
|
||||
return _this3.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
|
||||
_this4.touchTimeout = setTimeout(function (event) {
|
||||
return _this4.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this4._config.interval);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1407,7 +1430,7 @@
|
||||
};
|
||||
|
||||
_proto._slide = function _slide(direction, element) {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -1468,9 +1491,9 @@
|
||||
nextElement.classList.remove(directionalClassName, orderClassName);
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE$1);
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE$1, orderClassName, directionalClassName);
|
||||
_this4._isSliding = false;
|
||||
_this5._isSliding = false;
|
||||
setTimeout(function () {
|
||||
EventHandler.trigger(_this4._element, EVENT_SLID, {
|
||||
EventHandler.trigger(_this5._element, EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
@ -1556,24 +1579,20 @@
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
Carousel.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$2);
|
||||
};
|
||||
|
||||
_createClass(Carousel, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$2;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$2;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Carousel;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -1619,7 +1638,6 @@
|
||||
*/
|
||||
|
||||
var NAME$3 = 'collapse';
|
||||
var VERSION$3 = '5.0.0-alpha3';
|
||||
var DATA_KEY$3 = 'bs.collapse';
|
||||
var EVENT_KEY$3 = "." + DATA_KEY$3;
|
||||
var DATA_API_KEY$3 = '.data-api';
|
||||
@ -1650,12 +1668,16 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Collapse = /*#__PURE__*/function () {
|
||||
var Collapse = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Collapse, _BaseComponent);
|
||||
|
||||
function Collapse(element, config) {
|
||||
this._isTransitioning = false;
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._isTransitioning = false;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1);
|
||||
|
||||
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||
@ -1666,23 +1688,23 @@
|
||||
});
|
||||
|
||||
if (selector !== null && filterElement.length) {
|
||||
this._selector = selector;
|
||||
_this._selector = selector;
|
||||
|
||||
this._triggerArray.push(elem);
|
||||
_this._triggerArray.push(elem);
|
||||
}
|
||||
}
|
||||
|
||||
this._parent = this._config.parent ? this._getParent() : null;
|
||||
_this._parent = _this._config.parent ? _this._getParent() : null;
|
||||
|
||||
if (!this._config.parent) {
|
||||
this._addAriaAndCollapsedClass(this._element, this._triggerArray);
|
||||
if (!_this._config.parent) {
|
||||
_this._addAriaAndCollapsedClass(_this._element, _this._triggerArray);
|
||||
}
|
||||
|
||||
if (this._config.toggle) {
|
||||
this.toggle();
|
||||
if (_this._config.toggle) {
|
||||
_this.toggle();
|
||||
}
|
||||
|
||||
Data.setData(element, DATA_KEY$3, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -1698,7 +1720,7 @@
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -1709,8 +1731,8 @@
|
||||
|
||||
if (this._parent) {
|
||||
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(function (elem) {
|
||||
if (typeof _this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this._config.parent;
|
||||
if (typeof _this2._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this2._config.parent;
|
||||
}
|
||||
|
||||
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
||||
@ -1770,15 +1792,15 @@
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
_this._element.style[dimension] = '';
|
||||
_this2._element.style[dimension] = '';
|
||||
|
||||
_this.setTransitioning(false);
|
||||
_this2.setTransitioning(false);
|
||||
|
||||
EventHandler.trigger(_this._element, EVENT_SHOWN);
|
||||
EventHandler.trigger(_this2._element, EVENT_SHOWN);
|
||||
};
|
||||
|
||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
@ -1790,7 +1812,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -1828,13 +1850,13 @@
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this2.setTransitioning(false);
|
||||
_this3.setTransitioning(false);
|
||||
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this3._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
_this3._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
|
||||
EventHandler.trigger(_this2._element, EVENT_HIDDEN);
|
||||
EventHandler.trigger(_this3._element, EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
@ -1848,10 +1870,10 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$3);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
this._parent = null;
|
||||
this._element = null;
|
||||
this._triggerArray = null;
|
||||
this._isTransitioning = null;
|
||||
} // Private
|
||||
@ -1870,7 +1892,7 @@
|
||||
};
|
||||
|
||||
_proto._getParent = function _getParent() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var parent = this._config.parent;
|
||||
|
||||
@ -1887,7 +1909,7 @@
|
||||
SelectorEngine.find(selector, parent).forEach(function (element) {
|
||||
var selected = getElementFromSelector(element);
|
||||
|
||||
_this3._addAriaAndCollapsedClass(selected, [element]);
|
||||
_this4._addAriaAndCollapsedClass(selected, [element]);
|
||||
});
|
||||
return parent;
|
||||
};
|
||||
@ -1938,24 +1960,20 @@
|
||||
});
|
||||
};
|
||||
|
||||
Collapse.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$3);
|
||||
};
|
||||
|
||||
_createClass(Collapse, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$3;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$1;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$3;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Collapse;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -2021,7 +2039,6 @@
|
||||
*/
|
||||
|
||||
var NAME$4 = 'dropdown';
|
||||
var VERSION$4 = '5.0.0-alpha3';
|
||||
var DATA_KEY$4 = 'bs.dropdown';
|
||||
var EVENT_KEY$4 = "." + DATA_KEY$4;
|
||||
var DATA_API_KEY$4 = '.data-api';
|
||||
@ -2082,17 +2099,21 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Dropdown = /*#__PURE__*/function () {
|
||||
var Dropdown = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Dropdown, _BaseComponent);
|
||||
|
||||
function Dropdown(element, config) {
|
||||
this._element = element;
|
||||
this._popper = null;
|
||||
this._config = this._getConfig(config);
|
||||
this._menu = this._getMenuElement();
|
||||
this._inNavbar = this._detectNavbar();
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._popper = null;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._menu = _this._getMenuElement();
|
||||
_this._inNavbar = _this._detectNavbar();
|
||||
|
||||
Data.setData(element, DATA_KEY$4, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -2208,9 +2229,9 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$4);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._element, EVENT_KEY$4);
|
||||
this._element = null;
|
||||
this._menu = null;
|
||||
|
||||
if (this._popper) {
|
||||
@ -2230,13 +2251,13 @@
|
||||
;
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
_this.toggle();
|
||||
_this2.toggle();
|
||||
});
|
||||
};
|
||||
|
||||
@ -2272,13 +2293,13 @@
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -2440,15 +2461,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var index = items.indexOf(event.target);
|
||||
var index = items.indexOf(event.target); // Up
|
||||
|
||||
if (event.key === ARROW_UP_KEY && index > 0) {
|
||||
// Up
|
||||
index--;
|
||||
}
|
||||
} // Down
|
||||
|
||||
|
||||
if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
|
||||
// Down
|
||||
index++;
|
||||
} // index is -1 if the first keydown is an ArrowUp
|
||||
|
||||
@ -2457,16 +2477,7 @@
|
||||
items[index].focus();
|
||||
};
|
||||
|
||||
Dropdown.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$4);
|
||||
};
|
||||
|
||||
_createClass(Dropdown, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$4;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$2;
|
||||
@ -2476,10 +2487,15 @@
|
||||
get: function get() {
|
||||
return DefaultType$2;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$4;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Dropdown;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -2529,7 +2545,6 @@
|
||||
*/
|
||||
|
||||
var NAME$5 = 'modal';
|
||||
var VERSION$5 = '5.0.0-alpha3';
|
||||
var DATA_KEY$5 = 'bs.modal';
|
||||
var EVENT_KEY$5 = "." + DATA_KEY$5;
|
||||
var DATA_API_KEY$5 = '.data-api';
|
||||
@ -2537,14 +2552,12 @@
|
||||
var Default$3 = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: true
|
||||
focus: true
|
||||
};
|
||||
var DefaultType$3 = {
|
||||
backdrop: '(boolean|string)',
|
||||
keyboard: 'boolean',
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
focus: 'boolean'
|
||||
};
|
||||
var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
|
||||
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
|
||||
@ -2576,18 +2589,22 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Modal = /*#__PURE__*/function () {
|
||||
var Modal = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Modal, _BaseComponent);
|
||||
|
||||
function Modal(element, config) {
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
|
||||
this._backdrop = null;
|
||||
this._isShown = false;
|
||||
this._isBodyOverflowing = false;
|
||||
this._ignoreBackdropClick = false;
|
||||
this._isTransitioning = false;
|
||||
this._scrollbarWidth = 0;
|
||||
Data.setData(element, DATA_KEY$5, this);
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
|
||||
_this._backdrop = null;
|
||||
_this._isShown = false;
|
||||
_this._isBodyOverflowing = false;
|
||||
_this._ignoreBackdropClick = false;
|
||||
_this._isTransitioning = false;
|
||||
_this._scrollbarWidth = 0;
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -2599,7 +2616,7 @@
|
||||
};
|
||||
|
||||
_proto.show = function show(relatedTarget) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isShown || this._isTransitioning) {
|
||||
return;
|
||||
@ -2630,23 +2647,23 @@
|
||||
this._setResizeEvent();
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
|
||||
return _this.hide(event);
|
||||
return _this2.hide(event);
|
||||
});
|
||||
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
|
||||
EventHandler.one(_this._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this._element) {
|
||||
_this._ignoreBackdropClick = true;
|
||||
EventHandler.one(_this2._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this2._element) {
|
||||
_this2._ignoreBackdropClick = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this._showBackdrop(function () {
|
||||
return _this._showElement(relatedTarget);
|
||||
return _this2._showElement(relatedTarget);
|
||||
});
|
||||
};
|
||||
|
||||
_proto.hide = function hide(event) {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
@ -2684,7 +2701,7 @@
|
||||
if (transition) {
|
||||
var transitionDuration = getTransitionDurationFromElement(this._element);
|
||||
EventHandler.one(this._element, TRANSITION_END, function (event) {
|
||||
return _this2._hideModal(event);
|
||||
return _this3._hideModal(event);
|
||||
});
|
||||
emulateTransitionEnd(this._element, transitionDuration);
|
||||
} else {
|
||||
@ -2696,16 +2713,17 @@
|
||||
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
||||
return EventHandler.off(htmlElement, EVENT_KEY$5);
|
||||
});
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
/**
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
* Do not move `document` in `htmlElements` array
|
||||
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
|
||||
|
||||
EventHandler.off(document, EVENT_FOCUSIN);
|
||||
Data.removeData(this._element, DATA_KEY$5);
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._dialog = null;
|
||||
this._backdrop = null;
|
||||
this._isShown = null;
|
||||
@ -2727,7 +2745,7 @@
|
||||
};
|
||||
|
||||
_proto._showElement = function _showElement(relatedTarget) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var transition = this._element.classList.contains(CLASS_NAME_FADE);
|
||||
|
||||
@ -2763,12 +2781,12 @@
|
||||
}
|
||||
|
||||
var transitionComplete = function transitionComplete() {
|
||||
if (_this3._config.focus) {
|
||||
_this3._element.focus();
|
||||
if (_this4._config.focus) {
|
||||
_this4._element.focus();
|
||||
}
|
||||
|
||||
_this3._isTransitioning = false;
|
||||
EventHandler.trigger(_this3._element, EVENT_SHOWN$2, {
|
||||
_this4._isTransitioning = false;
|
||||
EventHandler.trigger(_this4._element, EVENT_SHOWN$2, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
};
|
||||
@ -2783,28 +2801,28 @@
|
||||
};
|
||||
|
||||
_proto._enforceFocus = function _enforceFocus() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
|
||||
|
||||
EventHandler.on(document, EVENT_FOCUSIN, function (event) {
|
||||
if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
|
||||
_this4._element.focus();
|
||||
if (document !== event.target && _this5._element !== event.target && !_this5._element.contains(event.target)) {
|
||||
_this5._element.focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_proto._setEscapeEvent = function _setEscapeEvent() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
|
||||
if (_this5._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
if (_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
event.preventDefault();
|
||||
|
||||
_this5.hide();
|
||||
} else if (!_this5._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
_this5._triggerBackdropTransition();
|
||||
_this6.hide();
|
||||
} else if (!_this6._config.keyboard && event.key === ESCAPE_KEY$1) {
|
||||
_this6._triggerBackdropTransition();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -2813,11 +2831,11 @@
|
||||
};
|
||||
|
||||
_proto._setResizeEvent = function _setResizeEvent() {
|
||||
var _this6 = this;
|
||||
var _this7 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler.on(window, EVENT_RESIZE, function () {
|
||||
return _this6._adjustDialog();
|
||||
return _this7._adjustDialog();
|
||||
});
|
||||
} else {
|
||||
EventHandler.off(window, EVENT_RESIZE);
|
||||
@ -2825,7 +2843,7 @@
|
||||
};
|
||||
|
||||
_proto._hideModal = function _hideModal() {
|
||||
var _this7 = this;
|
||||
var _this8 = this;
|
||||
|
||||
this._element.style.display = 'none';
|
||||
|
||||
@ -2840,11 +2858,11 @@
|
||||
this._showBackdrop(function () {
|
||||
document.body.classList.remove(CLASS_NAME_OPEN);
|
||||
|
||||
_this7._resetAdjustments();
|
||||
_this8._resetAdjustments();
|
||||
|
||||
_this7._resetScrollbar();
|
||||
_this8._resetScrollbar();
|
||||
|
||||
EventHandler.trigger(_this7._element, EVENT_HIDDEN$2);
|
||||
EventHandler.trigger(_this8._element, EVENT_HIDDEN$2);
|
||||
});
|
||||
};
|
||||
|
||||
@ -2855,7 +2873,7 @@
|
||||
};
|
||||
|
||||
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||
var _this8 = this;
|
||||
var _this9 = this;
|
||||
|
||||
var animate = this._element.classList.contains(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||
|
||||
@ -2869,8 +2887,8 @@
|
||||
|
||||
document.body.appendChild(this._backdrop);
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, function (event) {
|
||||
if (_this8._ignoreBackdropClick) {
|
||||
_this8._ignoreBackdropClick = false;
|
||||
if (_this9._ignoreBackdropClick) {
|
||||
_this9._ignoreBackdropClick = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2878,10 +2896,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (_this8._config.backdrop === 'static') {
|
||||
_this8._triggerBackdropTransition();
|
||||
if (_this9._config.backdrop === 'static') {
|
||||
_this9._triggerBackdropTransition();
|
||||
} else {
|
||||
_this8.hide();
|
||||
_this9.hide();
|
||||
}
|
||||
});
|
||||
|
||||
@ -2903,7 +2921,7 @@
|
||||
this._backdrop.classList.remove(CLASS_NAME_SHOW$2);
|
||||
|
||||
var callbackRemove = function callbackRemove() {
|
||||
_this8._removeBackdrop();
|
||||
_this9._removeBackdrop();
|
||||
|
||||
callback();
|
||||
};
|
||||
@ -2922,7 +2940,7 @@
|
||||
};
|
||||
|
||||
_proto._triggerBackdropTransition = function _triggerBackdropTransition() {
|
||||
var _this9 = this;
|
||||
var _this10 = this;
|
||||
|
||||
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
|
||||
@ -2941,13 +2959,13 @@
|
||||
var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
|
||||
EventHandler.off(this._element, TRANSITION_END);
|
||||
EventHandler.one(this._element, TRANSITION_END, function () {
|
||||
_this9._element.classList.remove(CLASS_NAME_STATIC);
|
||||
_this10._element.classList.remove(CLASS_NAME_STATIC);
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
EventHandler.one(_this9._element, TRANSITION_END, function () {
|
||||
_this9._element.style.overflowY = '';
|
||||
EventHandler.one(_this10._element, TRANSITION_END, function () {
|
||||
_this10._element.style.overflowY = '';
|
||||
});
|
||||
emulateTransitionEnd(_this9._element, modalTransitionDuration);
|
||||
emulateTransitionEnd(_this10._element, modalTransitionDuration);
|
||||
}
|
||||
});
|
||||
emulateTransitionEnd(this._element, modalTransitionDuration);
|
||||
@ -2982,7 +3000,7 @@
|
||||
};
|
||||
|
||||
_proto._setScrollbar = function _setScrollbar() {
|
||||
var _this10 = this;
|
||||
var _this11 = this;
|
||||
|
||||
if (this._isBodyOverflowing) {
|
||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||
@ -2992,14 +3010,14 @@
|
||||
var actualPadding = element.style.paddingRight;
|
||||
var calculatedPadding = window.getComputedStyle(element)['padding-right'];
|
||||
Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px";
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this11._scrollbarWidth + "px";
|
||||
}); // Adjust sticky content margin
|
||||
|
||||
SelectorEngine.find(SELECTOR_STICKY_CONTENT).forEach(function (element) {
|
||||
var actualMargin = element.style.marginRight;
|
||||
var calculatedMargin = window.getComputedStyle(element)['margin-right'];
|
||||
Manipulator.setDataAttribute(element, 'margin-right', actualMargin);
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px";
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this11._scrollbarWidth + "px";
|
||||
}); // Adjust body padding
|
||||
|
||||
var actualPadding = document.body.style.paddingRight;
|
||||
@ -3068,30 +3086,24 @@
|
||||
}
|
||||
|
||||
data[config](relatedTarget);
|
||||
} else if (_config.show) {
|
||||
data.show(relatedTarget);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Modal.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$5);
|
||||
};
|
||||
|
||||
_createClass(Modal, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$5;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$3;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$5;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Modal;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -3100,7 +3112,7 @@
|
||||
|
||||
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
|
||||
var _this11 = this;
|
||||
var _this12 = this;
|
||||
|
||||
var target = getElementFromSelector(this);
|
||||
|
||||
@ -3115,8 +3127,8 @@
|
||||
}
|
||||
|
||||
EventHandler.one(target, EVENT_HIDDEN$2, function () {
|
||||
if (isVisible(_this11)) {
|
||||
_this11.focus();
|
||||
if (isVisible(_this12)) {
|
||||
_this12.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -3287,7 +3299,6 @@
|
||||
*/
|
||||
|
||||
var NAME$6 = 'tooltip';
|
||||
var VERSION$6 = '5.0.0-alpha3';
|
||||
var DATA_KEY$6 = 'bs.tooltip';
|
||||
var EVENT_KEY$6 = "." + DATA_KEY$6;
|
||||
var CLASS_PREFIX = 'bs-tooltip';
|
||||
@ -3306,6 +3317,7 @@
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
allowList: 'object',
|
||||
@ -3320,7 +3332,7 @@
|
||||
};
|
||||
var Default$4 = {
|
||||
animation: true,
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
|
||||
trigger: 'hover focus',
|
||||
title: '',
|
||||
delay: 0,
|
||||
@ -3331,6 +3343,7 @@
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
allowList: DefaultAllowlist,
|
||||
@ -3364,26 +3377,30 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tooltip = /*#__PURE__*/function () {
|
||||
var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tooltip, _BaseComponent);
|
||||
|
||||
function Tooltip(element, config) {
|
||||
var _this;
|
||||
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
||||
} // private
|
||||
}
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this; // private
|
||||
|
||||
this._isEnabled = true;
|
||||
this._timeout = 0;
|
||||
this._hoverState = '';
|
||||
this._activeTrigger = {};
|
||||
this._popper = null; // Protected
|
||||
_this._isEnabled = true;
|
||||
_this._timeout = 0;
|
||||
_this._hoverState = '';
|
||||
_this._activeTrigger = {};
|
||||
_this._popper = null; // Protected
|
||||
|
||||
this.element = element;
|
||||
this.config = this._getConfig(config);
|
||||
this.tip = null;
|
||||
_this.config = _this._getConfig(config);
|
||||
_this.tip = null;
|
||||
|
||||
this._setListeners();
|
||||
_this._setListeners();
|
||||
|
||||
Data.setData(element, this.constructor.DATA_KEY, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -3436,9 +3453,8 @@
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
clearTimeout(this._timeout);
|
||||
Data.removeData(this.element, this.constructor.DATA_KEY);
|
||||
EventHandler.off(this.element, this.constructor.EVENT_KEY);
|
||||
EventHandler.off(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
||||
EventHandler.off(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.tip) {
|
||||
this.tip.parentNode.removeChild(this.tip);
|
||||
@ -3454,22 +3470,23 @@
|
||||
}
|
||||
|
||||
this._popper = null;
|
||||
this.element = null;
|
||||
this.config = null;
|
||||
this.tip = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this.element.style.display === 'none') {
|
||||
if (this._element.style.display === 'none') {
|
||||
throw new Error('Please use show on visible elements');
|
||||
}
|
||||
|
||||
if (this.isWithContent() && this._isEnabled) {
|
||||
var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this.element);
|
||||
var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
|
||||
var showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this._element);
|
||||
var isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
|
||||
|
||||
if (showEvent.defaultPrevented || !isInTheDom) {
|
||||
return;
|
||||
@ -3478,14 +3495,16 @@
|
||||
var tip = this.getTipElement();
|
||||
var tipId = getUID(this.constructor.NAME);
|
||||
tip.setAttribute('id', tipId);
|
||||
this.element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this._element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this.setContent();
|
||||
|
||||
if (this.config.animation) {
|
||||
tip.classList.add(CLASS_NAME_FADE$1);
|
||||
}
|
||||
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
|
||||
|
||||
var attachment = this._getAttachment(placement);
|
||||
|
||||
@ -3495,17 +3514,25 @@
|
||||
|
||||
Data.setData(tip, this.constructor.DATA_KEY, this);
|
||||
|
||||
if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
container.appendChild(tip);
|
||||
}
|
||||
|
||||
EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we add extra
|
||||
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper__default['default'](this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW$3);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
if (customClass) {
|
||||
var _tip$classList;
|
||||
|
||||
(_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
var _ref;
|
||||
|
||||
@ -3515,16 +3542,16 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this.config.animation) {
|
||||
_this._fixTransition();
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this._hoverState;
|
||||
_this._hoverState = null;
|
||||
EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler.trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
|
||||
if (prevHoverState === HOVER_STATE_OUT) {
|
||||
_this._leave(null, _this);
|
||||
_this2._leave(null, _this2);
|
||||
}
|
||||
};
|
||||
|
||||
@ -3539,7 +3566,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._popper) {
|
||||
return;
|
||||
@ -3548,20 +3575,20 @@
|
||||
var tip = this.getTipElement();
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
tip.parentNode.removeChild(tip);
|
||||
}
|
||||
|
||||
_this2._cleanTipClass();
|
||||
_this3._cleanTipClass();
|
||||
|
||||
_this2.element.removeAttribute('aria-describedby');
|
||||
_this3._element.removeAttribute('aria-describedby');
|
||||
|
||||
EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
|
||||
EventHandler.trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this2._popper.destroy();
|
||||
_this3._popper.destroy();
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
|
||||
var hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
||||
|
||||
if (hideEvent.defaultPrevented) {
|
||||
return;
|
||||
@ -3656,10 +3683,10 @@
|
||||
};
|
||||
|
||||
_proto.getTitle = function getTitle() {
|
||||
var title = this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (!title) {
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
|
||||
}
|
||||
|
||||
return title;
|
||||
@ -3667,7 +3694,7 @@
|
||||
;
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
@ -3685,11 +3712,11 @@
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
_this3._handlePopperPlacementChange(data);
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -3700,13 +3727,13 @@
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -3733,33 +3760,33 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
EventHandler.on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler.on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
});
|
||||
EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
EventHandler.on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this5.element) {
|
||||
_this5.hide();
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
}
|
||||
};
|
||||
|
||||
EventHandler.on(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler.on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = _extends({}, this.config, {
|
||||
@ -3772,12 +3799,18 @@
|
||||
};
|
||||
|
||||
_proto._fixTitle = function _fixTitle() {
|
||||
var title = this.element.getAttribute('title');
|
||||
var originalTitleType = typeof this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('title');
|
||||
|
||||
var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (title || originalTitleType !== 'string') {
|
||||
this.element.setAttribute('data-bs-original-title', title || '');
|
||||
this.element.setAttribute('title', '');
|
||||
this._element.setAttribute('data-bs-original-title', title || '');
|
||||
|
||||
if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
|
||||
this._element.setAttribute('aria-label', title);
|
||||
}
|
||||
|
||||
this._element.setAttribute('title', '');
|
||||
}
|
||||
};
|
||||
|
||||
@ -3857,7 +3890,7 @@
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
var dataAttributes = Manipulator.getDataAttributes(this.element);
|
||||
var dataAttributes = Manipulator.getDataAttributes(this._element);
|
||||
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
||||
if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
|
||||
delete dataAttributes[dataAttr];
|
||||
@ -3969,16 +4002,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
Tooltip.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$6);
|
||||
};
|
||||
|
||||
_createClass(Tooltip, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$6;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$4;
|
||||
@ -4011,7 +4035,7 @@
|
||||
}]);
|
||||
|
||||
return Tooltip;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
@ -4043,7 +4067,6 @@
|
||||
*/
|
||||
|
||||
var NAME$7 = 'popover';
|
||||
var VERSION$7 = '5.0.0-alpha3';
|
||||
var DATA_KEY$7 = 'bs.popover';
|
||||
var EVENT_KEY$7 = "." + DATA_KEY$7;
|
||||
var CLASS_PREFIX$1 = 'bs-popover';
|
||||
@ -4053,7 +4076,7 @@
|
||||
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>'
|
||||
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 = _extends({}, Tooltip.DefaultType, {
|
||||
@ -4104,7 +4127,7 @@
|
||||
var content = this._getContent();
|
||||
|
||||
if (typeof content === 'function') {
|
||||
content = content.call(this.element);
|
||||
content = content.call(this._element);
|
||||
}
|
||||
|
||||
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
||||
@ -4117,7 +4140,7 @@
|
||||
};
|
||||
|
||||
_proto._getContent = function _getContent() {
|
||||
return this.element.getAttribute('data-bs-content') || this.config.content;
|
||||
return this._element.getAttribute('data-bs-content') || this.config.content;
|
||||
};
|
||||
|
||||
_proto._cleanTipClass = function _cleanTipClass() {
|
||||
@ -4159,18 +4182,9 @@
|
||||
});
|
||||
};
|
||||
|
||||
Popover.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$7);
|
||||
};
|
||||
|
||||
_createClass(Popover, null, [{
|
||||
key: "VERSION",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$7;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return Default$5;
|
||||
}
|
||||
@ -4234,7 +4248,6 @@
|
||||
*/
|
||||
|
||||
var NAME$8 = 'scrollspy';
|
||||
var VERSION$8 = '5.0.0-alpha3';
|
||||
var DATA_KEY$8 = 'bs.scrollspy';
|
||||
var EVENT_KEY$8 = "." + DATA_KEY$8;
|
||||
var DATA_API_KEY$6 = '.data-api';
|
||||
@ -4268,26 +4281,29 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var ScrollSpy = /*#__PURE__*/function () {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this = this;
|
||||
var ScrollSpy = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(ScrollSpy, _BaseComponent);
|
||||
|
||||
this._element = element;
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
this._config = this._getConfig(config);
|
||||
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + ", " + this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
this._offsets = [];
|
||||
this._targets = [];
|
||||
this._activeTarget = null;
|
||||
this._scrollHeight = 0;
|
||||
EventHandler.on(this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._selector = _this._config.target + " " + SELECTOR_NAV_LINKS + ", " + _this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + _this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
_this._offsets = [];
|
||||
_this._targets = [];
|
||||
_this._activeTarget = null;
|
||||
_this._scrollHeight = 0;
|
||||
EventHandler.on(_this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
return _this._process(event);
|
||||
});
|
||||
this.refresh();
|
||||
|
||||
this._process();
|
||||
_this.refresh();
|
||||
|
||||
Data.setData(element, DATA_KEY$8, this);
|
||||
_this._process();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -4329,9 +4345,9 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$8);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler.off(this._scrollElement, EVENT_KEY$8);
|
||||
this._element = null;
|
||||
this._scrollElement = null;
|
||||
this._config = null;
|
||||
this._selector = null;
|
||||
@ -4476,24 +4492,20 @@
|
||||
});
|
||||
};
|
||||
|
||||
ScrollSpy.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$8);
|
||||
};
|
||||
|
||||
_createClass(ScrollSpy, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$8;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default$6;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$8;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ScrollSpy;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -4536,7 +4548,6 @@
|
||||
*/
|
||||
|
||||
var NAME$9 = 'tab';
|
||||
var VERSION$9 = '5.0.0-alpha3';
|
||||
var DATA_KEY$9 = 'bs.tab';
|
||||
var EVENT_KEY$9 = "." + DATA_KEY$9;
|
||||
var DATA_API_KEY$7 = '.data-api';
|
||||
@ -4563,12 +4574,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tab = /*#__PURE__*/function () {
|
||||
function Tab(element) {
|
||||
this._element = element;
|
||||
Data.setData(this._element, DATA_KEY$9, this);
|
||||
} // Getters
|
||||
var Tab = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tab, _BaseComponent);
|
||||
|
||||
function Tab() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Tab.prototype;
|
||||
|
||||
@ -4623,11 +4634,6 @@
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data.removeData(this._element, DATA_KEY$9);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -4710,19 +4716,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
Tab.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$9);
|
||||
};
|
||||
|
||||
_createClass(Tab, null, [{
|
||||
key: "VERSION",
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION$9;
|
||||
return DATA_KEY$9;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Tab;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -4765,7 +4768,6 @@
|
||||
*/
|
||||
|
||||
var NAME$a = 'toast';
|
||||
var VERSION$a = '5.0.0-alpha3';
|
||||
var DATA_KEY$a = 'bs.toast';
|
||||
var EVENT_KEY$a = "." + DATA_KEY$a;
|
||||
var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
|
||||
@ -4794,15 +4796,19 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Toast = /*#__PURE__*/function () {
|
||||
var Toast = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Toast, _BaseComponent);
|
||||
|
||||
function Toast(element, config) {
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._timeout = null;
|
||||
var _this;
|
||||
|
||||
this._setListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._timeout = null;
|
||||
|
||||
Data.setData(element, DATA_KEY$a, this);
|
||||
_this._setListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -4810,7 +4816,7 @@
|
||||
|
||||
// Public
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4);
|
||||
|
||||
@ -4825,16 +4831,16 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
_this2._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_SHOW$6);
|
||||
_this2._element.classList.add(CLASS_NAME_SHOW$6);
|
||||
|
||||
EventHandler.trigger(_this._element, EVENT_SHOWN$4);
|
||||
EventHandler.trigger(_this2._element, EVENT_SHOWN$4);
|
||||
|
||||
if (_this._config.autohide) {
|
||||
_this._timeout = setTimeout(function () {
|
||||
_this.hide();
|
||||
}, _this._config.delay);
|
||||
if (_this2._config.autohide) {
|
||||
_this2._timeout = setTimeout(function () {
|
||||
_this2.hide();
|
||||
}, _this2._config.delay);
|
||||
}
|
||||
};
|
||||
|
||||
@ -4854,7 +4860,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._element.classList.contains(CLASS_NAME_SHOW$6)) {
|
||||
return;
|
||||
@ -4867,9 +4873,9 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this2._element.classList.add(CLASS_NAME_HIDE);
|
||||
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||
|
||||
EventHandler.trigger(_this2._element, EVENT_HIDDEN$4);
|
||||
EventHandler.trigger(_this3._element, EVENT_HIDDEN$4);
|
||||
};
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
||||
@ -4891,8 +4897,9 @@
|
||||
}
|
||||
|
||||
EventHandler.off(this._element, EVENT_CLICK_DISMISS$1);
|
||||
Data.removeData(this._element, DATA_KEY$a);
|
||||
this._element = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
} // Private
|
||||
;
|
||||
@ -4904,10 +4911,10 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
|
||||
return _this3.hide();
|
||||
return _this4.hide();
|
||||
});
|
||||
};
|
||||
|
||||
@ -4937,16 +4944,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
Toast.getInstance = function getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY$a);
|
||||
};
|
||||
|
||||
_createClass(Toast, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION$a;
|
||||
}
|
||||
}, {
|
||||
key: "DefaultType",
|
||||
get: function get() {
|
||||
return DefaultType$7;
|
||||
@ -4956,10 +4954,15 @@
|
||||
get: function get() {
|
||||
return Default$7;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY$a;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Toast;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
|
2
dist/js/bootstrap.js.map
vendored
2
dist/js/bootstrap.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.min.js
vendored
2
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/bootstrap.min.js.map
vendored
2
dist/js/bootstrap.min.js.map
vendored
File diff suppressed because one or more lines are too long
80
js/dist/alert.js
vendored
80
js/dist/alert.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.Data, global.EventHandler));
|
||||
}(this, (function (Data, EventHandler) { 'use strict';
|
||||
|
||||
@ -112,8 +112,53 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
function _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'alert';
|
||||
var DATA_KEY = 'bs.alert';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -130,15 +175,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Alert = /*#__PURE__*/function () {
|
||||
function Alert(element) {
|
||||
this._element = element;
|
||||
|
||||
if (this._element) {
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
}
|
||||
} // Getters
|
||||
var Alert = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Alert, _BaseComponent);
|
||||
|
||||
function Alert() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Alert.prototype;
|
||||
|
||||
@ -153,11 +195,6 @@
|
||||
}
|
||||
|
||||
this._removeElement(rootElement);
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -220,19 +257,16 @@
|
||||
};
|
||||
};
|
||||
|
||||
Alert.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Alert, null, [{
|
||||
key: "VERSION",
|
||||
_createClass$1(Alert, null, [{
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Alert;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
|
2
js/dist/alert.js.map
vendored
2
js/dist/alert.js.map
vendored
File diff suppressed because one or more lines are too long
77
js/dist/button.js
vendored
77
js/dist/button.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.Data, global.EventHandler));
|
||||
}(this, (function (Data, EventHandler) { 'use strict';
|
||||
|
||||
@ -49,8 +49,53 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'button';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
function _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'button';
|
||||
var DATA_KEY = 'bs.button';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -63,12 +108,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Button = /*#__PURE__*/function () {
|
||||
function Button(element) {
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
} // Getters
|
||||
var Button = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Button, _BaseComponent);
|
||||
|
||||
function Button() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Button.prototype;
|
||||
|
||||
@ -76,11 +121,6 @@
|
||||
_proto.toggle = function toggle() {
|
||||
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
||||
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Static
|
||||
;
|
||||
|
||||
@ -98,19 +138,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
Button.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Button, null, [{
|
||||
key: "VERSION",
|
||||
_createClass$1(Button, null, [{
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Button;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
|
2
js/dist/button.js.map
vendored
2
js/dist/button.js.map
vendored
File diff suppressed because one or more lines are too long
163
js/dist/carousel.js
vendored
163
js/dist/carousel.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', './dom/selector-engine.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Carousel = factory(global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
|
||||
|
||||
@ -147,8 +147,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 _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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
@ -158,8 +156,55 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'carousel';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
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 _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'carousel';
|
||||
var DATA_KEY = 'bs.carousel';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -227,25 +272,29 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Carousel = /*#__PURE__*/function () {
|
||||
var Carousel = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Carousel, _BaseComponent);
|
||||
|
||||
function Carousel(element, config) {
|
||||
this._items = null;
|
||||
this._interval = null;
|
||||
this._activeElement = null;
|
||||
this._isPaused = false;
|
||||
this._isSliding = false;
|
||||
this.touchTimeout = null;
|
||||
this.touchStartX = 0;
|
||||
this.touchDeltaX = 0;
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._indicatorsElement = SelectorEngine__default['default'].findOne(SELECTOR_INDICATORS, this._element);
|
||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
this._pointerEvent = Boolean(window.PointerEvent);
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._items = null;
|
||||
_this._interval = null;
|
||||
_this._activeElement = null;
|
||||
_this._isPaused = false;
|
||||
_this._isSliding = false;
|
||||
_this.touchTimeout = null;
|
||||
_this.touchStartX = 0;
|
||||
_this.touchDeltaX = 0;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._indicatorsElement = SelectorEngine__default['default'].findOne(SELECTOR_INDICATORS, _this._element);
|
||||
_this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
|
||||
_this._pointerEvent = Boolean(window.PointerEvent);
|
||||
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -304,7 +353,7 @@
|
||||
};
|
||||
|
||||
_proto.to = function to(index) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
this._activeElement = SelectorEngine__default['default'].findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -316,7 +365,7 @@
|
||||
|
||||
if (this._isSliding) {
|
||||
EventHandler__default['default'].one(this._element, EVENT_SLID, function () {
|
||||
return _this.to(index);
|
||||
return _this2.to(index);
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -333,11 +382,11 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler__default['default'].off(this._element, EVENT_KEY);
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
this._items = null;
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._interval = null;
|
||||
this._isPaused = null;
|
||||
this._isSliding = null;
|
||||
@ -373,20 +422,20 @@
|
||||
};
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._config.keyboard) {
|
||||
EventHandler__default['default'].on(this._element, EVENT_KEYDOWN, function (event) {
|
||||
return _this2._keydown(event);
|
||||
return _this3._keydown(event);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
EventHandler__default['default'].on(this._element, EVENT_MOUSEENTER, function (event) {
|
||||
return _this2.pause(event);
|
||||
return _this3.pause(event);
|
||||
});
|
||||
EventHandler__default['default'].on(this._element, EVENT_MOUSELEAVE, function (event) {
|
||||
return _this2.cycle(event);
|
||||
return _this3.cycle(event);
|
||||
});
|
||||
}
|
||||
|
||||
@ -396,33 +445,33 @@
|
||||
};
|
||||
|
||||
_proto._addTouchEventListeners = function _addTouchEventListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var start = function start(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchStartX = event.clientX;
|
||||
} else if (!_this3._pointerEvent) {
|
||||
_this3.touchStartX = event.touches[0].clientX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchStartX = event.clientX;
|
||||
} else if (!_this4._pointerEvent) {
|
||||
_this4.touchStartX = event.touches[0].clientX;
|
||||
}
|
||||
};
|
||||
|
||||
var move = function move(event) {
|
||||
// ensure swiping with one touch and not pinching
|
||||
if (event.touches && event.touches.length > 1) {
|
||||
_this3.touchDeltaX = 0;
|
||||
_this4.touchDeltaX = 0;
|
||||
} else {
|
||||
_this3.touchDeltaX = event.touches[0].clientX - _this3.touchStartX;
|
||||
_this4.touchDeltaX = event.touches[0].clientX - _this4.touchStartX;
|
||||
}
|
||||
};
|
||||
|
||||
var end = function end(event) {
|
||||
if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this3.touchDeltaX = event.clientX - _this3.touchStartX;
|
||||
if (_this4._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
_this4.touchDeltaX = event.clientX - _this4.touchStartX;
|
||||
}
|
||||
|
||||
_this3._handleSwipe();
|
||||
_this4._handleSwipe();
|
||||
|
||||
if (_this3._config.pause === 'hover') {
|
||||
if (_this4._config.pause === 'hover') {
|
||||
// If it's a touch-enabled device, mouseenter/leave are fired as
|
||||
// part of the mouse compatibility events on first tap - the carousel
|
||||
// would stop cycling until user tapped out of it;
|
||||
@ -430,15 +479,15 @@
|
||||
// (as if it's the second time we tap on it, mouseenter compat event
|
||||
// is NOT fired) and after a timeout (to allow for mouse compatibility
|
||||
// events to fire) we explicitly restart cycling
|
||||
_this3.pause();
|
||||
_this4.pause();
|
||||
|
||||
if (_this3.touchTimeout) {
|
||||
clearTimeout(_this3.touchTimeout);
|
||||
if (_this4.touchTimeout) {
|
||||
clearTimeout(_this4.touchTimeout);
|
||||
}
|
||||
|
||||
_this3.touchTimeout = setTimeout(function (event) {
|
||||
return _this3.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
|
||||
_this4.touchTimeout = setTimeout(function (event) {
|
||||
return _this4.cycle(event);
|
||||
}, TOUCHEVENT_COMPAT_WAIT + _this4._config.interval);
|
||||
}
|
||||
};
|
||||
|
||||
@ -558,7 +607,7 @@
|
||||
};
|
||||
|
||||
_proto._slide = function _slide(direction, element) {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var activeElement = SelectorEngine__default['default'].findOne(SELECTOR_ACTIVE_ITEM, this._element);
|
||||
|
||||
@ -619,9 +668,9 @@
|
||||
nextElement.classList.remove(directionalClassName, orderClassName);
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE);
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName);
|
||||
_this4._isSliding = false;
|
||||
_this5._isSliding = false;
|
||||
setTimeout(function () {
|
||||
EventHandler__default['default'].trigger(_this4._element, EVENT_SLID, {
|
||||
EventHandler__default['default'].trigger(_this5._element, EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
@ -707,24 +756,20 @@
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
Carousel.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Carousel, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
_createClass$1(Carousel, null, [{
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Carousel;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
|
2
js/dist/carousel.js.map
vendored
2
js/dist/carousel.js.map
vendored
File diff suppressed because one or more lines are too long
135
js/dist/collapse.js
vendored
135
js/dist/collapse.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', './dom/selector-engine.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Collapse = factory(global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
|
||||
|
||||
@ -143,8 +143,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 _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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
@ -154,8 +152,55 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'collapse';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
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 _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'collapse';
|
||||
var DATA_KEY = 'bs.collapse';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -186,12 +231,16 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Collapse = /*#__PURE__*/function () {
|
||||
var Collapse = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Collapse, _BaseComponent);
|
||||
|
||||
function Collapse(element, config) {
|
||||
this._isTransitioning = false;
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._triggerArray = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._isTransitioning = false;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._triggerArray = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE + "[data-bs-target=\"#" + element.id + "\"]"));
|
||||
var toggleList = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE);
|
||||
|
||||
for (var i = 0, len = toggleList.length; i < len; i++) {
|
||||
@ -202,23 +251,23 @@
|
||||
});
|
||||
|
||||
if (selector !== null && filterElement.length) {
|
||||
this._selector = selector;
|
||||
_this._selector = selector;
|
||||
|
||||
this._triggerArray.push(elem);
|
||||
_this._triggerArray.push(elem);
|
||||
}
|
||||
}
|
||||
|
||||
this._parent = this._config.parent ? this._getParent() : null;
|
||||
_this._parent = _this._config.parent ? _this._getParent() : null;
|
||||
|
||||
if (!this._config.parent) {
|
||||
this._addAriaAndCollapsedClass(this._element, this._triggerArray);
|
||||
if (!_this._config.parent) {
|
||||
_this._addAriaAndCollapsedClass(_this._element, _this._triggerArray);
|
||||
}
|
||||
|
||||
if (this._config.toggle) {
|
||||
this.toggle();
|
||||
if (_this._config.toggle) {
|
||||
_this.toggle();
|
||||
}
|
||||
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -234,7 +283,7 @@
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -245,8 +294,8 @@
|
||||
|
||||
if (this._parent) {
|
||||
actives = SelectorEngine__default['default'].find(SELECTOR_ACTIVES, this._parent).filter(function (elem) {
|
||||
if (typeof _this._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this._config.parent;
|
||||
if (typeof _this2._config.parent === 'string') {
|
||||
return elem.getAttribute('data-bs-parent') === _this2._config.parent;
|
||||
}
|
||||
|
||||
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
||||
@ -306,15 +355,15 @@
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
_this._element.style[dimension] = '';
|
||||
_this2._element.style[dimension] = '';
|
||||
|
||||
_this.setTransitioning(false);
|
||||
_this2.setTransitioning(false);
|
||||
|
||||
EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN);
|
||||
EventHandler__default['default'].trigger(_this2._element, EVENT_SHOWN);
|
||||
};
|
||||
|
||||
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
@ -326,7 +375,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -364,13 +413,13 @@
|
||||
this.setTransitioning(true);
|
||||
|
||||
var complete = function complete() {
|
||||
_this2.setTransitioning(false);
|
||||
_this3.setTransitioning(false);
|
||||
|
||||
_this2._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
_this3._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
|
||||
_this2._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
_this3._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
|
||||
EventHandler__default['default'].trigger(_this2._element, EVENT_HIDDEN);
|
||||
EventHandler__default['default'].trigger(_this3._element, EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
@ -384,10 +433,10 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
this._parent = null;
|
||||
this._element = null;
|
||||
this._triggerArray = null;
|
||||
this._isTransitioning = null;
|
||||
} // Private
|
||||
@ -406,7 +455,7 @@
|
||||
};
|
||||
|
||||
_proto._getParent = function _getParent() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var parent = this._config.parent;
|
||||
|
||||
@ -423,7 +472,7 @@
|
||||
SelectorEngine__default['default'].find(selector, parent).forEach(function (element) {
|
||||
var selected = getElementFromSelector(element);
|
||||
|
||||
_this3._addAriaAndCollapsedClass(selected, [element]);
|
||||
_this4._addAriaAndCollapsedClass(selected, [element]);
|
||||
});
|
||||
return parent;
|
||||
};
|
||||
@ -474,24 +523,20 @@
|
||||
});
|
||||
};
|
||||
|
||||
Collapse.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Collapse, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
_createClass$1(Collapse, null, [{
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Collapse;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
|
2
js/dist/collapse.js.map
vendored
2
js/dist/collapse.js.map
vendored
File diff suppressed because one or more lines are too long
2
js/dist/dom/event-handler.js.map
vendored
2
js/dist/dom/event-handler.js.map
vendored
File diff suppressed because one or more lines are too long
110
js/dist/dropdown.js
vendored
110
js/dist/dropdown.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', 'popper.js', './dom/selector-engine.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', 'popper.js', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict';
|
||||
|
||||
@ -101,8 +101,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 _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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
@ -112,8 +110,55 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'dropdown';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
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 _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'dropdown';
|
||||
var DATA_KEY = 'bs.dropdown';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -174,17 +219,21 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Dropdown = /*#__PURE__*/function () {
|
||||
var Dropdown = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Dropdown, _BaseComponent);
|
||||
|
||||
function Dropdown(element, config) {
|
||||
this._element = element;
|
||||
this._popper = null;
|
||||
this._config = this._getConfig(config);
|
||||
this._menu = this._getMenuElement();
|
||||
this._inNavbar = this._detectNavbar();
|
||||
var _this;
|
||||
|
||||
this._addEventListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._popper = null;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._menu = _this._getMenuElement();
|
||||
_this._inNavbar = _this._detectNavbar();
|
||||
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
_this._addEventListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -300,9 +349,9 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler__default['default'].off(this._element, EVENT_KEY);
|
||||
this._element = null;
|
||||
this._menu = null;
|
||||
|
||||
if (this._popper) {
|
||||
@ -322,13 +371,13 @@
|
||||
;
|
||||
|
||||
_proto._addEventListeners = function _addEventListeners() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
EventHandler__default['default'].on(this._element, EVENT_CLICK, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
_this.toggle();
|
||||
_this2.toggle();
|
||||
});
|
||||
};
|
||||
|
||||
@ -364,13 +413,13 @@
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this._config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this3._config.offset(data.offsets, _this3._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -532,15 +581,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var index = items.indexOf(event.target);
|
||||
var index = items.indexOf(event.target); // Up
|
||||
|
||||
if (event.key === ARROW_UP_KEY && index > 0) {
|
||||
// Up
|
||||
index--;
|
||||
}
|
||||
} // Down
|
||||
|
||||
|
||||
if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
|
||||
// Down
|
||||
index++;
|
||||
} // index is -1 if the first keydown is an ArrowUp
|
||||
|
||||
@ -549,16 +597,7 @@
|
||||
items[index].focus();
|
||||
};
|
||||
|
||||
Dropdown.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Dropdown, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
_createClass$1(Dropdown, null, [{
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
@ -568,10 +607,15 @@
|
||||
get: function get() {
|
||||
return DefaultType;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Dropdown;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
|
2
js/dist/dropdown.js.map
vendored
2
js/dist/dropdown.js.map
vendored
File diff suppressed because one or more lines are too long
200
js/dist/modal.js
vendored
200
js/dist/modal.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', './dom/selector-engine.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Modal = factory(global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
|
||||
|
||||
@ -147,8 +147,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 _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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
@ -158,8 +156,55 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'modal';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
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 _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'modal';
|
||||
var DATA_KEY = 'bs.modal';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -167,14 +212,12 @@
|
||||
var Default = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
focus: true,
|
||||
show: true
|
||||
focus: true
|
||||
};
|
||||
var DefaultType = {
|
||||
backdrop: '(boolean|string)',
|
||||
keyboard: 'boolean',
|
||||
focus: 'boolean',
|
||||
show: 'boolean'
|
||||
focus: 'boolean'
|
||||
};
|
||||
var EVENT_HIDE = "hide" + EVENT_KEY;
|
||||
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY;
|
||||
@ -206,18 +249,22 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Modal = /*#__PURE__*/function () {
|
||||
var Modal = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Modal, _BaseComponent);
|
||||
|
||||
function Modal(element, config) {
|
||||
this._config = this._getConfig(config);
|
||||
this._element = element;
|
||||
this._dialog = SelectorEngine__default['default'].findOne(SELECTOR_DIALOG, element);
|
||||
this._backdrop = null;
|
||||
this._isShown = false;
|
||||
this._isBodyOverflowing = false;
|
||||
this._ignoreBackdropClick = false;
|
||||
this._isTransitioning = false;
|
||||
this._scrollbarWidth = 0;
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._dialog = SelectorEngine__default['default'].findOne(SELECTOR_DIALOG, element);
|
||||
_this._backdrop = null;
|
||||
_this._isShown = false;
|
||||
_this._isBodyOverflowing = false;
|
||||
_this._ignoreBackdropClick = false;
|
||||
_this._isTransitioning = false;
|
||||
_this._scrollbarWidth = 0;
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -229,7 +276,7 @@
|
||||
};
|
||||
|
||||
_proto.show = function show(relatedTarget) {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this._isShown || this._isTransitioning) {
|
||||
return;
|
||||
@ -260,23 +307,23 @@
|
||||
this._setResizeEvent();
|
||||
|
||||
EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
|
||||
return _this.hide(event);
|
||||
return _this2.hide(event);
|
||||
});
|
||||
EventHandler__default['default'].on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
|
||||
EventHandler__default['default'].one(_this._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this._element) {
|
||||
_this._ignoreBackdropClick = true;
|
||||
EventHandler__default['default'].one(_this2._element, EVENT_MOUSEUP_DISMISS, function (event) {
|
||||
if (event.target === _this2._element) {
|
||||
_this2._ignoreBackdropClick = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this._showBackdrop(function () {
|
||||
return _this._showElement(relatedTarget);
|
||||
return _this2._showElement(relatedTarget);
|
||||
});
|
||||
};
|
||||
|
||||
_proto.hide = function hide(event) {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
@ -314,7 +361,7 @@
|
||||
if (transition) {
|
||||
var transitionDuration = getTransitionDurationFromElement(this._element);
|
||||
EventHandler__default['default'].one(this._element, TRANSITION_END, function (event) {
|
||||
return _this2._hideModal(event);
|
||||
return _this3._hideModal(event);
|
||||
});
|
||||
emulateTransitionEnd(this._element, transitionDuration);
|
||||
} else {
|
||||
@ -326,16 +373,17 @@
|
||||
[window, this._element, this._dialog].forEach(function (htmlElement) {
|
||||
return EventHandler__default['default'].off(htmlElement, EVENT_KEY);
|
||||
});
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
/**
|
||||
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
||||
* Do not move `document` in `htmlElements` array
|
||||
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
|
||||
|
||||
EventHandler__default['default'].off(document, EVENT_FOCUSIN);
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
this._config = null;
|
||||
this._element = null;
|
||||
this._dialog = null;
|
||||
this._backdrop = null;
|
||||
this._isShown = null;
|
||||
@ -357,7 +405,7 @@
|
||||
};
|
||||
|
||||
_proto._showElement = function _showElement(relatedTarget) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var transition = this._element.classList.contains(CLASS_NAME_FADE);
|
||||
|
||||
@ -393,12 +441,12 @@
|
||||
}
|
||||
|
||||
var transitionComplete = function transitionComplete() {
|
||||
if (_this3._config.focus) {
|
||||
_this3._element.focus();
|
||||
if (_this4._config.focus) {
|
||||
_this4._element.focus();
|
||||
}
|
||||
|
||||
_this3._isTransitioning = false;
|
||||
EventHandler__default['default'].trigger(_this3._element, EVENT_SHOWN, {
|
||||
_this4._isTransitioning = false;
|
||||
EventHandler__default['default'].trigger(_this4._element, EVENT_SHOWN, {
|
||||
relatedTarget: relatedTarget
|
||||
});
|
||||
};
|
||||
@ -413,28 +461,28 @@
|
||||
};
|
||||
|
||||
_proto._enforceFocus = function _enforceFocus() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
EventHandler__default['default'].off(document, EVENT_FOCUSIN); // guard against infinite focus loop
|
||||
|
||||
EventHandler__default['default'].on(document, EVENT_FOCUSIN, function (event) {
|
||||
if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
|
||||
_this4._element.focus();
|
||||
if (document !== event.target && _this5._element !== event.target && !_this5._element.contains(event.target)) {
|
||||
_this5._element.focus();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
_proto._setEscapeEvent = function _setEscapeEvent() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler__default['default'].on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
|
||||
if (_this5._config.keyboard && event.key === ESCAPE_KEY) {
|
||||
if (_this6._config.keyboard && event.key === ESCAPE_KEY) {
|
||||
event.preventDefault();
|
||||
|
||||
_this5.hide();
|
||||
} else if (!_this5._config.keyboard && event.key === ESCAPE_KEY) {
|
||||
_this5._triggerBackdropTransition();
|
||||
_this6.hide();
|
||||
} else if (!_this6._config.keyboard && event.key === ESCAPE_KEY) {
|
||||
_this6._triggerBackdropTransition();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -443,11 +491,11 @@
|
||||
};
|
||||
|
||||
_proto._setResizeEvent = function _setResizeEvent() {
|
||||
var _this6 = this;
|
||||
var _this7 = this;
|
||||
|
||||
if (this._isShown) {
|
||||
EventHandler__default['default'].on(window, EVENT_RESIZE, function () {
|
||||
return _this6._adjustDialog();
|
||||
return _this7._adjustDialog();
|
||||
});
|
||||
} else {
|
||||
EventHandler__default['default'].off(window, EVENT_RESIZE);
|
||||
@ -455,7 +503,7 @@
|
||||
};
|
||||
|
||||
_proto._hideModal = function _hideModal() {
|
||||
var _this7 = this;
|
||||
var _this8 = this;
|
||||
|
||||
this._element.style.display = 'none';
|
||||
|
||||
@ -470,11 +518,11 @@
|
||||
this._showBackdrop(function () {
|
||||
document.body.classList.remove(CLASS_NAME_OPEN);
|
||||
|
||||
_this7._resetAdjustments();
|
||||
_this8._resetAdjustments();
|
||||
|
||||
_this7._resetScrollbar();
|
||||
_this8._resetScrollbar();
|
||||
|
||||
EventHandler__default['default'].trigger(_this7._element, EVENT_HIDDEN);
|
||||
EventHandler__default['default'].trigger(_this8._element, EVENT_HIDDEN);
|
||||
});
|
||||
};
|
||||
|
||||
@ -485,7 +533,7 @@
|
||||
};
|
||||
|
||||
_proto._showBackdrop = function _showBackdrop(callback) {
|
||||
var _this8 = this;
|
||||
var _this9 = this;
|
||||
|
||||
var animate = this._element.classList.contains(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
|
||||
|
||||
@ -499,8 +547,8 @@
|
||||
|
||||
document.body.appendChild(this._backdrop);
|
||||
EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, function (event) {
|
||||
if (_this8._ignoreBackdropClick) {
|
||||
_this8._ignoreBackdropClick = false;
|
||||
if (_this9._ignoreBackdropClick) {
|
||||
_this9._ignoreBackdropClick = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -508,10 +556,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (_this8._config.backdrop === 'static') {
|
||||
_this8._triggerBackdropTransition();
|
||||
if (_this9._config.backdrop === 'static') {
|
||||
_this9._triggerBackdropTransition();
|
||||
} else {
|
||||
_this8.hide();
|
||||
_this9.hide();
|
||||
}
|
||||
});
|
||||
|
||||
@ -533,7 +581,7 @@
|
||||
this._backdrop.classList.remove(CLASS_NAME_SHOW);
|
||||
|
||||
var callbackRemove = function callbackRemove() {
|
||||
_this8._removeBackdrop();
|
||||
_this9._removeBackdrop();
|
||||
|
||||
callback();
|
||||
};
|
||||
@ -552,7 +600,7 @@
|
||||
};
|
||||
|
||||
_proto._triggerBackdropTransition = function _triggerBackdropTransition() {
|
||||
var _this9 = this;
|
||||
var _this10 = this;
|
||||
|
||||
var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE_PREVENTED);
|
||||
|
||||
@ -571,13 +619,13 @@
|
||||
var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
|
||||
EventHandler__default['default'].off(this._element, TRANSITION_END);
|
||||
EventHandler__default['default'].one(this._element, TRANSITION_END, function () {
|
||||
_this9._element.classList.remove(CLASS_NAME_STATIC);
|
||||
_this10._element.classList.remove(CLASS_NAME_STATIC);
|
||||
|
||||
if (!isModalOverflowing) {
|
||||
EventHandler__default['default'].one(_this9._element, TRANSITION_END, function () {
|
||||
_this9._element.style.overflowY = '';
|
||||
EventHandler__default['default'].one(_this10._element, TRANSITION_END, function () {
|
||||
_this10._element.style.overflowY = '';
|
||||
});
|
||||
emulateTransitionEnd(_this9._element, modalTransitionDuration);
|
||||
emulateTransitionEnd(_this10._element, modalTransitionDuration);
|
||||
}
|
||||
});
|
||||
emulateTransitionEnd(this._element, modalTransitionDuration);
|
||||
@ -612,7 +660,7 @@
|
||||
};
|
||||
|
||||
_proto._setScrollbar = function _setScrollbar() {
|
||||
var _this10 = this;
|
||||
var _this11 = this;
|
||||
|
||||
if (this._isBodyOverflowing) {
|
||||
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
|
||||
@ -622,14 +670,14 @@
|
||||
var actualPadding = element.style.paddingRight;
|
||||
var calculatedPadding = window.getComputedStyle(element)['padding-right'];
|
||||
Manipulator__default['default'].setDataAttribute(element, 'padding-right', actualPadding);
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px";
|
||||
element.style.paddingRight = Number.parseFloat(calculatedPadding) + _this11._scrollbarWidth + "px";
|
||||
}); // Adjust sticky content margin
|
||||
|
||||
SelectorEngine__default['default'].find(SELECTOR_STICKY_CONTENT).forEach(function (element) {
|
||||
var actualMargin = element.style.marginRight;
|
||||
var calculatedMargin = window.getComputedStyle(element)['margin-right'];
|
||||
Manipulator__default['default'].setDataAttribute(element, 'margin-right', actualMargin);
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px";
|
||||
element.style.marginRight = Number.parseFloat(calculatedMargin) - _this11._scrollbarWidth + "px";
|
||||
}); // Adjust body padding
|
||||
|
||||
var actualPadding = document.body.style.paddingRight;
|
||||
@ -698,30 +746,24 @@
|
||||
}
|
||||
|
||||
data[config](relatedTarget);
|
||||
} else if (_config.show) {
|
||||
data.show(relatedTarget);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Modal.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Modal, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
_createClass$1(Modal, null, [{
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Modal;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
@ -730,7 +772,7 @@
|
||||
|
||||
|
||||
EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
var _this11 = this;
|
||||
var _this12 = this;
|
||||
|
||||
var target = getElementFromSelector(this);
|
||||
|
||||
@ -745,8 +787,8 @@
|
||||
}
|
||||
|
||||
EventHandler__default['default'].one(target, EVENT_HIDDEN, function () {
|
||||
if (isVisible(_this11)) {
|
||||
_this11.focus();
|
||||
if (isVisible(_this12)) {
|
||||
_this12.focus();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
2
js/dist/modal.js.map
vendored
2
js/dist/modal.js.map
vendored
File diff suppressed because one or more lines are too long
20
js/dist/popover.js
vendored
20
js/dist/popover.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/selector-engine.js'), require('./tooltip.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/selector-engine.js', './tooltip.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/selector-engine', './tooltip'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Popover = factory(global.Data, global.SelectorEngine, global.Tooltip));
|
||||
}(this, (function (Data, SelectorEngine, Tooltip) { 'use strict';
|
||||
|
||||
@ -55,7 +55,6 @@
|
||||
*/
|
||||
|
||||
var NAME = 'popover';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
var DATA_KEY = 'bs.popover';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var CLASS_PREFIX = 'bs-popover';
|
||||
@ -65,7 +64,7 @@
|
||||
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>'
|
||||
template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div>' + '</div>'
|
||||
});
|
||||
|
||||
var DefaultType = _extends({}, Tooltip__default['default'].DefaultType, {
|
||||
@ -116,7 +115,7 @@
|
||||
var content = this._getContent();
|
||||
|
||||
if (typeof content === 'function') {
|
||||
content = content.call(this.element);
|
||||
content = content.call(this._element);
|
||||
}
|
||||
|
||||
this.setElementContent(SelectorEngine__default['default'].findOne(SELECTOR_CONTENT, tip), content);
|
||||
@ -129,7 +128,7 @@
|
||||
};
|
||||
|
||||
_proto._getContent = function _getContent() {
|
||||
return this.element.getAttribute('data-bs-content') || this.config.content;
|
||||
return this._element.getAttribute('data-bs-content') || this.config.content;
|
||||
};
|
||||
|
||||
_proto._cleanTipClass = function _cleanTipClass() {
|
||||
@ -171,18 +170,9 @@
|
||||
});
|
||||
};
|
||||
|
||||
Popover.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Popover, null, [{
|
||||
key: "VERSION",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
key: "Default",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
|
2
js/dist/popover.js.map
vendored
2
js/dist/popover.js.map
vendored
File diff suppressed because one or more lines are too long
108
js/dist/scrollspy.js
vendored
108
js/dist/scrollspy.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', './dom/selector-engine.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ScrollSpy = factory(global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, SelectorEngine) { 'use strict';
|
||||
|
||||
@ -102,8 +102,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 _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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
@ -113,8 +111,55 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'scrollspy';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
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 _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'scrollspy';
|
||||
var DATA_KEY = 'bs.scrollspy';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -148,26 +193,29 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var ScrollSpy = /*#__PURE__*/function () {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this = this;
|
||||
var ScrollSpy = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(ScrollSpy, _BaseComponent);
|
||||
|
||||
this._element = element;
|
||||
this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
this._config = this._getConfig(config);
|
||||
this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + ", " + this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
this._offsets = [];
|
||||
this._targets = [];
|
||||
this._activeTarget = null;
|
||||
this._scrollHeight = 0;
|
||||
EventHandler__default['default'].on(this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
function ScrollSpy(element, config) {
|
||||
var _this;
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._scrollElement = element.tagName === 'BODY' ? window : element;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._selector = _this._config.target + " " + SELECTOR_NAV_LINKS + ", " + _this._config.target + " " + SELECTOR_LIST_ITEMS + ", " + _this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM;
|
||||
_this._offsets = [];
|
||||
_this._targets = [];
|
||||
_this._activeTarget = null;
|
||||
_this._scrollHeight = 0;
|
||||
EventHandler__default['default'].on(_this._scrollElement, EVENT_SCROLL, function (event) {
|
||||
return _this._process(event);
|
||||
});
|
||||
this.refresh();
|
||||
|
||||
this._process();
|
||||
_this.refresh();
|
||||
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
_this._process();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -209,9 +257,9 @@
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
EventHandler__default['default'].off(this._scrollElement, EVENT_KEY);
|
||||
this._element = null;
|
||||
this._scrollElement = null;
|
||||
this._config = null;
|
||||
this._selector = null;
|
||||
@ -356,24 +404,20 @@
|
||||
});
|
||||
};
|
||||
|
||||
ScrollSpy.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(ScrollSpy, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
_createClass$1(ScrollSpy, null, [{
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return ScrollSpy;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
|
2
js/dist/scrollspy.js.map
vendored
2
js/dist/scrollspy.js.map
vendored
File diff suppressed because one or more lines are too long
77
js/dist/tab.js
vendored
77
js/dist/tab.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/selector-engine.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tab = factory(global.Data, global.EventHandler, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, SelectorEngine) { 'use strict';
|
||||
|
||||
@ -117,8 +117,53 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'tab';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
function _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'tab';
|
||||
var DATA_KEY = 'bs.tab';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var DATA_API_KEY = '.data-api';
|
||||
@ -145,12 +190,12 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tab = /*#__PURE__*/function () {
|
||||
function Tab(element) {
|
||||
this._element = element;
|
||||
Data__default['default'].setData(this._element, DATA_KEY, this);
|
||||
} // Getters
|
||||
var Tab = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tab, _BaseComponent);
|
||||
|
||||
function Tab() {
|
||||
return _BaseComponent.apply(this, arguments) || this;
|
||||
}
|
||||
|
||||
var _proto = Tab.prototype;
|
||||
|
||||
@ -205,11 +250,6 @@
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
};
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
} // Private
|
||||
;
|
||||
|
||||
@ -292,19 +332,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
Tab.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Tab, null, [{
|
||||
key: "VERSION",
|
||||
_createClass$1(Tab, null, [{
|
||||
key: "DATA_KEY",
|
||||
// Getters
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Tab;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
|
2
js/dist/tab.js.map
vendored
2
js/dist/tab.js.map
vendored
File diff suppressed because one or more lines are too long
118
js/dist/toast.js
vendored
118
js/dist/toast.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Toast = factory(global.Data, global.EventHandler, global.Manipulator));
|
||||
}(this, (function (Data, EventHandler, Manipulator) { 'use strict';
|
||||
|
||||
@ -116,8 +116,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 _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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
@ -127,8 +125,55 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'toast';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
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 _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'toast';
|
||||
var DATA_KEY = 'bs.toast';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
|
||||
@ -157,15 +202,19 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Toast = /*#__PURE__*/function () {
|
||||
var Toast = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Toast, _BaseComponent);
|
||||
|
||||
function Toast(element, config) {
|
||||
this._element = element;
|
||||
this._config = this._getConfig(config);
|
||||
this._timeout = null;
|
||||
var _this;
|
||||
|
||||
this._setListeners();
|
||||
_this = _BaseComponent.call(this, element) || this;
|
||||
_this._config = _this._getConfig(config);
|
||||
_this._timeout = null;
|
||||
|
||||
Data__default['default'].setData(element, DATA_KEY, this);
|
||||
_this._setListeners();
|
||||
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -173,7 +222,7 @@
|
||||
|
||||
// Public
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
|
||||
|
||||
@ -188,16 +237,16 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
_this2._element.classList.remove(CLASS_NAME_SHOWING);
|
||||
|
||||
_this._element.classList.add(CLASS_NAME_SHOW);
|
||||
_this2._element.classList.add(CLASS_NAME_SHOW);
|
||||
|
||||
EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN);
|
||||
EventHandler__default['default'].trigger(_this2._element, EVENT_SHOWN);
|
||||
|
||||
if (_this._config.autohide) {
|
||||
_this._timeout = setTimeout(function () {
|
||||
_this.hide();
|
||||
}, _this._config.delay);
|
||||
if (_this2._config.autohide) {
|
||||
_this2._timeout = setTimeout(function () {
|
||||
_this2.hide();
|
||||
}, _this2._config.delay);
|
||||
}
|
||||
};
|
||||
|
||||
@ -217,7 +266,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._element.classList.contains(CLASS_NAME_SHOW)) {
|
||||
return;
|
||||
@ -230,9 +279,9 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
_this2._element.classList.add(CLASS_NAME_HIDE);
|
||||
_this3._element.classList.add(CLASS_NAME_HIDE);
|
||||
|
||||
EventHandler__default['default'].trigger(_this2._element, EVENT_HIDDEN);
|
||||
EventHandler__default['default'].trigger(_this3._element, EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_SHOW);
|
||||
@ -254,8 +303,9 @@
|
||||
}
|
||||
|
||||
EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
|
||||
Data__default['default'].removeData(this._element, DATA_KEY);
|
||||
this._element = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
|
||||
this._config = null;
|
||||
} // Private
|
||||
;
|
||||
@ -267,10 +317,10 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
|
||||
return _this3.hide();
|
||||
return _this4.hide();
|
||||
});
|
||||
};
|
||||
|
||||
@ -300,16 +350,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
Toast.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Toast, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
_createClass$1(Toast, null, [{
|
||||
key: "DefaultType",
|
||||
get: function get() {
|
||||
return DefaultType;
|
||||
@ -319,10 +360,15 @@
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}, {
|
||||
key: "DATA_KEY",
|
||||
get: function get() {
|
||||
return DATA_KEY;
|
||||
}
|
||||
}]);
|
||||
|
||||
return Toast;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
|
2
js/dist/toast.js.map
vendored
2
js/dist/toast.js.map
vendored
File diff suppressed because one or more lines are too long
218
js/dist/tooltip.js
vendored
218
js/dist/tooltip.js
vendored
@ -5,7 +5,7 @@
|
||||
*/
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', 'popper.js', './dom/selector-engine.js'], factory) :
|
||||
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './dom/manipulator', 'popper.js', './dom/selector-engine'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine));
|
||||
}(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict';
|
||||
|
||||
@ -283,8 +283,6 @@
|
||||
return createdDocument.body.innerHTML;
|
||||
}
|
||||
|
||||
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 _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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
@ -294,8 +292,55 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'tooltip';
|
||||
var VERSION = '5.0.0-alpha3';
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
|
||||
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 _defineProperties$1(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); } }
|
||||
|
||||
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var NAME = 'tooltip';
|
||||
var DATA_KEY = 'bs.tooltip';
|
||||
var EVENT_KEY = "." + DATA_KEY;
|
||||
var CLASS_PREFIX = 'bs-tooltip';
|
||||
@ -314,6 +359,7 @@
|
||||
container: '(string|element|boolean)',
|
||||
fallbackPlacement: '(string|array)',
|
||||
boundary: '(string|element)',
|
||||
customClass: '(string|function)',
|
||||
sanitize: 'boolean',
|
||||
sanitizeFn: '(null|function)',
|
||||
allowList: 'object',
|
||||
@ -328,7 +374,7 @@
|
||||
};
|
||||
var Default = {
|
||||
animation: true,
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div></div>',
|
||||
template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-arrow"></div>' + '<div class="tooltip-inner"></div>' + '</div>',
|
||||
trigger: 'hover focus',
|
||||
title: '',
|
||||
delay: 0,
|
||||
@ -339,6 +385,7 @@
|
||||
container: false,
|
||||
fallbackPlacement: 'flip',
|
||||
boundary: 'scrollParent',
|
||||
customClass: '',
|
||||
sanitize: true,
|
||||
sanitizeFn: null,
|
||||
allowList: DefaultAllowlist,
|
||||
@ -372,26 +419,30 @@
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Tooltip = /*#__PURE__*/function () {
|
||||
var Tooltip = /*#__PURE__*/function (_BaseComponent) {
|
||||
_inheritsLoose(Tooltip, _BaseComponent);
|
||||
|
||||
function Tooltip(element, config) {
|
||||
var _this;
|
||||
|
||||
if (typeof Popper__default['default'] === 'undefined') {
|
||||
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
||||
} // private
|
||||
}
|
||||
|
||||
_this = _BaseComponent.call(this, element) || this; // private
|
||||
|
||||
this._isEnabled = true;
|
||||
this._timeout = 0;
|
||||
this._hoverState = '';
|
||||
this._activeTrigger = {};
|
||||
this._popper = null; // Protected
|
||||
_this._isEnabled = true;
|
||||
_this._timeout = 0;
|
||||
_this._hoverState = '';
|
||||
_this._activeTrigger = {};
|
||||
_this._popper = null; // Protected
|
||||
|
||||
this.element = element;
|
||||
this.config = this._getConfig(config);
|
||||
this.tip = null;
|
||||
_this.config = _this._getConfig(config);
|
||||
_this.tip = null;
|
||||
|
||||
this._setListeners();
|
||||
_this._setListeners();
|
||||
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
return _this;
|
||||
} // Getters
|
||||
|
||||
|
||||
@ -444,9 +495,8 @@
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
clearTimeout(this._timeout);
|
||||
Data__default['default'].removeData(this.element, this.constructor.DATA_KEY);
|
||||
EventHandler__default['default'].off(this.element, this.constructor.EVENT_KEY);
|
||||
EventHandler__default['default'].off(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler__default['default'].off(this._element, this.constructor.EVENT_KEY);
|
||||
EventHandler__default['default'].off(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.tip) {
|
||||
this.tip.parentNode.removeChild(this.tip);
|
||||
@ -462,22 +512,23 @@
|
||||
}
|
||||
|
||||
this._popper = null;
|
||||
this.element = null;
|
||||
this.config = null;
|
||||
this.tip = null;
|
||||
|
||||
_BaseComponent.prototype.dispose.call(this);
|
||||
};
|
||||
|
||||
_proto.show = function show() {
|
||||
var _this = this;
|
||||
var _this2 = this;
|
||||
|
||||
if (this.element.style.display === 'none') {
|
||||
if (this._element.style.display === 'none') {
|
||||
throw new Error('Please use show on visible elements');
|
||||
}
|
||||
|
||||
if (this.isWithContent() && this._isEnabled) {
|
||||
var showEvent = EventHandler__default['default'].trigger(this.element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this.element);
|
||||
var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
|
||||
var showEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.SHOW);
|
||||
var shadowRoot = findShadowRoot(this._element);
|
||||
var isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
|
||||
|
||||
if (showEvent.defaultPrevented || !isInTheDom) {
|
||||
return;
|
||||
@ -486,14 +537,16 @@
|
||||
var tip = this.getTipElement();
|
||||
var tipId = getUID(this.constructor.NAME);
|
||||
tip.setAttribute('id', tipId);
|
||||
this.element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this._element.setAttribute('aria-describedby', tipId);
|
||||
|
||||
this.setContent();
|
||||
|
||||
if (this.config.animation) {
|
||||
tip.classList.add(CLASS_NAME_FADE);
|
||||
}
|
||||
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
|
||||
var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this._element) : this.config.placement;
|
||||
|
||||
var attachment = this._getAttachment(placement);
|
||||
|
||||
@ -503,17 +556,25 @@
|
||||
|
||||
Data__default['default'].setData(tip, this.constructor.DATA_KEY, this);
|
||||
|
||||
if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
||||
container.appendChild(tip);
|
||||
}
|
||||
|
||||
EventHandler__default['default'].trigger(this.element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW); // If this is a touch-enabled device we add extra
|
||||
EventHandler__default['default'].trigger(this._element, this.constructor.Event.INSERTED);
|
||||
this._popper = new Popper__default['default'](this._element, tip, this._getPopperConfig(attachment));
|
||||
tip.classList.add(CLASS_NAME_SHOW);
|
||||
var customClass = typeof this.config.customClass === 'function' ? this.config.customClass() : this.config.customClass;
|
||||
|
||||
if (customClass) {
|
||||
var _tip$classList;
|
||||
|
||||
(_tip$classList = tip.classList).add.apply(_tip$classList, customClass.split(' '));
|
||||
} // If this is a touch-enabled device we add extra
|
||||
// empty mouseover listeners to the body's immediate children;
|
||||
// only needed because of broken event delegation on iOS
|
||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||
|
||||
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
var _ref;
|
||||
|
||||
@ -523,16 +584,16 @@
|
||||
}
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this.config.animation) {
|
||||
_this._fixTransition();
|
||||
if (_this2.config.animation) {
|
||||
_this2._fixTransition();
|
||||
}
|
||||
|
||||
var prevHoverState = _this._hoverState;
|
||||
_this._hoverState = null;
|
||||
EventHandler__default['default'].trigger(_this.element, _this.constructor.Event.SHOWN);
|
||||
var prevHoverState = _this2._hoverState;
|
||||
_this2._hoverState = null;
|
||||
EventHandler__default['default'].trigger(_this2._element, _this2.constructor.Event.SHOWN);
|
||||
|
||||
if (prevHoverState === HOVER_STATE_OUT) {
|
||||
_this._leave(null, _this);
|
||||
_this2._leave(null, _this2);
|
||||
}
|
||||
};
|
||||
|
||||
@ -547,7 +608,7 @@
|
||||
};
|
||||
|
||||
_proto.hide = function hide() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
if (!this._popper) {
|
||||
return;
|
||||
@ -556,20 +617,20 @@
|
||||
var tip = this.getTipElement();
|
||||
|
||||
var complete = function complete() {
|
||||
if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
if (_this3._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
||||
tip.parentNode.removeChild(tip);
|
||||
}
|
||||
|
||||
_this2._cleanTipClass();
|
||||
_this3._cleanTipClass();
|
||||
|
||||
_this2.element.removeAttribute('aria-describedby');
|
||||
_this3._element.removeAttribute('aria-describedby');
|
||||
|
||||
EventHandler__default['default'].trigger(_this2.element, _this2.constructor.Event.HIDDEN);
|
||||
EventHandler__default['default'].trigger(_this3._element, _this3.constructor.Event.HIDDEN);
|
||||
|
||||
_this2._popper.destroy();
|
||||
_this3._popper.destroy();
|
||||
};
|
||||
|
||||
var hideEvent = EventHandler__default['default'].trigger(this.element, this.constructor.Event.HIDE);
|
||||
var hideEvent = EventHandler__default['default'].trigger(this._element, this.constructor.Event.HIDE);
|
||||
|
||||
if (hideEvent.defaultPrevented) {
|
||||
return;
|
||||
@ -664,10 +725,10 @@
|
||||
};
|
||||
|
||||
_proto.getTitle = function getTitle() {
|
||||
var title = this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (!title) {
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
|
||||
title = typeof this.config.title === 'function' ? this.config.title.call(this._element) : this.config.title;
|
||||
}
|
||||
|
||||
return title;
|
||||
@ -675,7 +736,7 @@
|
||||
;
|
||||
|
||||
_proto._getPopperConfig = function _getPopperConfig(attachment) {
|
||||
var _this3 = this;
|
||||
var _this4 = this;
|
||||
|
||||
var defaultBsConfig = {
|
||||
placement: attachment,
|
||||
@ -693,11 +754,11 @@
|
||||
},
|
||||
onCreate: function onCreate(data) {
|
||||
if (data.originalPlacement !== data.placement) {
|
||||
_this3._handlePopperPlacementChange(data);
|
||||
_this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
},
|
||||
onUpdate: function onUpdate(data) {
|
||||
return _this3._handlePopperPlacementChange(data);
|
||||
return _this4._handlePopperPlacementChange(data);
|
||||
}
|
||||
};
|
||||
return _extends({}, defaultBsConfig, this.config.popperConfig);
|
||||
@ -708,13 +769,13 @@
|
||||
};
|
||||
|
||||
_proto._getOffset = function _getOffset() {
|
||||
var _this4 = this;
|
||||
var _this5 = this;
|
||||
|
||||
var offset = {};
|
||||
|
||||
if (typeof this.config.offset === 'function') {
|
||||
offset.fn = function (data) {
|
||||
data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});
|
||||
data.offsets = _extends({}, data.offsets, _this5.config.offset(data.offsets, _this5._element) || {});
|
||||
return data;
|
||||
};
|
||||
} else {
|
||||
@ -741,33 +802,33 @@
|
||||
};
|
||||
|
||||
_proto._setListeners = function _setListeners() {
|
||||
var _this5 = this;
|
||||
var _this6 = this;
|
||||
|
||||
var triggers = this.config.trigger.split(' ');
|
||||
triggers.forEach(function (trigger) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler__default['default'].on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
|
||||
return _this5.toggle(event);
|
||||
EventHandler__default['default'].on(_this6._element, _this6.constructor.Event.CLICK, _this6.config.selector, function (event) {
|
||||
return _this6.toggle(event);
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
|
||||
EventHandler__default['default'].on(_this5.element, eventIn, _this5.config.selector, function (event) {
|
||||
return _this5._enter(event);
|
||||
var eventIn = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSEENTER : _this6.constructor.Event.FOCUSIN;
|
||||
var eventOut = trigger === TRIGGER_HOVER ? _this6.constructor.Event.MOUSELEAVE : _this6.constructor.Event.FOCUSOUT;
|
||||
EventHandler__default['default'].on(_this6._element, eventIn, _this6.config.selector, function (event) {
|
||||
return _this6._enter(event);
|
||||
});
|
||||
EventHandler__default['default'].on(_this5.element, eventOut, _this5.config.selector, function (event) {
|
||||
return _this5._leave(event);
|
||||
EventHandler__default['default'].on(_this6._element, eventOut, _this6.config.selector, function (event) {
|
||||
return _this6._leave(event);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this._hideModalHandler = function () {
|
||||
if (_this5.element) {
|
||||
_this5.hide();
|
||||
if (_this6._element) {
|
||||
_this6.hide();
|
||||
}
|
||||
};
|
||||
|
||||
EventHandler__default['default'].on(this.element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
EventHandler__default['default'].on(this._element.closest("." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
|
||||
|
||||
if (this.config.selector) {
|
||||
this.config = _extends({}, this.config, {
|
||||
@ -780,12 +841,18 @@
|
||||
};
|
||||
|
||||
_proto._fixTitle = function _fixTitle() {
|
||||
var title = this.element.getAttribute('title');
|
||||
var originalTitleType = typeof this.element.getAttribute('data-bs-original-title');
|
||||
var title = this._element.getAttribute('title');
|
||||
|
||||
var originalTitleType = typeof this._element.getAttribute('data-bs-original-title');
|
||||
|
||||
if (title || originalTitleType !== 'string') {
|
||||
this.element.setAttribute('data-bs-original-title', title || '');
|
||||
this.element.setAttribute('title', '');
|
||||
this._element.setAttribute('data-bs-original-title', title || '');
|
||||
|
||||
if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {
|
||||
this._element.setAttribute('aria-label', title);
|
||||
}
|
||||
|
||||
this._element.setAttribute('title', '');
|
||||
}
|
||||
};
|
||||
|
||||
@ -865,7 +932,7 @@
|
||||
};
|
||||
|
||||
_proto._getConfig = function _getConfig(config) {
|
||||
var dataAttributes = Manipulator__default['default'].getDataAttributes(this.element);
|
||||
var dataAttributes = Manipulator__default['default'].getDataAttributes(this._element);
|
||||
Object.keys(dataAttributes).forEach(function (dataAttr) {
|
||||
if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
|
||||
delete dataAttributes[dataAttr];
|
||||
@ -977,16 +1044,7 @@
|
||||
});
|
||||
};
|
||||
|
||||
Tooltip.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(Tooltip, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}, {
|
||||
_createClass$1(Tooltip, null, [{
|
||||
key: "Default",
|
||||
get: function get() {
|
||||
return Default;
|
||||
@ -1019,7 +1077,7 @@
|
||||
}]);
|
||||
|
||||
return Tooltip;
|
||||
}();
|
||||
}(BaseComponent);
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
|
2
js/dist/tooltip.js.map
vendored
2
js/dist/tooltip.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user