@openeuropa/bcl-bootstrap 0.28.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/bootstrap-icons.svg +1 -1
  2. package/icons/0-circle-fill.svg +4 -0
  3. package/icons/0-circle.svg +4 -0
  4. package/icons/0-square-fill.svg +4 -0
  5. package/icons/0-square.svg +4 -0
  6. package/icons/1-circle-fill.svg +1 -1
  7. package/icons/amd.svg +3 -0
  8. package/icons/arrow-bar-left.svg +1 -1
  9. package/icons/arrow-bar-right.svg +1 -1
  10. package/icons/arrows-collapse.svg +1 -1
  11. package/icons/arrows-expand.svg +1 -1
  12. package/icons/building-add.svg +5 -0
  13. package/icons/building-check.svg +5 -0
  14. package/icons/building-dash.svg +5 -0
  15. package/icons/building-down.svg +5 -0
  16. package/icons/building-exclamation.svg +4 -0
  17. package/icons/building-fill-add.svg +4 -0
  18. package/icons/building-fill-check.svg +4 -0
  19. package/icons/building-fill-dash.svg +4 -0
  20. package/icons/building-fill-down.svg +4 -0
  21. package/icons/building-fill-exclamation.svg +4 -0
  22. package/icons/building-fill-gear.svg +4 -0
  23. package/icons/building-fill-lock.svg +4 -0
  24. package/icons/building-fill-slash.svg +4 -0
  25. package/icons/building-fill-up.svg +4 -0
  26. package/icons/building-fill-x.svg +4 -0
  27. package/icons/building-fill.svg +3 -0
  28. package/icons/building-gear.svg +4 -0
  29. package/icons/building-lock.svg +4 -0
  30. package/icons/building-slash.svg +5 -0
  31. package/icons/building-up.svg +5 -0
  32. package/icons/building-x.svg +4 -0
  33. package/icons/building.svg +2 -2
  34. package/icons/buildings-fill.svg +3 -0
  35. package/icons/buildings.svg +4 -0
  36. package/icons/bus-front-fill.svg +3 -0
  37. package/icons/bus-front.svg +4 -0
  38. package/icons/capsule-pill.svg +1 -1
  39. package/icons/capsule.svg +1 -1
  40. package/icons/car-front-fill.svg +1 -1
  41. package/icons/car-front.svg +1 -1
  42. package/icons/database-add.svg +4 -0
  43. package/icons/database-check.svg +4 -0
  44. package/icons/database-dash.svg +4 -0
  45. package/icons/database-down.svg +4 -0
  46. package/icons/database-exclamation.svg +4 -0
  47. package/icons/database-fill-add.svg +4 -0
  48. package/icons/database-fill-check.svg +4 -0
  49. package/icons/database-fill-dash.svg +4 -0
  50. package/icons/database-fill-down.svg +4 -0
  51. package/icons/database-fill-exclamation.svg +5 -0
  52. package/icons/database-fill-gear.svg +4 -0
  53. package/icons/database-fill-lock.svg +5 -0
  54. package/icons/database-fill-slash.svg +4 -0
  55. package/icons/database-fill-up.svg +4 -0
  56. package/icons/database-fill-x.svg +5 -0
  57. package/icons/database-fill.svg +6 -0
  58. package/icons/database-gear.svg +4 -0
  59. package/icons/database-lock.svg +4 -0
  60. package/icons/database-slash.svg +4 -0
  61. package/icons/database-up.svg +4 -0
  62. package/icons/database-x.svg +4 -0
  63. package/icons/database.svg +3 -0
  64. package/icons/envelope-at-fill.svg +4 -0
  65. package/icons/envelope-at.svg +4 -0
  66. package/icons/ev-front-fill.svg +3 -0
  67. package/icons/ev-front.svg +4 -0
  68. package/icons/globe-americas.svg +3 -0
  69. package/icons/globe-asia-australia.svg +4 -0
  70. package/icons/globe-central-south-asia.svg +3 -0
  71. package/icons/globe-europe-africa.svg +3 -0
  72. package/icons/heart-pulse-fill.svg +2 -1
  73. package/icons/heart-pulse.svg +2 -1
  74. package/icons/heartbreak-fill.svg +1 -1
  75. package/icons/heartbreak.svg +1 -1
  76. package/icons/house-add-fill.svg +5 -0
  77. package/icons/house-add.svg +4 -0
  78. package/icons/house-check-fill.svg +5 -0
  79. package/icons/house-check.svg +4 -0
  80. package/icons/house-dash-fill.svg +5 -0
  81. package/icons/house-dash.svg +4 -0
  82. package/icons/house-door-fill.svg +1 -1
  83. package/icons/house-door.svg +1 -1
  84. package/icons/house-down-fill.svg +5 -0
  85. package/icons/house-down.svg +4 -0
  86. package/icons/house-exclamation-fill.svg +5 -0
  87. package/icons/house-exclamation.svg +4 -0
  88. package/icons/house-fill.svg +2 -2
  89. package/icons/house-gear-fill.svg +5 -0
  90. package/icons/house-gear.svg +4 -0
  91. package/icons/house-lock-fill.svg +5 -0
  92. package/icons/house-lock.svg +4 -0
  93. package/icons/house-slash-fill.svg +5 -0
  94. package/icons/house-slash.svg +4 -0
  95. package/icons/house-up-fill.svg +5 -0
  96. package/icons/house-up.svg +4 -0
  97. package/icons/house-x-fill.svg +5 -0
  98. package/icons/house-x.svg +4 -0
  99. package/icons/house.svg +1 -2
  100. package/icons/houses-fill.svg +4 -0
  101. package/icons/houses.svg +3 -0
  102. package/icons/lungs-fill.svg +1 -1
  103. package/icons/nvidia.svg +3 -0
  104. package/icons/people-fill.svg +1 -3
  105. package/icons/people.svg +1 -1
  106. package/icons/person-add.svg +4 -0
  107. package/icons/person-check.svg +2 -2
  108. package/icons/person-dash.svg +2 -2
  109. package/icons/person-down.svg +4 -0
  110. package/icons/person-exclamation.svg +4 -0
  111. package/icons/person-fill-add.svg +4 -0
  112. package/icons/person-fill-check.svg +4 -0
  113. package/icons/person-fill-dash.svg +4 -0
  114. package/icons/person-fill-down.svg +4 -0
  115. package/icons/person-fill-exclamation.svg +4 -0
  116. package/icons/person-fill-gear.svg +3 -0
  117. package/icons/person-fill-lock.svg +3 -0
  118. package/icons/person-fill-slash.svg +3 -0
  119. package/icons/person-fill-up.svg +4 -0
  120. package/icons/person-fill-x.svg +4 -0
  121. package/icons/person-fill.svg +1 -1
  122. package/icons/person-gear.svg +3 -0
  123. package/icons/person-lock.svg +3 -0
  124. package/icons/person-slash.svg +3 -0
  125. package/icons/person-up.svg +4 -0
  126. package/icons/person-vcard-fill.svg +3 -0
  127. package/icons/person-vcard.svg +4 -0
  128. package/icons/person-x.svg +2 -2
  129. package/icons/person.svg +1 -1
  130. package/icons/prescription.svg +2 -2
  131. package/icons/prescription2.svg +1 -1
  132. package/icons/regex.svg +3 -0
  133. package/icons/rocket-fill.svg +4 -0
  134. package/icons/rocket-takeoff-fill.svg +4 -0
  135. package/icons/rocket-takeoff.svg +5 -0
  136. package/icons/rocket.svg +5 -0
  137. package/icons/scooter.svg +3 -0
  138. package/icons/sign-dead-end-fill.svg +4 -0
  139. package/icons/sign-dead-end.svg +4 -0
  140. package/icons/sign-do-not-enter-fill.svg +4 -0
  141. package/icons/sign-do-not-enter.svg +4 -0
  142. package/icons/sign-intersection-fill.svg +3 -0
  143. package/icons/sign-intersection-side-fill.svg +3 -0
  144. package/icons/sign-intersection-side.svg +4 -0
  145. package/icons/sign-intersection-t-fill.svg +3 -0
  146. package/icons/sign-intersection-t.svg +4 -0
  147. package/icons/sign-intersection-y-fill.svg +3 -0
  148. package/icons/sign-intersection-y.svg +4 -0
  149. package/icons/sign-intersection.svg +4 -0
  150. package/icons/sign-merge-left-fill.svg +3 -0
  151. package/icons/sign-merge-left.svg +4 -0
  152. package/icons/sign-merge-right-fill.svg +3 -0
  153. package/icons/sign-merge-right.svg +4 -0
  154. package/icons/sign-no-left-turn-fill.svg +4 -0
  155. package/icons/sign-no-left-turn.svg +3 -0
  156. package/icons/sign-no-parking-fill.svg +4 -0
  157. package/icons/sign-no-parking.svg +3 -0
  158. package/icons/sign-no-right-turn-fill.svg +4 -0
  159. package/icons/sign-no-right-turn.svg +3 -0
  160. package/icons/sign-railroad-fill.svg +5 -0
  161. package/icons/sign-railroad.svg +4 -0
  162. package/icons/sign-stop-fill.svg +1 -1
  163. package/icons/sign-stop-lights-fill.svg +1 -1
  164. package/icons/sign-turn-left-fill.svg +1 -1
  165. package/icons/sign-turn-right-fill.svg +1 -1
  166. package/icons/sign-turn-slight-left-fill.svg +1 -1
  167. package/icons/sign-turn-slight-right-fill.svg +1 -1
  168. package/icons/sign-yield-fill.svg +1 -1
  169. package/icons/sina-weibo.svg +4 -0
  170. package/icons/stripe.svg +3 -0
  171. package/icons/subscript.svg +3 -0
  172. package/icons/superscript.svg +3 -0
  173. package/icons/taxi-front-fill.svg +3 -0
  174. package/icons/taxi-front.svg +4 -0
  175. package/icons/tencent-qq.svg +4 -0
  176. package/icons/text-wrap.svg +3 -0
  177. package/icons/train-freight-front-fill.svg +1 -1
  178. package/icons/train-freight-front.svg +1 -1
  179. package/icons/train-front-fill.svg +1 -1
  180. package/icons/train-front.svg +1 -1
  181. package/icons/train-lightrail-front-fill.svg +1 -1
  182. package/icons/train-lightrail-front.svg +1 -1
  183. package/icons/trello.svg +3 -0
  184. package/icons/truck-front-fill.svg +1 -1
  185. package/icons/truck-front.svg +2 -3
  186. package/icons/virus.svg +1 -1
  187. package/icons/virus2.svg +1 -1
  188. package/icons/wikipedia.svg +3 -0
  189. package/js/dist/alert.js +14 -25
  190. package/js/dist/alert.js.map +1 -1
  191. package/js/dist/base-component.js +13 -30
  192. package/js/dist/base-component.js.map +1 -1
  193. package/js/dist/button.js +11 -15
  194. package/js/dist/button.js.map +1 -1
  195. package/js/dist/carousel.js +36 -120
  196. package/js/dist/carousel.js.map +1 -1
  197. package/js/dist/collapse.js +27 -88
  198. package/js/dist/collapse.js.map +1 -1
  199. package/js/dist/dependency/manipulator.js +72 -0
  200. package/js/dist/dependency/manipulator.js.map +1 -0
  201. package/js/dist/dom/data.js +6 -10
  202. package/js/dist/dom/data.js.map +1 -1
  203. package/js/dist/dom/event-handler.js +7 -52
  204. package/js/dist/dom/event-handler.js.map +1 -1
  205. package/js/dist/dom/manipulator.js +2 -15
  206. package/js/dist/dom/manipulator.js.map +1 -1
  207. package/js/dist/dom/selector-engine.js +2 -16
  208. package/js/dist/dom/selector-engine.js.map +1 -1
  209. package/js/dist/dropdown.js +52 -124
  210. package/js/dist/dropdown.js.map +1 -1
  211. package/js/dist/modal.js +40 -119
  212. package/js/dist/modal.js.map +1 -1
  213. package/js/dist/offcanvas.js +36 -89
  214. package/js/dist/offcanvas.js.map +1 -1
  215. package/js/dist/popover.js +15 -22
  216. package/js/dist/popover.js.map +1 -1
  217. package/js/dist/scrollspy-legacy.js +216 -0
  218. package/js/dist/scrollspy-legacy.js.map +1 -0
  219. package/js/dist/scrollspy.js +42 -80
  220. package/js/dist/scrollspy.js.map +1 -1
  221. package/js/dist/tab.js +40 -98
  222. package/js/dist/tab.js.map +1 -1
  223. package/js/dist/toast.js +30 -69
  224. package/js/dist/toast.js.map +1 -1
  225. package/js/dist/tooltip.js +74 -196
  226. package/js/dist/tooltip.js.map +1 -1
  227. package/js/dist/util/backdrop.js +13 -40
  228. package/js/dist/util/backdrop.js.map +1 -1
  229. package/js/dist/util/component-functions.js +5 -11
  230. package/js/dist/util/component-functions.js.map +1 -1
  231. package/js/dist/util/config.js +6 -18
  232. package/js/dist/util/config.js.map +1 -1
  233. package/js/dist/util/focustrap.js +16 -33
  234. package/js/dist/util/focustrap.js.map +1 -1
  235. package/js/dist/util/index.js +28 -75
  236. package/js/dist/util/index.js.map +1 -1
  237. package/js/dist/util/sanitizer.js +7 -17
  238. package/js/dist/util/sanitizer.js.map +1 -1
  239. package/js/dist/util/scrollbar.js +16 -43
  240. package/js/dist/util/scrollbar.js.map +1 -1
  241. package/js/dist/util/swipe.js +18 -40
  242. package/js/dist/util/swipe.js.map +1 -1
  243. package/js/dist/util/template-factory.js +13 -41
  244. package/js/dist/util/template-factory.js.map +1 -1
  245. package/js/src/alert.js +1 -1
  246. package/js/src/base-component.js +2 -2
  247. package/js/src/button.js +1 -1
  248. package/js/src/carousel.js +1 -1
  249. package/js/src/collapse.js +1 -1
  250. package/js/src/dependency/manipulator.js +80 -0
  251. package/js/src/dom/data.js +1 -1
  252. package/js/src/dom/event-handler.js +1 -1
  253. package/js/src/dom/manipulator.js +1 -1
  254. package/js/src/dom/selector-engine.js +1 -1
  255. package/js/src/dropdown.js +10 -3
  256. package/js/src/modal.js +3 -3
  257. package/js/src/offcanvas.js +1 -1
  258. package/js/src/popover.js +1 -1
  259. package/js/src/scrollspy-legacy.js +294 -0
  260. package/js/src/scrollspy.js +1 -1
  261. package/js/src/tab.js +2 -4
  262. package/js/src/toast.js +9 -4
  263. package/js/src/tooltip.js +27 -48
  264. package/js/src/util/backdrop.js +1 -1
  265. package/js/src/util/component-functions.js +1 -1
  266. package/js/src/util/config.js +1 -1
  267. package/js/src/util/focustrap.js +1 -1
  268. package/js/src/util/index.js +1 -1
  269. package/js/src/util/sanitizer.js +1 -1
  270. package/js/src/util/scrollbar.js +1 -1
  271. package/js/src/util/swipe.js +1 -1
  272. package/js/src/util/template-factory.js +1 -1
  273. package/legacy/dependency/manipulator.js +80 -0
  274. package/legacy/scrollspy-legacy.js +294 -0
  275. package/package.json +6 -6
  276. package/scss/_buttons.scss +8 -2
  277. package/scss/_carousel.scss +0 -3
  278. package/scss/_functions.scss +1 -1
  279. package/scss/_toasts.scss +2 -0
  280. package/scss/_variables.scss +1 -1
  281. package/scss/bootstrap-utilities.scss +3 -0
  282. package/scss/mixins/_banner.scss +1 -1
  283. 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.28.0",
