bootstrap 5.2.3 → 5.3.2

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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +11 -5
  3. data/Gemfile +1 -0
  4. data/README.md +6 -2
  5. data/Rakefile +10 -1
  6. data/assets/javascripts/bootstrap/alert.js +22 -32
  7. data/assets/javascripts/bootstrap/base-component.js +22 -38
  8. data/assets/javascripts/bootstrap/button.js +19 -22
  9. data/assets/javascripts/bootstrap/carousel.js +52 -135
  10. data/assets/javascripts/bootstrap/collapse.js +40 -102
  11. data/assets/javascripts/bootstrap/dom/data.js +8 -12
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +19 -66
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +4 -17
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +42 -24
  15. data/assets/javascripts/bootstrap/dropdown.js +74 -145
  16. data/assets/javascripts/bootstrap/modal.js +53 -133
  17. data/assets/javascripts/bootstrap/offcanvas.js +50 -102
  18. data/assets/javascripts/bootstrap/popover.js +23 -29
  19. data/assets/javascripts/bootstrap/scrollspy.js +53 -90
  20. data/assets/javascripts/bootstrap/tab.js +63 -112
  21. data/assets/javascripts/bootstrap/toast.js +31 -73
  22. data/assets/javascripts/bootstrap/tooltip.js +75 -177
  23. data/assets/javascripts/bootstrap/util/backdrop.js +28 -54
  24. data/assets/javascripts/bootstrap/util/component-functions.js +13 -18
  25. data/assets/javascripts/bootstrap/util/config.js +15 -27
  26. data/assets/javascripts/bootstrap/util/focustrap.js +20 -36
  27. data/assets/javascripts/bootstrap/util/index.js +42 -111
  28. data/assets/javascripts/bootstrap/util/sanitizer.js +30 -42
  29. data/assets/javascripts/bootstrap/util/scrollbar.js +24 -50
  30. data/assets/javascripts/bootstrap/util/swipe.js +27 -48
  31. data/assets/javascripts/bootstrap/util/template-factory.js +25 -52
  32. data/assets/javascripts/bootstrap-sprockets.js +10 -10
  33. data/assets/javascripts/bootstrap.js +689 -1444
  34. data/assets/javascripts/bootstrap.min.js +3 -3
  35. data/assets/stylesheets/_bootstrap-grid.scss +1 -3
  36. data/assets/stylesheets/_bootstrap-reboot.scss +1 -0
  37. data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
  38. data/assets/stylesheets/_bootstrap.scss +1 -0
  39. data/assets/stylesheets/bootstrap/_accordion.scss +9 -0
  40. data/assets/stylesheets/bootstrap/_alert.scss +8 -11
  41. data/assets/stylesheets/bootstrap/_button-group.scss +2 -2
  42. data/assets/stylesheets/bootstrap/_buttons.scss +3 -3
  43. data/assets/stylesheets/bootstrap/_card.scss +5 -0
  44. data/assets/stylesheets/bootstrap/_carousel.scss +20 -2
  45. data/assets/stylesheets/bootstrap/_close.scss +32 -9
  46. data/assets/stylesheets/bootstrap/_dropdown.scss +1 -0
  47. data/assets/stylesheets/bootstrap/_functions.scss +1 -1
  48. data/assets/stylesheets/bootstrap/_grid.scss +6 -0
  49. data/assets/stylesheets/bootstrap/_helpers.scss +2 -0
  50. data/assets/stylesheets/bootstrap/_list-group.scss +12 -7
  51. data/assets/stylesheets/bootstrap/_maps.scss +120 -0
  52. data/assets/stylesheets/bootstrap/_mixins.scss +1 -2
  53. data/assets/stylesheets/bootstrap/_nav.scss +42 -17
  54. data/assets/stylesheets/bootstrap/_navbar.scss +15 -4
  55. data/assets/stylesheets/bootstrap/_offcanvas.scss +4 -2
  56. data/assets/stylesheets/bootstrap/_pagination.scss +1 -1
  57. data/assets/stylesheets/bootstrap/_progress.scss +10 -1
  58. data/assets/stylesheets/bootstrap/_reboot.scss +8 -7
  59. data/assets/stylesheets/bootstrap/_root.scss +124 -10
  60. data/assets/stylesheets/bootstrap/_tables.scss +18 -11
  61. data/assets/stylesheets/bootstrap/_tooltip.scss +4 -5
  62. data/assets/stylesheets/bootstrap/_utilities.scss +175 -16
  63. data/assets/stylesheets/bootstrap/_variables-dark.scss +87 -0
  64. data/assets/stylesheets/bootstrap/_variables.scss +282 -169
  65. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +23 -3
  66. data/assets/stylesheets/bootstrap/forms/_form-check.scss +26 -12
  67. data/assets/stylesheets/bootstrap/forms/_form-control.scss +24 -4
  68. data/assets/stylesheets/bootstrap/forms/_form-range.scss +3 -3
  69. data/assets/stylesheets/bootstrap/forms/_form-select.scss +12 -3
  70. data/assets/stylesheets/bootstrap/forms/_input-group.scss +1 -1
  71. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +1 -4
  72. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +20 -2
  73. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  74. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  75. data/assets/stylesheets/bootstrap/helpers/_vr.scss +1 -1
  76. data/assets/stylesheets/bootstrap/mixins/_alert.scss +4 -1
  77. data/assets/stylesheets/bootstrap/mixins/_banner.scss +2 -4
  78. data/assets/stylesheets/bootstrap/mixins/_caret.scss +30 -25
  79. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  80. data/assets/stylesheets/bootstrap/mixins/_forms.scss +8 -7
  81. data/assets/stylesheets/bootstrap/mixins/_grid.scss +1 -1
  82. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
  83. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +1 -1
  84. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +5 -1
  85. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +23 -29
  86. data/bootstrap.gemspec +4 -3
  87. data/lib/bootstrap/engine.rb +7 -1
  88. data/lib/bootstrap/version.rb +2 -2
  89. data/tasks/updater/js.rb +1 -1
  90. data/tasks/updater/scss.rb +2 -2
  91. data/test/gemfiles/rails_4_2.gemfile +1 -1
  92. data/test/gemfiles/rails_5_0.gemfile +1 -1
  93. data/test/gemfiles/rails_5_1.gemfile +1 -1
  94. data/test/gemfiles/rails_5_2.gemfile +1 -1
  95. data/test/gemfiles/rails_6_0.gemfile +1 -0
  96. data/test/gemfiles/rails_6_1.gemfile +1 -0
  97. data/test/gemfiles/rails_7_0_dartsass.gemfile +8 -0
  98. data/test/gemfiles/{rails_7_0.gemfile → rails_7_0_sassc.gemfile} +1 -0
  99. metadata +35 -15
  100. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +0 -18
