@openeuropa/bcl-theme-default 0.4298.202511051800 → 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 +167 -85
- 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/_input.scss +72 -31
- package/src/scss/_mega-menu.scss +57 -58
- package/src/scss/_multiselect-2.scss +21 -11
- package/src/scss/_pagination.scss +1 -0
- package/src/scss/_search-form.scss +4 -0
- package/src/scss/base/_colors.scss +1 -0
- package/src/scss/base/_mixins.scss +12 -0
- package/templates/bcl-accordion/accordion.html.twig +42 -46
- package/templates/bcl-alert/alert.html.twig +18 -21
- package/templates/bcl-badge/badge.html.twig +11 -15
- package/templates/bcl-banner/banner.html.twig +34 -37
- package/templates/bcl-base-templates/content-type.html.twig +63 -67
- 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 -20
- package/templates/bcl-breadcrumb/breadcrumb.html.twig +24 -28
- package/templates/bcl-button/button.html.twig +24 -27
- package/templates/bcl-button-group/button-group.html.twig +25 -29
- package/templates/bcl-card/card.html.twig +98 -101
- package/templates/bcl-card-layout/card-layout.html.twig +34 -37
- package/templates/bcl-carousel/carousel.html.twig +64 -67
- package/templates/bcl-contact-form/contact-form.html.twig +1 -1
- package/templates/bcl-content-banner/content-banner.html.twig +37 -40
- package/templates/bcl-date-block/date-block.html.twig +26 -29
- package/templates/bcl-description-list/description-list-details.html.twig +6 -9
- package/templates/bcl-description-list/description-list-title.html.twig +11 -14
- package/templates/bcl-description-list/description-list.html.twig +44 -48
- package/templates/bcl-dropdown/dropdown.html.twig +48 -52
- package/templates/bcl-event/event.html.twig +7 -7
- package/templates/bcl-fact-figures/fact-figures.html.twig +34 -37
- package/templates/bcl-featured-media/featured-media.html.twig +42 -46
- package/templates/bcl-file/file-translations.html.twig +29 -32
- package/templates/bcl-file/file.html.twig +47 -50
- package/templates/bcl-footer/footer.html.twig +31 -34
- package/templates/bcl-form/form.html.twig +70 -73
- package/templates/bcl-form-input/form-input.html.twig +57 -61
- package/templates/bcl-gallery/gallery-item.html.twig +20 -23
- package/templates/bcl-gallery/gallery.html.twig +62 -66
- 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 -82
- package/templates/bcl-heading/heading.html.twig +13 -17
- package/templates/bcl-icon/icon.html.twig +10 -13
- package/templates/bcl-inpage-navigation/inpage-navigation.html.twig +20 -23
- package/templates/bcl-landing-page/landing-page.html.twig +33 -33
- package/templates/bcl-language-list/language-list-grid.html.twig +25 -28
- package/templates/bcl-language-list/language-list-modal.html.twig +52 -52
- package/templates/bcl-language-list/language-list.html.twig +33 -37
- package/templates/bcl-language-switcher/language-switcher.html.twig +12 -15
- package/templates/bcl-link/link.html.twig +24 -27
- package/templates/bcl-links-block/links-block.html.twig +30 -34
- package/templates/bcl-list-group/list-group.html.twig +43 -47
- package/templates/bcl-listing/listing.html.twig +88 -91
- package/templates/bcl-mega-menu/mega-menu-items.html.twig +18 -21
- package/templates/bcl-mega-menu/mega-menu-submenu.html.twig +28 -26
- package/templates/bcl-mega-menu/mega-menu.html.twig +37 -38
- package/templates/bcl-modal/modal.html.twig +21 -23
- package/templates/bcl-navbar/navbar.html.twig +35 -38
- package/templates/bcl-navigation/navigation.html.twig +105 -110
- package/templates/bcl-offcanvas/offcanvas.html.twig +33 -36
- package/templates/bcl-page/page.html.twig +27 -27
- package/templates/bcl-pagination/pagination-item.html.twig +22 -26
- package/templates/bcl-pagination/pagination.html.twig +59 -62
- package/templates/bcl-pagination-v2/pagination-item.html.twig +31 -35
- package/templates/bcl-pagination-v2/pagination.html.twig +79 -82
- package/templates/bcl-person/person.html.twig +12 -12
- package/templates/bcl-placeholder/placeholder.html.twig +14 -18
- package/templates/bcl-progress/progress.html.twig +16 -20
- package/templates/bcl-project/project-lists.html.twig +25 -29
- package/templates/bcl-project/project.html.twig +35 -35
- package/templates/bcl-project-status/project-contributions.html.twig +25 -28
- package/templates/bcl-project-status/project-status.html.twig +32 -37
- package/templates/bcl-recent-activities/recent-activities.html.twig +13 -16
- package/templates/bcl-search/search.html.twig +12 -12
- package/templates/bcl-search-form/search-form.html.twig +21 -24
- package/templates/bcl-select/select.html.twig +52 -56
- package/templates/bcl-spinner/spinner.html.twig +10 -13
- 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 -17
- package/templates/bcl-table/table.html.twig +61 -65
- package/templates/bcl-textarea/textarea.html.twig +44 -47
- package/templates/bcl-timeline/timeline-item.html.twig +12 -15
- package/templates/bcl-timeline/timeline.html.twig +42 -45
- package/templates/bcl-toasts/toasts.html.twig +56 -60
- package/templates/bcl-user/user-compact.html.twig +24 -27
- package/templates/bcl-user/user-terms.html.twig +6 -6
- package/templates/bcl-user/user.html.twig +117 -117
package/js/oe-bcl-default.umd.js
CHANGED
|
@@ -4369,12 +4369,27 @@
|
|
|
4369
4369
|
MainNavigation.init(".bcl-navbar-toggler");
|
|
4370
4370
|
});
|
|
4371
4371
|
|
|
4372
|
+
const SUBMENU_HEIGHT_VARIABLE = "--oel-mega-menu-submenu-height";
|
|
4373
|
+
const SUBMENU_BODY_SELECTOR = ".__submenu_body";
|
|
4372
4374
|
class MegaMenu {
|
|
4375
|
+
scheduleSubmenuHeightUpdate = () => {
|
|
4376
|
+
if (this.submenuHeightFrame) {
|
|
4377
|
+
return;
|
|
4378
|
+
}
|
|
4379
|
+
this.submenuHeightFrame = window.requestAnimationFrame(() => {
|
|
4380
|
+
this.submenuHeightFrame = null;
|
|
4381
|
+
this.updateSubmenuHeight();
|
|
4382
|
+
});
|
|
4383
|
+
};
|
|
4373
4384
|
constructor(root) {
|
|
4374
4385
|
this.root = root;
|
|
4386
|
+
this.submenuHeightFrame = null;
|
|
4387
|
+
this.submenuBodies = SelectorEngine.find(SUBMENU_BODY_SELECTOR, this.root);
|
|
4375
4388
|
this.backButton = SelectorEngine.findOne(".back-button", this.root);
|
|
4376
4389
|
this.trigger = SelectorEngine.findOne(':scope > .dropdown-toggle[data-bs-toggle="dropdown"]', this.root);
|
|
4377
4390
|
this.ul = SelectorEngine.findOne('.bcl-mega-menu__items.__level-1', this.root);
|
|
4391
|
+
EventHandler.on(window, "resize", this.scheduleSubmenuHeightUpdate);
|
|
4392
|
+
EventHandler.on(window, "orientationchange", this.scheduleSubmenuHeightUpdate);
|
|
4378
4393
|
this.addSubmenuTriggerListeners();
|
|
4379
4394
|
this.addBackButtonListener();
|
|
4380
4395
|
this.addTriggerListeners();
|
|
@@ -4430,6 +4445,7 @@
|
|
|
4430
4445
|
|
|
4431
4446
|
// When the mega menu is opened, focus the first item in the menu.
|
|
4432
4447
|
EventHandler.on(this.trigger, 'shown.bs.dropdown', () => {
|
|
4448
|
+
this.scheduleSubmenuHeightUpdate();
|
|
4433
4449
|
const panelId = this.trigger.getAttribute('aria-controls');
|
|
4434
4450
|
const panel = panelId ? document.getElementById(panelId) : null;
|
|
4435
4451
|
const firstFocusable = panel ? this.getFocusableChildren(panel)[0] : null;
|
|
@@ -4488,6 +4504,7 @@
|
|
|
4488
4504
|
trigger.setAttribute('aria-expanded', 'true');
|
|
4489
4505
|
const panel = this.getPanelForTrigger(trigger);
|
|
4490
4506
|
if (panel) panel.hidden = false;
|
|
4507
|
+
this.scheduleSubmenuHeightUpdate();
|
|
4491
4508
|
}
|
|
4492
4509
|
|
|
4493
4510
|
/**
|
|
@@ -4513,6 +4530,33 @@
|
|
|
4513
4530
|
const panel = this.getPanelForTrigger(trigger);
|
|
4514
4531
|
if (panel) panel.hidden = true;
|
|
4515
4532
|
}
|
|
4533
|
+
updateSubmenuHeight() {
|
|
4534
|
+
if (!this.trigger || this.trigger.getAttribute('aria-expanded') !== 'true') {
|
|
4535
|
+
return;
|
|
4536
|
+
}
|
|
4537
|
+
if (!this.submenuBodies || this.submenuBodies.length === 0) {
|
|
4538
|
+
return;
|
|
4539
|
+
}
|
|
4540
|
+
const viewportHeight = document.documentElement && document.documentElement.clientHeight || window.innerHeight || 0;
|
|
4541
|
+
if (!viewportHeight) {
|
|
4542
|
+
return;
|
|
4543
|
+
}
|
|
4544
|
+
this.submenuBodies.forEach(submenuBody => {
|
|
4545
|
+
if (!submenuBody.isConnected || submenuBody.closest('[hidden]')) {
|
|
4546
|
+
return;
|
|
4547
|
+
}
|
|
4548
|
+
const rect = submenuBody.getBoundingClientRect();
|
|
4549
|
+
const visibleTop = Math.max(rect.top, 0);
|
|
4550
|
+
// Use the distance to the viewport bottom instead of the current element
|
|
4551
|
+
// height. Nested submenus inherit the parent max-height, so relying on
|
|
4552
|
+
// rect.bottom would keep the parent's value and never recalc for children.
|
|
4553
|
+
const availableHeight = Math.max(0, viewportHeight - visibleTop);
|
|
4554
|
+
const value = `${availableHeight}px`;
|
|
4555
|
+
if (submenuBody.style.getPropertyValue(SUBMENU_HEIGHT_VARIABLE) !== value) {
|
|
4556
|
+
submenuBody.style.setProperty(SUBMENU_HEIGHT_VARIABLE, value);
|
|
4557
|
+
}
|
|
4558
|
+
});
|
|
4559
|
+
}
|
|
4516
4560
|
static init(selector = ".bcl-mega-menu") {
|
|
4517
4561
|
const megaMenus = SelectorEngine.find(selector);
|
|
4518
4562
|
megaMenus.forEach(menuEl => new MegaMenu(menuEl));
|
|
@@ -6923,6 +6967,72 @@
|
|
|
6923
6967
|
}
|
|
6924
6968
|
}
|
|
6925
6969
|
|
|
6970
|
+
const HEADER_SELECTOR = ".bcl-header";
|
|
6971
|
+
const TOGGLER_SELECTOR = ".bcl-navbar-toggler";
|
|
6972
|
+
const OFFSET_VARIABLE = "--oel-mega-menu-offset-top";
|
|
6973
|
+
class Header {
|
|
6974
|
+
scheduleUpdate = () => {
|
|
6975
|
+
if (this.frameRequest) {
|
|
6976
|
+
return;
|
|
6977
|
+
}
|
|
6978
|
+
this.frameRequest = window.requestAnimationFrame(() => {
|
|
6979
|
+
this.frameRequest = null;
|
|
6980
|
+
this.updateOffset();
|
|
6981
|
+
});
|
|
6982
|
+
};
|
|
6983
|
+
constructor(element) {
|
|
6984
|
+
this.element = element;
|
|
6985
|
+
this.frameRequest = null;
|
|
6986
|
+
this.resizeObserver = null;
|
|
6987
|
+
this.init();
|
|
6988
|
+
}
|
|
6989
|
+
init() {
|
|
6990
|
+
this.updateOffset();
|
|
6991
|
+
EventHandler.on(window, "resize", this.scheduleUpdate);
|
|
6992
|
+
EventHandler.on(window, "orientationchange", this.scheduleUpdate);
|
|
6993
|
+
const togglers = SelectorEngine.find(TOGGLER_SELECTOR, this.element);
|
|
6994
|
+
togglers.forEach(toggler => {
|
|
6995
|
+
// Some layouts move the header when the nav toggler expands; keep offset in sync.
|
|
6996
|
+
EventHandler.on(toggler, "click", this.scheduleUpdate);
|
|
6997
|
+
});
|
|
6998
|
+
}
|
|
6999
|
+
updateOffset() {
|
|
7000
|
+
if (!this.element) {
|
|
7001
|
+
return;
|
|
7002
|
+
}
|
|
7003
|
+
const rect = this.element.getBoundingClientRect();
|
|
7004
|
+
const offset = Math.max(0, rect.top);
|
|
7005
|
+
const value = `${offset}px`;
|
|
7006
|
+
if (this.element.style.getPropertyValue(OFFSET_VARIABLE) === value) {
|
|
7007
|
+
return;
|
|
7008
|
+
}
|
|
7009
|
+
this.element.style.setProperty(OFFSET_VARIABLE, value);
|
|
7010
|
+
}
|
|
7011
|
+
static init(root) {
|
|
7012
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
7013
|
+
return;
|
|
7014
|
+
}
|
|
7015
|
+
const resolvedRoot = root || document;
|
|
7016
|
+
const context = resolvedRoot instanceof Element ? resolvedRoot : resolvedRoot.documentElement || document.documentElement;
|
|
7017
|
+
const headers = SelectorEngine.find(HEADER_SELECTOR, context);
|
|
7018
|
+
headers.forEach(headerElement => {
|
|
7019
|
+
if (headerElement.dataset.headerOffsetInitialized === "true") {
|
|
7020
|
+
return;
|
|
7021
|
+
}
|
|
7022
|
+
headerElement.dataset.headerOffsetInitialized = "true";
|
|
7023
|
+
new Header(headerElement);
|
|
7024
|
+
});
|
|
7025
|
+
}
|
|
7026
|
+
}
|
|
7027
|
+
if (typeof document !== "undefined") {
|
|
7028
|
+
const initializeHeaderOffset = () => Header.init();
|
|
7029
|
+
if (document.readyState === "loading") {
|
|
7030
|
+
document.addEventListener("DOMContentLoaded", initializeHeaderOffset);
|
|
7031
|
+
} else {
|
|
7032
|
+
initializeHeaderOffset();
|
|
7033
|
+
}
|
|
7034
|
+
}
|
|
7035
|
+
|
|
6926
7036
|
/**
|
|
6927
7037
|
* --------------------------------------------------------------------------
|
|
6928
7038
|
* Bootstrap (v5.1.0): index.esm.js
|
|
@@ -6948,7 +7058,8 @@
|
|
|
6948
7058
|
Tooltip,
|
|
6949
7059
|
Gallery,
|
|
6950
7060
|
AccessibleToggle,
|
|
6951
|
-
AccordionToggle
|
|
7061
|
+
AccordionToggle,
|
|
7062
|
+
Header
|
|
6952
7063
|
};
|
|
6953
7064
|
|
|
6954
7065
|
return index_umd;
|