bootstrap 4.3.1 → 5.1.3

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.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +17 -2
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +7 -4
  5. data/assets/javascripts/bootstrap/alert.js +172 -136
  6. data/assets/javascripts/bootstrap/base-component.js +182 -0
  7. data/assets/javascripts/bootstrap/button.js +101 -142
  8. data/assets/javascripts/bootstrap/carousel.js +483 -408
  9. data/assets/javascripts/bootstrap/collapse.js +340 -273
  10. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +321 -0
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +127 -0
  14. data/assets/javascripts/bootstrap/dropdown.js +491 -399
  15. data/assets/javascripts/bootstrap/modal.js +841 -449
  16. data/assets/javascripts/bootstrap/offcanvas.js +866 -0
  17. data/assets/javascripts/bootstrap/popover.js +121 -198
  18. data/assets/javascripts/bootstrap/scrollspy.js +256 -240
  19. data/assets/javascripts/bootstrap/tab.js +218 -154
  20. data/assets/javascripts/bootstrap/toast.js +329 -189
  21. data/assets/javascripts/bootstrap/tooltip.js +651 -552
  22. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  23. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  24. data/assets/javascripts/bootstrap-sprockets.js +8 -1
  25. data/assets/javascripts/bootstrap.js +3503 -2892
  26. data/assets/javascripts/bootstrap.min.js +4 -4
  27. data/assets/stylesheets/_bootstrap-grid.scss +56 -18
  28. data/assets/stylesheets/_bootstrap-reboot.scss +5 -4
  29. data/assets/stylesheets/_bootstrap.scss +20 -11
  30. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  31. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  32. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  33. data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -18
  34. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  35. data/assets/stylesheets/bootstrap/_buttons.scss +28 -54
  36. data/assets/stylesheets/bootstrap/_card.scss +52 -125
  37. data/assets/stylesheets/bootstrap/_carousel.scss +70 -38
  38. data/assets/stylesheets/bootstrap/_close.scss +30 -31
  39. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  40. data/assets/stylesheets/bootstrap/_dropdown.scss +88 -39
  41. data/assets/stylesheets/bootstrap/_forms.scss +9 -330
  42. data/assets/stylesheets/bootstrap/_functions.scss +243 -27
  43. data/assets/stylesheets/bootstrap/_grid.scss +14 -33
  44. data/assets/stylesheets/bootstrap/_helpers.scss +9 -0
  45. data/assets/stylesheets/bootstrap/_images.scss +3 -3
  46. data/assets/stylesheets/bootstrap/_list-group.scss +61 -36
  47. data/assets/stylesheets/bootstrap/_mixins.scss +12 -16
  48. data/assets/stylesheets/bootstrap/_modal.scss +64 -84
  49. data/assets/stylesheets/bootstrap/_nav.scss +29 -10
  50. data/assets/stylesheets/bootstrap/_navbar.scss +93 -52
  51. data/assets/stylesheets/bootstrap/_offcanvas.scss +83 -0
  52. data/assets/stylesheets/bootstrap/_pagination.scss +13 -22
  53. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  54. data/assets/stylesheets/bootstrap/_popover.scss +29 -42
  55. data/assets/stylesheets/bootstrap/_progress.scss +10 -5
  56. data/assets/stylesheets/bootstrap/_reboot.scss +350 -208
  57. data/assets/stylesheets/bootstrap/_root.scss +43 -8
  58. data/assets/stylesheets/bootstrap/_spinners.scss +21 -7
  59. data/assets/stylesheets/bootstrap/_tables.scss +84 -114
  60. data/assets/stylesheets/bootstrap/_toasts.scss +21 -14
  61. data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
  62. data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
  63. data/assets/stylesheets/bootstrap/_type.scss +40 -61
  64. data/assets/stylesheets/bootstrap/_utilities.scss +630 -17
  65. data/assets/stylesheets/bootstrap/_variables.scss +1007 -489
  66. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  67. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +63 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  70. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  71. data/assets/stylesheets/bootstrap/forms/_form-select.scss +72 -0
  72. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  73. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  74. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  75. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  76. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  77. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  78. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  79. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  80. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  81. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  82. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  83. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  84. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  85. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  86. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  87. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
  88. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  89. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  90. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +77 -51
  91. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  92. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  93. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  94. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  95. data/assets/stylesheets/bootstrap/mixins/_forms.scss +67 -115
  96. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  97. data/assets/stylesheets/bootstrap/mixins/_grid.scss +132 -32
  98. data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
  99. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  100. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  101. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  102. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  103. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  104. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +89 -0
  105. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  106. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  107. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +278 -128
  108. data/bootstrap.gemspec +4 -6
  109. data/lib/bootstrap/version.rb +2 -2
  110. data/tasks/updater/js.rb +25 -6
  111. data/tasks/updater/network.rb +8 -2
  112. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  113. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  114. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  115. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  116. data/test/dummy_rails/app/views/pages/root.html +89 -0
  117. data/test/dummy_rails/config/application.rb +0 -3
  118. data/test/gemfiles/rails_6_0.gemfile +7 -0
  119. data/test/gemfiles/rails_6_1.gemfile +7 -0
  120. data/test/support/dummy_rails_integration.rb +3 -1
  121. data/test/test_helper.rb +18 -13
  122. metadata +61 -79
  123. data/assets/javascripts/bootstrap/util.js +0 -171
  124. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  125. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
  126. data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
  127. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  128. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  129. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  130. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
  131. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  132. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  133. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
  134. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  135. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  136. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
  137. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  138. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  139. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
  140. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  141. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  142. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  143. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  144. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  145. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  146. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  147. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  148. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  149. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  150. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  151. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  152. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  153. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  154. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  155. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  156. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  157. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  158. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -1,152 +1,123 @@
