bootstrap 4.3.1 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +55 -0
- data/CHANGELOG.md +2 -14
- data/README.md +28 -5
- data/assets/javascripts/bootstrap/alert.js +54 -163
- data/assets/javascripts/bootstrap/base-component.js +83 -0
- data/assets/javascripts/bootstrap/button.js +44 -152
- data/assets/javascripts/bootstrap/carousel.js +289 -569
- data/assets/javascripts/bootstrap/collapse.js +170 -349
- data/assets/javascripts/bootstrap/dom/data.js +62 -0
- data/assets/javascripts/bootstrap/dom/event-handler.js +236 -0
- data/assets/javascripts/bootstrap/dom/manipulator.js +71 -0
- data/assets/javascripts/bootstrap/dom/selector-engine.js +103 -0
- data/assets/javascripts/bootstrap/dropdown.js +303 -496
- data/assets/javascripts/bootstrap/modal.js +229 -559
- data/assets/javascripts/bootstrap/offcanvas.js +245 -0
- data/assets/javascripts/bootstrap/popover.js +61 -226
- data/assets/javascripts/bootstrap/scrollspy.js +217 -317
- data/assets/javascripts/bootstrap/tab.js +220 -212
- data/assets/javascripts/bootstrap/toast.js +145 -229
- data/assets/javascripts/bootstrap/tooltip.js +421 -782
- data/assets/javascripts/bootstrap/util/backdrop.js +139 -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 +113 -0
- data/assets/javascripts/bootstrap/util/index.js +281 -0
- data/assets/javascripts/bootstrap/util/sanitizer.js +110 -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 +6 -0
- data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
- data/assets/javascripts/bootstrap-sprockets.js +23 -7
- data/assets/javascripts/bootstrap.js +3690 -3639
- data/assets/javascripts/bootstrap.min.js +4 -4
- data/assets/stylesheets/_bootstrap-grid.scss +53 -20
- data/assets/stylesheets/_bootstrap-reboot.scss +5 -7
- data/assets/stylesheets/_bootstrap.scss +21 -13
- data/assets/stylesheets/bootstrap/_accordion.scss +158 -0
- data/assets/stylesheets/bootstrap/_alert.scss +32 -15
- data/assets/stylesheets/bootstrap/_badge.scss +15 -31
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +23 -24
- data/assets/stylesheets/bootstrap/_button-group.scss +27 -48
- data/assets/stylesheets/bootstrap/_buttons.scss +139 -69
- data/assets/stylesheets/bootstrap/_card.scss +91 -141
- data/assets/stylesheets/bootstrap/_carousel.scss +86 -39
- data/assets/stylesheets/bootstrap/_close.scss +51 -29
- data/assets/stylesheets/bootstrap/_containers.scss +41 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +131 -72
- data/assets/stylesheets/bootstrap/_forms.scss +9 -330
- data/assets/stylesheets/bootstrap/_functions.scss +244 -28
- data/assets/stylesheets/bootstrap/_grid.scss +18 -31
- data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
- data/assets/stylesheets/bootstrap/_images.scss +3 -3
- data/assets/stylesheets/bootstrap/_list-group.scss +101 -53
- data/assets/stylesheets/bootstrap/_maps.scss +174 -0
- data/assets/stylesheets/bootstrap/_mixins.scss +13 -18
- data/assets/stylesheets/bootstrap/_modal.scss +120 -112
- data/assets/stylesheets/bootstrap/_nav.scss +113 -24
- data/assets/stylesheets/bootstrap/_navbar.scss +145 -150
- data/assets/stylesheets/bootstrap/_offcanvas.scss +146 -0
- data/assets/stylesheets/bootstrap/_pagination.scss +74 -38
- data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
- data/assets/stylesheets/bootstrap/_popover.scss +99 -74
- data/assets/stylesheets/bootstrap/_progress.scss +40 -15
- data/assets/stylesheets/bootstrap/_reboot.scss +342 -215
- data/assets/stylesheets/bootstrap/_root.scss +174 -9
- data/assets/stylesheets/bootstrap/_spinners.scss +52 -22
- data/assets/stylesheets/bootstrap/_tables.scss +101 -115
- data/assets/stylesheets/bootstrap/_toasts.scss +54 -25
- data/assets/stylesheets/bootstrap/_tooltip.scss +67 -63
- data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
- data/assets/stylesheets/bootstrap/_type.scss +42 -61
- data/assets/stylesheets/bootstrap/_utilities.scss +806 -17
- data/assets/stylesheets/bootstrap/_variables-dark.scss +85 -0
- data/assets/stylesheets/bootstrap/_variables.scss +1235 -615
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +19 -0
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +94 -0
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +188 -0
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +214 -0
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +80 -0
- data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +132 -0
- data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
- data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
- data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +8 -0
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +30 -0
- 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 +36 -0
- data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
- data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
- data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
- data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -6
- data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
- data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
- data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +20 -16
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +60 -97
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +34 -27
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +77 -116
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +133 -33
- data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +7 -2
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +7 -19
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
- data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +97 -0
- data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +33 -0
- data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +276 -132
- data/bootstrap.gemspec +4 -6
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +31 -7
- data/tasks/updater/network.rb +10 -4
- data/tasks/updater/scss.rb +1 -1
- data/tasks/updater.rb +2 -2
- data/test/dummy_rails/app/assets/config/manifest.js +3 -0
- data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
- data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
- data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
- data/test/dummy_rails/app/views/pages/root.html +89 -0
- data/test/dummy_rails/config/application.rb +0 -3
- data/test/gemfiles/rails_5_2.gemfile +8 -0
- data/test/gemfiles/rails_6_0.gemfile +7 -0
- data/test/gemfiles/rails_6_1.gemfile +7 -0
- data/test/gemfiles/rails_7_0.gemfile +7 -0
- data/test/support/dummy_rails_integration.rb +3 -1
- data/test/test_helper.rb +18 -12
- metadata +86 -84
- data/.travis.yml +0 -17
- data/assets/javascripts/bootstrap/util.js +0 -171
- data/assets/stylesheets/bootstrap/_code.scss +0 -48
- data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
- data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
- data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
- data/assets/stylesheets/bootstrap/_media.scss +0 -8
- data/assets/stylesheets/bootstrap/_print.scss +0 -141
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
- data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
- data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
- data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
- data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
- data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
- data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
- data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
- data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
- data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
- data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
- data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
- data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
- data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
- data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
- data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
- data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
- data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
- data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
- data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
- data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
- /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -1,185 +1,77 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap button.js
|
3
|
-
* Copyright 2011-
|
4
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/
|
2
|
+
* Bootstrap button.js v5.3.0 (https://getbootstrap.com/)
|
3
|
+
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
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('
|
8
|
-
typeof define === 'function' && define.amd ? define(['
|
9
|
-
(global = global || self, global.Button = factory(global.
|
10
|
-
}(this, function (
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./base-component.js'), require('./dom/event-handler.js'), require('./util/index.js')) :
|
8
|
+
typeof define === 'function' && define.amd ? define(['./base-component', './dom/event-handler', './util/index'], factory) :
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Button = factory(global.BaseComponent, global.EventHandler, global.Index));
|
10
|
+
})(this, (function (BaseComponent, EventHandler, index_js) { 'use strict';
|
11
11
|
|
12
|
-
|
12
|
+
/**
|
13
|
+
* --------------------------------------------------------------------------
|
14
|
+
* Bootstrap button.js
|
15
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
16
|
+
* --------------------------------------------------------------------------
|
17
|
+
*/
|
13
18
|
|
14
|
-
function _defineProperties(target, props) {
|
15
|
-
for (var i = 0; i < props.length; i++) {
|
16
|
-
var descriptor = props[i];
|
17
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
18
|
-
descriptor.configurable = true;
|
19
|
-
if ("value" in descriptor) descriptor.writable = true;
|
20
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
25
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
26
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
27
|
-
return Constructor;
|
28
|
-
}
|
29
19
|
|
30
20
|
/**
|
31
|
-
* ------------------------------------------------------------------------
|
32
21
|
* Constants
|
33
|
-
* ------------------------------------------------------------------------
|
34
22
|
*/
|
35
23
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
ACTIVE: 'active',
|
44
|
-
BUTTON: 'btn',
|
45
|
-
FOCUS: 'focus'
|
46
|
-
};
|
47
|
-
var Selector = {
|
48
|
-
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
|
49
|
-
DATA_TOGGLE: '[data-toggle="buttons"]',
|
50
|
-
INPUT: 'input:not([type="hidden"])',
|
51
|
-
ACTIVE: '.active',
|
52
|
-
BUTTON: '.btn'
|
53
|
-
};
|
54
|
-
var Event = {
|
55
|
-
CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
|
56
|
-
FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
|
57
|
-
/**
|
58
|
-
* ------------------------------------------------------------------------
|
59
|
-
* Class Definition
|
60
|
-
* ------------------------------------------------------------------------
|
61
|
-
*/
|
62
|
-
|
63
|
-
};
|
64
|
-
|
65
|
-
var Button =
|
66
|
-
/*#__PURE__*/
|
67
|
-
function () {
|
68
|
-
function Button(element) {
|
69
|
-
this._element = element;
|
70
|
-
} // Getters
|
24
|
+
const NAME = 'button';
|
25
|
+
const DATA_KEY = 'bs.button';
|
26
|
+
const EVENT_KEY = `.${DATA_KEY}`;
|
27
|
+
const DATA_API_KEY = '.data-api';
|
28
|
+
const CLASS_NAME_ACTIVE = 'active';
|
29
|
+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
|
30
|
+
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
71
31
|
|
32
|
+
/**
|
33
|
+
* Class definition
|
34
|
+
*/
|
72
35
|
|
73
|
-
|
36
|
+
class Button extends BaseComponent {
|
37
|
+
// Getters
|
38
|
+
static get NAME() {
|
39
|
+
return NAME;
|
40
|
+
}
|
74
41
|
|
75
42
|
// Public
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
if (rootElement) {
|
82
|
-
var input = this._element.querySelector(Selector.INPUT);
|
83
|
-
|
84
|
-
if (input) {
|
85
|
-
if (input.type === 'radio') {
|
86
|
-
if (input.checked && this._element.classList.contains(ClassName.ACTIVE)) {
|
87
|
-
triggerChangeEvent = false;
|
88
|
-
} else {
|
89
|
-
var activeElement = rootElement.querySelector(Selector.ACTIVE);
|
90
|
-
|
91
|
-
if (activeElement) {
|
92
|
-
$(activeElement).removeClass(ClassName.ACTIVE);
|
93
|
-
}
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
if (triggerChangeEvent) {
|
98
|
-
if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
|
99
|
-
return;
|
100
|
-
}
|
101
|
-
|
102
|
-
input.checked = !this._element.classList.contains(ClassName.ACTIVE);
|
103
|
-
$(input).trigger('change');
|
104
|
-
}
|
105
|
-
|
106
|
-
input.focus();
|
107
|
-
addAriaPressed = false;
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
if (addAriaPressed) {
|
112
|
-
this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
|
113
|
-
}
|
114
|
-
|
115
|
-
if (triggerChangeEvent) {
|
116
|
-
$(this._element).toggleClass(ClassName.ACTIVE);
|
117
|
-
}
|
118
|
-
};
|
119
|
-
|
120
|
-
_proto.dispose = function dispose() {
|
121
|
-
$.removeData(this._element, DATA_KEY);
|
122
|
-
this._element = null;
|
123
|
-
} // Static
|
124
|
-
;
|
43
|
+
toggle() {
|
44
|
+
// Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
|
45
|
+
this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
|
46
|
+
}
|
125
47
|
|
126
|
-
|
48
|
+
// Static
|
49
|
+
static jQueryInterface(config) {
|
127
50
|
return this.each(function () {
|
128
|
-
|
129
|
-
|
130
|
-
if (!data) {
|
131
|
-
data = new Button(this);
|
132
|
-
$(this).data(DATA_KEY, data);
|
133
|
-
}
|
134
|
-
|
51
|
+
const data = Button.getOrCreateInstance(this);
|
135
52
|
if (config === 'toggle') {
|
136
53
|
data[config]();
|
137
54
|
}
|
138
55
|
});
|
139
|
-
}
|
140
|
-
|
141
|
-
_createClass(Button, null, [{
|
142
|
-
key: "VERSION",
|
143
|
-
get: function get() {
|
144
|
-
return VERSION;
|
145
|
-
}
|
146
|
-
}]);
|
56
|
+
}
|
57
|
+
}
|
147
58
|
|
148
|
-
return Button;
|
149
|
-
}();
|
150
59
|
/**
|
151
|
-
*
|
152
|
-
* Data Api implementation
|
153
|
-
* ------------------------------------------------------------------------
|
60
|
+
* Data API implementation
|
154
61
|
*/
|
155
62
|
|
156
|
-
|
157
|
-
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
63
|
+
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
|
158
64
|
event.preventDefault();
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
button = $(button).closest(Selector.BUTTON);
|
163
|
-
}
|
164
|
-
|
165
|
-
Button._jQueryInterface.call($(button), 'toggle');
|
166
|
-
}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
|
167
|
-
var button = $(event.target).closest(Selector.BUTTON)[0];
|
168
|
-
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
|
65
|
+
const button = event.target.closest(SELECTOR_DATA_TOGGLE);
|
66
|
+
const data = Button.getOrCreateInstance(button);
|
67
|
+
data.toggle();
|
169
68
|
});
|
69
|
+
|
170
70
|
/**
|
171
|
-
* ------------------------------------------------------------------------
|
172
71
|
* jQuery
|
173
|
-
* ------------------------------------------------------------------------
|
174
72
|
*/
|
175
73
|
|
176
|
-
|
177
|
-
$.fn[NAME].Constructor = Button;
|
178
|
-
|
179
|
-
$.fn[NAME].noConflict = function () {
|
180
|
-
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
181
|
-
return Button._jQueryInterface;
|
182
|
-
};
|
74
|
+
index_js.defineJQueryPlugin(Button);
|
183
75
|
|
184
76
|
return Button;
|
185
77
|
|