bootstrap 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +55 -0
  3. data/README.md +25 -5
  4. data/assets/javascripts/bootstrap/alert.js +22 -32
  5. data/assets/javascripts/bootstrap/base-component.js +22 -38
  6. data/assets/javascripts/bootstrap/button.js +19 -22
  7. data/assets/javascripts/bootstrap/carousel.js +52 -135
  8. data/assets/javascripts/bootstrap/collapse.js +40 -102
  9. data/assets/javascripts/bootstrap/dom/data.js +8 -12
  10. data/assets/javascripts/bootstrap/dom/event-handler.js +19 -66
  11. data/assets/javascripts/bootstrap/dom/manipulator.js +4 -17
  12. data/assets/javascripts/bootstrap/dom/selector-engine.js +42 -24
  13. data/assets/javascripts/bootstrap/dropdown.js +74 -143
  14. data/assets/javascripts/bootstrap/modal.js +66 -143
  15. data/assets/javascripts/bootstrap/offcanvas.js +50 -102
  16. data/assets/javascripts/bootstrap/popover.js +23 -29
  17. data/assets/javascripts/bootstrap/scrollspy.js +64 -97
  18. data/assets/javascripts/bootstrap/tab.js +55 -112
  19. data/assets/javascripts/bootstrap/toast.js +39 -77
  20. data/assets/javascripts/bootstrap/tooltip.js +99 -216
  21. data/assets/javascripts/bootstrap/util/backdrop.js +28 -54
  22. data/assets/javascripts/bootstrap/util/component-functions.js +13 -18
  23. data/assets/javascripts/bootstrap/util/config.js +15 -27
  24. data/assets/javascripts/bootstrap/util/focustrap.js +20 -36
  25. data/assets/javascripts/bootstrap/util/index.js +42 -111
  26. data/assets/javascripts/bootstrap/util/sanitizer.js +30 -42
  27. data/assets/javascripts/bootstrap/util/scrollbar.js +24 -50
  28. data/assets/javascripts/bootstrap/util/swipe.js +27 -48
  29. data/assets/javascripts/bootstrap/util/template-factory.js +25 -52
  30. data/assets/javascripts/bootstrap-sprockets.js +12 -12
  31. data/assets/javascripts/bootstrap.js +764 -1529
  32. data/assets/javascripts/bootstrap.min.js +3 -3
  33. data/assets/stylesheets/_bootstrap-grid.scss +1 -3
  34. data/assets/stylesheets/_bootstrap-reboot.scss +1 -0
  35. data/assets/stylesheets/_bootstrap.scss +1 -0
  36. data/assets/stylesheets/bootstrap/_accordion.scss +16 -4
  37. data/assets/stylesheets/bootstrap/_alert.scss +8 -11
  38. data/assets/stylesheets/bootstrap/_button-group.scss +3 -3
  39. data/assets/stylesheets/bootstrap/_buttons.scss +31 -10
  40. data/assets/stylesheets/bootstrap/_card.scss +5 -0
  41. data/assets/stylesheets/bootstrap/_carousel.scss +20 -5
  42. data/assets/stylesheets/bootstrap/_close.scss +32 -9
  43. data/assets/stylesheets/bootstrap/_dropdown.scss +3 -1
  44. data/assets/stylesheets/bootstrap/_functions.scss +3 -3
  45. data/assets/stylesheets/bootstrap/_grid.scss +6 -0
  46. data/assets/stylesheets/bootstrap/_helpers.scss +2 -0
  47. data/assets/stylesheets/bootstrap/_list-group.scss +18 -12
  48. data/assets/stylesheets/bootstrap/_maps.scss +120 -0
  49. data/assets/stylesheets/bootstrap/_mixins.scss +1 -2
  50. data/assets/stylesheets/bootstrap/_modal.scss +1 -1
  51. data/assets/stylesheets/bootstrap/_nav.scss +42 -5
  52. data/assets/stylesheets/bootstrap/_navbar.scss +17 -4
  53. data/assets/stylesheets/bootstrap/_offcanvas.scss +9 -6
  54. data/assets/stylesheets/bootstrap/_pagination.scss +1 -1
  55. data/assets/stylesheets/bootstrap/_popover.scss +5 -5
  56. data/assets/stylesheets/bootstrap/_progress.scss +10 -1
  57. data/assets/stylesheets/bootstrap/_reboot.scss +3 -3
  58. data/assets/stylesheets/bootstrap/_root.scss +121 -10
  59. data/assets/stylesheets/bootstrap/_tables.scss +18 -11
  60. data/assets/stylesheets/bootstrap/_toasts.scss +5 -2
  61. data/assets/stylesheets/bootstrap/_tooltip.scss +4 -5
  62. data/assets/stylesheets/bootstrap/_utilities.scss +172 -13
  63. data/assets/stylesheets/bootstrap/_variables-dark.scss +85 -0
  64. data/assets/stylesheets/bootstrap/_variables.scss +272 -162
  65. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +4 -0
  66. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +23 -3
  67. data/assets/stylesheets/bootstrap/forms/_form-check.scss +24 -11
  68. data/assets/stylesheets/bootstrap/forms/_form-control.scss +23 -3
  69. data/assets/stylesheets/bootstrap/forms/_form-select.scss +11 -2
  70. data/assets/stylesheets/bootstrap/forms/_input-group.scss +7 -4
  71. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +0 -2
  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/mixins/_alert.scss +4 -1
  76. data/assets/stylesheets/bootstrap/mixins/_banner.scss +3 -5
  77. data/assets/stylesheets/bootstrap/mixins/_caret.scss +30 -25
  78. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  79. data/assets/stylesheets/bootstrap/mixins/_forms.scss +18 -17
  80. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
  81. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +2 -2
  82. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +2 -2
  83. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +5 -1
  84. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +23 -29
  85. data/bootstrap.gemspec +1 -1
  86. data/lib/bootstrap/version.rb +2 -2
  87. data/tasks/updater/js.rb +2 -2
  88. data/tasks/updater/network.rb +2 -2
  89. data/tasks/updater/scss.rb +1 -1
  90. data/tasks/updater.rb +2 -2
  91. data/test/gemfiles/rails_5_2.gemfile +8 -0
  92. data/test/gemfiles/rails_7_0.gemfile +7 -0
  93. data/test/test_helper.rb +3 -2
  94. metadata +17 -9
  95. data/.travis.yml +0 -32
