@coreui/coreui 4.2.6 → 4.3.0-alpha.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.
- package/LICENSE +5 -6
- package/README.md +2 -2
- package/dist/css/coreui-grid.css +36 -83
- package/dist/css/coreui-grid.css.map +1 -1
- package/dist/css/coreui-grid.min.css +4 -6
- package/dist/css/coreui-grid.min.css.map +1 -1
- package/dist/css/coreui-grid.rtl.css +40 -89
- package/dist/css/coreui-grid.rtl.css.map +1 -1
- package/dist/css/coreui-grid.rtl.min.css +8 -12
- package/dist/css/coreui-grid.rtl.min.css.map +1 -1
- package/dist/css/coreui-reboot.css +176 -48
- package/dist/css/coreui-reboot.css.map +1 -1
- package/dist/css/coreui-reboot.min.css +4 -6
- package/dist/css/coreui-reboot.min.css.map +1 -1
- package/dist/css/coreui-reboot.rtl.css +180 -54
- package/dist/css/coreui-reboot.rtl.css.map +1 -1
- package/dist/css/coreui-reboot.rtl.min.css +8 -12
- package/dist/css/coreui-reboot.rtl.min.css.map +1 -1
- package/dist/css/coreui-utilities.css +1328 -95
- package/dist/css/coreui-utilities.css.map +1 -1
- package/dist/css/coreui-utilities.min.css +4 -6
- package/dist/css/coreui-utilities.min.css.map +1 -1
- package/dist/css/coreui-utilities.rtl.css +1237 -101
- package/dist/css/coreui-utilities.rtl.css.map +1 -1
- package/dist/css/coreui-utilities.rtl.min.css +8 -12
- package/dist/css/coreui-utilities.rtl.min.css.map +1 -1
- package/dist/css/coreui.css +2372 -889
- package/dist/css/coreui.css.map +1 -1
- package/dist/css/coreui.min.css +4 -6
- package/dist/css/coreui.min.css.map +1 -1
- package/dist/css/coreui.rtl.css +2293 -900
- package/dist/css/coreui.rtl.css.map +1 -1
- package/dist/css/coreui.rtl.min.css +8 -12
- package/dist/css/coreui.rtl.min.css.map +1 -1
- package/dist/js/coreui.bundle.js +289 -264
- package/dist/js/coreui.bundle.js.map +1 -1
- package/dist/js/coreui.bundle.min.js +4 -4
- package/dist/js/coreui.bundle.min.js.map +1 -1
- package/dist/js/coreui.esm.js +255 -230
- package/dist/js/coreui.esm.js.map +1 -1
- package/dist/js/coreui.esm.min.js +4 -4
- package/dist/js/coreui.esm.min.js.map +1 -1
- package/dist/js/coreui.js +258 -232
- package/dist/js/coreui.js.map +1 -1
- package/dist/js/coreui.min.js +4 -4
- package/dist/js/coreui.min.js.map +1 -1
- package/js/dist/alert.js +10 -9
- package/js/dist/alert.js.map +1 -1
- package/js/dist/base-component.js +11 -10
- package/js/dist/base-component.js.map +1 -1
- package/js/dist/button.js +10 -9
- package/js/dist/button.js.map +1 -1
- package/js/dist/carousel.js +11 -10
- package/js/dist/carousel.js.map +1 -1
- package/js/dist/collapse.js +10 -9
- package/js/dist/collapse.js.map +1 -1
- package/js/dist/dom/data.js +5 -5
- package/js/dist/dom/data.js.map +1 -1
- package/js/dist/dom/event-handler.js +9 -9
- package/js/dist/dom/event-handler.js.map +1 -1
- package/js/dist/dom/manipulator.js +5 -5
- package/js/dist/dom/manipulator.js.map +1 -1
- package/js/dist/dom/selector-engine.js +6 -5
- package/js/dist/dom/selector-engine.js.map +1 -1
- package/js/dist/dropdown.js +13 -12
- package/js/dist/dropdown.js.map +1 -1
- package/js/dist/modal.js +12 -13
- package/js/dist/modal.js.map +1 -1
- package/js/dist/navigation.js +10 -9
- package/js/dist/navigation.js.map +1 -1
- package/js/dist/offcanvas.js +13 -12
- package/js/dist/offcanvas.js.map +1 -1
- package/js/dist/popover.js +10 -9
- package/js/dist/popover.js.map +1 -1
- package/js/dist/scrollspy.js +14 -13
- package/js/dist/scrollspy.js.map +1 -1
- package/js/dist/sidebar.js +10 -9
- package/js/dist/sidebar.js.map +1 -1
- package/js/dist/tab.js +13 -12
- package/js/dist/tab.js.map +1 -1
- package/js/dist/toast.js +10 -9
- package/js/dist/toast.js.map +1 -1
- package/js/dist/tooltip.js +14 -13
- package/js/dist/tooltip.js.map +1 -1
- package/js/dist/util/backdrop.js +10 -9
- package/js/dist/util/backdrop.js.map +1 -1
- package/js/dist/util/component-functions.js +10 -9
- package/js/dist/util/component-functions.js.map +1 -1
- package/js/dist/util/config.js +10 -9
- package/js/dist/util/config.js.map +1 -1
- package/js/dist/util/focustrap.js +6 -5
- package/js/dist/util/focustrap.js.map +1 -1
- package/js/dist/util/index.js +5 -5
- package/js/dist/util/index.js.map +1 -1
- package/js/dist/util/sanitizer.js +10 -6
- package/js/dist/util/sanitizer.js.map +1 -1
- package/js/dist/util/scrollbar.js +10 -9
- package/js/dist/util/scrollbar.js.map +1 -1
- package/js/dist/util/swipe.js +10 -9
- package/js/dist/util/swipe.js.map +1 -1
- package/js/dist/util/template-factory.js +10 -9
- package/js/dist/util/template-factory.js.map +1 -1
- package/js/index.esm.js +21 -0
- package/js/index.umd.js +38 -0
- package/js/src/alert.js +4 -4
- package/js/src/base-component.js +4 -4
- package/js/src/button.js +4 -4
- package/js/src/carousel.js +7 -7
- package/js/src/collapse.js +5 -5
- package/js/src/dom/data.js +2 -2
- package/js/src/dom/event-handler.js +4 -5
- package/js/src/dom/manipulator.js +2 -2
- package/js/src/dom/selector-engine.js +2 -2
- package/js/src/dropdown.js +9 -9
- package/js/src/modal.js +9 -10
- package/js/src/navigation.js +4 -4
- package/js/src/offcanvas.js +11 -11
- package/js/src/popover.js +3 -3
- package/js/src/scrollspy.js +6 -6
- package/js/src/sidebar.js +5 -5
- package/js/src/tab.js +7 -7
- package/js/src/toast.js +4 -4
- package/js/src/tooltip.js +9 -9
- package/js/src/util/backdrop.js +3 -3
- package/js/src/util/component-functions.js +3 -3
- package/js/src/util/config.js +3 -3
- package/js/src/util/focustrap.js +2 -2
- package/js/src/util/index.js +2 -2
- package/js/src/util/sanitizer.js +6 -4
- package/js/src/util/scrollbar.js +3 -3
- package/js/src/util/swipe.js +3 -3
- package/js/src/util/template-factory.js +4 -4
- package/package.json +54 -44
- package/scss/_accordion.scss +9 -1
- package/scss/_alert.scss +6 -10
- package/scss/_badge.scss +2 -1
- package/scss/_button-group.scss +4 -4
- package/scss/_buttons.scss +23 -1
- package/scss/_card.scss +8 -3
- package/scss/_carousel.scss +24 -8
- package/scss/_close.scss +32 -9
- package/scss/_dropdown.scss +3 -3
- package/scss/_functions.scss +6 -22
- package/scss/_grid.scss +8 -0
- package/scss/_helpers.scss +2 -0
- package/scss/_list-group.scss +11 -2
- package/scss/_maps.scss +125 -0
- package/scss/_mixins.scss +1 -4
- package/scss/_nav.scss +7 -0
- package/scss/_navbar.scss +16 -3
- package/scss/_offcanvas.scss +4 -2
- package/scss/_pagination.scss +1 -1
- package/scss/_progress.scss +10 -1
- package/scss/_reboot.scss +2 -3
- package/scss/_root.scss +144 -16
- package/scss/_tables.scss +18 -15
- package/scss/_tooltip.scss +5 -6
- package/scss/_type.scss +3 -1
- package/scss/_utilities.scss +182 -23
- package/scss/_variables-dark.scss +169 -0
- package/scss/_variables.scss +354 -337
- package/scss/coreui-grid.rtl.scss +2 -7
- package/scss/coreui-grid.scss +3 -10
- package/scss/coreui-reboot.rtl.scss +2 -7
- package/scss/coreui-reboot.scss +4 -7
- package/scss/coreui-utilities.rtl.scss +2 -7
- package/scss/coreui-utilities.scss +3 -7
- package/scss/coreui.rtl.scss +2 -7
- package/scss/coreui.scss +3 -7
- package/scss/forms/_floating-labels.scss +23 -4
- package/scss/forms/_form-check.scss +22 -24
- package/scss/forms/_form-control.scss +33 -13
- package/scss/forms/_form-range.scss +8 -8
- package/scss/forms/_form-select.scss +19 -10
- package/scss/forms/_form-text.scss +1 -1
- package/scss/forms/_input-group.scss +1 -1
- package/scss/forms/_labels.scss +2 -2
- package/scss/helpers/_color-bg.scss +12 -2
- package/scss/helpers/_colored-links.scss +20 -2
- package/scss/helpers/_focus-ring.scss +5 -0
- package/scss/helpers/_icon-link.scss +25 -0
- package/scss/mixins/_alert.scss +4 -1
- package/scss/mixins/_banner.scss +7 -0
- package/scss/mixins/_breakpoints.scss +0 -13
- package/scss/mixins/_caret.scss +31 -26
- package/scss/mixins/_color-mode.scss +21 -0
- package/scss/mixins/_forms.scss +8 -7
- package/scss/mixins/_grid.scss +1 -1
- package/scss/mixins/_list-group.scss +3 -0
- package/scss/mixins/_utilities.scss +35 -15
- package/scss/mixins/_visually-hidden.scss +5 -1
- package/scss/sidebar/_sidebar.scss +10 -2
- package/scss/vendor/_rfs.scss +24 -30
- package/scss/mixins/_css-vars.scss +0 -87
package/dist/js/coreui.esm.js
CHANGED
|
@@ -1,14 +1,65 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* CoreUI
|
|
3
|
-
* Copyright
|
|
4
|
-
* Licensed under MIT (https://coreui
|
|
2
|
+
* CoreUI v4.3.0-alpha.0 (https://coreui.io)
|
|
3
|
+
* Copyright 2023 The CoreUI Team (https://github.com/orgs/coreui/people)
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
6
6
|
import * as Popper from '@popperjs/core';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* --------------------------------------------------------------------------
|
|
10
|
-
* CoreUI
|
|
11
|
-
* Licensed under MIT (https://
|
|
10
|
+
* CoreUI dom/data.js
|
|
11
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
12
|
+
*
|
|
13
|
+
* This is a modified version of the Bootstrap's dom/data.js
|
|
14
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
15
|
+
* --------------------------------------------------------------------------
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Constants
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const elementMap = new Map();
|
|
23
|
+
const Data = {
|
|
24
|
+
set(element, key, instance) {
|
|
25
|
+
if (!elementMap.has(element)) {
|
|
26
|
+
elementMap.set(element, new Map());
|
|
27
|
+
}
|
|
28
|
+
const instanceMap = elementMap.get(element);
|
|
29
|
+
|
|
30
|
+
// make it clear we only want one instance per element
|
|
31
|
+
// can be removed later when multiple key/instances are fine to be used
|
|
32
|
+
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
instanceMap.set(key, instance);
|
|
38
|
+
},
|
|
39
|
+
get(element, key) {
|
|
40
|
+
if (elementMap.has(element)) {
|
|
41
|
+
return elementMap.get(element).get(key) || null;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
},
|
|
45
|
+
remove(element, key) {
|
|
46
|
+
if (!elementMap.has(element)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const instanceMap = elementMap.get(element);
|
|
50
|
+
instanceMap.delete(key);
|
|
51
|
+
|
|
52
|
+
// free up element references if there are no instances left for an element
|
|
53
|
+
if (instanceMap.size === 0) {
|
|
54
|
+
elementMap.delete(element);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* --------------------------------------------------------------------------
|
|
61
|
+
* CoreUI util/index.js
|
|
62
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
12
63
|
*
|
|
13
64
|
* This is a modified version of the Bootstrap's util/index.js
|
|
14
65
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -257,14 +308,15 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
|
|
|
257
308
|
|
|
258
309
|
/**
|
|
259
310
|
* --------------------------------------------------------------------------
|
|
260
|
-
* CoreUI
|
|
261
|
-
* Licensed under MIT (https://
|
|
311
|
+
* CoreUI dom/event-handler.js
|
|
312
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
262
313
|
*
|
|
263
314
|
* This is a modified version of the Bootstrap's dom/event-handler.js
|
|
264
315
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
265
316
|
* --------------------------------------------------------------------------
|
|
266
317
|
*/
|
|
267
318
|
|
|
319
|
+
|
|
268
320
|
/**
|
|
269
321
|
* Constants
|
|
270
322
|
*/
|
|
@@ -330,7 +382,7 @@ function findHandler(events, callable, delegationSelector = null) {
|
|
|
330
382
|
}
|
|
331
383
|
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
|
332
384
|
const isDelegated = typeof handler === 'string';
|
|
333
|
-
//
|
|
385
|
+
// TODO: tooltip passes `false` instead of selector, so we need to check
|
|
334
386
|
const callable = isDelegated ? delegationFunction : handler || delegationFunction;
|
|
335
387
|
let typeEvent = getTypeEvent(originalTypeEvent);
|
|
336
388
|
if (!nativeEvents.has(typeEvent)) {
|
|
@@ -447,11 +499,10 @@ const EventHandler = {
|
|
|
447
499
|
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
|
|
448
500
|
defaultPrevented = jQueryEvent.isDefaultPrevented();
|
|
449
501
|
}
|
|
450
|
-
|
|
502
|
+
const evt = hydrateObj(new Event(event, {
|
|
451
503
|
bubbles,
|
|
452
504
|
cancelable: true
|
|
453
|
-
});
|
|
454
|
-
evt = hydrateObj(evt, args);
|
|
505
|
+
}), args);
|
|
455
506
|
if (defaultPrevented) {
|
|
456
507
|
evt.preventDefault();
|
|
457
508
|
}
|
|
@@ -482,59 +533,8 @@ function hydrateObj(obj, meta = {}) {
|
|
|
482
533
|
|
|
483
534
|
/**
|
|
484
535
|
* --------------------------------------------------------------------------
|
|
485
|
-
* CoreUI
|
|
486
|
-
* Licensed under MIT (https://
|
|
487
|
-
*
|
|
488
|
-
* This is a modified version of the Bootstrap's dom/data.js
|
|
489
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
490
|
-
* --------------------------------------------------------------------------
|
|
491
|
-
*/
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Constants
|
|
495
|
-
*/
|
|
496
|
-
|
|
497
|
-
const elementMap = new Map();
|
|
498
|
-
const Data = {
|
|
499
|
-
set(element, key, instance) {
|
|
500
|
-
if (!elementMap.has(element)) {
|
|
501
|
-
elementMap.set(element, new Map());
|
|
502
|
-
}
|
|
503
|
-
const instanceMap = elementMap.get(element);
|
|
504
|
-
|
|
505
|
-
// make it clear we only want one instance per element
|
|
506
|
-
// can be removed later when multiple key/instances are fine to be used
|
|
507
|
-
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
|
508
|
-
// eslint-disable-next-line no-console
|
|
509
|
-
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
instanceMap.set(key, instance);
|
|
513
|
-
},
|
|
514
|
-
get(element, key) {
|
|
515
|
-
if (elementMap.has(element)) {
|
|
516
|
-
return elementMap.get(element).get(key) || null;
|
|
517
|
-
}
|
|
518
|
-
return null;
|
|
519
|
-
},
|
|
520
|
-
remove(element, key) {
|
|
521
|
-
if (!elementMap.has(element)) {
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
const instanceMap = elementMap.get(element);
|
|
525
|
-
instanceMap.delete(key);
|
|
526
|
-
|
|
527
|
-
// free up element references if there are no instances left for an element
|
|
528
|
-
if (instanceMap.size === 0) {
|
|
529
|
-
elementMap.delete(element);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* --------------------------------------------------------------------------
|
|
536
|
-
* CoreUI (v4.2.6): dom/selector-engine.js
|
|
537
|
-
* Licensed under MIT (https://coreui.io/license)
|
|
536
|
+
* CoreUI dom/manipulator.js
|
|
537
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
538
538
|
*
|
|
539
539
|
* This is a modified version of the Bootstrap's dom/manipulator.js
|
|
540
540
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -593,14 +593,15 @@ const Manipulator = {
|
|
|
593
593
|
|
|
594
594
|
/**
|
|
595
595
|
* --------------------------------------------------------------------------
|
|
596
|
-
* CoreUI
|
|
597
|
-
* Licensed under MIT (https://
|
|
596
|
+
* CoreUI util/config.js
|
|
597
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
598
598
|
*
|
|
599
599
|
* This is a modified version of the Bootstrap's util/config.js
|
|
600
600
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
601
601
|
* --------------------------------------------------------------------------
|
|
602
602
|
*/
|
|
603
603
|
|
|
604
|
+
|
|
604
605
|
/**
|
|
605
606
|
* Class definition
|
|
606
607
|
*/
|
|
@@ -648,19 +649,20 @@ class Config {
|
|
|
648
649
|
|
|
649
650
|
/**
|
|
650
651
|
* --------------------------------------------------------------------------
|
|
651
|
-
* CoreUI
|
|
652
|
-
* Licensed under MIT (https://
|
|
652
|
+
* CoreUI base-component.js
|
|
653
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
653
654
|
*
|
|
654
655
|
* This component is a modified version of the Bootstrap's base-component.js
|
|
655
656
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
656
657
|
* --------------------------------------------------------------------------
|
|
657
658
|
*/
|
|
658
659
|
|
|
660
|
+
|
|
659
661
|
/**
|
|
660
662
|
* Constants
|
|
661
663
|
*/
|
|
662
664
|
|
|
663
|
-
const VERSION = '4.
|
|
665
|
+
const VERSION = '4.3.0-alpha.0';
|
|
664
666
|
|
|
665
667
|
/**
|
|
666
668
|
* Class definition
|
|
@@ -719,13 +721,14 @@ class BaseComponent extends Config {
|
|
|
719
721
|
|
|
720
722
|
/**
|
|
721
723
|
* --------------------------------------------------------------------------
|
|
722
|
-
* CoreUI
|
|
723
|
-
* Licensed under MIT (https://
|
|
724
|
+
* CoreUI dom/selector-engine.js
|
|
725
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
724
726
|
*
|
|
725
727
|
* This is a modified version of the Bootstrap's dom/selector-engine.js
|
|
726
728
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
727
729
|
* --------------------------------------------------------------------------
|
|
728
730
|
*/
|
|
731
|
+
|
|
729
732
|
const getSelector = element => {
|
|
730
733
|
let selector = element.getAttribute('data-coreui-target');
|
|
731
734
|
if (!selector || selector === '#') {
|
|
@@ -810,13 +813,14 @@ const SelectorEngine = {
|
|
|
810
813
|
|
|
811
814
|
/**
|
|
812
815
|
* --------------------------------------------------------------------------
|
|
813
|
-
* CoreUI
|
|
814
|
-
* Licensed under MIT (https://
|
|
816
|
+
* CoreUI util/component-functions.js
|
|
817
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
815
818
|
*
|
|
816
819
|
* This is a modified version of the Bootstrap's util/component-functions.js
|
|
817
820
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
818
821
|
* --------------------------------------------------------------------------
|
|
819
822
|
*/
|
|
823
|
+
|
|
820
824
|
const enableDismissTrigger = (component, method = 'hide') => {
|
|
821
825
|
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
|
|
822
826
|
const name = component.NAME;
|
|
@@ -837,14 +841,15 @@ const enableDismissTrigger = (component, method = 'hide') => {
|
|
|
837
841
|
|
|
838
842
|
/**
|
|
839
843
|
* --------------------------------------------------------------------------
|
|
840
|
-
* CoreUI
|
|
841
|
-
* Licensed under MIT (https://
|
|
844
|
+
* CoreUI alert.js
|
|
845
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
842
846
|
*
|
|
843
847
|
* This component is a modified version of the Bootstrap's alert.js
|
|
844
848
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
845
849
|
* --------------------------------------------------------------------------
|
|
846
850
|
*/
|
|
847
851
|
|
|
852
|
+
|
|
848
853
|
/**
|
|
849
854
|
* Constants
|
|
850
855
|
*/
|
|
@@ -914,14 +919,15 @@ defineJQueryPlugin(Alert);
|
|
|
914
919
|
|
|
915
920
|
/**
|
|
916
921
|
* --------------------------------------------------------------------------
|
|
917
|
-
* CoreUI
|
|
918
|
-
* Licensed under MIT (https://
|
|
922
|
+
* CoreUI button.js
|
|
923
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
919
924
|
*
|
|
920
925
|
* This component is a modified version of the Bootstrap's button.js
|
|
921
926
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
922
927
|
* --------------------------------------------------------------------------
|
|
923
928
|
*/
|
|
924
929
|
|
|
930
|
+
|
|
925
931
|
/**
|
|
926
932
|
* Constants
|
|
927
933
|
*/
|
|
@@ -980,14 +986,15 @@ defineJQueryPlugin(Button);
|
|
|
980
986
|
|
|
981
987
|
/**
|
|
982
988
|
* --------------------------------------------------------------------------
|
|
983
|
-
* CoreUI
|
|
984
|
-
* Licensed under MIT (https://
|
|
989
|
+
* CoreUI util/swipe.js
|
|
990
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
985
991
|
*
|
|
986
992
|
* This is a modified version of the Bootstrap's util/swipe.js
|
|
987
993
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
988
994
|
* --------------------------------------------------------------------------
|
|
989
995
|
*/
|
|
990
996
|
|
|
997
|
+
|
|
991
998
|
/**
|
|
992
999
|
* Constants
|
|
993
1000
|
*/
|
|
@@ -1102,14 +1109,15 @@ class Swipe extends Config {
|
|
|
1102
1109
|
|
|
1103
1110
|
/**
|
|
1104
1111
|
* --------------------------------------------------------------------------
|
|
1105
|
-
* CoreUI
|
|
1106
|
-
* Licensed under MIT (https://
|
|
1112
|
+
* CoreUI carousel.js
|
|
1113
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
1107
1114
|
*
|
|
1108
1115
|
* This component is a modified version of the Bootstrap's carousel.js
|
|
1109
1116
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1110
1117
|
* --------------------------------------------------------------------------
|
|
1111
1118
|
*/
|
|
1112
1119
|
|
|
1120
|
+
|
|
1113
1121
|
/**
|
|
1114
1122
|
* Constants
|
|
1115
1123
|
*/
|
|
@@ -1365,7 +1373,7 @@ class Carousel extends BaseComponent {
|
|
|
1365
1373
|
}
|
|
1366
1374
|
if (!activeElement || !nextElement) {
|
|
1367
1375
|
// Some weirdness is happening, so we bail
|
|
1368
|
-
//
|
|
1376
|
+
// TODO: change tests that use empty divs to avoid this check
|
|
1369
1377
|
return;
|
|
1370
1378
|
}
|
|
1371
1379
|
const isCycling = Boolean(this._interval);
|
|
@@ -1477,14 +1485,15 @@ defineJQueryPlugin(Carousel);
|
|
|
1477
1485
|
|
|
1478
1486
|
/**
|
|
1479
1487
|
* --------------------------------------------------------------------------
|
|
1480
|
-
* CoreUI
|
|
1481
|
-
* Licensed under MIT (https://
|
|
1488
|
+
* CoreUI collapse.js
|
|
1489
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
1482
1490
|
*
|
|
1483
1491
|
* This component is a modified version of the Bootstrap's collapse.js
|
|
1484
1492
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1485
1493
|
* --------------------------------------------------------------------------
|
|
1486
1494
|
*/
|
|
1487
1495
|
|
|
1496
|
+
|
|
1488
1497
|
/**
|
|
1489
1498
|
* Constants
|
|
1490
1499
|
*/
|
|
@@ -1713,14 +1722,15 @@ defineJQueryPlugin(Collapse);
|
|
|
1713
1722
|
|
|
1714
1723
|
/**
|
|
1715
1724
|
* --------------------------------------------------------------------------
|
|
1716
|
-
* CoreUI
|
|
1717
|
-
* Licensed under MIT (https://
|
|
1725
|
+
* CoreUI dropdown.js
|
|
1726
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
1718
1727
|
*
|
|
1719
1728
|
* This component is a modified version of the Bootstrap's dropdown.js
|
|
1720
1729
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
1721
1730
|
* --------------------------------------------------------------------------
|
|
1722
1731
|
*/
|
|
1723
1732
|
|
|
1733
|
+
|
|
1724
1734
|
/**
|
|
1725
1735
|
* Constants
|
|
1726
1736
|
*/
|
|
@@ -1788,7 +1798,7 @@ class Dropdown extends BaseComponent {
|
|
|
1788
1798
|
super(element, config);
|
|
1789
1799
|
this._popper = null;
|
|
1790
1800
|
this._parent = this._element.parentNode; // dropdown wrapper
|
|
1791
|
-
//
|
|
1801
|
+
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
|
1792
1802
|
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
|
|
1793
1803
|
this._inNavbar = this._detectNavbar();
|
|
1794
1804
|
}
|
|
@@ -1962,7 +1972,7 @@ class Dropdown extends BaseComponent {
|
|
|
1962
1972
|
|
|
1963
1973
|
// Disable Popper if we have a static display or Dropdown is in Navbar
|
|
1964
1974
|
if (this._inNavbar || this._config.display === 'static') {
|
|
1965
|
-
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); //
|
|
1975
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove
|
|
1966
1976
|
defaultBsPopperConfig.modifiers = [{
|
|
1967
1977
|
name: 'applyStyles',
|
|
1968
1978
|
enabled: false
|
|
@@ -2044,7 +2054,7 @@ class Dropdown extends BaseComponent {
|
|
|
2044
2054
|
}
|
|
2045
2055
|
event.preventDefault();
|
|
2046
2056
|
|
|
2047
|
-
//
|
|
2057
|
+
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
|
2048
2058
|
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$4) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$4)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$4)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$4, event.delegateTarget.parentNode);
|
|
2049
2059
|
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
|
2050
2060
|
if (isUpOrDownEvent) {
|
|
@@ -2083,114 +2093,15 @@ defineJQueryPlugin(Dropdown);
|
|
|
2083
2093
|
|
|
2084
2094
|
/**
|
|
2085
2095
|
* --------------------------------------------------------------------------
|
|
2086
|
-
* CoreUI
|
|
2087
|
-
* Licensed under MIT (https://
|
|
2088
|
-
*
|
|
2089
|
-
* This is a modified version of the Bootstrap's util/scrollBar.js
|
|
2090
|
-
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2091
|
-
* --------------------------------------------------------------------------
|
|
2092
|
-
*/
|
|
2093
|
-
|
|
2094
|
-
/**
|
|
2095
|
-
* Constants
|
|
2096
|
-
*/
|
|
2097
|
-
|
|
2098
|
-
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
|
2099
|
-
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
|
2100
|
-
const PROPERTY_PADDING = 'padding-right';
|
|
2101
|
-
const PROPERTY_MARGIN = 'margin-right';
|
|
2102
|
-
|
|
2103
|
-
/**
|
|
2104
|
-
* Class definition
|
|
2105
|
-
*/
|
|
2106
|
-
|
|
2107
|
-
class ScrollBarHelper {
|
|
2108
|
-
constructor() {
|
|
2109
|
-
this._element = document.body;
|
|
2110
|
-
}
|
|
2111
|
-
|
|
2112
|
-
// Public
|
|
2113
|
-
getWidth() {
|
|
2114
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
|
2115
|
-
const documentWidth = document.documentElement.clientWidth;
|
|
2116
|
-
return Math.abs(window.innerWidth - documentWidth);
|
|
2117
|
-
}
|
|
2118
|
-
hide() {
|
|
2119
|
-
const width = this.getWidth();
|
|
2120
|
-
this._disableOverFlow();
|
|
2121
|
-
// give padding to element to balance the hidden scrollbar width
|
|
2122
|
-
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2123
|
-
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
|
2124
|
-
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2125
|
-
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
|
2126
|
-
}
|
|
2127
|
-
reset() {
|
|
2128
|
-
this._resetElementAttributes(this._element, 'overflow');
|
|
2129
|
-
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
|
2130
|
-
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
|
2131
|
-
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
|
2132
|
-
}
|
|
2133
|
-
isOverflowing() {
|
|
2134
|
-
return this.getWidth() > 0;
|
|
2135
|
-
}
|
|
2136
|
-
|
|
2137
|
-
// Private
|
|
2138
|
-
_disableOverFlow() {
|
|
2139
|
-
this._saveInitialAttribute(this._element, 'overflow');
|
|
2140
|
-
this._element.style.overflow = 'hidden';
|
|
2141
|
-
}
|
|
2142
|
-
_setElementAttributes(selector, styleProperty, callback) {
|
|
2143
|
-
const scrollbarWidth = this.getWidth();
|
|
2144
|
-
const manipulationCallBack = element => {
|
|
2145
|
-
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
|
2146
|
-
return;
|
|
2147
|
-
}
|
|
2148
|
-
this._saveInitialAttribute(element, styleProperty);
|
|
2149
|
-
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
|
2150
|
-
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
|
2151
|
-
};
|
|
2152
|
-
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2153
|
-
}
|
|
2154
|
-
_saveInitialAttribute(element, styleProperty) {
|
|
2155
|
-
const actualValue = element.style.getPropertyValue(styleProperty);
|
|
2156
|
-
if (actualValue) {
|
|
2157
|
-
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
|
2158
|
-
}
|
|
2159
|
-
}
|
|
2160
|
-
_resetElementAttributes(selector, styleProperty) {
|
|
2161
|
-
const manipulationCallBack = element => {
|
|
2162
|
-
const value = Manipulator.getDataAttribute(element, styleProperty);
|
|
2163
|
-
// We only want to remove the property if the value is `null`; the value can also be zero
|
|
2164
|
-
if (value === null) {
|
|
2165
|
-
element.style.removeProperty(styleProperty);
|
|
2166
|
-
return;
|
|
2167
|
-
}
|
|
2168
|
-
Manipulator.removeDataAttribute(element, styleProperty);
|
|
2169
|
-
element.style.setProperty(styleProperty, value);
|
|
2170
|
-
};
|
|
2171
|
-
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2172
|
-
}
|
|
2173
|
-
_applyManipulationCallback(selector, callBack) {
|
|
2174
|
-
if (isElement(selector)) {
|
|
2175
|
-
callBack(selector);
|
|
2176
|
-
return;
|
|
2177
|
-
}
|
|
2178
|
-
for (const sel of SelectorEngine.find(selector, this._element)) {
|
|
2179
|
-
callBack(sel);
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
|
|
2184
|
-
/**
|
|
2185
|
-
* --------------------------------------------------------------------------
|
|
2186
|
-
* CoreUI (v4.2.6): tab.js
|
|
2187
|
-
* Licensed under MIT (https://coreui.io/license)
|
|
2096
|
+
* CoreUI util/backdrop.js
|
|
2097
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
2188
2098
|
*
|
|
2189
2099
|
* This is a modified version of the Bootstrap's util/backdrop.js
|
|
2190
2100
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2191
2101
|
* --------------------------------------------------------------------------
|
|
2192
2102
|
*/
|
|
2193
2103
|
|
|
2104
|
+
|
|
2194
2105
|
/**
|
|
2195
2106
|
* Constants
|
|
2196
2107
|
*/
|
|
@@ -2310,14 +2221,15 @@ class Backdrop extends Config {
|
|
|
2310
2221
|
|
|
2311
2222
|
/**
|
|
2312
2223
|
* --------------------------------------------------------------------------
|
|
2313
|
-
* CoreUI
|
|
2314
|
-
* Licensed under MIT (https://
|
|
2224
|
+
* CoreUI util/focustrap.js
|
|
2225
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
2315
2226
|
*
|
|
2316
2227
|
* This is a modified version of the Bootstrap's util/focustrap.js
|
|
2317
2228
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2318
2229
|
* --------------------------------------------------------------------------
|
|
2319
2230
|
*/
|
|
2320
2231
|
|
|
2232
|
+
|
|
2321
2233
|
/**
|
|
2322
2234
|
* Constants
|
|
2323
2235
|
*/
|
|
@@ -2411,14 +2323,116 @@ class FocusTrap extends Config {
|
|
|
2411
2323
|
|
|
2412
2324
|
/**
|
|
2413
2325
|
* --------------------------------------------------------------------------
|
|
2414
|
-
* CoreUI
|
|
2415
|
-
* Licensed under MIT (https://
|
|
2326
|
+
* CoreUI util/scrollBar.js
|
|
2327
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
2328
|
+
*
|
|
2329
|
+
* This is a modified version of the Bootstrap's util/scrollBar.js
|
|
2330
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2331
|
+
* --------------------------------------------------------------------------
|
|
2332
|
+
*/
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
/**
|
|
2336
|
+
* Constants
|
|
2337
|
+
*/
|
|
2338
|
+
|
|
2339
|
+
const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
|
|
2340
|
+
const SELECTOR_STICKY_CONTENT = '.sticky-top';
|
|
2341
|
+
const PROPERTY_PADDING = 'padding-right';
|
|
2342
|
+
const PROPERTY_MARGIN = 'margin-right';
|
|
2343
|
+
|
|
2344
|
+
/**
|
|
2345
|
+
* Class definition
|
|
2346
|
+
*/
|
|
2347
|
+
|
|
2348
|
+
class ScrollBarHelper {
|
|
2349
|
+
constructor() {
|
|
2350
|
+
this._element = document.body;
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
// Public
|
|
2354
|
+
getWidth() {
|
|
2355
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
|
2356
|
+
const documentWidth = document.documentElement.clientWidth;
|
|
2357
|
+
return Math.abs(window.innerWidth - documentWidth);
|
|
2358
|
+
}
|
|
2359
|
+
hide() {
|
|
2360
|
+
const width = this.getWidth();
|
|
2361
|
+
this._disableOverFlow();
|
|
2362
|
+
// give padding to element to balance the hidden scrollbar width
|
|
2363
|
+
this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2364
|
+
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
|
|
2365
|
+
this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width);
|
|
2366
|
+
this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width);
|
|
2367
|
+
}
|
|
2368
|
+
reset() {
|
|
2369
|
+
this._resetElementAttributes(this._element, 'overflow');
|
|
2370
|
+
this._resetElementAttributes(this._element, PROPERTY_PADDING);
|
|
2371
|
+
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING);
|
|
2372
|
+
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN);
|
|
2373
|
+
}
|
|
2374
|
+
isOverflowing() {
|
|
2375
|
+
return this.getWidth() > 0;
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
// Private
|
|
2379
|
+
_disableOverFlow() {
|
|
2380
|
+
this._saveInitialAttribute(this._element, 'overflow');
|
|
2381
|
+
this._element.style.overflow = 'hidden';
|
|
2382
|
+
}
|
|
2383
|
+
_setElementAttributes(selector, styleProperty, callback) {
|
|
2384
|
+
const scrollbarWidth = this.getWidth();
|
|
2385
|
+
const manipulationCallBack = element => {
|
|
2386
|
+
if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {
|
|
2387
|
+
return;
|
|
2388
|
+
}
|
|
2389
|
+
this._saveInitialAttribute(element, styleProperty);
|
|
2390
|
+
const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty);
|
|
2391
|
+
element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`);
|
|
2392
|
+
};
|
|
2393
|
+
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2394
|
+
}
|
|
2395
|
+
_saveInitialAttribute(element, styleProperty) {
|
|
2396
|
+
const actualValue = element.style.getPropertyValue(styleProperty);
|
|
2397
|
+
if (actualValue) {
|
|
2398
|
+
Manipulator.setDataAttribute(element, styleProperty, actualValue);
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
_resetElementAttributes(selector, styleProperty) {
|
|
2402
|
+
const manipulationCallBack = element => {
|
|
2403
|
+
const value = Manipulator.getDataAttribute(element, styleProperty);
|
|
2404
|
+
// We only want to remove the property if the value is `null`; the value can also be zero
|
|
2405
|
+
if (value === null) {
|
|
2406
|
+
element.style.removeProperty(styleProperty);
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
Manipulator.removeDataAttribute(element, styleProperty);
|
|
2410
|
+
element.style.setProperty(styleProperty, value);
|
|
2411
|
+
};
|
|
2412
|
+
this._applyManipulationCallback(selector, manipulationCallBack);
|
|
2413
|
+
}
|
|
2414
|
+
_applyManipulationCallback(selector, callBack) {
|
|
2415
|
+
if (isElement(selector)) {
|
|
2416
|
+
callBack(selector);
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
for (const sel of SelectorEngine.find(selector, this._element)) {
|
|
2420
|
+
callBack(sel);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
/**
|
|
2426
|
+
* --------------------------------------------------------------------------
|
|
2427
|
+
* CoreUI modal.js
|
|
2428
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
2416
2429
|
*
|
|
2417
2430
|
* This component is a modified version of the Bootstrap's modal.js
|
|
2418
2431
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
2419
2432
|
* --------------------------------------------------------------------------
|
|
2420
2433
|
*/
|
|
2421
2434
|
|
|
2435
|
+
|
|
2422
2436
|
/**
|
|
2423
2437
|
* Constants
|
|
2424
2438
|
*/
|
|
@@ -2520,9 +2534,8 @@ class Modal extends BaseComponent {
|
|
|
2520
2534
|
this._queueCallback(() => this._hideModal(), this._element, this._isAnimated());
|
|
2521
2535
|
}
|
|
2522
2536
|
dispose() {
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
}
|
|
2537
|
+
EventHandler.off(window, EVENT_KEY$6);
|
|
2538
|
+
EventHandler.off(this._dialog, EVENT_KEY$6);
|
|
2526
2539
|
this._backdrop.dispose();
|
|
2527
2540
|
this._focustrap.deactivate();
|
|
2528
2541
|
super.dispose();
|
|
@@ -2577,7 +2590,6 @@ class Modal extends BaseComponent {
|
|
|
2577
2590
|
return;
|
|
2578
2591
|
}
|
|
2579
2592
|
if (this._config.keyboard) {
|
|
2580
|
-
event.preventDefault();
|
|
2581
2593
|
this.hide();
|
|
2582
2594
|
return;
|
|
2583
2595
|
}
|
|
@@ -2720,11 +2732,12 @@ defineJQueryPlugin(Modal);
|
|
|
2720
2732
|
|
|
2721
2733
|
/**
|
|
2722
2734
|
* --------------------------------------------------------------------------
|
|
2723
|
-
* CoreUI
|
|
2724
|
-
* Licensed under MIT (https://
|
|
2735
|
+
* CoreUI navigation.js
|
|
2736
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
2725
2737
|
* --------------------------------------------------------------------------
|
|
2726
2738
|
*/
|
|
2727
2739
|
|
|
2740
|
+
|
|
2728
2741
|
/**
|
|
2729
2742
|
* ------------------------------------------------------------------------
|
|
2730
2743
|
* Constants
|
|
@@ -2974,14 +2987,15 @@ defineJQueryPlugin(Navigation);
|
|
|
2974
2987
|
|
|
2975
2988
|
/**
|
|
2976
2989
|
* --------------------------------------------------------------------------
|
|
2977
|
-
* CoreUI
|
|
2978
|
-
* Licensed under MIT (https://
|
|
2990
|
+
* CoreUI offcanvas.js
|
|
2991
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
2979
2992
|
*
|
|
2980
2993
|
* This component is a modified version of the Bootstrap's offcanvas.js
|
|
2981
2994
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
2982
2995
|
* --------------------------------------------------------------------------
|
|
2983
2996
|
*/
|
|
2984
2997
|
|
|
2998
|
+
|
|
2985
2999
|
/**
|
|
2986
3000
|
* Constants
|
|
2987
3001
|
*/
|
|
@@ -3135,11 +3149,11 @@ class Offcanvas extends BaseComponent {
|
|
|
3135
3149
|
if (event.key !== ESCAPE_KEY) {
|
|
3136
3150
|
return;
|
|
3137
3151
|
}
|
|
3138
|
-
if (
|
|
3139
|
-
|
|
3152
|
+
if (this._config.keyboard) {
|
|
3153
|
+
this.hide();
|
|
3140
3154
|
return;
|
|
3141
3155
|
}
|
|
3142
|
-
this.
|
|
3156
|
+
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
|
|
3143
3157
|
});
|
|
3144
3158
|
}
|
|
3145
3159
|
|
|
@@ -3207,8 +3221,8 @@ defineJQueryPlugin(Offcanvas);
|
|
|
3207
3221
|
|
|
3208
3222
|
/**
|
|
3209
3223
|
* --------------------------------------------------------------------------
|
|
3210
|
-
* CoreUI
|
|
3211
|
-
* Licensed under MIT (https://
|
|
3224
|
+
* CoreUI util/sanitizer.js
|
|
3225
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
3212
3226
|
*
|
|
3213
3227
|
* This is a modified version of the Bootstrap's util/sanitizer.js
|
|
3214
3228
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -3216,7 +3230,6 @@ defineJQueryPlugin(Offcanvas);
|
|
|
3216
3230
|
*/
|
|
3217
3231
|
|
|
3218
3232
|
const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
|
|
3219
|
-
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
3220
3233
|
|
|
3221
3234
|
/**
|
|
3222
3235
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
@@ -3243,6 +3256,9 @@ const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
|
3243
3256
|
// Check if a regular expression validates the attribute.
|
|
3244
3257
|
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName));
|
|
3245
3258
|
};
|
|
3259
|
+
|
|
3260
|
+
// js-docs-start allow-list
|
|
3261
|
+
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
|
|
3246
3262
|
const DefaultAllowlist = {
|
|
3247
3263
|
// Global attributes allowed on any supplied element below.
|
|
3248
3264
|
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
|
@@ -3276,6 +3292,8 @@ const DefaultAllowlist = {
|
|
|
3276
3292
|
u: [],
|
|
3277
3293
|
ul: []
|
|
3278
3294
|
};
|
|
3295
|
+
// js-docs-end allow-list
|
|
3296
|
+
|
|
3279
3297
|
function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
3280
3298
|
if (!unsafeHtml.length) {
|
|
3281
3299
|
return unsafeHtml;
|
|
@@ -3305,14 +3323,15 @@ function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
|
3305
3323
|
|
|
3306
3324
|
/**
|
|
3307
3325
|
* --------------------------------------------------------------------------
|
|
3308
|
-
* CoreUI
|
|
3309
|
-
* Licensed under MIT (https://
|
|
3326
|
+
* CoreUI util/template-factory.js
|
|
3327
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
3310
3328
|
*
|
|
3311
3329
|
* This is a modified version of the Bootstrap's util/template-factory.js
|
|
3312
3330
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3313
3331
|
* --------------------------------------------------------------------------
|
|
3314
3332
|
*/
|
|
3315
3333
|
|
|
3334
|
+
|
|
3316
3335
|
/**
|
|
3317
3336
|
* Constants
|
|
3318
3337
|
*/
|
|
@@ -3443,14 +3462,15 @@ class TemplateFactory extends Config {
|
|
|
3443
3462
|
|
|
3444
3463
|
/**
|
|
3445
3464
|
* --------------------------------------------------------------------------
|
|
3446
|
-
* CoreUI
|
|
3447
|
-
* Licensed under MIT (https://
|
|
3465
|
+
* CoreUI tooltip.js
|
|
3466
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
3448
3467
|
*
|
|
3449
3468
|
* This component is a modified version of the Bootstrap's tooltip.js
|
|
3450
3469
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3451
3470
|
* --------------------------------------------------------------------------
|
|
3452
3471
|
*/
|
|
3453
3472
|
|
|
3473
|
+
|
|
3454
3474
|
/**
|
|
3455
3475
|
* Constants
|
|
3456
3476
|
*/
|
|
@@ -3493,7 +3513,7 @@ const Default$4 = {
|
|
|
3493
3513
|
delay: 0,
|
|
3494
3514
|
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
|
3495
3515
|
html: false,
|
|
3496
|
-
offset: [0,
|
|
3516
|
+
offset: [0, 6],
|
|
3497
3517
|
placement: 'top',
|
|
3498
3518
|
popperConfig: null,
|
|
3499
3519
|
sanitize: true,
|
|
@@ -3606,7 +3626,7 @@ class Tooltip extends BaseComponent {
|
|
|
3606
3626
|
return;
|
|
3607
3627
|
}
|
|
3608
3628
|
|
|
3609
|
-
//
|
|
3629
|
+
// TODO: v6 remove this or make it optional
|
|
3610
3630
|
this._disposePopper();
|
|
3611
3631
|
const tip = this._getTipElement();
|
|
3612
3632
|
this._element.setAttribute('aria-describedby', tip.getAttribute('id'));
|
|
@@ -3692,12 +3712,12 @@ class Tooltip extends BaseComponent {
|
|
|
3692
3712
|
_createTipElement(content) {
|
|
3693
3713
|
const tip = this._getTemplateFactory(content).toHtml();
|
|
3694
3714
|
|
|
3695
|
-
//
|
|
3715
|
+
// TODO: remove this check in v6
|
|
3696
3716
|
if (!tip) {
|
|
3697
3717
|
return null;
|
|
3698
3718
|
}
|
|
3699
3719
|
tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$3);
|
|
3700
|
-
//
|
|
3720
|
+
// TODO: v6 the following can be achieved with CSS only
|
|
3701
3721
|
tip.classList.add(`bs-${this.constructor.NAME}-auto`);
|
|
3702
3722
|
const tipId = getUID(this.constructor.NAME).toString();
|
|
3703
3723
|
tip.setAttribute('id', tipId);
|
|
@@ -3957,14 +3977,15 @@ defineJQueryPlugin(Tooltip);
|
|
|
3957
3977
|
|
|
3958
3978
|
/**
|
|
3959
3979
|
* --------------------------------------------------------------------------
|
|
3960
|
-
* CoreUI
|
|
3961
|
-
* Licensed under MIT (https://
|
|
3980
|
+
* CoreUI popover.js
|
|
3981
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
3962
3982
|
*
|
|
3963
3983
|
* This component is a modified version of the Bootstrap's popover.js
|
|
3964
3984
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
3965
3985
|
* --------------------------------------------------------------------------
|
|
3966
3986
|
*/
|
|
3967
3987
|
|
|
3988
|
+
|
|
3968
3989
|
/**
|
|
3969
3990
|
* Constants
|
|
3970
3991
|
*/
|
|
@@ -4040,14 +4061,15 @@ defineJQueryPlugin(Popover);
|
|
|
4040
4061
|
|
|
4041
4062
|
/**
|
|
4042
4063
|
* --------------------------------------------------------------------------
|
|
4043
|
-
* CoreUI
|
|
4044
|
-
* Licensed under MIT (https://
|
|
4064
|
+
* CoreUI scrollspy.js
|
|
4065
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
4045
4066
|
*
|
|
4046
4067
|
* This component is a modified version of the Bootstrap's scrollspy.js
|
|
4047
4068
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4048
4069
|
* --------------------------------------------------------------------------
|
|
4049
4070
|
*/
|
|
4050
4071
|
|
|
4072
|
+
|
|
4051
4073
|
/**
|
|
4052
4074
|
* Constants
|
|
4053
4075
|
*/
|
|
@@ -4302,11 +4324,12 @@ defineJQueryPlugin(ScrollSpy);
|
|
|
4302
4324
|
|
|
4303
4325
|
/**
|
|
4304
4326
|
* --------------------------------------------------------------------------
|
|
4305
|
-
* CoreUI
|
|
4306
|
-
* Licensed under MIT (https://
|
|
4327
|
+
* CoreUI sidebar.js
|
|
4328
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
4307
4329
|
* --------------------------------------------------------------------------
|
|
4308
4330
|
*/
|
|
4309
4331
|
|
|
4332
|
+
|
|
4310
4333
|
/**
|
|
4311
4334
|
* ------------------------------------------------------------------------
|
|
4312
4335
|
* Constants
|
|
@@ -4582,14 +4605,15 @@ defineJQueryPlugin(Sidebar);
|
|
|
4582
4605
|
|
|
4583
4606
|
/**
|
|
4584
4607
|
* --------------------------------------------------------------------------
|
|
4585
|
-
* CoreUI
|
|
4586
|
-
* Licensed under MIT (https://
|
|
4608
|
+
* CoreUI tab.js
|
|
4609
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
4587
4610
|
*
|
|
4588
4611
|
* This component is a modified version of the Bootstrap's tab.js
|
|
4589
4612
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4590
4613
|
* --------------------------------------------------------------------------
|
|
4591
4614
|
*/
|
|
4592
4615
|
|
|
4616
|
+
|
|
4593
4617
|
/**
|
|
4594
4618
|
* Constants
|
|
4595
4619
|
*/
|
|
@@ -4618,7 +4642,7 @@ const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)';
|
|
|
4618
4642
|
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
|
|
4619
4643
|
const SELECTOR_OUTER = '.nav-item, .list-group-item';
|
|
4620
4644
|
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;
|
|
4621
|
-
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]'; //
|
|
4645
|
+
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]'; // TODO: could only be `tab` in v6
|
|
4622
4646
|
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;
|
|
4623
4647
|
const SELECTOR_DATA_TOGGLE_ACTIVE = `.${CLASS_NAME_ACTIVE}[data-coreui-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-coreui-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-coreui-toggle="list"]`;
|
|
4624
4648
|
|
|
@@ -4632,7 +4656,7 @@ class Tab extends BaseComponent {
|
|
|
4632
4656
|
this._parent = this._element.closest(SELECTOR_TAB_PANEL);
|
|
4633
4657
|
if (!this._parent) {
|
|
4634
4658
|
return;
|
|
4635
|
-
//
|
|
4659
|
+
// TODO: should throw exception in v6
|
|
4636
4660
|
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
|
|
4637
4661
|
}
|
|
4638
4662
|
|
|
@@ -4764,7 +4788,7 @@ class Tab extends BaseComponent {
|
|
|
4764
4788
|
}
|
|
4765
4789
|
this._setAttributeIfNotExists(target, 'role', 'tabpanel');
|
|
4766
4790
|
if (child.id) {
|
|
4767
|
-
this._setAttributeIfNotExists(target, 'aria-labelledby',
|
|
4791
|
+
this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`);
|
|
4768
4792
|
}
|
|
4769
4793
|
}
|
|
4770
4794
|
_toggleDropDown(element, open) {
|
|
@@ -4846,14 +4870,15 @@ defineJQueryPlugin(Tab);
|
|
|
4846
4870
|
|
|
4847
4871
|
/**
|
|
4848
4872
|
* --------------------------------------------------------------------------
|
|
4849
|
-
* CoreUI
|
|
4850
|
-
* Licensed under MIT (https://
|
|
4873
|
+
* CoreUI toast.js
|
|
4874
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
4851
4875
|
*
|
|
4852
4876
|
* This component is a modified version of the Bootstrap's toast.js
|
|
4853
4877
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
4854
4878
|
* --------------------------------------------------------------------------
|
|
4855
4879
|
*/
|
|
4856
4880
|
|
|
4881
|
+
|
|
4857
4882
|
/**
|
|
4858
4883
|
* Constants
|
|
4859
4884
|
*/
|