Release 2.0.0

This commit is contained in:
unknown 2020-12-30 15:35:18 +01:00
parent 095ef7f9a2
commit ece253d61f
110 changed files with 1727 additions and 1441 deletions

View File

@ -1,5 +1,5 @@
MDB5
Version: FREE 1.2.0
Version: FREE 2.0.0
Documentation:
https://mdbootstrap.com/docs/standard/

6
css/mdb.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -24,20 +24,39 @@
<div class="container">
<div class="d-flex justify-content-center align-items-center" style="height: 100vh;">
<div class="text-center">
<!-- <i class="fas fa-ticket-alt fa-10x"></i> -->
<img
class="mb-4"
src="https://mdbootstrap.com/img/logo/mdb-transparent-250px.png"
style="width: 250px; height: 90px;"
src="https://mdbootstrap.com/img/Marketing/other/mdb50off.png"
height="150px"
width="150px"
/>
<h5 class="mb-3">Thank you for using our product. We're glad you're with us.</h5>
<p class="mb-3">MDB Team</p>
<h5 class="mb-3">Release suprise! 50% OFF MDB 5 PRO</h5>
<p>
Use this coupon code before the next release to claim the reward.<br />Hurry up & don't
loose your chance.
</p>
<p>
<code class="text-uppercase h1 px-2 rounded bg-dark text-white">MB8XW23V</code>
</p>
<a
class="btn btn-primary btn-lg"
onclick="copy('MB8XW23V');toastr.info('Coupon code copied! Use it on the checkout.');"
target="_blank"
role="button"
>CLAIM DISCOUNT</a
>
<a
class="btn btn-outline-primary btn-lg"
href="https://mdbootstrap.com/docs/standard/getting-started/"
target="_blank"
role="button"
>Start MDB tutorial</a
>START TUTORIAL</a
>
<h5 class="h1-responsive text-uppercase mt-3">
the code <span class="font-weight-bold"></span> expires in:<br />
<span class="font-weight-bold" id="time-counter"></span>
</h5>
</div>
</div>
</div>
@ -47,5 +66,52 @@
<!-- MDB -->
<script type="text/javascript" src="js/mdb.min.js"></script>
<!-- Custom scripts -->
<script type="text/javascript"></script>
<script type="text/javascript">
function copy(text) {
var textarea = document.createElement('textarea');
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
}
// Ad counter
// Set the date we're counting down to
var countDownDate = new Date(Date.UTC(2020, 09, 30, 10, 00, 00));
var counterElement = document.getElementById('time-counter');
// Update the count down every 1 second
function startCounter() {
//wrapped in an if to prevent console errors if the element isn't found on the page
if (counterElement == null) {
return;
} else {
var x = setInterval(function () {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result in the element with id="demo"
counterElement.innerHTML = days + 'd ' + hours + 'h ' + minutes + 'm ' + seconds + 's';
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(x);
document.getElementById('time-counter').innerHTML =
'<p class="h3 grey-text">Sale ended :(</p>';
}
}, 1000);
}
}
startCounter();
</script>
</html>