@@ -1,25 +1,22 @@
1
1
  /*!
2
- * Bootstrap swipe.js v5.2.0 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap swipe.js v5.3.0 (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.0): 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.0 (https://getbootstrap.com/)
3
- * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
2
+ * Bootstrap template-factory.js v5.3.0 (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.0): 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;
@@ -1,28 +1,28 @@
1
1
  //= require ./bootstrap-global-this-define
2
+ //= require ./bootstrap/dom/manipulator
2
3
  //= require ./bootstrap/dom/data
3
4
  //= require ./bootstrap/util/index
4
5
  //= require ./bootstrap/dom/event-handler
5
- //= require ./bootstrap/dom/manipulator
6
6
  //= require ./bootstrap/util/config
7
7
  //= require ./bootstrap/base-component
8
+ //= require ./bootstrap/dom/selector-engine
8
9
  //= require ./bootstrap/util/component-functions
9
- //= require ./bootstrap/alert
10
+ //= require ./bootstrap/toast
10
11
  //= require ./bootstrap/button
11
- //= require ./bootstrap/dom/selector-engine
12
+ //= require ./bootstrap/alert
13
+ //= require ./bootstrap/util/sanitizer
14
+ //= require ./bootstrap/util/template-factory
12
15
  //= require ./bootstrap/util/swipe
13
16
  //= require ./bootstrap/carousel
14
- //= require ./bootstrap/collapse
15
- //= require ./bootstrap/dropdown
16
- //= require ./bootstrap/util/backdrop
17
+ //= require ./bootstrap/tooltip
17
18
  //= require ./bootstrap/util/focustrap
19
+ //= require ./bootstrap/util/backdrop
18
20
  //= require ./bootstrap/util/scrollbar
19
- //= require ./bootstrap/modal
20
21
  //= require ./bootstrap/offcanvas
21
- //= require ./bootstrap/util/sanitizer
22
- //= require ./bootstrap/util/template-factory
23
- //= require ./bootstrap/tooltip
24
22
  //= require ./bootstrap/popover
25
- //= require ./bootstrap/scrollspy
23
+ //= require ./bootstrap/modal
26
24
  //= require ./bootstrap/tab
27
- //= require ./bootstrap/toast
25
+ //= require ./bootstrap/dropdown
26
+ //= require ./bootstrap/collapse
27
+ //= require ./bootstrap/scrollspy
28
28
  //= require ./bootstrap-global-this-undefine