@coreui/coreui 4.2.5 → 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 +2295 -902
- 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 +17 -4
- 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 +357 -340
- 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/js/src/dropdown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI dropdown.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's dropdown.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import * as Popper from '@popperjs/core'
|
|
12
|
+
import BaseComponent from './base-component.js'
|
|
13
|
+
import EventHandler from './dom/event-handler.js'
|
|
14
|
+
import Manipulator from './dom/manipulator.js'
|
|
15
|
+
import SelectorEngine from './dom/selector-engine.js'
|
|
12
16
|
import {
|
|
13
17
|
defineJQueryPlugin,
|
|
14
18
|
execute,
|
|
@@ -20,10 +24,6 @@ import {
|
|
|
20
24
|
isVisible,
|
|
21
25
|
noop
|
|
22
26
|
} from './util/index.js'
|
|
23
|
-
import EventHandler from './dom/event-handler.js'
|
|
24
|
-
import Manipulator from './dom/manipulator.js'
|
|
25
|
-
import SelectorEngine from './dom/selector-engine.js'
|
|
26
|
-
import BaseComponent from './base-component.js'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Constants
|
|
@@ -99,7 +99,7 @@ class Dropdown extends BaseComponent {
|
|
|
99
99
|
|
|
100
100
|
this._popper = null
|
|
101
101
|
this._parent = this._element.parentNode // dropdown wrapper
|
|
102
|
-
//
|
|
102
|
+
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
|
103
103
|
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] ||
|
|
104
104
|
SelectorEngine.prev(this._element, SELECTOR_MENU)[0] ||
|
|
105
105
|
SelectorEngine.findOne(SELECTOR_MENU, this._parent)
|
|
@@ -314,7 +314,7 @@ class Dropdown extends BaseComponent {
|
|
|
314
314
|
|
|
315
315
|
// Disable Popper if we have a static display or Dropdown is in Navbar
|
|
316
316
|
if (this._inNavbar || this._config.display === 'static') {
|
|
317
|
-
Manipulator.setDataAttribute(this._menu, 'popper', 'static') //
|
|
317
|
+
Manipulator.setDataAttribute(this._menu, 'popper', 'static') // TODO: v6 remove
|
|
318
318
|
defaultBsPopperConfig.modifiers = [{
|
|
319
319
|
name: 'applyStyles',
|
|
320
320
|
enabled: false
|
|
@@ -412,7 +412,7 @@ class Dropdown extends BaseComponent {
|
|
|
412
412
|
|
|
413
413
|
event.preventDefault()
|
|
414
414
|
|
|
415
|
-
//
|
|
415
|
+
// TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/
|
|
416
416
|
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ?
|
|
417
417
|
this :
|
|
418
418
|
(SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] ||
|
package/js/src/modal.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI modal.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's modal.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import BaseComponent from './base-component.js'
|
|
12
12
|
import EventHandler from './dom/event-handler.js'
|
|
13
13
|
import SelectorEngine from './dom/selector-engine.js'
|
|
14
|
-
import ScrollBarHelper from './util/scrollbar.js'
|
|
15
|
-
import BaseComponent from './base-component.js'
|
|
16
14
|
import Backdrop from './util/backdrop.js'
|
|
17
|
-
import FocusTrap from './util/focustrap.js'
|
|
18
15
|
import { enableDismissTrigger } from './util/component-functions.js'
|
|
16
|
+
import FocusTrap from './util/focustrap.js'
|
|
17
|
+
import { defineJQueryPlugin, isRTL, isVisible, reflow } from './util/index.js'
|
|
18
|
+
import ScrollBarHelper from './util/scrollbar.js'
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Constants
|
|
@@ -142,12 +142,12 @@ class Modal extends BaseComponent {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
dispose() {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
145
|
+
EventHandler.off(window, EVENT_KEY)
|
|
146
|
+
EventHandler.off(this._dialog, EVENT_KEY)
|
|
148
147
|
|
|
149
148
|
this._backdrop.dispose()
|
|
150
149
|
this._focustrap.deactivate()
|
|
150
|
+
|
|
151
151
|
super.dispose()
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -211,7 +211,6 @@ class Modal extends BaseComponent {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
if (this._config.keyboard) {
|
|
214
|
-
event.preventDefault()
|
|
215
214
|
this.hide()
|
|
216
215
|
return
|
|
217
216
|
}
|
package/js/src/navigation.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI navigation.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
* --------------------------------------------------------------------------
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import BaseComponent from './base-component.js'
|
|
9
9
|
import Data from './dom/data.js'
|
|
10
10
|
import EventHandler from './dom/event-handler.js'
|
|
11
11
|
import Manipulator from './dom/manipulator.js'
|
|
12
12
|
import SelectorEngine from './dom/selector-engine.js'
|
|
13
|
-
import
|
|
13
|
+
import { defineJQueryPlugin } from './util/index.js'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* ------------------------------------------------------------------------
|
package/js/src/offcanvas.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI offcanvas.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's offcanvas.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import BaseComponent from './base-component.js'
|
|
12
|
+
import EventHandler from './dom/event-handler.js'
|
|
13
|
+
import SelectorEngine from './dom/selector-engine.js'
|
|
14
|
+
import Backdrop from './util/backdrop.js'
|
|
15
|
+
import { enableDismissTrigger } from './util/component-functions.js'
|
|
16
|
+
import FocusTrap from './util/focustrap.js'
|
|
11
17
|
import {
|
|
12
18
|
defineJQueryPlugin,
|
|
13
19
|
isDisabled,
|
|
14
20
|
isVisible
|
|
15
21
|
} from './util/index.js'
|
|
16
22
|
import ScrollBarHelper from './util/scrollbar.js'
|
|
17
|
-
import EventHandler from './dom/event-handler.js'
|
|
18
|
-
import BaseComponent from './base-component.js'
|
|
19
|
-
import SelectorEngine from './dom/selector-engine.js'
|
|
20
|
-
import Backdrop from './util/backdrop.js'
|
|
21
|
-
import FocusTrap from './util/focustrap.js'
|
|
22
|
-
import { enableDismissTrigger } from './util/component-functions.js'
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Constants
|
|
@@ -201,12 +201,12 @@ class Offcanvas extends BaseComponent {
|
|
|
201
201
|
return
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
if (
|
|
205
|
-
|
|
204
|
+
if (this._config.keyboard) {
|
|
205
|
+
this.hide()
|
|
206
206
|
return
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
this.
|
|
209
|
+
EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)
|
|
210
210
|
})
|
|
211
211
|
}
|
|
212
212
|
|
package/js/src/popover.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI popover.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's popover.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { defineJQueryPlugin } from './util/index.js'
|
|
12
11
|
import Tooltip from './tooltip.js'
|
|
12
|
+
import { defineJQueryPlugin } from './util/index.js'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Constants
|
package/js/src/scrollspy.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI scrollspy.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's scrollspy.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
12
|
-
import EventHandler from './dom/event-handler'
|
|
13
|
-
import SelectorEngine from './dom/selector-engine'
|
|
14
|
-
import
|
|
11
|
+
import BaseComponent from './base-component.js'
|
|
12
|
+
import EventHandler from './dom/event-handler.js'
|
|
13
|
+
import SelectorEngine from './dom/selector-engine.js'
|
|
14
|
+
import { defineJQueryPlugin, getElement, isDisabled, isVisible } from './util/index.js'
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Constants
|
package/js/src/sidebar.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI sidebar.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
* --------------------------------------------------------------------------
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { defineJQueryPlugin } from './util/index.js'
|
|
9
|
-
import ScrollBarHelper from './util/scrollbar.js'
|
|
10
|
-
import EventHandler from './dom/event-handler.js'
|
|
11
8
|
import BaseComponent from './base-component.js'
|
|
9
|
+
import EventHandler from './dom/event-handler.js'
|
|
12
10
|
import Manipulator from './dom/manipulator.js'
|
|
11
|
+
import { defineJQueryPlugin } from './util/index.js'
|
|
13
12
|
import Backdrop from './util/backdrop.js'
|
|
13
|
+
import ScrollBarHelper from './util/scrollbar.js'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* ------------------------------------------------------------------------
|
package/js/src/tab.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI tab.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's tab.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import BaseComponent from './base-component.js'
|
|
12
12
|
import EventHandler from './dom/event-handler.js'
|
|
13
13
|
import SelectorEngine from './dom/selector-engine.js'
|
|
14
|
-
import
|
|
14
|
+
import { defineJQueryPlugin, getNextActiveElement, isDisabled } from './util/index.js'
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Constants
|
|
@@ -46,7 +46,7 @@ const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)'
|
|
|
46
46
|
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'
|
|
47
47
|
const SELECTOR_OUTER = '.nav-item, .list-group-item'
|
|
48
48
|
const SELECTOR_INNER = `.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`
|
|
49
|
-
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]' //
|
|
49
|
+
const SELECTOR_DATA_TOGGLE = '[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]' // TODO: could only be `tab` in v6
|
|
50
50
|
const SELECTOR_INNER_ELEM = `${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`
|
|
51
51
|
|
|
52
52
|
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"]`
|
|
@@ -62,7 +62,7 @@ class Tab extends BaseComponent {
|
|
|
62
62
|
|
|
63
63
|
if (!this._parent) {
|
|
64
64
|
return
|
|
65
|
-
//
|
|
65
|
+
// TODO: should throw exception in v6
|
|
66
66
|
// throw new TypeError(`${element.outerHTML} has not a valid parent ${SELECTOR_INNER_ELEM}`)
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -215,7 +215,7 @@ class Tab extends BaseComponent {
|
|
|
215
215
|
this._setAttributeIfNotExists(target, 'role', 'tabpanel')
|
|
216
216
|
|
|
217
217
|
if (child.id) {
|
|
218
|
-
this._setAttributeIfNotExists(target, 'aria-labelledby',
|
|
218
|
+
this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`)
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
|
package/js/src/toast.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI toast.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's toast.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { defineJQueryPlugin, reflow } from './util/index.js'
|
|
12
|
-
import EventHandler from './dom/event-handler.js'
|
|
13
11
|
import BaseComponent from './base-component.js'
|
|
12
|
+
import EventHandler from './dom/event-handler.js'
|
|
14
13
|
import { enableDismissTrigger } from './util/component-functions.js'
|
|
14
|
+
import { defineJQueryPlugin, reflow } from './util/index.js'
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Constants
|
package/js/src/tooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI tooltip.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This component is a modified version of the Bootstrap's tooltip.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import * as Popper from '@popperjs/core'
|
|
12
|
-
import
|
|
13
|
-
import { DefaultAllowlist } from './util/sanitizer.js'
|
|
12
|
+
import BaseComponent from './base-component.js'
|
|
14
13
|
import EventHandler from './dom/event-handler.js'
|
|
15
14
|
import Manipulator from './dom/manipulator.js'
|
|
16
|
-
import
|
|
15
|
+
import { defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop } from './util/index.js'
|
|
16
|
+
import { DefaultAllowlist } from './util/sanitizer.js'
|
|
17
17
|
import TemplateFactory from './util/template-factory.js'
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -65,7 +65,7 @@ const Default = {
|
|
|
65
65
|
delay: 0,
|
|
66
66
|
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
|
|
67
67
|
html: false,
|
|
68
|
-
offset: [0,
|
|
68
|
+
offset: [0, 6],
|
|
69
69
|
placement: 'top',
|
|
70
70
|
popperConfig: null,
|
|
71
71
|
sanitize: true,
|
|
@@ -200,7 +200,7 @@ class Tooltip extends BaseComponent {
|
|
|
200
200
|
return
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
//
|
|
203
|
+
// TODO: v6 remove this or make it optional
|
|
204
204
|
this._disposePopper()
|
|
205
205
|
|
|
206
206
|
const tip = this._getTipElement()
|
|
@@ -305,13 +305,13 @@ class Tooltip extends BaseComponent {
|
|
|
305
305
|
_createTipElement(content) {
|
|
306
306
|
const tip = this._getTemplateFactory(content).toHtml()
|
|
307
307
|
|
|
308
|
-
//
|
|
308
|
+
// TODO: remove this check in v6
|
|
309
309
|
if (!tip) {
|
|
310
310
|
return null
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)
|
|
314
|
-
//
|
|
314
|
+
// TODO: v6 the following can be achieved with CSS only
|
|
315
315
|
tip.classList.add(`bs-${this.constructor.NAME}-auto`)
|
|
316
316
|
|
|
317
317
|
const tipId = getUID(this.constructor.NAME).toString()
|
package/js/src/util/backdrop.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/backdrop.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/backdrop.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import EventHandler from '../dom/event-handler.js'
|
|
12
|
-
import { execute, executeAfterTransition, getElement, reflow } from './index.js'
|
|
13
12
|
import Config from './config.js'
|
|
13
|
+
import { execute, executeAfterTransition, getElement, reflow } from './index.js'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Constants
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/component-functions.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/component-functions.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import EventHandler from '../dom/event-handler.js'
|
|
12
|
-
import { isDisabled } from './index.js'
|
|
13
12
|
import SelectorEngine from '../dom/selector-engine.js'
|
|
13
|
+
import { isDisabled } from './index.js'
|
|
14
14
|
|
|
15
15
|
const enableDismissTrigger = (component, method = 'hide') => {
|
|
16
16
|
const clickEvent = `click.dismiss${component.EVENT_KEY}`
|
package/js/src/util/config.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/config.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/config.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { isElement, toType } from './index.js'
|
|
12
11
|
import Manipulator from '../dom/manipulator.js'
|
|
12
|
+
import { isElement, toType } from './index.js'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Class definition
|
package/js/src/util/focustrap.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/focustrap.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/focustrap.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
package/js/src/util/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/index.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/index.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
package/js/src/util/sanitizer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/sanitizer.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/sanitizer.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -19,8 +19,6 @@ const uriAttributes = new Set([
|
|
|
19
19
|
'xlink:href'
|
|
20
20
|
])
|
|
21
21
|
|
|
22
|
-
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
|
|
23
|
-
|
|
24
22
|
/**
|
|
25
23
|
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
26
24
|
*
|
|
@@ -51,6 +49,9 @@ const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
|
51
49
|
.some(regex => regex.test(attributeName))
|
|
52
50
|
}
|
|
53
51
|
|
|
52
|
+
// js-docs-start allow-list
|
|
53
|
+
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
|
|
54
|
+
|
|
54
55
|
export const DefaultAllowlist = {
|
|
55
56
|
// Global attributes allowed on any supplied element below.
|
|
56
57
|
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
|
@@ -84,6 +85,7 @@ export const DefaultAllowlist = {
|
|
|
84
85
|
u: [],
|
|
85
86
|
ul: []
|
|
86
87
|
}
|
|
88
|
+
// js-docs-end allow-list
|
|
87
89
|
|
|
88
90
|
export function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
89
91
|
if (!unsafeHtml.length) {
|
package/js/src/util/scrollbar.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/scrollBar.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/scrollBar.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import SelectorEngine from '../dom/selector-engine.js'
|
|
12
11
|
import Manipulator from '../dom/manipulator.js'
|
|
12
|
+
import SelectorEngine from '../dom/selector-engine.js'
|
|
13
13
|
import { isElement } from './index.js'
|
|
14
14
|
|
|
15
15
|
/**
|
package/js/src/util/swipe.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/swipe.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/swipe.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import Config from './config.js'
|
|
12
11
|
import EventHandler from '../dom/event-handler.js'
|
|
12
|
+
import Config from './config.js'
|
|
13
13
|
import { execute } from './index.js'
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI util/template-factory.js
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
5
|
*
|
|
6
6
|
* This is a modified version of the Bootstrap's util/template-factory.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'
|
|
12
|
-
import { execute, getElement, isElement } from './index.js'
|
|
13
11
|
import SelectorEngine from '../dom/selector-engine.js'
|
|
14
12
|
import Config from './config.js'
|
|
13
|
+
import { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'
|
|
14
|
+
import { execute, getElement, isElement } from './index.js'
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Constants
|