6
js/mdb.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "mdb-ui-kit",
"version": "1.2.0",
"version": "2.0.0",
"main": "js/mdb.min.js",
"repository": "https://github.com/mdbootstrap/mdb-ui-kit.git",
"author": "MDBootstrap",

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap alert.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap alert.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -8,19 +8,21 @@
? (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)
: ((global = global || self), (global.Alert = factory(global.Data, global.EventHandler)));
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Alert = factory(global.Data, global.EventHandler)));
})(this, function (Data, EventHandler) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -119,7 +121,7 @@
*/
var NAME = 'alert';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.alert';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -141,7 +143,7 @@
this._element = element;
if (this._element) {
Data.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
}
} // Getters
@ -149,11 +151,7 @@
// Public
_proto.close = function close(element) {
var rootElement = this._element;
if (element) {
rootElement = this._getRootElement(element);
}
var rootElement = element ? this._getRootElement(element) : this._element;
var customEvent = this._triggerCloseEvent(rootElement);
@ -165,7 +163,7 @@
};
_proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY);
Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null;
}; // Private
@ -174,7 +172,7 @@
};
_proto._triggerCloseEvent = function _triggerCloseEvent(element) {
return EventHandler.trigger(element, EVENT_CLOSE);
return EventHandler__default['default'].trigger(element, EVENT_CLOSE);
};
_proto._removeElement = function _removeElement(element) {
@ -189,7 +187,7 @@
}
var transitionDuration = getTransitionDurationFromElement(element);
EventHandler.one(element, TRANSITION_END, function () {
EventHandler__default['default'].one(element, TRANSITION_END, function () {
return _this._destroyElement(element);
});
emulateTransitionEnd(element, transitionDuration);
@ -200,12 +198,12 @@
element.parentNode.removeChild(element);
}
EventHandler.trigger(element, EVENT_CLOSED);
EventHandler__default['default'].trigger(element, EVENT_CLOSED);
}; // Static
Alert.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
var data = Data__default['default'].getData(this, DATA_KEY);
if (!data) {
data = new Alert(this);
@ -228,7 +226,7 @@
};
Alert.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Alert, null, [
@ -248,7 +246,7 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_DISMISS,

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap button.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap button.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -8,19 +8,21 @@
? (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)
: ((global = global || self), (global.Button = factory(global.Data, global.EventHandler)));
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Button = factory(global.Data, global.EventHandler)));
})(this, function (Data, EventHandler) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -58,7 +60,7 @@
*/
var NAME = 'button';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.button';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -74,7 +76,7 @@
var Button = /*#__PURE__*/ (function () {
function Button(element) {
this._element = element;
Data.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
} // Getters
var _proto = Button.prototype;
@ -86,13 +88,13 @@
};
_proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY);
Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null;
}; // Static
Button.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
var data = Data__default['default'].getData(this, DATA_KEY);
if (!data) {
data = new Button(this);
@ -105,7 +107,7 @@
};
Button.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Button, null, [
@ -125,17 +127,22 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_DATA_TOGGLE,
function (event) {
event.preventDefault();
var button = event.target.closest(SELECTOR_DATA_TOGGLE);
var data = Data.getData(button, DATA_KEY);
var data = Data__default['default'].getData(button, DATA_KEY);
if (!data) {
data = new Button(button);
}
data.toggle();
});
}
);
var $ = getjQuery();
/**
* ------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap carousel.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap carousel.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -18,7 +18,7 @@
'./dom/manipulator.js',
'./dom/selector-engine.js',
], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Carousel = factory(
global.Data,
global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
Manipulator =
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default')
? Manipulator['default']
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -175,49 +170,21 @@
return null;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
function _defineProperties(target, props) {
@ -242,7 +209,7 @@
*/
var NAME = 'carousel';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.carousel';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -322,14 +289,17 @@
this.touchDeltaX = 0;
this._config = this._getConfig(config);
this._element = element;
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._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);
this._addEventListeners();
Data.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
} // Getters
var _proto = Carousel.prototype;
@ -360,7 +330,7 @@
this._isPaused = true;
}
if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {
if (SelectorEngine__default['default'].findOne(SELECTOR_NEXT_PREV, this._element)) {
triggerTransitionEnd(this._element);
this.cycle(true);
}
@ -390,7 +360,10 @@
_proto.to = function to(index) {
var _this = this;
this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
this._activeElement = SelectorEngine__default['default'].findOne(
SELECTOR_ACTIVE_ITEM,
this._element
);
var activeIndex = this._getItemIndex(this._activeElement);
@ -399,7 +372,7 @@
}
if (this._isSliding) {
EventHandler.one(this._element, EVENT_SLID, function () {
EventHandler__default['default'].one(this._element, EVENT_SLID, function () {
return _this.to(index);
});
return;
@ -417,8 +390,8 @@
};
_proto.dispose = function dispose() {
EventHandler.off(this._element, EVENT_KEY);
Data.removeData(this._element, DATA_KEY);
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;
@ -430,7 +403,7 @@
}; // Private
_proto._getConfig = function _getConfig(config) {
config = _objectSpread(_objectSpread({}, Default), config);
config = _extends({}, Default, config);
typeCheckConfig(NAME, config, DefaultType);
return config;
};
@ -458,16 +431,16 @@
var _this2 = this;
if (this._config.keyboard) {
EventHandler.on(this._element, EVENT_KEYDOWN, function (event) {
EventHandler__default['default'].on(this._element, EVENT_KEYDOWN, function (event) {
return _this2._keydown(event);
});
}
if (this._config.pause === 'hover') {
EventHandler.on(this._element, EVENT_MOUSEENTER, function (event) {
EventHandler__default['default'].on(this._element, EVENT_MOUSEENTER, function (event) {
return _this2.pause(event);
});
EventHandler.on(this._element, EVENT_MOUSELEAVE, function (event) {
EventHandler__default['default'].on(this._element, EVENT_MOUSELEAVE, function (event) {
return _this2.cycle(event);
});
}
@ -524,29 +497,31 @@
}
};
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(function (itemImg) {
EventHandler.on(itemImg, EVENT_DRAG_START, function (e) {
SelectorEngine__default['default']
.find(SELECTOR_ITEM_IMG, this._element)
.forEach(function (itemImg) {
EventHandler__default['default'].on(itemImg, EVENT_DRAG_START, function (e) {
return e.preventDefault();
});
});
if (this._pointerEvent) {
EventHandler.on(this._element, EVENT_POINTERDOWN, function (event) {
EventHandler__default['default'].on(this._element, EVENT_POINTERDOWN, function (event) {
return start(event);
});
EventHandler.on(this._element, EVENT_POINTERUP, function (event) {
EventHandler__default['default'].on(this._element, EVENT_POINTERUP, function (event) {
return end(event);
});
this._element.classList.add(CLASS_NAME_POINTER_EVENT);
} else {
EventHandler.on(this._element, EVENT_TOUCHSTART, function (event) {
EventHandler__default['default'].on(this._element, EVENT_TOUCHSTART, function (event) {
return start(event);
});
EventHandler.on(this._element, EVENT_TOUCHMOVE, function (event) {
EventHandler__default['default'].on(this._element, EVENT_TOUCHMOVE, function (event) {
return move(event);
});
EventHandler.on(this._element, EVENT_TOUCHEND, function (event) {
EventHandler__default['default'].on(this._element, EVENT_TOUCHEND, function (event) {
return end(event);
});
}
@ -572,7 +547,9 @@
_proto._getItemIndex = function _getItemIndex(element) {
this._items =
element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : [];
element && element.parentNode
? SelectorEngine__default['default'].find(SELECTOR_ITEM, element.parentNode)
: [];
return this._items.indexOf(element);
};
@ -600,10 +577,10 @@
var targetIndex = this._getItemIndex(relatedTarget);
var fromIndex = this._getItemIndex(
SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)
SelectorEngine__default['default'].findOne(SELECTOR_ACTIVE_ITEM, this._element)
);
return EventHandler.trigger(this._element, EVENT_SLIDE, {
return EventHandler__default['default'].trigger(this._element, EVENT_SLIDE, {
relatedTarget: relatedTarget,
direction: eventDirectionName,
from: fromIndex,
@ -613,7 +590,10 @@
_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
if (this._indicatorsElement) {
var indicators = SelectorEngine.find(SELECTOR_ACTIVE, this._indicatorsElement);
var indicators = SelectorEngine__default['default'].find(
SELECTOR_ACTIVE,
this._indicatorsElement
);
for (var i = 0; i < indicators.length; i++) {
indicators[i].classList.remove(CLASS_NAME_ACTIVE);
@ -630,7 +610,10 @@
_proto._slide = function _slide(direction, element) {
var _this4 = this;
var activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
var activeElement = SelectorEngine__default['default'].findOne(
SELECTOR_ACTIVE_ITEM,
this._element
);
var activeElementIndex = this._getItemIndex(activeElement);
@ -693,13 +676,13 @@
}
var transitionDuration = getTransitionDurationFromElement(activeElement);
EventHandler.one(activeElement, TRANSITION_END, function () {
EventHandler__default['default'].one(activeElement, TRANSITION_END, function () {
nextElement.classList.remove(directionalClassName, orderClassName);
nextElement.classList.add(CLASS_NAME_ACTIVE);
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName);
_this4._isSliding = false;
setTimeout(function () {
EventHandler.trigger(_this4._element, EVENT_SLID, {
EventHandler__default['default'].trigger(_this4._element, EVENT_SLID, {
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
@ -712,7 +695,7 @@
activeElement.classList.remove(CLASS_NAME_ACTIVE);
nextElement.classList.add(CLASS_NAME_ACTIVE);
this._isSliding = false;
EventHandler.trigger(this._element, EVENT_SLID, {
EventHandler__default['default'].trigger(this._element, EVENT_SLID, {
relatedTarget: nextElement,
direction: eventDirectionName,
from: activeElementIndex,
@ -726,15 +709,16 @@
}; // Static
Carousel.carouselInterface = function carouselInterface(element, config) {
var data = Data.getData(element, DATA_KEY);
var data = Data__default['default'].getData(element, DATA_KEY);
var _config = _objectSpread(
_objectSpread({}, Default),
Manipulator.getDataAttributes(element)
var _config = _extends(
{},
Default,
Manipulator__default['default'].getDataAttributes(element)
);
if (typeof config === 'object') {
_config = _objectSpread(_objectSpread({}, _config), config);
_config = _extends({}, _config, config);
}
var action = typeof config === 'string' ? config : _config.slide;
@ -770,9 +754,10 @@
return;
}
var config = _objectSpread(
_objectSpread({}, Manipulator.getDataAttributes(target)),
Manipulator.getDataAttributes(this)
var config = _extends(
{},
Manipulator__default['default'].getDataAttributes(target),
Manipulator__default['default'].getDataAttributes(this)
);
var slideIndex = this.getAttribute('data-slide-to');
@ -784,14 +769,14 @@
Carousel.carouselInterface(target, config);
if (slideIndex) {
Data.getData(target, DATA_KEY).to(slideIndex);
Data__default['default'].getData(target, DATA_KEY).to(slideIndex);
}
event.preventDefault();
};
Carousel.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Carousel, null, [
@ -817,17 +802,20 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_DATA_SLIDE,
Carousel.dataApiClickHandler
);
EventHandler.on(window, EVENT_LOAD_DATA_API, function () {
var carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
EventHandler__default['default'].on(window, EVENT_LOAD_DATA_API, function () {
var carousels = SelectorEngine__default['default'].find(SELECTOR_DATA_RIDE);
for (var i = 0, len = carousels.length; i < len; i++) {
Carousel.carouselInterface(carousels[i], Data.getData(carousels[i], DATA_KEY));
Carousel.carouselInterface(
carousels[i],
Data__default['default'].getData(carousels[i], DATA_KEY)
);
}
});
var $ = getjQuery();

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap collapse.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap collapse.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -18,7 +18,7 @@
'./dom/manipulator.js',
'./dom/selector-engine.js',
], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Collapse = factory(
global.Data,
global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
Manipulator =
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default')
? Manipulator['default']
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -167,49 +162,21 @@
return null;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
function _defineProperties(target, props) {
@ -234,7 +201,7 @@
*/
var NAME = 'collapse';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.collapse';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -270,19 +237,21 @@
this._isTransitioning = false;
this._element = element;
this._config = this._getConfig(config);
this._triggerArray = SelectorEngine.find(
this._triggerArray = SelectorEngine__default['default'].find(
SELECTOR_DATA_TOGGLE +
'[href="#' +
element.id +
'"],' +
(SELECTOR_DATA_TOGGLE + '[data-target="#' + element.id + '"]')
);
var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
var toggleList = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE);
for (var i = 0, len = toggleList.length; i < len; i++) {
var elem = toggleList[i];
var selector = getSelectorFromElement(elem);
var filterElement = SelectorEngine.find(selector).filter(function (foundElem) {
var filterElement = SelectorEngine__default['default']
.find(selector)
.filter(function (foundElem) {
return foundElem === element;
});
@ -303,7 +272,7 @@
this.toggle();
}
Data.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
} // Getters
var _proto = Collapse.prototype;
@ -328,7 +297,9 @@
var activesData;
if (this._parent) {
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(function (elem) {
actives = SelectorEngine__default['default']
.find(SELECTOR_ACTIVES, this._parent)
.filter(function (elem) {
if (typeof _this._config.parent === 'string') {
return elem.getAttribute('data-parent') === _this._config.parent;
}
@ -341,20 +312,22 @@
}
}
var container = SelectorEngine.findOne(this._selector);
var container = SelectorEngine__default['default'].findOne(this._selector);
if (actives) {
var tempActiveData = actives.filter(function (elem) {
return container !== elem;
});
activesData = tempActiveData[0] ? Data.getData(tempActiveData[0], DATA_KEY) : null;
activesData = tempActiveData[0]
? Data__default['default'].getData(tempActiveData[0], DATA_KEY)
: null;
if (activesData && activesData._isTransitioning) {
return;
}
}
var startEvent = EventHandler.trigger(this._element, EVENT_SHOW);
var startEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
if (startEvent.defaultPrevented) {
return;
@ -367,7 +340,7 @@
}
if (!activesData) {
Data.setData(elemActive, DATA_KEY, null);
Data__default['default'].setData(elemActive, DATA_KEY, null);
}
});
}
@ -398,13 +371,13 @@
_this.setTransitioning(false);
EventHandler.trigger(_this._element, EVENT_SHOWN);
EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN);
};
var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
var scrollSize = 'scroll' + capitalizedDimension;
var transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, TRANSITION_END, complete);
EventHandler__default['default'].one(this._element, TRANSITION_END, complete);
emulateTransitionEnd(this._element, transitionDuration);
this._element.style[dimension] = this._element[scrollSize] + 'px';
};
@ -416,7 +389,7 @@
return;
}
var startEvent = EventHandler.trigger(this._element, EVENT_HIDE);
var startEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
if (startEvent.defaultPrevented) {
return;
@ -454,12 +427,12 @@
_this2._element.classList.add(CLASS_NAME_COLLAPSE);
EventHandler.trigger(_this2._element, EVENT_HIDDEN);
EventHandler__default['default'].trigger(_this2._element, EVENT_HIDDEN);
};
this._element.style[dimension] = '';
var transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, TRANSITION_END, complete);
EventHandler__default['default'].one(this._element, TRANSITION_END, complete);
emulateTransitionEnd(this._element, transitionDuration);
};
@ -468,7 +441,7 @@
};
_proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY);
Data__default['default'].removeData(this._element, DATA_KEY);
this._config = null;
this._parent = null;
this._element = null;
@ -477,7 +450,7 @@
}; // Private
_proto._getConfig = function _getConfig(config) {
config = _objectSpread(_objectSpread({}, Default), config);
config = _extends({}, Default, config);
config.toggle = Boolean(config.toggle); // Coerce string values
typeCheckConfig(NAME, config, DefaultType);
@ -485,9 +458,7 @@
};
_proto._getDimension = function _getDimension() {
var hasWidth = this._element.classList.contains(WIDTH);
return hasWidth ? WIDTH : HEIGHT;
return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
};
_proto._getParent = function _getParent() {
@ -501,11 +472,11 @@
parent = parent[0];
}
} else {
parent = SelectorEngine.findOne(parent);
parent = SelectorEngine__default['default'].findOne(parent);
}
var selector = SELECTOR_DATA_TOGGLE + '[data-parent="' + parent + '"]';
SelectorEngine.find(selector, parent).forEach(function (element) {
SelectorEngine__default['default'].find(selector, parent).forEach(function (element) {
var selected = getElementFromSelector(element);
_this3._addAriaAndCollapsedClass(selected, [element]);
@ -514,10 +485,11 @@
};
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
if (element) {
var isOpen = element.classList.contains(CLASS_NAME_SHOW);
if (!element || !triggerArray.length) {
return;
}
if (triggerArray.length) {
var isOpen = element.classList.contains(CLASS_NAME_SHOW);
triggerArray.forEach(function (elem) {
if (isOpen) {
elem.classList.remove(CLASS_NAME_COLLAPSED);
@ -527,15 +499,15 @@
elem.setAttribute('aria-expanded', isOpen);
});
}
}
}; // Static
Collapse.collapseInterface = function collapseInterface(element, config) {
var data = Data.getData(element, DATA_KEY);
var data = Data__default['default'].getData(element, DATA_KEY);
var _config = _objectSpread(
_objectSpread(_objectSpread({}, Default), Manipulator.getDataAttributes(element)),
var _config = _extends(
{},
Default,
Manipulator__default['default'].getDataAttributes(element),
typeof config === 'object' && config ? config : {}
);
@ -563,7 +535,7 @@
};
Collapse.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Collapse, null, [
@ -589,17 +561,21 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_DATA_TOGGLE,
function (event) {
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
if (event.target.tagName === 'A') {
event.preventDefault();
}
var triggerData = Manipulator.getDataAttributes(this);
var triggerData = Manipulator__default['default'].getDataAttributes(this);
var selector = getSelectorFromElement(this);
var selectorElements = SelectorEngine.find(selector);
var selectorElements = SelectorEngine__default['default'].find(selector);
selectorElements.forEach(function (element) {
var data = Data.getData(element, DATA_KEY);
var data = Data__default['default'].getData(element, DATA_KEY);
var config;
if (data) {
@ -616,7 +592,8 @@
Collapse.collapseInterface(element, config);
});
});
}
);
var $ = getjQuery();
/**
* ------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap data.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap data.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -8,13 +8,14 @@
? (module.exports = factory())
: typeof define === 'function' && define.amd
? define(factory)
: ((global = global || self), (global.Data = factory()));
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Data = factory()));
})(this, function () {
'use strict';
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/data.js
* Bootstrap (v5.0.0-alpha2): dom/data.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -29,22 +30,22 @@
var id = 1;
return {
set: function set(element, key, data) {
if (typeof element.key === 'undefined') {
element.key = {
if (typeof element.bsKey === 'undefined') {
element.bsKey = {
key: key,
id: id,
};
id++;
}
storeData[element.key.id] = data;
storeData[element.bsKey.id] = data;
},
get: function get(element, key) {
if (!element || typeof element.key === 'undefined') {
if (!element || typeof element.bsKey === 'undefined') {
return null;
}
var keyProperties = element.key;
var keyProperties = element.bsKey;
if (keyProperties.key === key) {
return storeData[keyProperties.id];
@ -53,15 +54,15 @@
return null;
},
delete: function _delete(element, key) {
if (typeof element.key === 'undefined') {
if (typeof element.bsKey === 'undefined') {
return;
}
var keyProperties = element.key;
var keyProperties = element.bsKey;
if (keyProperties.key === key) {
delete storeData[keyProperties.id];
delete element.key;
delete element.bsKey;
}
},
};

View File

@ -1 +1 @@
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha1): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst mapData = (() => {\n const storeData = {}\n let id = 1\n return {\n set(element, key, data) {\n if (typeof element.key === 'undefined') {\n element.key = {\n key,\n id\n }\n id++\n }\n\n storeData[element.key.id] = data\n },\n get(element, key) {\n if (!element || typeof element.key === 'undefined') {\n return null\n }\n\n const keyProperties = element.key\n if (keyProperties.key === key) {\n return storeData[keyProperties.id]\n }\n\n return null\n },\n delete(element, key) {\n if (typeof element.key === 'undefined') {\n return\n }\n\n const keyProperties = element.key\n if (keyProperties.key === key) {\n delete storeData[keyProperties.id]\n delete element.key\n }\n }\n }\n})()\n\nconst Data = {\n setData(instance, key, data) {\n mapData.set(instance, key, data)\n },\n getData(instance, key) {\n return mapData.get(instance, key)\n },\n removeData(instance, key) {\n mapData.delete(instance, key)\n }\n}\n\nexport default Data\n"],"names":["mapData","storeData","id","set","element","key","data","get","keyProperties","delete","Data","setData","instance","getData","removeData"],"mappings":";;;;;;;;;;;EAAA;;;;;;;EAOA;;;;;EAMA,IAAMA,OAAO,GAAI,YAAM;EACrB,MAAMC,SAAS,GAAG,EAAlB;EACA,MAAIC,EAAE,GAAG,CAAT;EACA,SAAO;EACLC,IAAAA,GADK,eACDC,OADC,EACQC,GADR,EACaC,IADb,EACmB;EACtB,UAAI,OAAOF,OAAO,CAACC,GAAf,KAAuB,WAA3B,EAAwC;EACtCD,QAAAA,OAAO,CAACC,GAAR,GAAc;EACZA,UAAAA,GAAG,EAAHA,GADY;EAEZH,UAAAA,EAAE,EAAFA;EAFY,SAAd;EAIAA,QAAAA,EAAE;EACH;;EAEDD,MAAAA,SAAS,CAACG,OAAO,CAACC,GAAR,CAAYH,EAAb,CAAT,GAA4BI,IAA5B;EACD,KAXI;EAYLC,IAAAA,GAZK,eAYDH,OAZC,EAYQC,GAZR,EAYa;EAChB,UAAI,CAACD,OAAD,IAAY,OAAOA,OAAO,CAACC,GAAf,KAAuB,WAAvC,EAAoD;EAClD,eAAO,IAAP;EACD;;EAED,UAAMG,aAAa,GAAGJ,OAAO,CAACC,GAA9B;;EACA,UAAIG,aAAa,CAACH,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACO,aAAa,CAACN,EAAf,CAAhB;EACD;;EAED,aAAO,IAAP;EACD,KAvBI;EAwBLO,IAAAA,MAxBK,mBAwBEL,OAxBF,EAwBWC,GAxBX,EAwBgB;EACnB,UAAI,OAAOD,OAAO,CAACC,GAAf,KAAuB,WAA3B,EAAwC;EACtC;EACD;;EAED,UAAMG,aAAa,GAAGJ,OAAO,CAACC,GAA9B;;EACA,UAAIG,aAAa,CAACH,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACO,aAAa,CAACN,EAAf,CAAhB;EACA,eAAOE,OAAO,CAACC,GAAf;EACD;EACF;EAlCI,GAAP;EAoCD,CAvCe,EAAhB;;MAyCMK,IAAI,GAAG;EACXC,EAAAA,OADW,mBACHC,QADG,EACOP,GADP,EACYC,IADZ,EACkB;EAC3BN,IAAAA,OAAO,CAACG,GAAR,CAAYS,QAAZ,EAAsBP,GAAtB,EAA2BC,IAA3B;EACD,GAHU;EAIXO,EAAAA,OAJW,mBAIHD,QAJG,EAIOP,GAJP,EAIY;EACrB,WAAOL,OAAO,CAACO,GAAR,CAAYK,QAAZ,EAAsBP,GAAtB,CAAP;EACD,GANU;EAOXS,EAAAA,UAPW,sBAOAF,QAPA,EAOUP,GAPV,EAOe;EACxBL,IAAAA,OAAO,CAACS,MAAR,CAAeG,QAAf,EAAyBP,GAAzB;EACD;EATU;;;;;;;;"}
{"version":3,"file":"data.js","sources":["../../src/dom/data.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha2): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst mapData = (() => {\n const storeData = {}\n let id = 1\n return {\n set(element, key, data) {\n if (typeof element.bsKey === 'undefined') {\n element.bsKey = {\n key,\n id\n }\n id++\n }\n\n storeData[element.bsKey.id] = data\n },\n get(element, key) {\n if (!element || typeof element.bsKey === 'undefined') {\n return null\n }\n\n const keyProperties = element.bsKey\n if (keyProperties.key === key) {\n return storeData[keyProperties.id]\n }\n\n return null\n },\n delete(element, key) {\n if (typeof element.bsKey === 'undefined') {\n return\n }\n\n const keyProperties = element.bsKey\n if (keyProperties.key === key) {\n delete storeData[keyProperties.id]\n delete element.bsKey\n }\n }\n }\n})()\n\nconst Data = {\n setData(instance, key, data) {\n mapData.set(instance, key, data)\n },\n getData(instance, key) {\n return mapData.get(instance, key)\n },\n removeData(instance, key) {\n mapData.delete(instance, key)\n }\n}\n\nexport default Data\n"],"names":["mapData","storeData","id","set","element","key","data","bsKey","get","keyProperties","delete","Data","setData","instance","getData","removeData"],"mappings":";;;;;;;;;;;EAAA;;;;;;;EAOA;;;;;EAMA,IAAMA,OAAO,GAAI,YAAM;EACrB,MAAMC,SAAS,GAAG,EAAlB;EACA,MAAIC,EAAE,GAAG,CAAT;EACA,SAAO;EACLC,IAAAA,GADK,eACDC,OADC,EACQC,GADR,EACaC,IADb,EACmB;EACtB,UAAI,OAAOF,OAAO,CAACG,KAAf,KAAyB,WAA7B,EAA0C;EACxCH,QAAAA,OAAO,CAACG,KAAR,GAAgB;EACdF,UAAAA,GAAG,EAAHA,GADc;EAEdH,UAAAA,EAAE,EAAFA;EAFc,SAAhB;EAIAA,QAAAA,EAAE;EACH;;EAEDD,MAAAA,SAAS,CAACG,OAAO,CAACG,KAAR,CAAcL,EAAf,CAAT,GAA8BI,IAA9B;EACD,KAXI;EAYLE,IAAAA,GAZK,eAYDJ,OAZC,EAYQC,GAZR,EAYa;EAChB,UAAI,CAACD,OAAD,IAAY,OAAOA,OAAO,CAACG,KAAf,KAAyB,WAAzC,EAAsD;EACpD,eAAO,IAAP;EACD;;EAED,UAAME,aAAa,GAAGL,OAAO,CAACG,KAA9B;;EACA,UAAIE,aAAa,CAACJ,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACQ,aAAa,CAACP,EAAf,CAAhB;EACD;;EAED,aAAO,IAAP;EACD,KAvBI;EAwBLQ,IAAAA,MAxBK,mBAwBEN,OAxBF,EAwBWC,GAxBX,EAwBgB;EACnB,UAAI,OAAOD,OAAO,CAACG,KAAf,KAAyB,WAA7B,EAA0C;EACxC;EACD;;EAED,UAAME,aAAa,GAAGL,OAAO,CAACG,KAA9B;;EACA,UAAIE,aAAa,CAACJ,GAAd,KAAsBA,GAA1B,EAA+B;EAC7B,eAAOJ,SAAS,CAACQ,aAAa,CAACP,EAAf,CAAhB;EACA,eAAOE,OAAO,CAACG,KAAf;EACD;EACF;EAlCI,GAAP;EAoCD,CAvCe,EAAhB;;MAyCMI,IAAI,GAAG;EACXC,EAAAA,OADW,mBACHC,QADG,EACOR,GADP,EACYC,IADZ,EACkB;EAC3BN,IAAAA,OAAO,CAACG,GAAR,CAAYU,QAAZ,EAAsBR,GAAtB,EAA2BC,IAA3B;EACD,GAHU;EAIXQ,EAAAA,OAJW,mBAIHD,QAJG,EAIOR,GAJP,EAIY;EACrB,WAAOL,OAAO,CAACQ,GAAR,CAAYK,QAAZ,EAAsBR,GAAtB,CAAP;EACD,GANU;EAOXU,EAAAA,UAPW,sBAOAF,QAPA,EAOUR,GAPV,EAOe;EACxBL,IAAAA,OAAO,CAACU,MAAR,CAAeG,QAAf,EAAyBR,GAAzB;EACD;EATU;;;;;;;;"}

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap event-handler.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap event-handler.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -8,13 +8,14 @@
? (module.exports = factory(require('./polyfill.js')))
: typeof define === 'function' && define.amd
? define(['./polyfill.js'], factory)
: ((global = global || self), (global.EventHandler = factory(global.Polyfill)));
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.EventHandler = factory(global.Polyfill)));
})(this, function (polyfill_js) {
'use strict';
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -32,7 +33,7 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/event-handler.js
* Bootstrap (v5.0.0-alpha2): dom/event-handler.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -120,6 +121,8 @@
function bootstrapHandler(element, fn) {
return function handler(event) {
event.delegateTarget = element;
if (handler.oneOff) {
EventHandler.off(element, event.type, fn);
}
@ -135,6 +138,8 @@
for (var target = event.target; target && target !== this; target = target.parentNode) {
for (var i = domElements.length; i--; ) {
if (domElements[i] === target) {
event.delegateTarget = target;
if (handler.oneOff) {
EventHandler.off(element, event.type, fn);
}
@ -326,7 +331,7 @@
bubbles: bubbles,
cancelable: true,
});
} // merge custom informations in our event
} // merge custom information in our event
if (typeof args !== 'undefined') {
Object.keys(args).forEach(function (key) {

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap manipulator.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap manipulator.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -8,58 +8,31 @@
? (module.exports = factory())
: typeof define === 'function' && define.amd
? define(factory)
: ((global = global || self), (global.Manipulator = factory()));
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Manipulator = factory()));
})(this, function () {
'use strict';
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/manipulator.js
* Bootstrap (v5.0.0-alpha2): dom/manipulator.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -101,7 +74,7 @@
return {};
}
var attributes = _objectSpread({}, element.dataset);
var attributes = _extends({}, element.dataset);
Object.keys(attributes).forEach(function (key) {
attributes[key] = normalizeData(attributes[key]);

View File

@ -1 +1 @@
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha1): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {\n ...element.dataset\n }\n\n Object.keys(attributes).forEach(key => {\n attributes[key] = normalizeData(attributes[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n },\n\n toggleClass(element, className) {\n if (!element) {\n return\n }\n\n if (element.classList.contains(className)) {\n element.classList.remove(className)\n } else {\n element.classList.add(className)\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","dataset","Object","keys","forEach","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","document","body","scrollTop","left","scrollLeft","position","offsetTop","offsetLeft","toggleClass","className","classList","contains","remove","add"],"mappings":";;;;;;;;;;;;;;;;;EAAA;;;;;;EAOA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,MAAIA,GAAG,KAAK,MAAZ,EAAoB;EAClB,WAAO,IAAP;EACD;;EAED,MAAIA,GAAG,KAAK,OAAZ,EAAqB;EACnB,WAAO,KAAP;EACD;;EAED,MAAIA,GAAG,KAAKC,MAAM,CAACD,GAAD,CAAN,CAAYE,QAAZ,EAAZ,EAAoC;EAClC,WAAOD,MAAM,CAACD,GAAD,CAAb;EACD;;EAED,MAAIA,GAAG,KAAK,EAAR,IAAcA,GAAG,KAAK,MAA1B,EAAkC;EAChC,WAAO,IAAP;EACD;;EAED,SAAOA,GAAP;EACD;;EAED,SAASG,gBAAT,CAA0BC,GAA1B,EAA+B;EAC7B,SAAOA,GAAG,CAACC,OAAJ,CAAY,QAAZ,EAAsB,UAAAC,GAAG;EAAA,iBAAQA,GAAG,CAACC,WAAJ,EAAR;EAAA,GAAzB,CAAP;EACD;;MAEKC,WAAW,GAAG;EAClBC,EAAAA,gBADkB,4BACDC,OADC,EACQN,GADR,EACaO,KADb,EACoB;EACpCD,IAAAA,OAAO,CAACE,YAAR,WAA6BT,gBAAgB,CAACC,GAAD,CAA7C,EAAsDO,KAAtD;EACD,GAHiB;EAKlBE,EAAAA,mBALkB,+BAKEH,OALF,EAKWN,GALX,EAKgB;EAChCM,IAAAA,OAAO,CAACI,eAAR,WAAgCX,gBAAgB,CAACC,GAAD,CAAhD;EACD,GAPiB;EASlBW,EAAAA,iBATkB,6BASAL,OATA,EASS;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,QAAMM,UAAU,qBACXN,OAAO,CAACO,OADG,CAAhB;;EAIAC,IAAAA,MAAM,CAACC,IAAP,CAAYH,UAAZ,EAAwBI,OAAxB,CAAgC,UAAAhB,GAAG,EAAI;EACrCY,MAAAA,UAAU,CAACZ,GAAD,CAAV,GAAkBL,aAAa,CAACiB,UAAU,CAACZ,GAAD,CAAX,CAA/B;EACD,KAFD;EAIA,WAAOY,UAAP;EACD,GAvBiB;EAyBlBK,EAAAA,gBAzBkB,4BAyBDX,OAzBC,EAyBQN,GAzBR,EAyBa;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACY,YAAR,WAA6BnB,gBAAgB,CAACC,GAAD,CAA7C,CAAD,CAApB;EACD,GA3BiB;EA6BlBmB,EAAAA,MA7BkB,kBA6BXb,OA7BW,EA6BF;EACd,QAAMc,IAAI,GAAGd,OAAO,CAACe,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,QAAQ,CAACC,IAAT,CAAcC,SADzB;EAELC,MAAAA,IAAI,EAAEN,IAAI,CAACM,IAAL,GAAYH,QAAQ,CAACC,IAAT,CAAcG;EAF3B,KAAP;EAID,GApCiB;EAsClBC,EAAAA,QAtCkB,oBAsCTtB,OAtCS,EAsCA;EAChB,WAAO;EACLgB,MAAAA,GAAG,EAAEhB,OAAO,CAACuB,SADR;EAELH,MAAAA,IAAI,EAAEpB,OAAO,CAACwB;EAFT,KAAP;EAID,GA3CiB;EA6ClBC,EAAAA,WA7CkB,uBA6CNzB,OA7CM,EA6CG0B,SA7CH,EA6Cc;EAC9B,QAAI,CAAC1B,OAAL,EAAc;EACZ;EACD;;EAED,QAAIA,OAAO,CAAC2B,SAAR,CAAkBC,QAAlB,CAA2BF,SAA3B,CAAJ,EAA2C;EACzC1B,MAAAA,OAAO,CAAC2B,SAAR,CAAkBE,MAAlB,CAAyBH,SAAzB;EACD,KAFD,MAEO;EACL1B,MAAAA,OAAO,CAAC2B,SAAR,CAAkBG,GAAlB,CAAsBJ,SAAtB;EACD;EACF;EAvDiB;;;;;;;;"}
{"version":3,"file":"manipulator.js","sources":["../../src/dom/manipulator.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha2): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {\n ...element.dataset\n }\n\n Object.keys(attributes).forEach(key => {\n attributes[key] = normalizeData(attributes[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + document.body.scrollTop,\n left: rect.left + document.body.scrollLeft\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n },\n\n toggleClass(element, className) {\n if (!element) {\n return\n }\n\n if (element.classList.contains(className)) {\n element.classList.remove(className)\n } else {\n element.classList.add(className)\n }\n }\n}\n\nexport default Manipulator\n"],"names":["normalizeData","val","Number","toString","normalizeDataKey","key","replace","chr","toLowerCase","Manipulator","setDataAttribute","element","value","setAttribute","removeDataAttribute","removeAttribute","getDataAttributes","attributes","dataset","Object","keys","forEach","getDataAttribute","getAttribute","offset","rect","getBoundingClientRect","top","document","body","scrollTop","left","scrollLeft","position","offsetTop","offsetLeft","toggleClass","className","classList","contains","remove","add"],"mappings":";;;;;;;;;;;;;EAAA;;;;;;EAOA,SAASA,aAAT,CAAuBC,GAAvB,EAA4B;EAC1B,MAAIA,GAAG,KAAK,MAAZ,EAAoB;EAClB,WAAO,IAAP;EACD;;EAED,MAAIA,GAAG,KAAK,OAAZ,EAAqB;EACnB,WAAO,KAAP;EACD;;EAED,MAAIA,GAAG,KAAKC,MAAM,CAACD,GAAD,CAAN,CAAYE,QAAZ,EAAZ,EAAoC;EAClC,WAAOD,MAAM,CAACD,GAAD,CAAb;EACD;;EAED,MAAIA,GAAG,KAAK,EAAR,IAAcA,GAAG,KAAK,MAA1B,EAAkC;EAChC,WAAO,IAAP;EACD;;EAED,SAAOA,GAAP;EACD;;EAED,SAASG,gBAAT,CAA0BC,GAA1B,EAA+B;EAC7B,SAAOA,GAAG,CAACC,OAAJ,CAAY,QAAZ,EAAsB,UAAAC,GAAG;EAAA,iBAAQA,GAAG,CAACC,WAAJ,EAAR;EAAA,GAAzB,CAAP;EACD;;MAEKC,WAAW,GAAG;EAClBC,EAAAA,gBADkB,4BACDC,OADC,EACQN,GADR,EACaO,KADb,EACoB;EACpCD,IAAAA,OAAO,CAACE,YAAR,WAA6BT,gBAAgB,CAACC,GAAD,CAA7C,EAAsDO,KAAtD;EACD,GAHiB;EAKlBE,EAAAA,mBALkB,+BAKEH,OALF,EAKWN,GALX,EAKgB;EAChCM,IAAAA,OAAO,CAACI,eAAR,WAAgCX,gBAAgB,CAACC,GAAD,CAAhD;EACD,GAPiB;EASlBW,EAAAA,iBATkB,6BASAL,OATA,EASS;EACzB,QAAI,CAACA,OAAL,EAAc;EACZ,aAAO,EAAP;EACD;;EAED,QAAMM,UAAU,gBACXN,OAAO,CAACO,OADG,CAAhB;;EAIAC,IAAAA,MAAM,CAACC,IAAP,CAAYH,UAAZ,EAAwBI,OAAxB,CAAgC,UAAAhB,GAAG,EAAI;EACrCY,MAAAA,UAAU,CAACZ,GAAD,CAAV,GAAkBL,aAAa,CAACiB,UAAU,CAACZ,GAAD,CAAX,CAA/B;EACD,KAFD;EAIA,WAAOY,UAAP;EACD,GAvBiB;EAyBlBK,EAAAA,gBAzBkB,4BAyBDX,OAzBC,EAyBQN,GAzBR,EAyBa;EAC7B,WAAOL,aAAa,CAACW,OAAO,CAACY,YAAR,WAA6BnB,gBAAgB,CAACC,GAAD,CAA7C,CAAD,CAApB;EACD,GA3BiB;EA6BlBmB,EAAAA,MA7BkB,kBA6BXb,OA7BW,EA6BF;EACd,QAAMc,IAAI,GAAGd,OAAO,CAACe,qBAAR,EAAb;EAEA,WAAO;EACLC,MAAAA,GAAG,EAAEF,IAAI,CAACE,GAAL,GAAWC,QAAQ,CAACC,IAAT,CAAcC,SADzB;EAELC,MAAAA,IAAI,EAAEN,IAAI,CAACM,IAAL,GAAYH,QAAQ,CAACC,IAAT,CAAcG;EAF3B,KAAP;EAID,GApCiB;EAsClBC,EAAAA,QAtCkB,oBAsCTtB,OAtCS,EAsCA;EAChB,WAAO;EACLgB,MAAAA,GAAG,EAAEhB,OAAO,CAACuB,SADR;EAELH,MAAAA,IAAI,EAAEpB,OAAO,CAACwB;EAFT,KAAP;EAID,GA3CiB;EA6ClBC,EAAAA,WA7CkB,uBA6CNzB,OA7CM,EA6CG0B,SA7CH,EA6Cc;EAC9B,QAAI,CAAC1B,OAAL,EAAc;EACZ;EACD;;EAED,QAAIA,OAAO,CAAC2B,SAAR,CAAkBC,QAAlB,CAA2BF,SAA3B,CAAJ,EAA2C;EACzC1B,MAAAA,OAAO,CAAC2B,SAAR,CAAkBE,MAAlB,CAAyBH,SAAzB;EACD,KAFD,MAEO;EACL1B,MAAAA,OAAO,CAAC2B,SAAR,CAAkBG,GAAlB,CAAsBJ,SAAtB;EACD;EACF;EAvDiB;;;;;;;;"}

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap polyfill.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap polyfill.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -8,13 +8,14 @@
? factory(exports)
: typeof define === 'function' && define.amd
? define(['exports'], factory)
: ((global = global || self), factory((global.Polyfill = {})));
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
factory((global.Polyfill = {})));
})(this, function (exports) {
'use strict';
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap selector-engine.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap selector-engine.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -8,13 +8,14 @@
? (module.exports = factory(require('./polyfill.js')))
: typeof define === 'function' && define.amd
? define(['./polyfill.js'], factory)
: ((global = global || self), (global.SelectorEngine = factory(global.Polyfill)));
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.SelectorEngine = factory(global.Polyfill)));
})(this, function (polyfill_js) {
'use strict';
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/selector-engine.js
* Bootstrap (v5.0.0-alpha2): dom/selector-engine.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/

View File

@ -1 +1 @@
{"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha1): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { find as findFn, findOne } from './polyfill'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NODE_TEXT = 3\n\nconst SelectorEngine = {\n matches(element, selector) {\n return element.matches(selector)\n },\n\n find(selector, element = document.documentElement) {\n return [].concat(...findFn.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return findOne.call(element, selector)\n },\n\n children(element, selector) {\n const children = [].concat(...element.children)\n\n return children.filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n\n let ancestor = element.parentNode\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (this.matches(ancestor, selector)) {\n parents.push(ancestor)\n }\n\n ancestor = ancestor.parentNode\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (this.matches(next, selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n }\n}\n\nexport default SelectorEngine\n"],"names":["NODE_TEXT","SelectorEngine","matches","element","selector","find","document","documentElement","concat","findFn","call","findOne","children","filter","child","parents","ancestor","parentNode","nodeType","Node","ELEMENT_NODE","push","prev","previous","previousElementSibling","next","nextElementSibling"],"mappings":";;;;;;;;;;;EAAA;;;;;;EASA;;;;;;EAMA,IAAMA,SAAS,GAAG,CAAlB;MAEMC,cAAc,GAAG;EACrBC,EAAAA,OADqB,mBACbC,OADa,EACJC,QADI,EACM;EACzB,WAAOD,OAAO,CAACD,OAAR,CAAgBE,QAAhB,CAAP;EACD,GAHoB;EAKrBC,EAAAA,IALqB,gBAKhBD,QALgB,EAKND,OALM,EAK8B;EAAA;;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACjD,WAAO,YAAGC,MAAH,aAAaC,gBAAM,CAACC,IAAP,CAAYP,OAAZ,EAAqBC,QAArB,CAAb,CAAP;EACD,GAPoB;EASrBO,EAAAA,OATqB,mBASbP,QATa,EASHD,OATG,EASiC;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACpD,WAAOI,mBAAO,CAACD,IAAR,CAAaP,OAAb,EAAsBC,QAAtB,CAAP;EACD,GAXoB;EAarBQ,EAAAA,QAbqB,oBAaZT,OAbY,EAaHC,QAbG,EAaO;EAAA;;EAC1B,QAAMQ,QAAQ,GAAG,aAAGJ,MAAH,cAAaL,OAAO,CAACS,QAArB,CAAjB;;EAEA,WAAOA,QAAQ,CAACC,MAAT,CAAgB,UAAAC,KAAK;EAAA,aAAIA,KAAK,CAACZ,OAAN,CAAcE,QAAd,CAAJ;EAAA,KAArB,CAAP;EACD,GAjBoB;EAmBrBW,EAAAA,OAnBqB,mBAmBbZ,OAnBa,EAmBJC,QAnBI,EAmBM;EACzB,QAAMW,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGb,OAAO,CAACc,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBlB,SAApF,EAA+F;EAC7F,UAAI,KAAKE,OAAL,CAAac,QAAb,EAAuBZ,QAAvB,CAAJ,EAAsC;EACpCW,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GAjCoB;EAmCrBO,EAAAA,IAnCqB,gBAmChBnB,OAnCgB,EAmCPC,QAnCO,EAmCG;EACtB,QAAImB,QAAQ,GAAGpB,OAAO,CAACqB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACrB,OAAT,CAAiBE,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACmB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA/CoB;EAiDrBC,EAAAA,IAjDqB,gBAiDhBtB,OAjDgB,EAiDPC,QAjDO,EAiDG;EACtB,QAAIqB,IAAI,GAAGtB,OAAO,CAACuB,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAI,KAAKvB,OAAL,CAAauB,IAAb,EAAmBrB,QAAnB,CAAJ,EAAkC;EAChC,eAAO,CAACqB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;EA7DoB;;;;;;;;"}
{"version":3,"file":"selector-engine.js","sources":["../../src/dom/selector-engine.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.0.0-alpha2): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { find as findFn, findOne } from './polyfill'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NODE_TEXT = 3\n\nconst SelectorEngine = {\n matches(element, selector) {\n return element.matches(selector)\n },\n\n find(selector, element = document.documentElement) {\n return [].concat(...findFn.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return findOne.call(element, selector)\n },\n\n children(element, selector) {\n const children = [].concat(...element.children)\n\n return children.filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n\n let ancestor = element.parentNode\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (this.matches(ancestor, selector)) {\n parents.push(ancestor)\n }\n\n ancestor = ancestor.parentNode\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (this.matches(next, selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n }\n}\n\nexport default SelectorEngine\n"],"names":["NODE_TEXT","SelectorEngine","matches","element","selector","find","document","documentElement","concat","findFn","call","findOne","children","filter","child","parents","ancestor","parentNode","nodeType","Node","ELEMENT_NODE","push","prev","previous","previousElementSibling","next","nextElementSibling"],"mappings":";;;;;;;;;;;EAAA;;;;;;EASA;;;;;;EAMA,IAAMA,SAAS,GAAG,CAAlB;MAEMC,cAAc,GAAG;EACrBC,EAAAA,OADqB,mBACbC,OADa,EACJC,QADI,EACM;EACzB,WAAOD,OAAO,CAACD,OAAR,CAAgBE,QAAhB,CAAP;EACD,GAHoB;EAKrBC,EAAAA,IALqB,gBAKhBD,QALgB,EAKND,OALM,EAK8B;EAAA;;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACjD,WAAO,YAAGC,MAAH,aAAaC,gBAAM,CAACC,IAAP,CAAYP,OAAZ,EAAqBC,QAArB,CAAb,CAAP;EACD,GAPoB;EASrBO,EAAAA,OATqB,mBASbP,QATa,EASHD,OATG,EASiC;EAAA,QAApCA,OAAoC;EAApCA,MAAAA,OAAoC,GAA1BG,QAAQ,CAACC,eAAiB;EAAA;;EACpD,WAAOI,mBAAO,CAACD,IAAR,CAAaP,OAAb,EAAsBC,QAAtB,CAAP;EACD,GAXoB;EAarBQ,EAAAA,QAbqB,oBAaZT,OAbY,EAaHC,QAbG,EAaO;EAAA;;EAC1B,QAAMQ,QAAQ,GAAG,aAAGJ,MAAH,cAAaL,OAAO,CAACS,QAArB,CAAjB;;EAEA,WAAOA,QAAQ,CAACC,MAAT,CAAgB,UAAAC,KAAK;EAAA,aAAIA,KAAK,CAACZ,OAAN,CAAcE,QAAd,CAAJ;EAAA,KAArB,CAAP;EACD,GAjBoB;EAmBrBW,EAAAA,OAnBqB,mBAmBbZ,OAnBa,EAmBJC,QAnBI,EAmBM;EACzB,QAAMW,OAAO,GAAG,EAAhB;EAEA,QAAIC,QAAQ,GAAGb,OAAO,CAACc,UAAvB;;EAEA,WAAOD,QAAQ,IAAIA,QAAQ,CAACE,QAAT,KAAsBC,IAAI,CAACC,YAAvC,IAAuDJ,QAAQ,CAACE,QAAT,KAAsBlB,SAApF,EAA+F;EAC7F,UAAI,KAAKE,OAAL,CAAac,QAAb,EAAuBZ,QAAvB,CAAJ,EAAsC;EACpCW,QAAAA,OAAO,CAACM,IAAR,CAAaL,QAAb;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,UAApB;EACD;;EAED,WAAOF,OAAP;EACD,GAjCoB;EAmCrBO,EAAAA,IAnCqB,gBAmChBnB,OAnCgB,EAmCPC,QAnCO,EAmCG;EACtB,QAAImB,QAAQ,GAAGpB,OAAO,CAACqB,sBAAvB;;EAEA,WAAOD,QAAP,EAAiB;EACf,UAAIA,QAAQ,CAACrB,OAAT,CAAiBE,QAAjB,CAAJ,EAAgC;EAC9B,eAAO,CAACmB,QAAD,CAAP;EACD;;EAEDA,MAAAA,QAAQ,GAAGA,QAAQ,CAACC,sBAApB;EACD;;EAED,WAAO,EAAP;EACD,GA/CoB;EAiDrBC,EAAAA,IAjDqB,gBAiDhBtB,OAjDgB,EAiDPC,QAjDO,EAiDG;EACtB,QAAIqB,IAAI,GAAGtB,OAAO,CAACuB,kBAAnB;;EAEA,WAAOD,IAAP,EAAa;EACX,UAAI,KAAKvB,OAAL,CAAauB,IAAb,EAAmBrB,QAAnB,CAAJ,EAAkC;EAChC,eAAO,CAACqB,IAAD,CAAP;EACD;;EAEDA,MAAAA,IAAI,GAAGA,IAAI,CAACC,kBAAZ;EACD;;EAED,WAAO,EAAP;EACD;EA7DoB;;;;;;;;"}

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap dropdown.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap dropdown.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -20,7 +20,7 @@
'popper.js',
'./dom/selector-engine.js',
], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Dropdown = factory(
global.Data,
global.EventHandler,
@ -31,25 +31,19 @@
})(this, function (Data, EventHandler, Manipulator, Popper, SelectorEngine) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
Manipulator =
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default')
? Manipulator['default']
: Manipulator;
Popper =
Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var Popper__default = /*#__PURE__*/ _interopDefaultLegacy(Popper);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -135,49 +129,21 @@
return null;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
function _defineProperties(target, props) {
@ -202,7 +168,7 @@
*/
var NAME = 'dropdown';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.dropdown';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -273,7 +239,7 @@
this._addEventListeners();
Data.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
} // Getters
var _proto = Dropdown.prototype;
@ -308,14 +274,18 @@
var relatedTarget = {
relatedTarget: this._element,
};
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget);
var showEvent = EventHandler__default['default'].trigger(
this._element,
EVENT_SHOW,
relatedTarget
);
if (showEvent.defaultPrevented) {
return;
} // Disable totally Popper.js for Dropdown in Navbar
if (!this._inNavbar) {
if (typeof Popper === 'undefined') {
if (typeof Popper__default['default'] === 'undefined') {
throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org)");
}
@ -337,7 +307,11 @@
parent.classList.add(CLASS_NAME_POSITION_STATIC);
}
this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
this._popper = new Popper__default['default'](
referenceElement,
this._menu,
this._getPopperConfig()
);
} // 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
@ -347,7 +321,7 @@
var _ref;
(_ref = []).concat.apply(_ref, document.body.children).forEach(function (elem) {
return EventHandler.on(elem, 'mouseover', null, noop());
return EventHandler__default['default'].on(elem, 'mouseover', null, noop());
});
}
@ -355,9 +329,9 @@
this._element.setAttribute('aria-expanded', true);
Manipulator.toggleClass(this._menu, CLASS_NAME_SHOW);
Manipulator.toggleClass(this._element, CLASS_NAME_SHOW);
EventHandler.trigger(parent, EVENT_SHOWN, relatedTarget);
Manipulator__default['default'].toggleClass(this._menu, CLASS_NAME_SHOW);
Manipulator__default['default'].toggleClass(this._element, CLASS_NAME_SHOW);
EventHandler__default['default'].trigger(parent, EVENT_SHOWN, relatedTarget);
};
_proto.hide = function hide() {
@ -373,7 +347,7 @@
var relatedTarget = {
relatedTarget: this._element,
};
var hideEvent = EventHandler.trigger(parent, EVENT_HIDE, relatedTarget);
var hideEvent = EventHandler__default['default'].trigger(parent, EVENT_HIDE, relatedTarget);
if (hideEvent.defaultPrevented) {
return;
@ -383,14 +357,14 @@
this._popper.destroy();
}
Manipulator.toggleClass(this._menu, CLASS_NAME_SHOW);
Manipulator.toggleClass(this._element, CLASS_NAME_SHOW);
EventHandler.trigger(parent, EVENT_HIDDEN, relatedTarget);
Manipulator__default['default'].toggleClass(this._menu, CLASS_NAME_SHOW);
Manipulator__default['default'].toggleClass(this._element, CLASS_NAME_SHOW);
EventHandler__default['default'].trigger(parent, EVENT_HIDDEN, relatedTarget);
};
_proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY);
EventHandler.off(this._element, EVENT_KEY);
Data__default['default'].removeData(this._element, DATA_KEY);
EventHandler__default['default'].off(this._element, EVENT_KEY);
this._element = null;
this._menu = null;
@ -412,7 +386,7 @@
_proto._addEventListeners = function _addEventListeners() {
var _this = this;
EventHandler.on(this._element, EVENT_CLICK, function (event) {
EventHandler__default['default'].on(this._element, EVENT_CLICK, function (event) {
event.preventDefault();
event.stopPropagation();
@ -421,11 +395,10 @@
};
_proto._getConfig = function _getConfig(config) {
config = _objectSpread(
_objectSpread(
_objectSpread({}, this.constructor.Default),
Manipulator.getDataAttributes(this._element)
),
config = _extends(
{},
this.constructor.Default,
Manipulator__default['default'].getDataAttributes(this._element),
config
);
typeCheckConfig(NAME, config, this.constructor.DefaultType);
@ -433,7 +406,7 @@
};
_proto._getMenuElement = function _getMenuElement() {
return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
return SelectorEngine__default['default'].next(this._element, SELECTOR_MENU)[0];
};
_proto._getPlacement = function _getPlacement() {
@ -468,8 +441,9 @@
if (typeof this._config.offset === 'function') {
offset.fn = function (data) {
data.offsets = _objectSpread(
_objectSpread({}, data.offsets),
data.offsets = _extends(
{},
data.offsets,
_this2._config.offset(data.offsets, _this2._element) || {}
);
return data;
@ -501,11 +475,11 @@
};
}
return _objectSpread(_objectSpread({}, popperConfig), this._config.popperConfig);
return _extends({}, popperConfig, this._config.popperConfig);
}; // Static
Dropdown.dropdownInterface = function dropdownInterface(element, config) {
var data = Data.getData(element, DATA_KEY);
var data = Data__default['default'].getData(element, DATA_KEY);
var _config = typeof config === 'object' ? config : null;
@ -536,11 +510,11 @@
return;
}
var toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
var toggles = SelectorEngine__default['default'].find(SELECTOR_DATA_TOGGLE);
for (var i = 0, len = toggles.length; i < len; i++) {
var parent = Dropdown.getParentFromElement(toggles[i]);
var context = Data.getData(toggles[i], DATA_KEY);
var context = Data__default['default'].getData(toggles[i], DATA_KEY);
var relatedTarget = {
relatedTarget: toggles[i],
};
@ -568,7 +542,7 @@
continue;
}
var hideEvent = EventHandler.trigger(parent, EVENT_HIDE, relatedTarget);
var hideEvent = EventHandler__default['default'].trigger(parent, EVENT_HIDE, relatedTarget);
if (hideEvent.defaultPrevented) {
continue;
@ -579,7 +553,7 @@
var _ref2;
(_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (elem) {
return EventHandler.off(elem, 'mouseover', null, noop());
return EventHandler__default['default'].off(elem, 'mouseover', null, noop());
});
}
@ -591,7 +565,7 @@
dropdownMenu.classList.remove(CLASS_NAME_SHOW);
toggles[i].classList.remove(CLASS_NAME_SHOW);
EventHandler.trigger(parent, EVENT_HIDDEN, relatedTarget);
EventHandler__default['default'].trigger(parent, EVENT_HIDDEN, relatedTarget);
}
};
@ -631,7 +605,7 @@
if (event.key === ESCAPE_KEY) {
var button = this.matches(SELECTOR_DATA_TOGGLE)
? this
: SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0];
: SelectorEngine__default['default'].prev(this, SELECTOR_DATA_TOGGLE)[0];
button.focus();
Dropdown.clearMenus();
return;
@ -642,7 +616,9 @@
return;
}
var items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, parent).filter(isVisible);
var items = SelectorEngine__default['default']
.find(SELECTOR_VISIBLE_ITEMS, parent)
.filter(isVisible);
if (!items.length) {
return;
@ -665,7 +641,7 @@
};
Dropdown.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Dropdown, null, [
@ -697,23 +673,38 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(
EventHandler__default['default'].on(
document,
EVENT_KEYDOWN_DATA_API,
SELECTOR_DATA_TOGGLE,
Dropdown.dataApiKeydownHandler
);
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
EventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus);
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
EventHandler__default['default'].on(
document,
EVENT_KEYDOWN_DATA_API,
SELECTOR_MENU,
Dropdown.dataApiKeydownHandler
);
EventHandler__default['default'].on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus);
EventHandler__default['default'].on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_DATA_TOGGLE,
function (event) {
event.preventDefault();
event.stopPropagation();
Dropdown.dropdownInterface(this, 'toggle');
});
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, function (e) {
}
);
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_FORM_CHILD,
function (e) {
return e.stopPropagation();
});
}
);
var $ = getjQuery();
/**
* ------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap modal.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap modal.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -18,7 +18,7 @@
'./dom/manipulator.js',
'./dom/selector-engine.js',
], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Modal = factory(
global.Data,
global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
Manipulator =
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default')
? Manipulator['default']
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -175,49 +170,21 @@
return null;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
function _defineProperties(target, props) {
@ -242,7 +209,7 @@
*/
var NAME = 'modal';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.modal';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -293,14 +260,14 @@
function Modal(element, config) {
this._config = this._getConfig(config);
this._element = element;
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, 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.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
} // Getters
var _proto = Modal.prototype;
@ -321,7 +288,7 @@
this._isTransitioning = true;
}
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
relatedTarget: relatedTarget,
});
@ -341,11 +308,18 @@
this._setResizeEvent();
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
EventHandler__default['default'].on(
this._element,
EVENT_CLICK_DISMISS,
SELECTOR_DATA_DISMISS,
function (event) {
return _this.hide(event);
});
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
EventHandler.one(_this._element, EVENT_MOUSEUP_DISMISS, function (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;
}
@ -368,7 +342,7 @@
return;
}
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
if (hideEvent.defaultPrevented) {
return;
@ -386,16 +360,16 @@
this._setResizeEvent();
EventHandler.off(document, EVENT_FOCUSIN);
EventHandler__default['default'].off(document, EVENT_FOCUSIN);
this._element.classList.remove(CLASS_NAME_SHOW);
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
EventHandler__default['default'].off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
if (transition) {
var transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, TRANSITION_END, function (event) {
EventHandler__default['default'].one(this._element, TRANSITION_END, function (event) {
return _this2._hideModal(event);
});
emulateTransitionEnd(this._element, transitionDuration);
@ -406,7 +380,7 @@
_proto.dispose = function dispose() {
[window, this._element, this._dialog].forEach(function (htmlElement) {
return EventHandler.off(htmlElement, EVENT_KEY);
return EventHandler__default['default'].off(htmlElement, EVENT_KEY);
});
/**
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
@ -414,8 +388,8 @@
* It will remove `EVENT_CLICK_DATA_API` event that should remain
*/
EventHandler.off(document, EVENT_FOCUSIN);
Data.removeData(this._element, DATA_KEY);
EventHandler__default['default'].off(document, EVENT_FOCUSIN);
Data__default['default'].removeData(this._element, DATA_KEY);
this._config = null;
this._element = null;
this._dialog = null;
@ -432,7 +406,7 @@
}; // Private
_proto._getConfig = function _getConfig(config) {
config = _objectSpread(_objectSpread({}, Default), config);
config = _extends({}, Default, config);
typeCheckConfig(NAME, config, DefaultType);
return config;
};
@ -442,7 +416,7 @@
var transition = this._element.classList.contains(CLASS_NAME_FADE);
var modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
var modalBody = SelectorEngine__default['default'].findOne(SELECTOR_MODAL_BODY, this._dialog);
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
// Don't move modal's DOM position
@ -479,14 +453,14 @@
}
_this3._isTransitioning = false;
EventHandler.trigger(_this3._element, EVENT_SHOWN, {
EventHandler__default['default'].trigger(_this3._element, EVENT_SHOWN, {
relatedTarget: relatedTarget,
});
};
if (transition) {
var transitionDuration = getTransitionDurationFromElement(this._dialog);
EventHandler.one(this._dialog, TRANSITION_END, transitionComplete);
EventHandler__default['default'].one(this._dialog, TRANSITION_END, transitionComplete);
emulateTransitionEnd(this._dialog, transitionDuration);
} else {
transitionComplete();
@ -496,9 +470,9 @@
_proto._enforceFocus = function _enforceFocus() {
var _this4 = this;
EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
EventHandler__default['default'].off(document, EVENT_FOCUSIN); // guard against infinite focus loop
EventHandler.on(document, EVENT_FOCUSIN, function (event) {
EventHandler__default['default'].on(document, EVENT_FOCUSIN, function (event) {
if (
document !== event.target &&
_this4._element !== event.target &&
@ -513,7 +487,7 @@
var _this5 = this;
if (this._isShown) {
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
EventHandler__default['default'].on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
if (_this5._config.keyboard && event.key === ESCAPE_KEY) {
event.preventDefault();
@ -523,7 +497,7 @@
}
});
} else {
EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS);
EventHandler__default['default'].off(this._element, EVENT_KEYDOWN_DISMISS);
}
};
@ -531,11 +505,11 @@
var _this6 = this;
if (this._isShown) {
EventHandler.on(window, EVENT_RESIZE, function () {
EventHandler__default['default'].on(window, EVENT_RESIZE, function () {
return _this6._adjustDialog();
});
} else {
EventHandler.off(window, EVENT_RESIZE);
EventHandler__default['default'].off(window, EVENT_RESIZE);
}
};
@ -559,7 +533,7 @@
_this7._resetScrollbar();
EventHandler.trigger(_this7._element, EVENT_HIDDEN);
EventHandler__default['default'].trigger(_this7._element, EVENT_HIDDEN);
});
};
@ -583,7 +557,7 @@
}
document.body.appendChild(this._backdrop);
EventHandler.on(this._element, EVENT_CLICK_DISMISS, function (event) {
EventHandler__default['default'].on(this._element, EVENT_CLICK_DISMISS, function (event) {
if (_this8._ignoreBackdropClick) {
_this8._ignoreBackdropClick = false;
return;
@ -608,7 +582,7 @@
}
var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
EventHandler.one(this._backdrop, TRANSITION_END, callback);
EventHandler__default['default'].one(this._backdrop, TRANSITION_END, callback);
emulateTransitionEnd(this._backdrop, backdropTransitionDuration);
} else if (!this._isShown && this._backdrop) {
this._backdrop.classList.remove(CLASS_NAME_SHOW);
@ -622,7 +596,7 @@
if (this._element.classList.contains(CLASS_NAME_FADE)) {
var _backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
EventHandler.one(this._backdrop, TRANSITION_END, callbackRemove);
EventHandler__default['default'].one(this._backdrop, TRANSITION_END, callbackRemove);
emulateTransitionEnd(this._backdrop, _backdropTransitionDuration);
} else {
callbackRemove();
@ -636,17 +610,34 @@
var _this9 = this;
if (this._config.backdrop === 'static') {
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
var hideEvent = EventHandler__default['default'].trigger(
this._element,
EVENT_HIDE_PREVENTED
);
if (hideEvent.defaultPrevented) {
return;
}
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
if (!isModalOverflowing) {
this._element.style.overflowY = 'hidden';
}
this._element.classList.add(CLASS_NAME_STATIC);
var modalTransitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, TRANSITION_END, function () {
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);
if (!isModalOverflowing) {
EventHandler__default['default'].one(_this9._element, TRANSITION_END, function () {
_this9._element.style.overflowY = '';
});
emulateTransitionEnd(_this9._element, modalTransitionDuration);
}
});
emulateTransitionEnd(this._element, modalTransitionDuration);
@ -688,24 +679,31 @@
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set
// while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
// Adjust fixed content padding
SelectorEngine.find(SELECTOR_FIXED_CONTENT).forEach(function (element) {
SelectorEngine__default['default'].find(SELECTOR_FIXED_CONTENT).forEach(function (element) {
var actualPadding = element.style.paddingRight;
var calculatedPadding = window.getComputedStyle(element)['padding-right'];
Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
Manipulator__default['default'].setDataAttribute(element, 'padding-right', actualPadding);
element.style.paddingRight =
parseFloat(calculatedPadding) + _this10._scrollbarWidth + 'px';
}); // Adjust sticky content margin
SelectorEngine.find(SELECTOR_STICKY_CONTENT).forEach(function (element) {
SelectorEngine__default['default']
.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 = parseFloat(calculatedMargin) - _this10._scrollbarWidth + 'px';
Manipulator__default['default'].setDataAttribute(element, 'margin-right', actualMargin);
element.style.marginRight =
parseFloat(calculatedMargin) - _this10._scrollbarWidth + 'px';
}); // Adjust body padding
var actualPadding = document.body.style.paddingRight;
var calculatedPadding = window.getComputedStyle(document.body)['padding-right'];
Manipulator.setDataAttribute(document.body, 'padding-right', actualPadding);
Manipulator__default['default'].setDataAttribute(
document.body,
'padding-right',
actualPadding
);
document.body.style.paddingRight =
parseFloat(calculatedPadding) + this._scrollbarWidth + 'px';
}
@ -715,30 +713,35 @@
_proto._resetScrollbar = function _resetScrollbar() {
// Restore fixed content padding
SelectorEngine.find(SELECTOR_FIXED_CONTENT).forEach(function (element) {
var padding = Manipulator.getDataAttribute(element, 'padding-right');
SelectorEngine__default['default'].find(SELECTOR_FIXED_CONTENT).forEach(function (element) {
var padding = Manipulator__default['default'].getDataAttribute(element, 'padding-right');
if (typeof padding !== 'undefined') {
Manipulator.removeDataAttribute(element, 'padding-right');
Manipulator__default['default'].removeDataAttribute(element, 'padding-right');
element.style.paddingRight = padding;
}
}); // Restore sticky content and navbar-toggler margin
SelectorEngine.find('' + SELECTOR_STICKY_CONTENT).forEach(function (element) {
var margin = Manipulator.getDataAttribute(element, 'margin-right');
SelectorEngine__default['default']
.find('' + SELECTOR_STICKY_CONTENT)
.forEach(function (element) {
var margin = Manipulator__default['default'].getDataAttribute(element, 'margin-right');
if (typeof margin !== 'undefined') {
Manipulator.removeDataAttribute(element, 'margin-right');
Manipulator__default['default'].removeDataAttribute(element, 'margin-right');
element.style.marginRight = margin;
}
}); // Restore body padding
var padding = Manipulator.getDataAttribute(document.body, 'padding-right');
var padding = Manipulator__default['default'].getDataAttribute(
document.body,
'padding-right'
);
if (typeof padding === 'undefined') {
document.body.style.paddingRight = '';
} else {
Manipulator.removeDataAttribute(document.body, 'padding-right');
Manipulator__default['default'].removeDataAttribute(document.body, 'padding-right');
document.body.style.paddingRight = padding;
}
};
@ -755,10 +758,12 @@
Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
var data = Data__default['default'].getData(this, DATA_KEY);
var _config = _objectSpread(
_objectSpread(_objectSpread({}, Default), Manipulator.getDataAttributes(this)),
var _config = _extends(
{},
Default,
Manipulator__default['default'].getDataAttributes(this),
typeof config === 'object' && config ? config : {}
);
@ -779,7 +784,7 @@
};
Modal.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Modal, null, [
@ -805,7 +810,11 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_DATA_TOGGLE,
function (event) {
var _this11 = this;
var target = getElementFromSelector(this);
@ -814,31 +823,33 @@
event.preventDefault();
}
EventHandler.one(target, EVENT_SHOW, function (showEvent) {
EventHandler__default['default'].one(target, EVENT_SHOW, function (showEvent) {
if (showEvent.defaultPrevented) {
// only register focus restorer if modal will actually get shown
return;
}
EventHandler.one(target, EVENT_HIDDEN, function () {
EventHandler__default['default'].one(target, EVENT_HIDDEN, function () {
if (isVisible(_this11)) {
_this11.focus();
}
});
});
var data = Data.getData(target, DATA_KEY);
var data = Data__default['default'].getData(target, DATA_KEY);
if (!data) {
var config = _objectSpread(
_objectSpread({}, Manipulator.getDataAttributes(target)),
Manipulator.getDataAttributes(this)
var config = _extends(
{},
Manipulator__default['default'].getDataAttributes(target),
Manipulator__default['default'].getDataAttributes(this)
);
data = new Modal(target, config);
}
data.show(this);
});
}
);
var $ = getjQuery();
/**
* ------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap popover.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap popover.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -12,24 +12,22 @@
))
: typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/selector-engine.js', './tooltip.js'], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Popover = factory(global.Data, global.SelectorEngine, global.Tooltip)));
})(this, function (Data, SelectorEngine, Tooltip) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
Tooltip =
Tooltip && Object.prototype.hasOwnProperty.call(Tooltip, 'default')
? Tooltip['default']
: Tooltip;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
var Tooltip__default = /*#__PURE__*/ _interopDefaultLegacy(Tooltip);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -67,49 +65,21 @@
subClass.__proto__ = superClass;
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
/**
* ------------------------------------------------------------------------
@ -118,16 +88,13 @@
*/
var NAME = 'popover';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.popover';
var EVENT_KEY = '.' + DATA_KEY;
var CLASS_PREFIX = 'bs-popover';
var BSCLS_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g');
var Default = _objectSpread(
_objectSpread({}, Tooltip.Default),
{},
{
var Default = _extends({}, Tooltip__default['default'].Default, {
placement: 'right',
trigger: 'click',
content: '',
@ -136,16 +103,11 @@
'<div class="popover-arrow"></div>' +
'<h3 class="popover-header"></h3>' +
'<div class="popover-body"></div></div>',
}
);
});
var DefaultType = _objectSpread(
_objectSpread({}, Tooltip.DefaultType),
{},
{
var DefaultType = _extends({}, Tooltip__default['default'].DefaultType, {
content: '(string|element|function)',
}
);
});
var Event = {
HIDE: 'hide' + EVENT_KEY,
@ -186,7 +148,10 @@
_proto.setContent = function setContent() {
var tip = this.getTipElement(); // we use append for html objects to maintain js events
this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
this.setElementContent(
SelectorEngine__default['default'].findOne(SELECTOR_TITLE, tip),
this.getTitle()
);
var content = this._getContent();
@ -194,13 +159,16 @@
content = content.call(this.element);
}
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
this.setElementContent(
SelectorEngine__default['default'].findOne(SELECTOR_CONTENT, tip),
content
);
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
};
}; // Private
_proto._addAttachmentClass = function _addAttachmentClass(attachment) {
this.getTipElement().classList.add(CLASS_PREFIX + '-' + attachment);
}; // Private
};
_proto._getContent = function _getContent() {
return this.element.getAttribute('data-content') || this.config.content;
@ -223,7 +191,7 @@
Popover.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
var data = Data__default['default'].getData(this, DATA_KEY);
var _config = typeof config === 'object' ? config : null;
@ -233,7 +201,7 @@
if (!data) {
data = new Popover(this, _config);
Data.setData(this, DATA_KEY, data);
Data__default['default'].setData(this, DATA_KEY, data);
}
if (typeof config === 'string') {
@ -247,7 +215,7 @@
};
Popover.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Popover, null, [
@ -297,7 +265,7 @@
]);
return Popover;
})(Tooltip);
})(Tooltip__default['default']);
var $ = getjQuery();
/**

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap scrollspy.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap scrollspy.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -18,7 +18,7 @@
'./dom/manipulator.js',
'./dom/selector-engine.js',
], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.ScrollSpy = factory(
global.Data,
global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
Manipulator =
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default')
? Manipulator['default']
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -127,49 +122,21 @@
return null;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
function _defineProperties(target, props) {
@ -194,7 +161,7 @@
*/
var NAME = 'scrollspy';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.scrollspy';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -240,20 +207,25 @@
' ' +
SELECTOR_NAV_LINKS +
', ' +
(this._config.target + ' ' + SELECTOR_LIST_ITEMS + ',') +
(this._config.target + ' .' + CLASS_NAME_DROPDOWN_ITEM);
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) {
EventHandler__default['default'].on(this._scrollElement, EVENT_SCROLL, function (event) {
return _this._process(event);
});
this.refresh();
this._process();
Data.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
} // Getters
var _proto = ScrollSpy.prototype;
@ -269,21 +241,22 @@
this._offsets = [];
this._targets = [];
this._scrollHeight = this._getScrollHeight();
var targets = SelectorEngine.find(this._selector);
var targets = SelectorEngine__default['default'].find(this._selector);
targets
.map(function (element) {
var target;
var targetSelector = getSelectorFromElement(element);
if (targetSelector) {
target = SelectorEngine.findOne(targetSelector);
}
var target = targetSelector
? SelectorEngine__default['default'].findOne(targetSelector)
: null;
if (target) {
var targetBCR = target.getBoundingClientRect();
if (targetBCR.width || targetBCR.height) {
return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
return [
Manipulator__default['default'][offsetMethod](target).top + offsetBase,
targetSelector,
];
}
}
@ -303,8 +276,8 @@
};
_proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY);
EventHandler.off(this._scrollElement, EVENT_KEY);
Data__default['default'].removeData(this._element, DATA_KEY);
EventHandler__default['default'].off(this._scrollElement, EVENT_KEY);
this._element = null;
this._scrollElement = null;
this._config = null;
@ -316,10 +289,7 @@
}; // Private
_proto._getConfig = function _getConfig(config) {
config = _objectSpread(
_objectSpread({}, Default),
typeof config === 'object' && config ? config : {}
);
config = _extends({}, Default, typeof config === 'object' && config ? config : {});
if (typeof config.target !== 'string' && isElement(config.target)) {
var id = config.target.id;
@ -405,41 +375,47 @@
return selector + '[data-target="' + target + '"],' + selector + '[href="' + target + '"]';
});
var link = SelectorEngine.findOne(queries.join(','));
var link = SelectorEngine__default['default'].findOne(queries.join(','));
if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
SelectorEngine.findOne(
SELECTOR_DROPDOWN_TOGGLE,
link.closest(SELECTOR_DROPDOWN)
).classList.add(CLASS_NAME_ACTIVE);
SelectorEngine__default['default']
.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN))
.classList.add(CLASS_NAME_ACTIVE);
link.classList.add(CLASS_NAME_ACTIVE);
} else {
// Set triggered link as active
link.classList.add(CLASS_NAME_ACTIVE);
SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP).forEach(function (listGroup) {
SelectorEngine__default['default']
.parents(link, SELECTOR_NAV_LIST_GROUP)
.forEach(function (listGroup) {
// Set triggered links parents as active
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
SelectorEngine.prev(listGroup, SELECTOR_NAV_LINKS + ', ' + SELECTOR_LIST_ITEMS).forEach(
function (item) {
SelectorEngine__default['default']
.prev(listGroup, SELECTOR_NAV_LINKS + ', ' + SELECTOR_LIST_ITEMS)
.forEach(function (item) {
return item.classList.add(CLASS_NAME_ACTIVE);
}
); // Handle special case when .nav-link is inside .nav-item
}); // Handle special case when .nav-link is inside .nav-item
SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(function (navItem) {
SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(function (item) {
SelectorEngine__default['default']
.prev(listGroup, SELECTOR_NAV_ITEMS)
.forEach(function (navItem) {
SelectorEngine__default['default']
.children(navItem, SELECTOR_NAV_LINKS)
.forEach(function (item) {
return item.classList.add(CLASS_NAME_ACTIVE);
});
});
});
}
EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
EventHandler__default['default'].trigger(this._scrollElement, EVENT_ACTIVATE, {
relatedTarget: target,
});
};
_proto._clear = function _clear() {
SelectorEngine.find(this._selector)
SelectorEngine__default['default']
.find(this._selector)
.filter(function (node) {
return node.classList.contains(CLASS_NAME_ACTIVE);
})
@ -450,7 +426,7 @@
ScrollSpy.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
var data = Data__default['default'].getData(this, DATA_KEY);
var _config = typeof config === 'object' && config;
@ -469,7 +445,7 @@
};
ScrollSpy.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(ScrollSpy, null, [
@ -495,9 +471,9 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(window, EVENT_LOAD_DATA_API, function () {
SelectorEngine.find(SELECTOR_DATA_SPY).forEach(function (spy) {
return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
EventHandler__default['default'].on(window, EVENT_LOAD_DATA_API, function () {
SelectorEngine__default['default'].find(SELECTOR_DATA_SPY).forEach(function (spy) {
return new ScrollSpy(spy, Manipulator__default['default'].getDataAttributes(spy));
});
});
var $ = getjQuery();

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap tab.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap tab.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -12,24 +12,22 @@
))
: typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/event-handler.js', './dom/selector-engine.js'], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Tab = factory(global.Data, global.EventHandler, global.SelectorEngine)));
})(this, function (Data, EventHandler, SelectorEngine) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -132,7 +130,7 @@
*/
var NAME = 'tab';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.tab';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@ -162,7 +160,7 @@
var Tab = /*#__PURE__*/ (function () {
function Tab(element) {
this._element = element;
Data.setData(this._element, DATA_KEY, this);
Data__default['default'].setData(this._element, DATA_KEY, this);
} // Getters
var _proto = Tab.prototype;
@ -190,19 +188,19 @@
listElement.nodeName === 'UL' || listElement.nodeName === 'OL'
? SELECTOR_ACTIVE_UL
: SELECTOR_ACTIVE;
previous = SelectorEngine.find(itemSelector, listElement);
previous = SelectorEngine__default['default'].find(itemSelector, listElement);
previous = previous[previous.length - 1];
}
var hideEvent = null;
if (previous) {
hideEvent = EventHandler.trigger(previous, EVENT_HIDE, {
hideEvent = EventHandler__default['default'].trigger(previous, EVENT_HIDE, {
relatedTarget: this._element,
});
}
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
relatedTarget: previous,
});
@ -213,10 +211,10 @@
this._activate(this._element, listElement);
var complete = function complete() {
EventHandler.trigger(previous, EVENT_HIDDEN, {
EventHandler__default['default'].trigger(previous, EVENT_HIDDEN, {
relatedTarget: _this._element,
});
EventHandler.trigger(_this._element, EVENT_SHOWN, {
EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN, {
relatedTarget: previous,
});
};
@ -229,7 +227,7 @@
};
_proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY);
Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null;
}; // Private
@ -238,8 +236,8 @@
var activeElements =
container && (container.nodeName === 'UL' || container.nodeName === 'OL')
? SelectorEngine.find(SELECTOR_ACTIVE_UL, container)
: SelectorEngine.children(container, SELECTOR_ACTIVE);
? SelectorEngine__default['default'].find(SELECTOR_ACTIVE_UL, container)
: SelectorEngine__default['default'].children(container, SELECTOR_ACTIVE);
var active = activeElements[0];
var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE);
@ -250,7 +248,7 @@
if (active && isTransitioning) {
var transitionDuration = getTransitionDurationFromElement(active);
active.classList.remove(CLASS_NAME_SHOW);
EventHandler.one(active, TRANSITION_END, complete);
EventHandler__default['default'].one(active, TRANSITION_END, complete);
emulateTransitionEnd(active, transitionDuration);
} else {
complete();
@ -260,7 +258,7 @@
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
if (active) {
active.classList.remove(CLASS_NAME_ACTIVE);
var dropdownChild = SelectorEngine.findOne(
var dropdownChild = SelectorEngine__default['default'].findOne(
SELECTOR_DROPDOWN_ACTIVE_CHILD,
active.parentNode
);
@ -290,7 +288,9 @@
var dropdownElement = element.closest(SELECTOR_DROPDOWN);
if (dropdownElement) {
SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE).forEach(function (dropdown) {
SelectorEngine__default['default']
.find(SELECTOR_DROPDOWN_TOGGLE)
.forEach(function (dropdown) {
return dropdown.classList.add(CLASS_NAME_ACTIVE);
});
}
@ -305,7 +305,7 @@
Tab.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY) || new Tab(this);
var data = Data__default['default'].getData(this, DATA_KEY) || new Tab(this);
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
@ -318,7 +318,7 @@
};
Tab.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Tab, null, [
@ -338,11 +338,16 @@
* ------------------------------------------------------------------------
*/
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
EventHandler__default['default'].on(
document,
EVENT_CLICK_DATA_API,
SELECTOR_DATA_TOGGLE,
function (event) {
event.preventDefault();
var data = Data.getData(this, DATA_KEY) || new Tab(this);
var data = Data__default['default'].getData(this, DATA_KEY) || new Tab(this);
data.show();
});
}
);
var $ = getjQuery();
/**
* ------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap toast.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap toast.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -12,24 +12,22 @@
))
: typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js'], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Toast = factory(global.Data, global.EventHandler, global.Manipulator)));
})(this, function (Data, EventHandler, Manipulator) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
Manipulator =
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default')
? Manipulator['default']
: Manipulator;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -126,49 +124,21 @@
return null;
};
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
function _defineProperties(target, props) {
@ -193,7 +163,7 @@
*/
var NAME = 'toast';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.toast';
var EVENT_KEY = '.' + DATA_KEY;
var EVENT_CLICK_DISMISS = 'click.dismiss' + EVENT_KEY;
@ -213,7 +183,7 @@
var Default = {
animation: true,
autohide: true,
delay: 500,
delay: 5000,
};
var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
/**
@ -230,7 +200,7 @@
this._setListeners();
Data.setData(element, DATA_KEY, this);
Data__default['default'].setData(element, DATA_KEY, this);
} // Getters
var _proto = Toast.prototype;
@ -239,12 +209,14 @@
_proto.show = function show() {
var _this = this;
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW);
var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
if (showEvent.defaultPrevented) {
return;
}
this._clearTimeout();
if (this._config.animation) {
this._element.classList.add(CLASS_NAME_FADE);
}
@ -254,7 +226,7 @@
_this._element.classList.add(CLASS_NAME_SHOW);
EventHandler.trigger(_this._element, EVENT_SHOWN);
EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN);
if (_this._config.autohide) {
_this._timeout = setTimeout(function () {
@ -271,7 +243,7 @@
if (this._config.animation) {
var transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, TRANSITION_END, complete);
EventHandler__default['default'].one(this._element, TRANSITION_END, complete);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
@ -285,7 +257,7 @@
return;
}
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE);
var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
if (hideEvent.defaultPrevented) {
return;
@ -294,14 +266,14 @@
var complete = function complete() {
_this2._element.classList.add(CLASS_NAME_HIDE);
EventHandler.trigger(_this2._element, EVENT_HIDDEN);
EventHandler__default['default'].trigger(_this2._element, EVENT_HIDDEN);
};
this._element.classList.remove(CLASS_NAME_SHOW);
if (this._config.animation) {
var transitionDuration = getTransitionDurationFromElement(this._element);
EventHandler.one(this._element, TRANSITION_END, complete);
EventHandler__default['default'].one(this._element, TRANSITION_END, complete);
emulateTransitionEnd(this._element, transitionDuration);
} else {
complete();
@ -309,22 +281,23 @@
};
_proto.dispose = function dispose() {
clearTimeout(this._timeout);
this._timeout = null;
this._clearTimeout();
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
this._element.classList.remove(CLASS_NAME_SHOW);
}
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
Data.removeData(this._element, DATA_KEY);
EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null;
this._config = null;
}; // Private
_proto._getConfig = function _getConfig(config) {
config = _objectSpread(
_objectSpread(_objectSpread({}, Default), Manipulator.getDataAttributes(this._element)),
config = _extends(
{},
Default,
Manipulator__default['default'].getDataAttributes(this._element),
typeof config === 'object' && config ? config : {}
);
typeCheckConfig(NAME, config, this.constructor.DefaultType);
@ -334,14 +307,24 @@
_proto._setListeners = function _setListeners() {
var _this3 = this;
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {
EventHandler__default['default'].on(
this._element,
EVENT_CLICK_DISMISS,
SELECTOR_DATA_DISMISS,
function () {
return _this3.hide();
});
}
);
};
_proto._clearTimeout = function _clearTimeout() {
clearTimeout(this._timeout);
this._timeout = null;
}; // Static
Toast.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
var data = Data__default['default'].getData(this, DATA_KEY);
var _config = typeof config === 'object' && config;
@ -360,7 +343,7 @@
};
Toast.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Toast, null, [

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap tooltip.js v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap tooltip.js v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@ -20,7 +20,7 @@
'popper.js',
'./dom/selector-engine.js',
], factory)
: ((global = global || self),
: ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Tooltip = factory(
global.Data,
global.EventHandler,
@ -31,25 +31,19 @@
})(this, function (Data, EventHandler, Manipulator, Popper, SelectorEngine) {
'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data;
EventHandler =
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default')
? EventHandler['default']
: EventHandler;
Manipulator =
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default')
? Manipulator['default']
: Manipulator;
Popper =
Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: SelectorEngine;
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e };
}
var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
var Popper__default = /*#__PURE__*/ _interopDefaultLegacy(Popper);
var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -183,7 +177,7 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/sanitizer.js
* Bootstrap (v5.0.0-alpha2): util/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -239,7 +233,7 @@
return false;
};
var DefaultWhitelist = {
var DefaultAllowlist = {
// Global attributes allowed on any supplied element below.
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
a: ['target', 'href', 'title', 'rel'],
@ -272,7 +266,7 @@
u: [],
ul: [],
};
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
var _ref;
if (!unsafeHtml.length) {
@ -285,7 +279,7 @@
var domParser = new window.DOMParser();
var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
var whitelistKeys = Object.keys(whiteList);
var allowlistKeys = Object.keys(allowList);
var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
@ -295,16 +289,16 @@
var el = elements[i];
var elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(elName) === -1) {
if (allowlistKeys.indexOf(elName) === -1) {
el.parentNode.removeChild(el);
return 'continue';
}
var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
var allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
attributeList.forEach(function (attr) {
if (!allowedAttribute(attr, whitelistedAttributes)) {
if (!allowedAttribute(attr, allowedAttributes)) {
el.removeAttribute(attr.nodeName);
}
});
@ -319,49 +313,21 @@
return createdDocument.body.innerHTML;
}
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
function _extends() {
_extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
};
return _extends.apply(this, arguments);
}
function _defineProperties(target, props) {
@ -386,12 +352,12 @@
*/
var NAME = 'tooltip';
var VERSION = '5.0.0-alpha1';
var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = '.' + DATA_KEY;
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g');
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
var DISALLOWED_ATTRIBUTES = ['sanitize', 'allowList', 'sanitizeFn'];
var DefaultType = {
animation: 'boolean',
template: 'string',
@ -407,7 +373,7 @@
boundary: '(string|element)',
sanitize: 'boolean',
sanitizeFn: '(null|function)',
whiteList: 'object',
allowList: 'object',
popperConfig: '(null|object)',
};
var AttachmentMap = {
@ -435,7 +401,7 @@
boundary: 'scrollParent',
sanitize: true,
sanitizeFn: null,
whiteList: DefaultWhitelist,
allowList: DefaultAllowlist,
popperConfig: null,
};
var Event$1 = {
@ -468,7 +434,7 @@
var Tooltip = /*#__PURE__*/ (function () {
function Tooltip(element, config) {
if (typeof Popper === 'undefined') {
if (typeof Popper__default['default'] === 'undefined') {
throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org)");
} // private
@ -484,7 +450,7 @@
this._setListeners();
Data.setData(element, this.constructor.DATA_KEY, this);
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
} // Getters
var _proto = Tooltip.prototype;
@ -509,11 +475,11 @@
if (event) {
var dataKey = this.constructor.DATA_KEY;
var context = Data.getData(event.target, dataKey);
var context = Data__default['default'].getData(event.delegateTarget, dataKey);
if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig());
Data.setData(event.target, dataKey, context);
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data__default['default'].setData(event.delegateTarget, dataKey, context);
}
context._activeTrigger.click = !context._activeTrigger.click;
@ -536,9 +502,9 @@
_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(
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
@ -571,7 +537,10 @@
}
if (this.isWithContent() && this._isEnabled) {
var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
var showEvent = EventHandler__default['default'].trigger(
this.element,
this.constructor.Event.SHOW
);
var shadowRoot = findShadowRoot(this.element);
var isInTheDom =
shadowRoot === null
@ -603,14 +572,18 @@
var container = this._getContainer();
Data.setData(tip, this.constructor.DATA_KEY, this);
Data__default['default'].setData(tip, this.constructor.DATA_KEY, this);
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));
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
// empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS
@ -620,7 +593,7 @@
var _ref;
(_ref = []).concat.apply(_ref, document.body.children).forEach(function (element) {
EventHandler.on(element, 'mouseover', noop());
EventHandler__default['default'].on(element, 'mouseover', noop());
});
}
@ -631,7 +604,7 @@
var prevHoverState = _this._hoverState;
_this._hoverState = null;
EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
EventHandler__default['default'].trigger(_this.element, _this.constructor.Event.SHOWN);
if (prevHoverState === HOVER_STATE_OUT) {
_this._leave(null, _this);
@ -640,7 +613,7 @@
if (this.tip.classList.contains(CLASS_NAME_FADE)) {
var transitionDuration = getTransitionDurationFromElement(this.tip);
EventHandler.one(this.tip, TRANSITION_END, complete);
EventHandler__default['default'].one(this.tip, TRANSITION_END, complete);
emulateTransitionEnd(this.tip, transitionDuration);
} else {
complete();
@ -651,6 +624,10 @@
_proto.hide = function hide() {
var _this2 = this;
if (!this._popper) {
return;
}
var tip = this.getTipElement();
var complete = function complete() {
@ -662,12 +639,15 @@
_this2.element.removeAttribute('aria-describedby');
EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
EventHandler__default['default'].trigger(_this2.element, _this2.constructor.Event.HIDDEN);
_this2._popper.destroy();
};
var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
var hideEvent = EventHandler__default['default'].trigger(
this.element,
this.constructor.Event.HIDE
);
if (hideEvent.defaultPrevented) {
return;
@ -680,7 +660,7 @@
var _ref2;
(_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (element) {
return EventHandler.off(element, 'mouseover', noop);
return EventHandler__default['default'].off(element, 'mouseover', noop);
});
}
@ -690,7 +670,7 @@
if (this.tip.classList.contains(CLASS_NAME_FADE)) {
var transitionDuration = getTransitionDurationFromElement(tip);
EventHandler.one(tip, TRANSITION_END, complete);
EventHandler__default['default'].one(tip, TRANSITION_END, complete);
emulateTransitionEnd(tip, transitionDuration);
} else {
complete();
@ -722,7 +702,10 @@
_proto.setContent = function setContent() {
var tip = this.getTipElement();
this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
this.setElementContent(
SelectorEngine__default['default'].findOne(SELECTOR_TOOLTIP_INNER, tip),
this.getTitle()
);
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
};
@ -750,7 +733,7 @@
if (this.config.html) {
if (this.config.sanitize) {
content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
}
element.innerHTML = content;
@ -798,7 +781,7 @@
return _this3._handlePopperPlacementChange(data);
},
};
return _objectSpread(_objectSpread({}, defaultBsConfig), this.config.popperConfig);
return _extends({}, defaultBsConfig, this.config.popperConfig);
};
_proto._addAttachmentClass = function _addAttachmentClass(attachment) {
@ -812,8 +795,9 @@
if (typeof this.config.offset === 'function') {
offset.fn = function (data) {
data.offsets = _objectSpread(
_objectSpread({}, data.offsets),
data.offsets = _extends(
{},
data.offsets,
_this4.config.offset(data.offsets, _this4.element) || {}
);
return data;
@ -834,7 +818,7 @@
return this.config.container;
}
return SelectorEngine.findOne(this.config.container);
return SelectorEngine__default['default'].findOne(this.config.container);
};
_proto._getAttachment = function _getAttachment(placement) {
@ -847,7 +831,7 @@
var triggers = this.config.trigger.split(' ');
triggers.forEach(function (trigger) {
if (trigger === 'click') {
EventHandler.on(
EventHandler__default['default'].on(
_this5.element,
_this5.constructor.Event.CLICK,
_this5.config.selector,
@ -864,12 +848,22 @@
trigger === TRIGGER_HOVER
? _this5.constructor.Event.MOUSELEAVE
: _this5.constructor.Event.FOCUSOUT;
EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
EventHandler__default['default'].on(
_this5.element,
eventIn,
_this5.config.selector,
function (event) {
return _this5._enter(event);
});
EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
}
);
EventHandler__default['default'].on(
_this5.element,
eventOut,
_this5.config.selector,
function (event) {
return _this5._leave(event);
});
}
);
}
});
@ -879,21 +873,17 @@
}
};
EventHandler.on(
EventHandler__default['default'].on(
this.element.closest('.' + CLASS_NAME_MODAL),
'hide.bs.modal',
this._hideModalHandler
);
if (this.config.selector) {
this.config = _objectSpread(
_objectSpread({}, this.config),
{},
{
this.config = _extends({}, this.config, {
trigger: 'manual',
selector: '',
}
);
});
} else {
this._fixTitle();
}
@ -910,11 +900,11 @@
_proto._enter = function _enter(event, context) {
var dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey);
context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig());
Data.setData(event.target, dataKey, context);
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data__default['default'].setData(event.delegateTarget, dataKey, context);
}
if (event) {
@ -946,11 +936,11 @@
_proto._leave = function _leave(event, context) {
var dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey);
context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig());
Data.setData(event.target, dataKey, context);
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data__default['default'].setData(event.delegateTarget, dataKey, context);
}
if (event) {
@ -987,7 +977,7 @@
};
_proto._getConfig = function _getConfig(config) {
var dataAttributes = Manipulator.getDataAttributes(this.element);
var dataAttributes = Manipulator__default['default'].getDataAttributes(this.element);
Object.keys(dataAttributes).forEach(function (dataAttr) {
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
delete dataAttributes[dataAttr];
@ -998,8 +988,10 @@
config.container = config.container[0];
}
config = _objectSpread(
_objectSpread(_objectSpread({}, this.constructor.Default), dataAttributes),
config = _extends(
{},
this.constructor.Default,
dataAttributes,
typeof config === 'object' && config ? config : {}
);
@ -1021,7 +1013,7 @@
typeCheckConfig(NAME, config, this.constructor.DefaultType);
if (config.sanitize) {
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
}
return config;
@ -1057,8 +1049,7 @@
};
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
var popperInstance = popperData.instance;
this.tip = popperInstance.popper;
this.tip = popperData.instance.popper;
this._cleanTipClass();
@ -1082,7 +1073,7 @@
Tooltip.jQueryInterface = function jQueryInterface(config) {
return this.each(function () {
var data = Data.getData(this, DATA_KEY);
var data = Data__default['default'].getData(this, DATA_KEY);
var _config = typeof config === 'object' && config;
@ -1105,7 +1096,7 @@
};
Tooltip.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY);
return Data__default['default'].getData(element, DATA_KEY);
};
_createClass(Tooltip, null, [

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): alert.js
* Bootstrap (v5.0.0-alpha2): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -22,7 +22,7 @@ import EventHandler from './dom/event-handler';
*/
const NAME = 'alert';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.alert';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';
@ -61,11 +61,7 @@ class Alert {
// Public
close(element) {
let rootElement = this._element;
if (element) {
rootElement = this._getRootElement(element);
}
const rootElement = element ? this._getRootElement(element) : this._element;
const customEvent = this._triggerCloseEvent(rootElement);
if (customEvent === null || customEvent.defaultPrevented) {

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): button.js
* Bootstrap (v5.0.0-alpha2): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -16,7 +16,7 @@ import EventHandler from './dom/event-handler';
*/
const NAME = 'button';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.button';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): carousel.js
* Bootstrap (v5.0.0-alpha2): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -28,7 +28,7 @@ import SelectorEngine from './dom/selector-engine';
*/
const NAME = 'carousel';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.carousel';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): collapse.js
* Bootstrap (v5.0.0-alpha2): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -28,7 +28,7 @@ import SelectorEngine from './dom/selector-engine';
*/
const NAME = 'collapse';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.collapse';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';
@ -285,8 +285,7 @@ class Collapse {
}
_getDimension() {
const hasWidth = this._element.classList.contains(WIDTH);
return hasWidth ? WIDTH : HEIGHT;
return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
}
_getParent() {
@ -313,10 +312,12 @@ class Collapse {
}
_addAriaAndCollapsedClass(element, triggerArray) {
if (element) {
if (!element || !triggerArray.length) {
return;
}
const isOpen = element.classList.contains(CLASS_NAME_SHOW);
if (triggerArray.length) {
triggerArray.forEach((elem) => {
if (isOpen) {
elem.classList.remove(CLASS_NAME_COLLAPSED);
@ -327,8 +328,6 @@ class Collapse {
elem.setAttribute('aria-expanded', isOpen);
});
}
}
}
// Static

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/data.js
* Bootstrap (v5.0.0-alpha2): dom/data.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -16,22 +16,22 @@ const mapData = (() => {
let id = 1;
return {
set(element, key, data) {
if (typeof element.key === 'undefined') {
element.key = {
if (typeof element.bsKey === 'undefined') {
element.bsKey = {
key,
id,
};
id++;
}
storeData[element.key.id] = data;
storeData[element.bsKey.id] = data;
},
get(element, key) {
if (!element || typeof element.key === 'undefined') {
if (!element || typeof element.bsKey === 'undefined') {
return null;
}
const keyProperties = element.key;
const keyProperties = element.bsKey;
if (keyProperties.key === key) {
return storeData[keyProperties.id];
}
@ -39,14 +39,14 @@ const mapData = (() => {
return null;
},
delete(element, key) {
if (typeof element.key === 'undefined') {
if (typeof element.bsKey === 'undefined') {
return;
}
const keyProperties = element.key;
const keyProperties = element.bsKey;
if (keyProperties.key === key) {
delete storeData[keyProperties.id];
delete element.key;
delete element.bsKey;
}
},
};

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/event-handler.js
* Bootstrap (v5.0.0-alpha2): dom/event-handler.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -94,6 +94,8 @@ function getEvent(element) {
function bootstrapHandler(element, fn) {
return function handler(event) {
event.delegateTarget = element;
if (handler.oneOff) {
EventHandler.off(element, event.type, fn);
}
@ -109,6 +111,8 @@ function bootstrapDelegationHandler(element, selector, fn) {
for (let { target } = event; target && target !== this; target = target.parentNode) {
for (let i = domElements.length; i--; ) {
if (domElements[i] === target) {
event.delegateTarget = target;
if (handler.oneOff) {
EventHandler.off(element, event.type, fn);
}
@ -305,7 +309,7 @@ const EventHandler = {
});
}
// merge custom informations in our event
// merge custom information in our event
if (typeof args !== 'undefined') {
Object.keys(args).forEach((key) => {
Object.defineProperty(evt, key, {

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/manipulator.js
* Bootstrap (v5.0.0-alpha2): dom/manipulator.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/

View File

@ -2,7 +2,7 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/polyfill.js
* Bootstrap (v5.0.0-alpha2): dom/polyfill.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dom/selector-engine.js
* Bootstrap (v5.0.0-alpha2): dom/selector-engine.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): dropdown.js
* Bootstrap (v5.0.0-alpha2): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -26,7 +26,7 @@ import SelectorEngine from './dom/selector-engine';
*/
const NAME = 'dropdown';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.dropdown';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): modal.js
* Bootstrap (v5.0.0-alpha2): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -27,7 +27,7 @@ import SelectorEngine from './dom/selector-engine';
*/
const NAME = 'modal';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.modal';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';
@ -407,10 +407,23 @@ class Modal {
return;
}
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
if (!isModalOverflowing) {
this._element.style.overflowY = 'hidden';
}
this._element.classList.add(CLASS_NAME_STATIC);
const modalTransitionDuration = getTransitionDurationFromElement(this._element);
const modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
EventHandler.off(this._element, TRANSITION_END);
EventHandler.one(this._element, TRANSITION_END, () => {
this._element.classList.remove(CLASS_NAME_STATIC);
if (!isModalOverflowing) {
EventHandler.one(this._element, TRANSITION_END, () => {
this._element.style.overflowY = '';
});
emulateTransitionEnd(this._element, modalTransitionDuration);
}
});
emulateTransitionEnd(this._element, modalTransitionDuration);
this._element.focus();

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): popover.js
* Bootstrap (v5.0.0-alpha2): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -17,7 +17,7 @@ import Tooltip from './tooltip';
*/
const NAME = 'popover';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.popover';
const EVENT_KEY = `.${DATA_KEY}`;
const CLASS_PREFIX = 'bs-popover';
@ -117,12 +117,12 @@ class Popover extends Tooltip {
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
}
// Private
_addAttachmentClass(attachment) {
this.getTipElement().classList.add(`${CLASS_PREFIX}-${attachment}`);
}
// Private
_getContent() {
return this.element.getAttribute('data-content') || this.config.content;
}

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): scrollspy.js
* Bootstrap (v5.0.0-alpha2): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -24,7 +24,7 @@ import SelectorEngine from './dom/selector-engine';
*/
const NAME = 'scrollspy';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.scrollspy';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';
@ -70,10 +70,7 @@ class ScrollSpy {
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._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;
@ -109,19 +106,14 @@ class ScrollSpy {
this._offsets = [];
this._targets = [];
this._scrollHeight = this._getScrollHeight();
const targets = SelectorEngine.find(this._selector);
targets
.map((element) => {
let target;
const targetSelector = getSelectorFromElement(element);
if (targetSelector) {
target = SelectorEngine.findOne(targetSelector);
}
const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
if (target) {
const targetBCR = target.getBoundingClientRect();

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): tab.js
* Bootstrap (v5.0.0-alpha2): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -24,7 +24,7 @@ import SelectorEngine from './dom/selector-engine';
*/
const NAME = 'tab';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.tab';
const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api';

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): toast.js
* Bootstrap (v5.0.0-alpha2): toast.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -24,7 +24,7 @@ import Manipulator from './dom/manipulator';
*/
const NAME = 'toast';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.toast';
const EVENT_KEY = `.${DATA_KEY}`;
@ -48,7 +48,7 @@ const DefaultType = {
const Default = {
animation: true,
autohide: true,
delay: 500,
delay: 5000,
};
const SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
@ -91,6 +91,8 @@ class Toast {
return;
}
this._clearTimeout();
if (this._config.animation) {
this._element.classList.add(CLASS_NAME_FADE);
}
@ -149,8 +151,7 @@ class Toast {
}
dispose() {
clearTimeout(this._timeout);
this._timeout = null;
this._clearTimeout();
if (this._element.classList.contains(CLASS_NAME_SHOW)) {
this._element.classList.remove(CLASS_NAME_SHOW);
@ -181,6 +182,11 @@ class Toast {
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
}
_clearTimeout() {
clearTimeout(this._timeout);
this._timeout = null;
}
// Static
static jQueryInterface(config) {

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): tooltip.js
* Bootstrap (v5.0.0-alpha2): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -16,7 +16,7 @@ import {
noop,
typeCheckConfig,
} from './util/index';
import { DefaultWhitelist, sanitizeHtml } from './util/sanitizer';
import { DefaultAllowlist, sanitizeHtml } from './util/sanitizer';
import Data from './dom/data';
import EventHandler from './dom/event-handler';
import Manipulator from './dom/manipulator';
@ -30,12 +30,12 @@ import SelectorEngine from './dom/selector-engine';
*/
const NAME = 'tooltip';
const VERSION = '5.0.0-alpha1';
const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.tooltip';
const EVENT_KEY = `.${DATA_KEY}`;
const CLASS_PREFIX = 'bs-tooltip';
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
const DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
const DISALLOWED_ATTRIBUTES = ['sanitize', 'allowList', 'sanitizeFn'];
const DefaultType = {
animation: 'boolean',
@ -52,7 +52,7 @@ const DefaultType = {
boundary: '(string|element)',
sanitize: 'boolean',
sanitizeFn: '(null|function)',
whiteList: 'object',
allowList: 'object',
popperConfig: '(null|object)',
};
@ -82,7 +82,7 @@ const Default = {
boundary: 'scrollParent',
sanitize: true,
sanitizeFn: null,
whiteList: DefaultWhitelist,
allowList: DefaultAllowlist,
popperConfig: null,
};
@ -192,11 +192,11 @@ class Tooltip {
if (event) {
const dataKey = this.constructor.DATA_KEY;
let context = Data.getData(event.target, dataKey);
let context = Data.getData(event.delegateTarget, dataKey);
if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig());
Data.setData(event.target, dataKey, context);
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.delegateTarget, dataKey, context);
}
context._activeTrigger.click = !context._activeTrigger.click;
@ -332,6 +332,10 @@ class Tooltip {
}
hide() {
if (!this._popper) {
return;
}
const tip = this.getTipElement();
const complete = () => {
if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
@ -430,7 +434,7 @@ class Tooltip {
if (this.config.html) {
if (this.config.sanitize) {
content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
content = sanitizeHtml(content, this.config.allowList, this.config.sanitizeFn);
}
element.innerHTML = content;
@ -582,11 +586,11 @@ class Tooltip {
_enter(event, context) {
const dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey);
context = context || Data.getData(event.delegateTarget, dataKey);
if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig());
Data.setData(event.target, dataKey, context);
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.delegateTarget, dataKey, context);
}
if (event) {
@ -619,11 +623,11 @@ class Tooltip {
_leave(event, context) {
const dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey);
context = context || Data.getData(event.delegateTarget, dataKey);
if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig());
Data.setData(event.target, dataKey, context);
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.delegateTarget, dataKey, context);
}
if (event) {
@ -697,7 +701,7 @@ class Tooltip {
typeCheckConfig(NAME, config, this.constructor.DefaultType);
if (config.sanitize) {
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
}
return config;
@ -726,8 +730,7 @@ class Tooltip {
}
_handlePopperPlacementChange(popperData) {
const popperInstance = popperData.instance;
this.tip = popperInstance.popper;
this.tip = popperData.instance.popper;
this._cleanTipClass();
this._addAttachmentClass(this._getAttachment(popperData.placement));
}

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/index.js
* Bootstrap (v5.0.0-alpha2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/

View File

@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha1): util/sanitizer.js
* Bootstrap (v5.0.0-alpha2): util/sanitizer.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@ -57,7 +57,7 @@ const allowedAttribute = (attr, allowedAttributeList) => {
return false;
};
export const DefaultWhitelist = {
export const DefaultAllowlist = {
// Global attributes allowed on any supplied element below.
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
a: ['target', 'href', 'title', 'rel'],
@ -91,7 +91,7 @@ export const DefaultWhitelist = {
ul: [],
};
export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
export function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
if (!unsafeHtml.length) {
return unsafeHtml;
}
@ -102,24 +102,24 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
const domParser = new window.DOMParser();
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
const whitelistKeys = Object.keys(whiteList);
const allowlistKeys = Object.keys(allowList);
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
for (let i = 0, len = elements.length; i < len; i++) {
const el = elements[i];
const elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(elName) === -1) {
if (allowlistKeys.indexOf(elName) === -1) {
el.parentNode.removeChild(el);
continue;
}
const attributeList = [].concat(...el.attributes);
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
attributeList.forEach((attr) => {
if (!allowedAttribute(attr, whitelistedAttributes)) {
if (!allowedAttribute(attr, allowedAttributes)) {
el.removeAttribute(attr.nodeName);
}
});

View File

@ -314,19 +314,12 @@ class Ripple {
}
// Static
static autoInitial(instance) {
return function (event) {
instance._autoInit(event);
};
}
static staticMethod(instance) {
return function (event) {
instance._method(event);
};
}
static jQueryInterface(options) {
return this.each(function () {
const data = Data.getData(this, DATA_KEY);

View File

@ -13,47 +13,47 @@ const uriAttrs = [
'longdesc',
'poster',
'src',
'xlink:href'
]
'xlink:href',
];
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
/**
* A pattern that recognizes a commonly useful subset of URLs that are safe.
*
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
*/
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
/**
* A pattern that matches safe data URLs. Only matches image, video and audio types.
*
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
*/
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
const allowedAttribute = (attr, allowedAttributeList) => {
const attrName = attr.nodeName.toLowerCase()
const attrName = attr.nodeName.toLowerCase();
if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
return SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)
return SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue);
}
return true
return true;
}
const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp)
const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp);
// Check if a regular expression validates the attribute.
for (let i = 0, len = regExp.length; i < len; i++) {
if (regExp[i].test(attrName)) {
return true
return true;
}
}
return false
}
return false;
};
export const DefaultWhitelist = {
// Global attributes allowed on any supplied element below.
@ -86,42 +86,42 @@ export const DefaultWhitelist = {
sup: [],
strong: [],
u: [],
ul: []
}
ul: [],
};
export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
if (!unsafeHtml.length) {
return unsafeHtml
return unsafeHtml;
}
if (sanitizeFn && typeof sanitizeFn === 'function') {
return sanitizeFn(unsafeHtml)
return sanitizeFn(unsafeHtml);
}
const domParser = new window.DOMParser()
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')
const whitelistKeys = Object.keys(whiteList)
const elements = [].concat(...createdDocument.body.querySelectorAll('*'))
const domParser = new window.DOMParser();
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
const whitelistKeys = Object.keys(whiteList);
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
for (let i = 0, len = elements.length; i < len; i++) {
const el = elements[i]
const elName = el.nodeName.toLowerCase()
const el = elements[i];
const elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(elName) === -1) {
el.parentNode.removeChild(el)
el.parentNode.removeChild(el);
continue
continue;
}
const attributeList = [].concat(...el.attributes)
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
const attributeList = [].concat(...el.attributes);
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
attributeList.forEach(attr => {
attributeList.forEach((attr) => {
if (!allowedAttribute(attr, whitelistedAttributes)) {
el.removeAttribute(attr.nodeName)
el.removeAttribute(attr.nodeName);
}
})
});
}
return createdDocument.body.innerHTML
return createdDocument.body.innerHTML;
}

View File

@ -21,31 +21,32 @@
font-weight: $alert-link-font-weight;
}
// Dismissible alerts
//
// Expand the right padding and account for the close button's positioning.
.alert-dismissible {
padding-right: $close-font-size + $alert-padding-x * 2;
padding-right: $alert-dismissible-padding-r;
// Adjust close link position
.close {
.btn-close {
position: absolute;
top: 0;
right: 0;
padding: $alert-padding-y $alert-padding-x;
color: inherit;
padding: $alert-padding-y * 1.25 $alert-padding-x;
}
}
// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert.
@each $color, $value in $theme-colors {
.alert-#{$color} {
@include alert-variant(color-level($value, $alert-bg-level), color-level($value, $alert-border-level), color-level($value, $alert-color-level));
@include alert-variant(
color-level($value, $alert-bg-level),
color-level($value, $alert-border-level),
color-level($value, $alert-color-level)
);
}
}
// scss-docs-end alert-modifiers

View File

@ -183,12 +183,12 @@
.card-img-top,
.card-header {
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-top-right-radius: 0;
}
.card-img-bottom,
.card-footer {
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-bottom-right-radius: 0;
}
}
@ -198,12 +198,12 @@
.card-img-top,
.card-header {
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-top-left-radius: 0;
}
.card-img-bottom,
.card-footer {
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-bottom-left-radius: 0;
}
}
@ -217,6 +217,8 @@
//
.accordion {
overflow-anchor: none;
> .card {
overflow: hidden;

View File

@ -52,7 +52,6 @@
transform: translateX(-100%);
}
//
// Alternate transitions
//
@ -79,7 +78,6 @@
}
}
//
// Left/right controls for nav
//
@ -111,11 +109,19 @@
}
.carousel-control-prev {
left: 0;
background-image: if($enable-gradients, linear-gradient(90deg, rgba($black, .25), rgba($black, .001)), null);
background-image: if(
$enable-gradients,
linear-gradient(90deg, rgba($black, 0.25), rgba($black, 0.001)),
null
);
}
.carousel-control-next {
right: 0;
background-image: if($enable-gradients, linear-gradient(270deg, rgba($black, .25), rgba($black, .001)), null);
background-image: if(
$enable-gradients,
linear-gradient(270deg, rgba($black, 0.25), rgba($black, 0.001)),
null
);
}
// Icons for within
@ -135,7 +141,6 @@
background-image: escape-svg($carousel-control-next-icon-bg);
}
// Optional indicator pips
//
// Add an ordered list with the following class and add a list item for each
@ -178,7 +183,6 @@
}
}
// Optional captions
//
//
@ -193,3 +197,20 @@
color: $carousel-caption-color;
text-align: center;
}
// Dark mode carousel
.carousel-dark {
.carousel-control-prev-icon,
.carousel-control-next-icon {
filter: $carousel-dark-control-icon-filter;
}
.carousel-indicators li {
background-color: $carousel-dark-indicator-active-bg;
}
.carousel-caption {
color: $carousel-dark-caption-color;
}
}

View File

@ -1,36 +1,41 @@
.close {
@include font-size($close-font-size);
font-weight: $close-font-weight;
line-height: 1;
color: $close-color;
text-shadow: $close-text-shadow;
opacity: .5;
// transparent background and border properties included for button version.
// iOS requires the button element instead of an anchor tag.
// If you want the anchor version, it requires `href="#"`.
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
.btn-close {
box-sizing: content-box;
width: $btn-close-width;
height: $btn-close-height;
padding: $btn-close-padding-y $btn-close-padding-x;
color: $btn-close-color;
background: transparent escape-svg($btn-close-bg) no-repeat center center / $btn-close-width auto; // include transparent for button elements
background-clip: content-box;
border: 0; // for button elements
@include border-radius();
opacity: $btn-close-opacity;
// Override <a>'s hover style
&:hover {
color: $close-color;
color: $btn-close-color;
text-decoration: none;
opacity: $btn-close-hover-opacity;
}
&:hover,
&:focus {
opacity: .75;
outline: none;
box-shadow: $btn-close-focus-shadow;
opacity: $btn-close-focus-opacity;
}
&:disabled,
&.disabled {
pointer-events: none;
user-select: none;
opacity: $btn-close-disabled-opacity;
}
}
// Additional properties for button version
// iOS requires the button element instead of an anchor tag.
// If you want the anchor version, it requires `href="#"`.
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
// stylelint-disable-next-line selector-no-qualifying-type
button.close {
padding: 0;
background-color: transparent;
border: 0;
.btn-close-white {
filter: $btn-close-white-filter;
}

View File

@ -21,7 +21,7 @@
z-index: $zindex-dropdown;
display: none; // none by default, but block on "open" of the menu
min-width: $dropdown-min-width;
padding: $dropdown-padding-y 0;
padding: $dropdown-padding-y $dropdown-padding-x;
margin: $dropdown-spacer 0 0; // override default ul
@include font-size($dropdown-font-size);
color: $dropdown-color;
@ -104,10 +104,10 @@
// When enabled Popper.js, reset basic dropdown position
// stylelint-disable-next-line no-duplicate-selectors
.dropdown-menu {
&[x-placement^="top"],
&[x-placement^="right"],
&[x-placement^="bottom"],
&[x-placement^="left"] {
&[x-placement^='top'],
&[x-placement^='right'],
&[x-placement^='bottom'],
&[x-placement^='left'] {
right: auto;
bottom: auto;
}
@ -193,3 +193,44 @@
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
color: $dropdown-link-color;
}
// Dark dropdowns
.dropdown-menu-dark {
color: $dropdown-dark-color;
background-color: $dropdown-dark-bg;
border-color: $dropdown-dark-border-color;
@include box-shadow($dropdown-dark-box-shadow);
.dropdown-item {
color: $dropdown-dark-link-color;
&:hover,
&:focus {
color: $dropdown-dark-link-hover-color;
@include gradient-bg($dropdown-dark-link-hover-bg);
}
&.active,
&:active {
color: $dropdown-dark-link-active-color;
@include gradient-bg($dropdown-dark-link-active-bg);
}
&.disabled,
&:disabled {
color: $dropdown-dark-link-disabled-color;
}
}
.dropdown-divider {
border-color: $dropdown-dark-divider-bg;
}
.dropdown-item-text {
color: $dropdown-dark-link-color;
}
.dropdown-header {
color: $dropdown-dark-header-color;
}
}

View File

@ -80,6 +80,9 @@
}
// See https://codepen.io/kevinweber/pen/dXWoRw
//
// Requires the use of quotes around data URIs.
@function escape-svg($string) {
@if str-index($string, 'data:image/svg+xml') {
@each $char, $encoded in $escaped-characters {
@ -140,7 +143,7 @@ $_luminance-list: 0.0008 0.001 0.0011 0.0013 0.0015 0.0017 0.002 0.0022 0.0025 0
}
}
@warn "Found no color leading to #{$min-contrast-ratio}:1 contrast ratio against #{$background}";
@warn "Found no color leading to #{$min-contrast-ratio}:1 contrast ratio against #{$background}...";
@return $max-ratio-color;
}

View File

@ -1,7 +1,7 @@
@import 'helpers/clearfix';
@import 'helpers/colored-links';
@import 'helpers/embed';
@import 'helpers/ratio';
@import 'helpers/position';
@import 'helpers/screenreaders';
@import 'helpers/visually-hidden';
@import 'helpers/stretched-link';
@import 'helpers/text-truncation';

View File

@ -12,7 +12,6 @@
@include border-radius($list-group-border-radius);
}
// Interactive list items
//
// Use anchor or button elements instead of `li`s or `div`s to create interactive
@ -38,7 +37,6 @@
}
}
// Individual list items
//
// Use on `li`s or `div`s within the `.list-group` parent.
@ -85,7 +83,6 @@
}
}
// Horizontal
//
// Change the layout of list group items from vertical (default) to horizontal.
@ -112,7 +109,7 @@
margin-top: 0;
}
& + .list-group-item {
+ .list-group-item {
border-top-width: $list-group-border-width;
border-left-width: 0;
@ -126,7 +123,6 @@
}
}
// Flush list items
//
// Remove borders and border-radius to keep list group items edge-to-edge. Most
@ -144,7 +140,6 @@
}
}
// scss-docs-start list-group-modifiers
// List group contextual variants
//
@ -152,6 +147,10 @@
// Organizationally, this must come after the `:hover` states.
@each $color, $value in $theme-colors {
@include list-group-item-variant($color, color-level($value, $list-group-item-bg-level), color-level($value, $list-group-item-color-level));
@include list-group-item-variant(
$color,
color-level($value, $list-group-item-bg-level),
color-level($value, $list-group-item-color-level)
);
}
// scss-docs-end list-group-modifiers

View File

@ -12,7 +12,7 @@
@import 'mixins/breakpoints';
@import 'mixins/image';
@import 'mixins/resize';
@import 'mixins/screen-reader';
@import 'mixins/visually-hidden';
@import 'mixins/reset-text';
@import 'mixins/text-truncate';

View File

@ -55,9 +55,10 @@
}
.modal-dialog-scrollable {
max-height: subtract(100%, $modal-dialog-margin * 2);
height: subtract(100%, $modal-dialog-margin * 2);
.modal-content {
max-height: 100%;
overflow: hidden;
}
@ -114,16 +115,16 @@
.modal-header {
display: flex;
flex-shrink: 0;
align-items: flex-start; // so the close btn always stays on the upper right corner
align-items: center;
justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
padding: $modal-header-padding;
border-bottom: $modal-header-border-width solid $modal-header-border-color;
@include border-top-radius($modal-content-inner-border-radius);
.close {
padding: $modal-header-padding;
// auto on the left force icon to the right even when there is no .modal-title
margin: (-$modal-header-padding-y) (-$modal-header-padding-x) (-$modal-header-padding-y) auto;
.btn-close {
padding: ($modal-header-padding-y / 2) ($modal-header-padding-x / 2);
margin: ($modal-header-padding-y / -2) ($modal-header-padding-x / -2)
($modal-header-padding-y / -2) auto;
}
}
@ -180,7 +181,7 @@
}
.modal-dialog-scrollable {
max-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
}
.modal-dialog-centered {

View File

@ -14,11 +14,15 @@
.nav-link {
display: block;
padding: $nav-link-padding-y $nav-link-padding-x;
@include font-size($nav-link-font-size);
font-weight: $nav-link-font-weight;
color: $nav-link-color;
text-decoration: if($link-decoration == none, null, none);
@include transition($nav-link-transition);
&:hover,
&:focus {
color: $nav-link-hover-color;
text-decoration: if($link-hover-decoration == underline, none, null);
}

View File

@ -150,6 +150,7 @@
$next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints);
// stylelint-disable-next-line scss/selector-no-union-class-name
&#{$infix} {
@include media-breakpoint-up($next) {
flex-wrap: nowrap;

View File

@ -10,6 +10,7 @@
text-decoration: if($link-decoration == none, null, none);
background-color: $pagination-bg;
border: $pagination-border-width solid $pagination-border-color;
@include transition($pagination-transition);
&:hover {
z-index: 2;
@ -21,6 +22,8 @@
&:focus {
z-index: 3;
color: $pagination-focus-color;
background-color: $pagination-focus-bg;
outline: $pagination-focus-outline;
box-shadow: $pagination-focus-box-shadow;
}

View File

@ -63,7 +63,6 @@ body {
//
// 1. Reset Firefox's gray color
// 2. Set correct height and prevent the `size` attribute to make the `hr` look like an input field
// See https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_hr_size
hr {
margin: $hr-margin-y 0;
@ -353,12 +352,14 @@ caption {
text-align: left;
}
// 1. Matches default `<td>` alignment by inheriting `text-align`.
// 2. Fix alignment for Safari
// 1. Removes font-weight bold by inheriting
// 2. Matches default `<td>` alignment by inheriting `text-align`.
// 3. Fix alignment for Safari
th {
text-align: inherit; // 1
text-align: -webkit-match-parent; // 2
font-weight: $table-th-font-weight; // 1
text-align: inherit; // 2
text-align: -webkit-match-parent; // 3
}
thead,
@ -384,7 +385,7 @@ label {
// See https://github.com/twbs/bootstrap/issues/24093
button {
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-radius: 0;
}

View File

@ -3,7 +3,9 @@
//
@keyframes spinner-border {
to { transform: rotate(360deg); }
to {
transform: rotate(360deg);
}
}
.spinner-border {
@ -13,7 +15,7 @@
vertical-align: text-bottom;
border: $spinner-border-width solid currentColor;
border-right-color: transparent;
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-radius: 50%;
animation: spinner-border $spinner-animation-speed linear infinite;
}
@ -44,7 +46,7 @@
height: $spinner-height;
vertical-align: text-bottom;
background-color: currentColor;
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-radius: 50%;
opacity: 0;
animation: spinner-grow $spinner-animation-speed linear infinite;

View File

@ -40,7 +40,7 @@
// Highlight border color between thead, tbody and tfoot.
> :not(:last-child) > :last-child > * {
border-bottom-color: $table-group-seperator-color;
border-bottom-color: $table-group-separator-color;
}
}

View File

@ -1,13 +1,11 @@
.toast {
max-width: $toast-max-width;
overflow: hidden; // cheap rounded corners on nested items
@include font-size($toast-font-size);
color: $toast-color;
background-color: $toast-background-color;
background-clip: padding-box;
border: $toast-border-width solid $toast-border-color;
box-shadow: $toast-box-shadow;
backdrop-filter: blur(10px);
opacity: 0;
@include border-radius($toast-border-radius);
@ -37,6 +35,12 @@
background-color: $toast-header-background-color;
background-clip: padding-box;
border-bottom: $toast-border-width solid $toast-header-border-color;
@include border-top-radius(subtract($toast-border-radius, $toast-border-width));
.btn-close {
margin-right: $toast-padding-x / -2;
margin-left: $toast-padding-x;
}
}
.toast-body {

View File

@ -23,7 +23,7 @@ $utilities: map-merge(
print: true,
property: display,
class: d,
values: none inline inline-block block table table-row table-cell flex inline-flex,
values: inline inline-block block table table-row table-cell flex inline-flex none,
),
'shadow': (
property: box-shadow,
@ -39,6 +39,31 @@ $utilities: map-merge(
property: position,
values: static relative absolute fixed sticky,
),
'top': (
property: top,
values: $position-values,
),
'bottom': (
property: bottom,
values: $position-values,
),
'left': (
property: left,
values: $position-values,
),
'right': (
property: right,
values: $position-values,
),
'translate-middle': (
property: transform,
class: translate-middle,
values: (
null: (
translateX(-50%) translateY(-50%),
),
),
),
'border': (
property: border,
values: (
@ -85,6 +110,11 @@ $utilities: map-merge(
)
),
),
'border-width': (
property: border-width,
class: border,
values: $border-widths,
),
// Sizing utilities
'width':
(

View File

@ -38,9 +38,9 @@ $pink: #d63384 !default;
$red: #dc3545 !default;
$orange: #fd7e14 !default;
$yellow: #ffc107 !default;
$green: #28a745 !default;
$green: #198754 !default;
$teal: #20c997 !default;
$cyan: #17a2b8 !default;
$cyan: #0dcaf0 !default;
// scss-docs-start colors-map
$colors: (
@ -87,10 +87,10 @@ $theme-color-interval: 8% !default;
// The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
// See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
$min-contrast-ratio: 3 !default;
$min-contrast-ratio: 4.5 !default;
// Customize the light and dark text colors for use in our color contrast function.
$color-contrast-dark: $gray-900 !default;
$color-contrast-dark: $black !default;
$color-contrast-light: $white !default;
// fusv-disable
@ -246,6 +246,16 @@ $spacers: (
$negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default;
// Position
//
// Define the edge positioning anchors of the position utilities.
$position-values: (
0: 0,
50: 50%,
100: 100%,
) !default;
// Body
//
// Settings for the `<body>` element.
@ -321,7 +331,7 @@ $gutters: $spacers !default;
// Container padding
$container-padding-x: 1rem !default;
$container-padding-x: $grid-gutter-width !default;
// Components
//
@ -333,6 +343,14 @@ $border-color: $gray-300 !default;
$border-radius: 0.25rem !default;
$border-radius-sm: 0.2rem !default;
$border-radius-lg: 0.3rem !default;
$border-widths: (
0: 0,
1: 1px,
2: 2px,
3: 3px,
4: 4px,
5: 5px,
) !default;
$rounded-pill: 50rem !default;
@ -352,26 +370,16 @@ $transition-base: all 0.2s ease-in-out !default;
$transition-fade: opacity 0.15s linear !default;
$transition-collapse: height 0.35s ease !default;
// scss-docs-start embed-responsive-aspect-ratios
$embed-responsive-aspect-ratios: (
'21by9': (
x: 21,
y: 9,
),
'16by9': (
x: 16,
y: 9,
),
'4by3': (
x: 4,
y: 3,
),
'1by1': (
x: 1,
y: 1,
),
// stylelint-disable function-disallowed-list
// scss-docs-start aspect-ratios
$aspect-ratios: (
'1x1': 100%,
'4x3': calc(3 / 4 * 100%),
'16x9': calc(9 / 16 * 100%),
'21x9': calc(9 / 21 * 100%),
) !default;
// scss-docs-end embed-responsive-aspect-ratios
// scss-docs-end aspect-ratios
// stylelint-enable function-disallowed-list
// Typography
//
@ -484,6 +492,8 @@ $table-cell-vertical-align: top !default;
$table-color: $body-color !default;
$table-bg: transparent !default;
$table-th-font-weight: null !default;
$table-striped-color: $table-color !default;
$table-striped-bg-factor: 0.05 !default;
$table-striped-bg: rgba($black, $table-striped-bg-factor) !default;
@ -502,7 +512,7 @@ $table-border-color: $border-color !default;
$table-striped-order: odd !default;
$table-group-seperator-color: currentColor !default;
$table-group-separator-color: currentColor !default;
$table-caption-color: $text-muted !default;
@ -530,7 +540,7 @@ $input-btn-font-family: null !default;
$input-btn-font-size: $font-size-base !default;
$input-btn-line-height: $line-height-base !default;
$input-btn-focus-width: 0.2rem !default;
$input-btn-focus-width: 0.25rem !default;
$input-btn-focus-color-opacity: 0.25 !default;
$input-btn-focus-color: rgba($component-active-bg, $input-btn-focus-color-opacity) !default;
$input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color !default;
@ -659,7 +669,7 @@ $input-height-lg: add(
$input-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !default;
$form-check-input-width: 1.25em !default;
$form-check-input-width: 1em !default;
$form-check-min-height: $font-size-base * $line-height-base !default;
$form-check-padding-left: $form-check-input-width + 0.5em !default;
$form-check-margin-bottom: 0.125rem !default;
@ -703,6 +713,9 @@ $form-switch-checked-bg-position: right center !default;
$form-check-inline-margin-right: 1rem !default;
$input-group-addon-padding-y: $input-padding-y !default;
$input-group-addon-padding-x: $input-padding-x !default;
$input-group-addon-font-weight: $input-font-weight !default;
$input-group-addon-color: $input-color !default;
$input-group-addon-bg: $gray-200 !default;
$input-group-addon-border-color: $input-border-color !default;
@ -847,6 +860,10 @@ $zindex-tooltip: 1070 !default;
$nav-link-padding-y: 0.5rem !default;
$nav-link-padding-x: 1rem !default;
$nav-link-font-size: null !default;
$nav-link-font-weight: null !default;
$nav-link-color: null !default;
$nav-link-hover-color: null !default;
$nav-link-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out !default;
$nav-link-disabled-color: $gray-600 !default;
@ -908,6 +925,7 @@ $navbar-dark-brand-hover-color: $navbar-dark-active-color !default;
// Dropdown menu container and contents.
$dropdown-min-width: 10rem !default;
$dropdown-padding-x: 0 !default;
$dropdown-padding-y: 0.5rem !default;
$dropdown-spacer: 0.125rem !default;
$dropdown-font-size: $font-size-base !default;
@ -917,7 +935,7 @@ $dropdown-border-color: rgba($black, 0.15) !default;
$dropdown-border-radius: $border-radius !default;
$dropdown-border-width: $border-width !default;
$dropdown-inner-border-radius: subtract($dropdown-border-radius, $dropdown-border-width) !default;
$dropdown-divider-bg: $gray-200 !default;
$dropdown-divider-bg: $dropdown-border-color !default;
$dropdown-divider-margin-y: $spacer / 2 !default;
$dropdown-box-shadow: $box-shadow !default;
@ -936,6 +954,19 @@ $dropdown-item-padding-x: $spacer !default;
$dropdown-header-color: $gray-600 !default;
$dropdown-header-padding: $dropdown-padding-y $dropdown-item-padding-x !default;
$dropdown-dark-color: $gray-300 !default;
$dropdown-dark-bg: $gray-800 !default;
$dropdown-dark-border-color: $dropdown-border-color !default;
$dropdown-dark-divider-bg: $dropdown-divider-bg !default;
$dropdown-dark-box-shadow: null !default;
$dropdown-dark-link-color: $dropdown-dark-color !default;
$dropdown-dark-link-hover-color: $white !default;
$dropdown-dark-link-hover-bg: rgba($white, 0.15) !default;
$dropdown-dark-link-active-color: $dropdown-link-active-color !default;
$dropdown-dark-link-active-bg: $dropdown-link-active-bg !default;
$dropdown-dark-link-disabled-color: $gray-500 !default;
$dropdown-dark-header-color: $gray-500 !default;
// Pagination
$pagination-padding-y: 0.375rem !default;
@ -952,6 +983,8 @@ $pagination-border-radius: $border-radius !default;
$pagination-margin-left: -$pagination-border-width !default;
$pagination-border-color: $gray-300 !default;
$pagination-focus-color: $link-hover-color !default;
$pagination-focus-bg: $gray-200 !default;
$pagination-focus-box-shadow: $input-btn-focus-box-shadow !default;
$pagination-focus-outline: 0 !default;
@ -967,6 +1000,9 @@ $pagination-disabled-color: $gray-600 !default;
$pagination-disabled-bg: $white !default;
$pagination-disabled-border-color: $gray-300 !default;
$pagination-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !default;
// Cards
$card-spacer-y: $spacer !default;
@ -1042,7 +1078,7 @@ $popover-arrow-outer-color: fade-in($popover-border-color, 0.05) !default;
$toast-max-width: 350px !default;
$toast-padding-x: 0.75rem !default;
$toast-padding-y: 0.25rem !default;
$toast-padding-y: 0.5rem !default;
$toast-font-size: 0.875rem !default;
$toast-color: null !default;
$toast-background-color: rgba($white, 0.85) !default;
@ -1060,8 +1096,8 @@ $toast-header-border-color: rgba(0, 0, 0, 0.05) !default;
$badge-font-size: 0.75em !default;
$badge-font-weight: $font-weight-bold !default;
$badge-color: $white !default;
$badge-padding-y: 0.25em !default;
$badge-padding-x: 0.5em !default;
$badge-padding-y: 0.35em !default;
$badge-padding-x: 0.65em !default;
$badge-border-radius: $border-radius !default;
// Modals
@ -1124,6 +1160,8 @@ $alert-bg-level: -10 !default;
$alert-border-level: -9 !default;
$alert-color-level: 6 !default;
$alert-dismissible-padding-r: $alert-padding-x * 3 !default; // 3x covers width of x plus default padding on either side
// Progress bars
$progress-height: 1rem !default;
@ -1212,14 +1250,18 @@ $carousel-caption-color: $white !default;
$carousel-caption-padding-y: 1.25rem !default;
$carousel-caption-spacer: 1.25rem !default;
$carousel-control-icon-width: 20px !default;
$carousel-control-icon-width: 2rem !default;
$carousel-control-prev-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'><path d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/></svg>") !default;
$carousel-control-next-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'><path d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/></svg>") !default;
$carousel-control-prev-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 16 16'><path d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/></svg>") !default;
$carousel-control-next-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 16 16'><path d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/></svg>") !default;
$carousel-transition-duration: 0.6s !default;
$carousel-transition: transform $carousel-transition-duration ease-in-out !default; // Define transform transition first if using multiple transitions (e.g., `transform 2s ease, opacity .5s ease-out`)
$carousel-dark-indicator-active-bg: $black !default;
$carousel-dark-caption-color: $black !default;
$carousel-dark-control-icon-filter: invert(1) grayscale(100) !default;
// Spinners
$spinner-width: 2rem !default;
@ -1233,10 +1275,18 @@ $spinner-border-width-sm: 0.2em !default;
// Close
$close-font-size: $font-size-base * 1.5 !default;
$close-font-weight: $font-weight-bold !default;
$close-color: $black !default;
$close-text-shadow: 0 1px 0 $white !default;
$btn-close-width: 1em !default;
$btn-close-height: $btn-close-width !default;
$btn-close-padding-x: 0.25em !default;
$btn-close-padding-y: $btn-close-padding-x !default;
$btn-close-color: $black !default;
$btn-close-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' fill='#{$btn-close-color}' viewBox='0 0 16 16'><path d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/></svg>") !default;
$btn-close-focus-shadow: $input-btn-focus-box-shadow !default;
$btn-close-opacity: 0.5 !default;
$btn-close-hover-opacity: 0.75 !default;
$btn-close-focus-opacity: 1 !default;
$btn-close-disabled-opacity: 0.25 !default;
$btn-close-white-filter: invert(1) grayscale(100%) brightness(200%) !default;
// Code

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap Grid v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap Grid v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
@ -32,7 +32,8 @@ $utilities: map-get-multiple(
'flex',
'flex-direction',
'flex-grow',
'flex-shrink' 'flex-wrap',
'flex-shrink',
'flex-wrap',
'justify-content',
'align-items',
'align-content',

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap Reboot v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap Reboot v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap Utilities v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap Utilities v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

@ -1,5 +1,5 @@
/*!
* Bootstrap v5.0.0-alpha1 (https://getbootstrap.com/)
* Bootstrap v5.0.0-alpha2 (https://getbootstrap.com/)
* Copyright 2011-2020 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

@ -33,7 +33,7 @@
}
&[type='radio'] {
// stylelint-disable-next-line property-blacklist
// stylelint-disable-next-line property-disallowed-list
border-radius: $form-check-radio-border-radius;
}

View File

@ -53,7 +53,6 @@
}
}
// Textual addons
//
// Serves as a catch-all element for any text or radio/checkbox input you wish
@ -62,9 +61,9 @@
.input-group-text {
display: flex;
align-items: center;
padding: $input-padding-y $input-padding-x;
padding: $input-group-addon-padding-y $input-group-addon-padding-x;
@include font-size($input-font-size); // Match inputs
font-weight: $font-weight-normal;
font-weight: $input-group-addon-font-weight;
line-height: $input-line-height;
color: $input-group-addon-color;
text-align: center;
@ -74,7 +73,6 @@
@include border-radius($input-border-radius);
}
// Sizing
//
// Remix the default form control sizing classes into new ones for easier
@ -119,7 +117,6 @@
padding-right: $form-select-padding-x + $form-select-indicator-padding;
}
// Rounded corners
//
// These rulesets must come after the sizing ones to properly override sm and lg

View File

@ -5,7 +5,11 @@
@if $emphasized-link-hover-darken-percentage != 0 {
&:hover,
&:focus {
color: darken($value, $emphasized-link-hover-darken-percentage);
color: if(
color-contrast($value) == $color-contrast-light,
darken($value, $emphasized-link-hover-darken-percentage),
lighten($value, $emphasized-link-hover-darken-percentage)
);
}
}
}

View File

@ -1,31 +0,0 @@
// Credit: Nicolas Gallagher and SUIT CSS.
.embed-responsive {
position: relative;
width: 100%;
&::before {
display: block;
content: "";
}
.embed-responsive-item,
iframe,
embed,
object,
video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
@each $key, $ratio in $embed-responsive-aspect-ratios {
.embed-responsive-#{$key} {
&::before {
padding-top: percentage(map-get($ratio, y) / map-get($ratio, x));
}
}
}

View File

@ -0,0 +1,26 @@
// Credit: Nicolas Gallagher and SUIT CSS.
.ratio {
position: relative;
width: 100%;
&::before {
display: block;
padding-top: var(--aspect-ratio);
content: '';
}
> * {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
@each $key, $ratio in $aspect-ratios {
.ratio-#{$key} {
--aspect-ratio: #{$ratio};
}
}

View File

@ -1,8 +0,0 @@
//
// Screenreaders
//
.sr-only,
.sr-only-focusable:not(:focus) {
@include sr-only();
}

View File

@ -0,0 +1,8 @@
//
// Visually hidden
//
.visually-hidden,
.visually-hidden-focusable:not(:focus) {
@include visually-hidden();
}

View File

@ -1,4 +1,4 @@
// stylelint-disable property-blacklist
// stylelint-disable property-disallowed-list
// Single side border-radius
// Helper function to replace negative values with 0
@ -17,59 +17,58 @@
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
@if $enable-rounded {
border-radius: valid-radius($radius);
}
@else if $fallback-border-radius != false {
} @else if $fallback-border-radius != false {
border-radius: $fallback-border-radius;
}
}
@mixin border-top-radius($radius) {
@mixin border-top-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-left-radius: valid-radius($radius);
border-top-right-radius: valid-radius($radius);
}
}
@mixin border-right-radius($radius) {
@mixin border-right-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-right-radius: valid-radius($radius);
border-bottom-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-radius($radius) {
@mixin border-bottom-radius($radius: $border-radius) {
@if $enable-rounded {
border-bottom-right-radius: valid-radius($radius);
border-bottom-left-radius: valid-radius($radius);
}
}
@mixin border-left-radius($radius) {
@mixin border-left-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-left-radius: valid-radius($radius);
border-bottom-left-radius: valid-radius($radius);
}
}
@mixin border-top-left-radius($radius) {
@mixin border-top-left-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-left-radius: valid-radius($radius);
}
}
@mixin border-top-right-radius($radius) {
@mixin border-top-right-radius($radius: $border-radius) {
@if $enable-rounded {
border-top-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-right-radius($radius) {
@mixin border-bottom-right-radius($radius: $border-radius) {
@if $enable-rounded {
border-bottom-right-radius: valid-radius($radius);
}
}
@mixin border-bottom-left-radius($radius) {
@mixin border-bottom-left-radius($radius: $border-radius) {
@if $enable-rounded {
border-bottom-left-radius: valid-radius($radius);
}

View File

@ -2,17 +2,15 @@
@if $enable-shadows {
$result: ();
@if (length($shadow) == 1) {
// We can pass `@include box-shadow(none);`
$result: $shadow;
} @else {
// Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;`
@for $i from 1 through length($shadow) {
@if nth($shadow, $i) != "none" {
$result: append($result, nth($shadow, $i), "comma");
}
@each $value in $shadow {
@if $value != null {
$result: append($result, $value, 'comma');
}
@if $value == none and length($shadow) > 1 {
@warn "The keyword 'none' must be used as a single argument.";
}
}
@if (length($result) > 0) {
box-shadow: $result;
}

View File

@ -112,7 +112,8 @@
// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
$min: breakpoint-min($name, $breakpoints);
$max: breakpoint-max(breakpoint-next($name, $breakpoints));
$next: breakpoint-next($name, $breakpoints);
$max: breakpoint-max($next);
@if $min != null and $max != null {
@media (min-width: $min) and (max-width: $max) {
@ -123,7 +124,7 @@
@content;
}
} @else if $min == null {
@include media-breakpoint-down($name, $breakpoints) {
@include media-breakpoint-down($next, $breakpoints) {
@content;
}
}

View File

@ -7,12 +7,17 @@
$background,
$border,
$color: color-contrast($background),
$hover-background: darken($background, 7.5%),
$hover-border: darken($border, 10%),
$hover-background:
if($color == $color-contrast-light, darken($background, 7.5%), lighten($background, 7.5%)),
$hover-border: if($color == $color-contrast-light, darken($border, 10%), lighten($border, 5%)),
$hover-color: color-contrast($hover-background),
$active-background: darken($background, 10%),
$active-border: darken($border, 12.5%),
$active-color: color-contrast($active-background)
$active-background:
if($color == $color-contrast-light, darken($background, 10%), lighten($background, 10%)),
$active-border: if($color == $color-contrast-light, darken($border, 12.5%), lighten($border, 5%)),
$active-color: color-contrast($active-background),
$disabled-background: $background,
$disabled-border: $border,
$disabled-color: color-contrast($disabled-background)
) {
color: $color;
@include gradient-bg($background);
@ -67,11 +72,11 @@
&:disabled,
&.disabled {
color: $color;
background-color: $background;
color: $disabled-color;
background-color: $disabled-background;
// Remove CSS gradients if they're enabled
background-image: if($enable-gradients, none, null);
border-color: $border;
border-color: $disabled-border;
}
}

View File

@ -1,9 +1,11 @@
// Container mixins
@mixin make-container($padding-x: $container-padding-x) {
@mixin make-container($gutter: $container-padding-x) {
--bs-gutter-x: #{$gutter};
width: 100%;
padding-right: $padding-x;
padding-left: $padding-x;
padding-right: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
padding-left: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
margin-right: auto;
margin-left: auto;
}

View File

@ -6,11 +6,10 @@
--bs-gutter-x: #{$gutter};
--bs-gutter-y: 0;
display: flex;
flex: 1 0 100%;
flex-wrap: wrap;
margin-top: calc(var(--bs-gutter-y) * -1); // stylelint-disable-line function-blacklist
margin-right: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-blacklist
margin-left: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-blacklist
margin-top: calc(var(--bs-gutter-y) * -1); // stylelint-disable-line function-disallowed-list
margin-right: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-disallowed-list
margin-left: calc(var(--bs-gutter-x) / -2); // stylelint-disable-line function-disallowed-list
}
@mixin make-col-ready($gutter: $grid-gutter-width) {
@ -26,8 +25,8 @@
flex-shrink: 0;
width: 100%;
max-width: 100%; // Prevent `.col-auto`, `.col` (& responsive variants) from breaking out the grid
padding-right: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-blacklist
padding-left: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-blacklist
padding-right: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
padding-left: calc(var(--bs-gutter-x) / 2); // stylelint-disable-line function-disallowed-list
margin-top: var(--bs-gutter-y);
}
@ -52,7 +51,7 @@
// numberof columns. Supports wrapping to new lines, but does not do a Masonry
// style grid.
@mixin row-cols($count) {
& > * {
> * {
flex: 0 0 auto;
width: 100% / $count;
}

View File

@ -1,4 +1,4 @@
// stylelint-disable property-blacklist
// stylelint-disable property-disallowed-list
@mixin transition($transition...) {
@if length($transition) == 0 {
$transition: $transition-base;

View File

@ -1,11 +1,11 @@
// stylelint-disable declaration-no-important
// Only display content to screen readers
// Hide content visually while keeping it accessible to assistive technologies
//
// See: https://a11yproject.com/posts/how-to-hide-content/
// See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
@mixin sr-only {
@mixin visually-hidden() {
position: absolute !important;
width: 1px !important;
height: 1px !important;
@ -21,8 +21,8 @@
//
// Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
@mixin sr-only-focusable {
@mixin visually-hidden-focusable() {
&:not(:focus) {
@include sr-only();
@include visually-hidden();
}
}

10
src/scss/free/_close.scss Normal file
View File

@ -0,0 +1,10 @@
// transparent background and border properties included for button version.
// iOS requires the button element instead of an anchor tag.
// If you want the anchor version, it requires `href="#"`.
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
.btn-close {
&:focus {
box-shadow: none;
}
}

View File

@ -0,0 +1,89 @@
// 12.10.2020 ---------------------------------------------------
.close {
font-size: calc(1.275rem + 0.3vw);
font-weight: 700;
line-height: 1;
color: #000;
text-shadow: 0 1px 0 #fff;
opacity: 0.5;
// Override <a>'s hover style
&:hover {
color: #000;
text-decoration: none;
}
&:hover,
&:focus {
opacity: 0.75;
}
&:disabled,
&.disabled {
pointer-events: none;
}
}
// Additional properties for button version
// iOS requires the button element instead of an anchor tag.
// If you want the anchor version, it requires `href="#"`.
// See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
// stylelint-disable-next-line selector-no-qualifying-type
button.close {
padding: 0;
background-color: transparent;
border: 0;
}
// Credit: Nicolas Gallagher and SUIT CSS.
.embed-responsive {
position: relative;
width: 100%;
&::before {
display: block;
content: '';
}
.embed-responsive-item,
iframe,
embed,
object,
video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
.embed-responsive-21by9:before {
padding-top: 42.85714%;
}
.embed-responsive-16by9:before {
padding-top: 56.25%;
}
.embed-responsive-4by3:before {
padding-top: 75%;
}
.embed-responsive-1by1:before {
padding-top: 100%;
}
.sr-only,
.sr-only-focusable:not(:focus) {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}

View File

@ -51,7 +51,7 @@
}
.dropdown-item {
padding: $dropdown-padding-y $dropdown-padding-x;
padding: $dropdown-item-padding-y $dropdown-item-padding-x;
color: $dropdown-color;
border-radius: 0;

Some files were not shown because too many files have changed in this diff Show More