bootstrap 5.1.1 → 5.1.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/javascripts/bootstrap/alert.js +13 -13
- data/assets/javascripts/bootstrap/base-component.js +13 -13
- data/assets/javascripts/bootstrap/button.js +10 -10
- data/assets/javascripts/bootstrap/carousel.js +39 -39
- data/assets/javascripts/bootstrap/collapse.js +28 -27
- data/assets/javascripts/bootstrap/dom/data.js +5 -5
- data/assets/javascripts/bootstrap/dom/event-handler.js +5 -5
- data/assets/javascripts/bootstrap/dom/manipulator.js +4 -4
- data/assets/javascripts/bootstrap/dom/selector-engine.js +5 -5
- data/assets/javascripts/bootstrap/dropdown.js +37 -39
- data/assets/javascripts/bootstrap/modal.js +51 -51
- data/assets/javascripts/bootstrap/offcanvas.js +40 -40
- data/assets/javascripts/bootstrap/popover.js +10 -10
- data/assets/javascripts/bootstrap/scrollspy.js +27 -27
- data/assets/javascripts/bootstrap/tab.js +19 -19
- data/assets/javascripts/bootstrap/toast.js +21 -21
- data/assets/javascripts/bootstrap/tooltip.js +55 -58
- data/assets/javascripts/bootstrap-sprockets.js +7 -7
- data/assets/javascripts/bootstrap.js +64 -66
- data/assets/javascripts/bootstrap.min.js +2 -2
- data/assets/stylesheets/_bootstrap-grid.scss +1 -1
- data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
- data/assets/stylesheets/_bootstrap.scss +1 -1
- data/assets/stylesheets/bootstrap/_buttons.scss +1 -0
- data/assets/stylesheets/bootstrap/_tables.scss +8 -4
- data/assets/stylesheets/bootstrap/_variables.scss +6 -4
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +4 -3
- data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +1 -1
- data/lib/bootstrap/version.rb +2 -2
- metadata +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap tooltip.js v5.1.
|
2
|
+
* Bootstrap tooltip.js v5.1.2 (https://getbootstrap.com/)
|
3
3
|
* Copyright 2011-2021 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
|
*/
|
@@ -7,40 +7,38 @@
|
|
7
7
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core'), require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('./dom/selector-engine.js'), require('./base-component.js')) :
|
8
8
|
typeof define === 'function' && define.amd ? define(['@popperjs/core', './dom/data', './dom/event-handler', './dom/manipulator', './dom/selector-engine', './base-component'], factory) :
|
9
9
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Tooltip = factory(global.Popper, global.Data, global.EventHandler, global.Manipulator, global.SelectorEngine, global.Base));
|
10
|
-
}(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
|
10
|
+
})(this, (function (Popper, Data, EventHandler, Manipulator, SelectorEngine, BaseComponent) { 'use strict';
|
11
11
|
|
12
|
-
|
12
|
+
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
13
13
|
|
14
14
|
function _interopNamespace(e) {
|
15
15
|
if (e && e.__esModule) return e;
|
16
|
-
|
16
|
+
const n = Object.create(null);
|
17
17
|
if (e) {
|
18
|
-
|
18
|
+
for (const k in e) {
|
19
19
|
if (k !== 'default') {
|
20
|
-
|
20
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
21
21
|
Object.defineProperty(n, k, d.get ? d : {
|
22
22
|
enumerable: true,
|
23
|
-
get:
|
24
|
-
return e[k];
|
25
|
-
}
|
23
|
+
get: () => e[k]
|
26
24
|
});
|
27
25
|
}
|
28
|
-
}
|
26
|
+
}
|
29
27
|
}
|
30
|
-
n
|
28
|
+
n.default = e;
|
31
29
|
return Object.freeze(n);
|
32
30
|
}
|
33
31
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
const Popper__namespace = /*#__PURE__*/_interopNamespace(Popper);
|
33
|
+
const Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
34
|
+
const EventHandler__default = /*#__PURE__*/_interopDefaultLegacy(EventHandler);
|
35
|
+
const Manipulator__default = /*#__PURE__*/_interopDefaultLegacy(Manipulator);
|
36
|
+
const SelectorEngine__default = /*#__PURE__*/_interopDefaultLegacy(SelectorEngine);
|
37
|
+
const BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
|
40
38
|
|
41
39
|
/**
|
42
40
|
* --------------------------------------------------------------------------
|
43
|
-
* Bootstrap (v5.1.
|
41
|
+
* Bootstrap (v5.1.2): util/index.js
|
44
42
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
45
43
|
* --------------------------------------------------------------------------
|
46
44
|
*/
|
@@ -182,42 +180,42 @@
|
|
182
180
|
|
183
181
|
/**
|
184
182
|
* --------------------------------------------------------------------------
|
185
|
-
* Bootstrap (v5.1.
|
183
|
+
* Bootstrap (v5.1.2): util/sanitizer.js
|
186
184
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
187
185
|
* --------------------------------------------------------------------------
|
188
186
|
*/
|
189
|
-
const
|
187
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
190
188
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
191
189
|
/**
|
192
190
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
193
191
|
*
|
194
|
-
* Shoutout to Angular
|
192
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
195
193
|
*/
|
196
194
|
|
197
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
195
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
198
196
|
/**
|
199
197
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
200
198
|
*
|
201
|
-
* Shoutout to Angular
|
199
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
202
200
|
*/
|
203
201
|
|
204
202
|
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
|
205
203
|
|
206
|
-
const allowedAttribute = (
|
207
|
-
const
|
204
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
205
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
208
206
|
|
209
|
-
if (allowedAttributeList.includes(
|
210
|
-
if (
|
211
|
-
return Boolean(SAFE_URL_PATTERN.test(
|
207
|
+
if (allowedAttributeList.includes(attributeName)) {
|
208
|
+
if (uriAttributes.has(attributeName)) {
|
209
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
212
210
|
}
|
213
211
|
|
214
212
|
return true;
|
215
213
|
}
|
216
214
|
|
217
|
-
const regExp = allowedAttributeList.filter(
|
215
|
+
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
218
216
|
|
219
217
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
220
|
-
if (regExp[i].test(
|
218
|
+
if (regExp[i].test(attributeName)) {
|
221
219
|
return true;
|
222
220
|
}
|
223
221
|
}
|
@@ -269,23 +267,22 @@
|
|
269
267
|
|
270
268
|
const domParser = new window.DOMParser();
|
271
269
|
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
272
|
-
const allowlistKeys = Object.keys(allowList);
|
273
270
|
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
274
271
|
|
275
272
|
for (let i = 0, len = elements.length; i < len; i++) {
|
276
|
-
const
|
277
|
-
const
|
273
|
+
const element = elements[i];
|
274
|
+
const elementName = element.nodeName.toLowerCase();
|
278
275
|
|
279
|
-
if (!
|
280
|
-
|
276
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
277
|
+
element.remove();
|
281
278
|
continue;
|
282
279
|
}
|
283
280
|
|
284
|
-
const attributeList = [].concat(...
|
285
|
-
const allowedAttributes = [].concat(allowList['*'] || [], allowList[
|
286
|
-
attributeList.forEach(
|
287
|
-
if (!allowedAttribute(
|
288
|
-
|
281
|
+
const attributeList = [].concat(...element.attributes);
|
282
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
283
|
+
attributeList.forEach(attribute => {
|
284
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
285
|
+
element.removeAttribute(attribute.nodeName);
|
289
286
|
}
|
290
287
|
});
|
291
288
|
}
|
@@ -295,7 +292,7 @@
|
|
295
292
|
|
296
293
|
/**
|
297
294
|
* --------------------------------------------------------------------------
|
298
|
-
* Bootstrap (v5.1.
|
295
|
+
* Bootstrap (v5.1.2): tooltip.js
|
299
296
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
300
297
|
* --------------------------------------------------------------------------
|
301
298
|
*/
|
@@ -385,7 +382,7 @@
|
|
385
382
|
* ------------------------------------------------------------------------
|
386
383
|
*/
|
387
384
|
|
388
|
-
class Tooltip extends BaseComponent__default
|
385
|
+
class Tooltip extends BaseComponent__default.default {
|
389
386
|
constructor(element, config) {
|
390
387
|
if (typeof Popper__namespace === 'undefined') {
|
391
388
|
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
|
@@ -463,7 +460,7 @@
|
|
463
460
|
|
464
461
|
dispose() {
|
465
462
|
clearTimeout(this._timeout);
|
466
|
-
EventHandler__default
|
463
|
+
EventHandler__default.default.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
467
464
|
|
468
465
|
if (this.tip) {
|
469
466
|
this.tip.remove();
|
@@ -483,7 +480,7 @@
|
|
483
480
|
return;
|
484
481
|
}
|
485
482
|
|
486
|
-
const showEvent = EventHandler__default
|
483
|
+
const showEvent = EventHandler__default.default.trigger(this._element, this.constructor.Event.SHOW);
|
487
484
|
const shadowRoot = findShadowRoot(this._element);
|
488
485
|
const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element);
|
489
486
|
|
@@ -519,11 +516,11 @@
|
|
519
516
|
const {
|
520
517
|
container
|
521
518
|
} = this._config;
|
522
|
-
Data__default
|
519
|
+
Data__default.default.set(tip, this.constructor.DATA_KEY, this);
|
523
520
|
|
524
521
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
525
522
|
container.append(tip);
|
526
|
-
EventHandler__default
|
523
|
+
EventHandler__default.default.trigger(this._element, this.constructor.Event.INSERTED);
|
527
524
|
}
|
528
525
|
|
529
526
|
if (this._popper) {
|
@@ -546,14 +543,14 @@
|
|
546
543
|
|
547
544
|
if ('ontouchstart' in document.documentElement) {
|
548
545
|
[].concat(...document.body.children).forEach(element => {
|
549
|
-
EventHandler__default
|
546
|
+
EventHandler__default.default.on(element, 'mouseover', noop);
|
550
547
|
});
|
551
548
|
}
|
552
549
|
|
553
550
|
const complete = () => {
|
554
551
|
const prevHoverState = this._hoverState;
|
555
552
|
this._hoverState = null;
|
556
|
-
EventHandler__default
|
553
|
+
EventHandler__default.default.trigger(this._element, this.constructor.Event.SHOWN);
|
557
554
|
|
558
555
|
if (prevHoverState === HOVER_STATE_OUT) {
|
559
556
|
this._leave(null, this);
|
@@ -585,12 +582,12 @@
|
|
585
582
|
|
586
583
|
this._element.removeAttribute('aria-describedby');
|
587
584
|
|
588
|
-
EventHandler__default
|
585
|
+
EventHandler__default.default.trigger(this._element, this.constructor.Event.HIDDEN);
|
589
586
|
|
590
587
|
this._disposePopper();
|
591
588
|
};
|
592
589
|
|
593
|
-
const hideEvent = EventHandler__default
|
590
|
+
const hideEvent = EventHandler__default.default.trigger(this._element, this.constructor.Event.HIDE);
|
594
591
|
|
595
592
|
if (hideEvent.defaultPrevented) {
|
596
593
|
return;
|
@@ -600,7 +597,7 @@
|
|
600
597
|
// empty mouseover listeners we added for iOS support
|
601
598
|
|
602
599
|
if ('ontouchstart' in document.documentElement) {
|
603
|
-
[].concat(...document.body.children).forEach(element => EventHandler__default
|
600
|
+
[].concat(...document.body.children).forEach(element => EventHandler__default.default.off(element, 'mouseover', noop));
|
604
601
|
}
|
605
602
|
|
606
603
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
@@ -643,7 +640,7 @@
|
|
643
640
|
}
|
644
641
|
|
645
642
|
_sanitizeAndSetContent(template, content, selector) {
|
646
|
-
const templateElement = SelectorEngine__default
|
643
|
+
const templateElement = SelectorEngine__default.default.findOne(selector, template);
|
647
644
|
|
648
645
|
if (!content && templateElement) {
|
649
646
|
templateElement.remove();
|
@@ -781,12 +778,12 @@
|
|
781
778
|
|
782
779
|
triggers.forEach(trigger => {
|
783
780
|
if (trigger === 'click') {
|
784
|
-
EventHandler__default
|
781
|
+
EventHandler__default.default.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event));
|
785
782
|
} else if (trigger !== TRIGGER_MANUAL) {
|
786
783
|
const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN;
|
787
784
|
const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT;
|
788
|
-
EventHandler__default
|
789
|
-
EventHandler__default
|
785
|
+
EventHandler__default.default.on(this._element, eventIn, this._config.selector, event => this._enter(event));
|
786
|
+
EventHandler__default.default.on(this._element, eventOut, this._config.selector, event => this._leave(event));
|
790
787
|
}
|
791
788
|
});
|
792
789
|
|
@@ -796,7 +793,7 @@
|
|
796
793
|
}
|
797
794
|
};
|
798
795
|
|
799
|
-
EventHandler__default
|
796
|
+
EventHandler__default.default.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
800
797
|
|
801
798
|
if (this._config.selector) {
|
802
799
|
this._config = { ...this._config,
|
@@ -888,7 +885,7 @@
|
|
888
885
|
}
|
889
886
|
|
890
887
|
_getConfig(config) {
|
891
|
-
const dataAttributes = Manipulator__default
|
888
|
+
const dataAttributes = Manipulator__default.default.getDataAttributes(this._element);
|
892
889
|
Object.keys(dataAttributes).forEach(dataAttr => {
|
893
890
|
if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
|
894
891
|
delete dataAttributes[dataAttr];
|
@@ -1005,4 +1002,4 @@
|
|
1005
1002
|
|
1006
1003
|
return Tooltip;
|
1007
1004
|
|
1008
|
-
}))
|
1005
|
+
}));
|
@@ -1,19 +1,19 @@
|
|
1
1
|
//= require ./bootstrap-global-this-define
|
2
|
+
//= require ./bootstrap/dom/manipulator
|
2
3
|
//= require ./bootstrap/dom/data
|
3
4
|
//= require ./bootstrap/dom/event-handler
|
4
5
|
//= require ./bootstrap/base-component
|
5
|
-
//= require ./bootstrap/dom/manipulator
|
6
6
|
//= require ./bootstrap/dom/selector-engine
|
7
|
-
//= require ./bootstrap/
|
8
|
-
//= require ./bootstrap/carousel
|
9
|
-
//= require ./bootstrap/alert
|
10
|
-
//= require ./bootstrap/modal
|
7
|
+
//= require ./bootstrap/offcanvas
|
11
8
|
//= require ./bootstrap/tooltip
|
12
9
|
//= require ./bootstrap/popover
|
10
|
+
//= require ./bootstrap/modal
|
13
11
|
//= require ./bootstrap/button
|
14
|
-
//= require ./bootstrap/collapse
|
15
12
|
//= require ./bootstrap/tab
|
16
|
-
//= require ./bootstrap/offcanvas
|
17
13
|
//= require ./bootstrap/dropdown
|
14
|
+
//= require ./bootstrap/alert
|
18
15
|
//= require ./bootstrap/toast
|
16
|
+
//= require ./bootstrap/carousel
|
17
|
+
//= require ./bootstrap/scrollspy
|
18
|
+
//= require ./bootstrap/collapse
|
19
19
|
//= require ./bootstrap-global-this-undefine
|