@openeuropa/bcl-theme-joinup 1.10.9 → 1.10.11
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-joinup.css +48 -34
- package/css/oe-bcl-joinup.css.map +1 -1
- package/css/oe-bcl-joinup.min.css +1 -1
- package/css/oe-bcl-joinup.min.css.map +1 -1
- package/js/oe-bcl-joinup.bundle.js +44 -0
- package/js/oe-bcl-joinup.bundle.js.map +1 -1
- package/js/oe-bcl-joinup.bundle.min.js +1 -1
- package/js/oe-bcl-joinup.bundle.min.js.map +1 -1
- package/js/oe-bcl-joinup.esm.js +44 -0
- package/js/oe-bcl-joinup.esm.js.map +1 -1
- package/js/oe-bcl-joinup.esm.min.js +1 -1
- package/js/oe-bcl-joinup.esm.min.js.map +1 -1
- package/js/oe-bcl-joinup.umd.js +44 -0
- package/js/oe-bcl-joinup.umd.js.map +1 -1
- package/js/oe-bcl-joinup.umd.min.js +1 -1
- package/js/oe-bcl-joinup.umd.min.js.map +1 -1
- package/package.json +6 -6
- 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 +17 -36
- 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 +47 -44
- 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 +46 -49
- 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 +44 -48
- 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 +32 -27
- package/templates/bcl-links-block/links-block.html.twig +29 -33
- 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 +25 -26
- package/templates/bcl-mega-menu/mega-menu.html.twig +37 -38
- package/templates/bcl-modal/modal.html.twig +17 -20
- 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-joinup.umd.js
CHANGED
|
@@ -4871,12 +4871,27 @@
|
|
|
4871
4871
|
MainNavigation.init(".bcl-navbar-toggler");
|
|
4872
4872
|
});
|
|
4873
4873
|
|
|
4874
|
+
const SUBMENU_HEIGHT_VARIABLE = "--oel-mega-menu-submenu-height";
|
|
4875
|
+
const SUBMENU_BODY_SELECTOR = ".__submenu_body";
|
|
4874
4876
|
class MegaMenu {
|
|
4877
|
+
scheduleSubmenuHeightUpdate = () => {
|
|
4878
|
+
if (this.submenuHeightFrame) {
|
|
4879
|
+
return;
|
|
4880
|
+
}
|
|
4881
|
+
this.submenuHeightFrame = window.requestAnimationFrame(() => {
|
|
4882
|
+
this.submenuHeightFrame = null;
|
|
4883
|
+
this.updateSubmenuHeight();
|
|
4884
|
+
});
|
|
4885
|
+
};
|
|
4875
4886
|
constructor(root) {
|
|
4876
4887
|
this.root = root;
|
|
4888
|
+
this.submenuHeightFrame = null;
|
|
4889
|
+
this.submenuBodies = SelectorEngine.find(SUBMENU_BODY_SELECTOR, this.root);
|
|
4877
4890
|
this.backButton = SelectorEngine.findOne(".back-button", this.root);
|
|
4878
4891
|
this.trigger = SelectorEngine.findOne(':scope > .dropdown-toggle[data-bs-toggle="dropdown"]', this.root);
|
|
4879
4892
|
this.ul = SelectorEngine.findOne('.bcl-mega-menu__items.__level-1', this.root);
|
|
4893
|
+
EventHandler.on(window, "resize", this.scheduleSubmenuHeightUpdate);
|
|
4894
|
+
EventHandler.on(window, "orientationchange", this.scheduleSubmenuHeightUpdate);
|
|
4880
4895
|
this.addSubmenuTriggerListeners();
|
|
4881
4896
|
this.addBackButtonListener();
|
|
4882
4897
|
this.addTriggerListeners();
|
|
@@ -4932,6 +4947,7 @@
|
|
|
4932
4947
|
|
|
4933
4948
|
// When the mega menu is opened, focus the first item in the menu.
|
|
4934
4949
|
EventHandler.on(this.trigger, 'shown.bs.dropdown', () => {
|
|
4950
|
+
this.scheduleSubmenuHeightUpdate();
|
|
4935
4951
|
const panelId = this.trigger.getAttribute('aria-controls');
|
|
4936
4952
|
const panel = panelId ? document.getElementById(panelId) : null;
|
|
4937
4953
|
const firstFocusable = panel ? this.getFocusableChildren(panel)[0] : null;
|
|
@@ -4990,6 +5006,7 @@
|
|
|
4990
5006
|
trigger.setAttribute('aria-expanded', 'true');
|
|
4991
5007
|
const panel = this.getPanelForTrigger(trigger);
|
|
4992
5008
|
if (panel) panel.hidden = false;
|
|
5009
|
+
this.scheduleSubmenuHeightUpdate();
|
|
4993
5010
|
}
|
|
4994
5011
|
|
|
4995
5012
|
/**
|
|
@@ -5015,6 +5032,33 @@
|
|
|
5015
5032
|
const panel = this.getPanelForTrigger(trigger);
|
|
5016
5033
|
if (panel) panel.hidden = true;
|
|
5017
5034
|
}
|
|
5035
|
+
updateSubmenuHeight() {
|
|
5036
|
+
if (!this.trigger || this.trigger.getAttribute('aria-expanded') !== 'true') {
|
|
5037
|
+
return;
|
|
5038
|
+
}
|
|
5039
|
+
if (!this.submenuBodies || this.submenuBodies.length === 0) {
|
|
5040
|
+
return;
|
|
5041
|
+
}
|
|
5042
|
+
const viewportHeight = document.documentElement && document.documentElement.clientHeight || window.innerHeight || 0;
|
|
5043
|
+
if (!viewportHeight) {
|
|
5044
|
+
return;
|
|
5045
|
+
}
|
|
5046
|
+
this.submenuBodies.forEach(submenuBody => {
|
|
5047
|
+
if (!submenuBody.isConnected || submenuBody.closest('[hidden]')) {
|
|
5048
|
+
return;
|
|
5049
|
+
}
|
|
5050
|
+
const rect = submenuBody.getBoundingClientRect();
|
|
5051
|
+
const visibleTop = Math.max(rect.top, 0);
|
|
5052
|
+
// Use the distance to the viewport bottom instead of the current element
|
|
5053
|
+
// height. Nested submenus inherit the parent max-height, so relying on
|
|
5054
|
+
// rect.bottom would keep the parent's value and never recalc for children.
|
|
5055
|
+
const availableHeight = Math.max(0, viewportHeight - visibleTop);
|
|
5056
|
+
const value = `${availableHeight}px`;
|
|
5057
|
+
if (submenuBody.style.getPropertyValue(SUBMENU_HEIGHT_VARIABLE) !== value) {
|
|
5058
|
+
submenuBody.style.setProperty(SUBMENU_HEIGHT_VARIABLE, value);
|
|
5059
|
+
}
|
|
5060
|
+
});
|
|
5061
|
+
}
|
|
5018
5062
|
static init(selector = ".bcl-mega-menu") {
|
|
5019
5063
|
const megaMenus = SelectorEngine.find(selector);
|
|
5020
5064
|
megaMenus.forEach(menuEl => new MegaMenu(menuEl));
|