@coreui/coreui 4.2.6 → 4.3.0-beta.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 +2385 -885
- 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 +2299 -905
- 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 +317 -304
- 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 +277 -258
- 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 +280 -260
- 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 +16 -15
- 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 +30 -32
- 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 +8 -8
- 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 +40 -43
- 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 +52 -43
- 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 +18 -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 +361 -344
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI dom/event-handler.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 dom/event-handler.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -131,7 +131,7 @@ function findHandler(events, callable, delegationSelector = null) {
|
|
|
131
131
|
|
|
132
132
|
function normalizeParameters(originalTypeEvent, handler, delegationFunction) {
|
|
133
133
|
const isDelegated = typeof handler === 'string'
|
|
134
|
-
//
|
|
134
|
+
// TODO: tooltip passes `false` instead of selector, so we need to check
|
|
135
135
|
const callable = isDelegated ? delegationFunction : (handler || delegationFunction)
|
|
136
136
|
let typeEvent = getTypeEvent(originalTypeEvent)
|
|
137
137
|
|
|
@@ -282,8 +282,7 @@ const EventHandler = {
|
|
|
282
282
|
defaultPrevented = jQueryEvent.isDefaultPrevented()
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
|
|
286
|
-
evt = hydrateObj(evt, args)
|
|
285
|
+
const evt = hydrateObj(new Event(event, { bubbles, cancelable: true }), args)
|
|
287
286
|
|
|
288
287
|
if (defaultPrevented) {
|
|
289
288
|
evt.preventDefault()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI dom/manipulator.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 dom/manipulator.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* --------------------------------------------------------------------------
|
|
3
|
-
* CoreUI
|
|
4
|
-
* Licensed under MIT (https://
|
|
3
|
+
* CoreUI dom/selector-engine.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 dom/selector-engine.js
|
|
7
7
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
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
|
|
@@ -211,11 +211,11 @@ class ScrollSpy extends BaseComponent {
|
|
|
211
211
|
continue
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
const observableSection = SelectorEngine.findOne(anchor.hash, this._element)
|
|
214
|
+
const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)
|
|
215
215
|
|
|
216
216
|
// ensure that the observableSection exists & is visible
|
|
217
217
|
if (isVisible(observableSection)) {
|
|
218
|
-
this._targetLinks.set(anchor.hash, anchor)
|
|
218
|
+
this._targetLinks.set(decodeURI(anchor.hash), anchor)
|
|
219
219
|
this._observableSections.set(anchor.hash, observableSection)
|
|
220
220
|
}
|
|
221
221
|
}
|
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,56 +1,16 @@
|
|
|
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)
|
|
8
8
|
* --------------------------------------------------------------------------
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
'background',
|
|
13
|
-
'cite',
|
|
14
|
-
'href',
|
|
15
|
-
'itemtype',
|
|
16
|
-
'longdesc',
|
|
17
|
-
'poster',
|
|
18
|
-
'src',
|
|
19
|
-
'xlink:href'
|
|
20
|
-
])
|
|
21
|
-
|
|
11
|
+
// js-docs-start allow-list
|
|
22
12
|
const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
|
|
23
13
|
|
|
24
|
-
/**
|
|
25
|
-
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
|
26
|
-
*
|
|
27
|
-
* Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
28
|
-
*/
|
|
29
|
-
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
|
33
|
-
*
|
|
34
|
-
* Shout-out to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts
|
|
35
|
-
*/
|
|
36
|
-
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i
|
|
37
|
-
|
|
38
|
-
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
39
|
-
const attributeName = attribute.nodeName.toLowerCase()
|
|
40
|
-
|
|
41
|
-
if (allowedAttributeList.includes(attributeName)) {
|
|
42
|
-
if (uriAttributes.has(attributeName)) {
|
|
43
|
-
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue))
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return true
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Check if a regular expression validates the attribute.
|
|
50
|
-
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)
|
|
51
|
-
.some(regex => regex.test(attributeName))
|
|
52
|
-
}
|
|
53
|
-
|
|
54
14
|
export const DefaultAllowlist = {
|
|
55
15
|
// Global attributes allowed on any supplied element below.
|
|
56
16
|
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
|
@@ -84,6 +44,43 @@ export const DefaultAllowlist = {
|
|
|
84
44
|
u: [],
|
|
85
45
|
ul: []
|
|
86
46
|
}
|
|
47
|
+
// js-docs-end allow-list
|
|
48
|
+
|
|
49
|
+
const uriAttributes = new Set([
|
|
50
|
+
'background',
|
|
51
|
+
'cite',
|
|
52
|
+
'href',
|
|
53
|
+
'itemtype',
|
|
54
|
+
'longdesc',
|
|
55
|
+
'poster',
|
|
56
|
+
'src',
|
|
57
|
+
'xlink:href'
|
|
58
|
+
])
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A pattern that recognizes URLs that are safe wrt. XSS in URL navigation
|
|
62
|
+
* contexts.
|
|
63
|
+
*
|
|
64
|
+
* Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38
|
|
65
|
+
*/
|
|
66
|
+
// eslint-disable-next-line unicorn/better-regex
|
|
67
|
+
const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i
|
|
68
|
+
|
|
69
|
+
const allowedAttribute = (attribute, allowedAttributeList) => {
|
|
70
|
+
const attributeName = attribute.nodeName.toLowerCase()
|
|
71
|
+
|
|
72
|
+
if (allowedAttributeList.includes(attributeName)) {
|
|
73
|
+
if (uriAttributes.has(attributeName)) {
|
|
74
|
+
return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return true
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Check if a regular expression validates the attribute.
|
|
81
|
+
return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)
|
|
82
|
+
.some(regex => regex.test(attributeName))
|
|
83
|
+
}
|
|
87
84
|
|
|
88
85
|
export function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {
|
|
89
86
|
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
|
/**
|