bootstrap 5.1.3 → 5.3.5
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/.github/workflows/ci.yml +61 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +1 -0
- data/README.md +35 -14
- data/Rakefile +16 -5
- data/assets/javascripts/bootstrap/alert.js +22 -167
- data/assets/javascripts/bootstrap/base-component.js +34 -133
- data/assets/javascripts/bootstrap/button.js +19 -86
- data/assets/javascripts/bootstrap/carousel.js +209 -564
- data/assets/javascripts/bootstrap/collapse.js +78 -324
- data/assets/javascripts/bootstrap/dom/data.js +8 -14
- data/assets/javascripts/bootstrap/dom/event-handler.js +89 -174
- data/assets/javascripts/bootstrap/dom/manipulator.js +22 -39
- data/assets/javascripts/bootstrap/dom/selector-engine.js +47 -71
- data/assets/javascripts/bootstrap/dropdown.js +135 -420
- data/assets/javascripts/bootstrap/modal.js +115 -837
- data/assets/javascripts/bootstrap/offcanvas.js +93 -714
- data/assets/javascripts/bootstrap/popover.js +42 -130
- data/assets/javascripts/bootstrap/scrollspy.js +180 -296
- data/assets/javascripts/bootstrap/tab.js +197 -245
- data/assets/javascripts/bootstrap/toast.js +52 -276
- data/assets/javascripts/bootstrap/tooltip.js +283 -744
- data/assets/javascripts/bootstrap/util/backdrop.js +138 -0
- data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
- data/assets/javascripts/bootstrap/util/config.js +67 -0
- data/assets/javascripts/bootstrap/util/focustrap.js +112 -0
- data/assets/javascripts/bootstrap/util/index.js +280 -0
- data/assets/javascripts/bootstrap/util/sanitizer.js +113 -0
- data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
- data/assets/javascripts/bootstrap/util/swipe.js +134 -0
- data/assets/javascripts/bootstrap/util/template-factory.js +150 -0
- data/assets/javascripts/bootstrap-global-this-define.js +1 -1
- data/assets/javascripts/bootstrap-sprockets.js +15 -6
- data/assets/javascripts/bootstrap.js +2278 -2831
- data/assets/javascripts/bootstrap.min.js +3 -3
- data/assets/stylesheets/_bootstrap-grid.scss +4 -9
- data/assets/stylesheets/_bootstrap-reboot.scss +4 -7
- data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
- data/assets/stylesheets/_bootstrap.scss +5 -6
- data/assets/stylesheets/bootstrap/_accordion.scss +68 -33
- data/assets/stylesheets/bootstrap/_alert.scss +25 -14
- data/assets/stylesheets/bootstrap/_badge.scss +14 -5
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -10
- data/assets/stylesheets/bootstrap/_button-group.scss +12 -4
- data/assets/stylesheets/bootstrap/_buttons.scss +133 -28
- data/assets/stylesheets/bootstrap/_card.scss +61 -39
- data/assets/stylesheets/bootstrap/_carousel.scss +22 -25
- data/assets/stylesheets/bootstrap/_close.scss +36 -10
- data/assets/stylesheets/bootstrap/_containers.scss +1 -1
- data/assets/stylesheets/bootstrap/_dropdown.scss +86 -76
- data/assets/stylesheets/bootstrap/_functions.scss +10 -10
- data/assets/stylesheets/bootstrap/_grid.scss +9 -3
- data/assets/stylesheets/bootstrap/_helpers.scss +3 -0
- data/assets/stylesheets/bootstrap/_list-group.scss +81 -56
- data/assets/stylesheets/bootstrap/_maps.scss +174 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +1 -2
- data/assets/stylesheets/bootstrap/_modal.scss +76 -45
- data/assets/stylesheets/bootstrap/_nav.scss +87 -29
- data/assets/stylesheets/bootstrap/_navbar.scss +102 -148
- data/assets/stylesheets/bootstrap/_offcanvas.scss +125 -61
- 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 +31 -11
- data/assets/stylesheets/bootstrap/_reboot.scss +32 -46
- data/assets/stylesheets/bootstrap/_root.scss +155 -22
- data/assets/stylesheets/bootstrap/_spinners.scss +38 -22
- data/assets/stylesheets/bootstrap/_tables.scss +40 -24
- data/assets/stylesheets/bootstrap/_toasts.scss +38 -16
- data/assets/stylesheets/bootstrap/_tooltip.scss +60 -56
- data/assets/stylesheets/bootstrap/_type.scss +3 -1
- data/assets/stylesheets/bootstrap/_utilities.scss +209 -33
- data/assets/stylesheets/bootstrap/_variables-dark.scss +102 -0
- data/assets/stylesheets/bootstrap/_variables.scss +415 -303
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +39 -5
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +51 -14
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +36 -41
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +3 -3
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +12 -4
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +20 -9
- data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +7 -0
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +20 -2
- data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
- data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
- 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 +2 -2
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -4
- data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +8 -8
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +32 -95
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +30 -25
- data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_container.scss +4 -2
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +38 -19
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +15 -15
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
- 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 +14 -6
- data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +6 -2
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +23 -29
- data/bootstrap.gemspec +3 -3
- data/lib/bootstrap/engine.rb +17 -2
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +10 -5
- data/tasks/updater/network.rb +2 -2
- data/tasks/updater/scss.rb +2 -2
- data/tasks/updater.rb +2 -2
- data/test/dummy_rails/config/application.rb +0 -2
- data/test/dummy_rails/public/favicon.ico +0 -0
- data/test/gemfiles/rails_4_2.gemfile +2 -1
- data/test/gemfiles/rails_5_0.gemfile +1 -2
- data/test/gemfiles/rails_5_1.gemfile +1 -2
- data/test/gemfiles/rails_5_2.gemfile +7 -0
- data/test/gemfiles/rails_6_0.gemfile +1 -1
- data/test/gemfiles/rails_6_1.gemfile +1 -1
- data/test/gemfiles/rails_7_0_dartsass.gemfile +7 -0
- data/test/gemfiles/rails_7_0_sassc.gemfile +7 -0
- data/test/rails_test.rb +0 -5
- data/test/test_helper.rb +3 -2
- metadata +49 -29
- data/.travis.yml +0 -32
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +0 -18
|
@@ -1,125 +1,101 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap selector-engine.js v5.
|
|
3
|
-
* Copyright 2011-
|
|
2
|
+
* Bootstrap selector-engine.js v5.3.5 (https://getbootstrap.com/)
|
|
3
|
+
* Copyright 2011-2025 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() :
|
|
8
|
-
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory());
|
|
10
|
-
})(this, (function () { 'use strict';
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../util/index.js')) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['../util/index'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.SelectorEngine = factory(global.Index));
|
|
10
|
+
})(this, (function (index_js) { 'use strict';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* --------------------------------------------------------------------------
|
|
14
|
-
* Bootstrap
|
|
14
|
+
* Bootstrap dom/selector-engine.js
|
|
15
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
16
16
|
* --------------------------------------------------------------------------
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const isVisible = element => {
|
|
32
|
-
if (!isElement(element) || element.getClientRects().length === 0) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const isDisabled = element => {
|
|
40
|
-
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (element.classList.contains('disabled')) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
19
|
+
const getSelector = element => {
|
|
20
|
+
let selector = element.getAttribute('data-bs-target');
|
|
21
|
+
if (!selector || selector === '#') {
|
|
22
|
+
let hrefAttribute = element.getAttribute('href');
|
|
23
|
+
|
|
24
|
+
// The only valid content that could double as a selector are IDs or classes,
|
|
25
|
+
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
|
26
|
+
// `document.querySelector` will rightfully complain it is invalid.
|
|
27
|
+
// See https://github.com/twbs/bootstrap/issues/32273
|
|
28
|
+
if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
47
31
|
|
|
48
|
-
|
|
49
|
-
|
|
32
|
+
// Just in case some CMS puts out a full URL with the anchor appended
|
|
33
|
+
if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
|
|
34
|
+
hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
|
|
35
|
+
}
|
|
36
|
+
selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
|
|
50
37
|
}
|
|
51
|
-
|
|
52
|
-
return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';
|
|
38
|
+
return selector ? selector.split(',').map(sel => index_js.parseSelector(sel)).join(',') : null;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* --------------------------------------------------------------------------
|
|
57
|
-
* Bootstrap (v5.1.3): dom/selector-engine.js
|
|
58
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
59
|
-
* --------------------------------------------------------------------------
|
|
60
|
-
*/
|
|
61
|
-
const NODE_TEXT = 3;
|
|
62
40
|
const SelectorEngine = {
|
|
63
41
|
find(selector, element = document.documentElement) {
|
|
64
42
|
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
65
43
|
},
|
|
66
|
-
|
|
67
44
|
findOne(selector, element = document.documentElement) {
|
|
68
45
|
return Element.prototype.querySelector.call(element, selector);
|
|
69
46
|
},
|
|
70
|
-
|
|
71
47
|
children(element, selector) {
|
|
72
48
|
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
73
49
|
},
|
|
74
|
-
|
|
75
50
|
parents(element, selector) {
|
|
76
51
|
const parents = [];
|
|
77
|
-
let ancestor = element.parentNode;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
parents.push(ancestor);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
ancestor = ancestor.parentNode;
|
|
52
|
+
let ancestor = element.parentNode.closest(selector);
|
|
53
|
+
while (ancestor) {
|
|
54
|
+
parents.push(ancestor);
|
|
55
|
+
ancestor = ancestor.parentNode.closest(selector);
|
|
85
56
|
}
|
|
86
|
-
|
|
87
57
|
return parents;
|
|
88
58
|
},
|
|
89
|
-
|
|
90
59
|
prev(element, selector) {
|
|
91
60
|
let previous = element.previousElementSibling;
|
|
92
|
-
|
|
93
61
|
while (previous) {
|
|
94
62
|
if (previous.matches(selector)) {
|
|
95
63
|
return [previous];
|
|
96
64
|
}
|
|
97
|
-
|
|
98
65
|
previous = previous.previousElementSibling;
|
|
99
66
|
}
|
|
100
|
-
|
|
101
67
|
return [];
|
|
102
68
|
},
|
|
103
|
-
|
|
69
|
+
// TODO: this is now unused; remove later along with prev()
|
|
104
70
|
next(element, selector) {
|
|
105
71
|
let next = element.nextElementSibling;
|
|
106
|
-
|
|
107
72
|
while (next) {
|
|
108
73
|
if (next.matches(selector)) {
|
|
109
74
|
return [next];
|
|
110
75
|
}
|
|
111
|
-
|
|
112
76
|
next = next.nextElementSibling;
|
|
113
77
|
}
|
|
114
|
-
|
|
115
78
|
return [];
|
|
116
79
|
},
|
|
117
|
-
|
|
118
80
|
focusableChildren(element) {
|
|
119
|
-
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',
|
|
120
|
-
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
81
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
|
|
82
|
+
return this.find(focusables, element).filter(el => !index_js.isDisabled(el) && index_js.isVisible(el));
|
|
83
|
+
},
|
|
84
|
+
getSelectorFromElement(element) {
|
|
85
|
+
const selector = getSelector(element);
|
|
86
|
+
if (selector) {
|
|
87
|
+
return SelectorEngine.findOne(selector) ? selector : null;
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
},
|
|
91
|
+
getElementFromSelector(element) {
|
|
92
|
+
const selector = getSelector(element);
|
|
93
|
+
return selector ? SelectorEngine.findOne(selector) : null;
|
|
94
|
+
},
|
|
95
|
+
getMultipleElementsFromSelector(element) {
|
|
96
|
+
const selector = getSelector(element);
|
|
97
|
+
return selector ? SelectorEngine.find(selector) : [];
|
|
121
98
|
}
|
|
122
|
-
|
|
123
99
|
};
|
|
124
100
|
|
|
125
101
|
return SelectorEngine;
|