@openeuropa/bcl-theme-default 0.4230.202512021730 → 0.4360.202601141610
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/css/oe-bcl-ckeditor5.min.css +1 -1
- package/css/oe-bcl-ckeditor5.min.css.map +1 -1
- package/css/oe-bcl-default.css +61 -48
- package/css/oe-bcl-default.css.map +1 -1
- package/css/oe-bcl-default.min.css +1 -1
- package/css/oe-bcl-default.min.css.map +1 -1
- package/js/oe-bcl-default.bundle.js +112 -1
- package/js/oe-bcl-default.bundle.js.map +1 -1
- package/js/oe-bcl-default.bundle.min.js +1 -1
- package/js/oe-bcl-default.bundle.min.js.map +1 -1
- package/js/oe-bcl-default.esm.js +111 -1
- package/js/oe-bcl-default.esm.js.map +1 -1
- package/js/oe-bcl-default.esm.min.js +1 -1
- package/js/oe-bcl-default.esm.min.js.map +1 -1
- package/js/oe-bcl-default.umd.js +112 -1
- package/js/oe-bcl-default.umd.js.map +1 -1
- package/js/oe-bcl-default.umd.min.js +1 -1
- package/js/oe-bcl-default.umd.min.js.map +1 -1
- package/package.json +5 -5
- package/src/js/header/header.js +91 -0
- package/src/js/index.esm.js +2 -0
- package/src/js/index.umd.js +2 -0
- package/src/js/mega-menu/mega-menu.js +57 -0
- package/src/scss/_header.scss +6 -2
- package/src/scss/_mega-menu.scss +57 -58
- package/src/scss/base/_colors.scss +1 -0
- package/templates/bcl-accordion/accordion.html.twig +42 -43
- package/templates/bcl-alert/alert.html.twig +18 -18
- package/templates/bcl-badge/badge.html.twig +11 -12
- package/templates/bcl-banner/banner.html.twig +34 -34
- package/templates/bcl-base-templates/content-type.html.twig +63 -64
- package/templates/bcl-base-templates/listing-page.html.twig +31 -31
- package/templates/bcl-base-templates/sidebar-search.html.twig +10 -10
- package/templates/bcl-blockquote/blockquote.html.twig +17 -17
- package/templates/bcl-breadcrumb/breadcrumb.html.twig +24 -25
- package/templates/bcl-button/button.html.twig +24 -24
- package/templates/bcl-button-group/button-group.html.twig +25 -26
- package/templates/bcl-card/card.html.twig +98 -98
- package/templates/bcl-card-layout/card-layout.html.twig +34 -34
- package/templates/bcl-carousel/carousel.html.twig +64 -64
- package/templates/bcl-contact-form/contact-form.html.twig +1 -1
- package/templates/bcl-content-banner/content-banner.html.twig +37 -37
- package/templates/bcl-date-block/date-block.html.twig +26 -26
- package/templates/bcl-description-list/description-list-details.html.twig +6 -6
- package/templates/bcl-description-list/description-list-title.html.twig +11 -11
- package/templates/bcl-description-list/description-list.html.twig +44 -45
- package/templates/bcl-dropdown/dropdown.html.twig +48 -49
- package/templates/bcl-event/event.html.twig +7 -7
- package/templates/bcl-fact-figures/fact-figures.html.twig +34 -34
- package/templates/bcl-featured-media/featured-media.html.twig +42 -43
- package/templates/bcl-file/file-translations.html.twig +29 -29
- package/templates/bcl-file/file.html.twig +46 -46
- package/templates/bcl-footer/footer.html.twig +31 -31
- package/templates/bcl-form/form.html.twig +70 -70
- package/templates/bcl-form-input/form-input.html.twig +57 -58
- package/templates/bcl-gallery/gallery-item.html.twig +20 -20
- package/templates/bcl-gallery/gallery.html.twig +62 -63
- package/templates/bcl-glossary/glossary-detail.html.twig +19 -19
- package/templates/bcl-glossary/glossary-listing.html.twig +6 -6
- package/templates/bcl-group/group-landing.html.twig +69 -69
- package/templates/bcl-group/group.html.twig +19 -19
- package/templates/bcl-header/header.html.twig +71 -79
- package/templates/bcl-heading/heading.html.twig +13 -14
- package/templates/bcl-icon/icon.html.twig +10 -10
- package/templates/bcl-inpage-navigation/inpage-navigation.html.twig +20 -20
- package/templates/bcl-landing-page/landing-page.html.twig +33 -33
- package/templates/bcl-language-list/language-list-grid.html.twig +25 -25
- package/templates/bcl-language-list/language-list-modal.html.twig +52 -52
- package/templates/bcl-language-list/language-list.html.twig +33 -34
- package/templates/bcl-language-switcher/language-switcher.html.twig +12 -12
- package/templates/bcl-link/link.html.twig +24 -24
- package/templates/bcl-links-block/links-block.html.twig +29 -30
- package/templates/bcl-list-group/list-group.html.twig +43 -44
- package/templates/bcl-listing/listing.html.twig +88 -88
- package/templates/bcl-mega-menu/mega-menu-items.html.twig +18 -18
- package/templates/bcl-mega-menu/mega-menu-submenu.html.twig +27 -22
- package/templates/bcl-mega-menu/mega-menu.html.twig +37 -35
- package/templates/bcl-modal/modal.html.twig +17 -17
- package/templates/bcl-navbar/navbar.html.twig +35 -35
- package/templates/bcl-navigation/navigation.html.twig +106 -106
- package/templates/bcl-offcanvas/offcanvas.html.twig +33 -33
- package/templates/bcl-page/page.html.twig +27 -27
- package/templates/bcl-pagination/pagination-item.html.twig +22 -23
- package/templates/bcl-pagination/pagination.html.twig +59 -59
- package/templates/bcl-pagination-v2/pagination-item.html.twig +31 -32
- package/templates/bcl-pagination-v2/pagination.html.twig +79 -79
- package/templates/bcl-person/person.html.twig +12 -12
- package/templates/bcl-placeholder/placeholder.html.twig +14 -15
- package/templates/bcl-progress/progress.html.twig +16 -17
- package/templates/bcl-project/project-lists.html.twig +25 -25
- package/templates/bcl-project/project.html.twig +35 -35
- package/templates/bcl-project-status/project-contributions.html.twig +25 -25
- package/templates/bcl-project-status/project-status.html.twig +32 -34
- package/templates/bcl-recent-activities/recent-activities.html.twig +13 -13
- package/templates/bcl-search/search.html.twig +12 -12
- package/templates/bcl-search-form/search-form.html.twig +21 -21
- package/templates/bcl-select/select.html.twig +52 -53
- package/templates/bcl-spinner/spinner.html.twig +10 -10
- package/templates/bcl-subscription/subscription-modal.html.twig +7 -7
- package/templates/bcl-subscription/subscription.html.twig +3 -3
- package/templates/bcl-subscription-block/subscription-block.html.twig +14 -14
- package/templates/bcl-table/table.html.twig +61 -62
- package/templates/bcl-textarea/textarea.html.twig +44 -44
- package/templates/bcl-timeline/timeline-item.html.twig +12 -12
- package/templates/bcl-timeline/timeline.html.twig +42 -42
- package/templates/bcl-toasts/toasts.html.twig +56 -57
- package/templates/bcl-user/user-compact.html.twig +24 -24
- package/templates/bcl-user/user-terms.html.twig +6 -6
- package/templates/bcl-user/user.html.twig +117 -117
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@openeuropa/bcl-theme-default",
|
|
3
3
|
"author": "European Commission",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.4360.202601141610",
|
|
6
6
|
"description": "OE - BCL theme default",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"align-templates": "lerna --scope \"@openeuropa/bcl-twig-templates\" run prepublish",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"@ecl/resources-ec-logo": "3.7.1",
|
|
23
23
|
"@ecl/resources-eu-logo": "3.7.1",
|
|
24
24
|
"@ecl/resources-flag-icons": "3.7.1",
|
|
25
|
-
"@openeuropa/bcl-bootstrap": "^0.
|
|
26
|
-
"@openeuropa/bcl-builder": "^0.
|
|
27
|
-
"@openeuropa/bcl-twig-templates": "^0.
|
|
25
|
+
"@openeuropa/bcl-bootstrap": "^0.4360.202601141610",
|
|
26
|
+
"@openeuropa/bcl-builder": "^0.4360.202601141610",
|
|
27
|
+
"@openeuropa/bcl-twig-templates": "^0.4360.202601141610",
|
|
28
28
|
"@rollup/plugin-replace": "6.0.2",
|
|
29
29
|
"copyfiles": "2.4.1",
|
|
30
30
|
"cross-env": "10.1.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"design-system",
|
|
52
52
|
"twig"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "2caf9255f88587416f6e83e572a1f20e4cf206f5"
|
|
55
55
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import EventHandler from "@openeuropa/bcl-bootstrap/js/src/dom/event-handler";
|
|
2
|
+
import SelectorEngine from "@openeuropa/bcl-bootstrap/js/src/dom/selector-engine";
|
|
3
|
+
|
|
4
|
+
const HEADER_SELECTOR = ".bcl-header";
|
|
5
|
+
const TOGGLER_SELECTOR = ".bcl-navbar-toggler";
|
|
6
|
+
const OFFSET_VARIABLE = "--oel-mega-menu-offset-top";
|
|
7
|
+
|
|
8
|
+
class Header {
|
|
9
|
+
scheduleUpdate = () => {
|
|
10
|
+
if (this.frameRequest) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
this.frameRequest = window.requestAnimationFrame(() => {
|
|
15
|
+
this.frameRequest = null;
|
|
16
|
+
this.updateOffset();
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
constructor(element) {
|
|
21
|
+
this.element = element;
|
|
22
|
+
this.frameRequest = null;
|
|
23
|
+
this.resizeObserver = null;
|
|
24
|
+
|
|
25
|
+
this.init();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
init() {
|
|
29
|
+
this.updateOffset();
|
|
30
|
+
|
|
31
|
+
EventHandler.on(window, "resize", this.scheduleUpdate);
|
|
32
|
+
EventHandler.on(window, "orientationchange", this.scheduleUpdate);
|
|
33
|
+
|
|
34
|
+
const togglers = SelectorEngine.find(TOGGLER_SELECTOR, this.element);
|
|
35
|
+
togglers.forEach((toggler) => {
|
|
36
|
+
// Some layouts move the header when the nav toggler expands; keep offset in sync.
|
|
37
|
+
EventHandler.on(toggler, "click", this.scheduleUpdate);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
updateOffset() {
|
|
42
|
+
if (!this.element) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const rect = this.element.getBoundingClientRect();
|
|
47
|
+
const offset = Math.max(0, rect.top);
|
|
48
|
+
const value = `${offset}px`;
|
|
49
|
+
|
|
50
|
+
if (this.element.style.getPropertyValue(OFFSET_VARIABLE) === value) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
this.element.style.setProperty(OFFSET_VARIABLE, value);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static init(root) {
|
|
58
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const resolvedRoot = root || document;
|
|
63
|
+
const context =
|
|
64
|
+
resolvedRoot instanceof Element
|
|
65
|
+
? resolvedRoot
|
|
66
|
+
: resolvedRoot.documentElement || document.documentElement;
|
|
67
|
+
|
|
68
|
+
const headers = SelectorEngine.find(HEADER_SELECTOR, context);
|
|
69
|
+
|
|
70
|
+
headers.forEach((headerElement) => {
|
|
71
|
+
if (headerElement.dataset.headerOffsetInitialized === "true") {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
headerElement.dataset.headerOffsetInitialized = "true";
|
|
76
|
+
new Header(headerElement);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (typeof document !== "undefined") {
|
|
82
|
+
const initializeHeaderOffset = () => Header.init();
|
|
83
|
+
|
|
84
|
+
if (document.readyState === "loading") {
|
|
85
|
+
document.addEventListener("DOMContentLoaded", initializeHeaderOffset);
|
|
86
|
+
} else {
|
|
87
|
+
initializeHeaderOffset();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default Header;
|
package/src/js/index.esm.js
CHANGED
|
@@ -23,6 +23,7 @@ import Tooltip from "@openeuropa/bcl-bootstrap/js/src/tooltip";
|
|
|
23
23
|
import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
|
|
24
24
|
import AccordionToggle from "@openeuropa/bcl-theme-default/src/js/accordion-toggle/accordion-toggle";
|
|
25
25
|
import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
|
|
26
|
+
import Header from "@openeuropa/bcl-theme-default/src/js/header/header";
|
|
26
27
|
|
|
27
28
|
export {
|
|
28
29
|
Alert,
|
|
@@ -43,4 +44,5 @@ export {
|
|
|
43
44
|
Gallery,
|
|
44
45
|
AccessibleToggle,
|
|
45
46
|
AccordionToggle,
|
|
47
|
+
Header,
|
|
46
48
|
};
|
package/src/js/index.umd.js
CHANGED
|
@@ -23,6 +23,7 @@ import Tooltip from "@openeuropa/bcl-bootstrap/js/src/tooltip";
|
|
|
23
23
|
import AccordionToggle from "@openeuropa/bcl-theme-default/src/js/accordion-toggle/accordion-toggle";
|
|
24
24
|
import Gallery from "@openeuropa/bcl-theme-default/src/js/gallery/gallery";
|
|
25
25
|
import AccessibleToggle from "@openeuropa/bcl-theme-default/src/js/accessible-toggle/accessible-toggle";
|
|
26
|
+
import Header from "@openeuropa/bcl-theme-default/src/js/header/header";
|
|
26
27
|
|
|
27
28
|
export default {
|
|
28
29
|
Alert,
|
|
@@ -43,4 +44,5 @@ export default {
|
|
|
43
44
|
Gallery,
|
|
44
45
|
AccessibleToggle,
|
|
45
46
|
AccordionToggle,
|
|
47
|
+
Header,
|
|
46
48
|
};
|
|
@@ -2,15 +2,33 @@ import Dropdown from "@openeuropa/bcl-bootstrap/js/src/dropdown";
|
|
|
2
2
|
import SelectorEngine from "@openeuropa/bcl-bootstrap/js/src/dom/selector-engine";
|
|
3
3
|
import EventHandler from "@openeuropa/bcl-bootstrap/js/src/dom/event-handler";
|
|
4
4
|
|
|
5
|
+
const SUBMENU_HEIGHT_VARIABLE = "--oel-mega-menu-submenu-height";
|
|
6
|
+
const SUBMENU_BODY_SELECTOR = ".__submenu_body";
|
|
7
|
+
|
|
5
8
|
class MegaMenu {
|
|
9
|
+
scheduleSubmenuHeightUpdate = () => {
|
|
10
|
+
if (this.submenuHeightFrame) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
this.submenuHeightFrame = window.requestAnimationFrame(() => {
|
|
15
|
+
this.submenuHeightFrame = null;
|
|
16
|
+
this.updateSubmenuHeight();
|
|
17
|
+
});
|
|
18
|
+
};
|
|
6
19
|
|
|
7
20
|
constructor(root) {
|
|
8
21
|
this.root = root;
|
|
22
|
+
this.submenuHeightFrame = null;
|
|
23
|
+
this.submenuBodies = SelectorEngine.find(SUBMENU_BODY_SELECTOR, this.root);
|
|
9
24
|
|
|
10
25
|
this.backButton = SelectorEngine.findOne(".back-button", this.root);
|
|
11
26
|
this.trigger = SelectorEngine.findOne(':scope > .dropdown-toggle[data-bs-toggle="dropdown"]', this.root);
|
|
12
27
|
this.ul = SelectorEngine.findOne('.bcl-mega-menu__items.__level-1', this.root);
|
|
13
28
|
|
|
29
|
+
EventHandler.on(window, "resize", this.scheduleSubmenuHeightUpdate);
|
|
30
|
+
EventHandler.on(window, "orientationchange", this.scheduleSubmenuHeightUpdate);
|
|
31
|
+
|
|
14
32
|
this.addSubmenuTriggerListeners();
|
|
15
33
|
this.addBackButtonListener();
|
|
16
34
|
this.addTriggerListeners();
|
|
@@ -73,6 +91,7 @@ class MegaMenu {
|
|
|
73
91
|
|
|
74
92
|
// When the mega menu is opened, focus the first item in the menu.
|
|
75
93
|
EventHandler.on(this.trigger, 'shown.bs.dropdown', () => {
|
|
94
|
+
this.scheduleSubmenuHeightUpdate();
|
|
76
95
|
const panelId = this.trigger.getAttribute('aria-controls');
|
|
77
96
|
const panel = panelId ? document.getElementById(panelId) : null;
|
|
78
97
|
const firstFocusable = panel ? this.getFocusableChildren(panel)[0] : null;
|
|
@@ -136,6 +155,7 @@ class MegaMenu {
|
|
|
136
155
|
trigger.setAttribute('aria-expanded', 'true');
|
|
137
156
|
const panel = this.getPanelForTrigger(trigger);
|
|
138
157
|
if (panel) panel.hidden = false;
|
|
158
|
+
this.scheduleSubmenuHeightUpdate();
|
|
139
159
|
}
|
|
140
160
|
|
|
141
161
|
/**
|
|
@@ -164,6 +184,43 @@ class MegaMenu {
|
|
|
164
184
|
if (panel) panel.hidden = true;
|
|
165
185
|
}
|
|
166
186
|
|
|
187
|
+
updateSubmenuHeight() {
|
|
188
|
+
if (!this.trigger || this.trigger.getAttribute('aria-expanded') !== 'true') {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (!this.submenuBodies || this.submenuBodies.length === 0) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const viewportHeight =
|
|
197
|
+
(document.documentElement && document.documentElement.clientHeight) ||
|
|
198
|
+
window.innerHeight ||
|
|
199
|
+
0;
|
|
200
|
+
|
|
201
|
+
if (!viewportHeight) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
this.submenuBodies.forEach((submenuBody) => {
|
|
206
|
+
if (!submenuBody.isConnected || submenuBody.closest('[hidden]')) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const rect = submenuBody.getBoundingClientRect();
|
|
211
|
+
const visibleTop = Math.max(rect.top, 0);
|
|
212
|
+
// Use the distance to the viewport bottom instead of the current element
|
|
213
|
+
// height. Nested submenus inherit the parent max-height, so relying on
|
|
214
|
+
// rect.bottom would keep the parent's value and never recalc for children.
|
|
215
|
+
const availableHeight = Math.max(0, viewportHeight - visibleTop);
|
|
216
|
+
const value = `${availableHeight}px`;
|
|
217
|
+
|
|
218
|
+
if (submenuBody.style.getPropertyValue(SUBMENU_HEIGHT_VARIABLE) !== value) {
|
|
219
|
+
submenuBody.style.setProperty(SUBMENU_HEIGHT_VARIABLE, value);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
167
224
|
static init(selector = ".bcl-mega-menu") {
|
|
168
225
|
const megaMenus = SelectorEngine.find(selector);
|
|
169
226
|
megaMenus.forEach((menuEl) => new MegaMenu(menuEl));
|
package/src/scss/_header.scss
CHANGED
|
@@ -46,6 +46,7 @@ $header-link-active-background: #003776 !default;
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.bcl-header {
|
|
49
|
+
--oel-mega-menu-offset-top: 0px;
|
|
49
50
|
.notification {
|
|
50
51
|
position: relative;
|
|
51
52
|
padding-right: 0;
|
|
@@ -96,10 +97,9 @@ $header-link-active-background: #003776 !default;
|
|
|
96
97
|
header:has(.bcl-header__navbar #main-navbar.show),
|
|
97
98
|
header:has(.bcl-header__navbar.collapsing),
|
|
98
99
|
header:has(.bcl-header__navbar.show) {
|
|
99
|
-
height: 100vh;
|
|
100
|
+
height: calc(100vh - var(--oel-mega-menu-offset-top, 0px));
|
|
100
101
|
display: flex;
|
|
101
102
|
flex-flow: column;
|
|
102
|
-
overflow: auto;
|
|
103
103
|
|
|
104
104
|
> div:has(.breadcrumb) {
|
|
105
105
|
display: none;
|
|
@@ -127,6 +127,10 @@ $header-link-active-background: #003776 !default;
|
|
|
127
127
|
z-index: 1030;
|
|
128
128
|
width: 100%;
|
|
129
129
|
align-items: flex-start;
|
|
130
|
+
height: 100%;
|
|
131
|
+
&:not(:has(.bcl-mega-menu__container.show)) {
|
|
132
|
+
overflow: auto;
|
|
133
|
+
}
|
|
130
134
|
.navbar-nav {
|
|
131
135
|
width: 100%;
|
|
132
136
|
margin-top: 1rem;
|
package/src/scss/_mega-menu.scss
CHANGED
|
@@ -193,6 +193,8 @@ ul.bcl-mega-menu__items {
|
|
|
193
193
|
@include media-breakpoint-up(lg) {
|
|
194
194
|
block-size: $mm-panel-height;
|
|
195
195
|
overflow-y: auto;
|
|
196
|
+
scrollbar-color: $primary-bg-light-subtle transparent;
|
|
197
|
+
scrollbar-width: thin;
|
|
196
198
|
}
|
|
197
199
|
// Add space above in mobile viewport.
|
|
198
200
|
@include media-breakpoint-down(lg) {
|
|
@@ -275,34 +277,6 @@ ul.bcl-mega-menu__items {
|
|
|
275
277
|
}
|
|
276
278
|
}
|
|
277
279
|
}
|
|
278
|
-
|
|
279
|
-
// The see-all link is at the bottom of the list.
|
|
280
|
-
&:has(> a.see-all-button) {
|
|
281
|
-
position: sticky;
|
|
282
|
-
inset-block-start: 100%;
|
|
283
|
-
}
|
|
284
|
-
> a.see-all-button {
|
|
285
|
-
border-top: none;
|
|
286
|
-
&:after {
|
|
287
|
-
background: $neutral-border-color;
|
|
288
|
-
content: "";
|
|
289
|
-
block-size: 1px;
|
|
290
|
-
inset-inline-start: 0;
|
|
291
|
-
position: absolute;
|
|
292
|
-
inset-block-start: 0;
|
|
293
|
-
// Replicate horizontal padding of parent element.
|
|
294
|
-
inset-inline: $mm-gutter-x;
|
|
295
|
-
}
|
|
296
|
-
> svg {
|
|
297
|
-
inline-size: 0.8rem;
|
|
298
|
-
}
|
|
299
|
-
> span {
|
|
300
|
-
text-overflow: ellipsis;
|
|
301
|
-
overflow: hidden;
|
|
302
|
-
display: block;
|
|
303
|
-
white-space: nowrap;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
280
|
}
|
|
307
281
|
}
|
|
308
282
|
|
|
@@ -314,6 +288,21 @@ ul.bcl-mega-menu__items {
|
|
|
314
288
|
// Avoid a space between the parent menu and the submenu.
|
|
315
289
|
@include padding-right(0);
|
|
316
290
|
}
|
|
291
|
+
@include media-breakpoint-down(lg) {
|
|
292
|
+
> .bcl-mega-menu__items {
|
|
293
|
+
&:has(.bcl-mega-menu__submenu:not([hidden])) {
|
|
294
|
+
> .__leaf,
|
|
295
|
+
> .__parent {
|
|
296
|
+
display: none;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
> .__parent {
|
|
300
|
+
&:has(.bcl-mega-menu__submenu:not([hidden])) {
|
|
301
|
+
display: block;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
317
306
|
}
|
|
318
307
|
|
|
319
308
|
// Nested submenu.
|
|
@@ -372,40 +361,42 @@ ul.bcl-mega-menu__items {
|
|
|
372
361
|
}
|
|
373
362
|
}
|
|
374
363
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
@include media-breakpoint-up(lg) {
|
|
382
|
-
background: $primary-bg-subtle;
|
|
383
|
-
}
|
|
384
|
-
// Hide other parts of the mega menu in mobile, when a sub-submenu is open.
|
|
385
|
-
@include media-breakpoint-down(lg) {
|
|
386
|
-
.bcl-mega-menu__container:has(&.active) {
|
|
387
|
-
.bcl-mega-menu__info,
|
|
388
|
-
.bcl-mega-menu__first-submenu {
|
|
389
|
-
display: none;
|
|
390
|
-
}
|
|
364
|
+
@include media-breakpoint-up(lg) {
|
|
365
|
+
> .bcl-mega-menu__items {
|
|
366
|
+
flex: 1 1 0;
|
|
367
|
+
overflow-y: auto;
|
|
368
|
+
> li > :is(span, a, button) {
|
|
369
|
+
@include mm-item-padding($px: map-get($spacers, "4-25"));
|
|
391
370
|
}
|
|
392
371
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
372
|
+
}
|
|
373
|
+
.__see_all {
|
|
374
|
+
border-top: 1px solid $neutral-border-color;
|
|
375
|
+
@include media-breakpoint-up(lg) {
|
|
376
|
+
border-top: 1px solid $primary-border-subtle;
|
|
377
|
+
margin: 0 map-get($spacers, "4-25");
|
|
378
|
+
}
|
|
379
|
+
> .see-all-button {
|
|
380
|
+
@include mm-item-padding();
|
|
381
|
+
// Use flex for icon spacing.
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
color: $link-color;
|
|
401
385
|
@include media-breakpoint-up(lg) {
|
|
402
|
-
|
|
386
|
+
padding: $mm-gutter-y map-get($spacers, "4-25");
|
|
387
|
+
margin: 0 -1.75rem;
|
|
403
388
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
>
|
|
408
|
-
|
|
389
|
+
&:hover {
|
|
390
|
+
background: $primary-bg-subtle;
|
|
391
|
+
}
|
|
392
|
+
> svg {
|
|
393
|
+
flex-shrink: 0;
|
|
394
|
+
}
|
|
395
|
+
> span {
|
|
396
|
+
text-overflow: ellipsis;
|
|
397
|
+
overflow: hidden;
|
|
398
|
+
display: block;
|
|
399
|
+
white-space: nowrap;
|
|
409
400
|
}
|
|
410
401
|
}
|
|
411
402
|
}
|
|
@@ -429,4 +420,12 @@ ul.bcl-mega-menu__items {
|
|
|
429
420
|
transform: translateX(-50%);
|
|
430
421
|
}
|
|
431
422
|
}
|
|
423
|
+
.bcl-mega-menu {
|
|
424
|
+
.__submenu_body {
|
|
425
|
+
max-height: var(--oel-mega-menu-submenu-height);
|
|
426
|
+
overflow: auto;
|
|
427
|
+
scrollbar-color: $primary-bg-light-subtle transparent;
|
|
428
|
+
scrollbar-width: thin;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
432
431
|
}
|
|
@@ -25,6 +25,7 @@ $neutral-border-color: #b9c5e9;
|
|
|
25
25
|
$table-hover-bg-factor: 0.1;
|
|
26
26
|
|
|
27
27
|
// Background colors as before for Alerts and list-group
|
|
28
|
+
$primary-bg-light-subtle: tint-color($primary, 70%);
|
|
28
29
|
$primary-bg-subtle: tint-color($primary, 90%);
|
|
29
30
|
$secondary-bg-subtle: tint-color($secondary, 90%);
|
|
30
31
|
$success-bg-subtle: tint-color($success, 90%);
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- attributes (drupal attrs)
|
|
21
21
|
#}
|
|
22
22
|
|
|
23
|
-
{
|
|
23
|
+
{%- set _title = title|default('') %}
|
|
24
24
|
{% set _title_tag = title_tag|default('h2') %}
|
|
25
25
|
{% set _title_link = title_link|default({}) %}
|
|
26
26
|
{% set _title_attributes = title_attributes ?: create_attribute() %}
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
{% set _open_item_id = open_item_id|default(0) %}
|
|
33
33
|
{% set _classes = ['accordion'] %}
|
|
34
34
|
{% if _flush %}
|
|
35
|
-
{
|
|
35
|
+
{%- set _classes = _classes|merge(['accordion-flush']) %}
|
|
36
36
|
{% endif %}
|
|
37
37
|
|
|
38
|
-
{
|
|
39
|
-
{
|
|
38
|
+
{%- if attributes is empty %}
|
|
39
|
+
{%- set attributes = create_attribute() %}
|
|
40
40
|
{% endif %}
|
|
41
41
|
|
|
42
|
-
{
|
|
42
|
+
{%- set attributes = attributes.addClass(_classes).setAttribute('id', 'accordion-' ~ _id) %}
|
|
43
43
|
|
|
44
|
-
{
|
|
44
|
+
{%- if _items is not empty -%}
|
|
45
45
|
<div
|
|
46
46
|
{{ attributes }}
|
|
47
47
|
>
|
|
@@ -55,52 +55,52 @@
|
|
|
55
55
|
{%- endif -%}
|
|
56
56
|
|
|
57
57
|
{% if _items|length > 1 and (_expand_button is not empty or _collapse_button is not empty) %}
|
|
58
|
-
{
|
|
58
|
+
{%- set wrapper_attributes = create_attribute().addClass(['d-flex', 'justify-content-end', 'gap-3', 'mb-3']) -%}
|
|
59
59
|
<div
|
|
60
60
|
{{ wrapper_attributes }}
|
|
61
61
|
>
|
|
62
|
-
{
|
|
63
|
-
{
|
|
64
|
-
{
|
|
62
|
+
{%- if _expand_button is not empty %}
|
|
63
|
+
{%- if _expand_button.attributes is empty %}
|
|
64
|
+
{%- set _expand_button = _expand_button|merge({
|
|
65
65
|
attributes: create_attribute()
|
|
66
66
|
})
|
|
67
67
|
%}
|
|
68
|
-
{
|
|
69
|
-
{
|
|
68
|
+
{%- endif %}
|
|
69
|
+
{%- include '@oe-bcl/bcl-button/button.html.twig' with _expand_button|merge({
|
|
70
70
|
attributes: _expand_button.attributes
|
|
71
71
|
.setAttribute('data-target', 'accordion-' ~ _id)
|
|
72
72
|
.setAttribute('data-action', 'expand')
|
|
73
73
|
}) only %}
|
|
74
|
-
{
|
|
75
|
-
{
|
|
76
|
-
{
|
|
77
|
-
{
|
|
74
|
+
{%- endif %}
|
|
75
|
+
{%- if _collapse_button is not empty %}
|
|
76
|
+
{%- if _collapse_button.attributes is empty %}
|
|
77
|
+
{%- set _collapse_button = _collapse_button|merge({
|
|
78
78
|
attributes: create_attribute()
|
|
79
79
|
})
|
|
80
80
|
%}
|
|
81
|
-
{
|
|
82
|
-
{
|
|
81
|
+
{%- endif %}
|
|
82
|
+
{%- include '@oe-bcl/bcl-button/button.html.twig' with _collapse_button|merge({
|
|
83
83
|
attributes: _collapse_button.attributes
|
|
84
84
|
.setAttribute('data-target', 'accordion-' ~ _id)
|
|
85
85
|
.setAttribute('data-action', 'collapse')
|
|
86
86
|
}) only %}
|
|
87
|
-
{
|
|
87
|
+
{%- endif -%}
|
|
88
88
|
</div>
|
|
89
|
-
{
|
|
89
|
+
{%- endif -%}
|
|
90
90
|
<div class="accordion-items-wrapper">
|
|
91
|
-
{
|
|
92
|
-
{
|
|
93
|
-
{
|
|
94
|
-
{
|
|
95
|
-
{
|
|
96
|
-
{
|
|
91
|
+
{%- for _item in _items %}
|
|
92
|
+
{%- set _open_item = _open_item_id == loop.index %}
|
|
93
|
+
{%- set _button_classes = ['accordion-button'] %}
|
|
94
|
+
{%- if not _open_item %}
|
|
95
|
+
{%- set _button_classes = _button_classes|merge(['collapsed']) %}
|
|
96
|
+
{%- endif -%}
|
|
97
97
|
<div class="accordion-item">
|
|
98
|
-
{%- set _item_title_tag = _item.title_tag|default('h2')
|
|
99
|
-
<{{ _item_title_tag }}
|
|
100
|
-
class="accordion-header"
|
|
98
|
+
{%- set _item_title_tag = _item.title_tag|default('h2') -%}
|
|
99
|
+
<{{ _item_title_tag }}
|
|
100
|
+
class="accordion-header"
|
|
101
101
|
id="heading-{{ _id }}-{{ loop.index }}"
|
|
102
102
|
>
|
|
103
|
-
{
|
|
103
|
+
{%- set button_attributes = create_attribute()
|
|
104
104
|
.addClass(_button_classes)
|
|
105
105
|
.setAttribute('data-bs-toggle', 'collapse')
|
|
106
106
|
.setAttribute('autocomplete', 'off')
|
|
@@ -108,34 +108,33 @@
|
|
|
108
108
|
.setAttribute('aria-controls', 'collapse-' ~ _id ~ '-' ~ loop.index)
|
|
109
109
|
.setAttribute('aria-expanded', open_item ? 'true' : 'false')
|
|
110
110
|
%}
|
|
111
|
-
{
|
|
111
|
+
{%- set item_title -%}
|
|
112
112
|
<span>
|
|
113
113
|
{{- _item.title -}}
|
|
114
114
|
</span>
|
|
115
|
-
{
|
|
116
|
-
{
|
|
115
|
+
{%- endset %}
|
|
116
|
+
{%- include '@oe-bcl/bcl-button/button.html.twig' with {
|
|
117
117
|
label: item_title,
|
|
118
118
|
clean_class: true,
|
|
119
119
|
attributes: button_attributes
|
|
120
|
-
} only
|
|
121
|
-
</{{ _item_title_tag }}>
|
|
120
|
+
} only -%}
|
|
121
|
+
</{{ _item_title_tag }}>{# -#}
|
|
122
122
|
<div
|
|
123
123
|
id="collapse-{{ _id }}-{{ loop.index }}"
|
|
124
124
|
class="accordion-collapse collapse{{ _open_item ? ' show' }}"
|
|
125
125
|
aria-labelledby="heading-{{ _id }}-{{ loop.index }}"
|
|
126
126
|
role="region"
|
|
127
|
-
{% if not _item.stay_open and _expand_button is empty
|
|
127
|
+
{% if not _item.stay_open and _expand_button is empty %}
|
|
128
128
|
data-bs-parent="#accordion-{{ _id }}"
|
|
129
129
|
{% endif %}
|
|
130
|
-
>
|
|
130
|
+
>{# -#}
|
|
131
131
|
<div class="accordion-body">
|
|
132
132
|
{%- set _content = _item.content|default('') %}
|
|
133
133
|
{%- block content _content -%}
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
134
|
+
</div>{# -#}
|
|
135
|
+
</div>{# -#}
|
|
136
136
|
</div>
|
|
137
|
-
{
|
|
138
|
-
</div>
|
|
137
|
+
{%- endfor -%}
|
|
138
|
+
</div>{# -#}
|
|
139
139
|
</div>
|
|
140
|
-
{
|
|
141
|
-
|
|
140
|
+
{%- endif -%}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- attributes (drupal attrs)
|
|
10
10
|
#}
|
|
11
11
|
|
|
12
|
-
{
|
|
12
|
+
{%- set _message = message|default('') %}
|
|
13
13
|
{% set _heading = heading|default('') %}
|
|
14
14
|
{% set _variant = variant|default('primary') %}
|
|
15
15
|
{% set _dismissible = dismissible ?? true %}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
{% set _icon_path = icon_path|default('') %}
|
|
18
18
|
{% set _icon_name = icon_name|default('') %}
|
|
19
19
|
|
|
20
|
-
{
|
|
20
|
+
{%- set _classes = ['alert', 'alert-' ~ _variant|e('html_attr'), 'd-flex', 'align-items-center'] %}
|
|
21
21
|
{% set _icon_names = {
|
|
22
22
|
primary: "info-circle-fill",
|
|
23
23
|
secondary: "info-circle-fill",
|
|
@@ -30,36 +30,36 @@
|
|
|
30
30
|
}
|
|
31
31
|
%}
|
|
32
32
|
|
|
33
|
-
{
|
|
34
|
-
{
|
|
33
|
+
{%- if _dismissible %}
|
|
34
|
+
{%- set _classes = _classes|merge(['alert-dismissible']) %}
|
|
35
35
|
{% endif %}
|
|
36
36
|
{% if _animated_dismiss %}
|
|
37
|
-
{
|
|
37
|
+
{%- set _classes = _classes|merge(['fade', 'show']) %}
|
|
38
38
|
{% endif %}
|
|
39
39
|
|
|
40
|
-
{
|
|
40
|
+
{%- set _classes = _classes|merge(['text-dark']) %}
|
|
41
41
|
|
|
42
|
-
{
|
|
42
|
+
{%- set _icon_classes = ['flex-shrink-0 me-3 mt-1 align-self-start' ] %}
|
|
43
43
|
|
|
44
|
-
{
|
|
45
|
-
{
|
|
44
|
+
{%- if _variant != 'light' %}
|
|
45
|
+
{%- set _icon_classes = _icon_classes|merge(['text-' ~ _variant]) %}
|
|
46
46
|
{% endif %}
|
|
47
47
|
|
|
48
|
-
{
|
|
49
|
-
{
|
|
48
|
+
{%- if attributes is empty %}
|
|
49
|
+
{%- set attributes = create_attribute() %}
|
|
50
50
|
{% endif %}
|
|
51
51
|
|
|
52
|
-
{
|
|
52
|
+
{%- set attributes = attributes.addClass(_classes).setAttribute('role', 'alert') -%}
|
|
53
53
|
|
|
54
54
|
<div {{ attributes }}>
|
|
55
|
-
{
|
|
56
|
-
{
|
|
55
|
+
{%- if _icon_path is not empty %}
|
|
56
|
+
{%- include '@oe-bcl/bcl-icon/icon.html.twig' with {
|
|
57
57
|
name: _icon_name ?: _icon_names[_variant],
|
|
58
58
|
size: 's',
|
|
59
59
|
path: _icon_path,
|
|
60
60
|
attributes: create_attribute().addClass(_icon_classes),
|
|
61
61
|
} only %}
|
|
62
|
-
{% endif
|
|
62
|
+
{% endif -%}
|
|
63
63
|
<div class="alert-content flex-grow-1">
|
|
64
64
|
{%- if _heading is not empty -%}
|
|
65
65
|
<div class="alert-heading h4">{{ _heading }}</div>
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
type="button"
|
|
74
74
|
class="btn-close"
|
|
75
75
|
data-bs-dismiss="alert"
|
|
76
|
-
aria-label="Close"
|
|
77
|
-
|
|
76
|
+
aria-label="Close"
|
|
77
|
+
></button>
|
|
78
78
|
{%- endif -%}
|
|
79
79
|
</div>
|
|
80
|
-
|
|
80
|
+
{#--#}
|