bootstrap 5.0.0.beta3 → 5.0.0
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 +2 -2
- data/assets/javascripts/bootstrap-sprockets.js +1 -1
- data/assets/javascripts/bootstrap.js +509 -459
- data/assets/javascripts/bootstrap.min.js +2 -2
- data/assets/javascripts/bootstrap/alert.js +4 -4
- data/assets/javascripts/bootstrap/base-component.js +9 -7
- data/assets/javascripts/bootstrap/button.js +3 -3
- data/assets/javascripts/bootstrap/carousel.js +11 -12
- data/assets/javascripts/bootstrap/collapse.js +5 -5
- data/assets/javascripts/bootstrap/dom/data.js +2 -2
- data/assets/javascripts/bootstrap/dom/event-handler.js +32 -14
- data/assets/javascripts/bootstrap/dom/manipulator.js +2 -2
- data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
- data/assets/javascripts/bootstrap/dropdown.js +109 -94
- data/assets/javascripts/bootstrap/modal.js +262 -177
- data/assets/javascripts/bootstrap/offcanvas.js +219 -56
- data/assets/javascripts/bootstrap/popover.js +3 -3
- data/assets/javascripts/bootstrap/scrollspy.js +18 -22
- data/assets/javascripts/bootstrap/tab.js +21 -8
- data/assets/javascripts/bootstrap/toast.js +4 -5
- data/assets/javascripts/bootstrap/tooltip.js +7 -9
- data/assets/stylesheets/_bootstrap-grid.scss +1 -1
- data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
- data/assets/stylesheets/_bootstrap.scss +1 -1
- data/assets/stylesheets/bootstrap/_accordion.scss +4 -2
- data/assets/stylesheets/bootstrap/_dropdown.scss +7 -13
- data/assets/stylesheets/bootstrap/_list-group.scss +1 -1
- data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
- data/assets/stylesheets/bootstrap/_modal.scss +0 -9
- data/assets/stylesheets/bootstrap/_offcanvas.scss +11 -11
- data/assets/stylesheets/bootstrap/_spinners.scss +2 -2
- data/assets/stylesheets/bootstrap/_variables.scss +7 -7
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +5 -5
- data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +7 -4
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +8 -3
- data/bootstrap.gemspec +1 -1
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab3cae7213a21110421a1bff463a4f8bccfdc085ce03953a9add6330fcc52f6f
|
4
|
+
data.tar.gz: f5e9f214138024c8adafcc459b934119657f9a0989b83c43dacf783ddd01a8a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a54dd7911c5a617cce35d57e7e8543859cd891e82fa919a85e74a7242337c6258175c7cacf09957b016d24a77957d85731a9373e948a9cfd1e85311513b05184
|
7
|
+
data.tar.gz: 63aac9f119c570a9826c14f6e1fefdf1c472bdd3befeac525c1d86c75a01e73e36c85bb238916ba09968b12541472c6f8727f3ca701366c7a72c161a32ff8c18
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Please see the appropriate guide for your environment of choice:
|
|
20
20
|
Add `bootstrap` to your Gemfile:
|
21
21
|
|
22
22
|
```ruby
|
23
|
-
gem 'bootstrap', '~> 5.0.0
|
23
|
+
gem 'bootstrap', '~> 5.0.0'
|
24
24
|
```
|
25
25
|
|
26
26
|
Ensure that `sprockets-rails` is at least v2.3.2.
|
@@ -48,7 +48,7 @@ Then, remove all the `*= require` and `*= require_tree` statements from the Sass
|
|
48
48
|
Do not use `*= require` in Sass or your other stylesheets will not be able to access the Bootstrap mixins and variables.
|
49
49
|
|
50
50
|
Bootstrap JavaScript can optionally use jQuery.
|
51
|
-
If you're using Rails 5.1+, you can add
|
51
|
+
If you're using Rails 5.1+, you can add the `jquery-rails` gem to your Gemfile:
|
52
52
|
|
53
53
|
```ruby
|
54
54
|
gem 'jquery-rails'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
//= require ./bootstrap-global-this-define
|
2
2
|
//= require ./bootstrap/dom/data
|
3
|
-
//= require ./bootstrap/base-component
|
4
3
|
//= require ./bootstrap/dom/event-handler
|
4
|
+
//= require ./bootstrap/base-component
|
5
5
|
//= require ./bootstrap/alert
|
6
6
|
//= require ./bootstrap/button
|
7
7
|
//= require ./bootstrap/dom/manipulator
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Bootstrap v5.0.0
|
2
|
+
* Bootstrap v5.0.0 (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
|
*/
|
@@ -33,7 +33,7 @@
|
|
33
33
|
|
34
34
|
/**
|
35
35
|
* --------------------------------------------------------------------------
|
36
|
-
* Bootstrap (v5.0.0
|
36
|
+
* Bootstrap (v5.0.0): util/index.js
|
37
37
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
38
38
|
* --------------------------------------------------------------------------
|
39
39
|
*/
|
@@ -78,7 +78,7 @@
|
|
78
78
|
|
79
79
|
|
80
80
|
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
81
|
-
hrefAttr =
|
81
|
+
hrefAttr = `#${hrefAttr.split('#')[1]}`;
|
82
82
|
}
|
83
83
|
|
84
84
|
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
|
@@ -156,7 +156,7 @@
|
|
156
156
|
const valueType = value && isElement(value) ? 'element' : toType(value);
|
157
157
|
|
158
158
|
if (!new RegExp(expectedTypes).test(valueType)) {
|
159
|
-
throw new TypeError(`${componentName.toUpperCase()}:
|
159
|
+
throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);
|
160
160
|
}
|
161
161
|
});
|
162
162
|
};
|
@@ -214,7 +214,7 @@
|
|
214
214
|
return findShadowRoot(element.parentNode);
|
215
215
|
};
|
216
216
|
|
217
|
-
const noop = () =>
|
217
|
+
const noop = () => {};
|
218
218
|
|
219
219
|
const reflow = element => element.offsetHeight;
|
220
220
|
|
@@ -258,9 +258,15 @@
|
|
258
258
|
});
|
259
259
|
};
|
260
260
|
|
261
|
+
const execute = callback => {
|
262
|
+
if (typeof callback === 'function') {
|
263
|
+
callback();
|
264
|
+
}
|
265
|
+
};
|
266
|
+
|
261
267
|
/**
|
262
268
|
* --------------------------------------------------------------------------
|
263
|
-
* Bootstrap (v5.0.0
|
269
|
+
* Bootstrap (v5.0.0): dom/data.js
|
264
270
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
265
271
|
* --------------------------------------------------------------------------
|
266
272
|
*/
|
@@ -314,7 +320,7 @@
|
|
314
320
|
|
315
321
|
/**
|
316
322
|
* --------------------------------------------------------------------------
|
317
|
-
* Bootstrap (v5.0.0
|
323
|
+
* Bootstrap (v5.0.0): dom/event-handler.js
|
318
324
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
319
325
|
* --------------------------------------------------------------------------
|
320
326
|
*/
|
@@ -334,6 +340,7 @@
|
|
334
340
|
mouseenter: 'mouseover',
|
335
341
|
mouseleave: 'mouseout'
|
336
342
|
};
|
343
|
+
const customEventsRegex = /^(mouseenter|mouseleave)/i;
|
337
344
|
const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']);
|
338
345
|
/**
|
339
346
|
* ------------------------------------------------------------------------
|
@@ -377,7 +384,7 @@
|
|
377
384
|
|
378
385
|
if (handler.oneOff) {
|
379
386
|
// eslint-disable-next-line unicorn/consistent-destructuring
|
380
|
-
EventHandler.off(element, event.type, fn);
|
387
|
+
EventHandler.off(element, event.type, selector, fn);
|
381
388
|
}
|
382
389
|
|
383
390
|
return fn.apply(target, [event]);
|
@@ -406,15 +413,8 @@
|
|
406
413
|
|
407
414
|
function normalizeParams(originalTypeEvent, handler, delegationFn) {
|
408
415
|
const delegation = typeof handler === 'string';
|
409
|
-
const originalHandler = delegation ? delegationFn : handler;
|
410
|
-
|
411
|
-
let typeEvent = originalTypeEvent.replace(stripNameRegex, '');
|
412
|
-
const custom = customEvents[typeEvent];
|
413
|
-
|
414
|
-
if (custom) {
|
415
|
-
typeEvent = custom;
|
416
|
-
}
|
417
|
-
|
416
|
+
const originalHandler = delegation ? delegationFn : handler;
|
417
|
+
let typeEvent = getTypeEvent(originalTypeEvent);
|
418
418
|
const isNative = nativeEvents.has(typeEvent);
|
419
419
|
|
420
420
|
if (!isNative) {
|
@@ -432,6 +432,24 @@
|
|
432
432
|
if (!handler) {
|
433
433
|
handler = delegationFn;
|
434
434
|
delegationFn = null;
|
435
|
+
} // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
|
436
|
+
// this prevents the handler from being dispatched the same way as mouseover or mouseout does
|
437
|
+
|
438
|
+
|
439
|
+
if (customEventsRegex.test(originalTypeEvent)) {
|
440
|
+
const wrapFn = fn => {
|
441
|
+
return function (event) {
|
442
|
+
if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) {
|
443
|
+
return fn.call(this, event);
|
444
|
+
}
|
445
|
+
};
|
446
|
+
};
|
447
|
+
|
448
|
+
if (delegationFn) {
|
449
|
+
delegationFn = wrapFn(delegationFn);
|
450
|
+
} else {
|
451
|
+
handler = wrapFn(handler);
|
452
|
+
}
|
435
453
|
}
|
436
454
|
|
437
455
|
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
|
@@ -475,6 +493,12 @@
|
|
475
493
|
});
|
476
494
|
}
|
477
495
|
|
496
|
+
function getTypeEvent(event) {
|
497
|
+
// allow to get the native events from namespaced events ('click.bs.button' --> 'click')
|
498
|
+
event = event.replace(stripNameRegex, '');
|
499
|
+
return customEvents[event] || event;
|
500
|
+
}
|
501
|
+
|
478
502
|
const EventHandler = {
|
479
503
|
on(element, event, handler, delegationFn) {
|
480
504
|
addHandler(element, event, handler, delegationFn, false);
|
@@ -527,7 +551,7 @@
|
|
527
551
|
}
|
528
552
|
|
529
553
|
const $ = getjQuery();
|
530
|
-
const typeEvent = event
|
554
|
+
const typeEvent = getTypeEvent(event);
|
531
555
|
const inNamespace = event !== typeEvent;
|
532
556
|
const isNative = nativeEvents.has(typeEvent);
|
533
557
|
let jQueryEvent;
|
@@ -585,7 +609,7 @@
|
|
585
609
|
|
586
610
|
/**
|
587
611
|
* --------------------------------------------------------------------------
|
588
|
-
* Bootstrap (v5.0.0
|
612
|
+
* Bootstrap (v5.0.0): base-component.js
|
589
613
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
590
614
|
* --------------------------------------------------------------------------
|
591
615
|
*/
|
@@ -595,7 +619,7 @@
|
|
595
619
|
* ------------------------------------------------------------------------
|
596
620
|
*/
|
597
621
|
|
598
|
-
const VERSION = '5.0.0
|
622
|
+
const VERSION = '5.0.0';
|
599
623
|
|
600
624
|
class BaseComponent {
|
601
625
|
constructor(element) {
|
@@ -611,6 +635,7 @@
|
|
611
635
|
|
612
636
|
dispose() {
|
613
637
|
Data.remove(this._element, this.constructor.DATA_KEY);
|
638
|
+
EventHandler.off(this._element, `.${this.constructor.DATA_KEY}`);
|
614
639
|
this._element = null;
|
615
640
|
}
|
616
641
|
/** Static */
|
@@ -628,7 +653,7 @@
|
|
628
653
|
|
629
654
|
/**
|
630
655
|
* --------------------------------------------------------------------------
|
631
|
-
* Bootstrap (v5.0.0
|
656
|
+
* Bootstrap (v5.0.0): alert.js
|
632
657
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
633
658
|
* --------------------------------------------------------------------------
|
634
659
|
*/
|
@@ -638,7 +663,7 @@
|
|
638
663
|
* ------------------------------------------------------------------------
|
639
664
|
*/
|
640
665
|
|
641
|
-
const NAME$
|
666
|
+
const NAME$c = 'alert';
|
642
667
|
const DATA_KEY$b = 'bs.alert';
|
643
668
|
const EVENT_KEY$b = `.${DATA_KEY$b}`;
|
644
669
|
const DATA_API_KEY$8 = '.data-api';
|
@@ -647,8 +672,8 @@
|
|
647
672
|
const EVENT_CLOSED = `closed${EVENT_KEY$b}`;
|
648
673
|
const EVENT_CLICK_DATA_API$7 = `click${EVENT_KEY$b}${DATA_API_KEY$8}`;
|
649
674
|
const CLASS_NAME_ALERT = 'alert';
|
650
|
-
const CLASS_NAME_FADE$
|
651
|
-
const CLASS_NAME_SHOW$
|
675
|
+
const CLASS_NAME_FADE$6 = 'fade';
|
676
|
+
const CLASS_NAME_SHOW$9 = 'show';
|
652
677
|
/**
|
653
678
|
* ------------------------------------------------------------------------
|
654
679
|
* Class Definition
|
@@ -684,9 +709,9 @@
|
|
684
709
|
}
|
685
710
|
|
686
711
|
_removeElement(element) {
|
687
|
-
element.classList.remove(CLASS_NAME_SHOW$
|
712
|
+
element.classList.remove(CLASS_NAME_SHOW$9);
|
688
713
|
|
689
|
-
if (!element.classList.contains(CLASS_NAME_FADE$
|
714
|
+
if (!element.classList.contains(CLASS_NAME_FADE$6)) {
|
690
715
|
this._destroyElement(element);
|
691
716
|
|
692
717
|
return;
|
@@ -746,11 +771,11 @@
|
|
746
771
|
* add .Alert to jQuery only if jQuery is present
|
747
772
|
*/
|
748
773
|
|
749
|
-
defineJQueryPlugin(NAME$
|
774
|
+
defineJQueryPlugin(NAME$c, Alert);
|
750
775
|
|
751
776
|
/**
|
752
777
|
* --------------------------------------------------------------------------
|
753
|
-
* Bootstrap (v5.0.0
|
778
|
+
* Bootstrap (v5.0.0): button.js
|
754
779
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
755
780
|
* --------------------------------------------------------------------------
|
756
781
|
*/
|
@@ -760,7 +785,7 @@
|
|
760
785
|
* ------------------------------------------------------------------------
|
761
786
|
*/
|
762
787
|
|
763
|
-
const NAME$
|
788
|
+
const NAME$b = 'button';
|
764
789
|
const DATA_KEY$a = 'bs.button';
|
765
790
|
const EVENT_KEY$a = `.${DATA_KEY$a}`;
|
766
791
|
const DATA_API_KEY$7 = '.data-api';
|
@@ -826,11 +851,11 @@
|
|
826
851
|
* add .Button to jQuery only if jQuery is present
|
827
852
|
*/
|
828
853
|
|
829
|
-
defineJQueryPlugin(NAME$
|
854
|
+
defineJQueryPlugin(NAME$b, Button);
|
830
855
|
|
831
856
|
/**
|
832
857
|
* --------------------------------------------------------------------------
|
833
|
-
* Bootstrap (v5.0.0
|
858
|
+
* Bootstrap (v5.0.0): dom/manipulator.js
|
834
859
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
835
860
|
* --------------------------------------------------------------------------
|
836
861
|
*/
|
@@ -904,7 +929,7 @@
|
|
904
929
|
|
905
930
|
/**
|
906
931
|
* --------------------------------------------------------------------------
|
907
|
-
* Bootstrap (v5.0.0
|
932
|
+
* Bootstrap (v5.0.0): dom/selector-engine.js
|
908
933
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
909
934
|
* --------------------------------------------------------------------------
|
910
935
|
*/
|
@@ -975,7 +1000,7 @@
|
|
975
1000
|
|
976
1001
|
/**
|
977
1002
|
* --------------------------------------------------------------------------
|
978
|
-
* Bootstrap (v5.0.0
|
1003
|
+
* Bootstrap (v5.0.0): carousel.js
|
979
1004
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
980
1005
|
* --------------------------------------------------------------------------
|
981
1006
|
*/
|
@@ -985,7 +1010,7 @@
|
|
985
1010
|
* ------------------------------------------------------------------------
|
986
1011
|
*/
|
987
1012
|
|
988
|
-
const NAME$
|
1013
|
+
const NAME$a = 'carousel';
|
989
1014
|
const DATA_KEY$9 = 'bs.carousel';
|
990
1015
|
const EVENT_KEY$9 = `.${DATA_KEY$9}`;
|
991
1016
|
const DATA_API_KEY$6 = '.data-api';
|
@@ -994,7 +1019,7 @@
|
|
994
1019
|
const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
|
995
1020
|
|
996
1021
|
const SWIPE_THRESHOLD = 40;
|
997
|
-
const Default$
|
1022
|
+
const Default$9 = {
|
998
1023
|
interval: 5000,
|
999
1024
|
keyboard: true,
|
1000
1025
|
slide: false,
|
@@ -1002,7 +1027,7 @@
|
|
1002
1027
|
wrap: true,
|
1003
1028
|
touch: true
|
1004
1029
|
};
|
1005
|
-
const DefaultType$
|
1030
|
+
const DefaultType$9 = {
|
1006
1031
|
interval: '(number|boolean)',
|
1007
1032
|
keyboard: 'boolean',
|
1008
1033
|
slide: '(boolean|string)',
|
@@ -1073,7 +1098,7 @@
|
|
1073
1098
|
|
1074
1099
|
|
1075
1100
|
static get Default() {
|
1076
|
-
return Default$
|
1101
|
+
return Default$9;
|
1077
1102
|
}
|
1078
1103
|
|
1079
1104
|
static get DATA_KEY() {
|
@@ -1158,7 +1183,6 @@
|
|
1158
1183
|
}
|
1159
1184
|
|
1160
1185
|
dispose() {
|
1161
|
-
EventHandler.off(this._element, EVENT_KEY$9);
|
1162
1186
|
this._items = null;
|
1163
1187
|
this._config = null;
|
1164
1188
|
this._interval = null;
|
@@ -1171,10 +1195,10 @@
|
|
1171
1195
|
|
1172
1196
|
|
1173
1197
|
_getConfig(config) {
|
1174
|
-
config = { ...Default$
|
1198
|
+
config = { ...Default$9,
|
1175
1199
|
...config
|
1176
1200
|
};
|
1177
|
-
typeCheckConfig(NAME$
|
1201
|
+
typeCheckConfig(NAME$a, config, DefaultType$9);
|
1178
1202
|
return config;
|
1179
1203
|
}
|
1180
1204
|
|
@@ -1273,11 +1297,11 @@
|
|
1273
1297
|
if (event.key === ARROW_LEFT_KEY) {
|
1274
1298
|
event.preventDefault();
|
1275
1299
|
|
1276
|
-
this._slide(
|
1300
|
+
this._slide(DIRECTION_RIGHT);
|
1277
1301
|
} else if (event.key === ARROW_RIGHT_KEY) {
|
1278
1302
|
event.preventDefault();
|
1279
1303
|
|
1280
|
-
this._slide(
|
1304
|
+
this._slide(DIRECTION_LEFT);
|
1281
1305
|
}
|
1282
1306
|
}
|
1283
1307
|
|
@@ -1439,10 +1463,10 @@
|
|
1439
1463
|
}
|
1440
1464
|
|
1441
1465
|
if (isRTL()) {
|
1442
|
-
return direction ===
|
1466
|
+
return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT;
|
1443
1467
|
}
|
1444
1468
|
|
1445
|
-
return direction ===
|
1469
|
+
return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV;
|
1446
1470
|
}
|
1447
1471
|
|
1448
1472
|
_orderToDirection(order) {
|
@@ -1451,16 +1475,16 @@
|
|
1451
1475
|
}
|
1452
1476
|
|
1453
1477
|
if (isRTL()) {
|
1454
|
-
return order ===
|
1478
|
+
return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
1455
1479
|
}
|
1456
1480
|
|
1457
|
-
return order ===
|
1481
|
+
return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT;
|
1458
1482
|
} // Static
|
1459
1483
|
|
1460
1484
|
|
1461
1485
|
static carouselInterface(element, config) {
|
1462
1486
|
let data = Data.get(element, DATA_KEY$9);
|
1463
|
-
let _config = { ...Default$
|
1487
|
+
let _config = { ...Default$9,
|
1464
1488
|
...Manipulator.getDataAttributes(element)
|
1465
1489
|
};
|
1466
1490
|
|
@@ -1544,11 +1568,11 @@
|
|
1544
1568
|
* add .Carousel to jQuery only if jQuery is present
|
1545
1569
|
*/
|
1546
1570
|
|
1547
|
-
defineJQueryPlugin(NAME$
|
1571
|
+
defineJQueryPlugin(NAME$a, Carousel);
|
1548
1572
|
|
1549
1573
|
/**
|
1550
1574
|
* --------------------------------------------------------------------------
|
1551
|
-
* Bootstrap (v5.0.0
|
1575
|
+
* Bootstrap (v5.0.0): collapse.js
|
1552
1576
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
1553
1577
|
* --------------------------------------------------------------------------
|
1554
1578
|
*/
|
@@ -1558,15 +1582,15 @@
|
|
1558
1582
|
* ------------------------------------------------------------------------
|
1559
1583
|
*/
|
1560
1584
|
|
1561
|
-
const NAME$
|
1585
|
+
const NAME$9 = 'collapse';
|
1562
1586
|
const DATA_KEY$8 = 'bs.collapse';
|
1563
1587
|
const EVENT_KEY$8 = `.${DATA_KEY$8}`;
|
1564
1588
|
const DATA_API_KEY$5 = '.data-api';
|
1565
|
-
const Default$
|
1589
|
+
const Default$8 = {
|
1566
1590
|
toggle: true,
|
1567
1591
|
parent: ''
|
1568
1592
|
};
|
1569
|
-
const DefaultType$
|
1593
|
+
const DefaultType$8 = {
|
1570
1594
|
toggle: 'boolean',
|
1571
1595
|
parent: '(string|element)'
|
1572
1596
|
};
|
@@ -1575,7 +1599,7 @@
|
|
1575
1599
|
const EVENT_HIDE$5 = `hide${EVENT_KEY$8}`;
|
1576
1600
|
const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$8}`;
|
1577
1601
|
const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`;
|
1578
|
-
const CLASS_NAME_SHOW$
|
1602
|
+
const CLASS_NAME_SHOW$8 = 'show';
|
1579
1603
|
const CLASS_NAME_COLLAPSE = 'collapse';
|
1580
1604
|
const CLASS_NAME_COLLAPSING = 'collapsing';
|
1581
1605
|
const CLASS_NAME_COLLAPSED = 'collapsed';
|
@@ -1622,7 +1646,7 @@
|
|
1622
1646
|
|
1623
1647
|
|
1624
1648
|
static get Default() {
|
1625
|
-
return Default$
|
1649
|
+
return Default$8;
|
1626
1650
|
}
|
1627
1651
|
|
1628
1652
|
static get DATA_KEY() {
|
@@ -1631,7 +1655,7 @@
|
|
1631
1655
|
|
1632
1656
|
|
1633
1657
|
toggle() {
|
1634
|
-
if (this._element.classList.contains(CLASS_NAME_SHOW$
|
1658
|
+
if (this._element.classList.contains(CLASS_NAME_SHOW$8)) {
|
1635
1659
|
this.hide();
|
1636
1660
|
} else {
|
1637
1661
|
this.show();
|
@@ -1639,7 +1663,7 @@
|
|
1639
1663
|
}
|
1640
1664
|
|
1641
1665
|
show() {
|
1642
|
-
if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW$
|
1666
|
+
if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW$8)) {
|
1643
1667
|
return;
|
1644
1668
|
}
|
1645
1669
|
|
@@ -1709,7 +1733,7 @@
|
|
1709
1733
|
const complete = () => {
|
1710
1734
|
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
1711
1735
|
|
1712
|
-
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
1736
|
+
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8);
|
1713
1737
|
|
1714
1738
|
this._element.style[dimension] = '';
|
1715
1739
|
this.setTransitioning(false);
|
@@ -1725,7 +1749,7 @@
|
|
1725
1749
|
}
|
1726
1750
|
|
1727
1751
|
hide() {
|
1728
|
-
if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW$
|
1752
|
+
if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW$8)) {
|
1729
1753
|
return;
|
1730
1754
|
}
|
1731
1755
|
|
@@ -1742,7 +1766,7 @@
|
|
1742
1766
|
|
1743
1767
|
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
1744
1768
|
|
1745
|
-
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$
|
1769
|
+
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$8);
|
1746
1770
|
|
1747
1771
|
const triggerArrayLength = this._triggerArray.length;
|
1748
1772
|
|
@@ -1751,7 +1775,7 @@
|
|
1751
1775
|
const trigger = this._triggerArray[i];
|
1752
1776
|
const elem = getElementFromSelector(trigger);
|
1753
1777
|
|
1754
|
-
if (elem && !elem.classList.contains(CLASS_NAME_SHOW$
|
1778
|
+
if (elem && !elem.classList.contains(CLASS_NAME_SHOW$8)) {
|
1755
1779
|
trigger.classList.add(CLASS_NAME_COLLAPSED);
|
1756
1780
|
trigger.setAttribute('aria-expanded', false);
|
1757
1781
|
}
|
@@ -1790,12 +1814,12 @@
|
|
1790
1814
|
|
1791
1815
|
|
1792
1816
|
_getConfig(config) {
|
1793
|
-
config = { ...Default$
|
1817
|
+
config = { ...Default$8,
|
1794
1818
|
...config
|
1795
1819
|
};
|
1796
1820
|
config.toggle = Boolean(config.toggle); // Coerce string values
|
1797
1821
|
|
1798
|
-
typeCheckConfig(NAME$
|
1822
|
+
typeCheckConfig(NAME$9, config, DefaultType$8);
|
1799
1823
|
return config;
|
1800
1824
|
}
|
1801
1825
|
|
@@ -1831,7 +1855,7 @@
|
|
1831
1855
|
return;
|
1832
1856
|
}
|
1833
1857
|
|
1834
|
-
const isOpen = element.classList.contains(CLASS_NAME_SHOW$
|
1858
|
+
const isOpen = element.classList.contains(CLASS_NAME_SHOW$8);
|
1835
1859
|
triggerArray.forEach(elem => {
|
1836
1860
|
if (isOpen) {
|
1837
1861
|
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
@@ -1846,7 +1870,7 @@
|
|
1846
1870
|
|
1847
1871
|
static collapseInterface(element, config) {
|
1848
1872
|
let data = Data.get(element, DATA_KEY$8);
|
1849
|
-
const _config = { ...Default$
|
1873
|
+
const _config = { ...Default$8,
|
1850
1874
|
...Manipulator.getDataAttributes(element),
|
1851
1875
|
...(typeof config === 'object' && config ? config : {})
|
1852
1876
|
};
|
@@ -1917,11 +1941,11 @@
|
|
1917
1941
|
* add .Collapse to jQuery only if jQuery is present
|
1918
1942
|
*/
|
1919
1943
|
|
1920
|
-
defineJQueryPlugin(NAME$
|
1944
|
+
defineJQueryPlugin(NAME$9, Collapse);
|
1921
1945
|
|
1922
1946
|
/**
|
1923
1947
|
* --------------------------------------------------------------------------
|
1924
|
-
* Bootstrap (v5.0.0
|
1948
|
+
* Bootstrap (v5.0.0): dropdown.js
|
1925
1949
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
1926
1950
|
* --------------------------------------------------------------------------
|
1927
1951
|
*/
|
@@ -1931,7 +1955,7 @@
|
|
1931
1955
|
* ------------------------------------------------------------------------
|
1932
1956
|
*/
|
1933
1957
|
|
1934
|
-
const NAME$
|
1958
|
+
const NAME$8 = 'dropdown';
|
1935
1959
|
const DATA_KEY$7 = 'bs.dropdown';
|
1936
1960
|
const EVENT_KEY$7 = `.${DATA_KEY$7}`;
|
1937
1961
|
const DATA_API_KEY$4 = '.data-api';
|
@@ -1951,8 +1975,7 @@
|
|
1951
1975
|
const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`;
|
1952
1976
|
const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$7}${DATA_API_KEY$4}`;
|
1953
1977
|
const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$7}${DATA_API_KEY$4}`;
|
1954
|
-
const
|
1955
|
-
const CLASS_NAME_SHOW$6 = 'show';
|
1978
|
+
const CLASS_NAME_SHOW$7 = 'show';
|
1956
1979
|
const CLASS_NAME_DROPUP = 'dropup';
|
1957
1980
|
const CLASS_NAME_DROPEND = 'dropend';
|
1958
1981
|
const CLASS_NAME_DROPSTART = 'dropstart';
|
@@ -1967,19 +1990,21 @@
|
|
1967
1990
|
const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end';
|
1968
1991
|
const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start';
|
1969
1992
|
const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start';
|
1970
|
-
const Default$
|
1993
|
+
const Default$7 = {
|
1971
1994
|
offset: [0, 2],
|
1972
1995
|
boundary: 'clippingParents',
|
1973
1996
|
reference: 'toggle',
|
1974
1997
|
display: 'dynamic',
|
1975
|
-
popperConfig: null
|
1998
|
+
popperConfig: null,
|
1999
|
+
autoClose: true
|
1976
2000
|
};
|
1977
|
-
const DefaultType$
|
2001
|
+
const DefaultType$7 = {
|
1978
2002
|
offset: '(array|string|function)',
|
1979
2003
|
boundary: '(string|element)',
|
1980
2004
|
reference: '(string|element|object)',
|
1981
2005
|
display: 'string',
|
1982
|
-
popperConfig: '(null|object|function)'
|
2006
|
+
popperConfig: '(null|object|function)',
|
2007
|
+
autoClose: '(boolean|string)'
|
1983
2008
|
};
|
1984
2009
|
/**
|
1985
2010
|
* ------------------------------------------------------------------------
|
@@ -2000,11 +2025,11 @@
|
|
2000
2025
|
|
2001
2026
|
|
2002
2027
|
static get Default() {
|
2003
|
-
return Default$
|
2028
|
+
return Default$7;
|
2004
2029
|
}
|
2005
2030
|
|
2006
2031
|
static get DefaultType() {
|
2007
|
-
return DefaultType$
|
2032
|
+
return DefaultType$7;
|
2008
2033
|
}
|
2009
2034
|
|
2010
2035
|
static get DATA_KEY() {
|
@@ -2013,15 +2038,14 @@
|
|
2013
2038
|
|
2014
2039
|
|
2015
2040
|
toggle() {
|
2016
|
-
if (this._element
|
2041
|
+
if (isDisabled(this._element)) {
|
2017
2042
|
return;
|
2018
2043
|
}
|
2019
2044
|
|
2020
|
-
const isActive = this._element.classList.contains(CLASS_NAME_SHOW$
|
2021
|
-
|
2022
|
-
Dropdown.clearMenus();
|
2045
|
+
const isActive = this._element.classList.contains(CLASS_NAME_SHOW$7);
|
2023
2046
|
|
2024
2047
|
if (isActive) {
|
2048
|
+
this.hide();
|
2025
2049
|
return;
|
2026
2050
|
}
|
2027
2051
|
|
@@ -2029,7 +2053,7 @@
|
|
2029
2053
|
}
|
2030
2054
|
|
2031
2055
|
show() {
|
2032
|
-
if (this._element
|
2056
|
+
if (isDisabled(this._element) || this._menu.classList.contains(CLASS_NAME_SHOW$7)) {
|
2033
2057
|
return;
|
2034
2058
|
}
|
2035
2059
|
|
@@ -2080,48 +2104,33 @@
|
|
2080
2104
|
|
2081
2105
|
|
2082
2106
|
if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {
|
2083
|
-
[].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover',
|
2107
|
+
[].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover', noop));
|
2084
2108
|
}
|
2085
2109
|
|
2086
2110
|
this._element.focus();
|
2087
2111
|
|
2088
2112
|
this._element.setAttribute('aria-expanded', true);
|
2089
2113
|
|
2090
|
-
this._menu.classList.toggle(CLASS_NAME_SHOW$
|
2114
|
+
this._menu.classList.toggle(CLASS_NAME_SHOW$7);
|
2091
2115
|
|
2092
|
-
this._element.classList.toggle(CLASS_NAME_SHOW$
|
2116
|
+
this._element.classList.toggle(CLASS_NAME_SHOW$7);
|
2093
2117
|
|
2094
2118
|
EventHandler.trigger(this._element, EVENT_SHOWN$4, relatedTarget);
|
2095
2119
|
}
|
2096
2120
|
|
2097
2121
|
hide() {
|
2098
|
-
if (this._element
|
2122
|
+
if (isDisabled(this._element) || !this._menu.classList.contains(CLASS_NAME_SHOW$7)) {
|
2099
2123
|
return;
|
2100
2124
|
}
|
2101
2125
|
|
2102
2126
|
const relatedTarget = {
|
2103
2127
|
relatedTarget: this._element
|
2104
2128
|
};
|
2105
|
-
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);
|
2106
|
-
|
2107
|
-
if (hideEvent.defaultPrevented) {
|
2108
|
-
return;
|
2109
|
-
}
|
2110
|
-
|
2111
|
-
if (this._popper) {
|
2112
|
-
this._popper.destroy();
|
2113
|
-
}
|
2114
|
-
|
2115
|
-
this._menu.classList.toggle(CLASS_NAME_SHOW$6);
|
2116
|
-
|
2117
|
-
this._element.classList.toggle(CLASS_NAME_SHOW$6);
|
2118
2129
|
|
2119
|
-
|
2120
|
-
EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget);
|
2130
|
+
this._completeHide(relatedTarget);
|
2121
2131
|
}
|
2122
2132
|
|
2123
2133
|
dispose() {
|
2124
|
-
EventHandler.off(this._element, EVENT_KEY$7);
|
2125
2134
|
this._menu = null;
|
2126
2135
|
|
2127
2136
|
if (this._popper) {
|
@@ -2149,16 +2158,43 @@
|
|
2149
2158
|
});
|
2150
2159
|
}
|
2151
2160
|
|
2161
|
+
_completeHide(relatedTarget) {
|
2162
|
+
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget);
|
2163
|
+
|
2164
|
+
if (hideEvent.defaultPrevented) {
|
2165
|
+
return;
|
2166
|
+
} // If this is a touch-enabled device we remove the extra
|
2167
|
+
// empty mouseover listeners we added for iOS support
|
2168
|
+
|
2169
|
+
|
2170
|
+
if ('ontouchstart' in document.documentElement) {
|
2171
|
+
[].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', noop));
|
2172
|
+
}
|
2173
|
+
|
2174
|
+
if (this._popper) {
|
2175
|
+
this._popper.destroy();
|
2176
|
+
}
|
2177
|
+
|
2178
|
+
this._menu.classList.remove(CLASS_NAME_SHOW$7);
|
2179
|
+
|
2180
|
+
this._element.classList.remove(CLASS_NAME_SHOW$7);
|
2181
|
+
|
2182
|
+
this._element.setAttribute('aria-expanded', 'false');
|
2183
|
+
|
2184
|
+
Manipulator.removeDataAttribute(this._menu, 'popper');
|
2185
|
+
EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget);
|
2186
|
+
}
|
2187
|
+
|
2152
2188
|
_getConfig(config) {
|
2153
2189
|
config = { ...this.constructor.Default,
|
2154
2190
|
...Manipulator.getDataAttributes(this._element),
|
2155
2191
|
...config
|
2156
2192
|
};
|
2157
|
-
typeCheckConfig(NAME$
|
2193
|
+
typeCheckConfig(NAME$8, config, this.constructor.DefaultType);
|
2158
2194
|
|
2159
2195
|
if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') {
|
2160
2196
|
// Popper virtual elements require a getBoundingClientRect method
|
2161
|
-
throw new TypeError(`${NAME$
|
2197
|
+
throw new TypeError(`${NAME$8.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);
|
2162
2198
|
}
|
2163
2199
|
|
2164
2200
|
return config;
|
@@ -2235,6 +2271,29 @@
|
|
2235
2271
|
return { ...defaultBsPopperConfig,
|
2236
2272
|
...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)
|
2237
2273
|
};
|
2274
|
+
}
|
2275
|
+
|
2276
|
+
_selectMenuItem(event) {
|
2277
|
+
const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible);
|
2278
|
+
|
2279
|
+
if (!items.length) {
|
2280
|
+
return;
|
2281
|
+
}
|
2282
|
+
|
2283
|
+
let index = items.indexOf(event.target); // Up
|
2284
|
+
|
2285
|
+
if (event.key === ARROW_UP_KEY && index > 0) {
|
2286
|
+
index--;
|
2287
|
+
} // Down
|
2288
|
+
|
2289
|
+
|
2290
|
+
if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
|
2291
|
+
index++;
|
2292
|
+
} // index is -1 if the first keydown is an ArrowUp
|
2293
|
+
|
2294
|
+
|
2295
|
+
index = index === -1 ? 0 : index;
|
2296
|
+
items[index].focus();
|
2238
2297
|
} // Static
|
2239
2298
|
|
2240
2299
|
|
@@ -2268,7 +2327,7 @@
|
|
2268
2327
|
return;
|
2269
2328
|
}
|
2270
2329
|
|
2271
|
-
if (/input|select|textarea|form/i.test(event.target.tagName)) {
|
2330
|
+
if (/input|select|option|textarea|form/i.test(event.target.tagName)) {
|
2272
2331
|
return;
|
2273
2332
|
}
|
2274
2333
|
}
|
@@ -2277,58 +2336,38 @@
|
|
2277
2336
|
|
2278
2337
|
for (let i = 0, len = toggles.length; i < len; i++) {
|
2279
2338
|
const context = Data.get(toggles[i], DATA_KEY$7);
|
2280
|
-
const relatedTarget = {
|
2281
|
-
relatedTarget: toggles[i]
|
2282
|
-
};
|
2283
2339
|
|
2284
|
-
if (
|
2285
|
-
relatedTarget.clickEvent = event;
|
2286
|
-
}
|
2287
|
-
|
2288
|
-
if (!context) {
|
2340
|
+
if (!context || context._config.autoClose === false) {
|
2289
2341
|
continue;
|
2290
2342
|
}
|
2291
2343
|
|
2292
|
-
|
2293
|
-
|
2294
|
-
if (!toggles[i].classList.contains(CLASS_NAME_SHOW$6)) {
|
2344
|
+
if (!context._element.classList.contains(CLASS_NAME_SHOW$7)) {
|
2295
2345
|
continue;
|
2296
2346
|
}
|
2297
2347
|
|
2348
|
+
const relatedTarget = {
|
2349
|
+
relatedTarget: context._element
|
2350
|
+
};
|
2351
|
+
|
2298
2352
|
if (event) {
|
2299
|
-
|
2300
|
-
|
2353
|
+
const composedPath = event.composedPath();
|
2354
|
+
const isMenuTarget = composedPath.includes(context._menu);
|
2355
|
+
|
2356
|
+
if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) {
|
2301
2357
|
continue;
|
2302
2358
|
} // Tab navigation through the dropdown menu shouldn't close the menu
|
2303
2359
|
|
2304
2360
|
|
2305
|
-
if (event.type === 'keyup' && event.key === TAB_KEY &&
|
2361
|
+
if (event.type === 'keyup' && event.key === TAB_KEY && context._menu.contains(event.target)) {
|
2306
2362
|
continue;
|
2307
2363
|
}
|
2308
|
-
}
|
2309
|
-
|
2310
|
-
const hideEvent = EventHandler.trigger(toggles[i], EVENT_HIDE$4, relatedTarget);
|
2311
|
-
|
2312
|
-
if (hideEvent.defaultPrevented) {
|
2313
|
-
continue;
|
2314
|
-
} // If this is a touch-enabled device we remove the extra
|
2315
|
-
// empty mouseover listeners we added for iOS support
|
2316
|
-
|
2317
|
-
|
2318
|
-
if ('ontouchstart' in document.documentElement) {
|
2319
|
-
[].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', null, noop()));
|
2320
|
-
}
|
2321
|
-
|
2322
|
-
toggles[i].setAttribute('aria-expanded', 'false');
|
2323
2364
|
|
2324
|
-
|
2325
|
-
|
2365
|
+
if (event.type === 'click') {
|
2366
|
+
relatedTarget.clickEvent = event;
|
2367
|
+
}
|
2326
2368
|
}
|
2327
2369
|
|
2328
|
-
|
2329
|
-
toggles[i].classList.remove(CLASS_NAME_SHOW$6);
|
2330
|
-
Manipulator.removeDataAttribute(dropdownMenu, 'popper');
|
2331
|
-
EventHandler.trigger(toggles[i], EVENT_HIDDEN$4, relatedTarget);
|
2370
|
+
context._completeHide(relatedTarget);
|
2332
2371
|
}
|
2333
2372
|
}
|
2334
2373
|
|
@@ -2348,26 +2387,29 @@
|
|
2348
2387
|
return;
|
2349
2388
|
}
|
2350
2389
|
|
2390
|
+
const isActive = this.classList.contains(CLASS_NAME_SHOW$7);
|
2391
|
+
|
2392
|
+
if (!isActive && event.key === ESCAPE_KEY$2) {
|
2393
|
+
return;
|
2394
|
+
}
|
2395
|
+
|
2351
2396
|
event.preventDefault();
|
2352
2397
|
event.stopPropagation();
|
2353
2398
|
|
2354
|
-
if (this
|
2399
|
+
if (isDisabled(this)) {
|
2355
2400
|
return;
|
2356
2401
|
}
|
2357
2402
|
|
2358
|
-
const
|
2359
|
-
const isActive = this.classList.contains(CLASS_NAME_SHOW$6);
|
2403
|
+
const getToggleButton = () => this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0];
|
2360
2404
|
|
2361
2405
|
if (event.key === ESCAPE_KEY$2) {
|
2362
|
-
|
2363
|
-
button.focus();
|
2406
|
+
getToggleButton().focus();
|
2364
2407
|
Dropdown.clearMenus();
|
2365
2408
|
return;
|
2366
2409
|
}
|
2367
2410
|
|
2368
2411
|
if (!isActive && (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY)) {
|
2369
|
-
|
2370
|
-
button.click();
|
2412
|
+
getToggleButton().click();
|
2371
2413
|
return;
|
2372
2414
|
}
|
2373
2415
|
|
@@ -2376,26 +2418,7 @@
|
|
2376
2418
|
return;
|
2377
2419
|
}
|
2378
2420
|
|
2379
|
-
|
2380
|
-
|
2381
|
-
if (!items.length) {
|
2382
|
-
return;
|
2383
|
-
}
|
2384
|
-
|
2385
|
-
let index = items.indexOf(event.target); // Up
|
2386
|
-
|
2387
|
-
if (event.key === ARROW_UP_KEY && index > 0) {
|
2388
|
-
index--;
|
2389
|
-
} // Down
|
2390
|
-
|
2391
|
-
|
2392
|
-
if (event.key === ARROW_DOWN_KEY && index < items.length - 1) {
|
2393
|
-
index++;
|
2394
|
-
} // index is -1 if the first keydown is an ArrowUp
|
2395
|
-
|
2396
|
-
|
2397
|
-
index = index === -1 ? 0 : index;
|
2398
|
-
items[index].focus();
|
2421
|
+
Dropdown.getInstance(getToggleButton())._selectMenuItem(event);
|
2399
2422
|
}
|
2400
2423
|
|
2401
2424
|
}
|
@@ -2421,11 +2444,213 @@
|
|
2421
2444
|
* add .Dropdown to jQuery only if jQuery is present
|
2422
2445
|
*/
|
2423
2446
|
|
2424
|
-
defineJQueryPlugin(NAME$
|
2447
|
+
defineJQueryPlugin(NAME$8, Dropdown);
|
2425
2448
|
|
2426
2449
|
/**
|
2427
2450
|
* --------------------------------------------------------------------------
|
2428
|
-
* Bootstrap (v5.0.0
|
2451
|
+
* Bootstrap (v5.0.0): util/scrollBar.js
|
2452
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
2453
|
+
* --------------------------------------------------------------------------
|
2454
|
+
*/
|
2455
|
+
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
2456
|
+
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
2457
|
+
|
2458
|
+
const getWidth = () => {
|
2459
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
2460
|
+
const documentWidth = document.documentElement.clientWidth;
|
2461
|
+
return Math.abs(window.innerWidth - documentWidth);
|
2462
|
+
};
|
2463
|
+
|
2464
|
+
const hide = (width = getWidth()) => {
|
2465
|
+
_disableOverFlow(); // give padding to element to balances the hidden scrollbar width
|
2466
|
+
|
2467
|
+
|
2468
|
+
_setElementAttributes('body', 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements, to keep shown fullwidth
|
2469
|
+
|
2470
|
+
|
2471
|
+
_setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
|
2472
|
+
|
2473
|
+
_setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
|
2474
|
+
};
|
2475
|
+
|
2476
|
+
const _disableOverFlow = () => {
|
2477
|
+
const actualValue = document.body.style.overflow;
|
2478
|
+
|
2479
|
+
if (actualValue) {
|
2480
|
+
Manipulator.setDataAttribute(document.body, 'overflow', actualValue);
|
2481
|
+
}
|
2482
|
+
|
2483
|
+
document.body.style.overflow = 'hidden';
|
2484
|
+
};
|
2485
|
+
|
2486
|
+
const _setElementAttributes = (selector, styleProp, callback) => {
|
2487
|
+
const scrollbarWidth = getWidth();
|
2488
|
+
SelectorEngine.find(selector).forEach(element => {
|
2489
|
+
if (element !== document.body && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
2490
|
+
return;
|
2491
|
+
}
|
2492
|
+
|
2493
|
+
const actualValue = element.style[styleProp];
|
2494
|
+
const calculatedValue = window.getComputedStyle(element)[styleProp];
|
2495
|
+
Manipulator.setDataAttribute(element, styleProp, actualValue);
|
2496
|
+
element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`;
|
2497
|
+
});
|
2498
|
+
};
|
2499
|
+
|
2500
|
+
const reset = () => {
|
2501
|
+
_resetElementAttributes('body', 'overflow');
|
2502
|
+
|
2503
|
+
_resetElementAttributes('body', 'paddingRight');
|
2504
|
+
|
2505
|
+
_resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
|
2506
|
+
|
2507
|
+
_resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
|
2508
|
+
};
|
2509
|
+
|
2510
|
+
const _resetElementAttributes = (selector, styleProp) => {
|
2511
|
+
SelectorEngine.find(selector).forEach(element => {
|
2512
|
+
const value = Manipulator.getDataAttribute(element, styleProp);
|
2513
|
+
|
2514
|
+
if (typeof value === 'undefined') {
|
2515
|
+
element.style.removeProperty(styleProp);
|
2516
|
+
} else {
|
2517
|
+
Manipulator.removeDataAttribute(element, styleProp);
|
2518
|
+
element.style[styleProp] = value;
|
2519
|
+
}
|
2520
|
+
});
|
2521
|
+
};
|
2522
|
+
|
2523
|
+
/**
|
2524
|
+
* --------------------------------------------------------------------------
|
2525
|
+
* Bootstrap (v5.0.0): util/backdrop.js
|
2526
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2527
|
+
* --------------------------------------------------------------------------
|
2528
|
+
*/
|
2529
|
+
const Default$6 = {
|
2530
|
+
isVisible: true,
|
2531
|
+
// if false, we use the backdrop helper without adding any element to the dom
|
2532
|
+
isAnimated: false,
|
2533
|
+
rootElement: document.body,
|
2534
|
+
// give the choice to place backdrop under different elements
|
2535
|
+
clickCallback: null
|
2536
|
+
};
|
2537
|
+
const DefaultType$6 = {
|
2538
|
+
isVisible: 'boolean',
|
2539
|
+
isAnimated: 'boolean',
|
2540
|
+
rootElement: 'element',
|
2541
|
+
clickCallback: '(function|null)'
|
2542
|
+
};
|
2543
|
+
const NAME$7 = 'backdrop';
|
2544
|
+
const CLASS_NAME_BACKDROP = 'modal-backdrop';
|
2545
|
+
const CLASS_NAME_FADE$5 = 'fade';
|
2546
|
+
const CLASS_NAME_SHOW$6 = 'show';
|
2547
|
+
const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$7}`;
|
2548
|
+
|
2549
|
+
class Backdrop {
|
2550
|
+
constructor(config) {
|
2551
|
+
this._config = this._getConfig(config);
|
2552
|
+
this._isAppended = false;
|
2553
|
+
this._element = null;
|
2554
|
+
}
|
2555
|
+
|
2556
|
+
show(callback) {
|
2557
|
+
if (!this._config.isVisible) {
|
2558
|
+
execute(callback);
|
2559
|
+
return;
|
2560
|
+
}
|
2561
|
+
|
2562
|
+
this._append();
|
2563
|
+
|
2564
|
+
if (this._config.isAnimated) {
|
2565
|
+
reflow(this._getElement());
|
2566
|
+
}
|
2567
|
+
|
2568
|
+
this._getElement().classList.add(CLASS_NAME_SHOW$6);
|
2569
|
+
|
2570
|
+
this._emulateAnimation(() => {
|
2571
|
+
execute(callback);
|
2572
|
+
});
|
2573
|
+
}
|
2574
|
+
|
2575
|
+
hide(callback) {
|
2576
|
+
if (!this._config.isVisible) {
|
2577
|
+
execute(callback);
|
2578
|
+
return;
|
2579
|
+
}
|
2580
|
+
|
2581
|
+
this._getElement().classList.remove(CLASS_NAME_SHOW$6);
|
2582
|
+
|
2583
|
+
this._emulateAnimation(() => {
|
2584
|
+
this.dispose();
|
2585
|
+
execute(callback);
|
2586
|
+
});
|
2587
|
+
} // Private
|
2588
|
+
|
2589
|
+
|
2590
|
+
_getElement() {
|
2591
|
+
if (!this._element) {
|
2592
|
+
const backdrop = document.createElement('div');
|
2593
|
+
backdrop.className = CLASS_NAME_BACKDROP;
|
2594
|
+
|
2595
|
+
if (this._config.isAnimated) {
|
2596
|
+
backdrop.classList.add(CLASS_NAME_FADE$5);
|
2597
|
+
}
|
2598
|
+
|
2599
|
+
this._element = backdrop;
|
2600
|
+
}
|
2601
|
+
|
2602
|
+
return this._element;
|
2603
|
+
}
|
2604
|
+
|
2605
|
+
_getConfig(config) {
|
2606
|
+
config = { ...Default$6,
|
2607
|
+
...(typeof config === 'object' ? config : {})
|
2608
|
+
};
|
2609
|
+
typeCheckConfig(NAME$7, config, DefaultType$6);
|
2610
|
+
return config;
|
2611
|
+
}
|
2612
|
+
|
2613
|
+
_append() {
|
2614
|
+
if (this._isAppended) {
|
2615
|
+
return;
|
2616
|
+
}
|
2617
|
+
|
2618
|
+
this._config.rootElement.appendChild(this._getElement());
|
2619
|
+
|
2620
|
+
EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {
|
2621
|
+
execute(this._config.clickCallback);
|
2622
|
+
});
|
2623
|
+
this._isAppended = true;
|
2624
|
+
}
|
2625
|
+
|
2626
|
+
dispose() {
|
2627
|
+
if (!this._isAppended) {
|
2628
|
+
return;
|
2629
|
+
}
|
2630
|
+
|
2631
|
+
EventHandler.off(this._element, EVENT_MOUSEDOWN);
|
2632
|
+
|
2633
|
+
this._getElement().parentNode.removeChild(this._element);
|
2634
|
+
|
2635
|
+
this._isAppended = false;
|
2636
|
+
}
|
2637
|
+
|
2638
|
+
_emulateAnimation(callback) {
|
2639
|
+
if (!this._config.isAnimated) {
|
2640
|
+
execute(callback);
|
2641
|
+
return;
|
2642
|
+
}
|
2643
|
+
|
2644
|
+
const backdropTransitionDuration = getTransitionDurationFromElement(this._getElement());
|
2645
|
+
EventHandler.one(this._getElement(), 'transitionend', () => execute(callback));
|
2646
|
+
emulateTransitionEnd(this._getElement(), backdropTransitionDuration);
|
2647
|
+
}
|
2648
|
+
|
2649
|
+
}
|
2650
|
+
|
2651
|
+
/**
|
2652
|
+
* --------------------------------------------------------------------------
|
2653
|
+
* Bootstrap (v5.0.0): modal.js
|
2429
2654
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
2430
2655
|
* --------------------------------------------------------------------------
|
2431
2656
|
*/
|
@@ -2458,12 +2683,10 @@
|
|
2458
2683
|
const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$6}`;
|
2459
2684
|
const EVENT_RESIZE = `resize${EVENT_KEY$6}`;
|
2460
2685
|
const EVENT_CLICK_DISMISS$2 = `click.dismiss${EVENT_KEY$6}`;
|
2461
|
-
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$6}`;
|
2686
|
+
const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$6}`;
|
2462
2687
|
const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`;
|
2463
2688
|
const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`;
|
2464
2689
|
const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`;
|
2465
|
-
const CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
|
2466
|
-
const CLASS_NAME_BACKDROP = 'modal-backdrop';
|
2467
2690
|
const CLASS_NAME_OPEN = 'modal-open';
|
2468
2691
|
const CLASS_NAME_FADE$4 = 'fade';
|
2469
2692
|
const CLASS_NAME_SHOW$5 = 'show';
|
@@ -2472,8 +2695,6 @@
|
|
2472
2695
|
const SELECTOR_MODAL_BODY = '.modal-body';
|
2473
2696
|
const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]';
|
2474
2697
|
const SELECTOR_DATA_DISMISS$2 = '[data-bs-dismiss="modal"]';
|
2475
|
-
const SELECTOR_FIXED_CONTENT$1 = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
2476
|
-
const SELECTOR_STICKY_CONTENT$1 = '.sticky-top';
|
2477
2698
|
/**
|
2478
2699
|
* ------------------------------------------------------------------------
|
2479
2700
|
* Class Definition
|
@@ -2485,12 +2706,10 @@
|
|
2485
2706
|
super(element);
|
2486
2707
|
this._config = this._getConfig(config);
|
2487
2708
|
this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element);
|
2488
|
-
this._backdrop =
|
2709
|
+
this._backdrop = this._initializeBackDrop();
|
2489
2710
|
this._isShown = false;
|
2490
|
-
this._isBodyOverflowing = false;
|
2491
2711
|
this._ignoreBackdropClick = false;
|
2492
2712
|
this._isTransitioning = false;
|
2493
|
-
this._scrollbarWidth = 0;
|
2494
2713
|
} // Getters
|
2495
2714
|
|
2496
2715
|
|
@@ -2525,10 +2744,8 @@
|
|
2525
2744
|
}
|
2526
2745
|
|
2527
2746
|
this._isShown = true;
|
2528
|
-
|
2529
|
-
|
2530
|
-
|
2531
|
-
this._setScrollbar();
|
2747
|
+
hide();
|
2748
|
+
document.body.classList.add(CLASS_NAME_OPEN);
|
2532
2749
|
|
2533
2750
|
this._adjustDialog();
|
2534
2751
|
|
@@ -2592,7 +2809,7 @@
|
|
2592
2809
|
}
|
2593
2810
|
|
2594
2811
|
dispose() {
|
2595
|
-
[window, this.
|
2812
|
+
[window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6));
|
2596
2813
|
super.dispose();
|
2597
2814
|
/**
|
2598
2815
|
* `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
|
@@ -2603,12 +2820,13 @@
|
|
2603
2820
|
EventHandler.off(document, EVENT_FOCUSIN$1);
|
2604
2821
|
this._config = null;
|
2605
2822
|
this._dialog = null;
|
2823
|
+
|
2824
|
+
this._backdrop.dispose();
|
2825
|
+
|
2606
2826
|
this._backdrop = null;
|
2607
2827
|
this._isShown = null;
|
2608
|
-
this._isBodyOverflowing = null;
|
2609
2828
|
this._ignoreBackdropClick = null;
|
2610
2829
|
this._isTransitioning = null;
|
2611
|
-
this._scrollbarWidth = null;
|
2612
2830
|
}
|
2613
2831
|
|
2614
2832
|
handleUpdate() {
|
@@ -2616,8 +2834,17 @@
|
|
2616
2834
|
} // Private
|
2617
2835
|
|
2618
2836
|
|
2837
|
+
_initializeBackDrop() {
|
2838
|
+
return new Backdrop({
|
2839
|
+
isVisible: Boolean(this._config.backdrop),
|
2840
|
+
// 'static' option will be translated to true, and booleans will keep their value
|
2841
|
+
isAnimated: this._isAnimated()
|
2842
|
+
});
|
2843
|
+
}
|
2844
|
+
|
2619
2845
|
_getConfig(config) {
|
2620
2846
|
config = { ...Default$5,
|
2847
|
+
...Manipulator.getDataAttributes(this._element),
|
2621
2848
|
...config
|
2622
2849
|
};
|
2623
2850
|
typeCheckConfig(NAME$6, config, DefaultType$5);
|
@@ -2690,7 +2917,7 @@
|
|
2690
2917
|
|
2691
2918
|
_setEscapeEvent() {
|
2692
2919
|
if (this._isShown) {
|
2693
|
-
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
2920
|
+
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => {
|
2694
2921
|
if (this._config.keyboard && event.key === ESCAPE_KEY$1) {
|
2695
2922
|
event.preventDefault();
|
2696
2923
|
this.hide();
|
@@ -2699,7 +2926,7 @@
|
|
2699
2926
|
}
|
2700
2927
|
});
|
2701
2928
|
} else {
|
2702
|
-
EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS);
|
2929
|
+
EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS$1);
|
2703
2930
|
}
|
2704
2931
|
}
|
2705
2932
|
|
@@ -2722,85 +2949,35 @@
|
|
2722
2949
|
|
2723
2950
|
this._isTransitioning = false;
|
2724
2951
|
|
2725
|
-
this.
|
2952
|
+
this._backdrop.hide(() => {
|
2726
2953
|
document.body.classList.remove(CLASS_NAME_OPEN);
|
2727
2954
|
|
2728
2955
|
this._resetAdjustments();
|
2729
2956
|
|
2730
|
-
|
2731
|
-
|
2957
|
+
reset();
|
2732
2958
|
EventHandler.trigger(this._element, EVENT_HIDDEN$3);
|
2733
2959
|
});
|
2734
2960
|
}
|
2735
2961
|
|
2736
|
-
_removeBackdrop() {
|
2737
|
-
this._backdrop.parentNode.removeChild(this._backdrop);
|
2738
|
-
|
2739
|
-
this._backdrop = null;
|
2740
|
-
}
|
2741
|
-
|
2742
2962
|
_showBackdrop(callback) {
|
2743
|
-
|
2744
|
-
|
2745
|
-
|
2746
|
-
|
2747
|
-
this._backdrop.className = CLASS_NAME_BACKDROP;
|
2748
|
-
|
2749
|
-
if (isAnimated) {
|
2750
|
-
this._backdrop.classList.add(CLASS_NAME_FADE$4);
|
2751
|
-
}
|
2752
|
-
|
2753
|
-
document.body.appendChild(this._backdrop);
|
2754
|
-
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, event => {
|
2755
|
-
if (this._ignoreBackdropClick) {
|
2756
|
-
this._ignoreBackdropClick = false;
|
2757
|
-
return;
|
2758
|
-
}
|
2759
|
-
|
2760
|
-
if (event.target !== event.currentTarget) {
|
2761
|
-
return;
|
2762
|
-
}
|
2763
|
-
|
2764
|
-
if (this._config.backdrop === 'static') {
|
2765
|
-
this._triggerBackdropTransition();
|
2766
|
-
} else {
|
2767
|
-
this.hide();
|
2768
|
-
}
|
2769
|
-
});
|
2770
|
-
|
2771
|
-
if (isAnimated) {
|
2772
|
-
reflow(this._backdrop);
|
2963
|
+
EventHandler.on(this._element, EVENT_CLICK_DISMISS$2, event => {
|
2964
|
+
if (this._ignoreBackdropClick) {
|
2965
|
+
this._ignoreBackdropClick = false;
|
2966
|
+
return;
|
2773
2967
|
}
|
2774
2968
|
|
2775
|
-
|
2776
|
-
|
2777
|
-
if (!isAnimated) {
|
2778
|
-
callback();
|
2969
|
+
if (event.target !== event.currentTarget) {
|
2779
2970
|
return;
|
2780
2971
|
}
|
2781
2972
|
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
this._backdrop.classList.remove(CLASS_NAME_SHOW$5);
|
2787
|
-
|
2788
|
-
const callbackRemove = () => {
|
2789
|
-
this._removeBackdrop();
|
2790
|
-
|
2791
|
-
callback();
|
2792
|
-
};
|
2793
|
-
|
2794
|
-
if (isAnimated) {
|
2795
|
-
const backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
|
2796
|
-
EventHandler.one(this._backdrop, 'transitionend', callbackRemove);
|
2797
|
-
emulateTransitionEnd(this._backdrop, backdropTransitionDuration);
|
2798
|
-
} else {
|
2799
|
-
callbackRemove();
|
2973
|
+
if (this._config.backdrop === true) {
|
2974
|
+
this.hide();
|
2975
|
+
} else if (this._config.backdrop === 'static') {
|
2976
|
+
this._triggerBackdropTransition();
|
2800
2977
|
}
|
2801
|
-
}
|
2802
|
-
|
2803
|
-
|
2978
|
+
});
|
2979
|
+
|
2980
|
+
this._backdrop.show(callback);
|
2804
2981
|
}
|
2805
2982
|
|
2806
2983
|
_isAnimated() {
|
@@ -2844,103 +3021,37 @@
|
|
2844
3021
|
|
2845
3022
|
_adjustDialog() {
|
2846
3023
|
const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
|
3024
|
+
const scrollbarWidth = getWidth();
|
3025
|
+
const isBodyOverflowing = scrollbarWidth > 0;
|
2847
3026
|
|
2848
|
-
if (!
|
2849
|
-
this._element.style.paddingLeft = `${
|
3027
|
+
if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) {
|
3028
|
+
this._element.style.paddingLeft = `${scrollbarWidth}px`;
|
2850
3029
|
}
|
2851
3030
|
|
2852
|
-
if (
|
2853
|
-
this._element.style.paddingRight = `${
|
3031
|
+
if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) {
|
3032
|
+
this._element.style.paddingRight = `${scrollbarWidth}px`;
|
2854
3033
|
}
|
2855
3034
|
}
|
2856
3035
|
|
2857
3036
|
_resetAdjustments() {
|
2858
3037
|
this._element.style.paddingLeft = '';
|
2859
3038
|
this._element.style.paddingRight = '';
|
2860
|
-
}
|
2861
|
-
|
2862
|
-
_checkScrollbar() {
|
2863
|
-
const rect = document.body.getBoundingClientRect();
|
2864
|
-
this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
|
2865
|
-
this._scrollbarWidth = this._getScrollbarWidth();
|
2866
|
-
}
|
2867
|
-
|
2868
|
-
_setScrollbar() {
|
2869
|
-
if (this._isBodyOverflowing) {
|
2870
|
-
this._setElementAttributes(SELECTOR_FIXED_CONTENT$1, 'paddingRight', calculatedValue => calculatedValue + this._scrollbarWidth);
|
2871
|
-
|
2872
|
-
this._setElementAttributes(SELECTOR_STICKY_CONTENT$1, 'marginRight', calculatedValue => calculatedValue - this._scrollbarWidth);
|
2873
|
-
|
2874
|
-
this._setElementAttributes('body', 'paddingRight', calculatedValue => calculatedValue + this._scrollbarWidth);
|
2875
|
-
}
|
2876
|
-
|
2877
|
-
document.body.classList.add(CLASS_NAME_OPEN);
|
2878
|
-
}
|
2879
|
-
|
2880
|
-
_setElementAttributes(selector, styleProp, callback) {
|
2881
|
-
SelectorEngine.find(selector).forEach(element => {
|
2882
|
-
if (element !== document.body && window.innerWidth > element.clientWidth + this._scrollbarWidth) {
|
2883
|
-
return;
|
2884
|
-
}
|
2885
|
-
|
2886
|
-
const actualValue = element.style[styleProp];
|
2887
|
-
const calculatedValue = window.getComputedStyle(element)[styleProp];
|
2888
|
-
Manipulator.setDataAttribute(element, styleProp, actualValue);
|
2889
|
-
element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px';
|
2890
|
-
});
|
2891
|
-
}
|
2892
|
-
|
2893
|
-
_resetScrollbar() {
|
2894
|
-
this._resetElementAttributes(SELECTOR_FIXED_CONTENT$1, 'paddingRight');
|
2895
|
-
|
2896
|
-
this._resetElementAttributes(SELECTOR_STICKY_CONTENT$1, 'marginRight');
|
2897
|
-
|
2898
|
-
this._resetElementAttributes('body', 'paddingRight');
|
2899
|
-
}
|
2900
|
-
|
2901
|
-
_resetElementAttributes(selector, styleProp) {
|
2902
|
-
SelectorEngine.find(selector).forEach(element => {
|
2903
|
-
const value = Manipulator.getDataAttribute(element, styleProp);
|
2904
|
-
|
2905
|
-
if (typeof value === 'undefined' && element === document.body) {
|
2906
|
-
element.style[styleProp] = '';
|
2907
|
-
} else {
|
2908
|
-
Manipulator.removeDataAttribute(element, styleProp);
|
2909
|
-
element.style[styleProp] = value;
|
2910
|
-
}
|
2911
|
-
});
|
2912
|
-
}
|
2913
|
-
|
2914
|
-
_getScrollbarWidth() {
|
2915
|
-
// thx d.walsh
|
2916
|
-
const scrollDiv = document.createElement('div');
|
2917
|
-
scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
|
2918
|
-
document.body.appendChild(scrollDiv);
|
2919
|
-
const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
|
2920
|
-
document.body.removeChild(scrollDiv);
|
2921
|
-
return scrollbarWidth;
|
2922
3039
|
} // Static
|
2923
3040
|
|
2924
3041
|
|
2925
3042
|
static jQueryInterface(config, relatedTarget) {
|
2926
3043
|
return this.each(function () {
|
2927
|
-
|
2928
|
-
const _config = { ...Default$5,
|
2929
|
-
...Manipulator.getDataAttributes(this),
|
2930
|
-
...(typeof config === 'object' && config ? config : {})
|
2931
|
-
};
|
3044
|
+
const data = Modal.getInstance(this) || new Modal(this, typeof config === 'object' ? config : {});
|
2932
3045
|
|
2933
|
-
if (
|
2934
|
-
|
3046
|
+
if (typeof config !== 'string') {
|
3047
|
+
return;
|
2935
3048
|
}
|
2936
3049
|
|
2937
|
-
if (typeof config === '
|
2938
|
-
|
2939
|
-
throw new TypeError(`No method named "${config}"`);
|
2940
|
-
}
|
2941
|
-
|
2942
|
-
data[config](relatedTarget);
|
3050
|
+
if (typeof data[config] === 'undefined') {
|
3051
|
+
throw new TypeError(`No method named "${config}"`);
|
2943
3052
|
}
|
3053
|
+
|
3054
|
+
data[config](relatedTarget);
|
2944
3055
|
});
|
2945
3056
|
}
|
2946
3057
|
|
@@ -2955,7 +3066,7 @@
|
|
2955
3066
|
EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {
|
2956
3067
|
const target = getElementFromSelector(this);
|
2957
3068
|
|
2958
|
-
if (
|
3069
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
2959
3070
|
event.preventDefault();
|
2960
3071
|
}
|
2961
3072
|
|
@@ -2971,15 +3082,7 @@
|
|
2971
3082
|
}
|
2972
3083
|
});
|
2973
3084
|
});
|
2974
|
-
|
2975
|
-
|
2976
|
-
if (!data) {
|
2977
|
-
const config = { ...Manipulator.getDataAttributes(target),
|
2978
|
-
...Manipulator.getDataAttributes(this)
|
2979
|
-
};
|
2980
|
-
data = new Modal(target, config);
|
2981
|
-
}
|
2982
|
-
|
3085
|
+
const data = Modal.getInstance(target) || new Modal(target);
|
2983
3086
|
data.toggle(this);
|
2984
3087
|
});
|
2985
3088
|
/**
|
@@ -2993,69 +3096,7 @@
|
|
2993
3096
|
|
2994
3097
|
/**
|
2995
3098
|
* --------------------------------------------------------------------------
|
2996
|
-
* Bootstrap (v5.0.0
|
2997
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
2998
|
-
* --------------------------------------------------------------------------
|
2999
|
-
*/
|
3000
|
-
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed';
|
3001
|
-
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
3002
|
-
|
3003
|
-
const getWidth = () => {
|
3004
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
3005
|
-
const documentWidth = document.documentElement.clientWidth;
|
3006
|
-
return Math.abs(window.innerWidth - documentWidth);
|
3007
|
-
};
|
3008
|
-
|
3009
|
-
const hide = (width = getWidth()) => {
|
3010
|
-
document.body.style.overflow = 'hidden';
|
3011
|
-
|
3012
|
-
_setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width);
|
3013
|
-
|
3014
|
-
_setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width);
|
3015
|
-
|
3016
|
-
_setElementAttributes('body', 'paddingRight', calculatedValue => calculatedValue + width);
|
3017
|
-
};
|
3018
|
-
|
3019
|
-
const _setElementAttributes = (selector, styleProp, callback) => {
|
3020
|
-
const scrollbarWidth = getWidth();
|
3021
|
-
SelectorEngine.find(selector).forEach(element => {
|
3022
|
-
if (element !== document.body && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
3023
|
-
return;
|
3024
|
-
}
|
3025
|
-
|
3026
|
-
const actualValue = element.style[styleProp];
|
3027
|
-
const calculatedValue = window.getComputedStyle(element)[styleProp];
|
3028
|
-
Manipulator.setDataAttribute(element, styleProp, actualValue);
|
3029
|
-
element.style[styleProp] = callback(Number.parseFloat(calculatedValue)) + 'px';
|
3030
|
-
});
|
3031
|
-
};
|
3032
|
-
|
3033
|
-
const reset = () => {
|
3034
|
-
document.body.style.overflow = 'auto';
|
3035
|
-
|
3036
|
-
_resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight');
|
3037
|
-
|
3038
|
-
_resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight');
|
3039
|
-
|
3040
|
-
_resetElementAttributes('body', 'paddingRight');
|
3041
|
-
};
|
3042
|
-
|
3043
|
-
const _resetElementAttributes = (selector, styleProp) => {
|
3044
|
-
SelectorEngine.find(selector).forEach(element => {
|
3045
|
-
const value = Manipulator.getDataAttribute(element, styleProp);
|
3046
|
-
|
3047
|
-
if (typeof value === 'undefined' && element === document.body) {
|
3048
|
-
element.style.removeProperty(styleProp);
|
3049
|
-
} else {
|
3050
|
-
Manipulator.removeDataAttribute(element, styleProp);
|
3051
|
-
element.style[styleProp] = value;
|
3052
|
-
}
|
3053
|
-
});
|
3054
|
-
};
|
3055
|
-
|
3056
|
-
/**
|
3057
|
-
* --------------------------------------------------------------------------
|
3058
|
-
* Bootstrap (v5.0.0-beta3): offcanvas.js
|
3099
|
+
* Bootstrap (v5.0.0): offcanvas.js
|
3059
3100
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
3060
3101
|
* --------------------------------------------------------------------------
|
3061
3102
|
*/
|
@@ -3081,11 +3122,8 @@
|
|
3081
3122
|
keyboard: 'boolean',
|
3082
3123
|
scroll: 'boolean'
|
3083
3124
|
};
|
3084
|
-
const CLASS_NAME_BACKDROP_BODY = 'offcanvas-backdrop';
|
3085
3125
|
const CLASS_NAME_SHOW$4 = 'show';
|
3086
|
-
const CLASS_NAME_TOGGLING = 'offcanvas-toggling';
|
3087
3126
|
const OPEN_SELECTOR = '.offcanvas.show';
|
3088
|
-
const ACTIVE_SELECTOR = `${OPEN_SELECTOR}, .${CLASS_NAME_TOGGLING}`;
|
3089
3127
|
const EVENT_SHOW$2 = `show${EVENT_KEY$5}`;
|
3090
3128
|
const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`;
|
3091
3129
|
const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`;
|
@@ -3093,6 +3131,7 @@
|
|
3093
3131
|
const EVENT_FOCUSIN = `focusin${EVENT_KEY$5}`;
|
3094
3132
|
const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$5}${DATA_API_KEY$2}`;
|
3095
3133
|
const EVENT_CLICK_DISMISS$1 = `click.dismiss${EVENT_KEY$5}`;
|
3134
|
+
const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$5}`;
|
3096
3135
|
const SELECTOR_DATA_DISMISS$1 = '[data-bs-dismiss="offcanvas"]';
|
3097
3136
|
const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]';
|
3098
3137
|
/**
|
@@ -3106,6 +3145,7 @@
|
|
3106
3145
|
super(element);
|
3107
3146
|
this._config = this._getConfig(config);
|
3108
3147
|
this._isShown = false;
|
3148
|
+
this._backdrop = this._initializeBackDrop();
|
3109
3149
|
|
3110
3150
|
this._addEventListeners();
|
3111
3151
|
} // Getters
|
@@ -3140,15 +3180,13 @@
|
|
3140
3180
|
this._isShown = true;
|
3141
3181
|
this._element.style.visibility = 'visible';
|
3142
3182
|
|
3143
|
-
|
3144
|
-
document.body.classList.add(CLASS_NAME_BACKDROP_BODY);
|
3145
|
-
}
|
3183
|
+
this._backdrop.show();
|
3146
3184
|
|
3147
3185
|
if (!this._config.scroll) {
|
3148
3186
|
hide();
|
3149
|
-
}
|
3150
3187
|
|
3151
|
-
|
3188
|
+
this._enforceFocusOnElement(this._element);
|
3189
|
+
}
|
3152
3190
|
|
3153
3191
|
this._element.removeAttribute('aria-hidden');
|
3154
3192
|
|
@@ -3159,16 +3197,14 @@
|
|
3159
3197
|
this._element.classList.add(CLASS_NAME_SHOW$4);
|
3160
3198
|
|
3161
3199
|
const completeCallBack = () => {
|
3162
|
-
this._element.classList.remove(CLASS_NAME_TOGGLING);
|
3163
|
-
|
3164
3200
|
EventHandler.trigger(this._element, EVENT_SHOWN$2, {
|
3165
3201
|
relatedTarget
|
3166
3202
|
});
|
3167
|
-
|
3168
|
-
this._enforceFocusOnElement(this._element);
|
3169
3203
|
};
|
3170
3204
|
|
3171
|
-
|
3205
|
+
const transitionDuration = getTransitionDurationFromElement(this._element);
|
3206
|
+
EventHandler.one(this._element, 'transitionend', completeCallBack);
|
3207
|
+
emulateTransitionEnd(this._element, transitionDuration);
|
3172
3208
|
}
|
3173
3209
|
|
3174
3210
|
hide() {
|
@@ -3182,8 +3218,6 @@
|
|
3182
3218
|
return;
|
3183
3219
|
}
|
3184
3220
|
|
3185
|
-
this._element.classList.add(CLASS_NAME_TOGGLING);
|
3186
|
-
|
3187
3221
|
EventHandler.off(document, EVENT_FOCUSIN);
|
3188
3222
|
|
3189
3223
|
this._element.blur();
|
@@ -3192,6 +3226,8 @@
|
|
3192
3226
|
|
3193
3227
|
this._element.classList.remove(CLASS_NAME_SHOW$4);
|
3194
3228
|
|
3229
|
+
this._backdrop.hide();
|
3230
|
+
|
3195
3231
|
const completeCallback = () => {
|
3196
3232
|
this._element.setAttribute('aria-hidden', true);
|
3197
3233
|
|
@@ -3201,20 +3237,25 @@
|
|
3201
3237
|
|
3202
3238
|
this._element.style.visibility = 'hidden';
|
3203
3239
|
|
3204
|
-
if (this._config.backdrop) {
|
3205
|
-
document.body.classList.remove(CLASS_NAME_BACKDROP_BODY);
|
3206
|
-
}
|
3207
|
-
|
3208
3240
|
if (!this._config.scroll) {
|
3209
3241
|
reset();
|
3210
3242
|
}
|
3211
3243
|
|
3212
3244
|
EventHandler.trigger(this._element, EVENT_HIDDEN$2);
|
3213
|
-
|
3214
|
-
this._element.classList.remove(CLASS_NAME_TOGGLING);
|
3215
3245
|
};
|
3216
3246
|
|
3217
|
-
|
3247
|
+
const transitionDuration = getTransitionDurationFromElement(this._element);
|
3248
|
+
EventHandler.one(this._element, 'transitionend', completeCallback);
|
3249
|
+
emulateTransitionEnd(this._element, transitionDuration);
|
3250
|
+
}
|
3251
|
+
|
3252
|
+
dispose() {
|
3253
|
+
this._backdrop.dispose();
|
3254
|
+
|
3255
|
+
super.dispose();
|
3256
|
+
EventHandler.off(document, EVENT_FOCUSIN);
|
3257
|
+
this._config = null;
|
3258
|
+
this._backdrop = null;
|
3218
3259
|
} // Private
|
3219
3260
|
|
3220
3261
|
|
@@ -3227,6 +3268,15 @@
|
|
3227
3268
|
return config;
|
3228
3269
|
}
|
3229
3270
|
|
3271
|
+
_initializeBackDrop() {
|
3272
|
+
return new Backdrop({
|
3273
|
+
isVisible: this._config.backdrop,
|
3274
|
+
isAnimated: true,
|
3275
|
+
rootElement: this._element.parentNode,
|
3276
|
+
clickCallback: () => this.hide()
|
3277
|
+
});
|
3278
|
+
}
|
3279
|
+
|
3230
3280
|
_enforceFocusOnElement(element) {
|
3231
3281
|
EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
|
3232
3282
|
|
@@ -3240,18 +3290,11 @@
|
|
3240
3290
|
|
3241
3291
|
_addEventListeners() {
|
3242
3292
|
EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, () => this.hide());
|
3243
|
-
EventHandler.on(
|
3293
|
+
EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {
|
3244
3294
|
if (this._config.keyboard && event.key === ESCAPE_KEY) {
|
3245
3295
|
this.hide();
|
3246
3296
|
}
|
3247
3297
|
});
|
3248
|
-
EventHandler.on(document, EVENT_CLICK_DATA_API$1, event => {
|
3249
|
-
const target = SelectorEngine.findOne(getSelectorFromElement(event.target));
|
3250
|
-
|
3251
|
-
if (!this._element.contains(event.target) && target !== this._element) {
|
3252
|
-
this.hide();
|
3253
|
-
}
|
3254
|
-
});
|
3255
3298
|
} // Static
|
3256
3299
|
|
3257
3300
|
|
@@ -3297,10 +3340,10 @@
|
|
3297
3340
|
}
|
3298
3341
|
}); // avoid conflict when clicking a toggler of an offcanvas, while another is open
|
3299
3342
|
|
3300
|
-
const allReadyOpen = SelectorEngine.findOne(
|
3343
|
+
const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR);
|
3301
3344
|
|
3302
3345
|
if (allReadyOpen && allReadyOpen !== target) {
|
3303
|
-
|
3346
|
+
Offcanvas.getInstance(allReadyOpen).hide();
|
3304
3347
|
}
|
3305
3348
|
|
3306
3349
|
const data = Data.get(target, DATA_KEY$5) || new Offcanvas(target);
|
@@ -3319,7 +3362,7 @@
|
|
3319
3362
|
|
3320
3363
|
/**
|
3321
3364
|
* --------------------------------------------------------------------------
|
3322
|
-
* Bootstrap (v5.0.0
|
3365
|
+
* Bootstrap (v5.0.0): util/sanitizer.js
|
3323
3366
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
3324
3367
|
* --------------------------------------------------------------------------
|
3325
3368
|
*/
|
@@ -3432,7 +3475,7 @@
|
|
3432
3475
|
|
3433
3476
|
/**
|
3434
3477
|
* --------------------------------------------------------------------------
|
3435
|
-
* Bootstrap (v5.0.0
|
3478
|
+
* Bootstrap (v5.0.0): tooltip.js
|
3436
3479
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
3437
3480
|
* --------------------------------------------------------------------------
|
3438
3481
|
*/
|
@@ -3607,7 +3650,6 @@
|
|
3607
3650
|
|
3608
3651
|
dispose() {
|
3609
3652
|
clearTimeout(this._timeout);
|
3610
|
-
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
3611
3653
|
EventHandler.off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler);
|
3612
3654
|
|
3613
3655
|
if (this.tip && this.tip.parentNode) {
|
@@ -3692,7 +3734,7 @@
|
|
3692
3734
|
|
3693
3735
|
if ('ontouchstart' in document.documentElement) {
|
3694
3736
|
[].concat(...document.body.children).forEach(element => {
|
3695
|
-
EventHandler.on(element, 'mouseover', noop
|
3737
|
+
EventHandler.on(element, 'mouseover', noop);
|
3696
3738
|
});
|
3697
3739
|
}
|
3698
3740
|
|
@@ -3891,7 +3933,6 @@
|
|
3891
3933
|
modifiers: [{
|
3892
3934
|
name: 'flip',
|
3893
3935
|
options: {
|
3894
|
-
altBoundary: true,
|
3895
3936
|
fallbackPlacements: this.config.fallbackPlacements
|
3896
3937
|
}
|
3897
3938
|
}, {
|
@@ -4174,7 +4215,7 @@
|
|
4174
4215
|
|
4175
4216
|
/**
|
4176
4217
|
* --------------------------------------------------------------------------
|
4177
|
-
* Bootstrap (v5.0.0
|
4218
|
+
* Bootstrap (v5.0.0): popover.js
|
4178
4219
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4179
4220
|
* --------------------------------------------------------------------------
|
4180
4221
|
*/
|
@@ -4324,7 +4365,7 @@
|
|
4324
4365
|
|
4325
4366
|
/**
|
4326
4367
|
* --------------------------------------------------------------------------
|
4327
|
-
* Bootstrap (v5.0.0
|
4368
|
+
* Bootstrap (v5.0.0): scrollspy.js
|
4328
4369
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4329
4370
|
* --------------------------------------------------------------------------
|
4330
4371
|
*/
|
@@ -4437,6 +4478,7 @@
|
|
4437
4478
|
|
4438
4479
|
_getConfig(config) {
|
4439
4480
|
config = { ...Default$1,
|
4481
|
+
...Manipulator.getDataAttributes(this._element),
|
4440
4482
|
...(typeof config === 'object' && config ? config : {})
|
4441
4483
|
};
|
4442
4484
|
|
@@ -4545,21 +4587,17 @@
|
|
4545
4587
|
|
4546
4588
|
static jQueryInterface(config) {
|
4547
4589
|
return this.each(function () {
|
4548
|
-
|
4549
|
-
|
4550
|
-
const _config = typeof config === 'object' && config;
|
4590
|
+
const data = ScrollSpy.getInstance(this) || new ScrollSpy(this, typeof config === 'object' ? config : {});
|
4551
4591
|
|
4552
|
-
if (
|
4553
|
-
|
4592
|
+
if (typeof config !== 'string') {
|
4593
|
+
return;
|
4554
4594
|
}
|
4555
4595
|
|
4556
|
-
if (typeof config === '
|
4557
|
-
|
4558
|
-
throw new TypeError(`No method named "${config}"`);
|
4559
|
-
}
|
4560
|
-
|
4561
|
-
data[config]();
|
4596
|
+
if (typeof data[config] === 'undefined') {
|
4597
|
+
throw new TypeError(`No method named "${config}"`);
|
4562
4598
|
}
|
4599
|
+
|
4600
|
+
data[config]();
|
4563
4601
|
});
|
4564
4602
|
}
|
4565
4603
|
|
@@ -4572,7 +4610,7 @@
|
|
4572
4610
|
|
4573
4611
|
|
4574
4612
|
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
4575
|
-
SelectorEngine.find(SELECTOR_DATA_SPY).forEach(spy => new ScrollSpy(spy
|
4613
|
+
SelectorEngine.find(SELECTOR_DATA_SPY).forEach(spy => new ScrollSpy(spy));
|
4576
4614
|
});
|
4577
4615
|
/**
|
4578
4616
|
* ------------------------------------------------------------------------
|
@@ -4585,7 +4623,7 @@
|
|
4585
4623
|
|
4586
4624
|
/**
|
4587
4625
|
* --------------------------------------------------------------------------
|
4588
|
-
* Bootstrap (v5.0.0
|
4626
|
+
* Bootstrap (v5.0.0): tab.js
|
4589
4627
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4590
4628
|
* --------------------------------------------------------------------------
|
4591
4629
|
*/
|
@@ -4629,7 +4667,7 @@
|
|
4629
4667
|
|
4630
4668
|
|
4631
4669
|
show() {
|
4632
|
-
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)
|
4670
|
+
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
|
4633
4671
|
return;
|
4634
4672
|
}
|
4635
4673
|
|
@@ -4717,11 +4755,17 @@
|
|
4717
4755
|
element.classList.add(CLASS_NAME_SHOW$1);
|
4718
4756
|
}
|
4719
4757
|
|
4720
|
-
|
4758
|
+
let parent = element.parentNode;
|
4759
|
+
|
4760
|
+
if (parent && parent.nodeName === 'LI') {
|
4761
|
+
parent = parent.parentNode;
|
4762
|
+
}
|
4763
|
+
|
4764
|
+
if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
|
4721
4765
|
const dropdownElement = element.closest(SELECTOR_DROPDOWN);
|
4722
4766
|
|
4723
4767
|
if (dropdownElement) {
|
4724
|
-
SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));
|
4768
|
+
SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement).forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));
|
4725
4769
|
}
|
4726
4770
|
|
4727
4771
|
element.setAttribute('aria-expanded', true);
|
@@ -4756,7 +4800,14 @@
|
|
4756
4800
|
|
4757
4801
|
|
4758
4802
|
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
4759
|
-
|
4803
|
+
if (['A', 'AREA'].includes(this.tagName)) {
|
4804
|
+
event.preventDefault();
|
4805
|
+
}
|
4806
|
+
|
4807
|
+
if (isDisabled(this)) {
|
4808
|
+
return;
|
4809
|
+
}
|
4810
|
+
|
4760
4811
|
const data = Data.get(this, DATA_KEY$1) || new Tab(this);
|
4761
4812
|
data.show();
|
4762
4813
|
});
|
@@ -4771,7 +4822,7 @@
|
|
4771
4822
|
|
4772
4823
|
/**
|
4773
4824
|
* --------------------------------------------------------------------------
|
4774
|
-
* Bootstrap (v5.0.0
|
4825
|
+
* Bootstrap (v5.0.0): toast.js
|
4775
4826
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4776
4827
|
* --------------------------------------------------------------------------
|
4777
4828
|
*/
|
@@ -4910,7 +4961,6 @@
|
|
4910
4961
|
this._element.classList.remove(CLASS_NAME_SHOW);
|
4911
4962
|
}
|
4912
4963
|
|
4913
|
-
EventHandler.off(this._element, EVENT_CLICK_DISMISS);
|
4914
4964
|
super.dispose();
|
4915
4965
|
this._config = null;
|
4916
4966
|
} // Private
|
@@ -4968,7 +5018,7 @@
|
|
4968
5018
|
|
4969
5019
|
/**
|
4970
5020
|
* --------------------------------------------------------------------------
|
4971
|
-
* Bootstrap (v5.0.0
|
5021
|
+
* Bootstrap (v5.0.0): index.umd.js
|
4972
5022
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
4973
5023
|
* --------------------------------------------------------------------------
|
4974
5024
|
*/
|