@openeuropa/bcl-bootstrap 0.28.1 → 1.0.2
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/bootstrap-icons.svg +1 -1
- package/icons/0-circle-fill.svg +4 -0
- package/icons/0-circle.svg +4 -0
- package/icons/0-square-fill.svg +4 -0
- package/icons/0-square.svg +4 -0
- package/icons/1-circle-fill.svg +1 -1
- package/icons/amd.svg +3 -0
- package/icons/arrow-bar-left.svg +1 -1
- package/icons/arrow-bar-right.svg +1 -1
- package/icons/arrows-collapse.svg +1 -1
- package/icons/arrows-expand.svg +1 -1
- package/icons/building-add.svg +5 -0
- package/icons/building-check.svg +5 -0
- package/icons/building-dash.svg +5 -0
- package/icons/building-down.svg +5 -0
- package/icons/building-exclamation.svg +4 -0
- package/icons/building-fill-add.svg +4 -0
- package/icons/building-fill-check.svg +4 -0
- package/icons/building-fill-dash.svg +4 -0
- package/icons/building-fill-down.svg +4 -0
- package/icons/building-fill-exclamation.svg +4 -0
- package/icons/building-fill-gear.svg +4 -0
- package/icons/building-fill-lock.svg +4 -0
- package/icons/building-fill-slash.svg +4 -0
- package/icons/building-fill-up.svg +4 -0
- package/icons/building-fill-x.svg +4 -0
- package/icons/building-fill.svg +3 -0
- package/icons/building-gear.svg +4 -0
- package/icons/building-lock.svg +4 -0
- package/icons/building-slash.svg +5 -0
- package/icons/building-up.svg +5 -0
- package/icons/building-x.svg +4 -0
- package/icons/building.svg +2 -2
- package/icons/buildings-fill.svg +3 -0
- package/icons/buildings.svg +4 -0
- package/icons/bus-front-fill.svg +3 -0
- package/icons/bus-front.svg +4 -0
- package/icons/capsule-pill.svg +1 -1
- package/icons/capsule.svg +1 -1
- package/icons/car-front-fill.svg +1 -1
- package/icons/car-front.svg +1 -1
- package/icons/database-add.svg +4 -0
- package/icons/database-check.svg +4 -0
- package/icons/database-dash.svg +4 -0
- package/icons/database-down.svg +4 -0
- package/icons/database-exclamation.svg +4 -0
- package/icons/database-fill-add.svg +4 -0
- package/icons/database-fill-check.svg +4 -0
- package/icons/database-fill-dash.svg +4 -0
- package/icons/database-fill-down.svg +4 -0
- package/icons/database-fill-exclamation.svg +5 -0
- package/icons/database-fill-gear.svg +4 -0
- package/icons/database-fill-lock.svg +5 -0
- package/icons/database-fill-slash.svg +4 -0
- package/icons/database-fill-up.svg +4 -0
- package/icons/database-fill-x.svg +5 -0
- package/icons/database-fill.svg +6 -0
- package/icons/database-gear.svg +4 -0
- package/icons/database-lock.svg +4 -0
- package/icons/database-slash.svg +4 -0
- package/icons/database-up.svg +4 -0
- package/icons/database-x.svg +4 -0
- package/icons/database.svg +3 -0
- package/icons/envelope-at-fill.svg +4 -0
- package/icons/envelope-at.svg +4 -0
- package/icons/ev-front-fill.svg +3 -0
- package/icons/ev-front.svg +4 -0
- package/icons/globe-americas.svg +3 -0
- package/icons/globe-asia-australia.svg +4 -0
- package/icons/globe-central-south-asia.svg +3 -0
- package/icons/globe-europe-africa.svg +3 -0
- package/icons/heart-pulse-fill.svg +2 -1
- package/icons/heart-pulse.svg +2 -1
- package/icons/heartbreak-fill.svg +1 -1
- package/icons/heartbreak.svg +1 -1
- package/icons/house-add-fill.svg +5 -0
- package/icons/house-add.svg +4 -0
- package/icons/house-check-fill.svg +5 -0
- package/icons/house-check.svg +4 -0
- package/icons/house-dash-fill.svg +5 -0
- package/icons/house-dash.svg +4 -0
- package/icons/house-door-fill.svg +1 -1
- package/icons/house-door.svg +1 -1
- package/icons/house-down-fill.svg +5 -0
- package/icons/house-down.svg +4 -0
- package/icons/house-exclamation-fill.svg +5 -0
- package/icons/house-exclamation.svg +4 -0
- package/icons/house-fill.svg +2 -2
- package/icons/house-gear-fill.svg +5 -0
- package/icons/house-gear.svg +4 -0
- package/icons/house-lock-fill.svg +5 -0
- package/icons/house-lock.svg +4 -0
- package/icons/house-slash-fill.svg +5 -0
- package/icons/house-slash.svg +4 -0
- package/icons/house-up-fill.svg +5 -0
- package/icons/house-up.svg +4 -0
- package/icons/house-x-fill.svg +5 -0
- package/icons/house-x.svg +4 -0
- package/icons/house.svg +1 -2
- package/icons/houses-fill.svg +4 -0
- package/icons/houses.svg +3 -0
- package/icons/lungs-fill.svg +1 -1
- package/icons/nvidia.svg +3 -0
- package/icons/people-fill.svg +1 -3
- package/icons/people.svg +1 -1
- package/icons/person-add.svg +4 -0
- package/icons/person-check.svg +2 -2
- package/icons/person-dash.svg +2 -2
- package/icons/person-down.svg +4 -0
- package/icons/person-exclamation.svg +4 -0
- package/icons/person-fill-add.svg +4 -0
- package/icons/person-fill-check.svg +4 -0
- package/icons/person-fill-dash.svg +4 -0
- package/icons/person-fill-down.svg +4 -0
- package/icons/person-fill-exclamation.svg +4 -0
- package/icons/person-fill-gear.svg +3 -0
- package/icons/person-fill-lock.svg +3 -0
- package/icons/person-fill-slash.svg +3 -0
- package/icons/person-fill-up.svg +4 -0
- package/icons/person-fill-x.svg +4 -0
- package/icons/person-fill.svg +1 -1
- package/icons/person-gear.svg +3 -0
- package/icons/person-lock.svg +3 -0
- package/icons/person-slash.svg +3 -0
- package/icons/person-up.svg +4 -0
- package/icons/person-vcard-fill.svg +3 -0
- package/icons/person-vcard.svg +4 -0
- package/icons/person-x.svg +2 -2
- package/icons/person.svg +1 -1
- package/icons/prescription.svg +2 -2
- package/icons/prescription2.svg +1 -1
- package/icons/regex.svg +3 -0
- package/icons/rocket-fill.svg +4 -0
- package/icons/rocket-takeoff-fill.svg +4 -0
- package/icons/rocket-takeoff.svg +5 -0
- package/icons/rocket.svg +5 -0
- package/icons/scooter.svg +3 -0
- package/icons/sign-dead-end-fill.svg +4 -0
- package/icons/sign-dead-end.svg +4 -0
- package/icons/sign-do-not-enter-fill.svg +4 -0
- package/icons/sign-do-not-enter.svg +4 -0
- package/icons/sign-intersection-fill.svg +3 -0
- package/icons/sign-intersection-side-fill.svg +3 -0
- package/icons/sign-intersection-side.svg +4 -0
- package/icons/sign-intersection-t-fill.svg +3 -0
- package/icons/sign-intersection-t.svg +4 -0
- package/icons/sign-intersection-y-fill.svg +3 -0
- package/icons/sign-intersection-y.svg +4 -0
- package/icons/sign-intersection.svg +4 -0
- package/icons/sign-merge-left-fill.svg +3 -0
- package/icons/sign-merge-left.svg +4 -0
- package/icons/sign-merge-right-fill.svg +3 -0
- package/icons/sign-merge-right.svg +4 -0
- package/icons/sign-no-left-turn-fill.svg +4 -0
- package/icons/sign-no-left-turn.svg +3 -0
- package/icons/sign-no-parking-fill.svg +4 -0
- package/icons/sign-no-parking.svg +3 -0
- package/icons/sign-no-right-turn-fill.svg +4 -0
- package/icons/sign-no-right-turn.svg +3 -0
- package/icons/sign-railroad-fill.svg +5 -0
- package/icons/sign-railroad.svg +4 -0
- package/icons/sign-stop-fill.svg +1 -1
- package/icons/sign-stop-lights-fill.svg +1 -1
- package/icons/sign-turn-left-fill.svg +1 -1
- package/icons/sign-turn-right-fill.svg +1 -1
- package/icons/sign-turn-slight-left-fill.svg +1 -1
- package/icons/sign-turn-slight-right-fill.svg +1 -1
- package/icons/sign-yield-fill.svg +1 -1
- package/icons/sina-weibo.svg +4 -0
- package/icons/stripe.svg +3 -0
- package/icons/subscript.svg +3 -0
- package/icons/superscript.svg +3 -0
- package/icons/taxi-front-fill.svg +3 -0
- package/icons/taxi-front.svg +4 -0
- package/icons/tencent-qq.svg +4 -0
- package/icons/text-wrap.svg +3 -0
- package/icons/train-freight-front-fill.svg +1 -1
- package/icons/train-freight-front.svg +1 -1
- package/icons/train-front-fill.svg +1 -1
- package/icons/train-front.svg +1 -1
- package/icons/train-lightrail-front-fill.svg +1 -1
- package/icons/train-lightrail-front.svg +1 -1
- package/icons/trello.svg +3 -0
- package/icons/truck-front-fill.svg +1 -1
- package/icons/truck-front.svg +2 -3
- package/icons/virus.svg +1 -1
- package/icons/virus2.svg +1 -1
- package/icons/wikipedia.svg +3 -0
- package/js/dist/alert.js +14 -25
- package/js/dist/alert.js.map +1 -1
- package/js/dist/base-component.js +13 -30
- package/js/dist/base-component.js.map +1 -1
- package/js/dist/button.js +11 -15
- package/js/dist/button.js.map +1 -1
- package/js/dist/carousel.js +36 -120
- package/js/dist/carousel.js.map +1 -1
- package/js/dist/collapse.js +27 -88
- package/js/dist/collapse.js.map +1 -1
- package/js/dist/dependency/manipulator.js +72 -0
- package/js/dist/dependency/manipulator.js.map +1 -0
- package/js/dist/dom/data.js +6 -10
- package/js/dist/dom/data.js.map +1 -1
- package/js/dist/dom/event-handler.js +7 -52
- package/js/dist/dom/event-handler.js.map +1 -1
- package/js/dist/dom/manipulator.js +2 -15
- package/js/dist/dom/manipulator.js.map +1 -1
- package/js/dist/dom/selector-engine.js +2 -16
- package/js/dist/dom/selector-engine.js.map +1 -1
- package/js/dist/dropdown.js +52 -124
- package/js/dist/dropdown.js.map +1 -1
- package/js/dist/modal.js +40 -119
- package/js/dist/modal.js.map +1 -1
- package/js/dist/offcanvas.js +36 -89
- package/js/dist/offcanvas.js.map +1 -1
- package/js/dist/popover.js +15 -22
- package/js/dist/popover.js.map +1 -1
- package/js/dist/scrollspy-legacy.js +216 -0
- package/js/dist/scrollspy-legacy.js.map +1 -0
- package/js/dist/scrollspy.js +42 -80
- package/js/dist/scrollspy.js.map +1 -1
- package/js/dist/tab.js +40 -98
- package/js/dist/tab.js.map +1 -1
- package/js/dist/toast.js +30 -69
- package/js/dist/toast.js.map +1 -1
- package/js/dist/tooltip.js +74 -196
- package/js/dist/tooltip.js.map +1 -1
- package/js/dist/util/backdrop.js +13 -40
- package/js/dist/util/backdrop.js.map +1 -1
- package/js/dist/util/component-functions.js +5 -11
- package/js/dist/util/component-functions.js.map +1 -1
- package/js/dist/util/config.js +6 -18
- package/js/dist/util/config.js.map +1 -1
- package/js/dist/util/focustrap.js +16 -33
- package/js/dist/util/focustrap.js.map +1 -1
- package/js/dist/util/index.js +28 -75
- package/js/dist/util/index.js.map +1 -1
- package/js/dist/util/sanitizer.js +7 -17
- package/js/dist/util/sanitizer.js.map +1 -1
- package/js/dist/util/scrollbar.js +16 -43
- package/js/dist/util/scrollbar.js.map +1 -1
- package/js/dist/util/swipe.js +18 -40
- package/js/dist/util/swipe.js.map +1 -1
- package/js/dist/util/template-factory.js +13 -41
- package/js/dist/util/template-factory.js.map +1 -1
- package/js/src/alert.js +1 -1
- package/js/src/base-component.js +2 -2
- package/js/src/button.js +1 -1
- package/js/src/carousel.js +1 -1
- package/js/src/collapse.js +1 -1
- package/js/src/dependency/manipulator.js +80 -0
- package/js/src/dom/data.js +1 -1
- package/js/src/dom/event-handler.js +1 -1
- package/js/src/dom/manipulator.js +1 -1
- package/js/src/dom/selector-engine.js +1 -1
- package/js/src/dropdown.js +10 -3
- package/js/src/modal.js +3 -3
- package/js/src/offcanvas.js +1 -1
- package/js/src/popover.js +1 -1
- package/js/src/scrollspy-legacy.js +294 -0
- package/js/src/scrollspy.js +1 -1
- package/js/src/tab.js +2 -4
- package/js/src/toast.js +9 -4
- package/js/src/tooltip.js +27 -48
- package/js/src/util/backdrop.js +1 -1
- package/js/src/util/component-functions.js +1 -1
- package/js/src/util/config.js +1 -1
- package/js/src/util/focustrap.js +1 -1
- package/js/src/util/index.js +1 -1
- package/js/src/util/sanitizer.js +1 -1
- package/js/src/util/scrollbar.js +1 -1
- package/js/src/util/swipe.js +1 -1
- package/js/src/util/template-factory.js +1 -1
- package/legacy/dependency/manipulator.js +80 -0
- package/legacy/scrollspy-legacy.js +294 -0
- package/package.json +6 -6
- package/scss/_buttons.scss +8 -2
- package/scss/_carousel.scss +0 -3
- package/scss/_functions.scss +1 -1
- package/scss/_toasts.scss +2 -0
- package/scss/_variables.scss +1 -1
- package/scss/bootstrap-utilities.scss +3 -0
- package/scss/mixins/_banner.scss +1 -1
- package/scss/mixins/_table-variants.scss +2 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap (v5.1.3): dom/manipulator.js
|
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
function normalizeData(val) {
|
|
9
|
+
if (val === 'true') {
|
|
10
|
+
return true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (val === 'false') {
|
|
14
|
+
return false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (val === Number(val).toString()) {
|
|
18
|
+
return Number(val)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (val === '' || val === 'null') {
|
|
22
|
+
return null
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return val
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function normalizeDataKey(key) {
|
|
29
|
+
return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const Manipulator = {
|
|
33
|
+
setDataAttribute(element, key, value) {
|
|
34
|
+
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
removeDataAttribute(element, key) {
|
|
38
|
+
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
getDataAttributes(element) {
|
|
42
|
+
if (!element) {
|
|
43
|
+
return {}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const attributes = {}
|
|
47
|
+
|
|
48
|
+
Object.keys(element.dataset)
|
|
49
|
+
.filter(key => key.startsWith('bs'))
|
|
50
|
+
.forEach(key => {
|
|
51
|
+
let pureKey = key.replace(/^bs/, '')
|
|
52
|
+
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)
|
|
53
|
+
attributes[pureKey] = normalizeData(element.dataset[key])
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
return attributes
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
getDataAttribute(element, key) {
|
|
60
|
+
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
offset(element) {
|
|
64
|
+
const rect = element.getBoundingClientRect()
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
top: rect.top + window.pageYOffset,
|
|
68
|
+
left: rect.left + window.pageXOffset
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
position(element) {
|
|
73
|
+
return {
|
|
74
|
+
top: element.offsetTop,
|
|
75
|
+
left: element.offsetLeft
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default Manipulator
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* Bootstrap (v5.1.3): scrollspy.js
|
|
4
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Old versions
|
|
9
|
+
import Manipulator from './dependency/manipulator'
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
defineJQueryPlugin,
|
|
13
|
+
getElement,
|
|
14
|
+
getSelectorFromElement,
|
|
15
|
+
} from './util/index'
|
|
16
|
+
import EventHandler from './dom/event-handler'
|
|
17
|
+
import SelectorEngine from './dom/selector-engine'
|
|
18
|
+
import BaseComponent from './base-component'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* ------------------------------------------------------------------------
|
|
22
|
+
* Constants
|
|
23
|
+
* ------------------------------------------------------------------------
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const NAME = 'scrollspy'
|
|
27
|
+
const DATA_KEY = 'bs.scrollspy'
|
|
28
|
+
const EVENT_KEY = `.${DATA_KEY}`
|
|
29
|
+
const DATA_API_KEY = '.data-api'
|
|
30
|
+
|
|
31
|
+
const Default = {
|
|
32
|
+
offset: 10,
|
|
33
|
+
method: 'auto',
|
|
34
|
+
target: ''
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const DefaultType = {
|
|
38
|
+
offset: 'number',
|
|
39
|
+
method: 'string',
|
|
40
|
+
target: '(string|element)'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const EVENT_ACTIVATE = `activate${EVENT_KEY}`
|
|
44
|
+
const EVENT_SCROLL = `scroll${EVENT_KEY}`
|
|
45
|
+
const EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`
|
|
46
|
+
|
|
47
|
+
const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'
|
|
48
|
+
const CLASS_NAME_ACTIVE = 'active'
|
|
49
|
+
|
|
50
|
+
const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'
|
|
51
|
+
const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'
|
|
52
|
+
const SELECTOR_NAV_LINKS = '.nav-link'
|
|
53
|
+
const SELECTOR_NAV_ITEMS = '.nav-item'
|
|
54
|
+
const SELECTOR_LIST_ITEMS = '.list-group-item'
|
|
55
|
+
const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`
|
|
56
|
+
const SELECTOR_DROPDOWN = '.dropdown'
|
|
57
|
+
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
|
|
58
|
+
|
|
59
|
+
const METHOD_OFFSET = 'offset'
|
|
60
|
+
const METHOD_POSITION = 'position'
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* ------------------------------------------------------------------------
|
|
64
|
+
* Class Definition
|
|
65
|
+
* ------------------------------------------------------------------------
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
class ScrollSpy extends BaseComponent {
|
|
69
|
+
constructor(element, config) {
|
|
70
|
+
super(element)
|
|
71
|
+
this._scrollElement = this._element.tagName === 'BODY' ? window : this._element
|
|
72
|
+
this._config = this._getConfig(config)
|
|
73
|
+
this._offsets = []
|
|
74
|
+
this._targets = []
|
|
75
|
+
this._activeTarget = null
|
|
76
|
+
this._scrollHeight = 0
|
|
77
|
+
|
|
78
|
+
EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process())
|
|
79
|
+
|
|
80
|
+
this.refresh()
|
|
81
|
+
this._process()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Getters
|
|
85
|
+
|
|
86
|
+
static get Default() {
|
|
87
|
+
return Default
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static get NAME() {
|
|
91
|
+
return NAME
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Public
|
|
95
|
+
|
|
96
|
+
refresh() {
|
|
97
|
+
const autoMethod = this._scrollElement === this._scrollElement.window ?
|
|
98
|
+
METHOD_OFFSET :
|
|
99
|
+
METHOD_POSITION
|
|
100
|
+
|
|
101
|
+
const offsetMethod = this._config.method === 'auto' ?
|
|
102
|
+
autoMethod :
|
|
103
|
+
this._config.method
|
|
104
|
+
|
|
105
|
+
const offsetBase = offsetMethod === METHOD_POSITION ?
|
|
106
|
+
this._getScrollTop() :
|
|
107
|
+
0
|
|
108
|
+
|
|
109
|
+
this._offsets = []
|
|
110
|
+
this._targets = []
|
|
111
|
+
this._scrollHeight = this._getScrollHeight()
|
|
112
|
+
|
|
113
|
+
const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target)
|
|
114
|
+
|
|
115
|
+
targets.map(element => {
|
|
116
|
+
const targetSelector = getSelectorFromElement(element)
|
|
117
|
+
const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null
|
|
118
|
+
|
|
119
|
+
if (target) {
|
|
120
|
+
const targetBCR = target.getBoundingClientRect()
|
|
121
|
+
if (targetBCR.width || targetBCR.height) {
|
|
122
|
+
return [
|
|
123
|
+
Manipulator[offsetMethod](target).top + offsetBase,
|
|
124
|
+
targetSelector
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return null
|
|
130
|
+
})
|
|
131
|
+
.filter(item => item)
|
|
132
|
+
.sort((a, b) => a[0] - b[0])
|
|
133
|
+
.forEach(item => {
|
|
134
|
+
this._offsets.push(item[0])
|
|
135
|
+
this._targets.push(item[1])
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
dispose() {
|
|
140
|
+
EventHandler.off(this._scrollElement, EVENT_KEY)
|
|
141
|
+
super.dispose()
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Private
|
|
145
|
+
|
|
146
|
+
_getConfig(config) {
|
|
147
|
+
config = {
|
|
148
|
+
...Default,
|
|
149
|
+
...Manipulator.getDataAttributes(this._element),
|
|
150
|
+
...(typeof config === 'object' && config ? config : {})
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
config.target = getElement(config.target) || document.documentElement
|
|
154
|
+
|
|
155
|
+
return config
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
_getScrollTop() {
|
|
159
|
+
return this._scrollElement === window ?
|
|
160
|
+
this._scrollElement.pageYOffset :
|
|
161
|
+
this._scrollElement.scrollTop
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
_getScrollHeight() {
|
|
165
|
+
return this._scrollElement.scrollHeight || Math.max(
|
|
166
|
+
document.body.scrollHeight,
|
|
167
|
+
document.documentElement.scrollHeight
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
_getOffsetHeight() {
|
|
172
|
+
return this._scrollElement === window ?
|
|
173
|
+
window.innerHeight :
|
|
174
|
+
this._scrollElement.getBoundingClientRect().height
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
_process() {
|
|
178
|
+
const scrollTop = this._getScrollTop() + this._config.offset
|
|
179
|
+
const scrollHeight = this._getScrollHeight()
|
|
180
|
+
const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight()
|
|
181
|
+
|
|
182
|
+
if (this._scrollHeight !== scrollHeight) {
|
|
183
|
+
this.refresh()
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (scrollTop >= maxScroll) {
|
|
187
|
+
const target = this._targets[this._targets.length - 1]
|
|
188
|
+
|
|
189
|
+
if (this._activeTarget !== target) {
|
|
190
|
+
this._activate(target)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
|
|
197
|
+
this._activeTarget = null
|
|
198
|
+
this._clear()
|
|
199
|
+
return
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
for (let i = this._offsets.length; i--;) {
|
|
203
|
+
const isActiveTarget = this._activeTarget !== this._targets[i] &&
|
|
204
|
+
scrollTop >= this._offsets[i] &&
|
|
205
|
+
(typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1])
|
|
206
|
+
|
|
207
|
+
if (isActiveTarget) {
|
|
208
|
+
this._activate(this._targets[i])
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
_activate(target) {
|
|
214
|
+
this._activeTarget = target
|
|
215
|
+
|
|
216
|
+
this._clear()
|
|
217
|
+
|
|
218
|
+
const queries = SELECTOR_LINK_ITEMS.split(',')
|
|
219
|
+
.map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`)
|
|
220
|
+
|
|
221
|
+
const link = SelectorEngine.findOne(queries.join(','), this._config.target)
|
|
222
|
+
|
|
223
|
+
link.classList.add(CLASS_NAME_ACTIVE)
|
|
224
|
+
if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
|
|
225
|
+
SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN))
|
|
226
|
+
.classList.add(CLASS_NAME_ACTIVE)
|
|
227
|
+
} else {
|
|
228
|
+
SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP)
|
|
229
|
+
.forEach(listGroup => {
|
|
230
|
+
// Set triggered links parents as active
|
|
231
|
+
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
|
232
|
+
SelectorEngine.prev(listGroup, `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`)
|
|
233
|
+
.forEach(item => item.classList.add(CLASS_NAME_ACTIVE))
|
|
234
|
+
|
|
235
|
+
// Handle special case when .nav-link is inside .nav-item
|
|
236
|
+
SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS)
|
|
237
|
+
.forEach(navItem => {
|
|
238
|
+
SelectorEngine.children(navItem, SELECTOR_NAV_LINKS)
|
|
239
|
+
.forEach(item => item.classList.add(CLASS_NAME_ACTIVE))
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
|
|
245
|
+
relatedTarget: target
|
|
246
|
+
})
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
_clear() {
|
|
250
|
+
SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target)
|
|
251
|
+
.filter(node => node.classList.contains(CLASS_NAME_ACTIVE))
|
|
252
|
+
.forEach(node => node.classList.remove(CLASS_NAME_ACTIVE))
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Static
|
|
256
|
+
|
|
257
|
+
static jQueryInterface(config) {
|
|
258
|
+
return this.each(function () {
|
|
259
|
+
const data = ScrollSpy.getOrCreateInstance(this, config)
|
|
260
|
+
|
|
261
|
+
if (typeof config !== 'string') {
|
|
262
|
+
return
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (typeof data[config] === 'undefined') {
|
|
266
|
+
throw new TypeError(`No method named "${config}"`)
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
data[config]()
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* ------------------------------------------------------------------------
|
|
276
|
+
* Data Api implementation
|
|
277
|
+
* ------------------------------------------------------------------------
|
|
278
|
+
*/
|
|
279
|
+
|
|
280
|
+
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
|
281
|
+
SelectorEngine.find(SELECTOR_DATA_SPY)
|
|
282
|
+
.forEach(spy => new ScrollSpy(spy))
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* ------------------------------------------------------------------------
|
|
287
|
+
* jQuery
|
|
288
|
+
* ------------------------------------------------------------------------
|
|
289
|
+
* add .ScrollSpy to jQuery only if jQuery is present
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
defineJQueryPlugin(ScrollSpy)
|
|
293
|
+
|
|
294
|
+
export default ScrollSpy
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-bootstrap",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "1.0.2",
|
|
6
6
|
"description": "OE - BCL bootstrap 5 sources",
|
|
7
7
|
"bin": {
|
|
8
8
|
"plugins-builder": "./bin/build-plugins.js"
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"build-plugins": "bin/build-plugins.js",
|
|
12
12
|
"clean": "rimraf js plugins scss",
|
|
13
13
|
"copy-sass": "copyfiles -u 3 \"./node_modules/bootstrap/scss/*\" \"./node_modules/bootstrap/scss/**/*\" scss",
|
|
14
|
-
"copy-js": "copyfiles -u 3 \"./node_modules/bootstrap/js/**/*\" js",
|
|
14
|
+
"copy-js": "copyfiles -u 3 \"./node_modules/bootstrap/js/**/*\" js && copyfiles -u 1 \"./legacy/**/*\" js/src",
|
|
15
15
|
"copy-icons": "copyfiles -f ./node_modules/bootstrap-icons/bootstrap-icons.svg ../bootstrap",
|
|
16
16
|
"copy-icons-svg": "copyfiles -f ./node_modules/bootstrap-icons/icons/* ../bootstrap/icons/",
|
|
17
17
|
"prepublish": "npm-run-all clean copy-* build-plugins"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@rollup/plugin-babel": "
|
|
21
|
-
"bootstrap": "5.2.
|
|
22
|
-
"bootstrap-icons": "1.
|
|
20
|
+
"@rollup/plugin-babel": "6.0.3",
|
|
21
|
+
"bootstrap": "5.2.3",
|
|
22
|
+
"bootstrap-icons": "1.10.3",
|
|
23
23
|
"copyfiles": "2.4.1",
|
|
24
24
|
"npm-run-all": "4.1.5",
|
|
25
25
|
"rimraf": "3.0.2"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"design-system",
|
|
42
42
|
"twig"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "54df3dccb26d9f6958862f06103766a0a2d78ca6"
|
|
45
45
|
}
|
package/scss/_buttons.scss
CHANGED
|
@@ -40,14 +40,20 @@
|
|
|
40
40
|
@include box-shadow(var(--#{$prefix}btn-box-shadow));
|
|
41
41
|
@include transition($btn-transition);
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
&:first-child:hover {
|
|
43
|
+
&:hover {
|
|
45
44
|
color: var(--#{$prefix}btn-hover-color);
|
|
46
45
|
text-decoration: if($link-hover-decoration == underline, none, null);
|
|
47
46
|
background-color: var(--#{$prefix}btn-hover-bg);
|
|
48
47
|
border-color: var(--#{$prefix}btn-hover-border-color);
|
|
49
48
|
}
|
|
50
49
|
|
|
50
|
+
.btn-check + &:hover {
|
|
51
|
+
// override for the checkbox/radio buttons
|
|
52
|
+
color: var(--#{$prefix}btn-color);
|
|
53
|
+
background-color: var(--#{$prefix}btn-bg);
|
|
54
|
+
border-color: var(--#{$prefix}btn-border-color);
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
&:focus-visible {
|
|
52
58
|
color: var(--#{$prefix}btn-hover-color);
|
|
53
59
|
@include gradient-bg(var(--#{$prefix}btn-hover-bg));
|
package/scss/_carousel.scss
CHANGED
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
display: block;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/* rtl:begin:ignore */
|
|
46
45
|
.carousel-item-next:not(.carousel-item-start),
|
|
47
46
|
.active.carousel-item-end {
|
|
48
47
|
transform: translateX(100%);
|
|
@@ -53,8 +52,6 @@
|
|
|
53
52
|
transform: translateX(-100%);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
/* rtl:end:ignore */
|
|
57
|
-
|
|
58
55
|
|
|
59
56
|
//
|
|
60
57
|
// Alternate transitions
|
package/scss/_functions.scss
CHANGED
|
@@ -198,7 +198,7 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
|
|
|
198
198
|
// Return opaque color
|
|
199
199
|
// opaque(#fff, rgba(0, 0, 0, .5)) => #808080
|
|
200
200
|
@function opaque($background, $foreground) {
|
|
201
|
-
@return mix(rgba($foreground, 1), $background, opacity($foreground) * 100);
|
|
201
|
+
@return mix(rgba($foreground, 1), $background, opacity($foreground) * 100%);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
// scss-docs-start color-functions
|
package/scss/_toasts.scss
CHANGED
package/scss/_variables.scss
CHANGED
|
@@ -1256,7 +1256,7 @@ $card-group-margin: $grid-gutter-width * .5 !default;
|
|
|
1256
1256
|
// scss-docs-start accordion-variables
|
|
1257
1257
|
$accordion-padding-y: 1rem !default;
|
|
1258
1258
|
$accordion-padding-x: 1.25rem !default;
|
|
1259
|
-
$accordion-color:
|
|
1259
|
+
$accordion-color: $body-color !default; // Sass variable because of $accordion-button-icon
|
|
1260
1260
|
$accordion-bg: $body-bg !default;
|
|
1261
1261
|
$accordion-border-width: $border-width !default;
|
|
1262
1262
|
$accordion-border-color: var(--#{$prefix}border-color) !default;
|
package/scss/mixins/_banner.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@mixin bsBanner($file) {
|
|
2
2
|
/*!
|
|
3
|
-
* Bootstrap #{$file} v5.2.
|
|
3
|
+
* Bootstrap #{$file} v5.2.3 (https://getbootstrap.com/)
|
|
4
4
|
* Copyright 2011-2022 The Bootstrap Authors
|
|
5
5
|
* Copyright 2011-2022 Twitter, Inc.
|
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
$hover-bg: mix($color, $background, percentage($table-hover-bg-factor));
|
|
6
6
|
$striped-bg: mix($color, $background, percentage($table-striped-bg-factor));
|
|
7
7
|
$active-bg: mix($color, $background, percentage($table-active-bg-factor));
|
|
8
|
-
$border-color: mix($color, $background, percentage($table-border-factor));
|
|
8
|
+
$table-border-color: mix($color, $background, percentage($table-border-factor));
|
|
9
9
|
|
|
10
10
|
--#{$prefix}table-color: #{$color};
|
|
11
11
|
--#{$prefix}table-bg: #{$background};
|
|
12
|
-
--#{$prefix}table-border-color: #{$border-color};
|
|
12
|
+
--#{$prefix}table-border-color: #{$table-border-color};
|
|
13
13
|
--#{$prefix}table-striped-bg: #{$striped-bg};
|
|
14
14
|
--#{$prefix}table-striped-color: #{color-contrast($striped-bg)};
|
|
15
15
|
--#{$prefix}table-active-bg: #{$active-bg};
|