bootstrap 5.1.3 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/javascripts/bootstrap/alert.js +11 -146
- data/assets/javascripts/bootstrap/base-component.js +37 -120
- data/assets/javascripts/bootstrap/button.js +10 -74
- data/assets/javascripts/bootstrap/carousel.js +213 -485
- data/assets/javascripts/bootstrap/collapse.js +65 -249
- data/assets/javascripts/bootstrap/dom/data.js +3 -5
- data/assets/javascripts/bootstrap/dom/event-handler.js +94 -132
- data/assets/javascripts/bootstrap/dom/manipulator.js +23 -27
- data/assets/javascripts/bootstrap/dom/selector-engine.js +16 -58
- data/assets/javascripts/bootstrap/dropdown.js +101 -317
- data/assets/javascripts/bootstrap/modal.js +107 -752
- data/assets/javascripts/bootstrap/offcanvas.js +90 -659
- data/assets/javascripts/bootstrap/popover.js +36 -118
- data/assets/javascripts/bootstrap/scrollspy.js +179 -262
- data/assets/javascripts/bootstrap/tab.js +215 -214
- data/assets/javascripts/bootstrap/toast.js +28 -214
- data/assets/javascripts/bootstrap/tooltip.js +268 -611
- data/assets/javascripts/bootstrap/util/backdrop.js +165 -0
- data/assets/javascripts/bootstrap/util/component-functions.js +46 -0
- data/assets/javascripts/bootstrap/util/config.js +79 -0
- data/assets/javascripts/bootstrap/util/focustrap.js +129 -0
- data/assets/javascripts/bootstrap/util/index.js +350 -0
- data/assets/javascripts/bootstrap/util/sanitizer.js +122 -0
- data/assets/javascripts/bootstrap/util/scrollbar.js +138 -0
- data/assets/javascripts/bootstrap/util/swipe.js +155 -0
- data/assets/javascripts/bootstrap/util/template-factory.js +177 -0
- data/assets/javascripts/bootstrap-global-this-define.js +1 -1
- data/assets/javascripts/bootstrap-sprockets.js +10 -1
- data/assets/javascripts/bootstrap.js +2065 -1860
- data/assets/javascripts/bootstrap.min.js +3 -3
- data/assets/stylesheets/_bootstrap-grid.scss +3 -6
- data/assets/stylesheets/_bootstrap-reboot.scss +3 -7
- data/assets/stylesheets/_bootstrap.scss +4 -6
- data/assets/stylesheets/bootstrap/_accordion.scss +52 -24
- data/assets/stylesheets/bootstrap/_alert.scss +18 -4
- data/assets/stylesheets/bootstrap/_badge.scss +14 -5
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -10
- data/assets/stylesheets/bootstrap/_button-group.scss +3 -0
- data/assets/stylesheets/bootstrap/_buttons.scss +97 -22
- data/assets/stylesheets/bootstrap/_card.scss +55 -37
- data/assets/stylesheets/bootstrap/_close.scss +1 -1
- data/assets/stylesheets/bootstrap/_containers.scss +1 -1
- data/assets/stylesheets/bootstrap/_dropdown.scss +83 -75
- data/assets/stylesheets/bootstrap/_functions.scss +7 -7
- data/assets/stylesheets/bootstrap/_grid.scss +3 -3
- data/assets/stylesheets/bootstrap/_helpers.scss +1 -0
- data/assets/stylesheets/bootstrap/_list-group.scss +44 -27
- data/assets/stylesheets/bootstrap/_maps.scss +54 -0
- data/assets/stylesheets/bootstrap/_modal.scss +71 -43
- data/assets/stylesheets/bootstrap/_nav.scss +53 -20
- data/assets/stylesheets/bootstrap/_navbar.scss +91 -150
- data/assets/stylesheets/bootstrap/_offcanvas.scss +119 -59
- data/assets/stylesheets/bootstrap/_pagination.scss +66 -21
- data/assets/stylesheets/bootstrap/_placeholders.scss +1 -1
- data/assets/stylesheets/bootstrap/_popover.scss +90 -52
- data/assets/stylesheets/bootstrap/_progress.scss +20 -9
- data/assets/stylesheets/bootstrap/_reboot.scss +25 -40
- data/assets/stylesheets/bootstrap/_root.scss +40 -21
- data/assets/stylesheets/bootstrap/_spinners.scss +38 -22
- data/assets/stylesheets/bootstrap/_tables.scss +32 -23
- data/assets/stylesheets/bootstrap/_toasts.scss +35 -16
- data/assets/stylesheets/bootstrap/_tooltip.scss +61 -56
- data/assets/stylesheets/bootstrap/_type.scss +2 -0
- data/assets/stylesheets/bootstrap/_utilities.scss +43 -26
- data/assets/stylesheets/bootstrap/_variables.scss +113 -121
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +3 -6
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +14 -3
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +28 -5
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +12 -37
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +0 -1
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +15 -7
- data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +10 -0
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +2 -2
- data/assets/stylesheets/bootstrap/helpers/_position.scss +7 -1
- data/assets/stylesheets/bootstrap/helpers/_ratio.scss +2 -2
- data/assets/stylesheets/bootstrap/helpers/_vr.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +7 -3
- data/assets/stylesheets/bootstrap/mixins/_banner.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +8 -8
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +32 -95
- data/assets/stylesheets/bootstrap/mixins/_container.scss +4 -2
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +12 -12
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +4 -25
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +12 -9
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +12 -4
- data/bootstrap.gemspec +1 -1
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +9 -4
- metadata +16 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 49075220be31b7b440684f6a22eb7ea6fcbff5860c940589c46aecbc2d20f6c1
|
|
4
|
+
data.tar.gz: 93841930e2afddf90c28b58a4273ea89aafd543fad464d329e7fcc255cecf479
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9b0c4f2b4b41fd480484a246866b26762e9f5850b63b1c60eb12b1e7c180f70703254bf07aae93390a4b38a63db25f670fbf46eca0fec2f731a829825340459
|
|
7
|
+
data.tar.gz: 6737dd3980d44c004a05f1910aeec8f7b8e068235db3e2371622744e9e8d1a617e8c1a91d138ee86225cc521102d49c2d6cf28d02bf366c11d3a0e3f6c56ccfd
|
data/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap alert.js v5.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Bootstrap alert.js v5.2.0 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
|
4
4
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
7
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler
|
|
8
|
-
typeof define === 'function' && define.amd ? define(['./dom/event-handler', './base-component'], factory) :
|
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.EventHandler, global.
|
|
10
|
-
})(this, (function (EventHandler, BaseComponent) { 'use strict';
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index'), require('./dom/event-handler'), require('./base-component'), require('./util/component-functions')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['./util/index', './dom/event-handler', './base-component', './util/component-functions'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Alert = factory(global.Index, global.EventHandler, global.BaseComponent, global.ComponentFunctions));
|
|
10
|
+
})(this, (function (index, EventHandler, BaseComponent, componentFunctions) { 'use strict';
|
|
11
11
|
|
|
12
12
|
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
13
13
|
|
|
@@ -16,140 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* --------------------------------------------------------------------------
|
|
19
|
-
* Bootstrap (v5.
|
|
20
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
21
|
-
* --------------------------------------------------------------------------
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const getSelector = element => {
|
|
25
|
-
let selector = element.getAttribute('data-bs-target');
|
|
26
|
-
|
|
27
|
-
if (!selector || selector === '#') {
|
|
28
|
-
let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes,
|
|
29
|
-
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
|
30
|
-
// `document.querySelector` will rightfully complain it is invalid.
|
|
31
|
-
// See https://github.com/twbs/bootstrap/issues/32273
|
|
32
|
-
|
|
33
|
-
if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) {
|
|
34
|
-
return null;
|
|
35
|
-
} // Just in case some CMS puts out a full URL with the anchor appended
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
|
39
|
-
hrefAttr = `#${hrefAttr.split('#')[1]}`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return selector;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const getElementFromSelector = element => {
|
|
49
|
-
const selector = getSelector(element);
|
|
50
|
-
return selector ? document.querySelector(selector) : null;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const isDisabled = element => {
|
|
54
|
-
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (element.classList.contains('disabled')) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (typeof element.disabled !== 'undefined') {
|
|
63
|
-
return element.disabled;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const getjQuery = () => {
|
|
70
|
-
const {
|
|
71
|
-
jQuery
|
|
72
|
-
} = window;
|
|
73
|
-
|
|
74
|
-
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
|
75
|
-
return jQuery;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return null;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const DOMContentLoadedCallbacks = [];
|
|
82
|
-
|
|
83
|
-
const onDOMContentLoaded = callback => {
|
|
84
|
-
if (document.readyState === 'loading') {
|
|
85
|
-
// add listener on the first call when the document is in loading state
|
|
86
|
-
if (!DOMContentLoadedCallbacks.length) {
|
|
87
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
88
|
-
DOMContentLoadedCallbacks.forEach(callback => callback());
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
DOMContentLoadedCallbacks.push(callback);
|
|
93
|
-
} else {
|
|
94
|
-
callback();
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const defineJQueryPlugin = plugin => {
|
|
99
|
-
onDOMContentLoaded(() => {
|
|
100
|
-
const $ = getjQuery();
|
|
101
|
-
/* istanbul ignore if */
|
|
102
|
-
|
|
103
|
-
if ($) {
|
|
104
|
-
const name = plugin.NAME;
|
|
105
|
-
const JQUERY_NO_CONFLICT = $.fn[name];
|
|
106
|
-
$.fn[name] = plugin.jQueryInterface;
|
|
107
|
-
$.fn[name].Constructor = plugin;
|
|
108
|
-
|
|
109
|
-
$.fn[name].noConflict = () => {
|
|
110
|
-
$.fn[name] = JQUERY_NO_CONFLICT;
|
|
111
|
-
return plugin.jQueryInterface;
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* --------------------------------------------------------------------------
|
|
119
|
-
* Bootstrap (v5.1.3): util/component-functions.js
|
|
120
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
121
|
-
* --------------------------------------------------------------------------
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
const enableDismissTrigger = (component, method = 'hide') => {
|
|
125
|
-
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
|
126
|
-
const name = component.NAME;
|
|
127
|
-
EventHandler__default.default.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
|
|
128
|
-
if (['A', 'AREA'].includes(this.tagName)) {
|
|
129
|
-
event.preventDefault();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (isDisabled(this)) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
|
137
|
-
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
|
138
|
-
|
|
139
|
-
instance[method]();
|
|
140
|
-
});
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* --------------------------------------------------------------------------
|
|
145
|
-
* Bootstrap (v5.1.3): alert.js
|
|
19
|
+
* Bootstrap (v5.2.0): alert.js
|
|
146
20
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
147
21
|
* --------------------------------------------------------------------------
|
|
148
22
|
*/
|
|
149
23
|
/**
|
|
150
|
-
* ------------------------------------------------------------------------
|
|
151
24
|
* Constants
|
|
152
|
-
* ------------------------------------------------------------------------
|
|
153
25
|
*/
|
|
154
26
|
|
|
155
27
|
const NAME = 'alert';
|
|
@@ -160,9 +32,7 @@
|
|
|
160
32
|
const CLASS_NAME_FADE = 'fade';
|
|
161
33
|
const CLASS_NAME_SHOW = 'show';
|
|
162
34
|
/**
|
|
163
|
-
*
|
|
164
|
-
* Class Definition
|
|
165
|
-
* ------------------------------------------------------------------------
|
|
35
|
+
* Class definition
|
|
166
36
|
*/
|
|
167
37
|
|
|
168
38
|
class Alert extends BaseComponent__default.default {
|
|
@@ -213,21 +83,16 @@
|
|
|
213
83
|
|
|
214
84
|
}
|
|
215
85
|
/**
|
|
216
|
-
*
|
|
217
|
-
* Data Api implementation
|
|
218
|
-
* ------------------------------------------------------------------------
|
|
86
|
+
* Data API implementation
|
|
219
87
|
*/
|
|
220
88
|
|
|
221
89
|
|
|
222
|
-
enableDismissTrigger(Alert, 'close');
|
|
90
|
+
componentFunctions.enableDismissTrigger(Alert, 'close');
|
|
223
91
|
/**
|
|
224
|
-
* ------------------------------------------------------------------------
|
|
225
92
|
* jQuery
|
|
226
|
-
* ------------------------------------------------------------------------
|
|
227
|
-
* add .Alert to jQuery only if jQuery is present
|
|
228
93
|
*/
|
|
229
94
|
|
|
230
|
-
defineJQueryPlugin(Alert);
|
|
95
|
+
index.defineJQueryPlugin(Alert);
|
|
231
96
|
|
|
232
97
|
return Alert;
|
|
233
98
|
|
|
@@ -1,158 +1,75 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap base-component.js v5.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Bootstrap base-component.js v5.2.0 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
|
4
4
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
7
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data
|
|
8
|
-
typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler'], factory) :
|
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.
|
|
10
|
-
})(this, (function (Data, EventHandler) { 'use strict';
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data'), require('./util/index'), require('./dom/event-handler'), require('./util/config')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['./dom/data', './util/index', './dom/event-handler', './util/config'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BaseComponent = factory(global.Data, global.Index, global.EventHandler, global.Config));
|
|
10
|
+
})(this, (function (Data, index, EventHandler, Config) { 'use strict';
|
|
11
11
|
|
|
12
12
|
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
13
13
|
|
|
14
14
|
const Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
|
15
15
|
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
|
16
|
+
const Config__default = /*#__PURE__*/_interopDefaultLegacy(Config);
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* --------------------------------------------------------------------------
|
|
19
|
-
* Bootstrap (v5.
|
|
20
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
21
|
-
* --------------------------------------------------------------------------
|
|
22
|
-
*/
|
|
23
|
-
const MILLISECONDS_MULTIPLIER = 1000;
|
|
24
|
-
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
|
25
|
-
|
|
26
|
-
const getTransitionDurationFromElement = element => {
|
|
27
|
-
if (!element) {
|
|
28
|
-
return 0;
|
|
29
|
-
} // Get transition-duration of the element
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let {
|
|
33
|
-
transitionDuration,
|
|
34
|
-
transitionDelay
|
|
35
|
-
} = window.getComputedStyle(element);
|
|
36
|
-
const floatTransitionDuration = Number.parseFloat(transitionDuration);
|
|
37
|
-
const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
|
|
38
|
-
|
|
39
|
-
if (!floatTransitionDuration && !floatTransitionDelay) {
|
|
40
|
-
return 0;
|
|
41
|
-
} // If multiple durations are defined, take the first
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
transitionDuration = transitionDuration.split(',')[0];
|
|
45
|
-
transitionDelay = transitionDelay.split(',')[0];
|
|
46
|
-
return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const triggerTransitionEnd = element => {
|
|
50
|
-
element.dispatchEvent(new Event(TRANSITION_END));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const isElement = obj => {
|
|
54
|
-
if (!obj || typeof obj !== 'object') {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (typeof obj.jquery !== 'undefined') {
|
|
59
|
-
obj = obj[0];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return typeof obj.nodeType !== 'undefined';
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const getElement = obj => {
|
|
66
|
-
if (isElement(obj)) {
|
|
67
|
-
// it's a jQuery object or a node element
|
|
68
|
-
return obj.jquery ? obj[0] : obj;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (typeof obj === 'string' && obj.length > 0) {
|
|
72
|
-
return document.querySelector(obj);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return null;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const execute = callback => {
|
|
79
|
-
if (typeof callback === 'function') {
|
|
80
|
-
callback();
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
|
|
85
|
-
if (!waitForTransition) {
|
|
86
|
-
execute(callback);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const durationPadding = 5;
|
|
91
|
-
const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
|
|
92
|
-
let called = false;
|
|
93
|
-
|
|
94
|
-
const handler = ({
|
|
95
|
-
target
|
|
96
|
-
}) => {
|
|
97
|
-
if (target !== transitionElement) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
called = true;
|
|
102
|
-
transitionElement.removeEventListener(TRANSITION_END, handler);
|
|
103
|
-
execute(callback);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
transitionElement.addEventListener(TRANSITION_END, handler);
|
|
107
|
-
setTimeout(() => {
|
|
108
|
-
if (!called) {
|
|
109
|
-
triggerTransitionEnd(transitionElement);
|
|
110
|
-
}
|
|
111
|
-
}, emulatedDuration);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* --------------------------------------------------------------------------
|
|
116
|
-
* Bootstrap (v5.1.3): base-component.js
|
|
20
|
+
* Bootstrap (v5.2.0): base-component.js
|
|
117
21
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
118
22
|
* --------------------------------------------------------------------------
|
|
119
23
|
*/
|
|
120
24
|
/**
|
|
121
|
-
* ------------------------------------------------------------------------
|
|
122
25
|
* Constants
|
|
123
|
-
* ------------------------------------------------------------------------
|
|
124
26
|
*/
|
|
125
27
|
|
|
126
|
-
const VERSION = '5.
|
|
28
|
+
const VERSION = '5.2.0';
|
|
29
|
+
/**
|
|
30
|
+
* Class definition
|
|
31
|
+
*/
|
|
127
32
|
|
|
128
|
-
class BaseComponent {
|
|
129
|
-
constructor(element) {
|
|
130
|
-
|
|
33
|
+
class BaseComponent extends Config__default.default {
|
|
34
|
+
constructor(element, config) {
|
|
35
|
+
super();
|
|
36
|
+
element = index.getElement(element);
|
|
131
37
|
|
|
132
38
|
if (!element) {
|
|
133
39
|
return;
|
|
134
40
|
}
|
|
135
41
|
|
|
136
42
|
this._element = element;
|
|
43
|
+
this._config = this._getConfig(config);
|
|
137
44
|
Data__default.default.set(this._element, this.constructor.DATA_KEY, this);
|
|
138
|
-
}
|
|
45
|
+
} // Public
|
|
46
|
+
|
|
139
47
|
|
|
140
48
|
dispose() {
|
|
141
49
|
Data__default.default.remove(this._element, this.constructor.DATA_KEY);
|
|
142
50
|
EventHandler__default.default.off(this._element, this.constructor.EVENT_KEY);
|
|
143
|
-
|
|
51
|
+
|
|
52
|
+
for (const propertyName of Object.getOwnPropertyNames(this)) {
|
|
144
53
|
this[propertyName] = null;
|
|
145
|
-
}
|
|
54
|
+
}
|
|
146
55
|
}
|
|
147
56
|
|
|
148
57
|
_queueCallback(callback, element, isAnimated = true) {
|
|
149
|
-
executeAfterTransition(callback, element, isAnimated);
|
|
58
|
+
index.executeAfterTransition(callback, element, isAnimated);
|
|
150
59
|
}
|
|
151
|
-
|
|
60
|
+
|
|
61
|
+
_getConfig(config) {
|
|
62
|
+
config = this._mergeConfigObj(config, this._element);
|
|
63
|
+
config = this._configAfterMerge(config);
|
|
64
|
+
|
|
65
|
+
this._typeCheckConfig(config);
|
|
66
|
+
|
|
67
|
+
return config;
|
|
68
|
+
} // Static
|
|
152
69
|
|
|
153
70
|
|
|
154
71
|
static getInstance(element) {
|
|
155
|
-
return Data__default.default.get(getElement(element), this.DATA_KEY);
|
|
72
|
+
return Data__default.default.get(index.getElement(element), this.DATA_KEY);
|
|
156
73
|
}
|
|
157
74
|
|
|
158
75
|
static getOrCreateInstance(element, config = {}) {
|
|
@@ -163,10 +80,6 @@
|
|
|
163
80
|
return VERSION;
|
|
164
81
|
}
|
|
165
82
|
|
|
166
|
-
static get NAME() {
|
|
167
|
-
throw new Error('You have to implement the static method "NAME", for each component!');
|
|
168
|
-
}
|
|
169
|
-
|
|
170
83
|
static get DATA_KEY() {
|
|
171
84
|
return `bs.${this.NAME}`;
|
|
172
85
|
}
|
|
@@ -175,6 +88,10 @@
|
|
|
175
88
|
return `.${this.DATA_KEY}`;
|
|
176
89
|
}
|
|
177
90
|
|
|
91
|
+
static eventName(name) {
|
|
92
|
+
return `${name}${this.EVENT_KEY}`;
|
|
93
|
+
}
|
|
94
|
+
|
|
178
95
|
}
|
|
179
96
|
|
|
180
97
|
return BaseComponent;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap button.js v5.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Bootstrap button.js v5.2.0 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
|
4
4
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
7
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler
|
|
8
|
-
typeof define === 'function' && define.amd ? define(['./dom/event-handler', './base-component'], factory) :
|
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.EventHandler, global.
|
|
10
|
-
})(this, (function (EventHandler, BaseComponent) { 'use strict';
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./util/index'), require('./dom/event-handler'), require('./base-component')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['./util/index', './dom/event-handler', './base-component'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.Index, global.EventHandler, global.BaseComponent));
|
|
10
|
+
})(this, (function (index, EventHandler, BaseComponent) { 'use strict';
|
|
11
11
|
|
|
12
12
|
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
13
13
|
|
|
@@ -16,69 +16,12 @@
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* --------------------------------------------------------------------------
|
|
19
|
-
* Bootstrap (v5.
|
|
20
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
21
|
-
* --------------------------------------------------------------------------
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const getjQuery = () => {
|
|
25
|
-
const {
|
|
26
|
-
jQuery
|
|
27
|
-
} = window;
|
|
28
|
-
|
|
29
|
-
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
|
30
|
-
return jQuery;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return null;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const DOMContentLoadedCallbacks = [];
|
|
37
|
-
|
|
38
|
-
const onDOMContentLoaded = callback => {
|
|
39
|
-
if (document.readyState === 'loading') {
|
|
40
|
-
// add listener on the first call when the document is in loading state
|
|
41
|
-
if (!DOMContentLoadedCallbacks.length) {
|
|
42
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
43
|
-
DOMContentLoadedCallbacks.forEach(callback => callback());
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
DOMContentLoadedCallbacks.push(callback);
|
|
48
|
-
} else {
|
|
49
|
-
callback();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const defineJQueryPlugin = plugin => {
|
|
54
|
-
onDOMContentLoaded(() => {
|
|
55
|
-
const $ = getjQuery();
|
|
56
|
-
/* istanbul ignore if */
|
|
57
|
-
|
|
58
|
-
if ($) {
|
|
59
|
-
const name = plugin.NAME;
|
|
60
|
-
const JQUERY_NO_CONFLICT = $.fn[name];
|
|
61
|
-
$.fn[name] = plugin.jQueryInterface;
|
|
62
|
-
$.fn[name].Constructor = plugin;
|
|
63
|
-
|
|
64
|
-
$.fn[name].noConflict = () => {
|
|
65
|
-
$.fn[name] = JQUERY_NO_CONFLICT;
|
|
66
|
-
return plugin.jQueryInterface;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* --------------------------------------------------------------------------
|
|
74
|
-
* Bootstrap (v5.1.3): button.js
|
|
19
|
+
* Bootstrap (v5.2.0): button.js
|
|
75
20
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
76
21
|
* --------------------------------------------------------------------------
|
|
77
22
|
*/
|
|
78
23
|
/**
|
|
79
|
-
* ------------------------------------------------------------------------
|
|
80
24
|
* Constants
|
|
81
|
-
* ------------------------------------------------------------------------
|
|
82
25
|
*/
|
|
83
26
|
|
|
84
27
|
const NAME = 'button';
|
|
@@ -89,9 +32,7 @@
|
|
|
89
32
|
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
|
|
90
33
|
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
|
91
34
|
/**
|
|
92
|
-
*
|
|
93
|
-
* Class Definition
|
|
94
|
-
* ------------------------------------------------------------------------
|
|
35
|
+
* Class definition
|
|
95
36
|
*/
|
|
96
37
|
|
|
97
38
|
class Button extends BaseComponent__default.default {
|
|
@@ -119,9 +60,7 @@
|
|
|
119
60
|
|
|
120
61
|
}
|
|
121
62
|
/**
|
|
122
|
-
*
|
|
123
|
-
* Data Api implementation
|
|
124
|
-
* ------------------------------------------------------------------------
|
|
63
|
+
* Data API implementation
|
|
125
64
|
*/
|
|
126
65
|
|
|
127
66
|
|
|
@@ -132,13 +71,10 @@
|
|
|
132
71
|
data.toggle();
|
|
133
72
|
});
|
|
134
73
|
/**
|
|
135
|
-
* ------------------------------------------------------------------------
|
|
136
74
|
* jQuery
|
|
137
|
-
* ------------------------------------------------------------------------
|
|
138
|
-
* add .Button to jQuery only if jQuery is present
|
|
139
75
|
*/
|
|
140
76
|
|
|
141
|
-
defineJQueryPlugin(Button);
|
|
77
|
+
index.defineJQueryPlugin(Button);
|
|
142
78
|
|
|
143
79
|
return Button;
|
|
144
80
|
|