@@ -1,25 +1,22 @@
1
1
  /*!
2
- * Bootstrap swipe.js v5.2.3 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap swipe.js v5.3.2 (https://getbootstrap.com/)
3
+ * Copyright 2011-2023 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('./config'), require('../dom/event-handler'), require('./index')) :
8
- typeof define === 'function' && define.amd ? define(['./config', '../dom/event-handler', './index'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Swipe = factory(global.Config, global.EventHandler, global.Index));
10
- })(this, (function (Config, EventHandler, index) { 'use strict';
11
-
12
- const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
13
-
14
- const Config__default = /*#__PURE__*/_interopDefaultLegacy(Config);
15
- const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/event-handler.js'), require('./config.js'), require('./index.js')) :
8
+ typeof define === 'function' && define.amd ? define(['../dom/event-handler', './config', './index'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Swipe = factory(global.EventHandler, global.Config, global.Index));
10
+ })(this, (function (EventHandler, Config, index_js) { 'use strict';
16
11
 
17
12
  /**
18
13
  * --------------------------------------------------------------------------
19
- * Bootstrap (v5.2.3): util/swipe.js
14
+ * Bootstrap util/swipe.js
20
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
16
  * --------------------------------------------------------------------------
22
17
  */
18
+
19
+
23
20
  /**
24
21
  * Constants
25
22
  */
@@ -45,109 +42,91 @@
45
42
  leftCallback: '(function|null)',
46
43
  rightCallback: '(function|null)'
47
44
  };
45
+
48
46
  /**
49
47
  * Class definition
50
48
  */
51
49
 
52
- class Swipe extends Config__default.default {
50
+ class Swipe extends Config {
53
51
  constructor(element, config) {
54
52
  super();
55
53
  this._element = element;
56
-
57
54
  if (!element || !Swipe.isSupported()) {
58
55
  return;
59
56
  }
60
-
61
57
  this._config = this._getConfig(config);
62
58
  this._deltaX = 0;
63
59
  this._supportPointerEvents = Boolean(window.PointerEvent);
64
-
65
60
  this._initEvents();
66
- } // Getters
67
-
61
+ }
68
62
 
63
+ // Getters
69
64
  static get Default() {
70
65
  return Default;
71
66
  }
72
-
73
67
  static get DefaultType() {
74
68
  return DefaultType;
75
69
  }
76
-
77
70
  static get NAME() {
78
71
  return NAME;
79
- } // Public
80
-
72
+ }
81
73
 
74
+ // Public
82
75
  dispose() {
83
- EventHandler__default.default.off(this._element, EVENT_KEY);
84
- } // Private
85
-
76
+ EventHandler.off(this._element, EVENT_KEY);
77
+ }
86
78
 
79
+ // Private
87
80
  _start(event) {
88
81
  if (!this._supportPointerEvents) {
89
82
  this._deltaX = event.touches[0].clientX;
90
83
  return;
91
84
  }
92
-
93
85
  if (this._eventIsPointerPenTouch(event)) {
94
86
  this._deltaX = event.clientX;
95
87
  }
96
88
  }
97
-
98
89
  _end(event) {
99
90
  if (this._eventIsPointerPenTouch(event)) {
100
91
  this._deltaX = event.clientX - this._deltaX;
101
92
  }
102
-
103
93
  this._handleSwipe();
104
-
105
- index.execute(this._config.endCallback);
94
+ index_js.execute(this._config.endCallback);
106
95
  }
107
-
108
96
  _move(event) {
109
97
  this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX;
110
98
  }
111
-
112
99
  _handleSwipe() {
113
100
  const absDeltaX = Math.abs(this._deltaX);
114
-
115
101
  if (absDeltaX <= SWIPE_THRESHOLD) {
116
102
  return;
117
103
  }
118
-
119
104
  const direction = absDeltaX / this._deltaX;
120
105
  this._deltaX = 0;
121
-
122
106
  if (!direction) {
123
107
  return;
124
108
  }
125
-
126
- index.execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);
109
+ index_js.execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback);
127
110
  }
