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