administrate-bootstrap-theme 0.2.2 → 1.0.6
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 +65 -32
- data/app/assets/javascripts/administrate-bootstrap-theme/{bootstrap/bootstrap.bundle.js → bootstrap.bundle.js} +1058 -973
- data/app/assets/stylesheets/administrate-bootstrap-theme/_base.scss +4 -21
- data/app/assets/stylesheets/administrate-bootstrap-theme/_variables.scss +4 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_card.scss +7 -6
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_carousel.scss +2 -2
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_dropdown.scss +4 -4
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_functions.scss +100 -3
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_grid.scss +11 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_helpers.scss +2 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_images.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_mixins.scss +1 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_modal.scss +5 -15
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_navbar.scss +30 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_offcanvas.scss +8 -2
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_placeholders.scss +51 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_popover.scss +10 -10
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_reboot.scss +12 -8
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_root.scss +40 -2
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tables.scss +9 -5
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_toasts.scss +3 -3
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_tooltip.scss +4 -4
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_transitions.scss +6 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_utilities.scss +44 -8
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/_variables.scss +206 -29
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-grid.scss +3 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-reboot.scss +2 -4
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap-utilities.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/bootstrap.scss +2 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_floating-labels.scss +3 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-check.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-control.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-range.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/forms/_form-select.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_stacks.scss +15 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/helpers/_vr.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_backdrop.scss +14 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_buttons.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_grid.scss +35 -9
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_utilities.scss +27 -6
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/mixins/_visually-hidden.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/bootstrap/vendor/_rfs.scss +55 -13
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_autumn.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_default.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_forest.scss +9 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_industrial.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/colors/_water.scss +8 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_body.scss +28 -10
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_content_header.scss +4 -6
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_form.scss +6 -6
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_navigation.scss +26 -3
- data/app/assets/stylesheets/administrate-bootstrap-theme/components/_pagination.scss +1 -1
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_lato.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_montserrat.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_open_sans.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_roboto.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/fonts/_source_sans_pro.scss +5 -0
- data/app/assets/stylesheets/administrate-bootstrap-theme/theme.scss +10 -61
- data/lib/administrate-bootstrap-theme/version.rb +3 -1
- data/lib/generators/administrate_bootstrap_theme/install/USAGE +10 -0
- data/lib/generators/administrate_bootstrap_theme/install/install_generator.rb +33 -0
- data/package.json +2 -3
- metadata +22 -8
- data/app/assets/javascripts/administrate-bootstrap-theme/flatpickr/flatpickr.js +0 -2673
- data/app/assets/javascripts/administrate-bootstrap-theme/theme.js +0 -22
- data/app/assets/stylesheets/administrate-bootstrap-theme/flatpickr/flatpickr.scss +0 -791
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Bootstrap v5.
|
|
2
|
+
* Bootstrap v5.1.3 (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,86 +7,14 @@
|
|
|
7
7
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
8
8
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
9
9
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory());
|
|
10
|
-
}(this, (function () { 'use strict';
|
|
10
|
+
})(this, (function () { 'use strict';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* --------------------------------------------------------------------------
|
|
14
|
-
* Bootstrap (v5.
|
|
14
|
+
* Bootstrap (v5.1.3): util/index.js
|
|
15
15
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
16
16
|
* --------------------------------------------------------------------------
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* ------------------------------------------------------------------------
|
|
21
|
-
* Constants
|
|
22
|
-
* ------------------------------------------------------------------------
|
|
23
|
-
*/
|
|
24
|
-
const NODE_TEXT = 3;
|
|
25
|
-
const SelectorEngine = {
|
|
26
|
-
find(selector, element = document.documentElement) {
|
|
27
|
-
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
findOne(selector, element = document.documentElement) {
|
|
31
|
-
return Element.prototype.querySelector.call(element, selector);
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
children(element, selector) {
|
|
35
|
-
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
parents(element, selector) {
|
|
39
|
-
const parents = [];
|
|
40
|
-
let ancestor = element.parentNode;
|
|
41
|
-
|
|
42
|
-
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
43
|
-
if (ancestor.matches(selector)) {
|
|
44
|
-
parents.push(ancestor);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
ancestor = ancestor.parentNode;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return parents;
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
prev(element, selector) {
|
|
54
|
-
let previous = element.previousElementSibling;
|
|
55
|
-
|
|
56
|
-
while (previous) {
|
|
57
|
-
if (previous.matches(selector)) {
|
|
58
|
-
return [previous];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
previous = previous.previousElementSibling;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return [];
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
next(element, selector) {
|
|
68
|
-
let next = element.nextElementSibling;
|
|
69
|
-
|
|
70
|
-
while (next) {
|
|
71
|
-
if (next.matches(selector)) {
|
|
72
|
-
return [next];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
next = next.nextElementSibling;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return [];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* --------------------------------------------------------------------------
|
|
85
|
-
* Bootstrap (v5.0.1): util/index.js
|
|
86
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
87
|
-
* --------------------------------------------------------------------------
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
18
|
const MAX_UID = 1000000;
|
|
91
19
|
const MILLISECONDS_MULTIPLIER = 1000;
|
|
92
20
|
const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
|
@@ -198,30 +126,12 @@
|
|
|
198
126
|
}
|
|
199
127
|
|
|
200
128
|
if (typeof obj === 'string' && obj.length > 0) {
|
|
201
|
-
return
|
|
129
|
+
return document.querySelector(obj);
|
|
202
130
|
}
|
|
203
131
|
|
|
204
132
|
return null;
|
|
205
133
|
};
|
|
206
134
|
|
|
207
|
-
const emulateTransitionEnd = (element, duration) => {
|
|
208
|
-
let called = false;
|
|
209
|
-
const durationPadding = 5;
|
|
210
|
-
const emulatedDuration = duration + durationPadding;
|
|
211
|
-
|
|
212
|
-
function listener() {
|
|
213
|
-
called = true;
|
|
214
|
-
element.removeEventListener(TRANSITION_END, listener);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
element.addEventListener(TRANSITION_END, listener);
|
|
218
|
-
setTimeout(() => {
|
|
219
|
-
if (!called) {
|
|
220
|
-
triggerTransitionEnd(element);
|
|
221
|
-
}
|
|
222
|
-
}, emulatedDuration);
|
|
223
|
-
};
|
|
224
|
-
|
|
225
135
|
const typeCheckConfig = (componentName, config, configTypes) => {
|
|
226
136
|
Object.keys(configTypes).forEach(property => {
|
|
227
137
|
const expectedTypes = configTypes[property];
|
|
@@ -235,17 +145,11 @@
|
|
|
235
145
|
};
|
|
236
146
|
|
|
237
147
|
const isVisible = element => {
|
|
238
|
-
if (!element) {
|
|
148
|
+
if (!isElement$1(element) || element.getClientRects().length === 0) {
|
|
239
149
|
return false;
|
|
240
150
|
}
|
|
241
151
|
|
|
242
|
-
|
|
243
|
-
const elementStyle = getComputedStyle(element);
|
|
244
|
-
const parentNodeStyle = getComputedStyle(element.parentNode);
|
|
245
|
-
return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden';
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return false;
|
|
152
|
+
return getComputedStyle(element).getPropertyValue('visibility') === 'visible';
|
|
249
153
|
};
|
|
250
154
|
|
|
251
155
|
const isDisabled = element => {
|
|
@@ -288,8 +192,20 @@
|
|
|
288
192
|
};
|
|
289
193
|
|
|
290
194
|
const noop = () => {};
|
|
195
|
+
/**
|
|
196
|
+
* Trick to restart an element's animation
|
|
197
|
+
*
|
|
198
|
+
* @param {HTMLElement} element
|
|
199
|
+
* @return void
|
|
200
|
+
*
|
|
201
|
+
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
|
202
|
+
*/
|
|
291
203
|
|
|
292
|
-
|
|
204
|
+
|
|
205
|
+
const reflow = element => {
|
|
206
|
+
// eslint-disable-next-line no-unused-expressions
|
|
207
|
+
element.offsetHeight;
|
|
208
|
+
};
|
|
293
209
|
|
|
294
210
|
const getjQuery = () => {
|
|
295
211
|
const {
|
|
@@ -303,9 +219,18 @@
|
|
|
303
219
|
return null;
|
|
304
220
|
};
|
|
305
221
|
|
|
222
|
+
const DOMContentLoadedCallbacks = [];
|
|
223
|
+
|
|
306
224
|
const onDOMContentLoaded = callback => {
|
|
307
225
|
if (document.readyState === 'loading') {
|
|
308
|
-
document
|
|
226
|
+
// add listener on the first call when the document is in loading state
|
|
227
|
+
if (!DOMContentLoadedCallbacks.length) {
|
|
228
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
229
|
+
DOMContentLoadedCallbacks.forEach(callback => callback());
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
DOMContentLoadedCallbacks.push(callback);
|
|
309
234
|
} else {
|
|
310
235
|
callback();
|
|
311
236
|
}
|
|
@@ -338,63 +263,66 @@
|
|
|
338
263
|
}
|
|
339
264
|
};
|
|
340
265
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
*/
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* ------------------------------------------------------------------------
|
|
350
|
-
* Constants
|
|
351
|
-
* ------------------------------------------------------------------------
|
|
352
|
-
*/
|
|
353
|
-
const elementMap = new Map();
|
|
354
|
-
var Data = {
|
|
355
|
-
set(element, key, instance) {
|
|
356
|
-
if (!elementMap.has(element)) {
|
|
357
|
-
elementMap.set(element, new Map());
|
|
358
|
-
}
|
|
266
|
+
const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
|
|
267
|
+
if (!waitForTransition) {
|
|
268
|
+
execute(callback);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
359
271
|
|
|
360
|
-
|
|
361
|
-
|
|
272
|
+
const durationPadding = 5;
|
|
273
|
+
const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
|
|
274
|
+
let called = false;
|
|
362
275
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
276
|
+
const handler = ({
|
|
277
|
+
target
|
|
278
|
+
}) => {
|
|
279
|
+
if (target !== transitionElement) {
|
|
366
280
|
return;
|
|
367
281
|
}
|
|
368
282
|
|
|
369
|
-
|
|
370
|
-
|
|
283
|
+
called = true;
|
|
284
|
+
transitionElement.removeEventListener(TRANSITION_END, handler);
|
|
285
|
+
execute(callback);
|
|
286
|
+
};
|
|
371
287
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
288
|
+
transitionElement.addEventListener(TRANSITION_END, handler);
|
|
289
|
+
setTimeout(() => {
|
|
290
|
+
if (!called) {
|
|
291
|
+
triggerTransitionEnd(transitionElement);
|
|
375
292
|
}
|
|
293
|
+
}, emulatedDuration);
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Return the previous/next element of a list.
|
|
297
|
+
*
|
|
298
|
+
* @param {array} list The list of elements
|
|
299
|
+
* @param activeElement The active element
|
|
300
|
+
* @param shouldGetNext Choose to get next or previous element
|
|
301
|
+
* @param isCycleAllowed
|
|
302
|
+
* @return {Element|elem} The proper element
|
|
303
|
+
*/
|
|
376
304
|
|
|
377
|
-
return null;
|
|
378
|
-
},
|
|
379
305
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
306
|
+
const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
|
|
307
|
+
let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed
|
|
384
308
|
|
|
385
|
-
|
|
386
|
-
|
|
309
|
+
if (index === -1) {
|
|
310
|
+
return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];
|
|
311
|
+
}
|
|
387
312
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
313
|
+
const listLength = list.length;
|
|
314
|
+
index += shouldGetNext ? 1 : -1;
|
|
315
|
+
|
|
316
|
+
if (isCycleAllowed) {
|
|
317
|
+
index = (index + listLength) % listLength;
|
|
391
318
|
}
|
|
392
319
|
|
|
320
|
+
return list[Math.max(0, Math.min(index, listLength - 1))];
|
|
393
321
|
};
|
|
394
322
|
|
|
395
323
|
/**
|
|
396
324
|
* --------------------------------------------------------------------------
|
|
397
|
-
* Bootstrap (v5.
|
|
325
|
+
* Bootstrap (v5.1.3): dom/event-handler.js
|
|
398
326
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
399
327
|
* --------------------------------------------------------------------------
|
|
400
328
|
*/
|
|
@@ -457,7 +385,6 @@
|
|
|
457
385
|
event.delegateTarget = target;
|
|
458
386
|
|
|
459
387
|
if (handler.oneOff) {
|
|
460
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
461
388
|
EventHandler.off(element, event.type, selector, fn);
|
|
462
389
|
}
|
|
463
390
|
|
|
@@ -683,17 +610,71 @@
|
|
|
683
610
|
|
|
684
611
|
/**
|
|
685
612
|
* --------------------------------------------------------------------------
|
|
686
|
-
* Bootstrap (v5.
|
|
613
|
+
* Bootstrap (v5.1.3): dom/data.js
|
|
687
614
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
688
615
|
* --------------------------------------------------------------------------
|
|
689
616
|
*/
|
|
617
|
+
|
|
690
618
|
/**
|
|
691
619
|
* ------------------------------------------------------------------------
|
|
692
620
|
* Constants
|
|
693
621
|
* ------------------------------------------------------------------------
|
|
694
622
|
*/
|
|
623
|
+
const elementMap = new Map();
|
|
624
|
+
const Data = {
|
|
625
|
+
set(element, key, instance) {
|
|
626
|
+
if (!elementMap.has(element)) {
|
|
627
|
+
elementMap.set(element, new Map());
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
const instanceMap = elementMap.get(element); // make it clear we only want one instance per element
|
|
631
|
+
// can be removed later when multiple key/instances are fine to be used
|
|
632
|
+
|
|
633
|
+
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
|
634
|
+
// eslint-disable-next-line no-console
|
|
635
|
+
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
695
638
|
|
|
696
|
-
|
|
639
|
+
instanceMap.set(key, instance);
|
|
640
|
+
},
|
|
641
|
+
|
|
642
|
+
get(element, key) {
|
|
643
|
+
if (elementMap.has(element)) {
|
|
644
|
+
return elementMap.get(element).get(key) || null;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return null;
|
|
648
|
+
},
|
|
649
|
+
|
|
650
|
+
remove(element, key) {
|
|
651
|
+
if (!elementMap.has(element)) {
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
const instanceMap = elementMap.get(element);
|
|
656
|
+
instanceMap.delete(key); // free up element references if there are no instances left for an element
|
|
657
|
+
|
|
658
|
+
if (instanceMap.size === 0) {
|
|
659
|
+
elementMap.delete(element);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* --------------------------------------------------------------------------
|
|
667
|
+
* Bootstrap (v5.1.3): base-component.js
|
|
668
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
669
|
+
* --------------------------------------------------------------------------
|
|
670
|
+
*/
|
|
671
|
+
/**
|
|
672
|
+
* ------------------------------------------------------------------------
|
|
673
|
+
* Constants
|
|
674
|
+
* ------------------------------------------------------------------------
|
|
675
|
+
*/
|
|
676
|
+
|
|
677
|
+
const VERSION = '5.1.3';
|
|
697
678
|
|
|
698
679
|
class BaseComponent {
|
|
699
680
|
constructor(element) {
|
|
@@ -716,20 +697,17 @@
|
|
|
716
697
|
}
|
|
717
698
|
|
|
718
699
|
_queueCallback(callback, element, isAnimated = true) {
|
|
719
|
-
|
|
720
|
-
execute(callback);
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
const transitionDuration = getTransitionDurationFromElement(element);
|
|
725
|
-
EventHandler.one(element, 'transitionend', () => execute(callback));
|
|
726
|
-
emulateTransitionEnd(element, transitionDuration);
|
|
700
|
+
executeAfterTransition(callback, element, isAnimated);
|
|
727
701
|
}
|
|
728
702
|
/** Static */
|
|
729
703
|
|
|
730
704
|
|
|
731
705
|
static getInstance(element) {
|
|
732
|
-
return Data.get(element, this.DATA_KEY);
|
|
706
|
+
return Data.get(getElement(element), this.DATA_KEY);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
static getOrCreateInstance(element, config = {}) {
|
|
710
|
+
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
|
|
733
711
|
}
|
|
734
712
|
|
|
735
713
|
static get VERSION() {
|
|
@@ -752,7 +730,33 @@
|
|
|
752
730
|
|
|
753
731
|
/**
|
|
754
732
|
* --------------------------------------------------------------------------
|
|
755
|
-
* Bootstrap (v5.
|
|
733
|
+
* Bootstrap (v5.1.3): util/component-functions.js
|
|
734
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
735
|
+
* --------------------------------------------------------------------------
|
|
736
|
+
*/
|
|
737
|
+
|
|
738
|
+
const enableDismissTrigger = (component, method = 'hide') => {
|
|
739
|
+
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
|
740
|
+
const name = component.NAME;
|
|
741
|
+
EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
|
|
742
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
|
743
|
+
event.preventDefault();
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
if (isDisabled(this)) {
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
const target = getElementFromSelector(this) || this.closest(`.${name}`);
|
|
751
|
+
const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method
|
|
752
|
+
|
|
753
|
+
instance[method]();
|
|
754
|
+
});
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* --------------------------------------------------------------------------
|
|
759
|
+
* Bootstrap (v5.1.3): alert.js
|
|
756
760
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
757
761
|
* --------------------------------------------------------------------------
|
|
758
762
|
*/
|
|
@@ -762,17 +766,13 @@
|
|
|
762
766
|
* ------------------------------------------------------------------------
|
|
763
767
|
*/
|
|
764
768
|
|
|
765
|
-
const NAME$
|
|
766
|
-
const DATA_KEY$
|
|
767
|
-
const EVENT_KEY$
|
|
768
|
-
const
|
|
769
|
-
const
|
|
770
|
-
const
|
|
771
|
-
const
|
|
772
|
-
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$b}${DATA_API_KEY$8}`;
|
|
773
|
-
const CLASS_NAME_ALERT = 'alert';
|
|
774
|
-
const CLASS_NAME_FADE$6 = 'fade';
|
|
775
|
-
const CLASS_NAME_SHOW$9 = 'show';
|
|
769
|
+
const NAME$d = 'alert';
|
|
770
|
+
const DATA_KEY$c = 'bs.alert';
|
|
771
|
+
const EVENT_KEY$c = `.${DATA_KEY$c}`;
|
|
772
|
+
const EVENT_CLOSE = `close${EVENT_KEY$c}`;
|
|
773
|
+
const EVENT_CLOSED = `closed${EVENT_KEY$c}`;
|
|
774
|
+
const CLASS_NAME_FADE$5 = 'fade';
|
|
775
|
+
const CLASS_NAME_SHOW$8 = 'show';
|
|
776
776
|
/**
|
|
777
777
|
* ------------------------------------------------------------------------
|
|
778
778
|
* Class Definition
|
|
@@ -782,69 +782,47 @@
|
|
|
782
782
|
class Alert extends BaseComponent {
|
|
783
783
|
// Getters
|
|
784
784
|
static get NAME() {
|
|
785
|
-
return NAME$
|
|
785
|
+
return NAME$d;
|
|
786
786
|
} // Public
|
|
787
787
|
|
|
788
788
|
|
|
789
|
-
close(
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
const customEvent = this._triggerCloseEvent(rootElement);
|
|
789
|
+
close() {
|
|
790
|
+
const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE);
|
|
793
791
|
|
|
794
|
-
if (
|
|
792
|
+
if (closeEvent.defaultPrevented) {
|
|
795
793
|
return;
|
|
796
794
|
}
|
|
797
795
|
|
|
798
|
-
this.
|
|
799
|
-
} // Private
|
|
800
|
-
|
|
796
|
+
this._element.classList.remove(CLASS_NAME_SHOW$8);
|
|
801
797
|
|
|
802
|
-
|
|
803
|
-
return getElementFromSelector(element) || element.closest(`.${CLASS_NAME_ALERT}`);
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
_triggerCloseEvent(element) {
|
|
807
|
-
return EventHandler.trigger(element, EVENT_CLOSE);
|
|
808
|
-
}
|
|
798
|
+
const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5);
|
|
809
799
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
const isAnimated = element.classList.contains(CLASS_NAME_FADE$6);
|
|
800
|
+
this._queueCallback(() => this._destroyElement(), this._element, isAnimated);
|
|
801
|
+
} // Private
|
|
813
802
|
|
|
814
|
-
this._queueCallback(() => this._destroyElement(element), element, isAnimated);
|
|
815
|
-
}
|
|
816
803
|
|
|
817
|
-
_destroyElement(
|
|
818
|
-
|
|
819
|
-
element.parentNode.removeChild(element);
|
|
820
|
-
}
|
|
804
|
+
_destroyElement() {
|
|
805
|
+
this._element.remove();
|
|
821
806
|
|
|
822
|
-
EventHandler.trigger(
|
|
807
|
+
EventHandler.trigger(this._element, EVENT_CLOSED);
|
|
808
|
+
this.dispose();
|
|
823
809
|
} // Static
|
|
824
810
|
|
|
825
811
|
|
|
826
812
|
static jQueryInterface(config) {
|
|
827
813
|
return this.each(function () {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
if (!data) {
|
|
831
|
-
data = new Alert(this);
|
|
832
|
-
}
|
|
814
|
+
const data = Alert.getOrCreateInstance(this);
|
|
833
815
|
|
|
834
|
-
if (config
|
|
835
|
-
|
|
816
|
+
if (typeof config !== 'string') {
|
|
817
|
+
return;
|
|
836
818
|
}
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
819
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
if (event) {
|
|
843
|
-
event.preventDefault();
|
|
820
|
+
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
|
|
821
|
+
throw new TypeError(`No method named "${config}"`);
|
|
844
822
|
}
|
|
845
823
|
|
|
846
|
-
|
|
847
|
-
};
|
|
824
|
+
data[config](this);
|
|
825
|
+
});
|
|
848
826
|
}
|
|
849
827
|
|
|
850
828
|
}
|
|
@@ -855,7 +833,7 @@
|
|
|
855
833
|
*/
|
|
856
834
|
|
|
857
835
|
|
|
858
|
-
|
|
836
|
+
enableDismissTrigger(Alert, 'close');
|
|
859
837
|
/**
|
|
860
838
|
* ------------------------------------------------------------------------
|
|
861
839
|
* jQuery
|
|
@@ -867,7 +845,7 @@
|
|
|
867
845
|
|
|
868
846
|
/**
|
|
869
847
|
* --------------------------------------------------------------------------
|
|
870
|
-
* Bootstrap (v5.
|
|
848
|
+
* Bootstrap (v5.1.3): button.js
|
|
871
849
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
872
850
|
* --------------------------------------------------------------------------
|
|
873
851
|
*/
|
|
@@ -877,13 +855,13 @@
|
|
|
877
855
|
* ------------------------------------------------------------------------
|
|
878
856
|
*/
|
|
879
857
|
|
|
880
|
-
const NAME$
|
|
881
|
-
const DATA_KEY$
|
|
882
|
-
const EVENT_KEY$
|
|
858
|
+
const NAME$c = 'button';
|
|
859
|
+
const DATA_KEY$b = 'bs.button';
|
|
860
|
+
const EVENT_KEY$b = `.${DATA_KEY$b}`;
|
|
883
861
|
const DATA_API_KEY$7 = '.data-api';
|
|
884
862
|
const CLASS_NAME_ACTIVE$3 = 'active';
|
|
885
863
|
const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]';
|
|
886
|
-
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$
|
|
864
|
+
const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`;
|
|
887
865
|
/**
|
|
888
866
|
* ------------------------------------------------------------------------
|
|
889
867
|
* Class Definition
|
|
@@ -893,7 +871,7 @@
|
|
|
893
871
|
class Button extends BaseComponent {
|
|
894
872
|
// Getters
|
|
895
873
|
static get NAME() {
|
|
896
|
-
return NAME$
|
|
874
|
+
return NAME$c;
|
|
897
875
|
} // Public
|
|
898
876
|
|
|
899
877
|
|
|
@@ -905,11 +883,7 @@
|
|
|
905
883
|
|
|
906
884
|
static jQueryInterface(config) {
|
|
907
885
|
return this.each(function () {
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
if (!data) {
|
|
911
|
-
data = new Button(this);
|
|
912
|
-
}
|
|
886
|
+
const data = Button.getOrCreateInstance(this);
|
|
913
887
|
|
|
914
888
|
if (config === 'toggle') {
|
|
915
889
|
data[config]();
|
|
@@ -928,12 +902,7 @@
|
|
|
928
902
|
EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => {
|
|
929
903
|
event.preventDefault();
|
|
930
904
|
const button = event.target.closest(SELECTOR_DATA_TOGGLE$5);
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
if (!data) {
|
|
934
|
-
data = new Button(button);
|
|
935
|
-
}
|
|
936
|
-
|
|
905
|
+
const data = Button.getOrCreateInstance(button);
|
|
937
906
|
data.toggle();
|
|
938
907
|
});
|
|
939
908
|
/**
|
|
@@ -947,7 +916,7 @@
|
|
|
947
916
|
|
|
948
917
|
/**
|
|
949
918
|
* --------------------------------------------------------------------------
|
|
950
|
-
* Bootstrap (v5.
|
|
919
|
+
* Bootstrap (v5.1.3): dom/manipulator.js
|
|
951
920
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
952
921
|
* --------------------------------------------------------------------------
|
|
953
922
|
*/
|
|
@@ -968,60 +937,130 @@
|
|
|
968
937
|
return null;
|
|
969
938
|
}
|
|
970
939
|
|
|
971
|
-
return val;
|
|
972
|
-
}
|
|
940
|
+
return val;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
function normalizeDataKey(key) {
|
|
944
|
+
return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`);
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
const Manipulator = {
|
|
948
|
+
setDataAttribute(element, key, value) {
|
|
949
|
+
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
|
|
950
|
+
},
|
|
951
|
+
|
|
952
|
+
removeDataAttribute(element, key) {
|
|
953
|
+
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);
|
|
954
|
+
},
|
|
955
|
+
|
|
956
|
+
getDataAttributes(element) {
|
|
957
|
+
if (!element) {
|
|
958
|
+
return {};
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
const attributes = {};
|
|
962
|
+
Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
|
|
963
|
+
let pureKey = key.replace(/^bs/, '');
|
|
964
|
+
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
|
|
965
|
+
attributes[pureKey] = normalizeData(element.dataset[key]);
|
|
966
|
+
});
|
|
967
|
+
return attributes;
|
|
968
|
+
},
|
|
969
|
+
|
|
970
|
+
getDataAttribute(element, key) {
|
|
971
|
+
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));
|
|
972
|
+
},
|
|
973
|
+
|
|
974
|
+
offset(element) {
|
|
975
|
+
const rect = element.getBoundingClientRect();
|
|
976
|
+
return {
|
|
977
|
+
top: rect.top + window.pageYOffset,
|
|
978
|
+
left: rect.left + window.pageXOffset
|
|
979
|
+
};
|
|
980
|
+
},
|
|
981
|
+
|
|
982
|
+
position(element) {
|
|
983
|
+
return {
|
|
984
|
+
top: element.offsetTop,
|
|
985
|
+
left: element.offsetLeft
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* --------------------------------------------------------------------------
|
|
993
|
+
* Bootstrap (v5.1.3): dom/selector-engine.js
|
|
994
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
995
|
+
* --------------------------------------------------------------------------
|
|
996
|
+
*/
|
|
997
|
+
const NODE_TEXT = 3;
|
|
998
|
+
const SelectorEngine = {
|
|
999
|
+
find(selector, element = document.documentElement) {
|
|
1000
|
+
return [].concat(...Element.prototype.querySelectorAll.call(element, selector));
|
|
1001
|
+
},
|
|
1002
|
+
|
|
1003
|
+
findOne(selector, element = document.documentElement) {
|
|
1004
|
+
return Element.prototype.querySelector.call(element, selector);
|
|
1005
|
+
},
|
|
1006
|
+
|
|
1007
|
+
children(element, selector) {
|
|
1008
|
+
return [].concat(...element.children).filter(child => child.matches(selector));
|
|
1009
|
+
},
|
|
1010
|
+
|
|
1011
|
+
parents(element, selector) {
|
|
1012
|
+
const parents = [];
|
|
1013
|
+
let ancestor = element.parentNode;
|
|
1014
|
+
|
|
1015
|
+
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
|
1016
|
+
if (ancestor.matches(selector)) {
|
|
1017
|
+
parents.push(ancestor);
|
|
1018
|
+
}
|
|
973
1019
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
1020
|
+
ancestor = ancestor.parentNode;
|
|
1021
|
+
}
|
|
977
1022
|
|
|
978
|
-
|
|
979
|
-
setDataAttribute(element, key, value) {
|
|
980
|
-
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
|
|
1023
|
+
return parents;
|
|
981
1024
|
},
|
|
982
1025
|
|
|
983
|
-
|
|
984
|
-
element.
|
|
985
|
-
},
|
|
1026
|
+
prev(element, selector) {
|
|
1027
|
+
let previous = element.previousElementSibling;
|
|
986
1028
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1029
|
+
while (previous) {
|
|
1030
|
+
if (previous.matches(selector)) {
|
|
1031
|
+
return [previous];
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
previous = previous.previousElementSibling;
|
|
990
1035
|
}
|
|
991
1036
|
|
|
992
|
-
|
|
993
|
-
Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => {
|
|
994
|
-
let pureKey = key.replace(/^bs/, '');
|
|
995
|
-
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
|
|
996
|
-
attributes[pureKey] = normalizeData(element.dataset[key]);
|
|
997
|
-
});
|
|
998
|
-
return attributes;
|
|
1037
|
+
return [];
|
|
999
1038
|
},
|
|
1000
1039
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
},
|
|
1040
|
+
next(element, selector) {
|
|
1041
|
+
let next = element.nextElementSibling;
|
|
1004
1042
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1043
|
+
while (next) {
|
|
1044
|
+
if (next.matches(selector)) {
|
|
1045
|
+
return [next];
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
next = next.nextElementSibling;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
return [];
|
|
1011
1052
|
},
|
|
1012
1053
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
left: element.offsetLeft
|
|
1017
|
-
};
|
|
1054
|
+
focusableChildren(element) {
|
|
1055
|
+
const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
|
1056
|
+
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el));
|
|
1018
1057
|
}
|
|
1019
1058
|
|
|
1020
1059
|
};
|
|
1021
1060
|
|
|
1022
1061
|
/**
|
|
1023
1062
|
* --------------------------------------------------------------------------
|
|
1024
|
-
* Bootstrap (v5.
|
|
1063
|
+
* Bootstrap (v5.1.3): carousel.js
|
|
1025
1064
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1026
1065
|
* --------------------------------------------------------------------------
|
|
1027
1066
|
*/
|
|
@@ -1031,16 +1070,16 @@
|
|
|
1031
1070
|
* ------------------------------------------------------------------------
|
|
1032
1071
|
*/
|
|
1033
1072
|
|
|
1034
|
-
const NAME$
|
|
1035
|
-
const DATA_KEY$
|
|
1036
|
-
const EVENT_KEY$
|
|
1073
|
+
const NAME$b = 'carousel';
|
|
1074
|
+
const DATA_KEY$a = 'bs.carousel';
|
|
1075
|
+
const EVENT_KEY$a = `.${DATA_KEY$a}`;
|
|
1037
1076
|
const DATA_API_KEY$6 = '.data-api';
|
|
1038
1077
|
const ARROW_LEFT_KEY = 'ArrowLeft';
|
|
1039
1078
|
const ARROW_RIGHT_KEY = 'ArrowRight';
|
|
1040
1079
|
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
|
1041
1080
|
|
|
1042
1081
|
const SWIPE_THRESHOLD = 40;
|
|
1043
|
-
const Default$
|
|
1082
|
+
const Default$a = {
|
|
1044
1083
|
interval: 5000,
|
|
1045
1084
|
keyboard: true,
|
|
1046
1085
|
slide: false,
|
|
@@ -1048,7 +1087,7 @@
|
|
|
1048
1087
|
wrap: true,
|
|
1049
1088
|
touch: true
|
|
1050
1089
|
};
|
|
1051
|
-
const DefaultType$
|
|
1090
|
+
const DefaultType$a = {
|
|
1052
1091
|
interval: '(number|boolean)',
|
|
1053
1092
|
keyboard: 'boolean',
|
|
1054
1093
|
slide: '(boolean|string)',
|
|
@@ -1060,19 +1099,23 @@
|
|
|
1060
1099
|
const ORDER_PREV = 'prev';
|
|
1061
1100
|
const DIRECTION_LEFT = 'left';
|
|
1062
1101
|
const DIRECTION_RIGHT = 'right';
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
const
|
|
1068
|
-
const
|
|
1069
|
-
const
|
|
1070
|
-
const
|
|
1071
|
-
const
|
|
1072
|
-
const
|
|
1073
|
-
const
|
|
1074
|
-
const
|
|
1075
|
-
const
|
|
1102
|
+
const KEY_TO_DIRECTION = {
|
|
1103
|
+
[ARROW_LEFT_KEY]: DIRECTION_RIGHT,
|
|
1104
|
+
[ARROW_RIGHT_KEY]: DIRECTION_LEFT
|
|
1105
|
+
};
|
|
1106
|
+
const EVENT_SLIDE = `slide${EVENT_KEY$a}`;
|
|
1107
|
+
const EVENT_SLID = `slid${EVENT_KEY$a}`;
|
|
1108
|
+
const EVENT_KEYDOWN = `keydown${EVENT_KEY$a}`;
|
|
1109
|
+
const EVENT_MOUSEENTER = `mouseenter${EVENT_KEY$a}`;
|
|
1110
|
+
const EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY$a}`;
|
|
1111
|
+
const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$a}`;
|
|
1112
|
+
const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$a}`;
|
|
1113
|
+
const EVENT_TOUCHEND = `touchend${EVENT_KEY$a}`;
|
|
1114
|
+
const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$a}`;
|
|
1115
|
+
const EVENT_POINTERUP = `pointerup${EVENT_KEY$a}`;
|
|
1116
|
+
const EVENT_DRAG_START = `dragstart${EVENT_KEY$a}`;
|
|
1117
|
+
const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
1118
|
+
const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`;
|
|
1076
1119
|
const CLASS_NAME_CAROUSEL = 'carousel';
|
|
1077
1120
|
const CLASS_NAME_ACTIVE$2 = 'active';
|
|
1078
1121
|
const CLASS_NAME_SLIDE = 'slide';
|
|
@@ -1119,18 +1162,16 @@
|
|
|
1119
1162
|
|
|
1120
1163
|
|
|
1121
1164
|
static get Default() {
|
|
1122
|
-
return Default$
|
|
1165
|
+
return Default$a;
|
|
1123
1166
|
}
|
|
1124
1167
|
|
|
1125
1168
|
static get NAME() {
|
|
1126
|
-
return NAME$
|
|
1169
|
+
return NAME$b;
|
|
1127
1170
|
} // Public
|
|
1128
1171
|
|
|
1129
1172
|
|
|
1130
1173
|
next() {
|
|
1131
|
-
|
|
1132
|
-
this._slide(ORDER_NEXT);
|
|
1133
|
-
}
|
|
1174
|
+
this._slide(ORDER_NEXT);
|
|
1134
1175
|
}
|
|
1135
1176
|
|
|
1136
1177
|
nextWhenVisible() {
|
|
@@ -1142,9 +1183,7 @@
|
|
|
1142
1183
|
}
|
|
1143
1184
|
|
|
1144
1185
|
prev() {
|
|
1145
|
-
|
|
1146
|
-
this._slide(ORDER_PREV);
|
|
1147
|
-
}
|
|
1186
|
+
this._slide(ORDER_PREV);
|
|
1148
1187
|
}
|
|
1149
1188
|
|
|
1150
1189
|
pause(event) {
|
|
@@ -1205,10 +1244,11 @@
|
|
|
1205
1244
|
|
|
1206
1245
|
|
|
1207
1246
|
_getConfig(config) {
|
|
1208
|
-
config = { ...Default$
|
|
1209
|
-
...
|
|
1247
|
+
config = { ...Default$a,
|
|
1248
|
+
...Manipulator.getDataAttributes(this._element),
|
|
1249
|
+
...(typeof config === 'object' ? config : {})
|
|
1210
1250
|
};
|
|
1211
|
-
typeCheckConfig(NAME$
|
|
1251
|
+
typeCheckConfig(NAME$b, config, DefaultType$a);
|
|
1212
1252
|
return config;
|
|
1213
1253
|
}
|
|
1214
1254
|
|
|
@@ -1245,8 +1285,12 @@
|
|
|
1245
1285
|
}
|
|
1246
1286
|
|
|
1247
1287
|
_addTouchEventListeners() {
|
|
1288
|
+
const hasPointerPenTouch = event => {
|
|
1289
|
+
return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH);
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1248
1292
|
const start = event => {
|
|
1249
|
-
if (
|
|
1293
|
+
if (hasPointerPenTouch(event)) {
|
|
1250
1294
|
this.touchStartX = event.clientX;
|
|
1251
1295
|
} else if (!this._pointerEvent) {
|
|
1252
1296
|
this.touchStartX = event.touches[0].clientX;
|
|
@@ -1259,7 +1303,7 @@
|
|
|
1259
1303
|
};
|
|
1260
1304
|
|
|
1261
1305
|
const end = event => {
|
|
1262
|
-
if (
|
|
1306
|
+
if (hasPointerPenTouch(event)) {
|
|
1263
1307
|
this.touchDeltaX = event.clientX - this.touchStartX;
|
|
1264
1308
|
}
|
|
1265
1309
|
|
|
@@ -1284,7 +1328,7 @@
|
|
|
1284
1328
|
};
|
|
1285
1329
|
|
|
1286
1330
|
SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
|
|
1287
|
-
EventHandler.on(itemImg, EVENT_DRAG_START,
|
|
1331
|
+
EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault());
|
|
1288
1332
|
});
|
|
1289
1333
|
|
|
1290
1334
|
if (this._pointerEvent) {
|
|
@@ -1304,14 +1348,12 @@
|
|
|
1304
1348
|
return;
|
|
1305
1349
|
}
|
|
1306
1350
|
|
|
1307
|
-
|
|
1308
|
-
event.preventDefault();
|
|
1351
|
+
const direction = KEY_TO_DIRECTION[event.key];
|
|
1309
1352
|
|
|
1310
|
-
|
|
1311
|
-
} else if (event.key === ARROW_RIGHT_KEY) {
|
|
1353
|
+
if (direction) {
|
|
1312
1354
|
event.preventDefault();
|
|
1313
1355
|
|
|
1314
|
-
this._slide(
|
|
1356
|
+
this._slide(direction);
|
|
1315
1357
|
}
|
|
1316
1358
|
}
|
|
1317
1359
|
|
|
@@ -1322,20 +1364,7 @@
|
|
|
1322
1364
|
|
|
1323
1365
|
_getItemByOrder(order, activeElement) {
|
|
1324
1366
|
const isNext = order === ORDER_NEXT;
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
const activeIndex = this._getItemIndex(activeElement);
|
|
1328
|
-
|
|
1329
|
-
const lastItemIndex = this._items.length - 1;
|
|
1330
|
-
const isGoingToWrap = isPrev && activeIndex === 0 || isNext && activeIndex === lastItemIndex;
|
|
1331
|
-
|
|
1332
|
-
if (isGoingToWrap && !this._config.wrap) {
|
|
1333
|
-
return activeElement;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
const delta = isPrev ? -1 : 1;
|
|
1337
|
-
const itemIndex = (activeIndex + delta) % this._items.length;
|
|
1338
|
-
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
|
|
1367
|
+
return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap);
|
|
1339
1368
|
}
|
|
1340
1369
|
|
|
1341
1370
|
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
|
@@ -1408,6 +1437,10 @@
|
|
|
1408
1437
|
return;
|
|
1409
1438
|
}
|
|
1410
1439
|
|
|
1440
|
+
if (this._isSliding) {
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1411
1444
|
const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
|
|
1412
1445
|
|
|
1413
1446
|
if (slideEvent.defaultPrevented) {
|
|
@@ -1491,10 +1524,10 @@
|
|
|
1491
1524
|
|
|
1492
1525
|
|
|
1493
1526
|
static carouselInterface(element, config) {
|
|
1494
|
-
|
|
1495
|
-
let
|
|
1496
|
-
|
|
1497
|
-
};
|
|
1527
|
+
const data = Carousel.getOrCreateInstance(element, config);
|
|
1528
|
+
let {
|
|
1529
|
+
_config
|
|
1530
|
+
} = data;
|
|
1498
1531
|
|
|
1499
1532
|
if (typeof config === 'object') {
|
|
1500
1533
|
_config = { ..._config,
|
|
@@ -1504,10 +1537,6 @@
|
|
|
1504
1537
|
|
|
1505
1538
|
const action = typeof config === 'string' ? config : _config.slide;
|
|
1506
1539
|
|
|
1507
|
-
if (!data) {
|
|
1508
|
-
data = new Carousel(element, _config);
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
1540
|
if (typeof config === 'number') {
|
|
1512
1541
|
data.to(config);
|
|
1513
1542
|
} else if (typeof action === 'string') {
|
|
@@ -1547,7 +1576,7 @@
|
|
|
1547
1576
|
Carousel.carouselInterface(target, config);
|
|
1548
1577
|
|
|
1549
1578
|
if (slideIndex) {
|
|
1550
|
-
|
|
1579
|
+
Carousel.getInstance(target).to(slideIndex);
|
|
1551
1580
|
}
|
|
1552
1581
|
|
|
1553
1582
|
event.preventDefault();
|
|
@@ -1566,7 +1595,7 @@
|
|
|
1566
1595
|
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
|
|
1567
1596
|
|
|
1568
1597
|
for (let i = 0, len = carousels.length; i < len; i++) {
|
|
1569
|
-
Carousel.carouselInterface(carousels[i],
|
|
1598
|
+
Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]));
|
|
1570
1599
|
}
|
|
1571
1600
|
});
|
|
1572
1601
|
/**
|
|
@@ -1580,7 +1609,7 @@
|
|
|
1580
1609
|
|
|
1581
1610
|
/**
|
|
1582
1611
|
* --------------------------------------------------------------------------
|
|
1583
|
-
* Bootstrap (v5.
|
|
1612
|
+
* Bootstrap (v5.1.3): collapse.js
|
|
1584
1613
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1585
1614
|
* --------------------------------------------------------------------------
|
|
1586
1615
|
*/
|
|
@@ -1590,30 +1619,32 @@
|
|
|
1590
1619
|
* ------------------------------------------------------------------------
|
|
1591
1620
|
*/
|
|
1592
1621
|
|
|
1593
|
-
const NAME$
|
|
1594
|
-
const DATA_KEY$
|
|
1595
|
-
const EVENT_KEY$
|
|
1622
|
+
const NAME$a = 'collapse';
|
|
1623
|
+
const DATA_KEY$9 = 'bs.collapse';
|
|
1624
|
+
const EVENT_KEY$9 = `.${DATA_KEY$9}`;
|
|
1596
1625
|
const DATA_API_KEY$5 = '.data-api';
|
|
1597
|
-
const Default$
|
|
1626
|
+
const Default$9 = {
|
|
1598
1627
|
toggle: true,
|
|
1599
|
-
parent:
|
|
1628
|
+
parent: null
|
|
1600
1629
|
};
|
|
1601
|
-
const DefaultType$
|
|
1630
|
+
const DefaultType$9 = {
|
|
1602
1631
|
toggle: 'boolean',
|
|
1603
|
-
parent: '(
|
|
1632
|
+
parent: '(null|element)'
|
|
1604
1633
|
};
|
|
1605
|
-
const EVENT_SHOW$5 = `show${EVENT_KEY$
|
|
1606
|
-
const EVENT_SHOWN$5 = `shown${EVENT_KEY$
|
|
1607
|
-
const EVENT_HIDE$5 = `hide${EVENT_KEY$
|
|
1608
|
-
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$
|
|
1609
|
-
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$
|
|
1610
|
-
const CLASS_NAME_SHOW$
|
|
1634
|
+
const EVENT_SHOW$5 = `show${EVENT_KEY$9}`;
|
|
1635
|
+
const EVENT_SHOWN$5 = `shown${EVENT_KEY$9}`;
|
|
1636
|
+
const EVENT_HIDE$5 = `hide${EVENT_KEY$9}`;
|
|
1637
|
+
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$9}`;
|
|
1638
|
+
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`;
|
|
1639
|
+
const CLASS_NAME_SHOW$7 = 'show';
|
|
1611
1640
|
const CLASS_NAME_COLLAPSE = 'collapse';
|
|
1612
1641
|
const CLASS_NAME_COLLAPSING = 'collapsing';
|
|
1613
1642
|
const CLASS_NAME_COLLAPSED = 'collapsed';
|
|
1643
|
+
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
|
|
1644
|
+
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
|
1614
1645
|
const WIDTH = 'width';
|
|
1615
1646
|
const HEIGHT = 'height';
|
|
1616
|
-
const SELECTOR_ACTIVES = '.show, .collapsing';
|
|
1647
|
+
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
|
1617
1648
|
const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]';
|
|
1618
1649
|
/**
|
|
1619
1650
|
* ------------------------------------------------------------------------
|
|
@@ -1626,7 +1657,7 @@
|
|
|
1626
1657
|
super(element);
|
|
1627
1658
|
this._isTransitioning = false;
|
|
1628
1659
|
this._config = this._getConfig(config);
|
|
1629
|
-
this._triggerArray =
|
|
1660
|
+
this._triggerArray = [];
|
|
1630
1661
|
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);
|
|
1631
1662
|
|
|
1632
1663
|
for (let i = 0, len = toggleList.length; i < len; i++) {
|
|
@@ -1641,10 +1672,10 @@
|
|
|
1641
1672
|
}
|
|
1642
1673
|
}
|
|
1643
1674
|
|
|
1644
|
-
this.
|
|
1675
|
+
this._initializeChildren();
|
|
1645
1676
|
|
|
1646
1677
|
if (!this._config.parent) {
|
|
1647
|
-
this._addAriaAndCollapsedClass(this.
|
|
1678
|
+
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
|
1648
1679
|
}
|
|
1649
1680
|
|
|
1650
1681
|
if (this._config.toggle) {
|
|
@@ -1654,16 +1685,16 @@
|
|
|
1654
1685
|
|
|
1655
1686
|
|
|
1656
1687
|
static get Default() {
|
|
1657
|
-
return Default$
|
|
1688
|
+
return Default$9;
|
|
1658
1689
|
}
|
|
1659
1690
|
|
|
1660
1691
|
static get NAME() {
|
|
1661
|
-
return NAME$
|
|
1692
|
+
return NAME$a;
|
|
1662
1693
|
} // Public
|
|
1663
1694
|
|
|
1664
1695
|
|
|
1665
1696
|
toggle() {
|
|
1666
|
-
if (this.
|
|
1697
|
+
if (this._isShown()) {
|
|
1667
1698
|
this.hide();
|
|
1668
1699
|
} else {
|
|
1669
1700
|
this.show();
|
|
@@ -1671,32 +1702,23 @@
|
|
|
1671
1702
|
}
|
|
1672
1703
|
|
|
1673
1704
|
show() {
|
|
1674
|
-
if (this._isTransitioning || this.
|
|
1705
|
+
if (this._isTransitioning || this._isShown()) {
|
|
1675
1706
|
return;
|
|
1676
1707
|
}
|
|
1677
1708
|
|
|
1678
|
-
let actives;
|
|
1709
|
+
let actives = [];
|
|
1679
1710
|
let activesData;
|
|
1680
1711
|
|
|
1681
|
-
if (this.
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
return elem.getAttribute('data-bs-parent') === this._config.parent;
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
return elem.classList.contains(CLASS_NAME_COLLAPSE);
|
|
1688
|
-
});
|
|
1689
|
-
|
|
1690
|
-
if (actives.length === 0) {
|
|
1691
|
-
actives = null;
|
|
1692
|
-
}
|
|
1712
|
+
if (this._config.parent) {
|
|
1713
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1714
|
+
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
|
1693
1715
|
}
|
|
1694
1716
|
|
|
1695
1717
|
const container = SelectorEngine.findOne(this._selector);
|
|
1696
1718
|
|
|
1697
|
-
if (actives) {
|
|
1719
|
+
if (actives.length) {
|
|
1698
1720
|
const tempActiveData = actives.find(elem => container !== elem);
|
|
1699
|
-
activesData = tempActiveData ?
|
|
1721
|
+
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
|
1700
1722
|
|
|
1701
1723
|
if (activesData && activesData._isTransitioning) {
|
|
1702
1724
|
return;
|
|
@@ -1709,17 +1731,17 @@
|
|
|
1709
1731
|
return;
|
|
1710
1732
|
}
|
|
1711
1733
|
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
}
|
|
1734
|
+
actives.forEach(elemActive => {
|
|
1735
|
+
if (container !== elemActive) {
|
|
1736
|
+
Collapse.getOrCreateInstance(elemActive, {
|
|
1737
|
+
toggle: false
|
|
1738
|
+
}).hide();
|
|
1739
|
+
}
|
|
1717
1740
|
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
}
|
|
1741
|
+
if (!activesData) {
|
|
1742
|
+
Data.set(elemActive, DATA_KEY$9, null);
|
|
1743
|
+
}
|
|
1744
|
+
});
|
|
1723
1745
|
|
|
1724
1746
|
const dimension = this._getDimension();
|
|
1725
1747
|
|
|
@@ -1729,22 +1751,18 @@
|
|
|
1729
1751
|
|
|
1730
1752
|
this._element.style[dimension] = 0;
|
|
1731
1753
|
|
|
1732
|
-
|
|
1733
|
-
this._triggerArray.forEach(element => {
|
|
1734
|
-
element.classList.remove(CLASS_NAME_COLLAPSED);
|
|
1735
|
-
element.setAttribute('aria-expanded', true);
|
|
1736
|
-
});
|
|
1737
|
-
}
|
|
1754
|
+
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
|
1738
1755
|
|
|
1739
|
-
this.
|
|
1756
|
+
this._isTransitioning = true;
|
|
1740
1757
|
|
|
1741
1758
|
const complete = () => {
|
|
1759
|
+
this._isTransitioning = false;
|
|
1760
|
+
|
|
1742
1761
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1743
1762
|
|
|
1744
|
-
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1763
|
+
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
|
|
1745
1764
|
|
|
1746
1765
|
this._element.style[dimension] = '';
|
|
1747
|
-
this.setTransitioning(false);
|
|
1748
1766
|
EventHandler.trigger(this._element, EVENT_SHOWN$5);
|
|
1749
1767
|
};
|
|
1750
1768
|
|
|
@@ -1757,7 +1775,7 @@
|
|
|
1757
1775
|
}
|
|
1758
1776
|
|
|
1759
1777
|
hide() {
|
|
1760
|
-
if (this._isTransitioning || !this.
|
|
1778
|
+
if (this._isTransitioning || !this._isShown()) {
|
|
1761
1779
|
return;
|
|
1762
1780
|
}
|
|
1763
1781
|
|
|
@@ -1774,26 +1792,23 @@
|
|
|
1774
1792
|
|
|
1775
1793
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
|
1776
1794
|
|
|
1777
|
-
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
|
1795
|
+
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7);
|
|
1778
1796
|
|
|
1779
1797
|
const triggerArrayLength = this._triggerArray.length;
|
|
1780
1798
|
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
const elem = getElementFromSelector(trigger);
|
|
1799
|
+
for (let i = 0; i < triggerArrayLength; i++) {
|
|
1800
|
+
const trigger = this._triggerArray[i];
|
|
1801
|
+
const elem = getElementFromSelector(trigger);
|
|
1785
1802
|
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
trigger.setAttribute('aria-expanded', false);
|
|
1789
|
-
}
|
|
1803
|
+
if (elem && !this._isShown(elem)) {
|
|
1804
|
+
this._addAriaAndCollapsedClass([trigger], false);
|
|
1790
1805
|
}
|
|
1791
1806
|
}
|
|
1792
1807
|
|
|
1793
|
-
this.
|
|
1808
|
+
this._isTransitioning = true;
|
|
1794
1809
|
|
|
1795
1810
|
const complete = () => {
|
|
1796
|
-
this.
|
|
1811
|
+
this._isTransitioning = false;
|
|
1797
1812
|
|
|
1798
1813
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
|
1799
1814
|
|
|
@@ -1807,45 +1822,47 @@
|
|
|
1807
1822
|
this._queueCallback(complete, this._element, true);
|
|
1808
1823
|
}
|
|
1809
1824
|
|
|
1810
|
-
|
|
1811
|
-
|
|
1825
|
+
_isShown(element = this._element) {
|
|
1826
|
+
return element.classList.contains(CLASS_NAME_SHOW$7);
|
|
1812
1827
|
} // Private
|
|
1813
1828
|
|
|
1814
1829
|
|
|
1815
1830
|
_getConfig(config) {
|
|
1816
|
-
config = { ...Default$
|
|
1831
|
+
config = { ...Default$9,
|
|
1832
|
+
...Manipulator.getDataAttributes(this._element),
|
|
1817
1833
|
...config
|
|
1818
1834
|
};
|
|
1819
1835
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
|
1820
1836
|
|
|
1821
|
-
|
|
1837
|
+
config.parent = getElement(config.parent);
|
|
1838
|
+
typeCheckConfig(NAME$a, config, DefaultType$9);
|
|
1822
1839
|
return config;
|
|
1823
1840
|
}
|
|
1824
1841
|
|
|
1825
1842
|
_getDimension() {
|
|
1826
|
-
return this._element.classList.contains(
|
|
1843
|
+
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
|
1827
1844
|
}
|
|
1828
1845
|
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
const
|
|
1835
|
-
SelectorEngine.find(
|
|
1846
|
+
_initializeChildren() {
|
|
1847
|
+
if (!this._config.parent) {
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
|
1852
|
+
SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => {
|
|
1836
1853
|
const selected = getElementFromSelector(element);
|
|
1837
1854
|
|
|
1838
|
-
|
|
1855
|
+
if (selected) {
|
|
1856
|
+
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
|
1857
|
+
}
|
|
1839
1858
|
});
|
|
1840
|
-
return parent;
|
|
1841
1859
|
}
|
|
1842
1860
|
|
|
1843
|
-
_addAriaAndCollapsedClass(
|
|
1844
|
-
if (!
|
|
1861
|
+
_addAriaAndCollapsedClass(triggerArray, isOpen) {
|
|
1862
|
+
if (!triggerArray.length) {
|
|
1845
1863
|
return;
|
|
1846
1864
|
}
|
|
1847
1865
|
|
|
1848
|
-
const isOpen = element.classList.contains(CLASS_NAME_SHOW$8);
|
|
1849
1866
|
triggerArray.forEach(elem => {
|
|
1850
1867
|
if (isOpen) {
|
|
1851
1868
|
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
|
@@ -1858,33 +1875,23 @@
|
|
|
1858
1875
|
} // Static
|
|
1859
1876
|
|
|
1860
1877
|
|
|
1861
|
-
static
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
...Manipulator.getDataAttributes(element),
|
|
1865
|
-
...(typeof config === 'object' && config ? config : {})
|
|
1866
|
-
};
|
|
1867
|
-
|
|
1868
|
-
if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
|
|
1869
|
-
_config.toggle = false;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
if (!data) {
|
|
1873
|
-
data = new Collapse(element, _config);
|
|
1874
|
-
}
|
|
1878
|
+
static jQueryInterface(config) {
|
|
1879
|
+
return this.each(function () {
|
|
1880
|
+
const _config = {};
|
|
1875
1881
|
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
throw new TypeError(`No method named "${config}"`);
|
|
1882
|
+
if (typeof config === 'string' && /show|hide/.test(config)) {
|
|
1883
|
+
_config.toggle = false;
|
|
1879
1884
|
}
|
|
1880
1885
|
|
|
1881
|
-
data
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1886
|
+
const data = Collapse.getOrCreateInstance(this, _config);
|
|
1884
1887
|
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
+
if (typeof config === 'string') {
|
|
1889
|
+
if (typeof data[config] === 'undefined') {
|
|
1890
|
+
throw new TypeError(`No method named "${config}"`);
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
data[config]();
|
|
1894
|
+
}
|
|
1888
1895
|
});
|
|
1889
1896
|
}
|
|
1890
1897
|
|
|
@@ -1902,26 +1909,12 @@
|
|
|
1902
1909
|
event.preventDefault();
|
|
1903
1910
|
}
|
|
1904
1911
|
|
|
1905
|
-
const triggerData = Manipulator.getDataAttributes(this);
|
|
1906
1912
|
const selector = getSelectorFromElement(this);
|
|
1907
1913
|
const selectorElements = SelectorEngine.find(selector);
|
|
1908
1914
|
selectorElements.forEach(element => {
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
if (data) {
|
|
1913
|
-
// update parent attribute
|
|
1914
|
-
if (data._parent === null && typeof triggerData.parent === 'string') {
|
|
1915
|
-
data._config.parent = triggerData.parent;
|
|
1916
|
-
data._parent = data._getParent();
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
config = 'toggle';
|
|
1920
|
-
} else {
|
|
1921
|
-
config = triggerData;
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
Collapse.collapseInterface(element, config);
|
|
1915
|
+
Collapse.getOrCreateInstance(element, {
|
|
1916
|
+
toggle: false
|
|
1917
|
+
}).toggle();
|
|
1925
1918
|
});
|
|
1926
1919
|
});
|
|
1927
1920
|
/**
|
|
@@ -2076,7 +2069,7 @@
|
|
|
2076
2069
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2077
2070
|
|
|
2078
2071
|
|
|
2079
|
-
|
|
2072
|
+
const applyStyles$1 = {
|
|
2080
2073
|
name: 'applyStyles',
|
|
2081
2074
|
enabled: true,
|
|
2082
2075
|
phase: 'write',
|
|
@@ -2089,17 +2082,39 @@
|
|
|
2089
2082
|
return placement.split('-')[0];
|
|
2090
2083
|
}
|
|
2091
2084
|
|
|
2092
|
-
|
|
2085
|
+
// import { isHTMLElement } from './instanceOf';
|
|
2086
|
+
function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
|
|
2087
|
+
includeScale) {
|
|
2088
|
+
|
|
2093
2089
|
var rect = element.getBoundingClientRect();
|
|
2090
|
+
var scaleX = 1;
|
|
2091
|
+
var scaleY = 1; // FIXME:
|
|
2092
|
+
// `offsetWidth` returns an integer while `getBoundingClientRect`
|
|
2093
|
+
// returns a float. This results in `scaleX` or `scaleY` being
|
|
2094
|
+
// non-1 when it should be for elements that aren't a full pixel in
|
|
2095
|
+
// width or height.
|
|
2096
|
+
// if (isHTMLElement(element) && includeScale) {
|
|
2097
|
+
// const offsetHeight = element.offsetHeight;
|
|
2098
|
+
// const offsetWidth = element.offsetWidth;
|
|
2099
|
+
// // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
|
|
2100
|
+
// // Fallback to 1 in case both values are `0`
|
|
2101
|
+
// if (offsetWidth > 0) {
|
|
2102
|
+
// scaleX = rect.width / offsetWidth || 1;
|
|
2103
|
+
// }
|
|
2104
|
+
// if (offsetHeight > 0) {
|
|
2105
|
+
// scaleY = rect.height / offsetHeight || 1;
|
|
2106
|
+
// }
|
|
2107
|
+
// }
|
|
2108
|
+
|
|
2094
2109
|
return {
|
|
2095
|
-
width: rect.width,
|
|
2096
|
-
height: rect.height,
|
|
2097
|
-
top: rect.top,
|
|
2098
|
-
right: rect.right,
|
|
2099
|
-
bottom: rect.bottom,
|
|
2100
|
-
left: rect.left,
|
|
2101
|
-
x: rect.left,
|
|
2102
|
-
y: rect.top
|
|
2110
|
+
width: rect.width / scaleX,
|
|
2111
|
+
height: rect.height / scaleY,
|
|
2112
|
+
top: rect.top / scaleY,
|
|
2113
|
+
right: rect.right / scaleX,
|
|
2114
|
+
bottom: rect.bottom / scaleY,
|
|
2115
|
+
left: rect.left / scaleX,
|
|
2116
|
+
x: rect.left / scaleX,
|
|
2117
|
+
y: rect.top / scaleY
|
|
2103
2118
|
};
|
|
2104
2119
|
}
|
|
2105
2120
|
|
|
@@ -2344,7 +2359,7 @@
|
|
|
2344
2359
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2345
2360
|
|
|
2346
2361
|
|
|
2347
|
-
|
|
2362
|
+
const arrow$1 = {
|
|
2348
2363
|
name: 'arrow',
|
|
2349
2364
|
enabled: true,
|
|
2350
2365
|
phase: 'main',
|
|
@@ -2354,6 +2369,10 @@
|
|
|
2354
2369
|
requiresIfExists: ['preventOverflow']
|
|
2355
2370
|
};
|
|
2356
2371
|
|
|
2372
|
+
function getVariation(placement) {
|
|
2373
|
+
return placement.split('-')[1];
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2357
2376
|
var unsetSides = {
|
|
2358
2377
|
top: 'auto',
|
|
2359
2378
|
right: 'auto',
|
|
@@ -2380,6 +2399,7 @@
|
|
|
2380
2399
|
var popper = _ref2.popper,
|
|
2381
2400
|
popperRect = _ref2.popperRect,
|
|
2382
2401
|
placement = _ref2.placement,
|
|
2402
|
+
variation = _ref2.variation,
|
|
2383
2403
|
offsets = _ref2.offsets,
|
|
2384
2404
|
position = _ref2.position,
|
|
2385
2405
|
gpuAcceleration = _ref2.gpuAcceleration,
|
|
@@ -2406,7 +2426,7 @@
|
|
|
2406
2426
|
if (offsetParent === getWindow(popper)) {
|
|
2407
2427
|
offsetParent = getDocumentElement(popper);
|
|
2408
2428
|
|
|
2409
|
-
if (getComputedStyle$1(offsetParent).position !== 'static') {
|
|
2429
|
+
if (getComputedStyle$1(offsetParent).position !== 'static' && position === 'absolute') {
|
|
2410
2430
|
heightProp = 'scrollHeight';
|
|
2411
2431
|
widthProp = 'scrollWidth';
|
|
2412
2432
|
}
|
|
@@ -2415,14 +2435,14 @@
|
|
|
2415
2435
|
|
|
2416
2436
|
offsetParent = offsetParent;
|
|
2417
2437
|
|
|
2418
|
-
if (placement === top) {
|
|
2438
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
|
2419
2439
|
sideY = bottom; // $FlowFixMe[prop-missing]
|
|
2420
2440
|
|
|
2421
2441
|
y -= offsetParent[heightProp] - popperRect.height;
|
|
2422
2442
|
y *= gpuAcceleration ? 1 : -1;
|
|
2423
2443
|
}
|
|
2424
2444
|
|
|
2425
|
-
if (placement === left) {
|
|
2445
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
|
2426
2446
|
sideX = right; // $FlowFixMe[prop-missing]
|
|
2427
2447
|
|
|
2428
2448
|
x -= offsetParent[widthProp] - popperRect.width;
|
|
@@ -2437,7 +2457,7 @@
|
|
|
2437
2457
|
if (gpuAcceleration) {
|
|
2438
2458
|
var _Object$assign;
|
|
2439
2459
|
|
|
2440
|
-
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1)
|
|
2460
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
|
2441
2461
|
}
|
|
2442
2462
|
|
|
2443
2463
|
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
|
|
@@ -2455,6 +2475,7 @@
|
|
|
2455
2475
|
|
|
2456
2476
|
var commonStyles = {
|
|
2457
2477
|
placement: getBasePlacement(state.placement),
|
|
2478
|
+
variation: getVariation(state.placement),
|
|
2458
2479
|
popper: state.elements.popper,
|
|
2459
2480
|
popperRect: state.rects.popper,
|
|
2460
2481
|
gpuAcceleration: gpuAcceleration
|
|
@@ -2484,7 +2505,7 @@
|
|
|
2484
2505
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2485
2506
|
|
|
2486
2507
|
|
|
2487
|
-
|
|
2508
|
+
const computeStyles$1 = {
|
|
2488
2509
|
name: 'computeStyles',
|
|
2489
2510
|
enabled: true,
|
|
2490
2511
|
phase: 'beforeWrite',
|
|
@@ -2531,7 +2552,7 @@
|
|
|
2531
2552
|
} // eslint-disable-next-line import/no-unused-modules
|
|
2532
2553
|
|
|
2533
2554
|
|
|
2534
|
-
|
|
2555
|
+
const eventListeners = {
|
|
2535
2556
|
name: 'eventListeners',
|
|
2536
2557
|
enabled: true,
|
|
2537
2558
|
phase: 'write',
|
|
@@ -2757,10 +2778,6 @@
|
|
|
2757
2778
|
return clippingRect;
|
|
2758
2779
|
}
|
|
2759
2780
|
|
|
2760
|
-
function getVariation(placement) {
|
|
2761
|
-
return placement.split('-')[1];
|
|
2762
|
-
}
|
|
2763
|
-
|
|
2764
2781
|
function computeOffsets(_ref) {
|
|
2765
2782
|
var reference = _ref.reference,
|
|
2766
2783
|
element = _ref.element,
|
|
@@ -2846,11 +2863,10 @@
|
|
|
2846
2863
|
padding = _options$padding === void 0 ? 0 : _options$padding;
|
|
2847
2864
|
var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
|
|
2848
2865
|
var altContext = elementContext === popper ? reference : popper;
|
|
2849
|
-
var referenceElement = state.elements.reference;
|
|
2850
2866
|
var popperRect = state.rects.popper;
|
|
2851
2867
|
var element = state.elements[altBoundary ? altContext : elementContext];
|
|
2852
2868
|
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
|
2853
|
-
var referenceClientRect = getBoundingClientRect(
|
|
2869
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
|
2854
2870
|
var popperOffsets = computeOffsets({
|
|
2855
2871
|
reference: referenceClientRect,
|
|
2856
2872
|
element: popperRect,
|
|
@@ -3050,7 +3066,7 @@
|
|
|
3050
3066
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3051
3067
|
|
|
3052
3068
|
|
|
3053
|
-
|
|
3069
|
+
const flip$1 = {
|
|
3054
3070
|
name: 'flip',
|
|
3055
3071
|
enabled: true,
|
|
3056
3072
|
phase: 'main',
|
|
@@ -3083,7 +3099,7 @@
|
|
|
3083
3099
|
});
|
|
3084
3100
|
}
|
|
3085
3101
|
|
|
3086
|
-
function hide
|
|
3102
|
+
function hide(_ref) {
|
|
3087
3103
|
var state = _ref.state,
|
|
3088
3104
|
name = _ref.name;
|
|
3089
3105
|
var referenceRect = state.rects.reference;
|
|
@@ -3112,12 +3128,12 @@
|
|
|
3112
3128
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3113
3129
|
|
|
3114
3130
|
|
|
3115
|
-
|
|
3131
|
+
const hide$1 = {
|
|
3116
3132
|
name: 'hide',
|
|
3117
3133
|
enabled: true,
|
|
3118
3134
|
phase: 'main',
|
|
3119
3135
|
requiresIfExists: ['preventOverflow'],
|
|
3120
|
-
fn: hide
|
|
3136
|
+
fn: hide
|
|
3121
3137
|
};
|
|
3122
3138
|
|
|
3123
3139
|
function distanceAndSkiddingToXY(placement, rects, offset) {
|
|
@@ -3164,7 +3180,7 @@
|
|
|
3164
3180
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3165
3181
|
|
|
3166
3182
|
|
|
3167
|
-
|
|
3183
|
+
const offset$1 = {
|
|
3168
3184
|
name: 'offset',
|
|
3169
3185
|
enabled: true,
|
|
3170
3186
|
phase: 'main',
|
|
@@ -3188,7 +3204,7 @@
|
|
|
3188
3204
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3189
3205
|
|
|
3190
3206
|
|
|
3191
|
-
|
|
3207
|
+
const popperOffsets$1 = {
|
|
3192
3208
|
name: 'popperOffsets',
|
|
3193
3209
|
enabled: true,
|
|
3194
3210
|
phase: 'read',
|
|
@@ -3304,7 +3320,7 @@
|
|
|
3304
3320
|
} // eslint-disable-next-line import/no-unused-modules
|
|
3305
3321
|
|
|
3306
3322
|
|
|
3307
|
-
|
|
3323
|
+
const preventOverflow$1 = {
|
|
3308
3324
|
name: 'preventOverflow',
|
|
3309
3325
|
enabled: true,
|
|
3310
3326
|
phase: 'main',
|
|
@@ -3327,16 +3343,24 @@
|
|
|
3327
3343
|
}
|
|
3328
3344
|
}
|
|
3329
3345
|
|
|
3346
|
+
function isElementScaled(element) {
|
|
3347
|
+
var rect = element.getBoundingClientRect();
|
|
3348
|
+
var scaleX = rect.width / element.offsetWidth || 1;
|
|
3349
|
+
var scaleY = rect.height / element.offsetHeight || 1;
|
|
3350
|
+
return scaleX !== 1 || scaleY !== 1;
|
|
3351
|
+
} // Returns the composite rect of an element relative to its offsetParent.
|
|
3330
3352
|
// Composite means it takes into account transforms as well as layout.
|
|
3331
3353
|
|
|
3354
|
+
|
|
3332
3355
|
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
|
3333
3356
|
if (isFixed === void 0) {
|
|
3334
3357
|
isFixed = false;
|
|
3335
3358
|
}
|
|
3336
3359
|
|
|
3360
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
3361
|
+
isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
|
3337
3362
|
var documentElement = getDocumentElement(offsetParent);
|
|
3338
3363
|
var rect = getBoundingClientRect(elementOrVirtualElement);
|
|
3339
|
-
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
3340
3364
|
var scroll = {
|
|
3341
3365
|
scrollLeft: 0,
|
|
3342
3366
|
scrollTop: 0
|
|
@@ -3490,7 +3514,8 @@
|
|
|
3490
3514
|
var isDestroyed = false;
|
|
3491
3515
|
var instance = {
|
|
3492
3516
|
state: state,
|
|
3493
|
-
setOptions: function setOptions(
|
|
3517
|
+
setOptions: function setOptions(setOptionsAction) {
|
|
3518
|
+
var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
|
|
3494
3519
|
cleanupModifierEffects();
|
|
3495
3520
|
state.options = Object.assign({}, defaultOptions, state.options, options);
|
|
3496
3521
|
state.scrollParents = {
|
|
@@ -3640,48 +3665,48 @@
|
|
|
3640
3665
|
defaultModifiers: defaultModifiers$1
|
|
3641
3666
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
3642
3667
|
|
|
3643
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$
|
|
3668
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
|
3644
3669
|
var createPopper = /*#__PURE__*/popperGenerator({
|
|
3645
3670
|
defaultModifiers: defaultModifiers
|
|
3646
3671
|
}); // eslint-disable-next-line import/no-unused-modules
|
|
3647
3672
|
|
|
3648
|
-
|
|
3673
|
+
const Popper = /*#__PURE__*/Object.freeze({
|
|
3649
3674
|
__proto__: null,
|
|
3650
|
-
popperGenerator
|
|
3651
|
-
detectOverflow
|
|
3675
|
+
popperGenerator,
|
|
3676
|
+
detectOverflow,
|
|
3652
3677
|
createPopperBase: createPopper$2,
|
|
3653
|
-
createPopper
|
|
3678
|
+
createPopper,
|
|
3654
3679
|
createPopperLite: createPopper$1,
|
|
3655
|
-
top
|
|
3656
|
-
bottom
|
|
3657
|
-
right
|
|
3658
|
-
left
|
|
3659
|
-
auto
|
|
3660
|
-
basePlacements
|
|
3661
|
-
start
|
|
3662
|
-
end
|
|
3663
|
-
clippingParents
|
|
3664
|
-
viewport
|
|
3665
|
-
popper
|
|
3666
|
-
reference
|
|
3667
|
-
variationPlacements
|
|
3668
|
-
placements
|
|
3669
|
-
beforeRead
|
|
3670
|
-
read
|
|
3671
|
-
afterRead
|
|
3672
|
-
beforeMain
|
|
3673
|
-
main
|
|
3674
|
-
afterMain
|
|
3675
|
-
beforeWrite
|
|
3676
|
-
write
|
|
3677
|
-
afterWrite
|
|
3678
|
-
modifierPhases
|
|
3680
|
+
top,
|
|
3681
|
+
bottom,
|
|
3682
|
+
right,
|
|
3683
|
+
left,
|
|
3684
|
+
auto,
|
|
3685
|
+
basePlacements,
|
|
3686
|
+
start,
|
|
3687
|
+
end,
|
|
3688
|
+
clippingParents,
|
|
3689
|
+
viewport,
|
|
3690
|
+
popper,
|
|
3691
|
+
reference,
|
|
3692
|
+
variationPlacements,
|
|
3693
|
+
placements,
|
|
3694
|
+
beforeRead,
|
|
3695
|
+
read,
|
|
3696
|
+
afterRead,
|
|
3697
|
+
beforeMain,
|
|
3698
|
+
main,
|
|
3699
|
+
afterMain,
|
|
3700
|
+
beforeWrite,
|
|
3701
|
+
write,
|
|
3702
|
+
afterWrite,
|
|
3703
|
+
modifierPhases,
|
|
3679
3704
|
applyStyles: applyStyles$1,
|
|
3680
3705
|
arrow: arrow$1,
|
|
3681
3706
|
computeStyles: computeStyles$1,
|
|
3682
|
-
eventListeners
|
|
3707
|
+
eventListeners,
|
|
3683
3708
|
flip: flip$1,
|
|
3684
|
-
hide: hide$
|
|
3709
|
+
hide: hide$1,
|
|
3685
3710
|
offset: offset$1,
|
|
3686
3711
|
popperOffsets: popperOffsets$1,
|
|
3687
3712
|
preventOverflow: preventOverflow$1
|
|
@@ -3689,7 +3714,7 @@
|
|
|
3689
3714
|
|
|
3690
3715
|
/**
|
|
3691
3716
|
* --------------------------------------------------------------------------
|
|
3692
|
-
* Bootstrap (v5.
|
|
3717
|
+
* Bootstrap (v5.1.3): dropdown.js
|
|
3693
3718
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3694
3719
|
* --------------------------------------------------------------------------
|
|
3695
3720
|
*/
|
|
@@ -3699,27 +3724,26 @@
|
|
|
3699
3724
|
* ------------------------------------------------------------------------
|
|
3700
3725
|
*/
|
|
3701
3726
|
|
|
3702
|
-
const NAME$
|
|
3703
|
-
const DATA_KEY$
|
|
3704
|
-
const EVENT_KEY$
|
|
3727
|
+
const NAME$9 = 'dropdown';
|
|
3728
|
+
const DATA_KEY$8 = 'bs.dropdown';
|
|
3729
|
+
const EVENT_KEY$8 = `.${DATA_KEY$8}`;
|
|
3705
3730
|
const DATA_API_KEY$4 = '.data-api';
|
|
3706
3731
|
const ESCAPE_KEY$2 = 'Escape';
|
|
3707
3732
|
const SPACE_KEY = 'Space';
|
|
3708
|
-
const TAB_KEY = 'Tab';
|
|
3733
|
+
const TAB_KEY$1 = 'Tab';
|
|
3709
3734
|
const ARROW_UP_KEY = 'ArrowUp';
|
|
3710
3735
|
const ARROW_DOWN_KEY = 'ArrowDown';
|
|
3711
3736
|
const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button
|
|
3712
3737
|
|
|
3713
3738
|
const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`);
|
|
3714
|
-
const EVENT_HIDE$4 = `hide${EVENT_KEY$
|
|
3715
|
-
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$
|
|
3716
|
-
const EVENT_SHOW$4 = `show${EVENT_KEY$
|
|
3717
|
-
const EVENT_SHOWN$4 = `shown${EVENT_KEY$
|
|
3718
|
-
const
|
|
3719
|
-
const
|
|
3720
|
-
const
|
|
3721
|
-
const
|
|
3722
|
-
const CLASS_NAME_SHOW$7 = 'show';
|
|
3739
|
+
const EVENT_HIDE$4 = `hide${EVENT_KEY$8}`;
|
|
3740
|
+
const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`;
|
|
3741
|
+
const EVENT_SHOW$4 = `show${EVENT_KEY$8}`;
|
|
3742
|
+
const EVENT_SHOWN$4 = `shown${EVENT_KEY$8}`;
|
|
3743
|
+
const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$8}${DATA_API_KEY$4}`;
|
|
3744
|
+
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$8}${DATA_API_KEY$4}`;
|
|
3745
|
+
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$8}${DATA_API_KEY$4}`;
|
|
3746
|
+
const CLASS_NAME_SHOW$6 = 'show';
|
|
3723
3747
|
const CLASS_NAME_DROPUP = 'dropup';
|
|
3724
3748
|
const CLASS_NAME_DROPEND = 'dropend';
|
|
3725
3749
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
|
@@ -3734,7 +3758,7 @@
|
|
|
3734
3758
|
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
|
3735
3759
|
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
|
3736
3760
|
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
|
3737
|
-
const Default$
|
|
3761
|
+
const Default$8 = {
|
|
3738
3762
|
offset: [0, 2],
|
|
3739
3763
|
boundary: 'clippingParents',
|
|
3740
3764
|
reference: 'toggle',
|
|
@@ -3742,7 +3766,7 @@
|
|
|
3742
3766
|
popperConfig: null,
|
|
3743
3767
|
autoClose: true
|
|
3744
3768
|
};
|
|
3745
|
-
const DefaultType$
|
|
3769
|
+
const DefaultType$8 = {
|
|
3746
3770
|
offset: '(array|string|function)',
|
|
3747
3771
|
boundary: '(string|element)',
|
|
3748
3772
|
reference: '(string|element|object)',
|
|
@@ -3763,45 +3787,31 @@
|
|
|
3763
3787
|
this._config = this._getConfig(config);
|
|
3764
3788
|
this._menu = this._getMenuElement();
|
|
3765
3789
|
this._inNavbar = this._detectNavbar();
|
|
3766
|
-
|
|
3767
|
-
this._addEventListeners();
|
|
3768
3790
|
} // Getters
|
|
3769
3791
|
|
|
3770
3792
|
|
|
3771
3793
|
static get Default() {
|
|
3772
|
-
return Default$
|
|
3794
|
+
return Default$8;
|
|
3773
3795
|
}
|
|
3774
3796
|
|
|
3775
3797
|
static get DefaultType() {
|
|
3776
|
-
return DefaultType$
|
|
3798
|
+
return DefaultType$8;
|
|
3777
3799
|
}
|
|
3778
3800
|
|
|
3779
3801
|
static get NAME() {
|
|
3780
|
-
return NAME$
|
|
3802
|
+
return NAME$9;
|
|
3781
3803
|
} // Public
|
|
3782
3804
|
|
|
3783
3805
|
|
|
3784
3806
|
toggle() {
|
|
3785
|
-
|
|
3786
|
-
return;
|
|
3787
|
-
}
|
|
3788
|
-
|
|
3789
|
-
const isActive = this._element.classList.contains(CLASS_NAME_SHOW$7);
|
|
3790
|
-
|
|
3791
|
-
if (isActive) {
|
|
3792
|
-
this.hide();
|
|
3793
|
-
return;
|
|
3794
|
-
}
|
|
3795
|
-
|
|
3796
|
-
this.show();
|
|
3807
|
+
return this._isShown() ? this.hide() : this.show();
|
|
3797
3808
|
}
|
|
3798
3809
|
|
|
3799
3810
|
show() {
|
|
3800
|
-
if (isDisabled(this._element) || this._menu
|
|
3811
|
+
if (isDisabled(this._element) || this._isShown(this._menu)) {
|
|
3801
3812
|
return;
|
|
3802
3813
|
}
|
|
3803
3814
|
|
|
3804
|
-
const parent = Dropdown.getParentFromElement(this._element);
|
|
3805
3815
|
const relatedTarget = {
|
|
3806
3816
|
relatedTarget: this._element
|
|
3807
3817
|
};
|
|
@@ -3809,34 +3819,14 @@
|
|
|
3809
3819
|
|
|
3810
3820
|
if (showEvent.defaultPrevented) {
|
|
3811
3821
|
return;
|
|
3812
|
-
}
|
|
3822
|
+
}
|
|
3813
3823
|
|
|
3824
|
+
const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar
|
|
3814
3825
|
|
|
3815
3826
|
if (this._inNavbar) {
|
|
3816
3827
|
Manipulator.setDataAttribute(this._menu, 'popper', 'none');
|
|
3817
3828
|
} else {
|
|
3818
|
-
|
|
3819
|
-
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
3820
|
-
}
|
|
3821
|
-
|
|
3822
|
-
let referenceElement = this._element;
|
|
3823
|
-
|
|
3824
|
-
if (this._config.reference === 'parent') {
|
|
3825
|
-
referenceElement = parent;
|
|
3826
|
-
} else if (isElement$1(this._config.reference)) {
|
|
3827
|
-
referenceElement = getElement(this._config.reference);
|
|
3828
|
-
} else if (typeof this._config.reference === 'object') {
|
|
3829
|
-
referenceElement = this._config.reference;
|
|
3830
|
-
}
|
|
3831
|
-
|
|
3832
|
-
const popperConfig = this._getPopperConfig();
|
|
3833
|
-
|
|
3834
|
-
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
3835
|
-
this._popper = createPopper(referenceElement, this._menu, popperConfig);
|
|
3836
|
-
|
|
3837
|
-
if (isDisplayStatic) {
|
|
3838
|
-
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
3839
|
-
}
|
|
3829
|
+
this._createPopper(parent);
|
|
3840
3830
|
} // If this is a touch-enabled device we add extra
|
|
3841
3831
|
// empty mouseover listeners to the body's immediate children;
|
|
3842
3832
|
// only needed because of broken event delegation on iOS
|
|
@@ -3851,15 +3841,15 @@
|
|
|
3851
3841
|
|
|
3852
3842
|
this._element.setAttribute('aria-expanded', true);
|
|
3853
3843
|
|
|
3854
|
-
this._menu.classList.
|
|
3844
|
+
this._menu.classList.add(CLASS_NAME_SHOW$6);
|
|
3855
3845
|
|
|
3856
|
-
this._element.classList.
|
|
3846
|
+
this._element.classList.add(CLASS_NAME_SHOW$6);
|
|
3857
3847
|
|
|
3858
3848
|
EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);
|
|
3859
3849
|
}
|
|
3860
3850
|
|
|
3861
3851
|
hide() {
|
|
3862
|
-
if (isDisabled(this._element) || !this._menu
|
|
3852
|
+
if (isDisabled(this._element) || !this._isShown(this._menu)) {
|
|
3863
3853
|
return;
|
|
3864
3854
|
}
|
|
3865
3855
|
|
|
@@ -3887,13 +3877,6 @@
|
|
|
3887
3877
|
} // Private
|
|
3888
3878
|
|
|
3889
3879
|
|
|
3890
|
-
_addEventListeners() {
|
|
3891
|
-
EventHandler.on(this._element, EVENT_CLICK, event => {
|
|
3892
|
-
event.preventDefault();
|
|
3893
|
-
this.toggle();
|
|
3894
|
-
});
|
|
3895
|
-
}
|
|
3896
|
-
|
|
3897
3880
|
_completeHide(relatedTarget) {
|
|
3898
3881
|
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);
|
|
3899
3882
|
|
|
@@ -3911,9 +3894,9 @@
|
|
|
3911
3894
|
this._popper.destroy();
|
|
3912
3895
|
}
|
|
3913
3896
|
|
|
3914
|
-
this._menu.classList.remove(CLASS_NAME_SHOW$
|
|
3897
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$6);
|
|
3915
3898
|
|
|
3916
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
3899
|
+
this._element.classList.remove(CLASS_NAME_SHOW$6);
|
|
3917
3900
|
|
|
3918
3901
|
this._element.setAttribute('aria-expanded', 'false');
|
|
3919
3902
|
|
|
@@ -3926,16 +3909,45 @@
|
|
|
3926
3909
|
...Manipulator.getDataAttributes(this._element),
|
|
3927
3910
|
...config
|
|
3928
3911
|
};
|
|
3929
|
-
typeCheckConfig(NAME$
|
|
3912
|
+
typeCheckConfig(NAME$9, config, this.constructor.DefaultType);
|
|
3930
3913
|
|
|
3931
3914
|
if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
|
3932
3915
|
// Popper virtual elements require a getBoundingClientRect method
|
|
3933
|
-
throw new TypeError(`${NAME$
|
|
3916
|
+
throw new TypeError(`${NAME$9.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
|
3934
3917
|
}
|
|
3935
3918
|
|
|
3936
3919
|
return config;
|
|
3937
3920
|
}
|
|
3938
3921
|
|
|
3922
|
+
_createPopper(parent) {
|
|
3923
|
+
if (typeof Popper === 'undefined') {
|
|
3924
|
+
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');
|
|
3925
|
+
}
|
|
3926
|
+
|
|
3927
|
+
let referenceElement = this._element;
|
|
3928
|
+
|
|
3929
|
+
if (this._config.reference === 'parent') {
|
|
3930
|
+
referenceElement = parent;
|
|
3931
|
+
} else if (isElement$1(this._config.reference)) {
|
|
3932
|
+
referenceElement = getElement(this._config.reference);
|
|
3933
|
+
} else if (typeof this._config.reference === 'object') {
|
|
3934
|
+
referenceElement = this._config.reference;
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
const popperConfig = this._getPopperConfig();
|
|
3938
|
+
|
|
3939
|
+
const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false);
|
|
3940
|
+
this._popper = createPopper(referenceElement, this._menu, popperConfig);
|
|
3941
|
+
|
|
3942
|
+
if (isDisplayStatic) {
|
|
3943
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static');
|
|
3944
|
+
}
|
|
3945
|
+
}
|
|
3946
|
+
|
|
3947
|
+
_isShown(element = this._element) {
|
|
3948
|
+
return element.classList.contains(CLASS_NAME_SHOW$6);
|
|
3949
|
+
}
|
|
3950
|
+
|
|
3939
3951
|
_getMenuElement() {
|
|
3940
3952
|
return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
|
|
3941
3953
|
}
|
|
@@ -4009,69 +4021,53 @@
|
|
|
4009
4021
|
};
|
|
4010
4022
|
}
|
|
4011
4023
|
|
|
4012
|
-
_selectMenuItem(
|
|
4024
|
+
_selectMenuItem({
|
|
4025
|
+
key,
|
|
4026
|
+
target
|
|
4027
|
+
}) {
|
|
4013
4028
|
const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);
|
|
4014
4029
|
|
|
4015
4030
|
if (!items.length) {
|
|
4016
4031
|
return;
|
|
4017
|
-
}
|
|
4018
|
-
|
|
4019
|
-
let index = items.indexOf(event.target); // Up
|
|
4032
|
+
} // if target isn't included in items (e.g. when expanding the dropdown)
|
|
4033
|
+
// allow cycling to get the last item in case key equals ARROW_UP_KEY
|
|
4020
4034
|
|
|
4021
|
-
if (event.key === ARROW_UP_KEY && index > 0) {
|
|
4022
|
-
index--;
|
|
4023
|
-
} // Down
|
|
4024
4035
|
|
|
4025
|
-
|
|
4026
|
-
if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
|
|
4027
|
-
index++;
|
|
4028
|
-
} // index is -1 if the first keydown is an ArrowUp
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
index = index === -1 ? 0 : index;
|
|
4032
|
-
items[index].focus();
|
|
4036
|
+
getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus();
|
|
4033
4037
|
} // Static
|
|
4034
4038
|
|
|
4035
4039
|
|
|
4036
|
-
static
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
const _config = typeof config === 'object' ? config : null;
|
|
4040
|
+
static jQueryInterface(config) {
|
|
4041
|
+
return this.each(function () {
|
|
4042
|
+
const data = Dropdown.getOrCreateInstance(this, config);
|
|
4040
4043
|
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
+
if (typeof config !== 'string') {
|
|
4045
|
+
return;
|
|
4046
|
+
}
|
|
4044
4047
|
|
|
4045
|
-
if (typeof config === 'string') {
|
|
4046
4048
|
if (typeof data[config] === 'undefined') {
|
|
4047
4049
|
throw new TypeError(`No method named "${config}"`);
|
|
4048
4050
|
}
|
|
4049
4051
|
|
|
4050
4052
|
data[config]();
|
|
4051
|
-
}
|
|
4052
|
-
}
|
|
4053
|
-
|
|
4054
|
-
static jQueryInterface(config) {
|
|
4055
|
-
return this.each(function () {
|
|
4056
|
-
Dropdown.dropdownInterface(this, config);
|
|
4057
4053
|
});
|
|
4058
4054
|
}
|
|
4059
4055
|
|
|
4060
4056
|
static clearMenus(event) {
|
|
4061
|
-
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY)) {
|
|
4057
|
+
if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) {
|
|
4062
4058
|
return;
|
|
4063
4059
|
}
|
|
4064
4060
|
|
|
4065
4061
|
const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$3);
|
|
4066
4062
|
|
|
4067
4063
|
for (let i = 0, len = toggles.length; i < len; i++) {
|
|
4068
|
-
const context =
|
|
4064
|
+
const context = Dropdown.getInstance(toggles[i]);
|
|
4069
4065
|
|
|
4070
4066
|
if (!context || context._config.autoClose === false) {
|
|
4071
4067
|
continue;
|
|
4072
4068
|
}
|
|
4073
4069
|
|
|
4074
|
-
if (!context.
|
|
4070
|
+
if (!context._isShown()) {
|
|
4075
4071
|
continue;
|
|
4076
4072
|
}
|
|
4077
4073
|
|
|
@@ -4088,7 +4084,7 @@
|
|
|
4088
4084
|
} // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu
|
|
4089
4085
|
|
|
4090
4086
|
|
|
4091
|
-
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
4087
|
+
if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) {
|
|
4092
4088
|
continue;
|
|
4093
4089
|
}
|
|
4094
4090
|
|
|
@@ -4117,7 +4113,7 @@
|
|
|
4117
4113
|
return;
|
|
4118
4114
|
}
|
|
4119
4115
|
|
|
4120
|
-
const isActive = this.classList.contains(CLASS_NAME_SHOW$
|
|
4116
|
+
const isActive = this.classList.contains(CLASS_NAME_SHOW$6);
|
|
4121
4117
|
|
|
4122
4118
|
if (!isActive && event.key === ESCAPE_KEY$2) {
|
|
4123
4119
|
return;
|
|
@@ -4130,25 +4126,27 @@
|
|
|
4130
4126
|
return;
|
|
4131
4127
|
}
|
|
4132
4128
|
|
|
4133
|
-
const getToggleButton =
|
|
4129
|
+
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];
|
|
4130
|
+
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
|
4134
4131
|
|
|
4135
4132
|
if (event.key === ESCAPE_KEY$2) {
|
|
4136
|
-
|
|
4137
|
-
Dropdown.clearMenus();
|
|
4133
|
+
instance.hide();
|
|
4138
4134
|
return;
|
|
4139
4135
|
}
|
|
4140
4136
|
|
|
4141
|
-
if (
|
|
4142
|
-
|
|
4137
|
+
if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {
|
|
4138
|
+
if (!isActive) {
|
|
4139
|
+
instance.show();
|
|
4140
|
+
}
|
|
4141
|
+
|
|
4142
|
+
instance._selectMenuItem(event);
|
|
4143
|
+
|
|
4143
4144
|
return;
|
|
4144
4145
|
}
|
|
4145
4146
|
|
|
4146
4147
|
if (!isActive || event.key === SPACE_KEY) {
|
|
4147
4148
|
Dropdown.clearMenus();
|
|
4148
|
-
return;
|
|
4149
4149
|
}
|
|
4150
|
-
|
|
4151
|
-
Dropdown.getInstance(getToggleButton())._selectMenuItem(event);
|
|
4152
4150
|
}
|
|
4153
4151
|
|
|
4154
4152
|
}
|
|
@@ -4165,7 +4163,7 @@
|
|
|
4165
4163
|
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
|
|
4166
4164
|
EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {
|
|
4167
4165
|
event.preventDefault();
|
|
4168
|
-
Dropdown.
|
|
4166
|
+
Dropdown.getOrCreateInstance(this).toggle();
|
|
4169
4167
|
});
|
|
4170
4168
|
/**
|
|
4171
4169
|
* ------------------------------------------------------------------------
|
|
@@ -4178,103 +4176,134 @@
|
|
|
4178
4176
|
|
|
4179
4177
|
/**
|
|
4180
4178
|
* --------------------------------------------------------------------------
|
|
4181
|
-
* Bootstrap (v5.
|
|
4179
|
+
* Bootstrap (v5.1.3): util/scrollBar.js
|
|
4182
4180
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4183
4181
|
* --------------------------------------------------------------------------
|
|
4184
4182
|
*/
|
|
4185
4183
|
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
|
4186
4184
|
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
|
4187
4185
|
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4186
|
+
class ScrollBarHelper {
|
|
4187
|
+
constructor() {
|
|
4188
|
+
this._element = document.body;
|
|
4189
|
+
}
|
|
4190
|
+
|
|
4191
|
+
getWidth() {
|
|
4192
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
|
4193
|
+
const documentWidth = document.documentElement.clientWidth;
|
|
4194
|
+
return Math.abs(window.innerWidth - documentWidth);
|
|
4195
|
+
}
|
|
4196
|
+
|
|
4197
|
+
hide() {
|
|
4198
|
+
const width = this.getWidth();
|
|
4199
|
+
|
|
4200
|
+
this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width
|
|
4201
|
+
|
|
4202
|
+
|
|
4203
|
+
this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
|
4204
|
+
|
|
4205
|
+
|
|
4206
|
+
this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
|
|
4193
4207
|
|
|
4194
|
-
|
|
4195
|
-
|
|
4208
|
+
this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
|
|
4209
|
+
}
|
|
4196
4210
|
|
|
4211
|
+
_disableOverFlow() {
|
|
4212
|
+
this._saveInitialAttribute(this._element, 'overflow');
|
|
4197
4213
|
|
|
4198
|
-
|
|
4214
|
+
this._element.style.overflow = 'hidden';
|
|
4215
|
+
}
|
|
4199
4216
|
|
|
4217
|
+
_setElementAttributes(selector, styleProp, callback) {
|
|
4218
|
+
const scrollbarWidth = this.getWidth();
|
|
4200
4219
|
|
|
4201
|
-
|
|
4220
|
+
const manipulationCallBack = element => {
|
|
4221
|
+
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
|
4222
|
+
return;
|
|
4223
|
+
}
|
|
4202
4224
|
|
|
4203
|
-
|
|
4204
|
-
};
|
|
4225
|
+
this._saveInitialAttribute(element, styleProp);
|
|
4205
4226
|
|
|
4206
|
-
|
|
4207
|
-
|
|
4227
|
+
const calculatedValue = window.getComputedStyle(element)[styleProp];
|
|
4228
|
+
element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
|
|
4229
|
+
};
|
|
4208
4230
|
|
|
4209
|
-
|
|
4210
|
-
Manipulator.setDataAttribute(document.body, 'overflow', actualValue);
|
|
4231
|
+
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
4211
4232
|
}
|
|
4212
4233
|
|
|
4213
|
-
|
|
4214
|
-
|
|
4234
|
+
reset() {
|
|
4235
|
+
this._resetElementAttributes(this._element, 'overflow');
|
|
4215
4236
|
|
|
4216
|
-
|
|
4217
|
-
const scrollbarWidth = getWidth();
|
|
4218
|
-
SelectorEngine.find(selector).forEach(element => {
|
|
4219
|
-
if (element !== document.body && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
|
4220
|
-
return;
|
|
4221
|
-
}
|
|
4237
|
+
this._resetElementAttributes(this._element, 'paddingRight');
|
|
4222
4238
|
|
|
4223
|
-
|
|
4224
|
-
const calculatedValue = window.getComputedStyle(element)[styleProp];
|
|
4225
|
-
Manipulator.setDataAttribute(element, styleProp, actualValue);
|
|
4226
|
-
element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
|
|
4227
|
-
});
|
|
4228
|
-
};
|
|
4239
|
+
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
|
|
4229
4240
|
|
|
4230
|
-
|
|
4231
|
-
|
|
4241
|
+
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
|
|
4242
|
+
}
|
|
4243
|
+
|
|
4244
|
+
_saveInitialAttribute(element, styleProp) {
|
|
4245
|
+
const actualValue = element.style[styleProp];
|
|
4232
4246
|
|
|
4233
|
-
|
|
4247
|
+
if (actualValue) {
|
|
4248
|
+
Manipulator.setDataAttribute(element, styleProp, actualValue);
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4234
4251
|
|
|
4235
|
-
_resetElementAttributes(
|
|
4252
|
+
_resetElementAttributes(selector, styleProp) {
|
|
4253
|
+
const manipulationCallBack = element => {
|
|
4254
|
+
const value = Manipulator.getDataAttribute(element, styleProp);
|
|
4236
4255
|
|
|
4237
|
-
|
|
4238
|
-
|
|
4256
|
+
if (typeof value === 'undefined') {
|
|
4257
|
+
element.style.removeProperty(styleProp);
|
|
4258
|
+
} else {
|
|
4259
|
+
Manipulator.removeDataAttribute(element, styleProp);
|
|
4260
|
+
element.style[styleProp] = value;
|
|
4261
|
+
}
|
|
4262
|
+
};
|
|
4239
4263
|
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
const value = Manipulator.getDataAttribute(element, styleProp);
|
|
4264
|
+
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
4265
|
+
}
|
|
4243
4266
|
|
|
4244
|
-
|
|
4245
|
-
|
|
4267
|
+
_applyManipulationCallback(selector, callBack) {
|
|
4268
|
+
if (isElement$1(selector)) {
|
|
4269
|
+
callBack(selector);
|
|
4246
4270
|
} else {
|
|
4247
|
-
|
|
4248
|
-
element.style[styleProp] = value;
|
|
4271
|
+
SelectorEngine.find(selector, this._element).forEach(callBack);
|
|
4249
4272
|
}
|
|
4250
|
-
}
|
|
4251
|
-
|
|
4273
|
+
}
|
|
4274
|
+
|
|
4275
|
+
isOverflowing() {
|
|
4276
|
+
return this.getWidth() > 0;
|
|
4277
|
+
}
|
|
4278
|
+
|
|
4279
|
+
}
|
|
4252
4280
|
|
|
4253
4281
|
/**
|
|
4254
4282
|
* --------------------------------------------------------------------------
|
|
4255
|
-
* Bootstrap (v5.
|
|
4256
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/
|
|
4283
|
+
* Bootstrap (v5.1.3): util/backdrop.js
|
|
4284
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4257
4285
|
* --------------------------------------------------------------------------
|
|
4258
4286
|
*/
|
|
4259
|
-
const Default$
|
|
4287
|
+
const Default$7 = {
|
|
4288
|
+
className: 'modal-backdrop',
|
|
4260
4289
|
isVisible: true,
|
|
4261
4290
|
// if false, we use the backdrop helper without adding any element to the dom
|
|
4262
4291
|
isAnimated: false,
|
|
4263
|
-
rootElement:
|
|
4292
|
+
rootElement: 'body',
|
|
4264
4293
|
// give the choice to place backdrop under different elements
|
|
4265
4294
|
clickCallback: null
|
|
4266
4295
|
};
|
|
4267
|
-
const DefaultType$
|
|
4296
|
+
const DefaultType$7 = {
|
|
4297
|
+
className: 'string',
|
|
4268
4298
|
isVisible: 'boolean',
|
|
4269
4299
|
isAnimated: 'boolean',
|
|
4270
|
-
rootElement: 'element',
|
|
4300
|
+
rootElement: '(element|string)',
|
|
4271
4301
|
clickCallback: '(function|null)'
|
|
4272
4302
|
};
|
|
4273
|
-
const NAME$
|
|
4274
|
-
const
|
|
4275
|
-
const
|
|
4276
|
-
const
|
|
4277
|
-
const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$7}`;
|
|
4303
|
+
const NAME$8 = 'backdrop';
|
|
4304
|
+
const CLASS_NAME_FADE$4 = 'fade';
|
|
4305
|
+
const CLASS_NAME_SHOW$5 = 'show';
|
|
4306
|
+
const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$8}`;
|
|
4278
4307
|
|
|
4279
4308
|
class Backdrop {
|
|
4280
4309
|
constructor(config) {
|
|
@@ -4295,7 +4324,7 @@
|
|
|
4295
4324
|
reflow(this._getElement());
|
|
4296
4325
|
}
|
|
4297
4326
|
|
|
4298
|
-
this._getElement().classList.add(CLASS_NAME_SHOW$
|
|
4327
|
+
this._getElement().classList.add(CLASS_NAME_SHOW$5);
|
|
4299
4328
|
|
|
4300
4329
|
this._emulateAnimation(() => {
|
|
4301
4330
|
execute(callback);
|
|
@@ -4308,7 +4337,7 @@
|
|
|
4308
4337
|
return;
|
|
4309
4338
|
}
|
|
4310
4339
|
|
|
4311
|
-
this._getElement().classList.remove(CLASS_NAME_SHOW$
|
|
4340
|
+
this._getElement().classList.remove(CLASS_NAME_SHOW$5);
|
|
4312
4341
|
|
|
4313
4342
|
this._emulateAnimation(() => {
|
|
4314
4343
|
this.dispose();
|
|
@@ -4320,10 +4349,10 @@
|
|
|
4320
4349
|
_getElement() {
|
|
4321
4350
|
if (!this._element) {
|
|
4322
4351
|
const backdrop = document.createElement('div');
|
|
4323
|
-
backdrop.className =
|
|
4352
|
+
backdrop.className = this._config.className;
|
|
4324
4353
|
|
|
4325
4354
|
if (this._config.isAnimated) {
|
|
4326
|
-
backdrop.classList.add(CLASS_NAME_FADE$
|
|
4355
|
+
backdrop.classList.add(CLASS_NAME_FADE$4);
|
|
4327
4356
|
}
|
|
4328
4357
|
|
|
4329
4358
|
this._element = backdrop;
|
|
@@ -4333,11 +4362,12 @@
|
|
|
4333
4362
|
}
|
|
4334
4363
|
|
|
4335
4364
|
_getConfig(config) {
|
|
4336
|
-
config = { ...Default$
|
|
4365
|
+
config = { ...Default$7,
|
|
4337
4366
|
...(typeof config === 'object' ? config : {})
|
|
4338
|
-
};
|
|
4339
|
-
|
|
4340
|
-
|
|
4367
|
+
}; // use getElement() with the default "body" to get a fresh Element on each instantiation
|
|
4368
|
+
|
|
4369
|
+
config.rootElement = getElement(config.rootElement);
|
|
4370
|
+
typeCheckConfig(NAME$8, config, DefaultType$7);
|
|
4341
4371
|
return config;
|
|
4342
4372
|
}
|
|
4343
4373
|
|
|
@@ -4346,7 +4376,7 @@
|
|
|
4346
4376
|
return;
|
|
4347
4377
|
}
|
|
4348
4378
|
|
|
4349
|
-
this._config.rootElement.
|
|
4379
|
+
this._config.rootElement.append(this._getElement());
|
|
4350
4380
|
|
|
4351
4381
|
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
|
4352
4382
|
execute(this._config.clickCallback);
|
|
@@ -4361,27 +4391,123 @@
|
|
|
4361
4391
|
|
|
4362
4392
|
EventHandler.off(this._element, EVENT_MOUSEDOWN);
|
|
4363
4393
|
|
|
4364
|
-
this.
|
|
4394
|
+
this._element.remove();
|
|
4365
4395
|
|
|
4366
4396
|
this._isAppended = false;
|
|
4367
4397
|
}
|
|
4368
4398
|
|
|
4369
4399
|
_emulateAnimation(callback) {
|
|
4370
|
-
|
|
4371
|
-
|
|
4400
|
+
executeAfterTransition(callback, this._getElement(), this._config.isAnimated);
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4403
|
+
}
|
|
4404
|
+
|
|
4405
|
+
/**
|
|
4406
|
+
* --------------------------------------------------------------------------
|
|
4407
|
+
* Bootstrap (v5.1.3): util/focustrap.js
|
|
4408
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4409
|
+
* --------------------------------------------------------------------------
|
|
4410
|
+
*/
|
|
4411
|
+
const Default$6 = {
|
|
4412
|
+
trapElement: null,
|
|
4413
|
+
// The element to trap focus inside of
|
|
4414
|
+
autofocus: true
|
|
4415
|
+
};
|
|
4416
|
+
const DefaultType$6 = {
|
|
4417
|
+
trapElement: 'element',
|
|
4418
|
+
autofocus: 'boolean'
|
|
4419
|
+
};
|
|
4420
|
+
const NAME$7 = 'focustrap';
|
|
4421
|
+
const DATA_KEY$7 = 'bs.focustrap';
|
|
4422
|
+
const EVENT_KEY$7 = `.${DATA_KEY$7}`;
|
|
4423
|
+
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$7}`;
|
|
4424
|
+
const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`;
|
|
4425
|
+
const TAB_KEY = 'Tab';
|
|
4426
|
+
const TAB_NAV_FORWARD = 'forward';
|
|
4427
|
+
const TAB_NAV_BACKWARD = 'backward';
|
|
4428
|
+
|
|
4429
|
+
class FocusTrap {
|
|
4430
|
+
constructor(config) {
|
|
4431
|
+
this._config = this._getConfig(config);
|
|
4432
|
+
this._isActive = false;
|
|
4433
|
+
this._lastTabNavDirection = null;
|
|
4434
|
+
}
|
|
4435
|
+
|
|
4436
|
+
activate() {
|
|
4437
|
+
const {
|
|
4438
|
+
trapElement,
|
|
4439
|
+
autofocus
|
|
4440
|
+
} = this._config;
|
|
4441
|
+
|
|
4442
|
+
if (this._isActive) {
|
|
4443
|
+
return;
|
|
4444
|
+
}
|
|
4445
|
+
|
|
4446
|
+
if (autofocus) {
|
|
4447
|
+
trapElement.focus();
|
|
4448
|
+
}
|
|
4449
|
+
|
|
4450
|
+
EventHandler.off(document, EVENT_KEY$7); // guard against infinite focus loop
|
|
4451
|
+
|
|
4452
|
+
EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event));
|
|
4453
|
+
EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event));
|
|
4454
|
+
this._isActive = true;
|
|
4455
|
+
}
|
|
4456
|
+
|
|
4457
|
+
deactivate() {
|
|
4458
|
+
if (!this._isActive) {
|
|
4459
|
+
return;
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4462
|
+
this._isActive = false;
|
|
4463
|
+
EventHandler.off(document, EVENT_KEY$7);
|
|
4464
|
+
} // Private
|
|
4465
|
+
|
|
4466
|
+
|
|
4467
|
+
_handleFocusin(event) {
|
|
4468
|
+
const {
|
|
4469
|
+
target
|
|
4470
|
+
} = event;
|
|
4471
|
+
const {
|
|
4472
|
+
trapElement
|
|
4473
|
+
} = this._config;
|
|
4474
|
+
|
|
4475
|
+
if (target === document || target === trapElement || trapElement.contains(target)) {
|
|
4476
|
+
return;
|
|
4477
|
+
}
|
|
4478
|
+
|
|
4479
|
+
const elements = SelectorEngine.focusableChildren(trapElement);
|
|
4480
|
+
|
|
4481
|
+
if (elements.length === 0) {
|
|
4482
|
+
trapElement.focus();
|
|
4483
|
+
} else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {
|
|
4484
|
+
elements[elements.length - 1].focus();
|
|
4485
|
+
} else {
|
|
4486
|
+
elements[0].focus();
|
|
4487
|
+
}
|
|
4488
|
+
}
|
|
4489
|
+
|
|
4490
|
+
_handleKeydown(event) {
|
|
4491
|
+
if (event.key !== TAB_KEY) {
|
|
4372
4492
|
return;
|
|
4373
4493
|
}
|
|
4374
4494
|
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4495
|
+
this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD;
|
|
4496
|
+
}
|
|
4497
|
+
|
|
4498
|
+
_getConfig(config) {
|
|
4499
|
+
config = { ...Default$6,
|
|
4500
|
+
...(typeof config === 'object' ? config : {})
|
|
4501
|
+
};
|
|
4502
|
+
typeCheckConfig(NAME$7, config, DefaultType$6);
|
|
4503
|
+
return config;
|
|
4378
4504
|
}
|
|
4379
4505
|
|
|
4380
4506
|
}
|
|
4381
4507
|
|
|
4382
4508
|
/**
|
|
4383
4509
|
* --------------------------------------------------------------------------
|
|
4384
|
-
* Bootstrap (v5.
|
|
4510
|
+
* Bootstrap (v5.1.3): modal.js
|
|
4385
4511
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4386
4512
|
* --------------------------------------------------------------------------
|
|
4387
4513
|
*/
|
|
@@ -4411,21 +4537,20 @@
|
|
|
4411
4537
|
const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$6}`;
|
|
4412
4538
|
const EVENT_SHOW$3 = `show${EVENT_KEY$6}`;
|
|
4413
4539
|
const EVENT_SHOWN$3 = `shown${EVENT_KEY$6}`;
|
|
4414
|
-
const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$6}`;
|
|
4415
4540
|
const EVENT_RESIZE = `resize${EVENT_KEY$6}`;
|
|
4416
|
-
const EVENT_CLICK_DISMISS
|
|
4541
|
+
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$6}`;
|
|
4417
4542
|
const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
|
|
4418
4543
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;
|
|
4419
4544
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;
|
|
4420
4545
|
const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
|
|
4421
4546
|
const CLASS_NAME_OPEN = 'modal-open';
|
|
4422
|
-
const CLASS_NAME_FADE$
|
|
4423
|
-
const CLASS_NAME_SHOW$
|
|
4547
|
+
const CLASS_NAME_FADE$3 = 'fade';
|
|
4548
|
+
const CLASS_NAME_SHOW$4 = 'show';
|
|
4424
4549
|
const CLASS_NAME_STATIC = 'modal-static';
|
|
4550
|
+
const OPEN_SELECTOR$1 = '.modal.show';
|
|
4425
4551
|
const SELECTOR_DIALOG = '.modal-dialog';
|
|
4426
4552
|
const SELECTOR_MODAL_BODY = '.modal-body';
|
|
4427
4553
|
const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
|
|
4428
|
-
const SELECTOR_DATA_DISMISS$2 = '[data-bs-dismiss="modal"]';
|
|
4429
4554
|
/**
|
|
4430
4555
|
* ------------------------------------------------------------------------
|
|
4431
4556
|
* Class Definition
|
|
@@ -4438,9 +4563,11 @@
|
|
|
4438
4563
|
this._config = this._getConfig(config);
|
|
4439
4564
|
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
|
|
4440
4565
|
this._backdrop = this._initializeBackDrop();
|
|
4566
|
+
this._focustrap = this._initializeFocusTrap();
|
|
4441
4567
|
this._isShown = false;
|
|
4442
4568
|
this._ignoreBackdropClick = false;
|
|
4443
4569
|
this._isTransitioning = false;
|
|
4570
|
+
this._scrollBar = new ScrollBarHelper();
|
|
4444
4571
|
} // Getters
|
|
4445
4572
|
|
|
4446
4573
|
|
|
@@ -4462,20 +4589,22 @@
|
|
|
4462
4589
|
return;
|
|
4463
4590
|
}
|
|
4464
4591
|
|
|
4465
|
-
if (this._isAnimated()) {
|
|
4466
|
-
this._isTransitioning = true;
|
|
4467
|
-
}
|
|
4468
|
-
|
|
4469
4592
|
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
|
|
4470
4593
|
relatedTarget
|
|
4471
4594
|
});
|
|
4472
4595
|
|
|
4473
|
-
if (
|
|
4596
|
+
if (showEvent.defaultPrevented) {
|
|
4474
4597
|
return;
|
|
4475
4598
|
}
|
|
4476
4599
|
|
|
4477
4600
|
this._isShown = true;
|
|
4478
|
-
|
|
4601
|
+
|
|
4602
|
+
if (this._isAnimated()) {
|
|
4603
|
+
this._isTransitioning = true;
|
|
4604
|
+
}
|
|
4605
|
+
|
|
4606
|
+
this._scrollBar.hide();
|
|
4607
|
+
|
|
4479
4608
|
document.body.classList.add(CLASS_NAME_OPEN);
|
|
4480
4609
|
|
|
4481
4610
|
this._adjustDialog();
|
|
@@ -4484,7 +4613,6 @@
|
|
|
4484
4613
|
|
|
4485
4614
|
this._setResizeEvent();
|
|
4486
4615
|
|
|
4487
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, SELECTOR_DATA_DISMISS$2, event => this.hide(event));
|
|
4488
4616
|
EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {
|
|
4489
4617
|
EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {
|
|
4490
4618
|
if (event.target === this._element) {
|
|
@@ -4496,11 +4624,7 @@
|
|
|
4496
4624
|
this._showBackdrop(() => this._showElement(relatedTarget));
|
|
4497
4625
|
}
|
|
4498
4626
|
|
|
4499
|
-
hide(
|
|
4500
|
-
if (event) {
|
|
4501
|
-
event.preventDefault();
|
|
4502
|
-
}
|
|
4503
|
-
|
|
4627
|
+
hide() {
|
|
4504
4628
|
if (!this._isShown || this._isTransitioning) {
|
|
4505
4629
|
return;
|
|
4506
4630
|
}
|
|
@@ -4523,11 +4647,11 @@
|
|
|
4523
4647
|
|
|
4524
4648
|
this._setResizeEvent();
|
|
4525
4649
|
|
|
4526
|
-
|
|
4650
|
+
this._focustrap.deactivate();
|
|
4527
4651
|
|
|
4528
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
4652
|
+
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
|
4529
4653
|
|
|
4530
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS
|
|
4654
|
+
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
|
|
4531
4655
|
EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
|
|
4532
4656
|
|
|
4533
4657
|
this._queueCallback(() => this._hideModal(), this._element, isAnimated);
|
|
@@ -4538,14 +4662,9 @@
|
|
|
4538
4662
|
|
|
4539
4663
|
this._backdrop.dispose();
|
|
4540
4664
|
|
|
4541
|
-
|
|
4542
|
-
/**
|
|
4543
|
-
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
|
4544
|
-
* Do not move `document` in `htmlElements` array
|
|
4545
|
-
* It will remove `EVENT_CLICK_DATA_API` event that should remain
|
|
4546
|
-
*/
|
|
4665
|
+
this._focustrap.deactivate();
|
|
4547
4666
|
|
|
4548
|
-
|
|
4667
|
+
super.dispose();
|
|
4549
4668
|
}
|
|
4550
4669
|
|
|
4551
4670
|
handleUpdate() {
|
|
@@ -4561,10 +4680,16 @@
|
|
|
4561
4680
|
});
|
|
4562
4681
|
}
|
|
4563
4682
|
|
|
4683
|
+
_initializeFocusTrap() {
|
|
4684
|
+
return new FocusTrap({
|
|
4685
|
+
trapElement: this._element
|
|
4686
|
+
});
|
|
4687
|
+
}
|
|
4688
|
+
|
|
4564
4689
|
_getConfig(config) {
|
|
4565
4690
|
config = { ...Default$5,
|
|
4566
4691
|
...Manipulator.getDataAttributes(this._element),
|
|
4567
|
-
...config
|
|
4692
|
+
...(typeof config === 'object' ? config : {})
|
|
4568
4693
|
};
|
|
4569
4694
|
typeCheckConfig(NAME$6, config, DefaultType$5);
|
|
4570
4695
|
return config;
|
|
@@ -4577,7 +4702,7 @@
|
|
|
4577
4702
|
|
|
4578
4703
|
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
|
|
4579
4704
|
// Don't move modal's DOM position
|
|
4580
|
-
document.body.
|
|
4705
|
+
document.body.append(this._element);
|
|
4581
4706
|
}
|
|
4582
4707
|
|
|
4583
4708
|
this._element.style.display = 'block';
|
|
@@ -4598,15 +4723,11 @@
|
|
|
4598
4723
|
reflow(this._element);
|
|
4599
4724
|
}
|
|
4600
4725
|
|
|
4601
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
4602
|
-
|
|
4603
|
-
if (this._config.focus) {
|
|
4604
|
-
this._enforceFocus();
|
|
4605
|
-
}
|
|
4726
|
+
this._element.classList.add(CLASS_NAME_SHOW$4);
|
|
4606
4727
|
|
|
4607
4728
|
const transitionComplete = () => {
|
|
4608
4729
|
if (this._config.focus) {
|
|
4609
|
-
this.
|
|
4730
|
+
this._focustrap.activate();
|
|
4610
4731
|
}
|
|
4611
4732
|
|
|
4612
4733
|
this._isTransitioning = false;
|
|
@@ -4618,16 +4739,6 @@
|
|
|
4618
4739
|
this._queueCallback(transitionComplete, this._dialog, isAnimated);
|
|
4619
4740
|
}
|
|
4620
4741
|
|
|
4621
|
-
_enforceFocus() {
|
|
4622
|
-
EventHandler.off(document, EVENT_FOCUSIN$2); // guard against infinite focus loop
|
|
4623
|
-
|
|
4624
|
-
EventHandler.on(document, EVENT_FOCUSIN$2, event => {
|
|
4625
|
-
if (document !== event.target && this._element !== event.target && !this._element.contains(event.target)) {
|
|
4626
|
-
this._element.focus();
|
|
4627
|
-
}
|
|
4628
|
-
});
|
|
4629
|
-
}
|
|
4630
|
-
|
|
4631
4742
|
_setEscapeEvent() {
|
|
4632
4743
|
if (this._isShown) {
|
|
4633
4744
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
|
|
@@ -4667,13 +4778,14 @@
|
|
|
4667
4778
|
|
|
4668
4779
|
this._resetAdjustments();
|
|
4669
4780
|
|
|
4670
|
-
reset();
|
|
4781
|
+
this._scrollBar.reset();
|
|
4782
|
+
|
|
4671
4783
|
EventHandler.trigger(this._element, EVENT_HIDDEN$3);
|
|
4672
4784
|
});
|
|
4673
4785
|
}
|
|
4674
4786
|
|
|
4675
4787
|
_showBackdrop(callback) {
|
|
4676
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS
|
|
4788
|
+
EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {
|
|
4677
4789
|
if (this._ignoreBackdropClick) {
|
|
4678
4790
|
this._ignoreBackdropClick = false;
|
|
4679
4791
|
return;
|
|
@@ -4694,7 +4806,7 @@
|
|
|
4694
4806
|
}
|
|
4695
4807
|
|
|
4696
4808
|
_isAnimated() {
|
|
4697
|
-
return this._element.classList.contains(CLASS_NAME_FADE$
|
|
4809
|
+
return this._element.classList.contains(CLASS_NAME_FADE$3);
|
|
4698
4810
|
}
|
|
4699
4811
|
|
|
4700
4812
|
_triggerBackdropTransition() {
|
|
@@ -4704,27 +4816,32 @@
|
|
|
4704
4816
|
return;
|
|
4705
4817
|
}
|
|
4706
4818
|
|
|
4707
|
-
const
|
|
4819
|
+
const {
|
|
4820
|
+
classList,
|
|
4821
|
+
scrollHeight,
|
|
4822
|
+
style
|
|
4823
|
+
} = this._element;
|
|
4824
|
+
const isModalOverflowing = scrollHeight > document.documentElement.clientHeight; // return if the following background transition hasn't yet completed
|
|
4825
|
+
|
|
4826
|
+
if (!isModalOverflowing && style.overflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) {
|
|
4827
|
+
return;
|
|
4828
|
+
}
|
|
4708
4829
|
|
|
4709
4830
|
if (!isModalOverflowing) {
|
|
4710
|
-
|
|
4831
|
+
style.overflowY = 'hidden';
|
|
4711
4832
|
}
|
|
4712
4833
|
|
|
4713
|
-
|
|
4834
|
+
classList.add(CLASS_NAME_STATIC);
|
|
4714
4835
|
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
EventHandler.one(this._element, 'transitionend', () => {
|
|
4718
|
-
this._element.classList.remove(CLASS_NAME_STATIC);
|
|
4836
|
+
this._queueCallback(() => {
|
|
4837
|
+
classList.remove(CLASS_NAME_STATIC);
|
|
4719
4838
|
|
|
4720
4839
|
if (!isModalOverflowing) {
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
});
|
|
4724
|
-
emulateTransitionEnd(this._element, modalTransitionDuration);
|
|
4840
|
+
this._queueCallback(() => {
|
|
4841
|
+
style.overflowY = '';
|
|
4842
|
+
}, this._dialog);
|
|
4725
4843
|
}
|
|
4726
|
-
});
|
|
4727
|
-
emulateTransitionEnd(this._element, modalTransitionDuration);
|
|
4844
|
+
}, this._dialog);
|
|
4728
4845
|
|
|
4729
4846
|
this._element.focus();
|
|
4730
4847
|
} // ----------------------------------------------------------------------
|
|
@@ -4734,7 +4851,9 @@
|
|
|
4734
4851
|
|
|
4735
4852
|
_adjustDialog() {
|
|
4736
4853
|
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
|
4737
|
-
|
|
4854
|
+
|
|
4855
|
+
const scrollbarWidth = this._scrollBar.getWidth();
|
|
4856
|
+
|
|
4738
4857
|
const isBodyOverflowing = scrollbarWidth > 0;
|
|
4739
4858
|
|
|
4740
4859
|
if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {
|
|
@@ -4754,7 +4873,7 @@
|
|
|
4754
4873
|
|
|
4755
4874
|
static jQueryInterface(config, relatedTarget) {
|
|
4756
4875
|
return this.each(function () {
|
|
4757
|
-
const data = Modal.
|
|
4876
|
+
const data = Modal.getOrCreateInstance(this, config);
|
|
4758
4877
|
|
|
4759
4878
|
if (typeof config !== 'string') {
|
|
4760
4879
|
return;
|
|
@@ -4794,10 +4913,18 @@
|
|
|
4794
4913
|
this.focus();
|
|
4795
4914
|
}
|
|
4796
4915
|
});
|
|
4797
|
-
});
|
|
4798
|
-
|
|
4916
|
+
}); // avoid conflict when clicking moddal toggler while another one is open
|
|
4917
|
+
|
|
4918
|
+
const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1);
|
|
4919
|
+
|
|
4920
|
+
if (allReadyOpen) {
|
|
4921
|
+
Modal.getInstance(allReadyOpen).hide();
|
|
4922
|
+
}
|
|
4923
|
+
|
|
4924
|
+
const data = Modal.getOrCreateInstance(target);
|
|
4799
4925
|
data.toggle(this);
|
|
4800
4926
|
});
|
|
4927
|
+
enableDismissTrigger(Modal);
|
|
4801
4928
|
/**
|
|
4802
4929
|
* ------------------------------------------------------------------------
|
|
4803
4930
|
* jQuery
|
|
@@ -4809,8 +4936,8 @@
|
|
|
4809
4936
|
|
|
4810
4937
|
/**
|
|
4811
4938
|
* --------------------------------------------------------------------------
|
|
4812
|
-
* Bootstrap (v5.
|
|
4813
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/
|
|
4939
|
+
* Bootstrap (v5.1.3): offcanvas.js
|
|
4940
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4814
4941
|
* --------------------------------------------------------------------------
|
|
4815
4942
|
*/
|
|
4816
4943
|
/**
|
|
@@ -4835,17 +4962,15 @@
|
|
|
4835
4962
|
keyboard: 'boolean',
|
|
4836
4963
|
scroll: 'boolean'
|
|
4837
4964
|
};
|
|
4838
|
-
const CLASS_NAME_SHOW$
|
|
4965
|
+
const CLASS_NAME_SHOW$3 = 'show';
|
|
4966
|
+
const CLASS_NAME_BACKDROP = 'offcanvas-backdrop';
|
|
4839
4967
|
const OPEN_SELECTOR = '.offcanvas.show';
|
|
4840
4968
|
const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;
|
|
4841
4969
|
const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;
|
|
4842
4970
|
const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;
|
|
4843
4971
|
const EVENT_HIDDEN$2 = `hidden${EVENT_KEY$5}`;
|
|
4844
|
-
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$5}`;
|
|
4845
4972
|
const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;
|
|
4846
|
-
const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$5}`;
|
|
4847
4973
|
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
|
|
4848
|
-
const SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="offcanvas"]';
|
|
4849
4974
|
const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
|
|
4850
4975
|
/**
|
|
4851
4976
|
* ------------------------------------------------------------------------
|
|
@@ -4859,6 +4984,7 @@
|
|
|
4859
4984
|
this._config = this._getConfig(config);
|
|
4860
4985
|
this._isShown = false;
|
|
4861
4986
|
this._backdrop = this._initializeBackDrop();
|
|
4987
|
+
this._focustrap = this._initializeFocusTrap();
|
|
4862
4988
|
|
|
4863
4989
|
this._addEventListeners();
|
|
4864
4990
|
} // Getters
|
|
@@ -4896,9 +5022,7 @@
|
|
|
4896
5022
|
this._backdrop.show();
|
|
4897
5023
|
|
|
4898
5024
|
if (!this._config.scroll) {
|
|
4899
|
-
hide();
|
|
4900
|
-
|
|
4901
|
-
this._enforceFocusOnElement(this._element);
|
|
5025
|
+
new ScrollBarHelper().hide();
|
|
4902
5026
|
}
|
|
4903
5027
|
|
|
4904
5028
|
this._element.removeAttribute('aria-hidden');
|
|
@@ -4907,9 +5031,13 @@
|
|
|
4907
5031
|
|
|
4908
5032
|
this._element.setAttribute('role', 'dialog');
|
|
4909
5033
|
|
|
4910
|
-
this._element.classList.add(CLASS_NAME_SHOW$
|
|
5034
|
+
this._element.classList.add(CLASS_NAME_SHOW$3);
|
|
4911
5035
|
|
|
4912
5036
|
const completeCallBack = () => {
|
|
5037
|
+
if (!this._config.scroll) {
|
|
5038
|
+
this._focustrap.activate();
|
|
5039
|
+
}
|
|
5040
|
+
|
|
4913
5041
|
EventHandler.trigger(this._element, EVENT_SHOWN$2, {
|
|
4914
5042
|
relatedTarget
|
|
4915
5043
|
});
|
|
@@ -4929,13 +5057,13 @@
|
|
|
4929
5057
|
return;
|
|
4930
5058
|
}
|
|
4931
5059
|
|
|
4932
|
-
|
|
5060
|
+
this._focustrap.deactivate();
|
|
4933
5061
|
|
|
4934
5062
|
this._element.blur();
|
|
4935
5063
|
|
|
4936
5064
|
this._isShown = false;
|
|
4937
5065
|
|
|
4938
|
-
this._element.classList.remove(CLASS_NAME_SHOW$
|
|
5066
|
+
this._element.classList.remove(CLASS_NAME_SHOW$3);
|
|
4939
5067
|
|
|
4940
5068
|
this._backdrop.hide();
|
|
4941
5069
|
|
|
@@ -4949,7 +5077,7 @@
|
|
|
4949
5077
|
this._element.style.visibility = 'hidden';
|
|
4950
5078
|
|
|
4951
5079
|
if (!this._config.scroll) {
|
|
4952
|
-
reset();
|
|
5080
|
+
new ScrollBarHelper().reset();
|
|
4953
5081
|
}
|
|
4954
5082
|
|
|
4955
5083
|
EventHandler.trigger(this._element, EVENT_HIDDEN$2);
|
|
@@ -4961,8 +5089,9 @@
|
|
|
4961
5089
|
dispose() {
|
|
4962
5090
|
this._backdrop.dispose();
|
|
4963
5091
|
|
|
5092
|
+
this._focustrap.deactivate();
|
|
5093
|
+
|
|
4964
5094
|
super.dispose();
|
|
4965
|
-
EventHandler.off(document, EVENT_FOCUSIN$1);
|
|
4966
5095
|
} // Private
|
|
4967
5096
|
|
|
4968
5097
|
|
|
@@ -4977,6 +5106,7 @@
|
|
|
4977
5106
|
|
|
4978
5107
|
_initializeBackDrop() {
|
|
4979
5108
|
return new Backdrop({
|
|
5109
|
+
className: CLASS_NAME_BACKDROP,
|
|
4980
5110
|
isVisible: this._config.backdrop,
|
|
4981
5111
|
isAnimated: true,
|
|
4982
5112
|
rootElement: this._element.parentNode,
|
|
@@ -4984,19 +5114,13 @@
|
|
|
4984
5114
|
});
|
|
4985
5115
|
}
|
|
4986
5116
|
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
EventHandler.on(document, EVENT_FOCUSIN$1, event => {
|
|
4991
|
-
if (document !== event.target && element !== event.target && !element.contains(event.target)) {
|
|
4992
|
-
element.focus();
|
|
4993
|
-
}
|
|
5117
|
+
_initializeFocusTrap() {
|
|
5118
|
+
return new FocusTrap({
|
|
5119
|
+
trapElement: this._element
|
|
4994
5120
|
});
|
|
4995
|
-
element.focus();
|
|
4996
5121
|
}
|
|
4997
5122
|
|
|
4998
5123
|
_addEventListeners() {
|
|
4999
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
|
5000
5124
|
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
|
5001
5125
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
|
5002
5126
|
this.hide();
|
|
@@ -5007,7 +5131,7 @@
|
|
|
5007
5131
|
|
|
5008
5132
|
static jQueryInterface(config) {
|
|
5009
5133
|
return this.each(function () {
|
|
5010
|
-
const data =
|
|
5134
|
+
const data = Offcanvas.getOrCreateInstance(this, config);
|
|
5011
5135
|
|
|
5012
5136
|
if (typeof config !== 'string') {
|
|
5013
5137
|
return;
|
|
@@ -5053,12 +5177,11 @@
|
|
|
5053
5177
|
Offcanvas.getInstance(allReadyOpen).hide();
|
|
5054
5178
|
}
|
|
5055
5179
|
|
|
5056
|
-
const data =
|
|
5180
|
+
const data = Offcanvas.getOrCreateInstance(target);
|
|
5057
5181
|
data.toggle(this);
|
|
5058
5182
|
});
|
|
5059
|
-
EventHandler.on(window, EVENT_LOAD_DATA_API$1, () =>
|
|
5060
|
-
|
|
5061
|
-
});
|
|
5183
|
+
EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show()));
|
|
5184
|
+
enableDismissTrigger(Offcanvas);
|
|
5062
5185
|
/**
|
|
5063
5186
|
* ------------------------------------------------------------------------
|
|
5064
5187
|
* jQuery
|
|
@@ -5069,42 +5192,42 @@
|
|
|
5069
5192
|
|
|
5070
5193
|
/**
|
|
5071
5194
|
* --------------------------------------------------------------------------
|
|
5072
|
-
* Bootstrap (v5.
|
|
5195
|
+
* Bootstrap (v5.1.3): util/sanitizer.js
|
|
5073
5196
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5074
5197
|
* --------------------------------------------------------------------------
|
|
5075
5198
|
*/
|
|
5076
|
-
const
|
|
5199
|
+
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
5077
5200
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
5078
5201
|
/**
|
|
5079
5202
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
5080
5203
|
*
|
|
5081
|
-
* Shoutout to Angular
|
|
5204
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5082
5205
|
*/
|
|
5083
5206
|
|
|
5084
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5207
|
+
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;
|
|
5085
5208
|
/**
|
|
5086
5209
|
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
5087
5210
|
*
|
|
5088
|
-
* Shoutout to Angular
|
|
5211
|
+
* Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
5089
5212
|
*/
|
|
5090
5213
|
|
|
5091
5214
|
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;
|
|
5092
5215
|
|
|
5093
|
-
const allowedAttribute = (
|
|
5094
|
-
const
|
|
5216
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
5217
|
+
const attributeName = attribute.nodeName.toLowerCase();
|
|
5095
5218
|
|
|
5096
|
-
if (allowedAttributeList.includes(
|
|
5097
|
-
if (
|
|
5098
|
-
return Boolean(SAFE_URL_PATTERN.test(
|
|
5219
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
5220
|
+
if (uriAttributes.has(attributeName)) {
|
|
5221
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue));
|
|
5099
5222
|
}
|
|
5100
5223
|
|
|
5101
5224
|
return true;
|
|
5102
5225
|
}
|
|
5103
5226
|
|
|
5104
|
-
const regExp = allowedAttributeList.filter(
|
|
5227
|
+
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute.
|
|
5105
5228
|
|
|
5106
5229
|
for (let i = 0, len = regExp.length; i < len; i++) {
|
|
5107
|
-
if (regExp[i].test(
|
|
5230
|
+
if (regExp[i].test(attributeName)) {
|
|
5108
5231
|
return true;
|
|
5109
5232
|
}
|
|
5110
5233
|
}
|
|
@@ -5156,23 +5279,22 @@
|
|
|
5156
5279
|
|
|
5157
5280
|
const domParser = new window.DOMParser();
|
|
5158
5281
|
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
|
|
5159
|
-
const allowlistKeys = Object.keys(allowList);
|
|
5160
5282
|
const elements = [].concat(...createdDocument.body.querySelectorAll('*'));
|
|
5161
5283
|
|
|
5162
5284
|
for (let i = 0, len = elements.length; i < len; i++) {
|
|
5163
|
-
const
|
|
5164
|
-
const
|
|
5285
|
+
const element = elements[i];
|
|
5286
|
+
const elementName = element.nodeName.toLowerCase();
|
|
5165
5287
|
|
|
5166
|
-
if (!
|
|
5167
|
-
|
|
5288
|
+
if (!Object.keys(allowList).includes(elementName)) {
|
|
5289
|
+
element.remove();
|
|
5168
5290
|
continue;
|
|
5169
5291
|
}
|
|
5170
5292
|
|
|
5171
|
-
const attributeList = [].concat(...
|
|
5172
|
-
const allowedAttributes = [].concat(allowList['*'] || [], allowList[
|
|
5173
|
-
attributeList.forEach(
|
|
5174
|
-
if (!allowedAttribute(
|
|
5175
|
-
|
|
5293
|
+
const attributeList = [].concat(...element.attributes);
|
|
5294
|
+
const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []);
|
|
5295
|
+
attributeList.forEach(attribute => {
|
|
5296
|
+
if (!allowedAttribute(attribute, allowedAttributes)) {
|
|
5297
|
+
element.removeAttribute(attribute.nodeName);
|
|
5176
5298
|
}
|
|
5177
5299
|
});
|
|
5178
5300
|
}
|
|
@@ -5182,7 +5304,7 @@
|
|
|
5182
5304
|
|
|
5183
5305
|
/**
|
|
5184
5306
|
* --------------------------------------------------------------------------
|
|
5185
|
-
* Bootstrap (v5.
|
|
5307
|
+
* Bootstrap (v5.1.3): tooltip.js
|
|
5186
5308
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5187
5309
|
* --------------------------------------------------------------------------
|
|
5188
5310
|
*/
|
|
@@ -5196,7 +5318,6 @@
|
|
|
5196
5318
|
const DATA_KEY$4 = 'bs.tooltip';
|
|
5197
5319
|
const EVENT_KEY$4 = `.${DATA_KEY$4}`;
|
|
5198
5320
|
const CLASS_PREFIX$1 = 'bs-tooltip';
|
|
5199
|
-
const BSCLS_PREFIX_REGEX$1 = new RegExp(`(^|\\s)${CLASS_PREFIX$1}\\S+`, 'g');
|
|
5200
5321
|
const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
|
|
5201
5322
|
const DefaultType$3 = {
|
|
5202
5323
|
animation: 'boolean',
|
|
@@ -5255,12 +5376,14 @@
|
|
|
5255
5376
|
MOUSEENTER: `mouseenter${EVENT_KEY$4}`,
|
|
5256
5377
|
MOUSELEAVE: `mouseleave${EVENT_KEY$4}`
|
|
5257
5378
|
};
|
|
5258
|
-
const CLASS_NAME_FADE$
|
|
5379
|
+
const CLASS_NAME_FADE$2 = 'fade';
|
|
5259
5380
|
const CLASS_NAME_MODAL = 'modal';
|
|
5260
|
-
const CLASS_NAME_SHOW$
|
|
5381
|
+
const CLASS_NAME_SHOW$2 = 'show';
|
|
5261
5382
|
const HOVER_STATE_SHOW = 'show';
|
|
5262
5383
|
const HOVER_STATE_OUT = 'out';
|
|
5263
5384
|
const SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
|
|
5385
|
+
const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`;
|
|
5386
|
+
const EVENT_MODAL_HIDE = 'hide.bs.modal';
|
|
5264
5387
|
const TRIGGER_HOVER = 'hover';
|
|
5265
5388
|
const TRIGGER_FOCUS = 'focus';
|
|
5266
5389
|
const TRIGGER_CLICK = 'click';
|
|
@@ -5337,7 +5460,7 @@
|
|
|
5337
5460
|
context._leave(null, context);
|
|
5338
5461
|
}
|
|
5339
5462
|
} else {
|
|
5340
|
-
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
5463
|
+
if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$2)) {
|
|
5341
5464
|
this._leave(null, this);
|
|
5342
5465
|
|
|
5343
5466
|
return;
|
|
@@ -5349,15 +5472,13 @@
|
|
|
5349
5472
|
|
|
5350
5473
|
dispose() {
|
|
5351
5474
|
clearTimeout(this._timeout);
|
|
5352
|
-
EventHandler.off(this._element.closest(
|
|
5475
|
+
EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
5353
5476
|
|
|
5354
|
-
if (this.tip
|
|
5355
|
-
this.tip.
|
|
5477
|
+
if (this.tip) {
|
|
5478
|
+
this.tip.remove();
|
|
5356
5479
|
}
|
|
5357
5480
|
|
|
5358
|
-
|
|
5359
|
-
this._popper.destroy();
|
|
5360
|
-
}
|
|
5481
|
+
this._disposePopper();
|
|
5361
5482
|
|
|
5362
5483
|
super.dispose();
|
|
5363
5484
|
}
|
|
@@ -5377,6 +5498,15 @@
|
|
|
5377
5498
|
|
|
5378
5499
|
if (showEvent.defaultPrevented || !isInTheDom) {
|
|
5379
5500
|
return;
|
|
5501
|
+
} // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`
|
|
5502
|
+
// This will be removed later in favor of a `setContent` method
|
|
5503
|
+
|
|
5504
|
+
|
|
5505
|
+
if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {
|
|
5506
|
+
this._disposePopper();
|
|
5507
|
+
|
|
5508
|
+
this.tip.remove();
|
|
5509
|
+
this.tip = null;
|
|
5380
5510
|
}
|
|
5381
5511
|
|
|
5382
5512
|
const tip = this.getTipElement();
|
|
@@ -5385,10 +5515,8 @@
|
|
|
5385
5515
|
|
|
5386
5516
|
this._element.setAttribute('aria-describedby', tipId);
|
|
5387
5517
|
|
|
5388
|
-
this.setContent();
|
|
5389
|
-
|
|
5390
5518
|
if (this._config.animation) {
|
|
5391
|
-
tip.classList.add(CLASS_NAME_FADE$
|
|
5519
|
+
tip.classList.add(CLASS_NAME_FADE$2);
|
|
5392
5520
|
}
|
|
5393
5521
|
|
|
5394
5522
|
const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement;
|
|
@@ -5403,7 +5531,7 @@
|
|
|
5403
5531
|
Data.set(tip, this.constructor.DATA_KEY, this);
|
|
5404
5532
|
|
|
5405
5533
|
if (!this._element.ownerDocument.documentElement.contains(this.tip)) {
|
|
5406
|
-
container.
|
|
5534
|
+
container.append(tip);
|
|
5407
5535
|
EventHandler.trigger(this._element, this.constructor.Event.INSERTED);
|
|
5408
5536
|
}
|
|
5409
5537
|
|
|
@@ -5413,8 +5541,9 @@
|
|
|
5413
5541
|
this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment));
|
|
5414
5542
|
}
|
|
5415
5543
|
|
|
5416
|
-
tip.classList.add(CLASS_NAME_SHOW$
|
|
5417
|
-
|
|
5544
|
+
tip.classList.add(CLASS_NAME_SHOW$2);
|
|
5545
|
+
|
|
5546
|
+
const customClass = this._resolvePossibleFunction(this._config.customClass);
|
|
5418
5547
|
|
|
5419
5548
|
if (customClass) {
|
|
5420
5549
|
tip.classList.add(...customClass.split(' '));
|
|
@@ -5440,7 +5569,7 @@
|
|
|
5440
5569
|
}
|
|
5441
5570
|
};
|
|
5442
5571
|
|
|
5443
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
5572
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
5444
5573
|
|
|
5445
5574
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5446
5575
|
}
|
|
@@ -5457,8 +5586,8 @@
|
|
|
5457
5586
|
return;
|
|
5458
5587
|
}
|
|
5459
5588
|
|
|
5460
|
-
if (this._hoverState !== HOVER_STATE_SHOW
|
|
5461
|
-
tip.
|
|
5589
|
+
if (this._hoverState !== HOVER_STATE_SHOW) {
|
|
5590
|
+
tip.remove();
|
|
5462
5591
|
}
|
|
5463
5592
|
|
|
5464
5593
|
this._cleanTipClass();
|
|
@@ -5467,11 +5596,7 @@
|
|
|
5467
5596
|
|
|
5468
5597
|
EventHandler.trigger(this._element, this.constructor.Event.HIDDEN);
|
|
5469
5598
|
|
|
5470
|
-
|
|
5471
|
-
this._popper.destroy();
|
|
5472
|
-
|
|
5473
|
-
this._popper = null;
|
|
5474
|
-
}
|
|
5599
|
+
this._disposePopper();
|
|
5475
5600
|
};
|
|
5476
5601
|
|
|
5477
5602
|
const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE);
|
|
@@ -5480,7 +5605,7 @@
|
|
|
5480
5605
|
return;
|
|
5481
5606
|
}
|
|
5482
5607
|
|
|
5483
|
-
tip.classList.remove(CLASS_NAME_SHOW$
|
|
5608
|
+
tip.classList.remove(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we remove the extra
|
|
5484
5609
|
// empty mouseover listeners we added for iOS support
|
|
5485
5610
|
|
|
5486
5611
|
if ('ontouchstart' in document.documentElement) {
|
|
@@ -5490,7 +5615,7 @@
|
|
|
5490
5615
|
this._activeTrigger[TRIGGER_CLICK] = false;
|
|
5491
5616
|
this._activeTrigger[TRIGGER_FOCUS] = false;
|
|
5492
5617
|
this._activeTrigger[TRIGGER_HOVER] = false;
|
|
5493
|
-
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$
|
|
5618
|
+
const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE$2);
|
|
5494
5619
|
|
|
5495
5620
|
this._queueCallback(complete, this.tip, isAnimated);
|
|
5496
5621
|
|
|
@@ -5515,14 +5640,27 @@
|
|
|
5515
5640
|
|
|
5516
5641
|
const element = document.createElement('div');
|
|
5517
5642
|
element.innerHTML = this._config.template;
|
|
5518
|
-
|
|
5643
|
+
const tip = element.children[0];
|
|
5644
|
+
this.setContent(tip);
|
|
5645
|
+
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
|
5646
|
+
this.tip = tip;
|
|
5519
5647
|
return this.tip;
|
|
5520
5648
|
}
|
|
5521
5649
|
|
|
5522
|
-
setContent() {
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5650
|
+
setContent(tip) {
|
|
5651
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER);
|
|
5652
|
+
}
|
|
5653
|
+
|
|
5654
|
+
_sanitizeAndSetContent(template, content, selector) {
|
|
5655
|
+
const templateElement = SelectorEngine.findOne(selector, template);
|
|
5656
|
+
|
|
5657
|
+
if (!content && templateElement) {
|
|
5658
|
+
templateElement.remove();
|
|
5659
|
+
return;
|
|
5660
|
+
} // we use append for html objects to maintain js events
|
|
5661
|
+
|
|
5662
|
+
|
|
5663
|
+
this.setElementContent(templateElement, content);
|
|
5526
5664
|
}
|
|
5527
5665
|
|
|
5528
5666
|
setElementContent(element, content) {
|
|
@@ -5536,7 +5674,7 @@
|
|
|
5536
5674
|
if (this._config.html) {
|
|
5537
5675
|
if (content.parentNode !== element) {
|
|
5538
5676
|
element.innerHTML = '';
|
|
5539
|
-
element.
|
|
5677
|
+
element.append(content);
|
|
5540
5678
|
}
|
|
5541
5679
|
} else {
|
|
5542
5680
|
element.textContent = content.textContent;
|
|
@@ -5557,13 +5695,9 @@
|
|
|
5557
5695
|
}
|
|
5558
5696
|
|
|
5559
5697
|
getTitle() {
|
|
5560
|
-
|
|
5698
|
+
const title = this._element.getAttribute('data-bs-original-title') || this._config.title;
|
|
5561
5699
|
|
|
5562
|
-
|
|
5563
|
-
title = typeof this._config.title === 'function' ? this._config.title.call(this._element) : this._config.title;
|
|
5564
|
-
}
|
|
5565
|
-
|
|
5566
|
-
return title;
|
|
5700
|
+
return this._resolvePossibleFunction(title);
|
|
5567
5701
|
}
|
|
5568
5702
|
|
|
5569
5703
|
updateAttachment(attachment) {
|
|
@@ -5580,15 +5714,7 @@
|
|
|
5580
5714
|
|
|
5581
5715
|
|
|
5582
5716
|
_initializeOnDelegatedTarget(event, context) {
|
|
5583
|
-
|
|
5584
|
-
context = context || Data.get(event.delegateTarget, dataKey);
|
|
5585
|
-
|
|
5586
|
-
if (!context) {
|
|
5587
|
-
context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
|
|
5588
|
-
Data.set(event.delegateTarget, dataKey, context);
|
|
5589
|
-
}
|
|
5590
|
-
|
|
5591
|
-
return context;
|
|
5717
|
+
return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
|
5592
5718
|
}
|
|
5593
5719
|
|
|
5594
5720
|
_getOffset() {
|
|
@@ -5607,6 +5733,10 @@
|
|
|
5607
5733
|
return offset;
|
|
5608
5734
|
}
|
|
5609
5735
|
|
|
5736
|
+
_resolvePossibleFunction(content) {
|
|
5737
|
+
return typeof content === 'function' ? content.call(this._element) : content;
|
|
5738
|
+
}
|
|
5739
|
+
|
|
5610
5740
|
_getPopperConfig(attachment) {
|
|
5611
5741
|
const defaultBsPopperConfig = {
|
|
5612
5742
|
placement: attachment,
|
|
@@ -5648,7 +5778,7 @@
|
|
|
5648
5778
|
}
|
|
5649
5779
|
|
|
5650
5780
|
_addAttachmentClass(attachment) {
|
|
5651
|
-
this.getTipElement().classList.add(`${
|
|
5781
|
+
this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`);
|
|
5652
5782
|
}
|
|
5653
5783
|
|
|
5654
5784
|
_getAttachment(placement) {
|
|
@@ -5675,7 +5805,7 @@
|
|
|
5675
5805
|
}
|
|
5676
5806
|
};
|
|
5677
5807
|
|
|
5678
|
-
EventHandler.on(this._element.closest(
|
|
5808
|
+
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
|
5679
5809
|
|
|
5680
5810
|
if (this._config.selector) {
|
|
5681
5811
|
this._config = { ...this._config,
|
|
@@ -5710,7 +5840,7 @@
|
|
|
5710
5840
|
context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
|
|
5711
5841
|
}
|
|
5712
5842
|
|
|
5713
|
-
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$
|
|
5843
|
+
if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || context._hoverState === HOVER_STATE_SHOW) {
|
|
5714
5844
|
context._hoverState = HOVER_STATE_SHOW;
|
|
5715
5845
|
return;
|
|
5716
5846
|
}
|
|
@@ -5806,26 +5936,32 @@
|
|
|
5806
5936
|
_getDelegateConfig() {
|
|
5807
5937
|
const config = {};
|
|
5808
5938
|
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
config[key] = this._config[key];
|
|
5813
|
-
}
|
|
5939
|
+
for (const key in this._config) {
|
|
5940
|
+
if (this.constructor.Default[key] !== this._config[key]) {
|
|
5941
|
+
config[key] = this._config[key];
|
|
5814
5942
|
}
|
|
5815
|
-
}
|
|
5943
|
+
} // In the future can be replaced with:
|
|
5944
|
+
// const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])
|
|
5945
|
+
// `Object.fromEntries(keysWithDifferentValues)`
|
|
5946
|
+
|
|
5816
5947
|
|
|
5817
5948
|
return config;
|
|
5818
5949
|
}
|
|
5819
5950
|
|
|
5820
5951
|
_cleanTipClass() {
|
|
5821
5952
|
const tip = this.getTipElement();
|
|
5822
|
-
const
|
|
5953
|
+
const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g');
|
|
5954
|
+
const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex);
|
|
5823
5955
|
|
|
5824
5956
|
if (tabClass !== null && tabClass.length > 0) {
|
|
5825
5957
|
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
5826
5958
|
}
|
|
5827
5959
|
}
|
|
5828
5960
|
|
|
5961
|
+
_getBasicClassPrefix() {
|
|
5962
|
+
return CLASS_PREFIX$1;
|
|
5963
|
+
}
|
|
5964
|
+
|
|
5829
5965
|
_handlePopperPlacementChange(popperData) {
|
|
5830
5966
|
const {
|
|
5831
5967
|
state
|
|
@@ -5840,22 +5976,20 @@
|
|
|
5840
5976
|
this._cleanTipClass();
|
|
5841
5977
|
|
|
5842
5978
|
this._addAttachmentClass(this._getAttachment(state.placement));
|
|
5979
|
+
}
|
|
5980
|
+
|
|
5981
|
+
_disposePopper() {
|
|
5982
|
+
if (this._popper) {
|
|
5983
|
+
this._popper.destroy();
|
|
5984
|
+
|
|
5985
|
+
this._popper = null;
|
|
5986
|
+
}
|
|
5843
5987
|
} // Static
|
|
5844
5988
|
|
|
5845
5989
|
|
|
5846
5990
|
static jQueryInterface(config) {
|
|
5847
5991
|
return this.each(function () {
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
const _config = typeof config === 'object' && config;
|
|
5851
|
-
|
|
5852
|
-
if (!data && /dispose|hide/.test(config)) {
|
|
5853
|
-
return;
|
|
5854
|
-
}
|
|
5855
|
-
|
|
5856
|
-
if (!data) {
|
|
5857
|
-
data = new Tooltip(this, _config);
|
|
5858
|
-
}
|
|
5992
|
+
const data = Tooltip.getOrCreateInstance(this, config);
|
|
5859
5993
|
|
|
5860
5994
|
if (typeof config === 'string') {
|
|
5861
5995
|
if (typeof data[config] === 'undefined') {
|
|
@@ -5880,7 +6014,7 @@
|
|
|
5880
6014
|
|
|
5881
6015
|
/**
|
|
5882
6016
|
* --------------------------------------------------------------------------
|
|
5883
|
-
* Bootstrap (v5.
|
|
6017
|
+
* Bootstrap (v5.1.3): popover.js
|
|
5884
6018
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5885
6019
|
* --------------------------------------------------------------------------
|
|
5886
6020
|
*/
|
|
@@ -5894,7 +6028,6 @@
|
|
|
5894
6028
|
const DATA_KEY$3 = 'bs.popover';
|
|
5895
6029
|
const EVENT_KEY$3 = `.${DATA_KEY$3}`;
|
|
5896
6030
|
const CLASS_PREFIX = 'bs-popover';
|
|
5897
|
-
const BSCLS_PREFIX_REGEX = new RegExp(`(^|\\s)${CLASS_PREFIX}\\S+`, 'g');
|
|
5898
6031
|
const Default$2 = { ...Tooltip.Default,
|
|
5899
6032
|
placement: 'right',
|
|
5900
6033
|
offset: [0, 8],
|
|
@@ -5917,8 +6050,6 @@
|
|
|
5917
6050
|
MOUSEENTER: `mouseenter${EVENT_KEY$3}`,
|
|
5918
6051
|
MOUSELEAVE: `mouseleave${EVENT_KEY$3}`
|
|
5919
6052
|
};
|
|
5920
|
-
const CLASS_NAME_FADE$2 = 'fade';
|
|
5921
|
-
const CLASS_NAME_SHOW$2 = 'show';
|
|
5922
6053
|
const SELECTOR_TITLE = '.popover-header';
|
|
5923
6054
|
const SELECTOR_CONTENT = '.popover-body';
|
|
5924
6055
|
/**
|
|
@@ -5950,54 +6081,25 @@
|
|
|
5950
6081
|
return this.getTitle() || this._getContent();
|
|
5951
6082
|
}
|
|
5952
6083
|
|
|
5953
|
-
setContent() {
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
|
|
5957
|
-
|
|
5958
|
-
let content = this._getContent();
|
|
6084
|
+
setContent(tip) {
|
|
6085
|
+
this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE);
|
|
5959
6086
|
|
|
5960
|
-
|
|
5961
|
-
content = content.call(this._element);
|
|
5962
|
-
}
|
|
5963
|
-
|
|
5964
|
-
this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
|
|
5965
|
-
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2);
|
|
6087
|
+
this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT);
|
|
5966
6088
|
} // Private
|
|
5967
6089
|
|
|
5968
6090
|
|
|
5969
|
-
_addAttachmentClass(attachment) {
|
|
5970
|
-
this.getTipElement().classList.add(`${CLASS_PREFIX}-${this.updateAttachment(attachment)}`);
|
|
5971
|
-
}
|
|
5972
|
-
|
|
5973
6091
|
_getContent() {
|
|
5974
|
-
return this.
|
|
6092
|
+
return this._resolvePossibleFunction(this._config.content);
|
|
5975
6093
|
}
|
|
5976
6094
|
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
|
|
5980
|
-
|
|
5981
|
-
if (tabClass !== null && tabClass.length > 0) {
|
|
5982
|
-
tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass));
|
|
5983
|
-
}
|
|
6095
|
+
_getBasicClassPrefix() {
|
|
6096
|
+
return CLASS_PREFIX;
|
|
5984
6097
|
} // Static
|
|
5985
6098
|
|
|
5986
6099
|
|
|
5987
6100
|
static jQueryInterface(config) {
|
|
5988
6101
|
return this.each(function () {
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
const _config = typeof config === 'object' ? config : null;
|
|
5992
|
-
|
|
5993
|
-
if (!data && /dispose|hide/.test(config)) {
|
|
5994
|
-
return;
|
|
5995
|
-
}
|
|
5996
|
-
|
|
5997
|
-
if (!data) {
|
|
5998
|
-
data = new Popover(this, _config);
|
|
5999
|
-
Data.set(this, DATA_KEY$3, data);
|
|
6000
|
-
}
|
|
6102
|
+
const data = Popover.getOrCreateInstance(this, config);
|
|
6001
6103
|
|
|
6002
6104
|
if (typeof config === 'string') {
|
|
6003
6105
|
if (typeof data[config] === 'undefined') {
|
|
@@ -6022,7 +6124,7 @@
|
|
|
6022
6124
|
|
|
6023
6125
|
/**
|
|
6024
6126
|
* --------------------------------------------------------------------------
|
|
6025
|
-
* Bootstrap (v5.
|
|
6127
|
+
* Bootstrap (v5.1.3): scrollspy.js
|
|
6026
6128
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
6027
6129
|
* --------------------------------------------------------------------------
|
|
6028
6130
|
*/
|
|
@@ -6056,6 +6158,7 @@
|
|
|
6056
6158
|
const SELECTOR_NAV_LINKS = '.nav-link';
|
|
6057
6159
|
const SELECTOR_NAV_ITEMS = '.nav-item';
|
|
6058
6160
|
const SELECTOR_LIST_ITEMS = '.list-group-item';
|
|
6161
|
+
const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`;
|
|
6059
6162
|
const SELECTOR_DROPDOWN$1 = '.dropdown';
|
|
6060
6163
|
const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
|
|
6061
6164
|
const METHOD_OFFSET = 'offset';
|
|
@@ -6071,7 +6174,6 @@
|
|
|
6071
6174
|
super(element);
|
|
6072
6175
|
this._scrollElement = this._element.tagName === 'BODY' ? window : this._element;
|
|
6073
6176
|
this._config = this._getConfig(config);
|
|
6074
|
-
this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`;
|
|
6075
6177
|
this._offsets = [];
|
|
6076
6178
|
this._targets = [];
|
|
6077
6179
|
this._activeTarget = null;
|
|
@@ -6099,7 +6201,7 @@
|
|
|
6099
6201
|
this._offsets = [];
|
|
6100
6202
|
this._targets = [];
|
|
6101
6203
|
this._scrollHeight = this._getScrollHeight();
|
|
6102
|
-
const targets = SelectorEngine.find(this.
|
|
6204
|
+
const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target);
|
|
6103
6205
|
targets.map(element => {
|
|
6104
6206
|
const targetSelector = getSelectorFromElement(element);
|
|
6105
6207
|
const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null;
|
|
@@ -6131,20 +6233,7 @@
|
|
|
6131
6233
|
...Manipulator.getDataAttributes(this._element),
|
|
6132
6234
|
...(typeof config === 'object' && config ? config : {})
|
|
6133
6235
|
};
|
|
6134
|
-
|
|
6135
|
-
if (typeof config.target !== 'string' && isElement$1(config.target)) {
|
|
6136
|
-
let {
|
|
6137
|
-
id
|
|
6138
|
-
} = config.target;
|
|
6139
|
-
|
|
6140
|
-
if (!id) {
|
|
6141
|
-
id = getUID(NAME$2);
|
|
6142
|
-
config.target.id = id;
|
|
6143
|
-
}
|
|
6144
|
-
|
|
6145
|
-
config.target = `#${id}`;
|
|
6146
|
-
}
|
|
6147
|
-
|
|
6236
|
+
config.target = getElement(config.target) || document.documentElement;
|
|
6148
6237
|
typeCheckConfig(NAME$2, config, DefaultType$1);
|
|
6149
6238
|
return config;
|
|
6150
6239
|
}
|
|
@@ -6204,16 +6293,13 @@
|
|
|
6204
6293
|
|
|
6205
6294
|
this._clear();
|
|
6206
6295
|
|
|
6207
|
-
const queries =
|
|
6208
|
-
|
|
6209
|
-
|
|
6296
|
+
const queries = SELECTOR_LINK_ITEMS.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`);
|
|
6297
|
+
const link = SelectorEngine.findOne(queries.join(','), this._config.target);
|
|
6298
|
+
link.classList.add(CLASS_NAME_ACTIVE$1);
|
|
6210
6299
|
|
|
6211
6300
|
if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
|
|
6212
6301
|
SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1);
|
|
6213
|
-
link.classList.add(CLASS_NAME_ACTIVE$1);
|
|
6214
6302
|
} else {
|
|
6215
|
-
// Set triggered link as active
|
|
6216
|
-
link.classList.add(CLASS_NAME_ACTIVE$1);
|
|
6217
6303
|
SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => {
|
|
6218
6304
|
// Set triggered links parents as active
|
|
6219
6305
|
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
|
@@ -6231,13 +6317,13 @@
|
|
|
6231
6317
|
}
|
|
6232
6318
|
|
|
6233
6319
|
_clear() {
|
|
6234
|
-
SelectorEngine.find(this.
|
|
6320
|
+
SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target).filter(node => node.classList.contains(CLASS_NAME_ACTIVE$1)).forEach(node => node.classList.remove(CLASS_NAME_ACTIVE$1));
|
|
6235
6321
|
} // Static
|
|
6236
6322
|
|
|
6237
6323
|
|
|
6238
6324
|
static jQueryInterface(config) {
|
|
6239
6325
|
return this.each(function () {
|
|
6240
|
-
const data = ScrollSpy.
|
|
6326
|
+
const data = ScrollSpy.getOrCreateInstance(this, config);
|
|
6241
6327
|
|
|
6242
6328
|
if (typeof config !== 'string') {
|
|
6243
6329
|
return;
|
|
@@ -6273,7 +6359,7 @@
|
|
|
6273
6359
|
|
|
6274
6360
|
/**
|
|
6275
6361
|
* --------------------------------------------------------------------------
|
|
6276
|
-
* Bootstrap (v5.
|
|
6362
|
+
* Bootstrap (v5.1.3): tab.js
|
|
6277
6363
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
6278
6364
|
* --------------------------------------------------------------------------
|
|
6279
6365
|
*/
|
|
@@ -6428,7 +6514,7 @@
|
|
|
6428
6514
|
|
|
6429
6515
|
static jQueryInterface(config) {
|
|
6430
6516
|
return this.each(function () {
|
|
6431
|
-
const data =
|
|
6517
|
+
const data = Tab.getOrCreateInstance(this);
|
|
6432
6518
|
|
|
6433
6519
|
if (typeof config === 'string') {
|
|
6434
6520
|
if (typeof data[config] === 'undefined') {
|
|
@@ -6457,7 +6543,7 @@
|
|
|
6457
6543
|
return;
|
|
6458
6544
|
}
|
|
6459
6545
|
|
|
6460
|
-
const data =
|
|
6546
|
+
const data = Tab.getOrCreateInstance(this);
|
|
6461
6547
|
data.show();
|
|
6462
6548
|
});
|
|
6463
6549
|
/**
|
|
@@ -6471,7 +6557,7 @@
|
|
|
6471
6557
|
|
|
6472
6558
|
/**
|
|
6473
6559
|
* --------------------------------------------------------------------------
|
|
6474
|
-
* Bootstrap (v5.
|
|
6560
|
+
* Bootstrap (v5.1.3): toast.js
|
|
6475
6561
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
6476
6562
|
* --------------------------------------------------------------------------
|
|
6477
6563
|
*/
|
|
@@ -6484,7 +6570,6 @@
|
|
|
6484
6570
|
const NAME = 'toast';
|
|
6485
6571
|
const DATA_KEY = 'bs.toast';
|
|
6486
6572
|
const EVENT_KEY = `.${DATA_KEY}`;
|
|
6487
|
-
const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`;
|
|
6488
6573
|
const EVENT_MOUSEOVER = `mouseover${EVENT_KEY}`;
|
|
6489
6574
|
const EVENT_MOUSEOUT = `mouseout${EVENT_KEY}`;
|
|
6490
6575
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY}`;
|
|
@@ -6494,7 +6579,8 @@
|
|
|
6494
6579
|
const EVENT_SHOW = `show${EVENT_KEY}`;
|
|
6495
6580
|
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
|
6496
6581
|
const CLASS_NAME_FADE = 'fade';
|
|
6497
|
-
const CLASS_NAME_HIDE = 'hide';
|
|
6582
|
+
const CLASS_NAME_HIDE = 'hide'; // @deprecated - kept here only for backwards compatibility
|
|
6583
|
+
|
|
6498
6584
|
const CLASS_NAME_SHOW = 'show';
|
|
6499
6585
|
const CLASS_NAME_SHOWING = 'showing';
|
|
6500
6586
|
const DefaultType = {
|
|
@@ -6507,7 +6593,6 @@
|
|
|
6507
6593
|
autohide: true,
|
|
6508
6594
|
delay: 5000
|
|
6509
6595
|
};
|
|
6510
|
-
const SELECTOR_DATA_DISMISS = '[data-bs-dismiss="toast"]';
|
|
6511
6596
|
/**
|
|
6512
6597
|
* ------------------------------------------------------------------------
|
|
6513
6598
|
* Class Definition
|
|
@@ -6555,17 +6640,18 @@
|
|
|
6555
6640
|
const complete = () => {
|
|
6556
6641
|
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
6557
6642
|
|
|
6558
|
-
this._element.classList.add(CLASS_NAME_SHOW);
|
|
6559
|
-
|
|
6560
6643
|
EventHandler.trigger(this._element, EVENT_SHOWN);
|
|
6561
6644
|
|
|
6562
6645
|
this._maybeScheduleHide();
|
|
6563
6646
|
};
|
|
6564
6647
|
|
|
6565
|
-
this._element.classList.remove(CLASS_NAME_HIDE);
|
|
6648
|
+
this._element.classList.remove(CLASS_NAME_HIDE); // @deprecated
|
|
6649
|
+
|
|
6566
6650
|
|
|
6567
6651
|
reflow(this._element);
|
|
6568
6652
|
|
|
6653
|
+
this._element.classList.add(CLASS_NAME_SHOW);
|
|
6654
|
+
|
|
6569
6655
|
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
6570
6656
|
|
|
6571
6657
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
@@ -6583,12 +6669,17 @@
|
|
|
6583
6669
|
}
|
|
6584
6670
|
|
|
6585
6671
|
const complete = () => {
|
|
6586
|
-
this._element.classList.add(CLASS_NAME_HIDE);
|
|
6672
|
+
this._element.classList.add(CLASS_NAME_HIDE); // @deprecated
|
|
6673
|
+
|
|
6674
|
+
|
|
6675
|
+
this._element.classList.remove(CLASS_NAME_SHOWING);
|
|
6676
|
+
|
|
6677
|
+
this._element.classList.remove(CLASS_NAME_SHOW);
|
|
6587
6678
|
|
|
6588
6679
|
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
|
6589
6680
|
};
|
|
6590
6681
|
|
|
6591
|
-
this._element.classList.
|
|
6682
|
+
this._element.classList.add(CLASS_NAME_SHOWING);
|
|
6592
6683
|
|
|
6593
6684
|
this._queueCallback(complete, this._element, this._config.animation);
|
|
6594
6685
|
}
|
|
@@ -6656,7 +6747,6 @@
|
|
|
6656
6747
|
}
|
|
6657
6748
|
|
|
6658
6749
|
_setListeners() {
|
|
6659
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide());
|
|
6660
6750
|
EventHandler.on(this._element, EVENT_MOUSEOVER, event => this._onInteraction(event, true));
|
|
6661
6751
|
EventHandler.on(this._element, EVENT_MOUSEOUT, event => this._onInteraction(event, false));
|
|
6662
6752
|
EventHandler.on(this._element, EVENT_FOCUSIN, event => this._onInteraction(event, true));
|
|
@@ -6671,13 +6761,7 @@
|
|
|
6671
6761
|
|
|
6672
6762
|
static jQueryInterface(config) {
|
|
6673
6763
|
return this.each(function () {
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
const _config = typeof config === 'object' && config;
|
|
6677
|
-
|
|
6678
|
-
if (!data) {
|
|
6679
|
-
data = new Toast(this, _config);
|
|
6680
|
-
}
|
|
6764
|
+
const data = Toast.getOrCreateInstance(this, config);
|
|
6681
6765
|
|
|
6682
6766
|
if (typeof config === 'string') {
|
|
6683
6767
|
if (typeof data[config] === 'undefined') {
|
|
@@ -6690,6 +6774,8 @@
|
|
|
6690
6774
|
}
|
|
6691
6775
|
|
|
6692
6776
|
}
|
|
6777
|
+
|
|
6778
|
+
enableDismissTrigger(Toast);
|
|
6693
6779
|
/**
|
|
6694
6780
|
* ------------------------------------------------------------------------
|
|
6695
6781
|
* jQuery
|
|
@@ -6697,16 +6783,15 @@
|
|
|
6697
6783
|
* add .Toast to jQuery only if jQuery is present
|
|
6698
6784
|
*/
|
|
6699
6785
|
|
|
6700
|
-
|
|
6701
6786
|
defineJQueryPlugin(Toast);
|
|
6702
6787
|
|
|
6703
6788
|
/**
|
|
6704
6789
|
* --------------------------------------------------------------------------
|
|
6705
|
-
* Bootstrap (v5.
|
|
6790
|
+
* Bootstrap (v5.1.3): index.umd.js
|
|
6706
6791
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
6707
6792
|
* --------------------------------------------------------------------------
|
|
6708
6793
|
*/
|
|
6709
|
-
|
|
6794
|
+
const index_umd = {
|
|
6710
6795
|
Alert,
|
|
6711
6796
|
Button,
|
|
6712
6797
|
Carousel,
|
|
@@ -6723,5 +6808,5 @@
|
|
|
6723
6808
|
|
|
6724
6809
|
return index_umd;
|
|
6725
6810
|
|
|
6726
|
-
}))
|
|
6811
|
+
}));
|
|
6727
6812
|
//# sourceMappingURL=bootstrap.bundle.js.map
|