@openeuropa/bcl-theme-joinup 1.9.0 → 1.9.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.
- package/css/oe-bcl-joinup.css +2384 -747
- package/css/oe-bcl-joinup.css.map +1 -1
- package/css/oe-bcl-joinup.min.css +1 -1
- package/css/oe-bcl-joinup.min.css.map +1 -1
- package/icons/bcl-default-icons.svg +1 -1
- package/icons/bootstrap-icons.svg +1 -1
- package/js/oe-bcl-joinup.bundle.js +552 -409
- package/js/oe-bcl-joinup.bundle.js.map +1 -1
- package/js/oe-bcl-joinup.bundle.min.js +1 -1
- package/js/oe-bcl-joinup.bundle.min.js.map +1 -1
- package/js/oe-bcl-joinup.esm.js +542 -400
- package/js/oe-bcl-joinup.esm.js.map +1 -1
- package/js/oe-bcl-joinup.esm.min.js +1 -1
- package/js/oe-bcl-joinup.esm.min.js.map +1 -1
- package/js/oe-bcl-joinup.umd.js +552 -409
- package/js/oe-bcl-joinup.umd.js.map +1 -1
- package/js/oe-bcl-joinup.umd.min.js +1 -1
- package/js/oe-bcl-joinup.umd.min.js.map +1 -1
- package/package.json +6 -6
- package/src/js/index.esm.js +2 -0
- package/src/js/index.umd.js +2 -0
- package/templates/bcl-accordion/accordion.html.twig +85 -46
- package/templates/bcl-inpage-navigation/inpage-navigation.html.twig +9 -1
- package/templates/bcl-mega-menu/mega-menu.html.twig +0 -116
package/js/oe-bcl-joinup.esm.js
CHANGED
|
@@ -2,7 +2,55 @@ import * as Popper from '@popperjs/core';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* --------------------------------------------------------------------------
|
|
5
|
-
* Bootstrap
|
|
5
|
+
* Bootstrap dom/data.js
|
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
7
|
+
* --------------------------------------------------------------------------
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Constants
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const elementMap = new Map();
|
|
15
|
+
var Data = {
|
|
16
|
+
set(element, key, instance) {
|
|
17
|
+
if (!elementMap.has(element)) {
|
|
18
|
+
elementMap.set(element, new Map());
|
|
19
|
+
}
|
|
20
|
+
const instanceMap = elementMap.get(element);
|
|
21
|
+
|
|
22
|
+
// make it clear we only want one instance per element
|
|
23
|
+
// can be removed later when multiple key/instances are fine to be used
|
|
24
|
+
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
|
25
|
+
// eslint-disable-next-line no-console
|
|
26
|
+
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
instanceMap.set(key, instance);
|
|
30
|
+
},
|
|
31
|
+
get(element, key) {
|
|
32
|
+
if (elementMap.has(element)) {
|
|
33
|
+
return elementMap.get(element).get(key) || null;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
},
|
|
37
|
+
remove(element, key) {
|
|
38
|
+
if (!elementMap.has(element)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const instanceMap = elementMap.get(element);
|
|
42
|
+
instanceMap.delete(key);
|
|
43
|
+
|
|
44
|
+
// free up element references if there are no instances left for an element
|
|
45
|
+
if (instanceMap.size === 0) {
|
|
46
|
+
elementMap.delete(element);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* --------------------------------------------------------------------------
|
|
53
|
+
* Bootstrap util/index.js
|
|
6
54
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
7
55
|
* --------------------------------------------------------------------------
|
|
8
56
|
*/
|
|
@@ -11,6 +59,19 @@ const MAX_UID = 1_000_000;
|
|
|
11
59
|
const MILLISECONDS_MULTIPLIER = 1000;
|
|
12
60
|
const TRANSITION_END = 'transitionend';
|
|
13
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Properly escape IDs selectors to handle weird IDs
|
|
64
|
+
* @param {string} selector
|
|
65
|
+
* @returns {string}
|
|
66
|
+
*/
|
|
67
|
+
const parseSelector = selector => {
|
|
68
|
+
if (selector && window.CSS && window.CSS.escape) {
|
|
69
|
+
// document.querySelector needs escaping to handle IDs (html5+) containing for instance /
|
|
70
|
+
selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`);
|
|
71
|
+
}
|
|
72
|
+
return selector;
|
|
73
|
+
};
|
|
74
|
+
|
|
14
75
|
// Shout-out Angus Croll (https://goo.gl/pxwQGp)
|
|
15
76
|
const toType = object => {
|
|
16
77
|
if (object === null || object === undefined) {
|
|
@@ -29,38 +90,6 @@ const getUID = prefix => {
|
|
|
29
90
|
} while (document.getElementById(prefix));
|
|
30
91
|
return prefix;
|
|
31
92
|
};
|
|
32
|
-
const getSelector = element => {
|
|
33
|
-
let selector = element.getAttribute('data-bs-target');
|
|
34
|
-
if (!selector || selector === '#') {
|
|
35
|
-
let hrefAttribute = element.getAttribute('href');
|
|
36
|
-
|
|
37
|
-
// The only valid content that could double as a selector are IDs or classes,
|
|
38
|
-
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
|
39
|
-
// `document.querySelector` will rightfully complain it is invalid.
|
|
40
|
-
// See https://github.com/twbs/bootstrap/issues/32273
|
|
41
|
-
if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Just in case some CMS puts out a full URL with the anchor appended
|
|
46
|
-
if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
|
|
47
|
-
hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
|
|
48
|
-
}
|
|
49
|
-
selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
|
|
50
|
-
}
|
|
51
|
-
return selector;
|
|
52
|
-
};
|
|
53
|
-
const getSelectorFromElement = element => {
|
|
54
|
-
const selector = getSelector(element);
|
|
55
|
-
if (selector) {
|
|
56
|
-
return document.querySelector(selector) ? selector : null;
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
59
|
-
};
|
|
60
|
-
const getElementFromSelector = element => {
|
|
61
|
-
const selector = getSelector(element);
|
|
62
|
-
return selector ? document.querySelector(selector) : null;
|
|
63
|
-
};
|
|
64
93
|
const getTransitionDurationFromElement = element => {
|
|
65
94
|
if (!element) {
|
|
66
95
|
return 0;
|
|
@@ -87,7 +116,7 @@ const getTransitionDurationFromElement = element => {
|
|
|
87
116
|
const triggerTransitionEnd = element => {
|
|
88
117
|
element.dispatchEvent(new Event(TRANSITION_END));
|
|
89
118
|
};
|
|
90
|
-
const isElement = object => {
|
|
119
|
+
const isElement$1 = object => {
|
|
91
120
|
if (!object || typeof object !== 'object') {
|
|
92
121
|
return false;
|
|
93
122
|
}
|
|
@@ -96,18 +125,18 @@ const isElement = object => {
|
|
|
96
125
|
}
|
|
97
126
|
return typeof object.nodeType !== 'undefined';
|
|
98
127
|
};
|
|
99
|
-
const getElement = object => {
|
|
128
|
+
const getElement$1 = object => {
|
|
100
129
|
// it's a jQuery object or a node element
|
|
101
|
-
if (isElement(object)) {
|
|
130
|
+
if (isElement$1(object)) {
|
|
102
131
|
return object.jquery ? object[0] : object;
|
|
103
132
|
}
|
|
104
133
|
if (typeof object === 'string' && object.length > 0) {
|
|
105
|
-
return document.querySelector(object);
|
|
134
|
+
return document.querySelector(parseSelector(object));
|
|
106
135
|
}
|
|
107
136
|
return null;
|
|
108
137
|
};
|
|
109
138
|
const isVisible = element => {
|
|
110
|
-
if (!isElement(element) || element.getClientRects().length === 0) {
|
|
139
|
+
if (!isElement$1(element) || element.getClientRects().length === 0) {
|
|
111
140
|
return false;
|
|
112
141
|
}
|
|
113
142
|
const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible';
|
|
@@ -172,32 +201,32 @@ const noop = () => {};
|
|
|
172
201
|
const reflow = element => {
|
|
173
202
|
element.offsetHeight; // eslint-disable-line no-unused-expressions
|
|
174
203
|
};
|
|
175
|
-
const getjQuery = () => {
|
|
204
|
+
const getjQuery$1 = () => {
|
|
176
205
|
if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
|
177
206
|
return window.jQuery;
|
|
178
207
|
}
|
|
179
208
|
return null;
|
|
180
209
|
};
|
|
181
|
-
const DOMContentLoadedCallbacks = [];
|
|
182
|
-
const onDOMContentLoaded = callback => {
|
|
210
|
+
const DOMContentLoadedCallbacks$1 = [];
|
|
211
|
+
const onDOMContentLoaded$1 = callback => {
|
|
183
212
|
if (document.readyState === 'loading') {
|
|
184
213
|
// add listener on the first call when the document is in loading state
|
|
185
|
-
if (!DOMContentLoadedCallbacks.length) {
|
|
214
|
+
if (!DOMContentLoadedCallbacks$1.length) {
|
|
186
215
|
document.addEventListener('DOMContentLoaded', () => {
|
|
187
|
-
for (const callback of DOMContentLoadedCallbacks) {
|
|
216
|
+
for (const callback of DOMContentLoadedCallbacks$1) {
|
|
188
217
|
callback();
|
|
189
218
|
}
|
|
190
219
|
});
|
|
191
220
|
}
|
|
192
|
-
DOMContentLoadedCallbacks.push(callback);
|
|
221
|
+
DOMContentLoadedCallbacks$1.push(callback);
|
|
193
222
|
} else {
|
|
194
223
|
callback();
|
|
195
224
|
}
|
|
196
225
|
};
|
|
197
226
|
const isRTL = () => document.documentElement.dir === 'rtl';
|
|
198
|
-
const defineJQueryPlugin = plugin => {
|
|
199
|
-
onDOMContentLoaded(() => {
|
|
200
|
-
const $ = getjQuery();
|
|
227
|
+
const defineJQueryPlugin$1 = plugin => {
|
|
228
|
+
onDOMContentLoaded$1(() => {
|
|
229
|
+
const $ = getjQuery$1();
|
|
201
230
|
/* istanbul ignore if */
|
|
202
231
|
if ($) {
|
|
203
232
|
const name = plugin.NAME;
|
|
@@ -211,10 +240,8 @@ const defineJQueryPlugin = plugin => {
|
|
|
211
240
|
}
|
|
212
241
|
});
|
|
213
242
|
};
|
|
214
|
-
const execute =
|
|
215
|
-
|
|
216
|
-
callback();
|
|
217
|
-
}
|
|
243
|
+
const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {
|
|
244
|
+
return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue;
|
|
218
245
|
};
|
|
219
246
|
const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
|
|
220
247
|
if (!waitForTransition) {
|
|
@@ -269,7 +296,7 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
|
|
|
269
296
|
|
|
270
297
|
/**
|
|
271
298
|
* --------------------------------------------------------------------------
|
|
272
|
-
* Bootstrap
|
|
299
|
+
* Bootstrap dom/event-handler.js
|
|
273
300
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
274
301
|
* --------------------------------------------------------------------------
|
|
275
302
|
*/
|
|
@@ -340,7 +367,7 @@ function findHandler(events, callable, delegationSelector = null) {
|
|
|
340
367
|
}
|
|
341
368
|
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
|
342
369
|
const isDelegated = typeof handler === 'string';
|
|
343
|
-
//
|
|
370
|
+
// TODO: tooltip passes `false` instead of selector, so we need to check
|
|
344
371
|
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
|
|
345
372
|
let typeEvent = getTypeEvent(originalTypeEvent);
|
|
346
373
|
if (!nativeEvents.has(typeEvent)) {
|
|
@@ -392,9 +419,8 @@ function removeHandler(element, events, typeEvent, handler, delegationSelector)
|
|
|
392
419
|
}
|
|
393
420
|
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
|
394
421
|
const storeElementEvent = events[typeEvent] || {};
|
|
395
|
-
for (const handlerKey of Object.
|
|
422
|
+
for (const [handlerKey, event] of Object.entries(storeElementEvent)) {
|
|
396
423
|
if (handlerKey.includes(namespace)) {
|
|
397
|
-
const event = storeElementEvent[handlerKey];
|
|
398
424
|
removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
|
|
399
425
|
}
|
|
400
426
|
}
|
|
@@ -433,10 +459,9 @@ const EventHandler = {
|
|
|
433
459
|
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
|
|
434
460
|
}
|
|
435
461
|
}
|
|
436
|
-
for (const keyHandlers of Object.
|
|
462
|
+
for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {
|
|
437
463
|
const handlerKey = keyHandlers.replace(stripUidRegex, '');
|
|
438
464
|
if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
|
|
439
|
-
const event = storeElementEvent[keyHandlers];
|
|
440
465
|
removeHandler(element, events, typeEvent, event.callable, event.delegationSelector);
|
|
441
466
|
}
|
|
442
467
|
}
|
|
@@ -445,7 +470,7 @@ const EventHandler = {
|
|
|
445
470
|
if (typeof event !== 'string' || !element) {
|
|
446
471
|
return null;
|
|
447
472
|
}
|
|
448
|
-
const $ = getjQuery();
|
|
473
|
+
const $ = getjQuery$1();
|
|
449
474
|
const typeEvent = getTypeEvent(event);
|
|
450
475
|
const inNamespace = event !== typeEvent;
|
|
451
476
|
let jQueryEvent = null;
|
|
@@ -459,11 +484,10 @@ const EventHandler = {
|
|
|
459
484
|
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
|
460
485
|
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
|
461
486
|
}
|
|
462
|
-
|
|
487
|
+
const evt = hydrateObj(new Event(event, {
|
|
463
488
|
bubbles,
|
|
464
489
|
cancelable: true
|
|
465
|
-
});
|
|
466
|
-
evt = hydrateObj(evt, args);
|
|
490
|
+
}), args);
|
|
467
491
|
if (defaultPrevented) {
|
|
468
492
|
evt.preventDefault();
|
|
469
493
|
}
|
|
@@ -476,8 +500,8 @@ const EventHandler = {
|
|
|
476
500
|
return evt;
|
|
477
501
|
}
|
|
478
502
|
};
|
|
479
|
-
function hydrateObj(obj, meta) {
|
|
480
|
-
for (const [key, value] of Object.entries(meta
|
|
503
|
+
function hydrateObj(obj, meta = {}) {
|
|
504
|
+
for (const [key, value] of Object.entries(meta)) {
|
|
481
505
|
try {
|
|
482
506
|
obj[key] = value;
|
|
483
507
|
} catch {
|
|
@@ -494,55 +518,7 @@ function hydrateObj(obj, meta) {
|
|
|
494
518
|
|
|
495
519
|
/**
|
|
496
520
|
* --------------------------------------------------------------------------
|
|
497
|
-
* Bootstrap
|
|
498
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
499
|
-
* --------------------------------------------------------------------------
|
|
500
|
-
*/
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Constants
|
|
504
|
-
*/
|
|
505
|
-
|
|
506
|
-
const elementMap = new Map();
|
|
507
|
-
var Data = {
|
|
508
|
-
set(element, key, instance) {
|
|
509
|
-
if (!elementMap.has(element)) {
|
|
510
|
-
elementMap.set(element, new Map());
|
|
511
|
-
}
|
|
512
|
-
const instanceMap = elementMap.get(element);
|
|
513
|
-
|
|
514
|
-
// make it clear we only want one instance per element
|
|
515
|
-
// can be removed later when multiple key/instances are fine to be used
|
|
516
|
-
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
|
517
|
-
// eslint-disable-next-line no-console
|
|
518
|
-
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
instanceMap.set(key, instance);
|
|
522
|
-
},
|
|
523
|
-
get(element, key) {
|
|
524
|
-
if (elementMap.has(element)) {
|
|
525
|
-
return elementMap.get(element).get(key) || null;
|
|
526
|
-
}
|
|
527
|
-
return null;
|
|
528
|
-
},
|
|
529
|
-
remove(element, key) {
|
|
530
|
-
if (!elementMap.has(element)) {
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
const instanceMap = elementMap.get(element);
|
|
534
|
-
instanceMap.delete(key);
|
|
535
|
-
|
|
536
|
-
// free up element references if there are no instances left for an element
|
|
537
|
-
if (instanceMap.size === 0) {
|
|
538
|
-
elementMap.delete(element);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* --------------------------------------------------------------------------
|
|
545
|
-
* Bootstrap (v5.2.3): dom/manipulator.js
|
|
521
|
+
* Bootstrap dom/manipulator.js
|
|
546
522
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
547
523
|
* --------------------------------------------------------------------------
|
|
548
524
|
*/
|
|
@@ -599,7 +575,7 @@ const Manipulator$1 = {
|
|
|
599
575
|
|
|
600
576
|
/**
|
|
601
577
|
* --------------------------------------------------------------------------
|
|
602
|
-
* Bootstrap
|
|
578
|
+
* Bootstrap util/config.js
|
|
603
579
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
604
580
|
* --------------------------------------------------------------------------
|
|
605
581
|
*/
|
|
@@ -630,20 +606,19 @@ class Config {
|
|
|
630
606
|
return config;
|
|
631
607
|
}
|
|
632
608
|
_mergeConfigObj(config, element) {
|
|
633
|
-
const jsonConfig = isElement(element) ? Manipulator$1.getDataAttribute(element, 'config') : {}; // try to parse
|
|
609
|
+
const jsonConfig = isElement$1(element) ? Manipulator$1.getDataAttribute(element, 'config') : {}; // try to parse
|
|
634
610
|
|
|
635
611
|
return {
|
|
636
612
|
...this.constructor.Default,
|
|
637
613
|
...(typeof jsonConfig === 'object' ? jsonConfig : {}),
|
|
638
|
-
...(isElement(element) ? Manipulator$1.getDataAttributes(element) : {}),
|
|
614
|
+
...(isElement$1(element) ? Manipulator$1.getDataAttributes(element) : {}),
|
|
639
615
|
...(typeof config === 'object' ? config : {})
|
|
640
616
|
};
|
|
641
617
|
}
|
|
642
618
|
_typeCheckConfig(config, configTypes = this.constructor.DefaultType) {
|
|
643
|
-
for (const property of Object.
|
|
644
|
-
const expectedTypes = configTypes[property];
|
|
619
|
+
for (const [property, expectedTypes] of Object.entries(configTypes)) {
|
|
645
620
|
const value = config[property];
|
|
646
|
-
const valueType = isElement(value) ? 'element' : toType(value);
|
|
621
|
+
const valueType = isElement$1(value) ? 'element' : toType(value);
|
|
647
622
|
if (!new RegExp(expectedTypes).test(valueType)) {
|
|
648
623
|
throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
|
|
649
624
|
}
|
|
@@ -653,7 +628,7 @@ class Config {
|
|
|
653
628
|
|
|
654
629
|
/**
|
|
655
630
|
* --------------------------------------------------------------------------
|
|
656
|
-
* Bootstrap
|
|
631
|
+
* Bootstrap base-component.js
|
|
657
632
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
658
633
|
* --------------------------------------------------------------------------
|
|
659
634
|
*/
|
|
@@ -663,7 +638,7 @@ class Config {
|
|
|
663
638
|
* Constants
|
|
664
639
|
*/
|
|
665
640
|
|
|
666
|
-
const VERSION = '5.
|
|
641
|
+
const VERSION = '5.3.3';
|
|
667
642
|
|
|
668
643
|
/**
|
|
669
644
|
* Class definition
|
|
@@ -672,7 +647,7 @@ const VERSION = '5.2.3';
|
|
|
672
647
|
class BaseComponent extends Config {
|
|
673
648
|
constructor(element, config) {
|
|
674
649
|
super();
|
|
675
|
-
element = getElement(element);
|
|
650
|
+
element = getElement$1(element);
|
|
676
651
|
if (!element) {
|
|
677
652
|
return;
|
|
678
653
|
}
|
|
@@ -701,7 +676,7 @@ class BaseComponent extends Config {
|
|
|
701
676
|
|
|
702
677
|
// Static
|
|
703
678
|
static getInstance(element) {
|
|
704
|
-
return Data.get(getElement(element), this.DATA_KEY);
|
|
679
|
+
return Data.get(getElement$1(element), this.DATA_KEY);
|
|
705
680
|
}
|
|
706
681
|
static getOrCreateInstance(element, config = {}) {
|
|
707
682
|
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
|
|
@@ -722,7 +697,96 @@ class BaseComponent extends Config {
|
|
|
722
697
|
|
|
723
698
|
/**
|
|
724
699
|
* --------------------------------------------------------------------------
|
|
725
|
-
* Bootstrap
|
|
700
|
+
* Bootstrap dom/selector-engine.js
|
|
701
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
702
|
+
* --------------------------------------------------------------------------
|
|
703
|
+
*/
|
|
704
|
+
|
|
705
|
+
const getSelector$1 = element => {
|
|
706
|
+
let selector = element.getAttribute('data-bs-target');
|
|
707
|
+
if (!selector || selector === '#') {
|
|
708
|
+
let hrefAttribute = element.getAttribute('href');
|
|
709
|
+
|
|
710
|
+
// The only valid content that could double as a selector are IDs or classes,
|
|
711
|
+
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
|
712
|
+
// `document.querySelector` will rightfully complain it is invalid.
|
|
713
|
+
// See https://github.com/twbs/bootstrap/issues/32273
|
|
714
|
+
if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// Just in case some CMS puts out a full URL with the anchor appended
|
|
719
|
+
if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
|
|
720
|
+
hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
|
|
721
|
+
}
|
|
722
|
+
selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
|
|
723
|
+
}
|
|
724
|
+
return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null;
|
|
725
|
+
};
|
|
726
|
+
const SelectorEngine = {
|
|
727
|
+
find(selector, element = document.documentElement) {
|
|
728
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
729
|
+
},
|
|
730
|
+
findOne(selector, element = document.documentElement) {
|
|
731
|
+
return Element.prototype.querySelector.call(element, selector);
|
|
732
|
+
},
|
|
733
|
+
children(element, selector) {
|
|
734
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
735
|
+
},
|
|
736
|
+
parents(element, selector) {
|
|
737
|
+
const parents = [];
|
|
738
|
+
let ancestor = element.parentNode.closest(selector);
|
|
739
|
+
while (ancestor) {
|
|
740
|
+
parents.push(ancestor);
|
|
741
|
+
ancestor = ancestor.parentNode.closest(selector);
|
|
742
|
+
}
|
|
743
|
+
return parents;
|
|
744
|
+
},
|
|
745
|
+
prev(element, selector) {
|
|
746
|
+
let previous = element.previousElementSibling;
|
|
747
|
+
while (previous) {
|
|
748
|
+
if (previous.matches(selector)) {
|
|
749
|
+
return [previous];
|
|
750
|
+
}
|
|
751
|
+
previous = previous.previousElementSibling;
|
|
752
|
+
}
|
|
753
|
+
return [];
|
|
754
|
+
},
|
|
755
|
+
// TODO: this is now unused; remove later along with prev()
|
|
756
|
+
next(element, selector) {
|
|
757
|
+
let next = element.nextElementSibling;
|
|
758
|
+
while (next) {
|
|
759
|
+
if (next.matches(selector)) {
|
|
760
|
+
return [next];
|
|
761
|
+
}
|
|
762
|
+
next = next.nextElementSibling;
|
|
763
|
+
}
|
|
764
|
+
return [];
|
|
765
|
+
},
|
|
766
|
+
focusableChildren(element) {
|
|
767
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
|
|
768
|
+
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
769
|
+
},
|
|
770
|
+
getSelectorFromElement(element) {
|
|
771
|
+
const selector = getSelector$1(element);
|
|
772
|
+
if (selector) {
|
|
773
|
+
return SelectorEngine.findOne(selector) ? selector : null;
|
|
774
|
+
}
|
|
775
|
+
return null;
|
|
776
|
+
},
|
|
777
|
+
getElementFromSelector(element) {
|
|
778
|
+
const selector = getSelector$1(element);
|
|
779
|
+
return selector ? SelectorEngine.findOne(selector) : null;
|
|
780
|
+
},
|
|
781
|
+
getMultipleElementsFromSelector(element) {
|
|
782
|
+
const selector = getSelector$1(element);
|
|
783
|
+
return selector ? SelectorEngine.find(selector) : [];
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* --------------------------------------------------------------------------
|
|
789
|
+
* Bootstrap util/component-functions.js
|
|
726
790
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
727
791
|
* --------------------------------------------------------------------------
|
|
728
792
|
*/
|
|
@@ -737,7 +801,7 @@ const enableDismissTrigger = (component, method = 'hide') => {
|
|
|
737
801
|
if (isDisabled(this)) {
|
|
738
802
|
return;
|
|
739
803
|
}
|
|
740
|
-
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
|
804
|
+
const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);
|
|
741
805
|
const instance = component.getOrCreateInstance(target);
|
|
742
806
|
|
|
743
807
|
// Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
|
@@ -747,7 +811,7 @@ const enableDismissTrigger = (component, method = 'hide') => {
|
|
|
747
811
|
|
|
748
812
|
/**
|
|
749
813
|
* --------------------------------------------------------------------------
|
|
750
|
-
* Bootstrap
|
|
814
|
+
* Bootstrap alert.js
|
|
751
815
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
752
816
|
* --------------------------------------------------------------------------
|
|
753
817
|
*/
|
|
@@ -818,11 +882,11 @@ enableDismissTrigger(Alert, 'close');
|
|
|
818
882
|
* jQuery
|
|
819
883
|
*/
|
|
820
884
|
|
|
821
|
-
defineJQueryPlugin(Alert);
|
|
885
|
+
defineJQueryPlugin$1(Alert);
|
|
822
886
|
|
|
823
887
|
/**
|
|
824
888
|
* --------------------------------------------------------------------------
|
|
825
|
-
* Bootstrap
|
|
889
|
+
* Bootstrap button.js
|
|
826
890
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
827
891
|
* --------------------------------------------------------------------------
|
|
828
892
|
*/
|
|
@@ -882,69 +946,11 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$7, SELECTOR_DATA_TOGGLE$5, event
|
|
|
882
946
|
* jQuery
|
|
883
947
|
*/
|
|
884
948
|
|
|
885
|
-
defineJQueryPlugin(Button);
|
|
949
|
+
defineJQueryPlugin$1(Button);
|
|
886
950
|
|
|
887
951
|
/**
|
|
888
952
|
* --------------------------------------------------------------------------
|
|
889
|
-
* Bootstrap
|
|
890
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
891
|
-
* --------------------------------------------------------------------------
|
|
892
|
-
*/
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
/**
|
|
896
|
-
* Constants
|
|
897
|
-
*/
|
|
898
|
-
|
|
899
|
-
const SelectorEngine = {
|
|
900
|
-
find(selector, element = document.documentElement) {
|
|
901
|
-
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
902
|
-
},
|
|
903
|
-
findOne(selector, element = document.documentElement) {
|
|
904
|
-
return Element.prototype.querySelector.call(element, selector);
|
|
905
|
-
},
|
|
906
|
-
children(element, selector) {
|
|
907
|
-
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
908
|
-
},
|
|
909
|
-
parents(element, selector) {
|
|
910
|
-
const parents = [];
|
|
911
|
-
let ancestor = element.parentNode.closest(selector);
|
|
912
|
-
while (ancestor) {
|
|
913
|
-
parents.push(ancestor);
|
|
914
|
-
ancestor = ancestor.parentNode.closest(selector);
|
|
915
|
-
}
|
|
916
|
-
return parents;
|
|
917
|
-
},
|
|
918
|
-
prev(element, selector) {
|
|
919
|
-
let previous = element.previousElementSibling;
|
|
920
|
-
while (previous) {
|
|
921
|
-
if (previous.matches(selector)) {
|
|
922
|
-
return [previous];
|
|
923
|
-
}
|
|
924
|
-
previous = previous.previousElementSibling;
|
|
925
|
-
}
|
|
926
|
-
return [];
|
|
927
|
-
},
|
|
928
|
-
// TODO: this is now unused; remove later along with prev()
|
|
929
|
-
next(element, selector) {
|
|
930
|
-
let next = element.nextElementSibling;
|
|
931
|
-
while (next) {
|
|
932
|
-
if (next.matches(selector)) {
|
|
933
|
-
return [next];
|
|
934
|
-
}
|
|
935
|
-
next = next.nextElementSibling;
|
|
936
|
-
}
|
|
937
|
-
return [];
|
|
938
|
-
},
|
|
939
|
-
focusableChildren(element) {
|
|
940
|
-
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(',');
|
|
941
|
-
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
942
|
-
}
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
/**
|
|
946
|
-
* --------------------------------------------------------------------------
|
|
947
|
-
* Bootstrap (v5.2.3): util/swipe.js
|
|
953
|
+
* Bootstrap util/swipe.js
|
|
948
954
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
949
955
|
* --------------------------------------------------------------------------
|
|
950
956
|
*/
|
|
@@ -1064,7 +1070,7 @@ class Swipe extends Config {
|
|
|
1064
1070
|
|
|
1065
1071
|
/**
|
|
1066
1072
|
* --------------------------------------------------------------------------
|
|
1067
|
-
* Bootstrap
|
|
1073
|
+
* Bootstrap carousel.js
|
|
1068
1074
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1069
1075
|
* --------------------------------------------------------------------------
|
|
1070
1076
|
*/
|
|
@@ -1325,7 +1331,7 @@ class Carousel extends BaseComponent {
|
|
|
1325
1331
|
}
|
|
1326
1332
|
if (!activeElement || !nextElement) {
|
|
1327
1333
|
// Some weirdness is happening, so we bail
|
|
1328
|
-
//
|
|
1334
|
+
// TODO: change tests that use empty divs to avoid this check
|
|
1329
1335
|
return;
|
|
1330
1336
|
}
|
|
1331
1337
|
const isCycling = Boolean(this._interval);
|
|
@@ -1402,7 +1408,7 @@ class Carousel extends BaseComponent {
|
|
|
1402
1408
|
*/
|
|
1403
1409
|
|
|
1404
1410
|
EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_SLIDE, function (event) {
|
|
1405
|
-
const target = getElementFromSelector(this);
|
|
1411
|
+
const target = SelectorEngine.getElementFromSelector(this);
|
|
1406
1412
|
if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
|
|
1407
1413
|
return;
|
|
1408
1414
|
}
|
|
@@ -1433,11 +1439,11 @@ EventHandler.on(window, EVENT_LOAD_DATA_API$4, () => {
|
|
|
1433
1439
|
* jQuery
|
|
1434
1440
|
*/
|
|
1435
1441
|
|
|
1436
|
-
defineJQueryPlugin(Carousel);
|
|
1442
|
+
defineJQueryPlugin$1(Carousel);
|
|
1437
1443
|
|
|
1438
1444
|
/**
|
|
1439
1445
|
* --------------------------------------------------------------------------
|
|
1440
|
-
* Bootstrap
|
|
1446
|
+
* Bootstrap collapse.js
|
|
1441
1447
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1442
1448
|
* --------------------------------------------------------------------------
|
|
1443
1449
|
*/
|
|
@@ -1486,7 +1492,7 @@ class Collapse extends BaseComponent {
|
|
|
1486
1492
|
this._triggerArray = [];
|
|
1487
1493
|
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
|
|
1488
1494
|
for (const elem of toggleList) {
|
|
1489
|
-
const selector = getSelectorFromElement(elem);
|
|
1495
|
+
const selector = SelectorEngine.getSelectorFromElement(elem);
|
|
1490
1496
|
const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element);
|
|
1491
1497
|
if (selector !== null && filterElement.length) {
|
|
1492
1498
|
this._triggerArray.push(elem);
|
|
@@ -1574,7 +1580,7 @@ class Collapse extends BaseComponent {
|
|
|
1574
1580
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
|
1575
1581
|
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
|
|
1576
1582
|
for (const trigger of this._triggerArray) {
|
|
1577
|
-
const element = getElementFromSelector(trigger);
|
|
1583
|
+
const element = SelectorEngine.getElementFromSelector(trigger);
|
|
1578
1584
|
if (element && !this._isShown(element)) {
|
|
1579
1585
|
this._addAriaAndCollapsedClass([trigger], false);
|
|
1580
1586
|
}
|
|
@@ -1596,7 +1602,7 @@ class Collapse extends BaseComponent {
|
|
|
1596
1602
|
// Private
|
|
1597
1603
|
_configAfterMerge(config) {
|
|
1598
1604
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
|
1599
|
-
config.parent = getElement(config.parent);
|
|
1605
|
+
config.parent = getElement$1(config.parent);
|
|
1600
1606
|
return config;
|
|
1601
1607
|
}
|
|
1602
1608
|
_getDimension() {
|
|
@@ -1608,7 +1614,7 @@ class Collapse extends BaseComponent {
|
|
|
1608
1614
|
}
|
|
1609
1615
|
const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);
|
|
1610
1616
|
for (const element of children) {
|
|
1611
|
-
const selected = getElementFromSelector(element);
|
|
1617
|
+
const selected = SelectorEngine.getElementFromSelector(element);
|
|
1612
1618
|
if (selected) {
|
|
1613
1619
|
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
|
1614
1620
|
}
|
|
@@ -1656,9 +1662,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, functi
|
|
|
1656
1662
|
if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') {
|
|
1657
1663
|
event.preventDefault();
|
|
1658
1664
|
}
|
|
1659
|
-
const
|
|
1660
|
-
const selectorElements = SelectorEngine.find(selector);
|
|
1661
|
-
for (const element of selectorElements) {
|
|
1665
|
+
for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {
|
|
1662
1666
|
Collapse.getOrCreateInstance(element, {
|
|
1663
1667
|
toggle: false
|
|
1664
1668
|
}).toggle();
|
|
@@ -1669,11 +1673,11 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$4, functi
|
|
|
1669
1673
|
* jQuery
|
|
1670
1674
|
*/
|
|
1671
1675
|
|
|
1672
|
-
defineJQueryPlugin(Collapse);
|
|
1676
|
+
defineJQueryPlugin$1(Collapse);
|
|
1673
1677
|
|
|
1674
1678
|
/**
|
|
1675
1679
|
* --------------------------------------------------------------------------
|
|
1676
|
-
* Bootstrap
|
|
1680
|
+
* Bootstrap dropdown.js
|
|
1677
1681
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1678
1682
|
* --------------------------------------------------------------------------
|
|
1679
1683
|
*/
|
|
@@ -1746,7 +1750,7 @@ class Dropdown extends BaseComponent {
|
|
|
1746
1750
|
super(element, config);
|
|
1747
1751
|
this._popper = null;
|
|
1748
1752
|
this._parent = this._element.parentNode; // dropdown wrapper
|
|
1749
|
-
//
|
|
1753
|
+
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
|
1750
1754
|
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
|
|
1751
1755
|
this._inNavbar = this._detectNavbar();
|
|
1752
1756
|
}
|
|
@@ -1841,7 +1845,7 @@ class Dropdown extends BaseComponent {
|
|
|
1841
1845
|
}
|
|
1842
1846
|
_getConfig(config) {
|
|
1843
1847
|
config = super._getConfig(config);
|
|
1844
|
-
if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
|
1848
|
+
if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
|
1845
1849
|
// Popper virtual elements require a getBoundingClientRect method
|
|
1846
1850
|
throw new TypeError(`${NAME$c.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
|
1847
1851
|
}
|
|
@@ -1854,8 +1858,8 @@ class Dropdown extends BaseComponent {
|
|
|
1854
1858
|
let referenceElement = this._element;
|
|
1855
1859
|
if (this._config.reference === 'parent') {
|
|
1856
1860
|
referenceElement = this._parent;
|
|
1857
|
-
} else if (isElement(this._config.reference)) {
|
|
1858
|
-
referenceElement = getElement(this._config.reference);
|
|
1861
|
+
} else if (isElement$1(this._config.reference)) {
|
|
1862
|
+
referenceElement = getElement$1(this._config.reference);
|
|
1859
1863
|
} else if (typeof this._config.reference === 'object') {
|
|
1860
1864
|
referenceElement = this._config.reference;
|
|
1861
1865
|
}
|
|
@@ -1920,7 +1924,7 @@ class Dropdown extends BaseComponent {
|
|
|
1920
1924
|
|
|
1921
1925
|
// Disable Popper if we have a static display or Dropdown is in Navbar
|
|
1922
1926
|
if (this._inNavbar || this._config.display === 'static') {
|
|
1923
|
-
Manipulator$1.setDataAttribute(this._menu, 'popper', 'static'); //
|
|
1927
|
+
Manipulator$1.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
|
|
1924
1928
|
defaultBsPopperConfig.modifiers = [{
|
|
1925
1929
|
name: 'applyStyles',
|
|
1926
1930
|
enabled: false
|
|
@@ -1928,7 +1932,7 @@ class Dropdown extends BaseComponent {
|
|
|
1928
1932
|
}
|
|
1929
1933
|
return {
|
|
1930
1934
|
...defaultBsPopperConfig,
|
|
1931
|
-
...(
|
|
1935
|
+
...execute(this._config.popperConfig, [defaultBsPopperConfig])
|
|
1932
1936
|
};
|
|
1933
1937
|
}
|
|
1934
1938
|
_selectMenuItem({
|
|
@@ -2002,7 +2006,7 @@ class Dropdown extends BaseComponent {
|
|
|
2002
2006
|
}
|
|
2003
2007
|
event.preventDefault();
|
|
2004
2008
|
|
|
2005
|
-
//
|
|
2009
|
+
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
|
2006
2010
|
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
|
|
2007
2011
|
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
|
2008
2012
|
if (isUpOrDownEvent) {
|
|
@@ -2037,7 +2041,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$3, functi
|
|
|
2037
2041
|
* jQuery
|
|
2038
2042
|
*/
|
|
2039
2043
|
|
|
2040
|
-
defineJQueryPlugin(Dropdown);
|
|
2044
|
+
defineJQueryPlugin$1(Dropdown);
|
|
2041
2045
|
|
|
2042
2046
|
/**
|
|
2043
2047
|
* --------------------------------------------------------------------------
|
|
@@ -2156,118 +2160,20 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$3, THUMBNAIL_SELECTOR, event => {
|
|
|
2156
2160
|
const firstSlide = event.target.parentNode.getAttribute('data-bs-slide-to');
|
|
2157
2161
|
gallery.dataset.galleryStart = firstSlide;
|
|
2158
2162
|
Gallery.getOrCreateInstance(gallery);
|
|
2159
|
-
});
|
|
2160
|
-
|
|
2161
|
-
/**
|
|
2162
|
-
* ------------------------------------------------------------------------
|
|
2163
|
-
* jQuery
|
|
2164
|
-
* ------------------------------------------------------------------------
|
|
2165
|
-
* add .gallery to jQuery only if jQuery is present
|
|
2166
|
-
*/
|
|
2167
|
-
|
|
2168
|
-
defineJQueryPlugin(Gallery);
|
|
2169
|
-
|
|
2170
|
-
/**
|
|
2171
|
-
* --------------------------------------------------------------------------
|
|
2172
|
-
* Bootstrap (v5.2.3): util/scrollBar.js
|
|
2173
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2174
|
-
* --------------------------------------------------------------------------
|
|
2175
|
-
*/
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
/**
|
|
2179
|
-
* Constants
|
|
2180
|
-
*/
|
|
2181
|
-
|
|
2182
|
-
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
|
2183
|
-
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
|
2184
|
-
const PROPERTY_PADDING = 'padding-right';
|
|
2185
|
-
const PROPERTY_MARGIN = 'margin-right';
|
|
2186
|
-
|
|
2187
|
-
/**
|
|
2188
|
-
* Class definition
|
|
2189
|
-
*/
|
|
2190
|
-
|
|
2191
|
-
class ScrollBarHelper {
|
|
2192
|
-
constructor() {
|
|
2193
|
-
this._element = document.body;
|
|
2194
|
-
}
|
|
2195
|
-
|
|
2196
|
-
// Public
|
|
2197
|
-
getWidth() {
|
|
2198
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
|
2199
|
-
const documentWidth = document.documentElement.clientWidth;
|
|
2200
|
-
return Math.abs(window.innerWidth - documentWidth);
|
|
2201
|
-
}
|
|
2202
|
-
hide() {
|
|
2203
|
-
const width = this.getWidth();
|
|
2204
|
-
this._disableOverFlow();
|
|
2205
|
-
// give padding to element to balance the hidden scrollbar width
|
|
2206
|
-
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2207
|
-
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
|
2208
|
-
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2209
|
-
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
|
2210
|
-
}
|
|
2211
|
-
reset() {
|
|
2212
|
-
this._resetElementAttributes(this._element, 'overflow');
|
|
2213
|
-
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
|
2214
|
-
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
|
2215
|
-
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
|
2216
|
-
}
|
|
2217
|
-
isOverflowing() {
|
|
2218
|
-
return this.getWidth() > 0;
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2221
|
-
// Private
|
|
2222
|
-
_disableOverFlow() {
|
|
2223
|
-
this._saveInitialAttribute(this._element, 'overflow');
|
|
2224
|
-
this._element.style.overflow = 'hidden';
|
|
2225
|
-
}
|
|
2226
|
-
_setElementAttributes(selector, styleProperty, callback) {
|
|
2227
|
-
const scrollbarWidth = this.getWidth();
|
|
2228
|
-
const manipulationCallBack = element => {
|
|
2229
|
-
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
|
2230
|
-
return;
|
|
2231
|
-
}
|
|
2232
|
-
this._saveInitialAttribute(element, styleProperty);
|
|
2233
|
-
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
|
2234
|
-
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
|
2235
|
-
};
|
|
2236
|
-
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2237
|
-
}
|
|
2238
|
-
_saveInitialAttribute(element, styleProperty) {
|
|
2239
|
-
const actualValue = element.style.getPropertyValue(styleProperty);
|
|
2240
|
-
if (actualValue) {
|
|
2241
|
-
Manipulator$1.setDataAttribute(element, styleProperty, actualValue);
|
|
2242
|
-
}
|
|
2243
|
-
}
|
|
2244
|
-
_resetElementAttributes(selector, styleProperty) {
|
|
2245
|
-
const manipulationCallBack = element => {
|
|
2246
|
-
const value = Manipulator$1.getDataAttribute(element, styleProperty);
|
|
2247
|
-
// We only want to remove the property if the value is `null`; the value can also be zero
|
|
2248
|
-
if (value === null) {
|
|
2249
|
-
element.style.removeProperty(styleProperty);
|
|
2250
|
-
return;
|
|
2251
|
-
}
|
|
2252
|
-
Manipulator$1.removeDataAttribute(element, styleProperty);
|
|
2253
|
-
element.style.setProperty(styleProperty, value);
|
|
2254
|
-
};
|
|
2255
|
-
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2256
|
-
}
|
|
2257
|
-
_applyManipulationCallback(selector, callBack) {
|
|
2258
|
-
if (isElement(selector)) {
|
|
2259
|
-
callBack(selector);
|
|
2260
|
-
return;
|
|
2261
|
-
}
|
|
2262
|
-
for (const sel of SelectorEngine.find(selector, this._element)) {
|
|
2263
|
-
callBack(sel);
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2163
|
+
});
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* ------------------------------------------------------------------------
|
|
2167
|
+
* jQuery
|
|
2168
|
+
* ------------------------------------------------------------------------
|
|
2169
|
+
* add .gallery to jQuery only if jQuery is present
|
|
2170
|
+
*/
|
|
2171
|
+
|
|
2172
|
+
defineJQueryPlugin$1(Gallery);
|
|
2267
2173
|
|
|
2268
2174
|
/**
|
|
2269
2175
|
* --------------------------------------------------------------------------
|
|
2270
|
-
* Bootstrap
|
|
2176
|
+
* Bootstrap util/backdrop.js
|
|
2271
2177
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2272
2178
|
* --------------------------------------------------------------------------
|
|
2273
2179
|
*/
|
|
@@ -2370,7 +2276,7 @@ class Backdrop extends Config {
|
|
|
2370
2276
|
}
|
|
2371
2277
|
_configAfterMerge(config) {
|
|
2372
2278
|
// use getElement() with the default "body" to get a fresh Element on each instantiation
|
|
2373
|
-
config.rootElement = getElement(config.rootElement);
|
|
2279
|
+
config.rootElement = getElement$1(config.rootElement);
|
|
2374
2280
|
return config;
|
|
2375
2281
|
}
|
|
2376
2282
|
_append() {
|
|
@@ -2391,7 +2297,7 @@ class Backdrop extends Config {
|
|
|
2391
2297
|
|
|
2392
2298
|
/**
|
|
2393
2299
|
* --------------------------------------------------------------------------
|
|
2394
|
-
* Bootstrap
|
|
2300
|
+
* Bootstrap util/focustrap.js
|
|
2395
2301
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2396
2302
|
* --------------------------------------------------------------------------
|
|
2397
2303
|
*/
|
|
@@ -2489,7 +2395,105 @@ class FocusTrap extends Config {
|
|
|
2489
2395
|
|
|
2490
2396
|
/**
|
|
2491
2397
|
* --------------------------------------------------------------------------
|
|
2492
|
-
* Bootstrap
|
|
2398
|
+
* Bootstrap util/scrollBar.js
|
|
2399
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2400
|
+
* --------------------------------------------------------------------------
|
|
2401
|
+
*/
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
/**
|
|
2405
|
+
* Constants
|
|
2406
|
+
*/
|
|
2407
|
+
|
|
2408
|
+
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
|
2409
|
+
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
|
2410
|
+
const PROPERTY_PADDING = 'padding-right';
|
|
2411
|
+
const PROPERTY_MARGIN = 'margin-right';
|
|
2412
|
+
|
|
2413
|
+
/**
|
|
2414
|
+
* Class definition
|
|
2415
|
+
*/
|
|
2416
|
+
|
|
2417
|
+
class ScrollBarHelper {
|
|
2418
|
+
constructor() {
|
|
2419
|
+
this._element = document.body;
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
// Public
|
|
2423
|
+
getWidth() {
|
|
2424
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
|
2425
|
+
const documentWidth = document.documentElement.clientWidth;
|
|
2426
|
+
return Math.abs(window.innerWidth - documentWidth);
|
|
2427
|
+
}
|
|
2428
|
+
hide() {
|
|
2429
|
+
const width = this.getWidth();
|
|
2430
|
+
this._disableOverFlow();
|
|
2431
|
+
// give padding to element to balance the hidden scrollbar width
|
|
2432
|
+
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2433
|
+
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
|
2434
|
+
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2435
|
+
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
|
2436
|
+
}
|
|
2437
|
+
reset() {
|
|
2438
|
+
this._resetElementAttributes(this._element, 'overflow');
|
|
2439
|
+
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
|
2440
|
+
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
|
2441
|
+
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
|
2442
|
+
}
|
|
2443
|
+
isOverflowing() {
|
|
2444
|
+
return this.getWidth() > 0;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
// Private
|
|
2448
|
+
_disableOverFlow() {
|
|
2449
|
+
this._saveInitialAttribute(this._element, 'overflow');
|
|
2450
|
+
this._element.style.overflow = 'hidden';
|
|
2451
|
+
}
|
|
2452
|
+
_setElementAttributes(selector, styleProperty, callback) {
|
|
2453
|
+
const scrollbarWidth = this.getWidth();
|
|
2454
|
+
const manipulationCallBack = element => {
|
|
2455
|
+
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
|
2456
|
+
return;
|
|
2457
|
+
}
|
|
2458
|
+
this._saveInitialAttribute(element, styleProperty);
|
|
2459
|
+
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
|
2460
|
+
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
|
2461
|
+
};
|
|
2462
|
+
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2463
|
+
}
|
|
2464
|
+
_saveInitialAttribute(element, styleProperty) {
|
|
2465
|
+
const actualValue = element.style.getPropertyValue(styleProperty);
|
|
2466
|
+
if (actualValue) {
|
|
2467
|
+
Manipulator$1.setDataAttribute(element, styleProperty, actualValue);
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
_resetElementAttributes(selector, styleProperty) {
|
|
2471
|
+
const manipulationCallBack = element => {
|
|
2472
|
+
const value = Manipulator$1.getDataAttribute(element, styleProperty);
|
|
2473
|
+
// We only want to remove the property if the value is `null`; the value can also be zero
|
|
2474
|
+
if (value === null) {
|
|
2475
|
+
element.style.removeProperty(styleProperty);
|
|
2476
|
+
return;
|
|
2477
|
+
}
|
|
2478
|
+
Manipulator$1.removeDataAttribute(element, styleProperty);
|
|
2479
|
+
element.style.setProperty(styleProperty, value);
|
|
2480
|
+
};
|
|
2481
|
+
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2482
|
+
}
|
|
2483
|
+
_applyManipulationCallback(selector, callBack) {
|
|
2484
|
+
if (isElement$1(selector)) {
|
|
2485
|
+
callBack(selector);
|
|
2486
|
+
return;
|
|
2487
|
+
}
|
|
2488
|
+
for (const sel of SelectorEngine.find(selector, this._element)) {
|
|
2489
|
+
callBack(sel);
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
/**
|
|
2495
|
+
* --------------------------------------------------------------------------
|
|
2496
|
+
* Bootstrap modal.js
|
|
2493
2497
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2494
2498
|
* --------------------------------------------------------------------------
|
|
2495
2499
|
*/
|
|
@@ -2596,9 +2600,8 @@ class Modal extends BaseComponent {
|
|
|
2596
2600
|
this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
|
|
2597
2601
|
}
|
|
2598
2602
|
dispose() {
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
}
|
|
2603
|
+
EventHandler.off(window, EVENT_KEY$5);
|
|
2604
|
+
EventHandler.off(this._dialog, EVENT_KEY$5);
|
|
2602
2605
|
this._backdrop.dispose();
|
|
2603
2606
|
this._focustrap.deactivate();
|
|
2604
2607
|
super.dispose();
|
|
@@ -2653,7 +2656,6 @@ class Modal extends BaseComponent {
|
|
|
2653
2656
|
return;
|
|
2654
2657
|
}
|
|
2655
2658
|
if (this._config.keyboard) {
|
|
2656
|
-
event.preventDefault();
|
|
2657
2659
|
this.hide();
|
|
2658
2660
|
return;
|
|
2659
2661
|
}
|
|
@@ -2762,7 +2764,7 @@ class Modal extends BaseComponent {
|
|
|
2762
2764
|
*/
|
|
2763
2765
|
|
|
2764
2766
|
EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {
|
|
2765
|
-
const target = getElementFromSelector(this);
|
|
2767
|
+
const target = SelectorEngine.getElementFromSelector(this);
|
|
2766
2768
|
if (['A', 'AREA'].includes(this.tagName)) {
|
|
2767
2769
|
event.preventDefault();
|
|
2768
2770
|
}
|
|
@@ -2792,11 +2794,11 @@ enableDismissTrigger(Modal);
|
|
|
2792
2794
|
* jQuery
|
|
2793
2795
|
*/
|
|
2794
2796
|
|
|
2795
|
-
defineJQueryPlugin(Modal);
|
|
2797
|
+
defineJQueryPlugin$1(Modal);
|
|
2796
2798
|
|
|
2797
2799
|
/**
|
|
2798
2800
|
* --------------------------------------------------------------------------
|
|
2799
|
-
* Bootstrap
|
|
2801
|
+
* Bootstrap offcanvas.js
|
|
2800
2802
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2801
2803
|
* --------------------------------------------------------------------------
|
|
2802
2804
|
*/
|
|
@@ -2955,11 +2957,11 @@ class Offcanvas extends BaseComponent {
|
|
|
2955
2957
|
if (event.key !== ESCAPE_KEY) {
|
|
2956
2958
|
return;
|
|
2957
2959
|
}
|
|
2958
|
-
if (
|
|
2959
|
-
|
|
2960
|
+
if (this._config.keyboard) {
|
|
2961
|
+
this.hide();
|
|
2960
2962
|
return;
|
|
2961
2963
|
}
|
|
2962
|
-
this.
|
|
2964
|
+
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
|
2963
2965
|
});
|
|
2964
2966
|
}
|
|
2965
2967
|
|
|
@@ -2983,7 +2985,7 @@ class Offcanvas extends BaseComponent {
|
|
|
2983
2985
|
*/
|
|
2984
2986
|
|
|
2985
2987
|
EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {
|
|
2986
|
-
const target = getElementFromSelector(this);
|
|
2988
|
+
const target = SelectorEngine.getElementFromSelector(this);
|
|
2987
2989
|
if (['A', 'AREA'].includes(this.tagName)) {
|
|
2988
2990
|
event.preventDefault();
|
|
2989
2991
|
}
|
|
@@ -3023,7 +3025,7 @@ enableDismissTrigger(Offcanvas);
|
|
|
3023
3025
|
* jQuery
|
|
3024
3026
|
*/
|
|
3025
3027
|
|
|
3026
|
-
defineJQueryPlugin(Offcanvas);
|
|
3028
|
+
defineJQueryPlugin$1(Offcanvas);
|
|
3027
3029
|
|
|
3028
3030
|
/**
|
|
3029
3031
|
* AccessibleToggle enhances Bootstrap Modal and Offcanvas components by:
|
|
@@ -3075,41 +3077,53 @@ class AccessibleToggle {
|
|
|
3075
3077
|
}
|
|
3076
3078
|
}
|
|
3077
3079
|
|
|
3080
|
+
class AccordionToggle {
|
|
3081
|
+
static isInitialized = false;
|
|
3082
|
+
constructor(buttonElement) {
|
|
3083
|
+
this.buttonElement = buttonElement;
|
|
3084
|
+
this.targetAccordionId = buttonElement.getAttribute("data-target");
|
|
3085
|
+
this.action = buttonElement.getAttribute("data-action");
|
|
3086
|
+
this.accordionElement = SelectorEngine.findOne(`#${this.targetAccordionId}`);
|
|
3087
|
+
this.accordionItems = SelectorEngine.find(".accordion-collapse", this.accordionElement);
|
|
3088
|
+
this.addEventListeners();
|
|
3089
|
+
}
|
|
3090
|
+
addEventListeners() {
|
|
3091
|
+
EventHandler.on(this.buttonElement, "click", event => this.handleAccordionAction(event));
|
|
3092
|
+
}
|
|
3093
|
+
handleAccordionAction(event) {
|
|
3094
|
+
const item = event.target;
|
|
3095
|
+
const action = item.getAttribute('data-action');
|
|
3096
|
+
const accordionItems = this.accordionItems;
|
|
3097
|
+
accordionItems.forEach(accordionItem => {
|
|
3098
|
+
const collapseInstance = Collapse.getOrCreateInstance(accordionItem, {
|
|
3099
|
+
toggle: false
|
|
3100
|
+
});
|
|
3101
|
+
if (action === 'expand') {
|
|
3102
|
+
collapseInstance.show();
|
|
3103
|
+
} else if (action === 'collapse') {
|
|
3104
|
+
collapseInstance.hide();
|
|
3105
|
+
}
|
|
3106
|
+
});
|
|
3107
|
+
}
|
|
3108
|
+
static init() {
|
|
3109
|
+
if (AccordionToggle.isInitialized) {
|
|
3110
|
+
return;
|
|
3111
|
+
}
|
|
3112
|
+
const toggleButtons = SelectorEngine.find('[data-action][data-target]');
|
|
3113
|
+
toggleButtons.forEach(buttonElement => new AccordionToggle(buttonElement));
|
|
3114
|
+
AccordionToggle.isInitialized = true;
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3078
3118
|
/**
|
|
3079
3119
|
* --------------------------------------------------------------------------
|
|
3080
|
-
* Bootstrap
|
|
3120
|
+
* Bootstrap util/sanitizer.js
|
|
3081
3121
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3082
3122
|
* --------------------------------------------------------------------------
|
|
3083
3123
|
*/
|
|
3084
3124
|
|
|
3085
|
-
|
|
3125
|
+
// js-docs-start allow-list
|
|
3086
3126
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
3087
|
-
|
|
3088
|
-
/**
|
|
3089
|
-
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
3090
|
-
*
|
|
3091
|
-
* Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
3092
|
-
*/
|
|
3093
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
3094
|
-
|
|
3095
|
-
/**
|
|
3096
|
-
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
3097
|
-
*
|
|
3098
|
-
* Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
3099
|
-
*/
|
|
3100
|
-
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;
|
|
3101
|
-
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
3102
|
-
const attributeName = attribute.nodeName.toLowerCase();
|
|
3103
|
-
if (allowedAttributeList.includes(attributeName)) {
|
|
3104
|
-
if (uriAttributes.has(attributeName)) {
|
|
3105
|
-
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
|
3106
|
-
}
|
|
3107
|
-
return true;
|
|
3108
|
-
}
|
|
3109
|
-
|
|
3110
|
-
// Check if a regular expression validates the attribute.
|
|
3111
|
-
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
|
|
3112
|
-
};
|
|
3113
3127
|
const DefaultAllowlist = {
|
|
3114
3128
|
// Global attributes allowed on any supplied element below.
|
|
3115
3129
|
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
|
@@ -3119,7 +3133,10 @@ const DefaultAllowlist = {
|
|
|
3119
3133
|
br: [],
|
|
3120
3134
|
col: [],
|
|
3121
3135
|
code: [],
|
|
3136
|
+
dd: [],
|
|
3122
3137
|
div: [],
|
|
3138
|
+
dl: [],
|
|
3139
|
+
dt: [],
|
|
3123
3140
|
em: [],
|
|
3124
3141
|
hr: [],
|
|
3125
3142
|
h1: [],
|
|
@@ -3143,6 +3160,30 @@ const DefaultAllowlist = {
|
|
|
3143
3160
|
u: [],
|
|
3144
3161
|
ul: []
|
|
3145
3162
|
};
|
|
3163
|
+
// js-docs-end allow-list
|
|
3164
|
+
|
|
3165
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
3166
|
+
|
|
3167
|
+
/**
|
|
3168
|
+
* A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
|
|
3169
|
+
* contexts.
|
|
3170
|
+
*
|
|
3171
|
+
* Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
|
|
3172
|
+
*/
|
|
3173
|
+
// eslint-disable-next-line unicorn/better-regex
|
|
3174
|
+
const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;
|
|
3175
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
3176
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
3177
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
3178
|
+
if (uriAttributes.has(attributeName)) {
|
|
3179
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));
|
|
3180
|
+
}
|
|
3181
|
+
return true;
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
// Check if a regular expression validates the attribute.
|
|
3185
|
+
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
|
|
3186
|
+
};
|
|
3146
3187
|
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
3147
3188
|
if (!unsafeHtml.length) {
|
|
3148
3189
|
return unsafeHtml;
|
|
@@ -3172,7 +3213,7 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
|
3172
3213
|
|
|
3173
3214
|
/**
|
|
3174
3215
|
* --------------------------------------------------------------------------
|
|
3175
|
-
* Bootstrap
|
|
3216
|
+
* Bootstrap util/template-factory.js
|
|
3176
3217
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3177
3218
|
* --------------------------------------------------------------------------
|
|
3178
3219
|
*/
|
|
@@ -3280,8 +3321,8 @@ class TemplateFactory extends Config {
|
|
|
3280
3321
|
templateElement.remove();
|
|
3281
3322
|
return;
|
|
3282
3323
|
}
|
|
3283
|
-
if (isElement(content)) {
|
|
3284
|
-
this._putElementInTemplate(getElement(content), templateElement);
|
|
3324
|
+
if (isElement$1(content)) {
|
|
3325
|
+
this._putElementInTemplate(getElement$1(content), templateElement);
|
|
3285
3326
|
return;
|
|
3286
3327
|
}
|
|
3287
3328
|
if (this._config.html) {
|
|
@@ -3294,7 +3335,7 @@ class TemplateFactory extends Config {
|
|
|
3294
3335
|
return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg;
|
|
3295
3336
|
}
|
|
3296
3337
|
_resolvePossibleFunction(arg) {
|
|
3297
|
-
return
|
|
3338
|
+
return execute(arg, [this]);
|
|
3298
3339
|
}
|
|
3299
3340
|
_putElementInTemplate(element, templateElement) {
|
|
3300
3341
|
if (this._config.html) {
|
|
@@ -3308,7 +3349,7 @@ class TemplateFactory extends Config {
|
|
|
3308
3349
|
|
|
3309
3350
|
/**
|
|
3310
3351
|
* --------------------------------------------------------------------------
|
|
3311
|
-
* Bootstrap
|
|
3352
|
+
* Bootstrap tooltip.js
|
|
3312
3353
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3313
3354
|
* --------------------------------------------------------------------------
|
|
3314
3355
|
*/
|
|
@@ -3356,7 +3397,7 @@ const Default$4 = {
|
|
|
3356
3397
|
delay: 0,
|
|
3357
3398
|
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
|
3358
3399
|
html: false,
|
|
3359
|
-
offset: [0,
|
|
3400
|
+
offset: [0, 6],
|
|
3360
3401
|
placement: 'top',
|
|
3361
3402
|
popperConfig: null,
|
|
3362
3403
|
sanitize: true,
|
|
@@ -3469,7 +3510,7 @@ class Tooltip extends BaseComponent {
|
|
|
3469
3510
|
return;
|
|
3470
3511
|
}
|
|
3471
3512
|
|
|
3472
|
-
//
|
|
3513
|
+
// TODO: v6 remove this or make it optional
|
|
3473
3514
|
this._disposePopper();
|
|
3474
3515
|
const tip = this._getTipElement();
|
|
3475
3516
|
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
|
|
@@ -3555,12 +3596,12 @@ class Tooltip extends BaseComponent {
|
|
|
3555
3596
|
_createTipElement(content) {
|
|
3556
3597
|
const tip = this._getTemplateFactory(content).toHtml();
|
|
3557
3598
|
|
|
3558
|
-
//
|
|
3599
|
+
// TODO: remove this check in v6
|
|
3559
3600
|
if (!tip) {
|
|
3560
3601
|
return null;
|
|
3561
3602
|
}
|
|
3562
3603
|
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
|
3563
|
-
//
|
|
3604
|
+
// TODO: v6 the following can be achieved with CSS only
|
|
3564
3605
|
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
|
|
3565
3606
|
const tipId = getUID(this.constructor.NAME).toString();
|
|
3566
3607
|
tip.setAttribute('id', tipId);
|
|
@@ -3610,7 +3651,7 @@ class Tooltip extends BaseComponent {
|
|
|
3610
3651
|
return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2);
|
|
3611
3652
|
}
|
|
3612
3653
|
_createPopper(tip) {
|
|
3613
|
-
const placement =
|
|
3654
|
+
const placement = execute(this._config.placement, [this, tip, this._element]);
|
|
3614
3655
|
const attachment = AttachmentMap[placement.toUpperCase()];
|
|
3615
3656
|
return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment));
|
|
3616
3657
|
}
|
|
@@ -3627,7 +3668,7 @@ class Tooltip extends BaseComponent {
|
|
|
3627
3668
|
return offset;
|
|
3628
3669
|
}
|
|
3629
3670
|
_resolvePossibleFunction(arg) {
|
|
3630
|
-
return
|
|
3671
|
+
return execute(arg, [this._element]);
|
|
3631
3672
|
}
|
|
3632
3673
|
_getPopperConfig(attachment) {
|
|
3633
3674
|
const defaultBsPopperConfig = {
|
|
@@ -3665,7 +3706,7 @@ class Tooltip extends BaseComponent {
|
|
|
3665
3706
|
};
|
|
3666
3707
|
return {
|
|
3667
3708
|
...defaultBsPopperConfig,
|
|
3668
|
-
...(
|
|
3709
|
+
...execute(this._config.popperConfig, [defaultBsPopperConfig])
|
|
3669
3710
|
};
|
|
3670
3711
|
}
|
|
3671
3712
|
_setListeners() {
|
|
@@ -3756,7 +3797,7 @@ class Tooltip extends BaseComponent {
|
|
|
3756
3797
|
return config;
|
|
3757
3798
|
}
|
|
3758
3799
|
_configAfterMerge(config) {
|
|
3759
|
-
config.container = config.container === false ? document.body : getElement(config.container);
|
|
3800
|
+
config.container = config.container === false ? document.body : getElement$1(config.container);
|
|
3760
3801
|
if (typeof config.delay === 'number') {
|
|
3761
3802
|
config.delay = {
|
|
3762
3803
|
show: config.delay,
|
|
@@ -3773,9 +3814,9 @@ class Tooltip extends BaseComponent {
|
|
|
3773
3814
|
}
|
|
3774
3815
|
_getDelegateConfig() {
|
|
3775
3816
|
const config = {};
|
|
3776
|
-
for (const key
|
|
3777
|
-
if (this.constructor.Default[key] !==
|
|
3778
|
-
config[key] =
|
|
3817
|
+
for (const [key, value] of Object.entries(this._config)) {
|
|
3818
|
+
if (this.constructor.Default[key] !== value) {
|
|
3819
|
+
config[key] = value;
|
|
3779
3820
|
}
|
|
3780
3821
|
}
|
|
3781
3822
|
config.selector = false;
|
|
@@ -3816,11 +3857,11 @@ class Tooltip extends BaseComponent {
|
|
|
3816
3857
|
* jQuery
|
|
3817
3858
|
*/
|
|
3818
3859
|
|
|
3819
|
-
defineJQueryPlugin(Tooltip);
|
|
3860
|
+
defineJQueryPlugin$1(Tooltip);
|
|
3820
3861
|
|
|
3821
3862
|
/**
|
|
3822
3863
|
* --------------------------------------------------------------------------
|
|
3823
|
-
* Bootstrap
|
|
3864
|
+
* Bootstrap popover.js
|
|
3824
3865
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3825
3866
|
* --------------------------------------------------------------------------
|
|
3826
3867
|
*/
|
|
@@ -3897,11 +3938,11 @@ class Popover extends Tooltip {
|
|
|
3897
3938
|
* jQuery
|
|
3898
3939
|
*/
|
|
3899
3940
|
|
|
3900
|
-
defineJQueryPlugin(Popover);
|
|
3941
|
+
defineJQueryPlugin$1(Popover);
|
|
3901
3942
|
|
|
3902
3943
|
/**
|
|
3903
3944
|
* --------------------------------------------------------------------------
|
|
3904
|
-
* Bootstrap
|
|
3945
|
+
* Bootstrap scrollspy.js
|
|
3905
3946
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3906
3947
|
* --------------------------------------------------------------------------
|
|
3907
3948
|
*/
|
|
@@ -3999,7 +4040,7 @@ let ScrollSpy$1 = class ScrollSpy extends BaseComponent {
|
|
|
3999
4040
|
// Private
|
|
4000
4041
|
_configAfterMerge(config) {
|
|
4001
4042
|
// TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case
|
|
4002
|
-
config.target = getElement(config.target) || document.body;
|
|
4043
|
+
config.target = getElement$1(config.target) || document.body;
|
|
4003
4044
|
|
|
4004
4045
|
// TODO: v6 Only for backwards compatibility reasons. Use rootMargin only
|
|
4005
4046
|
config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;
|
|
@@ -4085,11 +4126,11 @@ let ScrollSpy$1 = class ScrollSpy extends BaseComponent {
|
|
|
4085
4126
|
if (!anchor.hash || isDisabled(anchor)) {
|
|
4086
4127
|
continue;
|
|
4087
4128
|
}
|
|
4088
|
-
const observableSection = SelectorEngine.findOne(anchor.hash, this._element);
|
|
4129
|
+
const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element);
|
|
4089
4130
|
|
|
4090
4131
|
// ensure that the observableSection exists & is visible
|
|
4091
4132
|
if (isVisible(observableSection)) {
|
|
4092
|
-
this._targetLinks.set(anchor.hash, anchor);
|
|
4133
|
+
this._targetLinks.set(decodeURI(anchor.hash), anchor);
|
|
4093
4134
|
this._observableSections.set(anchor.hash, observableSection);
|
|
4094
4135
|
}
|
|
4095
4136
|
}
|
|
@@ -4157,7 +4198,7 @@ EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => {
|
|
|
4157
4198
|
* jQuery
|
|
4158
4199
|
*/
|
|
4159
4200
|
|
|
4160
|
-
defineJQueryPlugin(ScrollSpy$1);
|
|
4201
|
+
defineJQueryPlugin$1(ScrollSpy$1);
|
|
4161
4202
|
|
|
4162
4203
|
/**
|
|
4163
4204
|
* --------------------------------------------------------------------------
|
|
@@ -4221,6 +4262,99 @@ const Manipulator = {
|
|
|
4221
4262
|
}
|
|
4222
4263
|
};
|
|
4223
4264
|
|
|
4265
|
+
/**
|
|
4266
|
+
* --------------------------------------------------------------------------
|
|
4267
|
+
* Bootstrap (v5.2.3): util/index.js
|
|
4268
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4269
|
+
* --------------------------------------------------------------------------
|
|
4270
|
+
*/
|
|
4271
|
+
|
|
4272
|
+
const getSelector = element => {
|
|
4273
|
+
let selector = element.getAttribute('data-bs-target');
|
|
4274
|
+
if (!selector || selector === '#') {
|
|
4275
|
+
let hrefAttribute = element.getAttribute('href');
|
|
4276
|
+
|
|
4277
|
+
// The only valid content that could double as a selector are IDs or classes,
|
|
4278
|
+
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
|
4279
|
+
// `document.querySelector` will rightfully complain it is invalid.
|
|
4280
|
+
// See https://github.com/twbs/bootstrap/issues/32273
|
|
4281
|
+
if (!hrefAttribute || !hrefAttribute.includes('#') && !hrefAttribute.startsWith('.')) {
|
|
4282
|
+
return null;
|
|
4283
|
+
}
|
|
4284
|
+
|
|
4285
|
+
// Just in case some CMS puts out a full URL with the anchor appended
|
|
4286
|
+
if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {
|
|
4287
|
+
hrefAttribute = `#${hrefAttribute.split('#')[1]}`;
|
|
4288
|
+
}
|
|
4289
|
+
selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null;
|
|
4290
|
+
}
|
|
4291
|
+
return selector;
|
|
4292
|
+
};
|
|
4293
|
+
const getSelectorFromElement = element => {
|
|
4294
|
+
const selector = getSelector(element);
|
|
4295
|
+
if (selector) {
|
|
4296
|
+
return document.querySelector(selector) ? selector : null;
|
|
4297
|
+
}
|
|
4298
|
+
return null;
|
|
4299
|
+
};
|
|
4300
|
+
const isElement = object => {
|
|
4301
|
+
if (!object || typeof object !== 'object') {
|
|
4302
|
+
return false;
|
|
4303
|
+
}
|
|
4304
|
+
if (typeof object.jquery !== 'undefined') {
|
|
4305
|
+
object = object[0];
|
|
4306
|
+
}
|
|
4307
|
+
return typeof object.nodeType !== 'undefined';
|
|
4308
|
+
};
|
|
4309
|
+
const getElement = object => {
|
|
4310
|
+
// it's a jQuery object or a node element
|
|
4311
|
+
if (isElement(object)) {
|
|
4312
|
+
return object.jquery ? object[0] : object;
|
|
4313
|
+
}
|
|
4314
|
+
if (typeof object === 'string' && object.length > 0) {
|
|
4315
|
+
return document.querySelector(object);
|
|
4316
|
+
}
|
|
4317
|
+
return null;
|
|
4318
|
+
};
|
|
4319
|
+
const getjQuery = () => {
|
|
4320
|
+
if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
|
4321
|
+
return window.jQuery;
|
|
4322
|
+
}
|
|
4323
|
+
return null;
|
|
4324
|
+
};
|
|
4325
|
+
const DOMContentLoadedCallbacks = [];
|
|
4326
|
+
const onDOMContentLoaded = callback => {
|
|
4327
|
+
if (document.readyState === 'loading') {
|
|
4328
|
+
// add listener on the first call when the document is in loading state
|
|
4329
|
+
if (!DOMContentLoadedCallbacks.length) {
|
|
4330
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
4331
|
+
for (const callback of DOMContentLoadedCallbacks) {
|
|
4332
|
+
callback();
|
|
4333
|
+
}
|
|
4334
|
+
});
|
|
4335
|
+
}
|
|
4336
|
+
DOMContentLoadedCallbacks.push(callback);
|
|
4337
|
+
} else {
|
|
4338
|
+
callback();
|
|
4339
|
+
}
|
|
4340
|
+
};
|
|
4341
|
+
const defineJQueryPlugin = plugin => {
|
|
4342
|
+
onDOMContentLoaded(() => {
|
|
4343
|
+
const $ = getjQuery();
|
|
4344
|
+
/* istanbul ignore if */
|
|
4345
|
+
if ($) {
|
|
4346
|
+
const name = plugin.NAME;
|
|
4347
|
+
const JQUERY_NO_CONFLICT = $.fn[name];
|
|
4348
|
+
$.fn[name] = plugin.jQueryInterface;
|
|
4349
|
+
$.fn[name].Constructor = plugin;
|
|
4350
|
+
$.fn[name].noConflict = () => {
|
|
4351
|
+
$.fn[name] = JQUERY_NO_CONFLICT;
|
|
4352
|
+
return plugin.jQueryInterface;
|
|
4353
|
+
};
|
|
4354
|
+
}
|
|
4355
|
+
});
|
|
4356
|
+
};
|
|
4357
|
+
|
|
4224
4358
|
/**
|
|
4225
4359
|
* --------------------------------------------------------------------------
|
|
4226
4360
|
* Bootstrap (v5.1.3): scrollspy.js
|
|
@@ -4430,7 +4564,7 @@ defineJQueryPlugin(ScrollSpy);
|
|
|
4430
4564
|
|
|
4431
4565
|
/**
|
|
4432
4566
|
* --------------------------------------------------------------------------
|
|
4433
|
-
* Bootstrap
|
|
4567
|
+
* Bootstrap tab.js
|
|
4434
4568
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4435
4569
|
* --------------------------------------------------------------------------
|
|
4436
4570
|
*/
|
|
@@ -4454,17 +4588,19 @@ const ARROW_LEFT_KEY = 'ArrowLeft';
|
|
|
4454
4588
|
const ARROW_RIGHT_KEY = 'ArrowRight';
|
|
4455
4589
|
const ARROW_UP_KEY = 'ArrowUp';
|
|
4456
4590
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
|
4591
|
+
const HOME_KEY = 'Home';
|
|
4592
|
+
const END_KEY = 'End';
|
|
4457
4593
|
const CLASS_NAME_ACTIVE = 'active';
|
|
4458
4594
|
const CLASS_NAME_FADE$1 = 'fade';
|
|
4459
4595
|
const CLASS_NAME_SHOW$1 = 'show';
|
|
4460
4596
|
const CLASS_DROPDOWN = 'dropdown';
|
|
4461
4597
|
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
|
4462
4598
|
const SELECTOR_DROPDOWN_MENU = '.dropdown-menu';
|
|
4463
|
-
const NOT_SELECTOR_DROPDOWN_TOGGLE =
|
|
4599
|
+
const NOT_SELECTOR_DROPDOWN_TOGGLE = `:not(${SELECTOR_DROPDOWN_TOGGLE})`;
|
|
4464
4600
|
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
|
|
4465
4601
|
const SELECTOR_OUTER = '.nav-item, .list-group-item';
|
|
4466
4602
|
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
|
|
4467
|
-
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; //
|
|
4603
|
+
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]'; // TODO: could only be `tab` in v6
|
|
4468
4604
|
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
|
|
4469
4605
|
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;
|
|
4470
4606
|
|
|
@@ -4478,7 +4614,7 @@ class Tab extends BaseComponent {
|
|
|
4478
4614
|
this._parent = this._element.closest(SELECTOR_TAB_PANEL);
|
|
4479
4615
|
if (!this._parent) {
|
|
4480
4616
|
return;
|
|
4481
|
-
//
|
|
4617
|
+
// TODO: should throw exception in v6
|
|
4482
4618
|
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
|
|
4483
4619
|
}
|
|
4484
4620
|
|
|
@@ -4521,7 +4657,7 @@ class Tab extends BaseComponent {
|
|
|
4521
4657
|
return;
|
|
4522
4658
|
}
|
|
4523
4659
|
element.classList.add(CLASS_NAME_ACTIVE);
|
|
4524
|
-
this._activate(getElementFromSelector(element)); // Search and activate/show the proper section
|
|
4660
|
+
this._activate(SelectorEngine.getElementFromSelector(element)); // Search and activate/show the proper section
|
|
4525
4661
|
|
|
4526
4662
|
const complete = () => {
|
|
4527
4663
|
if (element.getAttribute('role') !== 'tab') {
|
|
@@ -4543,7 +4679,7 @@ class Tab extends BaseComponent {
|
|
|
4543
4679
|
}
|
|
4544
4680
|
element.classList.remove(CLASS_NAME_ACTIVE);
|
|
4545
4681
|
element.blur();
|
|
4546
|
-
this._deactivate(getElementFromSelector(element)); // Search and deactivate the shown section too
|
|
4682
|
+
this._deactivate(SelectorEngine.getElementFromSelector(element)); // Search and deactivate the shown section too
|
|
4547
4683
|
|
|
4548
4684
|
const complete = () => {
|
|
4549
4685
|
if (element.getAttribute('role') !== 'tab') {
|
|
@@ -4560,13 +4696,19 @@ class Tab extends BaseComponent {
|
|
|
4560
4696
|
this._queueCallback(complete, element, element.classList.contains(CLASS_NAME_FADE$1));
|
|
4561
4697
|
}
|
|
4562
4698
|
_keydown(event) {
|
|
4563
|
-
if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)) {
|
|
4699
|
+
if (![ARROW_LEFT_KEY, ARROW_RIGHT_KEY, ARROW_UP_KEY, ARROW_DOWN_KEY, HOME_KEY, END_KEY].includes(event.key)) {
|
|
4564
4700
|
return;
|
|
4565
4701
|
}
|
|
4566
4702
|
event.stopPropagation(); // stopPropagation/preventDefault both added to support up/down keys without scrolling the page
|
|
4567
4703
|
event.preventDefault();
|
|
4568
|
-
const
|
|
4569
|
-
|
|
4704
|
+
const children = this._getChildren().filter(element => !isDisabled(element));
|
|
4705
|
+
let nextActiveElement;
|
|
4706
|
+
if ([HOME_KEY, END_KEY].includes(event.key)) {
|
|
4707
|
+
nextActiveElement = children[event.key === HOME_KEY ? 0 : children.length - 1];
|
|
4708
|
+
} else {
|
|
4709
|
+
const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
|
|
4710
|
+
nextActiveElement = getNextActiveElement(children, event.target, isNext, true);
|
|
4711
|
+
}
|
|
4570
4712
|
if (nextActiveElement) {
|
|
4571
4713
|
nextActiveElement.focus({
|
|
4572
4714
|
preventScroll: true
|
|
@@ -4604,13 +4746,13 @@ class Tab extends BaseComponent {
|
|
|
4604
4746
|
this._setInitialAttributesOnTargetPanel(child);
|
|
4605
4747
|
}
|
|
4606
4748
|
_setInitialAttributesOnTargetPanel(child) {
|
|
4607
|
-
const target = getElementFromSelector(child);
|
|
4749
|
+
const target = SelectorEngine.getElementFromSelector(child);
|
|
4608
4750
|
if (!target) {
|
|
4609
4751
|
return;
|
|
4610
4752
|
}
|
|
4611
4753
|
this._setAttributeIfNotExists(target, 'role', 'tabpanel');
|
|
4612
4754
|
if (child.id) {
|
|
4613
|
-
this._setAttributeIfNotExists(target, 'aria-labelledby',
|
|
4755
|
+
this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
|
|
4614
4756
|
}
|
|
4615
4757
|
}
|
|
4616
4758
|
_toggleDropDown(element, open) {
|
|
@@ -4688,11 +4830,11 @@ EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
|
|
4688
4830
|
* jQuery
|
|
4689
4831
|
*/
|
|
4690
4832
|
|
|
4691
|
-
defineJQueryPlugin(Tab);
|
|
4833
|
+
defineJQueryPlugin$1(Tab);
|
|
4692
4834
|
|
|
4693
4835
|
/**
|
|
4694
4836
|
* --------------------------------------------------------------------------
|
|
4695
|
-
* Bootstrap
|
|
4837
|
+
* Bootstrap toast.js
|
|
4696
4838
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4697
4839
|
* --------------------------------------------------------------------------
|
|
4698
4840
|
*/
|
|
@@ -4872,7 +5014,7 @@ enableDismissTrigger(Toast);
|
|
|
4872
5014
|
* jQuery
|
|
4873
5015
|
*/
|
|
4874
5016
|
|
|
4875
|
-
defineJQueryPlugin(Toast);
|
|
5017
|
+
defineJQueryPlugin$1(Toast);
|
|
4876
5018
|
|
|
4877
|
-
export { AccessibleToggle, Alert, Button, Carousel, Collapse, Dropdown, Gallery, Modal, Offcanvas, Popover, ScrollSpy, ScrollSpy$1 as ScrollSpyV2, Tab, Toast, Tooltip };
|
|
5019
|
+
export { AccessibleToggle, AccordionToggle, Alert, Button, Carousel, Collapse, Dropdown, Gallery, Modal, Offcanvas, Popover, ScrollSpy, ScrollSpy$1 as ScrollSpyV2, Tab, Toast, Tooltip };
|
|
4878
5020
|
//# sourceMappingURL=oe-bcl-joinup.esm.js.map
|