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 MDB5
Version: FREE 1.2.0 Version: FREE 2.0.0
Documentation: Documentation:
https://mdbootstrap.com/docs/standard/ 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="container">
<div class="d-flex justify-content-center align-items-center" style="height: 100vh;"> <div class="d-flex justify-content-center align-items-center" style="height: 100vh;">
<div class="text-center"> <div class="text-center">
<!-- <i class="fas fa-ticket-alt fa-10x"></i> -->
<img <img
class="mb-4" src="https://mdbootstrap.com/img/Marketing/other/mdb50off.png"
src="https://mdbootstrap.com/img/logo/mdb-transparent-250px.png" height="150px"
style="width: 250px; height: 90px;" width="150px"
/> />
<h5 class="mb-3">Thank you for using our product. We're glad you're with us.</h5> <h5 class="mb-3">Release suprise! 50% OFF MDB 5 PRO</h5>
<p class="mb-3">MDB Team</p>
<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 <a
class="btn btn-primary btn-lg" 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/" href="https://mdbootstrap.com/docs/standard/getting-started/"
target="_blank" target="_blank"
role="button" 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> </div>
</div> </div>
@ -47,5 +66,52 @@
<!-- MDB --> <!-- MDB -->
<script type="text/javascript" src="js/mdb.min.js"></script> <script type="text/javascript" src="js/mdb.min.js"></script>
<!-- Custom scripts --> <!-- 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> </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", "name": "mdb-ui-kit",
"version": "1.2.0", "version": "2.0.0",
"main": "js/mdb.min.js", "main": "js/mdb.min.js",
"repository": "https://github.com/mdbootstrap/mdb-ui-kit.git", "repository": "https://github.com/mdbootstrap/mdb-ui-kit.git",
"author": "MDBootstrap", "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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * 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'))) ? (module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js')))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/event-handler.js'], factory) ? 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) { })(this, function (Data, EventHandler) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -119,7 +121,7 @@
*/ */
var NAME = 'alert'; var NAME = 'alert';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.alert'; var DATA_KEY = 'bs.alert';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -141,7 +143,7 @@
this._element = element; this._element = element;
if (this._element) { if (this._element) {
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} }
} // Getters } // Getters
@ -149,11 +151,7 @@
// Public // Public
_proto.close = function close(element) { _proto.close = function close(element) {
var rootElement = this._element; var rootElement = element ? this._getRootElement(element) : this._element;
if (element) {
rootElement = this._getRootElement(element);
}
var customEvent = this._triggerCloseEvent(rootElement); var customEvent = this._triggerCloseEvent(rootElement);
@ -165,7 +163,7 @@
}; };
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null; this._element = null;
}; // Private }; // Private
@ -174,7 +172,7 @@
}; };
_proto._triggerCloseEvent = function _triggerCloseEvent(element) { _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
return EventHandler.trigger(element, EVENT_CLOSE); return EventHandler__default['default'].trigger(element, EVENT_CLOSE);
}; };
_proto._removeElement = function _removeElement(element) { _proto._removeElement = function _removeElement(element) {
@ -189,7 +187,7 @@
} }
var transitionDuration = getTransitionDurationFromElement(element); var transitionDuration = getTransitionDurationFromElement(element);
EventHandler.one(element, TRANSITION_END, function () { EventHandler__default['default'].one(element, TRANSITION_END, function () {
return _this._destroyElement(element); return _this._destroyElement(element);
}); });
emulateTransitionEnd(element, transitionDuration); emulateTransitionEnd(element, transitionDuration);
@ -200,12 +198,12 @@
element.parentNode.removeChild(element); element.parentNode.removeChild(element);
} }
EventHandler.trigger(element, EVENT_CLOSED); EventHandler__default['default'].trigger(element, EVENT_CLOSED);
}; // Static }; // Static
Alert.jQueryInterface = function jQueryInterface(config) { Alert.jQueryInterface = function jQueryInterface(config) {
return this.each(function () { return this.each(function () {
var data = Data.getData(this, DATA_KEY); var data = Data__default['default'].getData(this, DATA_KEY);
if (!data) { if (!data) {
data = new Alert(this); data = new Alert(this);
@ -228,7 +226,7 @@
}; };
Alert.getInstance = function getInstance(element) { Alert.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Alert, null, [ _createClass(Alert, null, [
@ -248,7 +246,7 @@
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
EventHandler.on( EventHandler__default['default'].on(
document, document,
EVENT_CLICK_DATA_API, EVENT_CLICK_DATA_API,
SELECTOR_DISMISS, 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * 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'))) ? (module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js')))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/event-handler.js'], factory) ? 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) { })(this, function (Data, EventHandler) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -58,7 +60,7 @@
*/ */
var NAME = 'button'; var NAME = 'button';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.button'; var DATA_KEY = 'bs.button';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -74,7 +76,7 @@
var Button = /*#__PURE__*/ (function () { var Button = /*#__PURE__*/ (function () {
function Button(element) { function Button(element) {
this._element = element; this._element = element;
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} // Getters } // Getters
var _proto = Button.prototype; var _proto = Button.prototype;
@ -86,13 +88,13 @@
}; };
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null; this._element = null;
}; // Static }; // Static
Button.jQueryInterface = function jQueryInterface(config) { Button.jQueryInterface = function jQueryInterface(config) {
return this.each(function () { return this.each(function () {
var data = Data.getData(this, DATA_KEY); var data = Data__default['default'].getData(this, DATA_KEY);
if (!data) { if (!data) {
data = new Button(this); data = new Button(this);
@ -105,7 +107,7 @@
}; };
Button.getInstance = function getInstance(element) { Button.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Button, null, [ _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(); event.preventDefault();
var button = event.target.closest(SELECTOR_DATA_TOGGLE); 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) { if (!data) {
data = new Button(button); data = new Button(button);
} }
data.toggle(); data.toggle();
}); }
);
var $ = getjQuery(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -18,7 +18,7 @@
'./dom/manipulator.js', './dom/manipulator.js',
'./dom/selector-engine.js', './dom/selector-engine.js',
], factory) ], factory)
: ((global = global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Carousel = factory( (global.Carousel = factory(
global.Data, global.Data,
global.EventHandler, global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) { })(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Manipulator = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default') var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
? Manipulator['default'] var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -175,49 +170,21 @@
return null; return null;
}; };
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
function _defineProperties(target, props) { function _defineProperties(target, props) {
@ -242,7 +209,7 @@
*/ */
var NAME = 'carousel'; var NAME = 'carousel';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.carousel'; var DATA_KEY = 'bs.carousel';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -322,14 +289,17 @@
this.touchDeltaX = 0; this.touchDeltaX = 0;
this._config = this._getConfig(config); this._config = this._getConfig(config);
this._element = element; this._element = element;
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); this._indicatorsElement = SelectorEngine__default['default'].findOne(
SELECTOR_INDICATORS,
this._element
);
this._touchSupported = this._touchSupported =
'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
this._pointerEvent = Boolean(window.PointerEvent); this._pointerEvent = Boolean(window.PointerEvent);
this._addEventListeners(); this._addEventListeners();
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} // Getters } // Getters
var _proto = Carousel.prototype; var _proto = Carousel.prototype;
@ -360,7 +330,7 @@
this._isPaused = true; this._isPaused = true;
} }
if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) { if (SelectorEngine__default['default'].findOne(SELECTOR_NEXT_PREV, this._element)) {
triggerTransitionEnd(this._element); triggerTransitionEnd(this._element);
this.cycle(true); this.cycle(true);
} }
@ -390,7 +360,10 @@
_proto.to = function to(index) { _proto.to = function to(index) {
var _this = this; 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); var activeIndex = this._getItemIndex(this._activeElement);
@ -399,7 +372,7 @@
} }
if (this._isSliding) { if (this._isSliding) {
EventHandler.one(this._element, EVENT_SLID, function () { EventHandler__default['default'].one(this._element, EVENT_SLID, function () {
return _this.to(index); return _this.to(index);
}); });
return; return;
@ -417,8 +390,8 @@
}; };
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
EventHandler.off(this._element, EVENT_KEY); EventHandler__default['default'].off(this._element, EVENT_KEY);
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
this._items = null; this._items = null;
this._config = null; this._config = null;
this._element = null; this._element = null;
@ -430,7 +403,7 @@
}; // Private }; // Private
_proto._getConfig = function _getConfig(config) { _proto._getConfig = function _getConfig(config) {
config = _objectSpread(_objectSpread({}, Default), config); config = _extends({}, Default, config);
typeCheckConfig(NAME, config, DefaultType); typeCheckConfig(NAME, config, DefaultType);
return config; return config;
}; };
@ -458,16 +431,16 @@
var _this2 = this; var _this2 = this;
if (this._config.keyboard) { 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); return _this2._keydown(event);
}); });
} }
if (this._config.pause === 'hover') { 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); 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); return _this2.cycle(event);
}); });
} }
@ -524,29 +497,31 @@
} }
}; };
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(function (itemImg) { SelectorEngine__default['default']
EventHandler.on(itemImg, EVENT_DRAG_START, function (e) { .find(SELECTOR_ITEM_IMG, this._element)
.forEach(function (itemImg) {
EventHandler__default['default'].on(itemImg, EVENT_DRAG_START, function (e) {
return e.preventDefault(); return e.preventDefault();
}); });
}); });
if (this._pointerEvent) { if (this._pointerEvent) {
EventHandler.on(this._element, EVENT_POINTERDOWN, function (event) { EventHandler__default['default'].on(this._element, EVENT_POINTERDOWN, function (event) {
return start(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); return end(event);
}); });
this._element.classList.add(CLASS_NAME_POINTER_EVENT); this._element.classList.add(CLASS_NAME_POINTER_EVENT);
} else { } else {
EventHandler.on(this._element, EVENT_TOUCHSTART, function (event) { EventHandler__default['default'].on(this._element, EVENT_TOUCHSTART, function (event) {
return start(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); return move(event);
}); });
EventHandler.on(this._element, EVENT_TOUCHEND, function (event) { EventHandler__default['default'].on(this._element, EVENT_TOUCHEND, function (event) {
return end(event); return end(event);
}); });
} }
@ -572,7 +547,9 @@
_proto._getItemIndex = function _getItemIndex(element) { _proto._getItemIndex = function _getItemIndex(element) {
this._items = 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); return this._items.indexOf(element);
}; };
@ -600,10 +577,10 @@
var targetIndex = this._getItemIndex(relatedTarget); var targetIndex = this._getItemIndex(relatedTarget);
var fromIndex = this._getItemIndex( 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, relatedTarget: relatedTarget,
direction: eventDirectionName, direction: eventDirectionName,
from: fromIndex, from: fromIndex,
@ -613,7 +590,10 @@
_proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
if (this._indicatorsElement) { 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++) { for (var i = 0; i < indicators.length; i++) {
indicators[i].classList.remove(CLASS_NAME_ACTIVE); indicators[i].classList.remove(CLASS_NAME_ACTIVE);
@ -630,7 +610,10 @@
_proto._slide = function _slide(direction, element) { _proto._slide = function _slide(direction, element) {
var _this4 = this; 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); var activeElementIndex = this._getItemIndex(activeElement);
@ -693,13 +676,13 @@
} }
var transitionDuration = getTransitionDurationFromElement(activeElement); 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.remove(directionalClassName, orderClassName);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName); activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName);
_this4._isSliding = false; _this4._isSliding = false;
setTimeout(function () { setTimeout(function () {
EventHandler.trigger(_this4._element, EVENT_SLID, { EventHandler__default['default'].trigger(_this4._element, EVENT_SLID, {
relatedTarget: nextElement, relatedTarget: nextElement,
direction: eventDirectionName, direction: eventDirectionName,
from: activeElementIndex, from: activeElementIndex,
@ -712,7 +695,7 @@
activeElement.classList.remove(CLASS_NAME_ACTIVE); activeElement.classList.remove(CLASS_NAME_ACTIVE);
nextElement.classList.add(CLASS_NAME_ACTIVE); nextElement.classList.add(CLASS_NAME_ACTIVE);
this._isSliding = false; this._isSliding = false;
EventHandler.trigger(this._element, EVENT_SLID, { EventHandler__default['default'].trigger(this._element, EVENT_SLID, {
relatedTarget: nextElement, relatedTarget: nextElement,
direction: eventDirectionName, direction: eventDirectionName,
from: activeElementIndex, from: activeElementIndex,
@ -726,15 +709,16 @@
}; // Static }; // Static
Carousel.carouselInterface = function carouselInterface(element, config) { 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( var _config = _extends(
_objectSpread({}, Default), {},
Manipulator.getDataAttributes(element) Default,
Manipulator__default['default'].getDataAttributes(element)
); );
if (typeof config === 'object') { if (typeof config === 'object') {
_config = _objectSpread(_objectSpread({}, _config), config); _config = _extends({}, _config, config);
} }
var action = typeof config === 'string' ? config : _config.slide; var action = typeof config === 'string' ? config : _config.slide;
@ -770,9 +754,10 @@
return; return;
} }
var config = _objectSpread( var config = _extends(
_objectSpread({}, Manipulator.getDataAttributes(target)), {},
Manipulator.getDataAttributes(this) Manipulator__default['default'].getDataAttributes(target),
Manipulator__default['default'].getDataAttributes(this)
); );
var slideIndex = this.getAttribute('data-slide-to'); var slideIndex = this.getAttribute('data-slide-to');
@ -784,14 +769,14 @@
Carousel.carouselInterface(target, config); Carousel.carouselInterface(target, config);
if (slideIndex) { if (slideIndex) {
Data.getData(target, DATA_KEY).to(slideIndex); Data__default['default'].getData(target, DATA_KEY).to(slideIndex);
} }
event.preventDefault(); event.preventDefault();
}; };
Carousel.getInstance = function getInstance(element) { Carousel.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Carousel, null, [ _createClass(Carousel, null, [
@ -817,17 +802,20 @@
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
EventHandler.on( EventHandler__default['default'].on(
document, document,
EVENT_CLICK_DATA_API, EVENT_CLICK_DATA_API,
SELECTOR_DATA_SLIDE, SELECTOR_DATA_SLIDE,
Carousel.dataApiClickHandler Carousel.dataApiClickHandler
); );
EventHandler.on(window, EVENT_LOAD_DATA_API, function () { EventHandler__default['default'].on(window, EVENT_LOAD_DATA_API, function () {
var carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); var carousels = SelectorEngine__default['default'].find(SELECTOR_DATA_RIDE);
for (var i = 0, len = carousels.length; i < len; i++) { 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(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -18,7 +18,7 @@
'./dom/manipulator.js', './dom/manipulator.js',
'./dom/selector-engine.js', './dom/selector-engine.js',
], factory) ], factory)
: ((global = global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Collapse = factory( (global.Collapse = factory(
global.Data, global.Data,
global.EventHandler, global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) { })(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Manipulator = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default') var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
? Manipulator['default'] var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -167,49 +162,21 @@
return null; return null;
}; };
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
function _defineProperties(target, props) { function _defineProperties(target, props) {
@ -234,7 +201,7 @@
*/ */
var NAME = 'collapse'; var NAME = 'collapse';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.collapse'; var DATA_KEY = 'bs.collapse';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -270,19 +237,21 @@
this._isTransitioning = false; this._isTransitioning = false;
this._element = element; this._element = element;
this._config = this._getConfig(config); this._config = this._getConfig(config);
this._triggerArray = SelectorEngine.find( this._triggerArray = SelectorEngine__default['default'].find(
SELECTOR_DATA_TOGGLE + SELECTOR_DATA_TOGGLE +
'[href="#' + '[href="#' +
element.id + element.id +
'"],' + '"],' +
(SELECTOR_DATA_TOGGLE + '[data-target="#' + 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++) { for (var i = 0, len = toggleList.length; i < len; i++) {
var elem = toggleList[i]; var elem = toggleList[i];
var selector = getSelectorFromElement(elem); 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; return foundElem === element;
}); });
@ -303,7 +272,7 @@
this.toggle(); this.toggle();
} }
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} // Getters } // Getters
var _proto = Collapse.prototype; var _proto = Collapse.prototype;
@ -328,7 +297,9 @@
var activesData; var activesData;
if (this._parent) { 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') { if (typeof _this._config.parent === 'string') {
return elem.getAttribute('data-parent') === _this._config.parent; 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) { if (actives) {
var tempActiveData = actives.filter(function (elem) { var tempActiveData = actives.filter(function (elem) {
return container !== 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) { if (activesData && activesData._isTransitioning) {
return; return;
} }
} }
var startEvent = EventHandler.trigger(this._element, EVENT_SHOW); var startEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
if (startEvent.defaultPrevented) { if (startEvent.defaultPrevented) {
return; return;
@ -367,7 +340,7 @@
} }
if (!activesData) { if (!activesData) {
Data.setData(elemActive, DATA_KEY, null); Data__default['default'].setData(elemActive, DATA_KEY, null);
} }
}); });
} }
@ -398,13 +371,13 @@
_this.setTransitioning(false); _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 capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
var scrollSize = 'scroll' + capitalizedDimension; var scrollSize = 'scroll' + capitalizedDimension;
var transitionDuration = getTransitionDurationFromElement(this._element); 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); emulateTransitionEnd(this._element, transitionDuration);
this._element.style[dimension] = this._element[scrollSize] + 'px'; this._element.style[dimension] = this._element[scrollSize] + 'px';
}; };
@ -416,7 +389,7 @@
return; return;
} }
var startEvent = EventHandler.trigger(this._element, EVENT_HIDE); var startEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
if (startEvent.defaultPrevented) { if (startEvent.defaultPrevented) {
return; return;
@ -454,12 +427,12 @@
_this2._element.classList.add(CLASS_NAME_COLLAPSE); _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] = ''; this._element.style[dimension] = '';
var transitionDuration = getTransitionDurationFromElement(this._element); 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); emulateTransitionEnd(this._element, transitionDuration);
}; };
@ -468,7 +441,7 @@
}; };
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
this._config = null; this._config = null;
this._parent = null; this._parent = null;
this._element = null; this._element = null;
@ -477,7 +450,7 @@
}; // Private }; // Private
_proto._getConfig = function _getConfig(config) { _proto._getConfig = function _getConfig(config) {
config = _objectSpread(_objectSpread({}, Default), config); config = _extends({}, Default, config);
config.toggle = Boolean(config.toggle); // Coerce string values config.toggle = Boolean(config.toggle); // Coerce string values
typeCheckConfig(NAME, config, DefaultType); typeCheckConfig(NAME, config, DefaultType);
@ -485,9 +458,7 @@
}; };
_proto._getDimension = function _getDimension() { _proto._getDimension = function _getDimension() {
var hasWidth = this._element.classList.contains(WIDTH); return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
return hasWidth ? WIDTH : HEIGHT;
}; };
_proto._getParent = function _getParent() { _proto._getParent = function _getParent() {
@ -501,11 +472,11 @@
parent = parent[0]; parent = parent[0];
} }
} else { } else {
parent = SelectorEngine.findOne(parent); parent = SelectorEngine__default['default'].findOne(parent);
} }
var selector = SELECTOR_DATA_TOGGLE + '[data-parent="' + 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); var selected = getElementFromSelector(element);
_this3._addAriaAndCollapsedClass(selected, [element]); _this3._addAriaAndCollapsedClass(selected, [element]);
@ -514,10 +485,11 @@
}; };
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
if (element) { if (!element || !triggerArray.length) {
var isOpen = element.classList.contains(CLASS_NAME_SHOW); return;
}
if (triggerArray.length) { var isOpen = element.classList.contains(CLASS_NAME_SHOW);
triggerArray.forEach(function (elem) { triggerArray.forEach(function (elem) {
if (isOpen) { if (isOpen) {
elem.classList.remove(CLASS_NAME_COLLAPSED); elem.classList.remove(CLASS_NAME_COLLAPSED);
@ -527,15 +499,15 @@
elem.setAttribute('aria-expanded', isOpen); elem.setAttribute('aria-expanded', isOpen);
}); });
}
}
}; // Static }; // Static
Collapse.collapseInterface = function collapseInterface(element, config) { 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( var _config = _extends(
_objectSpread(_objectSpread({}, Default), Manipulator.getDataAttributes(element)), {},
Default,
Manipulator__default['default'].getDataAttributes(element),
typeof config === 'object' && config ? config : {} typeof config === 'object' && config ? config : {}
); );
@ -563,7 +535,7 @@
}; };
Collapse.getInstance = function getInstance(element) { Collapse.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Collapse, null, [ _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 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
if (event.target.tagName === 'A') { if (event.target.tagName === 'A') {
event.preventDefault(); event.preventDefault();
} }
var triggerData = Manipulator.getDataAttributes(this); var triggerData = Manipulator__default['default'].getDataAttributes(this);
var selector = getSelectorFromElement(this); var selector = getSelectorFromElement(this);
var selectorElements = SelectorEngine.find(selector); var selectorElements = SelectorEngine__default['default'].find(selector);
selectorElements.forEach(function (element) { selectorElements.forEach(function (element) {
var data = Data.getData(element, DATA_KEY); var data = Data__default['default'].getData(element, DATA_KEY);
var config; var config;
if (data) { if (data) {
@ -616,7 +592,8 @@
Collapse.collapseInterface(element, config); Collapse.collapseInterface(element, config);
}); });
}); }
);
var $ = getjQuery(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -8,13 +8,14 @@
? (module.exports = factory()) ? (module.exports = factory())
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(factory) ? define(factory)
: ((global = global || self), (global.Data = factory())); : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Data = factory()));
})(this, function () { })(this, function () {
'use strict'; '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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -29,22 +30,22 @@
var id = 1; var id = 1;
return { return {
set: function set(element, key, data) { set: function set(element, key, data) {
if (typeof element.key === 'undefined') { if (typeof element.bsKey === 'undefined') {
element.key = { element.bsKey = {
key: key, key: key,
id: id, id: id,
}; };
id++; id++;
} }
storeData[element.key.id] = data; storeData[element.bsKey.id] = data;
}, },
get: function get(element, key) { get: function get(element, key) {
if (!element || typeof element.key === 'undefined') { if (!element || typeof element.bsKey === 'undefined') {
return null; return null;
} }
var keyProperties = element.key; var keyProperties = element.bsKey;
if (keyProperties.key === key) { if (keyProperties.key === key) {
return storeData[keyProperties.id]; return storeData[keyProperties.id];
@ -53,15 +54,15 @@
return null; return null;
}, },
delete: function _delete(element, key) { delete: function _delete(element, key) {
if (typeof element.key === 'undefined') { if (typeof element.bsKey === 'undefined') {
return; return;
} }
var keyProperties = element.key; var keyProperties = element.bsKey;
if (keyProperties.key === key) { if (keyProperties.key === key) {
delete storeData[keyProperties.id]; 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -8,13 +8,14 @@
? (module.exports = factory(require('./polyfill.js'))) ? (module.exports = factory(require('./polyfill.js')))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./polyfill.js'], factory) ? 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) { })(this, function (polyfill_js) {
'use strict'; '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) * 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -120,6 +121,8 @@
function bootstrapHandler(element, fn) { function bootstrapHandler(element, fn) {
return function handler(event) { return function handler(event) {
event.delegateTarget = element;
if (handler.oneOff) { if (handler.oneOff) {
EventHandler.off(element, event.type, fn); EventHandler.off(element, event.type, fn);
} }
@ -135,6 +138,8 @@
for (var target = event.target; target && target !== this; target = target.parentNode) { for (var target = event.target; target && target !== this; target = target.parentNode) {
for (var i = domElements.length; i--; ) { for (var i = domElements.length; i--; ) {
if (domElements[i] === target) { if (domElements[i] === target) {
event.delegateTarget = target;
if (handler.oneOff) { if (handler.oneOff) {
EventHandler.off(element, event.type, fn); EventHandler.off(element, event.type, fn);
} }
@ -326,7 +331,7 @@
bubbles: bubbles, bubbles: bubbles,
cancelable: true, cancelable: true,
}); });
} // merge custom informations in our event } // merge custom information in our event
if (typeof args !== 'undefined') { if (typeof args !== 'undefined') {
Object.keys(args).forEach(function (key) { 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -8,58 +8,31 @@
? (module.exports = factory()) ? (module.exports = factory())
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(factory) ? define(factory)
: ((global = global || self), (global.Manipulator = factory())); : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Manipulator = factory()));
})(this, function () { })(this, function () {
'use strict'; 'use strict';
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -101,7 +74,7 @@
return {}; return {};
} }
var attributes = _objectSpread({}, element.dataset); var attributes = _extends({}, element.dataset);
Object.keys(attributes).forEach(function (key) { Object.keys(attributes).forEach(function (key) {
attributes[key] = normalizeData(attributes[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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -8,13 +8,14 @@
? factory(exports) ? factory(exports)
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['exports'], factory) ? define(['exports'], factory)
: ((global = global || self), factory((global.Polyfill = {}))); : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
factory((global.Polyfill = {})));
})(this, function (exports) { })(this, function (exports) {
'use strict'; '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) * 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -8,13 +8,14 @@
? (module.exports = factory(require('./polyfill.js'))) ? (module.exports = factory(require('./polyfill.js')))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./polyfill.js'], factory) ? 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) { })(this, function (polyfill_js) {
'use strict'; '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) * 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -20,7 +20,7 @@
'popper.js', 'popper.js',
'./dom/selector-engine.js', './dom/selector-engine.js',
], factory) ], factory)
: ((global = global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Dropdown = factory( (global.Dropdown = factory(
global.Data, global.Data,
global.EventHandler, global.EventHandler,
@ -31,25 +31,19 @@
})(this, function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { })(this, function (Data, EventHandler, Manipulator, Popper, SelectorEngine) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Manipulator = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default') var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
? Manipulator['default'] var Popper__default = /*#__PURE__*/ _interopDefaultLegacy(Popper);
: Manipulator; var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
Popper =
Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -135,49 +129,21 @@
return null; return null;
}; };
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
function _defineProperties(target, props) { function _defineProperties(target, props) {
@ -202,7 +168,7 @@
*/ */
var NAME = 'dropdown'; var NAME = 'dropdown';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.dropdown'; var DATA_KEY = 'bs.dropdown';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -273,7 +239,7 @@
this._addEventListeners(); this._addEventListeners();
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} // Getters } // Getters
var _proto = Dropdown.prototype; var _proto = Dropdown.prototype;
@ -308,14 +274,18 @@
var relatedTarget = { var relatedTarget = {
relatedTarget: this._element, 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) { if (showEvent.defaultPrevented) {
return; return;
} // Disable totally Popper.js for Dropdown in Navbar } // Disable totally Popper.js for Dropdown in Navbar
if (!this._inNavbar) { 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)"); throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org)");
} }
@ -337,7 +307,11 @@
parent.classList.add(CLASS_NAME_POSITION_STATIC); 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 } // If this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children; // empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS // only needed because of broken event delegation on iOS
@ -347,7 +321,7 @@
var _ref; var _ref;
(_ref = []).concat.apply(_ref, document.body.children).forEach(function (elem) { (_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); this._element.setAttribute('aria-expanded', true);
Manipulator.toggleClass(this._menu, CLASS_NAME_SHOW); Manipulator__default['default'].toggleClass(this._menu, CLASS_NAME_SHOW);
Manipulator.toggleClass(this._element, CLASS_NAME_SHOW); Manipulator__default['default'].toggleClass(this._element, CLASS_NAME_SHOW);
EventHandler.trigger(parent, EVENT_SHOWN, relatedTarget); EventHandler__default['default'].trigger(parent, EVENT_SHOWN, relatedTarget);
}; };
_proto.hide = function hide() { _proto.hide = function hide() {
@ -373,7 +347,7 @@
var relatedTarget = { var relatedTarget = {
relatedTarget: this._element, relatedTarget: this._element,
}; };
var hideEvent = EventHandler.trigger(parent, EVENT_HIDE, relatedTarget); var hideEvent = EventHandler__default['default'].trigger(parent, EVENT_HIDE, relatedTarget);
if (hideEvent.defaultPrevented) { if (hideEvent.defaultPrevented) {
return; return;
@ -383,14 +357,14 @@
this._popper.destroy(); this._popper.destroy();
} }
Manipulator.toggleClass(this._menu, CLASS_NAME_SHOW); Manipulator__default['default'].toggleClass(this._menu, CLASS_NAME_SHOW);
Manipulator.toggleClass(this._element, CLASS_NAME_SHOW); Manipulator__default['default'].toggleClass(this._element, CLASS_NAME_SHOW);
EventHandler.trigger(parent, EVENT_HIDDEN, relatedTarget); EventHandler__default['default'].trigger(parent, EVENT_HIDDEN, relatedTarget);
}; };
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
EventHandler.off(this._element, EVENT_KEY); EventHandler__default['default'].off(this._element, EVENT_KEY);
this._element = null; this._element = null;
this._menu = null; this._menu = null;
@ -412,7 +386,7 @@
_proto._addEventListeners = function _addEventListeners() { _proto._addEventListeners = function _addEventListeners() {
var _this = this; var _this = this;
EventHandler.on(this._element, EVENT_CLICK, function (event) { EventHandler__default['default'].on(this._element, EVENT_CLICK, function (event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
@ -421,11 +395,10 @@
}; };
_proto._getConfig = function _getConfig(config) { _proto._getConfig = function _getConfig(config) {
config = _objectSpread( config = _extends(
_objectSpread( {},
_objectSpread({}, this.constructor.Default), this.constructor.Default,
Manipulator.getDataAttributes(this._element) Manipulator__default['default'].getDataAttributes(this._element),
),
config config
); );
typeCheckConfig(NAME, config, this.constructor.DefaultType); typeCheckConfig(NAME, config, this.constructor.DefaultType);
@ -433,7 +406,7 @@
}; };
_proto._getMenuElement = function _getMenuElement() { _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() { _proto._getPlacement = function _getPlacement() {
@ -468,8 +441,9 @@
if (typeof this._config.offset === 'function') { if (typeof this._config.offset === 'function') {
offset.fn = function (data) { offset.fn = function (data) {
data.offsets = _objectSpread( data.offsets = _extends(
_objectSpread({}, data.offsets), {},
data.offsets,
_this2._config.offset(data.offsets, _this2._element) || {} _this2._config.offset(data.offsets, _this2._element) || {}
); );
return data; return data;
@ -501,11 +475,11 @@
}; };
} }
return _objectSpread(_objectSpread({}, popperConfig), this._config.popperConfig); return _extends({}, popperConfig, this._config.popperConfig);
}; // Static }; // Static
Dropdown.dropdownInterface = function dropdownInterface(element, config) { 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; var _config = typeof config === 'object' ? config : null;
@ -536,11 +510,11 @@
return; 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++) { for (var i = 0, len = toggles.length; i < len; i++) {
var parent = Dropdown.getParentFromElement(toggles[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 = { var relatedTarget = {
relatedTarget: toggles[i], relatedTarget: toggles[i],
}; };
@ -568,7 +542,7 @@
continue; continue;
} }
var hideEvent = EventHandler.trigger(parent, EVENT_HIDE, relatedTarget); var hideEvent = EventHandler__default['default'].trigger(parent, EVENT_HIDE, relatedTarget);
if (hideEvent.defaultPrevented) { if (hideEvent.defaultPrevented) {
continue; continue;
@ -579,7 +553,7 @@
var _ref2; var _ref2;
(_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (elem) { (_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); dropdownMenu.classList.remove(CLASS_NAME_SHOW);
toggles[i].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) { if (event.key === ESCAPE_KEY) {
var button = this.matches(SELECTOR_DATA_TOGGLE) var button = this.matches(SELECTOR_DATA_TOGGLE)
? this ? this
: SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0]; : SelectorEngine__default['default'].prev(this, SELECTOR_DATA_TOGGLE)[0];
button.focus(); button.focus();
Dropdown.clearMenus(); Dropdown.clearMenus();
return; return;
@ -642,7 +616,9 @@
return; 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) { if (!items.length) {
return; return;
@ -665,7 +641,7 @@
}; };
Dropdown.getInstance = function getInstance(element) { Dropdown.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Dropdown, null, [ _createClass(Dropdown, null, [
@ -697,23 +673,38 @@
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
EventHandler.on( EventHandler__default['default'].on(
document, document,
EVENT_KEYDOWN_DATA_API, EVENT_KEYDOWN_DATA_API,
SELECTOR_DATA_TOGGLE, SELECTOR_DATA_TOGGLE,
Dropdown.dataApiKeydownHandler Dropdown.dataApiKeydownHandler
); );
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); EventHandler__default['default'].on(
EventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus); document,
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); EVENT_KEYDOWN_DATA_API,
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 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.preventDefault();
event.stopPropagation(); event.stopPropagation();
Dropdown.dropdownInterface(this, 'toggle'); 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(); return e.stopPropagation();
}); }
);
var $ = getjQuery(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -18,7 +18,7 @@
'./dom/manipulator.js', './dom/manipulator.js',
'./dom/selector-engine.js', './dom/selector-engine.js',
], factory) ], factory)
: ((global = global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Modal = factory( (global.Modal = factory(
global.Data, global.Data,
global.EventHandler, global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) { })(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Manipulator = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default') var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
? Manipulator['default'] var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -175,49 +170,21 @@
return null; return null;
}; };
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
function _defineProperties(target, props) { function _defineProperties(target, props) {
@ -242,7 +209,7 @@
*/ */
var NAME = 'modal'; var NAME = 'modal';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.modal'; var DATA_KEY = 'bs.modal';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -293,14 +260,14 @@
function Modal(element, config) { function Modal(element, config) {
this._config = this._getConfig(config); this._config = this._getConfig(config);
this._element = element; this._element = element;
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element); this._dialog = SelectorEngine__default['default'].findOne(SELECTOR_DIALOG, element);
this._backdrop = null; this._backdrop = null;
this._isShown = false; this._isShown = false;
this._isBodyOverflowing = false; this._isBodyOverflowing = false;
this._ignoreBackdropClick = false; this._ignoreBackdropClick = false;
this._isTransitioning = false; this._isTransitioning = false;
this._scrollbarWidth = 0; this._scrollbarWidth = 0;
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} // Getters } // Getters
var _proto = Modal.prototype; var _proto = Modal.prototype;
@ -321,7 +288,7 @@
this._isTransitioning = true; this._isTransitioning = true;
} }
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
relatedTarget: relatedTarget, relatedTarget: relatedTarget,
}); });
@ -341,11 +308,18 @@
this._setResizeEvent(); 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); 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) { if (event.target === _this._element) {
_this._ignoreBackdropClick = true; _this._ignoreBackdropClick = true;
} }
@ -368,7 +342,7 @@
return; return;
} }
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
if (hideEvent.defaultPrevented) { if (hideEvent.defaultPrevented) {
return; return;
@ -386,16 +360,16 @@
this._setResizeEvent(); this._setResizeEvent();
EventHandler.off(document, EVENT_FOCUSIN); EventHandler__default['default'].off(document, EVENT_FOCUSIN);
this._element.classList.remove(CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_SHOW);
EventHandler.off(this._element, EVENT_CLICK_DISMISS); EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS); EventHandler__default['default'].off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
if (transition) { if (transition) {
var transitionDuration = getTransitionDurationFromElement(this._element); 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); return _this2._hideModal(event);
}); });
emulateTransitionEnd(this._element, transitionDuration); emulateTransitionEnd(this._element, transitionDuration);
@ -406,7 +380,7 @@
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
[window, this._element, this._dialog].forEach(function (htmlElement) { [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` * `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 * It will remove `EVENT_CLICK_DATA_API` event that should remain
*/ */
EventHandler.off(document, EVENT_FOCUSIN); EventHandler__default['default'].off(document, EVENT_FOCUSIN);
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
this._config = null; this._config = null;
this._element = null; this._element = null;
this._dialog = null; this._dialog = null;
@ -432,7 +406,7 @@
}; // Private }; // Private
_proto._getConfig = function _getConfig(config) { _proto._getConfig = function _getConfig(config) {
config = _objectSpread(_objectSpread({}, Default), config); config = _extends({}, Default, config);
typeCheckConfig(NAME, config, DefaultType); typeCheckConfig(NAME, config, DefaultType);
return config; return config;
}; };
@ -442,7 +416,7 @@
var transition = this._element.classList.contains(CLASS_NAME_FADE); 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) { if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
// Don't move modal's DOM position // Don't move modal's DOM position
@ -479,14 +453,14 @@
} }
_this3._isTransitioning = false; _this3._isTransitioning = false;
EventHandler.trigger(_this3._element, EVENT_SHOWN, { EventHandler__default['default'].trigger(_this3._element, EVENT_SHOWN, {
relatedTarget: relatedTarget, relatedTarget: relatedTarget,
}); });
}; };
if (transition) { if (transition) {
var transitionDuration = getTransitionDurationFromElement(this._dialog); 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); emulateTransitionEnd(this._dialog, transitionDuration);
} else { } else {
transitionComplete(); transitionComplete();
@ -496,9 +470,9 @@
_proto._enforceFocus = function _enforceFocus() { _proto._enforceFocus = function _enforceFocus() {
var _this4 = this; 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 ( if (
document !== event.target && document !== event.target &&
_this4._element !== event.target && _this4._element !== event.target &&
@ -513,7 +487,7 @@
var _this5 = this; var _this5 = this;
if (this._isShown) { 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) { if (_this5._config.keyboard && event.key === ESCAPE_KEY) {
event.preventDefault(); event.preventDefault();
@ -523,7 +497,7 @@
} }
}); });
} else { } else {
EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS); EventHandler__default['default'].off(this._element, EVENT_KEYDOWN_DISMISS);
} }
}; };
@ -531,11 +505,11 @@
var _this6 = this; var _this6 = this;
if (this._isShown) { if (this._isShown) {
EventHandler.on(window, EVENT_RESIZE, function () { EventHandler__default['default'].on(window, EVENT_RESIZE, function () {
return _this6._adjustDialog(); return _this6._adjustDialog();
}); });
} else { } else {
EventHandler.off(window, EVENT_RESIZE); EventHandler__default['default'].off(window, EVENT_RESIZE);
} }
}; };
@ -559,7 +533,7 @@
_this7._resetScrollbar(); _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); 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) { if (_this8._ignoreBackdropClick) {
_this8._ignoreBackdropClick = false; _this8._ignoreBackdropClick = false;
return; return;
@ -608,7 +582,7 @@
} }
var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop); 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); emulateTransitionEnd(this._backdrop, backdropTransitionDuration);
} else if (!this._isShown && this._backdrop) { } else if (!this._isShown && this._backdrop) {
this._backdrop.classList.remove(CLASS_NAME_SHOW); this._backdrop.classList.remove(CLASS_NAME_SHOW);
@ -622,7 +596,7 @@
if (this._element.classList.contains(CLASS_NAME_FADE)) { if (this._element.classList.contains(CLASS_NAME_FADE)) {
var _backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop); 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); emulateTransitionEnd(this._backdrop, _backdropTransitionDuration);
} else { } else {
callbackRemove(); callbackRemove();
@ -636,17 +610,34 @@
var _this9 = this; var _this9 = this;
if (this._config.backdrop === 'static') { 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) { if (hideEvent.defaultPrevented) {
return; return;
} }
var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
if (!isModalOverflowing) {
this._element.style.overflowY = 'hidden';
}
this._element.classList.add(CLASS_NAME_STATIC); this._element.classList.add(CLASS_NAME_STATIC);
var modalTransitionDuration = getTransitionDurationFromElement(this._element); var modalTransitionDuration = getTransitionDurationFromElement(this._dialog);
EventHandler.one(this._element, TRANSITION_END, function () { EventHandler__default['default'].off(this._element, TRANSITION_END);
EventHandler__default['default'].one(this._element, TRANSITION_END, function () {
_this9._element.classList.remove(CLASS_NAME_STATIC); _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); emulateTransitionEnd(this._element, modalTransitionDuration);
@ -688,24 +679,31 @@
// Note: DOMNode.style.paddingRight returns the actual value or '' if not set // 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 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
// Adjust fixed content padding // 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 actualPadding = element.style.paddingRight;
var calculatedPadding = window.getComputedStyle(element)['padding-right']; var calculatedPadding = window.getComputedStyle(element)['padding-right'];
Manipulator.setDataAttribute(element, 'padding-right', actualPadding); Manipulator__default['default'].setDataAttribute(element, 'padding-right', actualPadding);
element.style.paddingRight = element.style.paddingRight =
parseFloat(calculatedPadding) + _this10._scrollbarWidth + 'px'; parseFloat(calculatedPadding) + _this10._scrollbarWidth + 'px';
}); // Adjust sticky content margin }); // 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 actualMargin = element.style.marginRight;
var calculatedMargin = window.getComputedStyle(element)['margin-right']; var calculatedMargin = window.getComputedStyle(element)['margin-right'];
Manipulator.setDataAttribute(element, 'margin-right', actualMargin); Manipulator__default['default'].setDataAttribute(element, 'margin-right', actualMargin);
element.style.marginRight = parseFloat(calculatedMargin) - _this10._scrollbarWidth + 'px'; element.style.marginRight =
parseFloat(calculatedMargin) - _this10._scrollbarWidth + 'px';
}); // Adjust body padding }); // Adjust body padding
var actualPadding = document.body.style.paddingRight; var actualPadding = document.body.style.paddingRight;
var calculatedPadding = window.getComputedStyle(document.body)['padding-right']; 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 = document.body.style.paddingRight =
parseFloat(calculatedPadding) + this._scrollbarWidth + 'px'; parseFloat(calculatedPadding) + this._scrollbarWidth + 'px';
} }
@ -715,30 +713,35 @@
_proto._resetScrollbar = function _resetScrollbar() { _proto._resetScrollbar = function _resetScrollbar() {
// Restore fixed content padding // Restore fixed content padding
SelectorEngine.find(SELECTOR_FIXED_CONTENT).forEach(function (element) { SelectorEngine__default['default'].find(SELECTOR_FIXED_CONTENT).forEach(function (element) {
var padding = Manipulator.getDataAttribute(element, 'padding-right'); var padding = Manipulator__default['default'].getDataAttribute(element, 'padding-right');
if (typeof padding !== 'undefined') { if (typeof padding !== 'undefined') {
Manipulator.removeDataAttribute(element, 'padding-right'); Manipulator__default['default'].removeDataAttribute(element, 'padding-right');
element.style.paddingRight = padding; element.style.paddingRight = padding;
} }
}); // Restore sticky content and navbar-toggler margin }); // Restore sticky content and navbar-toggler margin
SelectorEngine.find('' + SELECTOR_STICKY_CONTENT).forEach(function (element) { SelectorEngine__default['default']
var margin = Manipulator.getDataAttribute(element, 'margin-right'); .find('' + SELECTOR_STICKY_CONTENT)
.forEach(function (element) {
var margin = Manipulator__default['default'].getDataAttribute(element, 'margin-right');
if (typeof margin !== 'undefined') { if (typeof margin !== 'undefined') {
Manipulator.removeDataAttribute(element, 'margin-right'); Manipulator__default['default'].removeDataAttribute(element, 'margin-right');
element.style.marginRight = margin; element.style.marginRight = margin;
} }
}); // Restore body padding }); // 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') { if (typeof padding === 'undefined') {
document.body.style.paddingRight = ''; document.body.style.paddingRight = '';
} else { } else {
Manipulator.removeDataAttribute(document.body, 'padding-right'); Manipulator__default['default'].removeDataAttribute(document.body, 'padding-right');
document.body.style.paddingRight = padding; document.body.style.paddingRight = padding;
} }
}; };
@ -755,10 +758,12 @@
Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) { Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) {
return this.each(function () { return this.each(function () {
var data = Data.getData(this, DATA_KEY); var data = Data__default['default'].getData(this, DATA_KEY);
var _config = _objectSpread( var _config = _extends(
_objectSpread(_objectSpread({}, Default), Manipulator.getDataAttributes(this)), {},
Default,
Manipulator__default['default'].getDataAttributes(this),
typeof config === 'object' && config ? config : {} typeof config === 'object' && config ? config : {}
); );
@ -779,7 +784,7 @@
}; };
Modal.getInstance = function getInstance(element) { Modal.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Modal, null, [ _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 _this11 = this;
var target = getElementFromSelector(this); var target = getElementFromSelector(this);
@ -814,31 +823,33 @@
event.preventDefault(); event.preventDefault();
} }
EventHandler.one(target, EVENT_SHOW, function (showEvent) { EventHandler__default['default'].one(target, EVENT_SHOW, function (showEvent) {
if (showEvent.defaultPrevented) { if (showEvent.defaultPrevented) {
// only register focus restorer if modal will actually get shown // only register focus restorer if modal will actually get shown
return; return;
} }
EventHandler.one(target, EVENT_HIDDEN, function () { EventHandler__default['default'].one(target, EVENT_HIDDEN, function () {
if (isVisible(_this11)) { if (isVisible(_this11)) {
_this11.focus(); _this11.focus();
} }
}); });
}); });
var data = Data.getData(target, DATA_KEY); var data = Data__default['default'].getData(target, DATA_KEY);
if (!data) { if (!data) {
var config = _objectSpread( var config = _extends(
_objectSpread({}, Manipulator.getDataAttributes(target)), {},
Manipulator.getDataAttributes(this) Manipulator__default['default'].getDataAttributes(target),
Manipulator__default['default'].getDataAttributes(this)
); );
data = new Modal(target, config); data = new Modal(target, config);
} }
data.show(this); data.show(this);
}); }
);
var $ = getjQuery(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -12,24 +12,22 @@
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/selector-engine.js', './tooltip.js'], factory) ? 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))); (global.Popover = factory(global.Data, global.SelectorEngine, global.Tooltip)));
})(this, function (Data, SelectorEngine, Tooltip) { })(this, function (Data, SelectorEngine, Tooltip) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
SelectorEngine = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default') }
? SelectorEngine['default']
: SelectorEngine; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Tooltip = var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
Tooltip && Object.prototype.hasOwnProperty.call(Tooltip, 'default') var Tooltip__default = /*#__PURE__*/ _interopDefaultLegacy(Tooltip);
? Tooltip['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -67,49 +65,21 @@
subClass.__proto__ = superClass; subClass.__proto__ = superClass;
} }
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@ -118,16 +88,13 @@
*/ */
var NAME = 'popover'; var NAME = 'popover';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.popover'; var DATA_KEY = 'bs.popover';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var CLASS_PREFIX = 'bs-popover'; var CLASS_PREFIX = 'bs-popover';
var BSCLS_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g'); var BSCLS_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g');
var Default = _objectSpread( var Default = _extends({}, Tooltip__default['default'].Default, {
_objectSpread({}, Tooltip.Default),
{},
{
placement: 'right', placement: 'right',
trigger: 'click', trigger: 'click',
content: '', content: '',
@ -136,16 +103,11 @@
'<div class="popover-arrow"></div>' + '<div class="popover-arrow"></div>' +
'<h3 class="popover-header"></h3>' + '<h3 class="popover-header"></h3>' +
'<div class="popover-body"></div></div>', '<div class="popover-body"></div></div>',
} });
);
var DefaultType = _objectSpread( var DefaultType = _extends({}, Tooltip__default['default'].DefaultType, {
_objectSpread({}, Tooltip.DefaultType),
{},
{
content: '(string|element|function)', content: '(string|element|function)',
} });
);
var Event = { var Event = {
HIDE: 'hide' + EVENT_KEY, HIDE: 'hide' + EVENT_KEY,
@ -186,7 +148,10 @@
_proto.setContent = function setContent() { _proto.setContent = function setContent() {
var tip = this.getTipElement(); // we use append for html objects to maintain js events 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(); var content = this._getContent();
@ -194,13 +159,16 @@
content = content.call(this.element); 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); tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
}; }; // Private
_proto._addAttachmentClass = function _addAttachmentClass(attachment) { _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
this.getTipElement().classList.add(CLASS_PREFIX + '-' + attachment); this.getTipElement().classList.add(CLASS_PREFIX + '-' + attachment);
}; // Private };
_proto._getContent = function _getContent() { _proto._getContent = function _getContent() {
return this.element.getAttribute('data-content') || this.config.content; return this.element.getAttribute('data-content') || this.config.content;
@ -223,7 +191,7 @@
Popover.jQueryInterface = function jQueryInterface(config) { Popover.jQueryInterface = function jQueryInterface(config) {
return this.each(function () { 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; var _config = typeof config === 'object' ? config : null;
@ -233,7 +201,7 @@
if (!data) { if (!data) {
data = new Popover(this, _config); data = new Popover(this, _config);
Data.setData(this, DATA_KEY, data); Data__default['default'].setData(this, DATA_KEY, data);
} }
if (typeof config === 'string') { if (typeof config === 'string') {
@ -247,7 +215,7 @@
}; };
Popover.getInstance = function getInstance(element) { Popover.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Popover, null, [ _createClass(Popover, null, [
@ -297,7 +265,7 @@
]); ]);
return Popover; return Popover;
})(Tooltip); })(Tooltip__default['default']);
var $ = getjQuery(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -18,7 +18,7 @@
'./dom/manipulator.js', './dom/manipulator.js',
'./dom/selector-engine.js', './dom/selector-engine.js',
], factory) ], factory)
: ((global = global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.ScrollSpy = factory( (global.ScrollSpy = factory(
global.Data, global.Data,
global.EventHandler, global.EventHandler,
@ -28,23 +28,18 @@
})(this, function (Data, EventHandler, Manipulator, SelectorEngine) { })(this, function (Data, EventHandler, Manipulator, SelectorEngine) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Manipulator = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default') var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
? Manipulator['default'] var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
: Manipulator;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -127,49 +122,21 @@
return null; return null;
}; };
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
function _defineProperties(target, props) { function _defineProperties(target, props) {
@ -194,7 +161,7 @@
*/ */
var NAME = 'scrollspy'; var NAME = 'scrollspy';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.scrollspy'; var DATA_KEY = 'bs.scrollspy';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -240,20 +207,25 @@
' ' + ' ' +
SELECTOR_NAV_LINKS + SELECTOR_NAV_LINKS +
', ' + ', ' +
(this._config.target + ' ' + SELECTOR_LIST_ITEMS + ',') + this._config.target +
(this._config.target + ' .' + CLASS_NAME_DROPDOWN_ITEM); ' ' +
SELECTOR_LIST_ITEMS +
', ' +
this._config.target +
' .' +
CLASS_NAME_DROPDOWN_ITEM;
this._offsets = []; this._offsets = [];
this._targets = []; this._targets = [];
this._activeTarget = null; this._activeTarget = null;
this._scrollHeight = 0; 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); return _this._process(event);
}); });
this.refresh(); this.refresh();
this._process(); this._process();
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} // Getters } // Getters
var _proto = ScrollSpy.prototype; var _proto = ScrollSpy.prototype;
@ -269,21 +241,22 @@
this._offsets = []; this._offsets = [];
this._targets = []; this._targets = [];
this._scrollHeight = this._getScrollHeight(); this._scrollHeight = this._getScrollHeight();
var targets = SelectorEngine.find(this._selector); var targets = SelectorEngine__default['default'].find(this._selector);
targets targets
.map(function (element) { .map(function (element) {
var target;
var targetSelector = getSelectorFromElement(element); var targetSelector = getSelectorFromElement(element);
var target = targetSelector
if (targetSelector) { ? SelectorEngine__default['default'].findOne(targetSelector)
target = SelectorEngine.findOne(targetSelector); : null;
}
if (target) { if (target) {
var targetBCR = target.getBoundingClientRect(); var targetBCR = target.getBoundingClientRect();
if (targetBCR.width || targetBCR.height) { 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() { _proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
EventHandler.off(this._scrollElement, EVENT_KEY); EventHandler__default['default'].off(this._scrollElement, EVENT_KEY);
this._element = null; this._element = null;
this._scrollElement = null; this._scrollElement = null;
this._config = null; this._config = null;
@ -316,10 +289,7 @@
}; // Private }; // Private
_proto._getConfig = function _getConfig(config) { _proto._getConfig = function _getConfig(config) {
config = _objectSpread( config = _extends({}, Default, typeof config === 'object' && config ? config : {});
_objectSpread({}, Default),
typeof config === 'object' && config ? config : {}
);
if (typeof config.target !== 'string' && isElement(config.target)) { if (typeof config.target !== 'string' && isElement(config.target)) {
var id = config.target.id; var id = config.target.id;
@ -405,41 +375,47 @@
return selector + '[data-target="' + target + '"],' + selector + '[href="' + target + '"]'; 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)) { if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
SelectorEngine.findOne( SelectorEngine__default['default']
SELECTOR_DROPDOWN_TOGGLE, .findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN))
link.closest(SELECTOR_DROPDOWN) .classList.add(CLASS_NAME_ACTIVE);
).classList.add(CLASS_NAME_ACTIVE);
link.classList.add(CLASS_NAME_ACTIVE); link.classList.add(CLASS_NAME_ACTIVE);
} else { } else {
// Set triggered link as active // Set triggered link as active
link.classList.add(CLASS_NAME_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 // Set triggered links parents as active
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor // 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( SelectorEngine__default['default']
function (item) { .prev(listGroup, SELECTOR_NAV_LINKS + ', ' + SELECTOR_LIST_ITEMS)
.forEach(function (item) {
return item.classList.add(CLASS_NAME_ACTIVE); 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__default['default']
SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(function (item) { .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); return item.classList.add(CLASS_NAME_ACTIVE);
}); });
}); });
}); });
} }
EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, { EventHandler__default['default'].trigger(this._scrollElement, EVENT_ACTIVATE, {
relatedTarget: target, relatedTarget: target,
}); });
}; };
_proto._clear = function _clear() { _proto._clear = function _clear() {
SelectorEngine.find(this._selector) SelectorEngine__default['default']
.find(this._selector)
.filter(function (node) { .filter(function (node) {
return node.classList.contains(CLASS_NAME_ACTIVE); return node.classList.contains(CLASS_NAME_ACTIVE);
}) })
@ -450,7 +426,7 @@
ScrollSpy.jQueryInterface = function jQueryInterface(config) { ScrollSpy.jQueryInterface = function jQueryInterface(config) {
return this.each(function () { 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; var _config = typeof config === 'object' && config;
@ -469,7 +445,7 @@
}; };
ScrollSpy.getInstance = function getInstance(element) { ScrollSpy.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(ScrollSpy, null, [ _createClass(ScrollSpy, null, [
@ -495,9 +471,9 @@
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
EventHandler.on(window, EVENT_LOAD_DATA_API, function () { EventHandler__default['default'].on(window, EVENT_LOAD_DATA_API, function () {
SelectorEngine.find(SELECTOR_DATA_SPY).forEach(function (spy) { SelectorEngine__default['default'].find(SELECTOR_DATA_SPY).forEach(function (spy) {
return new ScrollSpy(spy, Manipulator.getDataAttributes(spy)); return new ScrollSpy(spy, Manipulator__default['default'].getDataAttributes(spy));
}); });
}); });
var $ = getjQuery(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -12,24 +12,22 @@
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/event-handler.js', './dom/selector-engine.js'], factory) ? 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))); (global.Tab = factory(global.Data, global.EventHandler, global.SelectorEngine)));
})(this, function (Data, EventHandler, SelectorEngine) { })(this, function (Data, EventHandler, SelectorEngine) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
SelectorEngine = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default') var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
? SelectorEngine['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -132,7 +130,7 @@
*/ */
var NAME = 'tab'; var NAME = 'tab';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.tab'; var DATA_KEY = 'bs.tab';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api'; var DATA_API_KEY = '.data-api';
@ -162,7 +160,7 @@
var Tab = /*#__PURE__*/ (function () { var Tab = /*#__PURE__*/ (function () {
function Tab(element) { function Tab(element) {
this._element = element; this._element = element;
Data.setData(this._element, DATA_KEY, this); Data__default['default'].setData(this._element, DATA_KEY, this);
} // Getters } // Getters
var _proto = Tab.prototype; var _proto = Tab.prototype;
@ -190,19 +188,19 @@
listElement.nodeName === 'UL' || listElement.nodeName === 'OL' listElement.nodeName === 'UL' || listElement.nodeName === 'OL'
? SELECTOR_ACTIVE_UL ? SELECTOR_ACTIVE_UL
: SELECTOR_ACTIVE; : SELECTOR_ACTIVE;
previous = SelectorEngine.find(itemSelector, listElement); previous = SelectorEngine__default['default'].find(itemSelector, listElement);
previous = previous[previous.length - 1]; previous = previous[previous.length - 1];
} }
var hideEvent = null; var hideEvent = null;
if (previous) { if (previous) {
hideEvent = EventHandler.trigger(previous, EVENT_HIDE, { hideEvent = EventHandler__default['default'].trigger(previous, EVENT_HIDE, {
relatedTarget: this._element, relatedTarget: this._element,
}); });
} }
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW, {
relatedTarget: previous, relatedTarget: previous,
}); });
@ -213,10 +211,10 @@
this._activate(this._element, listElement); this._activate(this._element, listElement);
var complete = function complete() { var complete = function complete() {
EventHandler.trigger(previous, EVENT_HIDDEN, { EventHandler__default['default'].trigger(previous, EVENT_HIDDEN, {
relatedTarget: _this._element, relatedTarget: _this._element,
}); });
EventHandler.trigger(_this._element, EVENT_SHOWN, { EventHandler__default['default'].trigger(_this._element, EVENT_SHOWN, {
relatedTarget: previous, relatedTarget: previous,
}); });
}; };
@ -229,7 +227,7 @@
}; };
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null; this._element = null;
}; // Private }; // Private
@ -238,8 +236,8 @@
var activeElements = var activeElements =
container && (container.nodeName === 'UL' || container.nodeName === 'OL') container && (container.nodeName === 'UL' || container.nodeName === 'OL')
? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) ? SelectorEngine__default['default'].find(SELECTOR_ACTIVE_UL, container)
: SelectorEngine.children(container, SELECTOR_ACTIVE); : SelectorEngine__default['default'].children(container, SELECTOR_ACTIVE);
var active = activeElements[0]; var active = activeElements[0];
var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE); var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE);
@ -250,7 +248,7 @@
if (active && isTransitioning) { if (active && isTransitioning) {
var transitionDuration = getTransitionDurationFromElement(active); var transitionDuration = getTransitionDurationFromElement(active);
active.classList.remove(CLASS_NAME_SHOW); active.classList.remove(CLASS_NAME_SHOW);
EventHandler.one(active, TRANSITION_END, complete); EventHandler__default['default'].one(active, TRANSITION_END, complete);
emulateTransitionEnd(active, transitionDuration); emulateTransitionEnd(active, transitionDuration);
} else { } else {
complete(); complete();
@ -260,7 +258,7 @@
_proto._transitionComplete = function _transitionComplete(element, active, callback) { _proto._transitionComplete = function _transitionComplete(element, active, callback) {
if (active) { if (active) {
active.classList.remove(CLASS_NAME_ACTIVE); active.classList.remove(CLASS_NAME_ACTIVE);
var dropdownChild = SelectorEngine.findOne( var dropdownChild = SelectorEngine__default['default'].findOne(
SELECTOR_DROPDOWN_ACTIVE_CHILD, SELECTOR_DROPDOWN_ACTIVE_CHILD,
active.parentNode active.parentNode
); );
@ -290,7 +288,9 @@
var dropdownElement = element.closest(SELECTOR_DROPDOWN); var dropdownElement = element.closest(SELECTOR_DROPDOWN);
if (dropdownElement) { 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); return dropdown.classList.add(CLASS_NAME_ACTIVE);
}); });
} }
@ -305,7 +305,7 @@
Tab.jQueryInterface = function jQueryInterface(config) { Tab.jQueryInterface = function jQueryInterface(config) {
return this.each(function () { 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 config === 'string') {
if (typeof data[config] === 'undefined') { if (typeof data[config] === 'undefined') {
@ -318,7 +318,7 @@
}; };
Tab.getInstance = function getInstance(element) { Tab.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Tab, null, [ _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(); 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(); data.show();
}); }
);
var $ = getjQuery(); 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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -12,24 +12,22 @@
)) ))
: typeof define === 'function' && define.amd : typeof define === 'function' && define.amd
? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js'], factory) ? 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))); (global.Toast = factory(global.Data, global.EventHandler, global.Manipulator)));
})(this, function (Data, EventHandler, Manipulator) { })(this, function (Data, EventHandler, Manipulator) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Manipulator = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default') var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
? Manipulator['default']
: 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -126,49 +124,21 @@
return null; return null;
}; };
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
function _defineProperties(target, props) { function _defineProperties(target, props) {
@ -193,7 +163,7 @@
*/ */
var NAME = 'toast'; var NAME = 'toast';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.toast'; var DATA_KEY = 'bs.toast';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var EVENT_CLICK_DISMISS = 'click.dismiss' + EVENT_KEY; var EVENT_CLICK_DISMISS = 'click.dismiss' + EVENT_KEY;
@ -213,7 +183,7 @@
var Default = { var Default = {
animation: true, animation: true,
autohide: true, autohide: true,
delay: 500, delay: 5000,
}; };
var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'; var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
/** /**
@ -230,7 +200,7 @@
this._setListeners(); this._setListeners();
Data.setData(element, DATA_KEY, this); Data__default['default'].setData(element, DATA_KEY, this);
} // Getters } // Getters
var _proto = Toast.prototype; var _proto = Toast.prototype;
@ -239,12 +209,14 @@
_proto.show = function show() { _proto.show = function show() {
var _this = this; var _this = this;
var showEvent = EventHandler.trigger(this._element, EVENT_SHOW); var showEvent = EventHandler__default['default'].trigger(this._element, EVENT_SHOW);
if (showEvent.defaultPrevented) { if (showEvent.defaultPrevented) {
return; return;
} }
this._clearTimeout();
if (this._config.animation) { if (this._config.animation) {
this._element.classList.add(CLASS_NAME_FADE); this._element.classList.add(CLASS_NAME_FADE);
} }
@ -254,7 +226,7 @@
_this._element.classList.add(CLASS_NAME_SHOW); _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) { if (_this._config.autohide) {
_this._timeout = setTimeout(function () { _this._timeout = setTimeout(function () {
@ -271,7 +243,7 @@
if (this._config.animation) { if (this._config.animation) {
var transitionDuration = getTransitionDurationFromElement(this._element); 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); emulateTransitionEnd(this._element, transitionDuration);
} else { } else {
complete(); complete();
@ -285,7 +257,7 @@
return; return;
} }
var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE); var hideEvent = EventHandler__default['default'].trigger(this._element, EVENT_HIDE);
if (hideEvent.defaultPrevented) { if (hideEvent.defaultPrevented) {
return; return;
@ -294,14 +266,14 @@
var complete = function complete() { var complete = function complete() {
_this2._element.classList.add(CLASS_NAME_HIDE); _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); this._element.classList.remove(CLASS_NAME_SHOW);
if (this._config.animation) { if (this._config.animation) {
var transitionDuration = getTransitionDurationFromElement(this._element); 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); emulateTransitionEnd(this._element, transitionDuration);
} else { } else {
complete(); complete();
@ -309,22 +281,23 @@
}; };
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
clearTimeout(this._timeout); this._clearTimeout();
this._timeout = null;
if (this._element.classList.contains(CLASS_NAME_SHOW)) { if (this._element.classList.contains(CLASS_NAME_SHOW)) {
this._element.classList.remove(CLASS_NAME_SHOW); this._element.classList.remove(CLASS_NAME_SHOW);
} }
EventHandler.off(this._element, EVENT_CLICK_DISMISS); EventHandler__default['default'].off(this._element, EVENT_CLICK_DISMISS);
Data.removeData(this._element, DATA_KEY); Data__default['default'].removeData(this._element, DATA_KEY);
this._element = null; this._element = null;
this._config = null; this._config = null;
}; // Private }; // Private
_proto._getConfig = function _getConfig(config) { _proto._getConfig = function _getConfig(config) {
config = _objectSpread( config = _extends(
_objectSpread(_objectSpread({}, Default), Manipulator.getDataAttributes(this._element)), {},
Default,
Manipulator__default['default'].getDataAttributes(this._element),
typeof config === 'object' && config ? config : {} typeof config === 'object' && config ? config : {}
); );
typeCheckConfig(NAME, config, this.constructor.DefaultType); typeCheckConfig(NAME, config, this.constructor.DefaultType);
@ -334,14 +307,24 @@
_proto._setListeners = function _setListeners() { _proto._setListeners = function _setListeners() {
var _this3 = this; 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(); return _this3.hide();
}); }
);
};
_proto._clearTimeout = function _clearTimeout() {
clearTimeout(this._timeout);
this._timeout = null;
}; // Static }; // Static
Toast.jQueryInterface = function jQueryInterface(config) { Toast.jQueryInterface = function jQueryInterface(config) {
return this.each(function () { 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; var _config = typeof config === 'object' && config;
@ -360,7 +343,7 @@
}; };
Toast.getInstance = function getInstance(element) { Toast.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Toast, null, [ _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) * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
@ -20,7 +20,7 @@
'popper.js', 'popper.js',
'./dom/selector-engine.js', './dom/selector-engine.js',
], factory) ], factory)
: ((global = global || self), : ((global = typeof globalThis !== 'undefined' ? globalThis : global || self),
(global.Tooltip = factory( (global.Tooltip = factory(
global.Data, global.Data,
global.EventHandler, global.EventHandler,
@ -31,25 +31,19 @@
})(this, function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { })(this, function (Data, EventHandler, Manipulator, Popper, SelectorEngine) {
'use strict'; 'use strict';
Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; function _interopDefaultLegacy(e) {
EventHandler = return e && typeof e === 'object' && 'default' in e ? e : { default: e };
EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') }
? EventHandler['default']
: EventHandler; var Data__default = /*#__PURE__*/ _interopDefaultLegacy(Data);
Manipulator = var EventHandler__default = /*#__PURE__*/ _interopDefaultLegacy(EventHandler);
Manipulator && Object.prototype.hasOwnProperty.call(Manipulator, 'default') var Manipulator__default = /*#__PURE__*/ _interopDefaultLegacy(Manipulator);
? Manipulator['default'] var Popper__default = /*#__PURE__*/ _interopDefaultLegacy(Popper);
: Manipulator; var SelectorEngine__default = /*#__PURE__*/ _interopDefaultLegacy(SelectorEngine);
Popper =
Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
SelectorEngine =
SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default')
? SelectorEngine['default']
: 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) * 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -239,7 +233,7 @@
return false; return false;
}; };
var DefaultWhitelist = { var DefaultAllowlist = {
// Global attributes allowed on any supplied element below. // Global attributes allowed on any supplied element below.
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
a: ['target', 'href', 'title', 'rel'], a: ['target', 'href', 'title', 'rel'],
@ -272,7 +266,7 @@
u: [], u: [],
ul: [], ul: [],
}; };
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
var _ref; var _ref;
if (!unsafeHtml.length) { if (!unsafeHtml.length) {
@ -285,7 +279,7 @@
var domParser = new window.DOMParser(); var domParser = new window.DOMParser();
var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 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('*')); var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
@ -295,16 +289,16 @@
var el = elements[i]; var el = elements[i];
var elName = el.nodeName.toLowerCase(); var elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(elName) === -1) { if (allowlistKeys.indexOf(elName) === -1) {
el.parentNode.removeChild(el); el.parentNode.removeChild(el);
return 'continue'; return 'continue';
} }
var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes); var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); var allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
attributeList.forEach(function (attr) { attributeList.forEach(function (attr) {
if (!allowedAttribute(attr, whitelistedAttributes)) { if (!allowedAttribute(attr, allowedAttributes)) {
el.removeAttribute(attr.nodeName); el.removeAttribute(attr.nodeName);
} }
}); });
@ -319,49 +313,21 @@
return createdDocument.body.innerHTML; return createdDocument.body.innerHTML;
} }
function ownKeys(object, enumerableOnly) { function _extends() {
var keys = Object.keys(object); _extends =
if (Object.getOwnPropertySymbols) { Object.assign ||
var symbols = Object.getOwnPropertySymbols(object); function (target) {
if (enumerableOnly)
symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
});
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {}; var source = arguments[i];
if (i % 2) { for (var key in source) {
ownKeys(Object(source), true).forEach(function (key) { if (Object.prototype.hasOwnProperty.call(source, key)) {
_defineProperty(target, key, source[key]); 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));
});
} }
} }
return target; return target;
} };
return _extends.apply(this, arguments);
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;
} }
function _defineProperties(target, props) { function _defineProperties(target, props) {
@ -386,12 +352,12 @@
*/ */
var NAME = 'tooltip'; var NAME = 'tooltip';
var VERSION = '5.0.0-alpha1'; var VERSION = '5.0.0-alpha2';
var DATA_KEY = 'bs.tooltip'; var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = '.' + DATA_KEY; var EVENT_KEY = '.' + DATA_KEY;
var CLASS_PREFIX = 'bs-tooltip'; var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp('(^|\\s)' + CLASS_PREFIX + '\\S+', 'g'); 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 = { var DefaultType = {
animation: 'boolean', animation: 'boolean',
template: 'string', template: 'string',
@ -407,7 +373,7 @@
boundary: '(string|element)', boundary: '(string|element)',
sanitize: 'boolean', sanitize: 'boolean',
sanitizeFn: '(null|function)', sanitizeFn: '(null|function)',
whiteList: 'object', allowList: 'object',
popperConfig: '(null|object)', popperConfig: '(null|object)',
}; };
var AttachmentMap = { var AttachmentMap = {
@ -435,7 +401,7 @@
boundary: 'scrollParent', boundary: 'scrollParent',
sanitize: true, sanitize: true,
sanitizeFn: null, sanitizeFn: null,
whiteList: DefaultWhitelist, allowList: DefaultAllowlist,
popperConfig: null, popperConfig: null,
}; };
var Event$1 = { var Event$1 = {
@ -468,7 +434,7 @@
var Tooltip = /*#__PURE__*/ (function () { var Tooltip = /*#__PURE__*/ (function () {
function Tooltip(element, config) { 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)"); throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org)");
} // private } // private
@ -484,7 +450,7 @@
this._setListeners(); this._setListeners();
Data.setData(element, this.constructor.DATA_KEY, this); Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
} // Getters } // Getters
var _proto = Tooltip.prototype; var _proto = Tooltip.prototype;
@ -509,11 +475,11 @@
if (event) { if (event) {
var dataKey = this.constructor.DATA_KEY; var dataKey = this.constructor.DATA_KEY;
var context = Data.getData(event.target, dataKey); var context = Data__default['default'].getData(event.delegateTarget, dataKey);
if (!context) { if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig()); context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.target, dataKey, context); Data__default['default'].setData(event.delegateTarget, dataKey, context);
} }
context._activeTrigger.click = !context._activeTrigger.click; context._activeTrigger.click = !context._activeTrigger.click;
@ -536,9 +502,9 @@
_proto.dispose = function dispose() { _proto.dispose = function dispose() {
clearTimeout(this._timeout); clearTimeout(this._timeout);
Data.removeData(this.element, this.constructor.DATA_KEY); Data__default['default'].removeData(this.element, this.constructor.DATA_KEY);
EventHandler.off(this.element, this.constructor.EVENT_KEY); EventHandler__default['default'].off(this.element, this.constructor.EVENT_KEY);
EventHandler.off( EventHandler__default['default'].off(
this.element.closest('.' + CLASS_NAME_MODAL), this.element.closest('.' + CLASS_NAME_MODAL),
'hide.bs.modal', 'hide.bs.modal',
this._hideModalHandler this._hideModalHandler
@ -571,7 +537,10 @@
} }
if (this.isWithContent() && this._isEnabled) { 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 shadowRoot = findShadowRoot(this.element);
var isInTheDom = var isInTheDom =
shadowRoot === null shadowRoot === null
@ -603,14 +572,18 @@
var container = this._getContainer(); 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)) { if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
container.appendChild(tip); container.appendChild(tip);
} }
EventHandler.trigger(this.element, this.constructor.Event.INSERTED); EventHandler__default['default'].trigger(this.element, this.constructor.Event.INSERTED);
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment)); 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 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; // empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS // only needed because of broken event delegation on iOS
@ -620,7 +593,7 @@
var _ref; var _ref;
(_ref = []).concat.apply(_ref, document.body.children).forEach(function (element) { (_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; var prevHoverState = _this._hoverState;
_this._hoverState = null; _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) { if (prevHoverState === HOVER_STATE_OUT) {
_this._leave(null, _this); _this._leave(null, _this);
@ -640,7 +613,7 @@
if (this.tip.classList.contains(CLASS_NAME_FADE)) { if (this.tip.classList.contains(CLASS_NAME_FADE)) {
var transitionDuration = getTransitionDurationFromElement(this.tip); 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); emulateTransitionEnd(this.tip, transitionDuration);
} else { } else {
complete(); complete();
@ -651,6 +624,10 @@
_proto.hide = function hide() { _proto.hide = function hide() {
var _this2 = this; var _this2 = this;
if (!this._popper) {
return;
}
var tip = this.getTipElement(); var tip = this.getTipElement();
var complete = function complete() { var complete = function complete() {
@ -662,12 +639,15 @@
_this2.element.removeAttribute('aria-describedby'); _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(); _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) { if (hideEvent.defaultPrevented) {
return; return;
@ -680,7 +660,7 @@
var _ref2; var _ref2;
(_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (element) { (_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)) { if (this.tip.classList.contains(CLASS_NAME_FADE)) {
var transitionDuration = getTransitionDurationFromElement(tip); var transitionDuration = getTransitionDurationFromElement(tip);
EventHandler.one(tip, TRANSITION_END, complete); EventHandler__default['default'].one(tip, TRANSITION_END, complete);
emulateTransitionEnd(tip, transitionDuration); emulateTransitionEnd(tip, transitionDuration);
} else { } else {
complete(); complete();
@ -722,7 +702,10 @@
_proto.setContent = function setContent() { _proto.setContent = function setContent() {
var tip = this.getTipElement(); 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); tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
}; };
@ -750,7 +733,7 @@
if (this.config.html) { if (this.config.html) {
if (this.config.sanitize) { 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; element.innerHTML = content;
@ -798,7 +781,7 @@
return _this3._handlePopperPlacementChange(data); return _this3._handlePopperPlacementChange(data);
}, },
}; };
return _objectSpread(_objectSpread({}, defaultBsConfig), this.config.popperConfig); return _extends({}, defaultBsConfig, this.config.popperConfig);
}; };
_proto._addAttachmentClass = function _addAttachmentClass(attachment) { _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
@ -812,8 +795,9 @@
if (typeof this.config.offset === 'function') { if (typeof this.config.offset === 'function') {
offset.fn = function (data) { offset.fn = function (data) {
data.offsets = _objectSpread( data.offsets = _extends(
_objectSpread({}, data.offsets), {},
data.offsets,
_this4.config.offset(data.offsets, _this4.element) || {} _this4.config.offset(data.offsets, _this4.element) || {}
); );
return data; return data;
@ -834,7 +818,7 @@
return this.config.container; return this.config.container;
} }
return SelectorEngine.findOne(this.config.container); return SelectorEngine__default['default'].findOne(this.config.container);
}; };
_proto._getAttachment = function _getAttachment(placement) { _proto._getAttachment = function _getAttachment(placement) {
@ -847,7 +831,7 @@
var triggers = this.config.trigger.split(' '); var triggers = this.config.trigger.split(' ');
triggers.forEach(function (trigger) { triggers.forEach(function (trigger) {
if (trigger === 'click') { if (trigger === 'click') {
EventHandler.on( EventHandler__default['default'].on(
_this5.element, _this5.element,
_this5.constructor.Event.CLICK, _this5.constructor.Event.CLICK,
_this5.config.selector, _this5.config.selector,
@ -864,12 +848,22 @@
trigger === TRIGGER_HOVER trigger === TRIGGER_HOVER
? _this5.constructor.Event.MOUSELEAVE ? _this5.constructor.Event.MOUSELEAVE
: _this5.constructor.Event.FOCUSOUT; : _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); 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); return _this5._leave(event);
}); }
);
} }
}); });
@ -879,21 +873,17 @@
} }
}; };
EventHandler.on( EventHandler__default['default'].on(
this.element.closest('.' + CLASS_NAME_MODAL), this.element.closest('.' + CLASS_NAME_MODAL),
'hide.bs.modal', 'hide.bs.modal',
this._hideModalHandler this._hideModalHandler
); );
if (this.config.selector) { if (this.config.selector) {
this.config = _objectSpread( this.config = _extends({}, this.config, {
_objectSpread({}, this.config),
{},
{
trigger: 'manual', trigger: 'manual',
selector: '', selector: '',
} });
);
} else { } else {
this._fixTitle(); this._fixTitle();
} }
@ -910,11 +900,11 @@
_proto._enter = function _enter(event, context) { _proto._enter = function _enter(event, context) {
var dataKey = this.constructor.DATA_KEY; var dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey); context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
if (!context) { if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig()); context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.target, dataKey, context); Data__default['default'].setData(event.delegateTarget, dataKey, context);
} }
if (event) { if (event) {
@ -946,11 +936,11 @@
_proto._leave = function _leave(event, context) { _proto._leave = function _leave(event, context) {
var dataKey = this.constructor.DATA_KEY; var dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey); context = context || Data__default['default'].getData(event.delegateTarget, dataKey);
if (!context) { if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig()); context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.target, dataKey, context); Data__default['default'].setData(event.delegateTarget, dataKey, context);
} }
if (event) { if (event) {
@ -987,7 +977,7 @@
}; };
_proto._getConfig = function _getConfig(config) { _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) { Object.keys(dataAttributes).forEach(function (dataAttr) {
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
delete dataAttributes[dataAttr]; delete dataAttributes[dataAttr];
@ -998,8 +988,10 @@
config.container = config.container[0]; config.container = config.container[0];
} }
config = _objectSpread( config = _extends(
_objectSpread(_objectSpread({}, this.constructor.Default), dataAttributes), {},
this.constructor.Default,
dataAttributes,
typeof config === 'object' && config ? config : {} typeof config === 'object' && config ? config : {}
); );
@ -1021,7 +1013,7 @@
typeCheckConfig(NAME, config, this.constructor.DefaultType); typeCheckConfig(NAME, config, this.constructor.DefaultType);
if (config.sanitize) { if (config.sanitize) {
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
} }
return config; return config;
@ -1057,8 +1049,7 @@
}; };
_proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
var popperInstance = popperData.instance; this.tip = popperData.instance.popper;
this.tip = popperInstance.popper;
this._cleanTipClass(); this._cleanTipClass();
@ -1082,7 +1073,7 @@
Tooltip.jQueryInterface = function jQueryInterface(config) { Tooltip.jQueryInterface = function jQueryInterface(config) {
return this.each(function () { 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; var _config = typeof config === 'object' && config;
@ -1105,7 +1096,7 @@
}; };
Tooltip.getInstance = function getInstance(element) { Tooltip.getInstance = function getInstance(element) {
return Data.getData(element, DATA_KEY); return Data__default['default'].getData(element, DATA_KEY);
}; };
_createClass(Tooltip, null, [ _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) * 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 NAME = 'alert';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.alert'; const DATA_KEY = 'bs.alert';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; const DATA_API_KEY = '.data-api';
@ -61,11 +61,7 @@ class Alert {
// Public // Public
close(element) { close(element) {
let rootElement = this._element; const rootElement = element ? this._getRootElement(element) : this._element;
if (element) {
rootElement = this._getRootElement(element);
}
const customEvent = this._triggerCloseEvent(rootElement); const customEvent = this._triggerCloseEvent(rootElement);
if (customEvent === null || customEvent.defaultPrevented) { 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) * 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 NAME = 'button';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.button'; const DATA_KEY = 'bs.button';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; 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) * 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 NAME = 'carousel';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.carousel'; const DATA_KEY = 'bs.carousel';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; 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) * 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 NAME = 'collapse';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.collapse'; const DATA_KEY = 'bs.collapse';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; const DATA_API_KEY = '.data-api';
@ -285,8 +285,7 @@ class Collapse {
} }
_getDimension() { _getDimension() {
const hasWidth = this._element.classList.contains(WIDTH); return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT;
return hasWidth ? WIDTH : HEIGHT;
} }
_getParent() { _getParent() {
@ -313,10 +312,12 @@ class Collapse {
} }
_addAriaAndCollapsedClass(element, triggerArray) { _addAriaAndCollapsedClass(element, triggerArray) {
if (element) { if (!element || !triggerArray.length) {
return;
}
const isOpen = element.classList.contains(CLASS_NAME_SHOW); const isOpen = element.classList.contains(CLASS_NAME_SHOW);
if (triggerArray.length) {
triggerArray.forEach((elem) => { triggerArray.forEach((elem) => {
if (isOpen) { if (isOpen) {
elem.classList.remove(CLASS_NAME_COLLAPSED); elem.classList.remove(CLASS_NAME_COLLAPSED);
@ -327,8 +328,6 @@ class Collapse {
elem.setAttribute('aria-expanded', isOpen); elem.setAttribute('aria-expanded', isOpen);
}); });
} }
}
}
// Static // 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -16,22 +16,22 @@ const mapData = (() => {
let id = 1; let id = 1;
return { return {
set(element, key, data) { set(element, key, data) {
if (typeof element.key === 'undefined') { if (typeof element.bsKey === 'undefined') {
element.key = { element.bsKey = {
key, key,
id, id,
}; };
id++; id++;
} }
storeData[element.key.id] = data; storeData[element.bsKey.id] = data;
}, },
get(element, key) { get(element, key) {
if (!element || typeof element.key === 'undefined') { if (!element || typeof element.bsKey === 'undefined') {
return null; return null;
} }
const keyProperties = element.key; const keyProperties = element.bsKey;
if (keyProperties.key === key) { if (keyProperties.key === key) {
return storeData[keyProperties.id]; return storeData[keyProperties.id];
} }
@ -39,14 +39,14 @@ const mapData = (() => {
return null; return null;
}, },
delete(element, key) { delete(element, key) {
if (typeof element.key === 'undefined') { if (typeof element.bsKey === 'undefined') {
return; return;
} }
const keyProperties = element.key; const keyProperties = element.bsKey;
if (keyProperties.key === key) { if (keyProperties.key === key) {
delete storeData[keyProperties.id]; 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -94,6 +94,8 @@ function getEvent(element) {
function bootstrapHandler(element, fn) { function bootstrapHandler(element, fn) {
return function handler(event) { return function handler(event) {
event.delegateTarget = element;
if (handler.oneOff) { if (handler.oneOff) {
EventHandler.off(element, event.type, fn); 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 { target } = event; target && target !== this; target = target.parentNode) {
for (let i = domElements.length; i--; ) { for (let i = domElements.length; i--; ) {
if (domElements[i] === target) { if (domElements[i] === target) {
event.delegateTarget = target;
if (handler.oneOff) { if (handler.oneOff) {
EventHandler.off(element, event.type, fn); 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') { if (typeof args !== 'undefined') {
Object.keys(args).forEach((key) => { Object.keys(args).forEach((key) => {
Object.defineProperty(evt, 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) * 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) * 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) * 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) * 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 NAME = 'dropdown';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.dropdown'; const DATA_KEY = 'bs.dropdown';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; 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) * 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 NAME = 'modal';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.modal'; const DATA_KEY = 'bs.modal';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; const DATA_API_KEY = '.data-api';
@ -407,10 +407,23 @@ class Modal {
return; return;
} }
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
if (!isModalOverflowing) {
this._element.style.overflowY = 'hidden';
}
this._element.classList.add(CLASS_NAME_STATIC); 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, () => { EventHandler.one(this._element, TRANSITION_END, () => {
this._element.classList.remove(CLASS_NAME_STATIC); 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); emulateTransitionEnd(this._element, modalTransitionDuration);
this._element.focus(); 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -17,7 +17,7 @@ import Tooltip from './tooltip';
*/ */
const NAME = 'popover'; const NAME = 'popover';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.popover'; const DATA_KEY = 'bs.popover';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const CLASS_PREFIX = 'bs-popover'; const CLASS_PREFIX = 'bs-popover';
@ -117,12 +117,12 @@ class Popover extends Tooltip {
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW); tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW);
} }
// Private
_addAttachmentClass(attachment) { _addAttachmentClass(attachment) {
this.getTipElement().classList.add(`${CLASS_PREFIX}-${attachment}`); this.getTipElement().classList.add(`${CLASS_PREFIX}-${attachment}`);
} }
// Private
_getContent() { _getContent() {
return this.element.getAttribute('data-content') || this.config.content; 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) * 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 NAME = 'scrollspy';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.scrollspy'; const DATA_KEY = 'bs.scrollspy';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; const DATA_API_KEY = '.data-api';
@ -70,10 +70,7 @@ class ScrollSpy {
this._element = element; this._element = element;
this._scrollElement = element.tagName === 'BODY' ? window : element; this._scrollElement = element.tagName === 'BODY' ? window : element;
this._config = this._getConfig(config); this._config = this._getConfig(config);
this._selector = this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`;
`${this._config.target} ${SELECTOR_NAV_LINKS},` +
`${this._config.target} ${SELECTOR_LIST_ITEMS},` +
`${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`;
this._offsets = []; this._offsets = [];
this._targets = []; this._targets = [];
this._activeTarget = null; this._activeTarget = null;
@ -109,19 +106,14 @@ class ScrollSpy {
this._offsets = []; this._offsets = [];
this._targets = []; this._targets = [];
this._scrollHeight = this._getScrollHeight(); this._scrollHeight = this._getScrollHeight();
const targets = SelectorEngine.find(this._selector); const targets = SelectorEngine.find(this._selector);
targets targets
.map((element) => { .map((element) => {
let target;
const targetSelector = getSelectorFromElement(element); const targetSelector = getSelectorFromElement(element);
const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
if (targetSelector) {
target = SelectorEngine.findOne(targetSelector);
}
if (target) { if (target) {
const targetBCR = target.getBoundingClientRect(); 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) * 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 NAME = 'tab';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.tab'; const DATA_KEY = 'bs.tab';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const DATA_API_KEY = '.data-api'; 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -24,7 +24,7 @@ import Manipulator from './dom/manipulator';
*/ */
const NAME = 'toast'; const NAME = 'toast';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.toast'; const DATA_KEY = 'bs.toast';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
@ -48,7 +48,7 @@ const DefaultType = {
const Default = { const Default = {
animation: true, animation: true,
autohide: true, autohide: true,
delay: 500, delay: 5000,
}; };
const SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'; const SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]';
@ -91,6 +91,8 @@ class Toast {
return; return;
} }
this._clearTimeout();
if (this._config.animation) { if (this._config.animation) {
this._element.classList.add(CLASS_NAME_FADE); this._element.classList.add(CLASS_NAME_FADE);
} }
@ -149,8 +151,7 @@ class Toast {
} }
dispose() { dispose() {
clearTimeout(this._timeout); this._clearTimeout();
this._timeout = null;
if (this._element.classList.contains(CLASS_NAME_SHOW)) { if (this._element.classList.contains(CLASS_NAME_SHOW)) {
this._element.classList.remove(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()); EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
} }
_clearTimeout() {
clearTimeout(this._timeout);
this._timeout = null;
}
// Static // Static
static jQueryInterface(config) { 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -16,7 +16,7 @@ import {
noop, noop,
typeCheckConfig, typeCheckConfig,
} from './util/index'; } from './util/index';
import { DefaultWhitelist, sanitizeHtml } from './util/sanitizer'; import { DefaultAllowlist, sanitizeHtml } from './util/sanitizer';
import Data from './dom/data'; import Data from './dom/data';
import EventHandler from './dom/event-handler'; import EventHandler from './dom/event-handler';
import Manipulator from './dom/manipulator'; import Manipulator from './dom/manipulator';
@ -30,12 +30,12 @@ import SelectorEngine from './dom/selector-engine';
*/ */
const NAME = 'tooltip'; const NAME = 'tooltip';
const VERSION = '5.0.0-alpha1'; const VERSION = '5.0.0-alpha2';
const DATA_KEY = 'bs.tooltip'; const DATA_KEY = 'bs.tooltip';
const EVENT_KEY = `.${DATA_KEY}`; const EVENT_KEY = `.${DATA_KEY}`;
const CLASS_PREFIX = 'bs-tooltip'; const CLASS_PREFIX = 'bs-tooltip';
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g'); 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 = { const DefaultType = {
animation: 'boolean', animation: 'boolean',
@ -52,7 +52,7 @@ const DefaultType = {
boundary: '(string|element)', boundary: '(string|element)',
sanitize: 'boolean', sanitize: 'boolean',
sanitizeFn: '(null|function)', sanitizeFn: '(null|function)',
whiteList: 'object', allowList: 'object',
popperConfig: '(null|object)', popperConfig: '(null|object)',
}; };
@ -82,7 +82,7 @@ const Default = {
boundary: 'scrollParent', boundary: 'scrollParent',
sanitize: true, sanitize: true,
sanitizeFn: null, sanitizeFn: null,
whiteList: DefaultWhitelist, allowList: DefaultAllowlist,
popperConfig: null, popperConfig: null,
}; };
@ -192,11 +192,11 @@ class Tooltip {
if (event) { if (event) {
const dataKey = this.constructor.DATA_KEY; const dataKey = this.constructor.DATA_KEY;
let context = Data.getData(event.target, dataKey); let context = Data.getData(event.delegateTarget, dataKey);
if (!context) { if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig()); context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.target, dataKey, context); Data.setData(event.delegateTarget, dataKey, context);
} }
context._activeTrigger.click = !context._activeTrigger.click; context._activeTrigger.click = !context._activeTrigger.click;
@ -332,6 +332,10 @@ class Tooltip {
} }
hide() { hide() {
if (!this._popper) {
return;
}
const tip = this.getTipElement(); const tip = this.getTipElement();
const complete = () => { const complete = () => {
if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
@ -430,7 +434,7 @@ class Tooltip {
if (this.config.html) { if (this.config.html) {
if (this.config.sanitize) { 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; element.innerHTML = content;
@ -582,11 +586,11 @@ class Tooltip {
_enter(event, context) { _enter(event, context) {
const dataKey = this.constructor.DATA_KEY; const dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey); context = context || Data.getData(event.delegateTarget, dataKey);
if (!context) { if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig()); context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.target, dataKey, context); Data.setData(event.delegateTarget, dataKey, context);
} }
if (event) { if (event) {
@ -619,11 +623,11 @@ class Tooltip {
_leave(event, context) { _leave(event, context) {
const dataKey = this.constructor.DATA_KEY; const dataKey = this.constructor.DATA_KEY;
context = context || Data.getData(event.target, dataKey); context = context || Data.getData(event.delegateTarget, dataKey);
if (!context) { if (!context) {
context = new this.constructor(event.target, this._getDelegateConfig()); context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
Data.setData(event.target, dataKey, context); Data.setData(event.delegateTarget, dataKey, context);
} }
if (event) { if (event) {
@ -697,7 +701,7 @@ class Tooltip {
typeCheckConfig(NAME, config, this.constructor.DefaultType); typeCheckConfig(NAME, config, this.constructor.DefaultType);
if (config.sanitize) { if (config.sanitize) {
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn);
} }
return config; return config;
@ -726,8 +730,7 @@ class Tooltip {
} }
_handlePopperPlacementChange(popperData) { _handlePopperPlacementChange(popperData) {
const popperInstance = popperData.instance; this.tip = popperData.instance.popper;
this.tip = popperInstance.popper;
this._cleanTipClass(); this._cleanTipClass();
this._addAttachmentClass(this._getAttachment(popperData.placement)); 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) * 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) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
@ -57,7 +57,7 @@ const allowedAttribute = (attr, allowedAttributeList) => {
return false; return false;
}; };
export const DefaultWhitelist = { export const DefaultAllowlist = {
// Global attributes allowed on any supplied element below. // Global attributes allowed on any supplied element below.
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
a: ['target', 'href', 'title', 'rel'], a: ['target', 'href', 'title', 'rel'],
@ -91,7 +91,7 @@ export const DefaultWhitelist = {
ul: [], ul: [],
}; };
export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { export function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
if (!unsafeHtml.length) { if (!unsafeHtml.length) {
return unsafeHtml; return unsafeHtml;
} }
@ -102,24 +102,24 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
const domParser = new window.DOMParser(); const domParser = new window.DOMParser();
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
const whitelistKeys = Object.keys(whiteList); const allowlistKeys = Object.keys(allowList);
const elements = [].concat(...createdDocument.body.querySelectorAll('*')); const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
for (let i = 0, len = elements.length; i < len; i++) { for (let i = 0, len = elements.length; i < len; i++) {
const el = elements[i]; const el = elements[i];
const elName = el.nodeName.toLowerCase(); const elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(elName) === -1) { if (allowlistKeys.indexOf(elName) === -1) {
el.parentNode.removeChild(el); el.parentNode.removeChild(el);
continue; continue;
} }
const attributeList = [].concat(...el.attributes); const attributeList = [].concat(...el.attributes);
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); const allowedAttributes = [].concat(allowList['*'] || [], allowList[elName] || []);
attributeList.forEach((attr) => { attributeList.forEach((attr) => {
if (!allowedAttribute(attr, whitelistedAttributes)) { if (!allowedAttribute(attr, allowedAttributes)) {
el.removeAttribute(attr.nodeName); el.removeAttribute(attr.nodeName);
} }
}); });

View File

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

View File

@ -13,47 +13,47 @@ const uriAttrs = [
'longdesc', 'longdesc',
'poster', 'poster',
'src', '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. * 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 * 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. * 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 * 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 allowedAttribute = (attr, allowedAttributeList) => {
const attrName = attr.nodeName.toLowerCase() const attrName = attr.nodeName.toLowerCase();
if (allowedAttributeList.indexOf(attrName) !== -1) { if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.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. // Check if a regular expression validates the attribute.
for (let i = 0, len = regExp.length; i < len; i++) { for (let i = 0, len = regExp.length; i < len; i++) {
if (regExp[i].test(attrName)) { if (regExp[i].test(attrName)) {
return true return true;
} }
} }
return false return false;
} };
export const DefaultWhitelist = { export const DefaultWhitelist = {
// Global attributes allowed on any supplied element below. // Global attributes allowed on any supplied element below.
@ -86,42 +86,42 @@ export const DefaultWhitelist = {
sup: [], sup: [],
strong: [], strong: [],
u: [], u: [],
ul: [] ul: [],
} };
export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
if (!unsafeHtml.length) { if (!unsafeHtml.length) {
return unsafeHtml return unsafeHtml;
} }
if (sanitizeFn && typeof sanitizeFn === 'function') { if (sanitizeFn && typeof sanitizeFn === 'function') {
return sanitizeFn(unsafeHtml) return sanitizeFn(unsafeHtml);
} }
const domParser = new window.DOMParser() const domParser = new window.DOMParser();
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html') const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
const whitelistKeys = Object.keys(whiteList) const whitelistKeys = Object.keys(whiteList);
const elements = [].concat(...createdDocument.body.querySelectorAll('*')) const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
for (let i = 0, len = elements.length; i < len; i++) { for (let i = 0, len = elements.length; i < len; i++) {
const el = elements[i] const el = elements[i];
const elName = el.nodeName.toLowerCase() const elName = el.nodeName.toLowerCase();
if (whitelistKeys.indexOf(elName) === -1) { if (whitelistKeys.indexOf(elName) === -1) {
el.parentNode.removeChild(el) el.parentNode.removeChild(el);
continue continue;
} }
const attributeList = [].concat(...el.attributes) const attributeList = [].concat(...el.attributes);
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []) const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
attributeList.forEach(attr => { attributeList.forEach((attr) => {
if (!allowedAttribute(attr, whitelistedAttributes)) { 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; font-weight: $alert-link-font-weight;
} }
// Dismissible alerts // Dismissible alerts
// //
// Expand the right padding and account for the close button's positioning. // Expand the right padding and account for the close button's positioning.
.alert-dismissible { .alert-dismissible {
padding-right: $close-font-size + $alert-padding-x * 2; padding-right: $alert-dismissible-padding-r;
// Adjust close link position // Adjust close link position
.close { .btn-close {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
padding: $alert-padding-y $alert-padding-x; padding: $alert-padding-y * 1.25 $alert-padding-x;
color: inherit;
} }
} }
// scss-docs-start alert-modifiers // scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert. // Generate contextual modifier classes for colorizing the alert.
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
.alert-#{$color} { .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 // scss-docs-end alert-modifiers

View File

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

View File

@ -52,7 +52,6 @@
transform: translateX(-100%); transform: translateX(-100%);
} }
// //
// Alternate transitions // Alternate transitions
// //
@ -79,7 +78,6 @@
} }
} }
// //
// Left/right controls for nav // Left/right controls for nav
// //
@ -111,11 +109,19 @@
} }
.carousel-control-prev { .carousel-control-prev {
left: 0; 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 { .carousel-control-next {
right: 0; 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 // Icons for within
@ -135,7 +141,6 @@
background-image: escape-svg($carousel-control-next-icon-bg); background-image: escape-svg($carousel-control-next-icon-bg);
} }
// Optional indicator pips // Optional indicator pips
// //
// Add an ordered list with the following class and add a list item for each // Add an ordered list with the following class and add a list item for each
@ -178,7 +183,6 @@
} }
} }
// Optional captions // Optional captions
// //
// //
@ -193,3 +197,20 @@
color: $carousel-caption-color; color: $carousel-caption-color;
text-align: center; 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 { // transparent background and border properties included for button version.
@include font-size($close-font-size); // iOS requires the button element instead of an anchor tag.
font-weight: $close-font-weight; // If you want the anchor version, it requires `href="#"`.
line-height: 1; // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
color: $close-color;
text-shadow: $close-text-shadow; .btn-close {
opacity: .5; 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 // Override <a>'s hover style
&:hover { &:hover {
color: $close-color; color: $btn-close-color;
text-decoration: none; text-decoration: none;
opacity: $btn-close-hover-opacity;
} }
&:hover,
&:focus { &:focus {
opacity: .75; outline: none;
box-shadow: $btn-close-focus-shadow;
opacity: $btn-close-focus-opacity;
} }
&:disabled, &:disabled,
&.disabled { &.disabled {
pointer-events: none; pointer-events: none;
user-select: none;
opacity: $btn-close-disabled-opacity;
} }
} }
// Additional properties for button version .btn-close-white {
// iOS requires the button element instead of an anchor tag. filter: $btn-close-white-filter;
// 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;
} }

View File

@ -21,7 +21,7 @@
z-index: $zindex-dropdown; z-index: $zindex-dropdown;
display: none; // none by default, but block on "open" of the menu display: none; // none by default, but block on "open" of the menu
min-width: $dropdown-min-width; 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 margin: $dropdown-spacer 0 0; // override default ul
@include font-size($dropdown-font-size); @include font-size($dropdown-font-size);
color: $dropdown-color; color: $dropdown-color;
@ -104,10 +104,10 @@
// When enabled Popper.js, reset basic dropdown position // When enabled Popper.js, reset basic dropdown position
// stylelint-disable-next-line no-duplicate-selectors // stylelint-disable-next-line no-duplicate-selectors
.dropdown-menu { .dropdown-menu {
&[x-placement^="top"], &[x-placement^='top'],
&[x-placement^="right"], &[x-placement^='right'],
&[x-placement^="bottom"], &[x-placement^='bottom'],
&[x-placement^="left"] { &[x-placement^='left'] {
right: auto; right: auto;
bottom: auto; bottom: auto;
} }
@ -193,3 +193,44 @@
padding: $dropdown-item-padding-y $dropdown-item-padding-x; padding: $dropdown-item-padding-y $dropdown-item-padding-x;
color: $dropdown-link-color; 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 // See https://codepen.io/kevinweber/pen/dXWoRw
//
// Requires the use of quotes around data URIs.
@function escape-svg($string) { @function escape-svg($string) {
@if str-index($string, 'data:image/svg+xml') { @if str-index($string, 'data:image/svg+xml') {
@each $char, $encoded in $escaped-characters { @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; @return $max-ratio-color;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -14,11 +14,15 @@
.nav-link { .nav-link {
display: block; display: block;
padding: $nav-link-padding-y $nav-link-padding-x; 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); text-decoration: if($link-decoration == none, null, none);
@include transition($nav-link-transition); @include transition($nav-link-transition);
&:hover, &:hover,
&:focus { &:focus {
color: $nav-link-hover-color;
text-decoration: if($link-hover-decoration == underline, none, null); text-decoration: if($link-hover-decoration == underline, none, null);
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -40,7 +40,7 @@
// Highlight border color between thead, tbody and tfoot. // Highlight border color between thead, tbody and tfoot.
> :not(:last-child) > :last-child > * { > :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 { .toast {
max-width: $toast-max-width; max-width: $toast-max-width;
overflow: hidden; // cheap rounded corners on nested items
@include font-size($toast-font-size); @include font-size($toast-font-size);
color: $toast-color; color: $toast-color;
background-color: $toast-background-color; background-color: $toast-background-color;
background-clip: padding-box; background-clip: padding-box;
border: $toast-border-width solid $toast-border-color; border: $toast-border-width solid $toast-border-color;
box-shadow: $toast-box-shadow; box-shadow: $toast-box-shadow;
backdrop-filter: blur(10px);
opacity: 0; opacity: 0;
@include border-radius($toast-border-radius); @include border-radius($toast-border-radius);
@ -37,6 +35,12 @@
background-color: $toast-header-background-color; background-color: $toast-header-background-color;
background-clip: padding-box; background-clip: padding-box;
border-bottom: $toast-border-width solid $toast-header-border-color; 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 { .toast-body {

View File

@ -23,7 +23,7 @@ $utilities: map-merge(
print: true, print: true,
property: display, property: display,
class: d, 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': ( 'shadow': (
property: box-shadow, property: box-shadow,
@ -39,6 +39,31 @@ $utilities: map-merge(
property: position, property: position,
values: static relative absolute fixed sticky, 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': ( 'border': (
property: border, property: border,
values: ( values: (
@ -85,6 +110,11 @@ $utilities: map-merge(
) )
), ),
), ),
'border-width': (
property: border-width,
class: border,
values: $border-widths,
),
// Sizing utilities // Sizing utilities
'width': 'width':
( (

View File

@ -38,9 +38,9 @@ $pink: #d63384 !default;
$red: #dc3545 !default; $red: #dc3545 !default;
$orange: #fd7e14 !default; $orange: #fd7e14 !default;
$yellow: #ffc107 !default; $yellow: #ffc107 !default;
$green: #28a745 !default; $green: #198754 !default;
$teal: #20c997 !default; $teal: #20c997 !default;
$cyan: #17a2b8 !default; $cyan: #0dcaf0 !default;
// scss-docs-start colors-map // scss-docs-start colors-map
$colors: ( $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. // 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 // 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. // 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; $color-contrast-light: $white !default;
// fusv-disable // fusv-disable
@ -246,6 +246,16 @@ $spacers: (
$negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default; $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 // Body
// //
// Settings for the `<body>` element. // Settings for the `<body>` element.
@ -321,7 +331,7 @@ $gutters: $spacers !default;
// Container padding // Container padding
$container-padding-x: 1rem !default; $container-padding-x: $grid-gutter-width !default;
// Components // Components
// //
@ -333,6 +343,14 @@ $border-color: $gray-300 !default;
$border-radius: 0.25rem !default; $border-radius: 0.25rem !default;
$border-radius-sm: 0.2rem !default; $border-radius-sm: 0.2rem !default;
$border-radius-lg: 0.3rem !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; $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-fade: opacity 0.15s linear !default;
$transition-collapse: height 0.35s ease !default; $transition-collapse: height 0.35s ease !default;
// scss-docs-start embed-responsive-aspect-ratios // stylelint-disable function-disallowed-list
$embed-responsive-aspect-ratios: ( // scss-docs-start aspect-ratios
'21by9': ( $aspect-ratios: (
x: 21, '1x1': 100%,
y: 9, '4x3': calc(3 / 4 * 100%),
), '16x9': calc(9 / 16 * 100%),
'16by9': ( '21x9': calc(9 / 21 * 100%),
x: 16,
y: 9,
),
'4by3': (
x: 4,
y: 3,
),
'1by1': (
x: 1,
y: 1,
),
) !default; ) !default;
// scss-docs-end embed-responsive-aspect-ratios // scss-docs-end aspect-ratios
// stylelint-enable function-disallowed-list
// Typography // Typography
// //
@ -484,6 +492,8 @@ $table-cell-vertical-align: top !default;
$table-color: $body-color !default; $table-color: $body-color !default;
$table-bg: transparent !default; $table-bg: transparent !default;
$table-th-font-weight: null !default;
$table-striped-color: $table-color !default; $table-striped-color: $table-color !default;
$table-striped-bg-factor: 0.05 !default; $table-striped-bg-factor: 0.05 !default;
$table-striped-bg: rgba($black, $table-striped-bg-factor) !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-striped-order: odd !default;
$table-group-seperator-color: currentColor !default; $table-group-separator-color: currentColor !default;
$table-caption-color: $text-muted !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-font-size: $font-size-base !default;
$input-btn-line-height: $line-height-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-opacity: 0.25 !default;
$input-btn-focus-color: rgba($component-active-bg, $input-btn-focus-color-opacity) !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; $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; $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-min-height: $font-size-base * $line-height-base !default;
$form-check-padding-left: $form-check-input-width + 0.5em !default; $form-check-padding-left: $form-check-input-width + 0.5em !default;
$form-check-margin-bottom: 0.125rem !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; $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-color: $input-color !default;
$input-group-addon-bg: $gray-200 !default; $input-group-addon-bg: $gray-200 !default;
$input-group-addon-border-color: $input-border-color !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-y: 0.5rem !default;
$nav-link-padding-x: 1rem !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, $nav-link-transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out !default; border-color 0.15s ease-in-out !default;
$nav-link-disabled-color: $gray-600 !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 menu container and contents.
$dropdown-min-width: 10rem !default; $dropdown-min-width: 10rem !default;
$dropdown-padding-x: 0 !default;
$dropdown-padding-y: 0.5rem !default; $dropdown-padding-y: 0.5rem !default;
$dropdown-spacer: 0.125rem !default; $dropdown-spacer: 0.125rem !default;
$dropdown-font-size: $font-size-base !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-radius: $border-radius !default;
$dropdown-border-width: $border-width !default; $dropdown-border-width: $border-width !default;
$dropdown-inner-border-radius: subtract($dropdown-border-radius, $dropdown-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-divider-margin-y: $spacer / 2 !default;
$dropdown-box-shadow: $box-shadow !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-color: $gray-600 !default;
$dropdown-header-padding: $dropdown-padding-y $dropdown-item-padding-x !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
$pagination-padding-y: 0.375rem !default; $pagination-padding-y: 0.375rem !default;
@ -952,6 +983,8 @@ $pagination-border-radius: $border-radius !default;
$pagination-margin-left: -$pagination-border-width !default; $pagination-margin-left: -$pagination-border-width !default;
$pagination-border-color: $gray-300 !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-box-shadow: $input-btn-focus-box-shadow !default;
$pagination-focus-outline: 0 !default; $pagination-focus-outline: 0 !default;
@ -967,6 +1000,9 @@ $pagination-disabled-color: $gray-600 !default;
$pagination-disabled-bg: $white !default; $pagination-disabled-bg: $white !default;
$pagination-disabled-border-color: $gray-300 !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 // Cards
$card-spacer-y: $spacer !default; $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-max-width: 350px !default;
$toast-padding-x: 0.75rem !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-font-size: 0.875rem !default;
$toast-color: null !default; $toast-color: null !default;
$toast-background-color: rgba($white, 0.85) !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-size: 0.75em !default;
$badge-font-weight: $font-weight-bold !default; $badge-font-weight: $font-weight-bold !default;
$badge-color: $white !default; $badge-color: $white !default;
$badge-padding-y: 0.25em !default; $badge-padding-y: 0.35em !default;
$badge-padding-x: 0.5em !default; $badge-padding-x: 0.65em !default;
$badge-border-radius: $border-radius !default; $badge-border-radius: $border-radius !default;
// Modals // Modals
@ -1124,6 +1160,8 @@ $alert-bg-level: -10 !default;
$alert-border-level: -9 !default; $alert-border-level: -9 !default;
$alert-color-level: 6 !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 bars
$progress-height: 1rem !default; $progress-height: 1rem !default;
@ -1212,14 +1250,18 @@ $carousel-caption-color: $white !default;
$carousel-caption-padding-y: 1.25rem !default; $carousel-caption-padding-y: 1.25rem !default;
$carousel-caption-spacer: 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-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 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-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-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-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 // Spinners
$spinner-width: 2rem !default; $spinner-width: 2rem !default;
@ -1233,10 +1275,18 @@ $spinner-border-width-sm: 0.2em !default;
// Close // Close
$close-font-size: $font-size-base * 1.5 !default; $btn-close-width: 1em !default;
$close-font-weight: $font-weight-bold !default; $btn-close-height: $btn-close-width !default;
$close-color: $black !default; $btn-close-padding-x: 0.25em !default;
$close-text-shadow: 0 1px 0 $white !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 // 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 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc. * Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
@ -32,7 +32,8 @@ $utilities: map-get-multiple(
'flex', 'flex',
'flex-direction', 'flex-direction',
'flex-grow', 'flex-grow',
'flex-shrink' 'flex-wrap', 'flex-shrink',
'flex-wrap',
'justify-content', 'justify-content',
'align-items', 'align-items',
'align-content', '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 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc. * Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * 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 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc. * Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * 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 The Bootstrap Authors
* Copyright 2011-2020 Twitter, Inc. * Copyright 2011-2020 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)

View File

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

View File

@ -53,7 +53,6 @@
} }
} }
// Textual addons // Textual addons
// //
// Serves as a catch-all element for any text or radio/checkbox input you wish // Serves as a catch-all element for any text or radio/checkbox input you wish
@ -62,9 +61,9 @@
.input-group-text { .input-group-text {
display: flex; display: flex;
align-items: center; 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 @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; line-height: $input-line-height;
color: $input-group-addon-color; color: $input-group-addon-color;
text-align: center; text-align: center;
@ -74,7 +73,6 @@
@include border-radius($input-border-radius); @include border-radius($input-border-radius);
} }
// Sizing // Sizing
// //
// Remix the default form control sizing classes into new ones for easier // 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; padding-right: $form-select-padding-x + $form-select-indicator-padding;
} }
// Rounded corners // Rounded corners
// //
// These rulesets must come after the sizing ones to properly override sm and lg // 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 { @if $emphasized-link-hover-darken-percentage != 0 {
&:hover, &:hover,
&:focus { &: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 // Single side border-radius
// Helper function to replace negative values with 0 // Helper function to replace negative values with 0
@ -17,59 +17,58 @@
@mixin border-radius($radius: $border-radius, $fallback-border-radius: false) { @mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
@if $enable-rounded { @if $enable-rounded {
border-radius: valid-radius($radius); border-radius: valid-radius($radius);
} } @else if $fallback-border-radius != false {
@else if $fallback-border-radius != false {
border-radius: $fallback-border-radius; border-radius: $fallback-border-radius;
} }
} }
@mixin border-top-radius($radius) { @mixin border-top-radius($radius: $border-radius) {
@if $enable-rounded { @if $enable-rounded {
border-top-left-radius: valid-radius($radius); border-top-left-radius: valid-radius($radius);
border-top-right-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 { @if $enable-rounded {
border-top-right-radius: valid-radius($radius); border-top-right-radius: valid-radius($radius);
border-bottom-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 { @if $enable-rounded {
border-bottom-right-radius: valid-radius($radius); border-bottom-right-radius: valid-radius($radius);
border-bottom-left-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 { @if $enable-rounded {
border-top-left-radius: valid-radius($radius); border-top-left-radius: valid-radius($radius);
border-bottom-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 { @if $enable-rounded {
border-top-left-radius: valid-radius($radius); border-top-left-radius: valid-radius($radius);
} }
} }
@mixin border-top-right-radius($radius) { @mixin border-top-right-radius($radius: $border-radius) {
@if $enable-rounded { @if $enable-rounded {
border-top-right-radius: valid-radius($radius); border-top-right-radius: valid-radius($radius);
} }
} }
@mixin border-bottom-right-radius($radius) { @mixin border-bottom-right-radius($radius: $border-radius) {
@if $enable-rounded { @if $enable-rounded {
border-bottom-right-radius: valid-radius($radius); border-bottom-right-radius: valid-radius($radius);
} }
} }
@mixin border-bottom-left-radius($radius) { @mixin border-bottom-left-radius($radius: $border-radius) {
@if $enable-rounded { @if $enable-rounded {
border-bottom-left-radius: valid-radius($radius); border-bottom-left-radius: valid-radius($radius);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,11 @@
// stylelint-disable declaration-no-important // 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/ // See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
@mixin sr-only { @mixin visually-hidden() {
position: absolute !important; position: absolute !important;
width: 1px !important; width: 1px !important;
height: 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 // 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) { &: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 { .dropdown-item {
padding: $dropdown-padding-y $dropdown-padding-x; padding: $dropdown-item-padding-y $dropdown-item-padding-x;
color: $dropdown-color; color: $dropdown-color;
border-radius: 0; border-radius: 0;

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