5
+ "version": "1.0.0",
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": "5.3.1",
21
- "bootstrap": "5.2.1",
22
- "bootstrap-icons": "1.9.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": "9ceb916258c8c7331f37bbb7c4380a2121440e12"
44
+ "gitHead": "16b986722345644e83a37dc8091c07eecbdf4c8c"
45
45
  }
@@ -40,14 +40,20 @@
40
40
  @include box-shadow(var(--#{$prefix}btn-box-shadow));
41
41
  @include transition($btn-transition);
42
42
 
43
- :not(.btn-check) + &:hover,
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));
@@ -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
@@ -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
@@ -38,6 +38,8 @@
38
38
  }
39
39
 
40
40
  .toast-container {
41
+ --#{$prefix}toast-zindex: #{$zindex-toast};
42
+
41
43
  position: absolute;
42
44
  z-index: var(--#{$prefix}toast-zindex);
43
45
  width: max-content;
@@ -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: var(--#{$prefix}body-color) !default;
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;
@@ -8,6 +8,9 @@
8
8
  @import "mixins";
9
9
  @import "utilities";
10
10
 
11
+ // Layout & components
12
+ @import "root";
13
+
11
14
  // Helpers
12
15
  @import "helpers";
13
16
 
@@ -1,6 +1,6 @@
1
1
  @mixin bsBanner($file) {
2
2
  /*!
3
- * Bootstrap #{$file} v5.2.1 (https://getbootstrap.com/)
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};