128
-
129
111
  _initEvents() {
130
112
  if (this._supportPointerEvents) {
131
- EventHandler__default.default.on(this._element, EVENT_POINTERDOWN, event => this._start(event));
132
- EventHandler__default.default.on(this._element, EVENT_POINTERUP, event => this._end(event));
133
-
113
+ EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event));
114
+ EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event));
134
115
  this._element.classList.add(CLASS_NAME_POINTER_EVENT);
135
116
  } else {
136
- EventHandler__default.default.on(this._element, EVENT_TOUCHSTART, event => this._start(event));
137
- EventHandler__default.default.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));
138
- EventHandler__default.default.on(this._element, EVENT_TOUCHEND, event => this._end(event));
117
+ EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event));
118
+ EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event));
119
+ EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event));
139
120
  }
140
121
  }
141
-
142
122
  _eventIsPointerPenTouch(event) {
143
123
  return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
144
- } // Static
145
-
124
+ }
146
125
 
126
+ // Static
147
127
  static isSupported() {
148
128
  return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
149
129
  }
150
-
151
130
  }
152
131
 
153
132
  return Swipe;
@@ -1,32 +1,29 @@
1
1
  /*!
2
- * Bootstrap template-factory.js v5.2.3 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap template-factory.js v5.3.2 (https://getbootstrap.com/)
3
+ * Copyright 2011-2023 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('./sanitizer'), require('./index'), require('../dom/selector-engine'), require('./config')) :
8
- typeof define === 'function' && define.amd ? define(['./sanitizer', './index', '../dom/selector-engine', './config'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.TemplateFactory = factory(global.Sanitizer, global.Index, global.SelectorEngine, global.Config));
10
- })(this, (function (sanitizer, index, SelectorEngine, Config) { 'use strict';
11
-
12
- const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
13
-
14
- const SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
15
- const Config__default = /*#__PURE__*/_interopDefaultLegacy(Config);
7
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('../dom/selector-engine.js'), require('./config.js'), require('./sanitizer.js'), require('./index.js')) :
8
+ typeof define === 'function' && define.amd ? define(['../dom/selector-engine', './config', './sanitizer', './index'], factory) :
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.TemplateFactory = factory(global.SelectorEngine, global.Config, global.Sanitizer, global.Index));
10
+ })(this, (function (SelectorEngine, Config, sanitizer_js, index_js) { 'use strict';
16
11
 
17
12
  /**
18
13
  * --------------------------------------------------------------------------
19
- * Bootstrap (v5.2.3): util/template-factory.js
14
+ * Bootstrap util/template-factory.js
20
15
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
21
16
  * --------------------------------------------------------------------------
22
17
  */
18
+
19
+
23
20
  /**
24
21
  * Constants
25
22
  */
26
23
 
27
24
  const NAME = 'TemplateFactory';
28
25
  const Default = {
29
- allowList: sanitizer.DefaultAllowlist,
26
+ allowList: sanitizer_js.DefaultAllowlist,
30
27
  content: {},
31
28
  // { selector : text , selector2 : text2 , }
32
29
  extraClass: '',
@@ -48,73 +45,62 @@
48
45
  entry: '(string|element|function|null)',
49
46
  selector: '(string|element)'
50
47
  };
48
+
51
49
  /**
52
50
  * Class definition
53
51
  */
54
52
 
55
- class TemplateFactory extends Config__default.default {
53
+ class TemplateFactory extends Config {
56
54
  constructor(config) {
57
55
  super();
58
56
  this._config = this._getConfig(config);
59
- } // Getters
60
-
57
+ }
61
58
 
59
+ // Getters
62
60
  static get Default() {
63
61
  return Default;
64
62
  }
65
-
66
63
  static get DefaultType() {
67
64
  return DefaultType;
68
65
  }
69
-
70
66
  static get NAME() {
71
67
  return NAME;
72
- } // Public
73
-
68
+ }
74
69
 
70
+ // Public
75
71
  getContent() {
76
72
  return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean);
77
73
  }
78
-
79
74
  hasContent() {
80
75
  return this.getContent().length > 0;
81
76
  }
82
-
83
77
  changeContent(content) {
84
78
  this._checkContent(content);
85
-
86
- this._config.content = { ...this._config.content,
79
+ this._config.content = {
80
+ ...this._config.content,
87
81
  ...content
88
82
  };
89
83
  return this;
90
84
  }
91
-
92
85
  toHtml() {
93
86
  const templateWrapper = document.createElement('div');
94
87
  templateWrapper.innerHTML = this._maybeSanitize(this._config.template);
95
-
96
88
  for (const [selector, text] of Object.entries(this._config.content)) {
97
89
  this._setContent(templateWrapper, text, selector);
98
90
  }
99
-
100
91
  const template = templateWrapper.children[0];
101
-
102
92
  const extraClass = this._resolvePossibleFunction(this._config.extraClass);
103
-
104
93
  if (extraClass) {
105
94
  template.classList.add(...extraClass.split(' '));
106
95
  }
107
-
108
96
  return template;
109
- } // Private
110
-
97
+ }
111
98
 
99
+ // Private
112
100
  _typeCheckConfig(config) {
113
101
  super._typeCheckConfig(config);
114
-
115
102
  this._checkContent(config.content);
116
103
  }
117
-
118
104
  _checkContent(arg) {
119
105
  for (const [selector, content] of Object.entries(arg)) {
120
106
  super._typeCheckConfig({
@@ -123,53 +109,40 @@
123
109
  }, DefaultContentType);
124
110
  }
125
111
  }
126
-
127
112
  _setContent(template, content, selector) {
128
- const templateElement = SelectorEngine__default.default.findOne(selector, template);
129
-
113
+ const templateElement = SelectorEngine.findOne(selector, template);
130
114
  if (!templateElement) {
131
115
  return;
132
116
  }
133
-
134
117
  content = this._resolvePossibleFunction(content);
135
-
136
118
  if (!content) {
137
119
  templateElement.remove();
138
120
  return;
139
121
  }
140
-
141
- if (index.isElement(content)) {
142
- this._putElementInTemplate(index.getElement(content), templateElement);
143
-
122
+ if (index_js.isElement(content)) {
123
+ this._putElementInTemplate(index_js.getElement(content), templateElement);
144
124
  return;
145
125
  }
146
-
147
126
  if (this._config.html) {
148
127
  templateElement.innerHTML = this._maybeSanitize(content);
149
128
  return;
150
129
  }
151
-
152
130
  templateElement.textContent = content;
153
131
  }
154
-
155
132
  _maybeSanitize(arg) {
156
- return this._config.sanitize ? sanitizer.sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
133
+ return this._config.sanitize ? sanitizer_js.sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
157
134
  }
158
-
159
135
  _resolvePossibleFunction(arg) {
160
- return typeof arg === 'function' ? arg(this) : arg;
136
+ return index_js.execute(arg, [this]);
161
137
  }
162
-
163
138
  _putElementInTemplate(element, templateElement) {
164
139
  if (this._config.html) {
165
140
  templateElement.innerHTML = '';
166
141
  templateElement.append(element);
167
142
  return;
168
143
  }
169
-
170
144
  templateElement.textContent = element.textContent;
171
145
  }
172
-
173
146
  }
174
147
 
175
148
  return TemplateFactory;
@@ -5,24 +5,24 @@
5
5
  //= require ./bootstrap/dom/manipulator
6
6
  //= require ./bootstrap/util/config
7
7
  //= require ./bootstrap/base-component
8
- //= require ./bootstrap/util/component-functions
9
- //= require ./bootstrap/alert
10
- //= require ./bootstrap/button
11
8
  //= require ./bootstrap/dom/selector-engine
12
- //= require ./bootstrap/util/swipe
13
- //= require ./bootstrap/carousel
14
9
  //= require ./bootstrap/collapse
15
- //= require ./bootstrap/dropdown
10
+ //= require ./bootstrap/util/sanitizer
16
11
  //= require ./bootstrap/util/backdrop
17
- //= require ./bootstrap/util/focustrap
18
12
  //= require ./bootstrap/util/scrollbar
13
+ //= require ./bootstrap/util/component-functions
14
+ //= require ./bootstrap/util/focustrap
19
15
  //= require ./bootstrap/modal
20
- //= require ./bootstrap/offcanvas
21
- //= require ./bootstrap/util/sanitizer
22
16
  //= require ./bootstrap/util/template-factory
23
17
  //= require ./bootstrap/tooltip
18
+ //= require ./bootstrap/offcanvas
19
+ //= require ./bootstrap/util/swipe
20
+ //= require ./bootstrap/toast
21
+ //= require ./bootstrap/button
22
+ //= require ./bootstrap/alert
24
23
  //= require ./bootstrap/popover
25
24
  //= require ./bootstrap/scrollspy
25
+ //= require ./bootstrap/dropdown
26
26
  //= require ./bootstrap/tab
27
- //= require ./bootstrap/toast
27
+ //= require ./bootstrap/carousel
28
28
  //= require ./bootstrap-global-this-undefine