1
1
  /*!
2
- * Bootstrap button.js v4.3.1 (https://getbootstrap.com/)
3
- * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
2
+ * Bootstrap button.js v5.1.3 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 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('jquery')) :
8
- typeof define === 'function' && define.amd ? define(['jquery'], factory) :
9
- (global = global || self, global.Button = factory(global.jQuery));
10
- }(this, function ($) { 'use strict';
11
-
12
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
-
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
- }
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/event-handler.js'), require('./base-component.js')) :
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.Base));
10
+ })(this, (function (EventHandler, BaseComponent) { 'use strict';
23
11
 
24
- function _createClass(Constructor, protoProps, staticProps) {
25
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
26
- if (staticProps) _defineProperties(Constructor, staticProps);
27
- return Constructor;
28
- }
12
+ const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
13
+
14
+ const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
15
+ const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
29
16
 
30
17
  /**
31
- * ------------------------------------------------------------------------
32
- * Constants
33
- * ------------------------------------------------------------------------
18
+ * --------------------------------------------------------------------------
19
+ * Bootstrap (v5.1.3): util/index.js
20
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
+ * --------------------------------------------------------------------------
34
22
  */
35
23
 
36
- var NAME = 'button';
37
- var VERSION = '4.3.1';
38
- var DATA_KEY = 'bs.button';
39
- var EVENT_KEY = "." + DATA_KEY;
40
- var DATA_API_KEY = '.data-api';
41
- var JQUERY_NO_CONFLICT = $.fn[NAME];
42
- var ClassName = {
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
- */
24
+ const getjQuery = () => {
25
+ const {
26
+ jQuery
27
+ } = window;
28
+
29
+ if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
30
+ return jQuery;
31
+ }
62
32
 
33
+ return null;
63
34
  };
64
35
 
65
- var Button =
66
- /*#__PURE__*/
67
- function () {
68
- function Button(element) {
69
- this._element = element;
70
- } // Getters
71
-
72
-
73
- var _proto = Button.prototype;
74
-
75
- // Public
76
- _proto.toggle = function toggle() {
77
- var triggerChangeEvent = true;
78
- var addAriaPressed = true;
79
- var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0];
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
- }
36
+ const DOMContentLoadedCallbacks = [];
110
37
 
111
- if (addAriaPressed) {
112
- this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName.ACTIVE));
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
+ });
113
45
  }
114
46
 
115
- if (triggerChangeEvent) {
116
- $(this._element).toggleClass(ClassName.ACTIVE);
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
+ };
117
68
  }
118
- };
69
+ });
70
+ };
71
+
72
+ /**
73
+ * --------------------------------------------------------------------------
74
+ * Bootstrap (v5.1.3): button.js
75
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
76
+ * --------------------------------------------------------------------------
77
+ */
78
+ /**
79
+ * ------------------------------------------------------------------------
80
+ * Constants
81
+ * ------------------------------------------------------------------------
82
+ */
119
83
 
120
- _proto.dispose = function dispose() {
121
- $.removeData(this._element, DATA_KEY);
122
- this._element = null;
84
+ const NAME = 'button';
85
+ const DATA_KEY = 'bs.button';
86
+ const EVENT_KEY = `.${DATA_KEY}`;
87
+ const DATA_API_KEY = '.data-api';
88
+ const CLASS_NAME_ACTIVE = 'active';
89
+ const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="button"]';
90
+ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
91
+ /**
92
+ * ------------------------------------------------------------------------
93
+ * Class Definition
94
+ * ------------------------------------------------------------------------
95
+ */
96
+
97
+ class Button extends BaseComponent__default.default {
98
+ // Getters
99
+ static get NAME() {
100
+ return NAME;
101
+ } // Public
102
+
103
+
104
+ toggle() {
105
+ // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method
106
+ this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE));
123
107
  } // Static
124
- ;
125
108
 
126
- Button._jQueryInterface = function _jQueryInterface(config) {
127
- return this.each(function () {
128
- var data = $(this).data(DATA_KEY);
129
109
 
130
- if (!data) {
131
- data = new Button(this);
132
- $(this).data(DATA_KEY, data);
133
- }
110
+ static jQueryInterface(config) {
111
+ return this.each(function () {
112
+ const data = Button.getOrCreateInstance(this);
134
113
 
135
114
  if (config === 'toggle') {
136
115
  data[config]();
137
116
  }
138
117
  });
139
- };
140
-
141
- _createClass(Button, null, [{
142
- key: "VERSION",
143
- get: function get() {
144
- return VERSION;
145
- }
146
- }]);
118
+ }
147
119
 
148
- return Button;
149
- }();
120
+ }
150
121
  /**
151
122
  * ------------------------------------------------------------------------
152
123
  * Data Api implementation
@@ -154,32 +125,20 @@
154
125
  */
155
126
 
156
127
 
157
- $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
128
+ EventHandler__default.default.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {
158
129
  event.preventDefault();
159
- var button = event.target;
160
-
161
- if (!$(button).hasClass(ClassName.BUTTON)) {
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));
130
+ const button = event.target.closest(SELECTOR_DATA_TOGGLE);
131
+ const data = Button.getOrCreateInstance(button);
132
+ data.toggle();
169
133
  });
170
134
  /**
171
135
  * ------------------------------------------------------------------------
172
136
  * jQuery
173
137
  * ------------------------------------------------------------------------
138
+ * add .Button to jQuery only if jQuery is present
174
139
  */
175
140
 
176
- $.fn[NAME] = Button._jQueryInterface;
177
- $.fn[NAME].Constructor = Button;
178
-
179
- $.fn[NAME].noConflict = function () {
180
- $.fn[NAME] = JQUERY_NO_CONFLICT;
181
- return Button._jQueryInterface;
182
- };
141
+ defineJQueryPlugin(Button);
183
142
 
184
143
  return Button;
185
144