@eui/ecl 23.0.0-alpha.6 → 23.0.0-alpha.7
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/docs/changelog.html +41 -0
- package/docs/classes/EclLanguageService.html +8 -8
- package/docs/components/EclBannerComponent.html +28 -56
- package/docs/components/EclCardComponent.html +12 -24
- package/docs/components/EclCarouselComponent.html +33 -65
- package/docs/components/EclCarouselItemComponent.html +4 -8
- package/docs/components/EclCategoryFilterComponent.html +4 -8
- package/docs/components/EclCategoryFilterItemComponent.html +5 -9
- package/docs/components/EclCategoryFilterListComponent.html +5 -9
- package/docs/components/EclContentItemComponent.html +20 -40
- package/docs/components/EclFactFiguresItemComponent.html +4 -8
- package/docs/components/EclFactFiguresViewAllComponent.html +4 -8
- package/docs/components/EclFeaturedItemComponent.html +4 -10
- package/docs/components/EclFileComponent.html +4 -8
- package/docs/components/EclFileItemsComponent.html +4 -8
- package/docs/components/EclFormGroupComponent.html +4 -8
- package/docs/components/EclGalleryComponent.html +21 -41
- package/docs/components/EclGalleryItemComponent.html +8 -16
- package/docs/components/EclIconComponent.html +4 -8
- package/docs/components/EclInpageNavigationComponent.html +20 -40
- package/docs/components/EclInpageNavigationItemComponent.html +4 -8
- package/docs/components/EclListIllustrationComponent.html +4 -8
- package/docs/components/EclListIllustrationItemComponent.html +9 -17
- package/docs/components/EclMediaContainerComponent.html +21 -41
- package/docs/components/EclMegaMenuComponent.html +4 -8
- package/docs/components/EclMegaMenuFeaturedComponent.html +12 -24
- package/docs/components/EclMegaMenuInfoComponent.html +4 -8
- package/docs/components/EclMegaMenuItemComponent.html +37 -73
- package/docs/components/EclMegaMenuSubitemComponent.html +21 -43
- package/docs/components/EclMenuComponent.html +20 -40
- package/docs/components/EclMenuItemComponent.html +12 -24
- package/docs/components/EclMenuMegaItemComponent.html +12 -24
- package/docs/components/EclModalComponent.html +1 -1
- package/docs/components/EclMultiselectComponent.html +4 -8
- package/docs/components/EclMultiselectDropdownComponent.html +21 -41
- package/docs/components/EclMultiselectInputComponent.html +4 -8
- package/docs/components/EclMultiselectOptionComponent.html +4 -8
- package/docs/components/EclNavigationListComponent.html +4 -8
- package/docs/components/EclNavigationListItemComponent.html +4 -8
- package/docs/components/EclNewsTickerComponent.html +28 -48
- package/docs/components/EclNewsTickerItemComponent.html +4 -8
- package/docs/components/EclPageHeaderComponent.html +8 -16
- package/docs/components/EclPaginationComponent.html +4 -8
- package/docs/components/EclPopoverComponent.html +12 -24
- package/docs/components/EclSiteHeaderComponent.html +44 -88
- package/docs/components/EclSiteHeaderCustomActionComponent.html +8 -16
- package/docs/components/EclSiteHeaderLanguageComponent.html +10 -18
- package/docs/components/EclSiteHeaderLanguagePopoverComponent.html +6 -10
- package/docs/components/EclSiteHeaderLoginComponent.html +4 -8
- package/docs/components/EclSiteHeaderSearchComponent.html +4 -8
- package/docs/components/EclTabComponent.html +12 -24
- package/docs/components/EclTabsComponent.html +29 -57
- package/docs/components/EclTimelineComponent.html +4 -8
- package/docs/components/EclTimelineItemComponent.html +16 -32
- package/docs/directives/EclCheckboxDirective.html +16 -32
- package/docs/directives/EclDescriptionListDirective.html +4 -8
- package/docs/directives/EclGalleryMediaDirective.html +2 -2
- package/docs/directives/EclGalleryPictureDirective.html +1 -1
- package/docs/directives/EclListIllustrationPictureDirective.html +4 -8
- package/docs/directives/EclMediaContainerItemDirective.html +4 -8
- package/docs/directives/EclMegaMenuSublistDirective.html +8 -16
- package/docs/directives/EclMultiselectOptionDirective.html +4 -8
- package/docs/directives/EclPageHeaderMetaItemDirective.html +9 -0
- package/docs/directives/EclRadioDirective.html +8 -16
- package/docs/directives/EclSocialMediaFollowLinkDirective.html +4 -8
- package/docs/directives/EclTableDirective.html +4 -8
- package/docs/directives/EclTableHeadDirective.html +4 -8
- package/docs/injectables/EclDefaultLanguageService.html +7 -7
- package/docs/injectables/EclMegaMenuService.html +2 -2
- package/docs/interfaces/EclMegaMenuItem.html +2 -2
- package/docs/interfaces/EclMenuItem.html +2 -2
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/EclMegaMenuItemComponent.md +1 -1
- package/docs/json/EclMegaMenuSubitemComponent.md +1 -1
- package/docs/json/EclSiteHeaderLanguagePopoverComponent.md +2 -2
- package/docs/json/documentation.json +1365 -2133
- package/docs/llms.txt +182 -182
- package/docs/miscellaneous/variables.html +16 -16
- package/docs/properties.html +1 -1
- package/fesm2022/eui-ecl-components-ecl-banner.mjs +37 -40
- package/fesm2022/eui-ecl-components-ecl-banner.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-card.mjs +23 -17
- package/fesm2022/eui-ecl-components-ecl-card.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-carousel.mjs +105 -82
- package/fesm2022/eui-ecl-components-ecl-carousel.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-category-filter.mjs +36 -29
- package/fesm2022/eui-ecl-components-ecl-category-filter.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-checkbox.mjs +30 -20
- package/fesm2022/eui-ecl-components-ecl-checkbox.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-content-item.mjs +46 -27
- package/fesm2022/eui-ecl-components-ecl-content-item.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-date-picker.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-fact-figures.mjs +25 -15
- package/fesm2022/eui-ecl-components-ecl-fact-figures.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-featured.mjs +10 -9
- package/fesm2022/eui-ecl-components-ecl-featured.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-file.mjs +17 -13
- package/fesm2022/eui-ecl-components-ecl-file.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-form-group.mjs +12 -7
- package/fesm2022/eui-ecl-components-ecl-form-group.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-gallery.mjs +44 -49
- package/fesm2022/eui-ecl-components-ecl-gallery.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-icon.mjs +7 -8
- package/fesm2022/eui-ecl-components-ecl-icon.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-inpage-navigation.mjs +48 -50
- package/fesm2022/eui-ecl-components-ecl-inpage-navigation.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-link.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-list-illustration.mjs +19 -24
- package/fesm2022/eui-ecl-components-ecl-list-illustration.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-list.mjs +6 -7
- package/fesm2022/eui-ecl-components-ecl-list.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-loading-indicator.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-media-container.mjs +31 -34
- package/fesm2022/eui-ecl-components-ecl-media-container.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs +237 -197
- package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-menu.mjs +108 -86
- package/fesm2022/eui-ecl-components-ecl-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-modal.mjs +0 -1
- package/fesm2022/eui-ecl-components-ecl-modal.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-multiselect.mjs +70 -67
- package/fesm2022/eui-ecl-components-ecl-multiselect.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-navigation-list.mjs +16 -14
- package/fesm2022/eui-ecl-components-ecl-navigation-list.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-news-ticker.mjs +67 -51
- package/fesm2022/eui-ecl-components-ecl-news-ticker.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-page-header.mjs +17 -12
- package/fesm2022/eui-ecl-components-ecl-page-header.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-pagination.mjs +9 -7
- package/fesm2022/eui-ecl-components-ecl-pagination.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-popover.mjs +44 -38
- package/fesm2022/eui-ecl-components-ecl-popover.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-radio.mjs +22 -14
- package/fesm2022/eui-ecl-components-ecl-radio.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-header.mjs +123 -118
- package/fesm2022/eui-ecl-components-ecl-site-header.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs +2 -2
- package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-social-media-follow.mjs +10 -8
- package/fesm2022/eui-ecl-components-ecl-social-media-follow.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-table.mjs +17 -15
- package/fesm2022/eui-ecl-components-ecl-table.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-tabs.mjs +101 -81
- package/fesm2022/eui-ecl-components-ecl-tabs.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-timeline.mjs +47 -37
- package/fesm2022/eui-ecl-components-ecl-timeline.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-tooltip.mjs.map +1 -1
- package/fesm2022/eui-ecl-core.mjs +1 -1
- package/fesm2022/eui-ecl-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eui-ecl-components-ecl-banner.d.ts +42 -43
- package/types/eui-ecl-components-ecl-banner.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-card.d.ts +34 -35
- package/types/eui-ecl-components-ecl-card.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-carousel.d.ts +10 -11
- package/types/eui-ecl-components-ecl-carousel.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-category-filter.d.ts +6 -6
- package/types/eui-ecl-components-ecl-category-filter.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-checkbox.d.ts +47 -49
- package/types/eui-ecl-components-ecl-checkbox.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-content-item.d.ts +16 -18
- package/types/eui-ecl-components-ecl-content-item.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-fact-figures.d.ts +3 -3
- package/types/eui-ecl-components-ecl-fact-figures.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-featured.d.ts +2 -2
- package/types/eui-ecl-components-ecl-featured.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-file.d.ts +42 -43
- package/types/eui-ecl-components-ecl-file.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-form-group.d.ts +1 -3
- package/types/eui-ecl-components-ecl-form-group.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-gallery.d.ts +12 -12
- package/types/eui-ecl-components-ecl-gallery.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-icon.d.ts +1 -1
- package/types/eui-ecl-components-ecl-icon.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-inpage-navigation.d.ts +8 -8
- package/types/eui-ecl-components-ecl-inpage-navigation.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-list-illustration.d.ts +44 -44
- package/types/eui-ecl-components-ecl-list-illustration.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-list.d.ts +2 -2
- package/types/eui-ecl-components-ecl-list.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-media-container.d.ts +33 -33
- package/types/eui-ecl-components-ecl-media-container.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-mega-menu.d.ts +185 -191
- package/types/eui-ecl-components-ecl-mega-menu.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-menu.d.ts +126 -128
- package/types/eui-ecl-components-ecl-menu.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-modal.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-multiselect.d.ts +10 -10
- package/types/eui-ecl-components-ecl-multiselect.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-navigation-list.d.ts +3 -4
- package/types/eui-ecl-components-ecl-navigation-list.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-news-ticker.d.ts +18 -18
- package/types/eui-ecl-components-ecl-news-ticker.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-page-header.d.ts +3 -3
- package/types/eui-ecl-components-ecl-page-header.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-pagination.d.ts +1 -1
- package/types/eui-ecl-components-ecl-pagination.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-popover.d.ts +3 -3
- package/types/eui-ecl-components-ecl-popover.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-radio.d.ts +28 -28
- package/types/eui-ecl-components-ecl-radio.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-site-header.d.ts +48 -48
- package/types/eui-ecl-components-ecl-site-header.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-social-media-follow.d.ts +1 -1
- package/types/eui-ecl-components-ecl-social-media-follow.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-table.d.ts +3 -3
- package/types/eui-ecl-components-ecl-table.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-tabs.d.ts +12 -12
- package/types/eui-ecl-components-ecl-tabs.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-timeline.d.ts +27 -28
- package/types/eui-ecl-components-ecl-timeline.d.ts.map +1 -1
- package/types/eui-ecl-core.d.ts +11 -11
- package/types/eui-ecl-core.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { HostBinding, Directive, inject, ElementRef, booleanAttribute, Input, input,
|
|
2
|
+
import { HostBinding, Directive, inject, ElementRef, booleanAttribute, Input, viewChild, input, contentChildren, forwardRef, Component, Injectable, RendererFactory2, contentChild, EventEmitter, DOCUMENT, afterNextRender, Output, signal, IterableDiffers, PLATFORM_ID, Renderer2, output, HostListener } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@eui/ecl/core';
|
|
4
4
|
import { ECLBaseDirective, KeyCode, EclRtlService, ECLClickOutsideDirective } from '@eui/ecl/core';
|
|
5
5
|
import { EuiAppShellService } from '@eui/core';
|
|
@@ -29,7 +29,6 @@ class EclMegaMenuContainerDirective extends ECLBaseDirective {
|
|
|
29
29
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuContainerDirective, decorators: [{
|
|
30
30
|
type: Directive,
|
|
31
31
|
args: [{
|
|
32
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
33
32
|
selector: 'div[eclMegaMenuContainer]',
|
|
34
33
|
}]
|
|
35
34
|
}], propDecorators: { hasClass: [{
|
|
@@ -161,13 +160,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
161
160
|
class EclMegaMenuFeaturedComponent extends ECLBaseDirective {
|
|
162
161
|
constructor() {
|
|
163
162
|
super(...arguments);
|
|
163
|
+
this.megaMenuFeaturedScrollable = viewChild('megaMenuFeaturedScrollable', /* @ts-ignore */
|
|
164
|
+
...(ngDevMode ? [{ debugName: "megaMenuFeaturedScrollable" }] : /* istanbul ignore next */ []));
|
|
164
165
|
this.cmpClass = true;
|
|
165
166
|
this.eclMegaMenuFeaturedStyleHeight = null;
|
|
166
167
|
this.titleId = input(undefined, /* @ts-ignore */
|
|
167
168
|
...(ngDevMode ? [{ debugName: "titleId" }] : /* istanbul ignore next */ []));
|
|
169
|
+
this.links = contentChildren(forwardRef(() => EclLinkDirective), { ...(ngDevMode ? { debugName: "links" } : /* istanbul ignore next */ {}), descendants: true });
|
|
170
|
+
this.featuredItems = contentChildren(forwardRef(() => EclMegaMenuFeaturedListItemDirective), { ...(ngDevMode ? { debugName: "featuredItems" } : /* istanbul ignore next */ {}), descendants: true });
|
|
168
171
|
}
|
|
169
172
|
ngAfterContentInit() {
|
|
170
|
-
this.links?.forEach(link => link.class = 'ecl-mega-menu__featured-link');
|
|
173
|
+
this.links()?.forEach(link => link.class = 'ecl-mega-menu__featured-link');
|
|
171
174
|
}
|
|
172
175
|
/**
|
|
173
176
|
* Calculates and returns the height of the component. The total height of all the list items.
|
|
@@ -175,19 +178,16 @@ class EclMegaMenuFeaturedComponent extends ECLBaseDirective {
|
|
|
175
178
|
*/
|
|
176
179
|
getEclMegaMenuFeaturedHeight() {
|
|
177
180
|
let result = 0;
|
|
178
|
-
this.featuredItems?.forEach(el => result += el.getEclMegaMenuFeaturedItemHeight());
|
|
181
|
+
this.featuredItems()?.forEach(el => result += el.getEclMegaMenuFeaturedItemHeight());
|
|
179
182
|
return result;
|
|
180
183
|
}
|
|
181
184
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuFeaturedComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
182
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EclMegaMenuFeaturedComponent, isStandalone: true, selector: "div[eclMegaMenuFeatured]", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: false, isRequired: false, transformFunction: null }, titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ecl-mega-menu__featured": "this.cmpClass", "style.height.px": "this.eclMegaMenuFeaturedStyleHeight" } }, queries: [{ propertyName: "links", predicate: i0.forwardRef(() => EclLinkDirective), descendants: true }, { propertyName: "featuredItems", predicate: i0.forwardRef(() => EclMegaMenuFeaturedListItemDirective), descendants: true }], viewQueries: [{ propertyName: "megaMenuFeaturedScrollable", first: true, predicate: ["megaMenuFeaturedScrollable"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ecl-mega-menu__featured-scrollable\" #megaMenuFeaturedScrollable>\n <ng-content select=\"[eclMegaMenuFeaturedPicture]\"></ng-content>\n @if(title) {\n <span class=\"ecl-mega-menu__featured-title\" id=\"{{titleId()}}\">{{ title }}</span>\n }\n <ng-content select=\"[eclMegaMenuFeaturedList]\"></ng-content>\n</div>" }); }
|
|
185
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EclMegaMenuFeaturedComponent, isStandalone: true, selector: "div[eclMegaMenuFeatured]", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: false, isRequired: false, transformFunction: null }, titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ecl-mega-menu__featured": "this.cmpClass", "style.height.px": "this.eclMegaMenuFeaturedStyleHeight" } }, queries: [{ propertyName: "links", predicate: i0.forwardRef(() => EclLinkDirective), descendants: true, isSignal: true }, { propertyName: "featuredItems", predicate: i0.forwardRef(() => EclMegaMenuFeaturedListItemDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "megaMenuFeaturedScrollable", first: true, predicate: ["megaMenuFeaturedScrollable"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ecl-mega-menu__featured-scrollable\" #megaMenuFeaturedScrollable>\n <ng-content select=\"[eclMegaMenuFeaturedPicture]\"></ng-content>\n @if(title) {\n <span class=\"ecl-mega-menu__featured-title\" id=\"{{titleId()}}\">{{ title }}</span>\n }\n <ng-content select=\"[eclMegaMenuFeaturedList]\"></ng-content>\n</div>" }); }
|
|
183
186
|
}
|
|
184
187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuFeaturedComponent, decorators: [{
|
|
185
188
|
type: Component,
|
|
186
189
|
args: [{ selector: 'div[eclMegaMenuFeatured]', template: "<div class=\"ecl-mega-menu__featured-scrollable\" #megaMenuFeaturedScrollable>\n <ng-content select=\"[eclMegaMenuFeaturedPicture]\"></ng-content>\n @if(title) {\n <span class=\"ecl-mega-menu__featured-title\" id=\"{{titleId()}}\">{{ title }}</span>\n }\n <ng-content select=\"[eclMegaMenuFeaturedList]\"></ng-content>\n</div>" }]
|
|
187
|
-
}], propDecorators: { megaMenuFeaturedScrollable: [{
|
|
188
|
-
type: ViewChild,
|
|
189
|
-
args: ['megaMenuFeaturedScrollable']
|
|
190
|
-
}], cmpClass: [{
|
|
190
|
+
}], propDecorators: { megaMenuFeaturedScrollable: [{ type: i0.ViewChild, args: ['megaMenuFeaturedScrollable', { isSignal: true }] }], cmpClass: [{
|
|
191
191
|
type: HostBinding,
|
|
192
192
|
args: ['class.ecl-mega-menu__featured']
|
|
193
193
|
}], eclMegaMenuFeaturedStyleHeight: [{
|
|
@@ -195,13 +195,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
195
195
|
args: ['style.height.px']
|
|
196
196
|
}], title: [{
|
|
197
197
|
type: Input
|
|
198
|
-
}], titleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleId", required: false }] }], links: [{
|
|
199
|
-
type: ContentChildren,
|
|
200
|
-
args: [forwardRef(() => EclLinkDirective), { descendants: true }]
|
|
201
|
-
}], featuredItems: [{
|
|
202
|
-
type: ContentChildren,
|
|
203
|
-
args: [forwardRef(() => EclMegaMenuFeaturedListItemDirective), { descendants: true }]
|
|
204
|
-
}] } });
|
|
198
|
+
}], titleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleId", required: false }] }], links: [{ type: i0.ContentChildren, args: [forwardRef(() => EclLinkDirective), { ...{ descendants: true }, isSignal: true }] }], featuredItems: [{ type: i0.ContentChildren, args: [forwardRef(() => EclMegaMenuFeaturedListItemDirective), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
205
199
|
|
|
206
200
|
class EclMegaMenuDataService {
|
|
207
201
|
constructor() {
|
|
@@ -311,6 +305,31 @@ class EclMegaMenuSubitemComponent extends ECLBaseDirective {
|
|
|
311
305
|
*/
|
|
312
306
|
this.linkExtraAttributes = input(undefined, /* @ts-ignore */
|
|
313
307
|
...(ngDevMode ? [{ debugName: "linkExtraAttributes" }] : /* istanbul ignore next */ []));
|
|
308
|
+
/**
|
|
309
|
+
* Wrapper div element of the second level sub-items.
|
|
310
|
+
*/
|
|
311
|
+
this.megaMenuLevel2 = viewChild('megaMenuLevel2', /* @ts-ignore */
|
|
312
|
+
...(ngDevMode ? [{ debugName: "megaMenuLevel2" }] : /* istanbul ignore next */ []));
|
|
313
|
+
/**
|
|
314
|
+
* The link element, if it exists. Item can have either link or button.
|
|
315
|
+
*/
|
|
316
|
+
this.subMenuItemLink = viewChild(EclLinkDirective, /* @ts-ignore */
|
|
317
|
+
...(ngDevMode ? [{ debugName: "subMenuItemLink" }] : /* istanbul ignore next */ []));
|
|
318
|
+
/**
|
|
319
|
+
* The button element, if it exists. Item can have either link or button.
|
|
320
|
+
*/
|
|
321
|
+
this.subMenuItemBtn = viewChild('subMenuItemBtn', /* @ts-ignore */
|
|
322
|
+
...(ngDevMode ? [{ debugName: "subMenuItemBtn" }] : /* istanbul ignore next */ []));
|
|
323
|
+
/**
|
|
324
|
+
* The directive of the submenu lits.
|
|
325
|
+
*/
|
|
326
|
+
this.submenu = contentChild(forwardRef(() => EclMegaMenuSublistDirective), /* @ts-ignore */
|
|
327
|
+
...(ngDevMode ? [{ debugName: "submenu" }] : /* istanbul ignore next */ []));
|
|
328
|
+
/**
|
|
329
|
+
* The component for the featured items.
|
|
330
|
+
*/
|
|
331
|
+
this.eclMegaMenuFeatured = contentChild(forwardRef(() => EclMegaMenuFeaturedComponent), /* @ts-ignore */
|
|
332
|
+
...(ngDevMode ? [{ debugName: "eclMegaMenuFeatured" }] : /* istanbul ignore next */ []));
|
|
314
333
|
this.megaMenuSubItemClicked = new EventEmitter();
|
|
315
334
|
this.megaMenuSubItemKeydown = new EventEmitter();
|
|
316
335
|
this.isCurrent = false;
|
|
@@ -330,27 +349,30 @@ class EclMegaMenuSubitemComponent extends ECLBaseDirective {
|
|
|
330
349
|
this.appShell = inject(EuiAppShellService);
|
|
331
350
|
const eclMegaMenuService = this.eclMegaMenuService;
|
|
332
351
|
afterNextRender(() => {
|
|
333
|
-
|
|
334
|
-
|
|
352
|
+
const subMenuItemLink = this.subMenuItemLink();
|
|
353
|
+
if (subMenuItemLink) {
|
|
354
|
+
eclMegaMenuService.setExtraAttributesForLink(subMenuItemLink.el.nativeElement, this.linkExtraAttributes());
|
|
335
355
|
}
|
|
336
356
|
this.observeBreakpointChanges();
|
|
337
357
|
});
|
|
338
358
|
}
|
|
339
359
|
get hasChildren() {
|
|
340
|
-
return !!this.submenu;
|
|
360
|
+
return !!this.submenu();
|
|
341
361
|
}
|
|
342
362
|
get hasFeatured() {
|
|
343
|
-
return !!this.eclMegaMenuFeatured;
|
|
363
|
+
return !!this.eclMegaMenuFeatured();
|
|
344
364
|
}
|
|
345
365
|
/**
|
|
346
366
|
* Sets focus on either link or button element.
|
|
347
367
|
*/
|
|
348
368
|
onFocus() {
|
|
349
|
-
|
|
350
|
-
|
|
369
|
+
const subMenuItemLink = this.subMenuItemLink();
|
|
370
|
+
const subMenuItemBtn = this.subMenuItemBtn();
|
|
371
|
+
if (subMenuItemLink) {
|
|
372
|
+
subMenuItemLink.onFocus();
|
|
351
373
|
}
|
|
352
|
-
else if (
|
|
353
|
-
|
|
374
|
+
else if (subMenuItemBtn) {
|
|
375
|
+
subMenuItemBtn.onFocus();
|
|
354
376
|
}
|
|
355
377
|
}
|
|
356
378
|
onHide() {
|
|
@@ -415,14 +437,15 @@ class EclMegaMenuSubitemComponent extends ECLBaseDirective {
|
|
|
415
437
|
// Reset computed heights when switching breakpoints
|
|
416
438
|
if (wasMobile !== isMobile) {
|
|
417
439
|
this.level2StyleHeight = null;
|
|
418
|
-
|
|
419
|
-
|
|
440
|
+
const eclMegaMenuFeatured = this.eclMegaMenuFeatured();
|
|
441
|
+
if (eclMegaMenuFeatured) {
|
|
442
|
+
eclMegaMenuFeatured.eclMegaMenuFeaturedStyleHeight = null;
|
|
420
443
|
}
|
|
421
444
|
}
|
|
422
445
|
});
|
|
423
446
|
}
|
|
424
447
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuSubitemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
425
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EclMegaMenuSubitemComponent, isStandalone: true, selector: "li[eclMegaMenuSubitem]", inputs: { buttonId: { classPropertyName: "buttonId", publicName: "buttonId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, isExternal: { classPropertyName: "isExternal", publicName: "isExternal", isSignal: true, isRequired: false, transformFunction: null }, externalIconTitle: { classPropertyName: "externalIconTitle", publicName: "externalIconTitle", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: false, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, isSeeAll: { classPropertyName: "isSeeAll", publicName: "isSeeAll", isSignal: true, isRequired: false, transformFunction: null }, linkExtraAttributes: { classPropertyName: "linkExtraAttributes", publicName: "linkExtraAttributes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { megaMenuSubItemClicked: "megaMenuSubItemClicked", megaMenuSubItemKeydown: "megaMenuSubItemKeydown" }, host: { properties: { "class": "this.cssClasses", "style.display": "this.display" } }, queries: [{ propertyName: "submenu", first: true, predicate: i0.forwardRef(() => EclMegaMenuSublistDirective), descendants: true }, { propertyName: "eclMegaMenuFeatured", first: true, predicate: i0.forwardRef(() => EclMegaMenuFeaturedComponent), descendants: true }], viewQueries: [{ propertyName: "megaMenuLevel2", first: true, predicate: ["megaMenuLevel2"], descendants: true }, { propertyName: "subMenuItemLink", first: true, predicate: EclLinkDirective, descendants: true }, { propertyName: "subMenuItemBtn", first: true, predicate: ["subMenuItemBtn"], descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (!isSeeAll()) {\n@if (hasChildren) {\n<button eclButton #subMenuItemBtn variant=\"primary\" class=\"ecl-mega-menu__sublink\" [attr.aria-expanded]=\"isExpanded\"\n (click)=\"onButtonClick()\" (keydown)=\"onKeydown($event)\" id=\"{{buttonId()}}\">\n <span eclButtonLabel>{{label}}</span>\n <ecl-icon icon=\"corner-arrow\" transform=\"rotate-90\" size=\"2xs\"></ecl-icon>\n</button>\n} @else if (href) {\n<a eclLink variant=\"standalone\" [href]=\"href\" [target]=\"target()\" class=\"ecl-mega-menu__sublink\"\n (keydown)=\"onKeydown($event)\" (click)=\"onLinkClick()\">\n <span eclLinkLabel>{{label}}</span>\n <ng-container *ngTemplateOutlet=\"eclIcon\"></ng-container>\n</a>\n} @else {\n<a eclLink variant=\"standalone\" [attr.tabindex]=\"tabindex || 0\" [routerLink]=\"routerLink()\"\n [queryParams]=\"queryParams()\" [queryParamsHandling]=\"queryParamsHandling()\" class=\"ecl-mega-menu__sublink\"\n (keydown)=\"onKeydown($event)\" (click)=\"onLinkClick()\">\n <span eclLinkLabel>{{label}}</span>\n <ng-container *ngTemplateOutlet=\"eclIcon\"></ng-container>\n</a>\n}\n\n@if (hasChildren) {\n<div class=\"ecl-mega-menu__mega ecl-mega-menu__mega--level-2\" #megaMenuLevel2\n [style.height.px]=\"level2StyleHeight\">\n <ng-content select=\"[eclMegaMenuSublist]\"></ng-content>\n <ng-content select=\"[eclMegaMenuFeatured]\"></ng-content>\n</div>\n}\n} @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n}\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n\n<ng-template #eclIcon>\n @if (isExternal()) {\n <ecl-icon icon=\"external\" size=\"2xs\" ariaHidden=\"false\" role=\"img\">\n <title>Links to an external domain</title>\n </ecl-icon>\n }\n <!-- <ng-content select=\"ecl-icon\"></ng-content> -->\n</ng-template>", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i1.EclButtonComponent, selector: "button[eclButton], button[ecl-button], a[eclButton]", inputs: ["isIconOnly", "variant", "eclStyle", "size", "containerStyleClass"] }, { kind: "directive", type: i1.EclButtonLabelDirective, selector: "[eclButtonLabel]" }, { kind: "component", type: i2.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "directive", type: i3.EclLinkDirective, selector: "[eclLink]", inputs: ["extraAttributes", "isInverted", "isIconOnly", "isHighlight", "isNoVisited", "isBranded", "variant"] }, { kind: "directive", type: i3.EclLinkLabelDirective, selector: "[eclLinkLabel]" }] }); }
|
|
448
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EclMegaMenuSubitemComponent, isStandalone: true, selector: "li[eclMegaMenuSubitem]", inputs: { buttonId: { classPropertyName: "buttonId", publicName: "buttonId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, isExternal: { classPropertyName: "isExternal", publicName: "isExternal", isSignal: true, isRequired: false, transformFunction: null }, externalIconTitle: { classPropertyName: "externalIconTitle", publicName: "externalIconTitle", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: false, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, isSeeAll: { classPropertyName: "isSeeAll", publicName: "isSeeAll", isSignal: true, isRequired: false, transformFunction: null }, linkExtraAttributes: { classPropertyName: "linkExtraAttributes", publicName: "linkExtraAttributes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { megaMenuSubItemClicked: "megaMenuSubItemClicked", megaMenuSubItemKeydown: "megaMenuSubItemKeydown" }, host: { properties: { "class": "this.cssClasses", "style.display": "this.display" } }, queries: [{ propertyName: "submenu", first: true, predicate: i0.forwardRef(() => EclMegaMenuSublistDirective), descendants: true, isSignal: true }, { propertyName: "eclMegaMenuFeatured", first: true, predicate: i0.forwardRef(() => EclMegaMenuFeaturedComponent), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "megaMenuLevel2", first: true, predicate: ["megaMenuLevel2"], descendants: true, isSignal: true }, { propertyName: "subMenuItemLink", first: true, predicate: EclLinkDirective, descendants: true, isSignal: true }, { propertyName: "subMenuItemBtn", first: true, predicate: ["subMenuItemBtn"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (!isSeeAll()) {\n@if (hasChildren) {\n<button eclButton #subMenuItemBtn variant=\"primary\" class=\"ecl-mega-menu__sublink\" [attr.aria-expanded]=\"isExpanded\"\n (click)=\"onButtonClick()\" (keydown)=\"onKeydown($event)\" id=\"{{buttonId()}}\">\n <span eclButtonLabel>{{label}}</span>\n <ecl-icon icon=\"corner-arrow\" transform=\"rotate-90\" size=\"2xs\"></ecl-icon>\n</button>\n} @else if (href) {\n<a eclLink variant=\"standalone\" [href]=\"href\" [target]=\"target()\" class=\"ecl-mega-menu__sublink\"\n (keydown)=\"onKeydown($event)\" (click)=\"onLinkClick()\">\n <span eclLinkLabel>{{label}}</span>\n <ng-container *ngTemplateOutlet=\"eclIcon\"></ng-container>\n</a>\n} @else {\n<a eclLink variant=\"standalone\" [attr.tabindex]=\"tabindex || 0\" [routerLink]=\"routerLink()\"\n [queryParams]=\"queryParams()\" [queryParamsHandling]=\"queryParamsHandling()\" class=\"ecl-mega-menu__sublink\"\n (keydown)=\"onKeydown($event)\" (click)=\"onLinkClick()\">\n <span eclLinkLabel>{{label}}</span>\n <ng-container *ngTemplateOutlet=\"eclIcon\"></ng-container>\n</a>\n}\n\n@if (hasChildren) {\n<div class=\"ecl-mega-menu__mega ecl-mega-menu__mega--level-2\" #megaMenuLevel2\n [style.height.px]=\"level2StyleHeight\">\n <ng-content select=\"[eclMegaMenuSublist]\"></ng-content>\n <ng-content select=\"[eclMegaMenuFeatured]\"></ng-content>\n</div>\n}\n} @else {\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\n}\n\n<ng-template #content>\n <ng-content></ng-content>\n</ng-template>\n\n<ng-template #eclIcon>\n @if (isExternal()) {\n <ecl-icon icon=\"external\" size=\"2xs\" ariaHidden=\"false\" role=\"img\">\n <title>Links to an external domain</title>\n </ecl-icon>\n }\n <!-- <ng-content select=\"ecl-icon\"></ng-content> -->\n</ng-template>", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i1.EclButtonComponent, selector: "button[eclButton], button[ecl-button], a[eclButton]", inputs: ["isIconOnly", "variant", "eclStyle", "size", "containerStyleClass"] }, { kind: "directive", type: i1.EclButtonLabelDirective, selector: "[eclButtonLabel]" }, { kind: "component", type: i2.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "directive", type: i3.EclLinkDirective, selector: "[eclLink]", inputs: ["extraAttributes", "isInverted", "isIconOnly", "isHighlight", "isNoVisited", "isBranded", "variant"] }, { kind: "directive", type: i3.EclLinkLabelDirective, selector: "[eclLinkLabel]" }] }); }
|
|
426
449
|
}
|
|
427
450
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuSubitemComponent, decorators: [{
|
|
428
451
|
type: Component,
|
|
@@ -434,22 +457,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
434
457
|
type: Input
|
|
435
458
|
}], isExternal: [{ type: i0.Input, args: [{ isSignal: true, alias: "isExternal", required: false }] }], externalIconTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "externalIconTitle", required: false }] }], routerLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerLink", required: false }] }], queryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParams", required: false }] }], queryParamsHandling: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParamsHandling", required: false }] }], href: [{
|
|
436
459
|
type: Input
|
|
437
|
-
}], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], isSeeAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSeeAll", required: false }] }], linkExtraAttributes: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkExtraAttributes", required: false }] }], megaMenuLevel2: [{
|
|
438
|
-
type: ViewChild,
|
|
439
|
-
args: ['megaMenuLevel2']
|
|
440
|
-
}], subMenuItemLink: [{
|
|
441
|
-
type: ViewChild,
|
|
442
|
-
args: [EclLinkDirective]
|
|
443
|
-
}], subMenuItemBtn: [{
|
|
444
|
-
type: ViewChild,
|
|
445
|
-
args: ['subMenuItemBtn']
|
|
446
|
-
}], submenu: [{
|
|
447
|
-
type: ContentChild,
|
|
448
|
-
args: [forwardRef(() => EclMegaMenuSublistDirective)]
|
|
449
|
-
}], eclMegaMenuFeatured: [{
|
|
450
|
-
type: ContentChild,
|
|
451
|
-
args: [forwardRef(() => EclMegaMenuFeaturedComponent)]
|
|
452
|
-
}], megaMenuSubItemClicked: [{
|
|
460
|
+
}], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }], isSeeAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSeeAll", required: false }] }], linkExtraAttributes: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkExtraAttributes", required: false }] }], megaMenuLevel2: [{ type: i0.ViewChild, args: ['megaMenuLevel2', { isSignal: true }] }], subMenuItemLink: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EclLinkDirective), { isSignal: true }] }], subMenuItemBtn: [{ type: i0.ViewChild, args: ['subMenuItemBtn', { isSignal: true }] }], submenu: [{ type: i0.ContentChild, args: [forwardRef(() => EclMegaMenuSublistDirective), { isSignal: true }] }], eclMegaMenuFeatured: [{ type: i0.ContentChild, args: [forwardRef(() => EclMegaMenuFeaturedComponent), { isSignal: true }] }], megaMenuSubItemClicked: [{
|
|
453
461
|
type: Output
|
|
454
462
|
}], megaMenuSubItemKeydown: [{
|
|
455
463
|
type: Output
|
|
@@ -510,6 +518,10 @@ class EclMegaMenuSublistDirective extends ECLBaseDirective {
|
|
|
510
518
|
this.styleTop = null;
|
|
511
519
|
this.styleHeight = signal(null, /* @ts-ignore */
|
|
512
520
|
...(ngDevMode ? [{ debugName: "styleHeight" }] : /* istanbul ignore next */ []));
|
|
521
|
+
this.submenuItems = contentChildren(forwardRef(() => EclMegaMenuSubitemComponent), /* @ts-ignore */
|
|
522
|
+
...(ngDevMode ? [{ debugName: "submenuItems" }] : /* istanbul ignore next */ []));
|
|
523
|
+
this.spacer = contentChild(forwardRef(() => EclMegaMenuSpacerDirective), /* @ts-ignore */
|
|
524
|
+
...(ngDevMode ? [{ debugName: "spacer" }] : /* istanbul ignore next */ []));
|
|
513
525
|
this.megaMenuSubItemClicked = new EventEmitter();
|
|
514
526
|
this.destroy$ = new Subject();
|
|
515
527
|
this.isMobileBreakpoint = false;
|
|
@@ -522,7 +534,7 @@ class EclMegaMenuSublistDirective extends ECLBaseDirective {
|
|
|
522
534
|
}
|
|
523
535
|
ngDoCheck() {
|
|
524
536
|
// When a new item is added -> subscribe to item's events.
|
|
525
|
-
const diff = this.differ.diff(this.submenuItems);
|
|
537
|
+
const diff = this.differ.diff(this.submenuItems());
|
|
526
538
|
if (diff) {
|
|
527
539
|
diff.forEachItem((item) => {
|
|
528
540
|
this.connectMegaMenuItemEvents(item.item);
|
|
@@ -539,7 +551,7 @@ class EclMegaMenuSublistDirective extends ECLBaseDirective {
|
|
|
539
551
|
*/
|
|
540
552
|
onParentMegaMenuItemClick(isExpanded) {
|
|
541
553
|
if (!isExpanded) {
|
|
542
|
-
this.submenuItems.forEach(item => {
|
|
554
|
+
this.submenuItems().forEach(item => {
|
|
543
555
|
if (item.isExpanded) {
|
|
544
556
|
item.onSubMenuItemCollapse();
|
|
545
557
|
}
|
|
@@ -555,7 +567,7 @@ class EclMegaMenuSublistDirective extends ECLBaseDirective {
|
|
|
555
567
|
});
|
|
556
568
|
}
|
|
557
569
|
onMegaMenuSubItemClicked(item) {
|
|
558
|
-
this.submenuItems.filter(subItem => subItem !== item).forEach(el => {
|
|
570
|
+
this.submenuItems().filter(subItem => subItem !== item).forEach(el => {
|
|
559
571
|
el.onSubMenuItemCollapse();
|
|
560
572
|
if (this.isMobileBreakpoint && item.hasChildren) {
|
|
561
573
|
el.onHide();
|
|
@@ -564,7 +576,7 @@ class EclMegaMenuSublistDirective extends ECLBaseDirective {
|
|
|
564
576
|
this.megaMenuSubItemClicked.emit();
|
|
565
577
|
}
|
|
566
578
|
onMegaMenuSubItemKeydown(item, evt) {
|
|
567
|
-
const itemIndex = this.submenuItems
|
|
579
|
+
const itemIndex = this.submenuItems().findIndex(elem => elem === item);
|
|
568
580
|
switch (evt.key) {
|
|
569
581
|
case KeyCode.ARROW_DOWN: {
|
|
570
582
|
evt.preventDefault();
|
|
@@ -583,12 +595,12 @@ class EclMegaMenuSublistDirective extends ECLBaseDirective {
|
|
|
583
595
|
}
|
|
584
596
|
focusOnPrevSibling(index) {
|
|
585
597
|
if (index > 0) {
|
|
586
|
-
this.submenuItems.
|
|
598
|
+
this.submenuItems().at(index - 1).onFocus();
|
|
587
599
|
}
|
|
588
600
|
}
|
|
589
601
|
focusOnNextSibling(index) {
|
|
590
|
-
if (index < this.submenuItems.length - 1) {
|
|
591
|
-
this.submenuItems.
|
|
602
|
+
if (index < this.submenuItems().length - 1) {
|
|
603
|
+
this.submenuItems().at(index + 1).onFocus();
|
|
592
604
|
}
|
|
593
605
|
}
|
|
594
606
|
observeBreakpointChanges() {
|
|
@@ -608,7 +620,7 @@ class EclMegaMenuSublistDirective extends ECLBaseDirective {
|
|
|
608
620
|
});
|
|
609
621
|
}
|
|
610
622
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuSublistDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
611
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
623
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.5", type: EclMegaMenuSublistDirective, isStandalone: true, selector: "ul[eclMegaMenuSublist]", outputs: { megaMenuSubItemClicked: "megaMenuSubItemClicked" }, host: { properties: { "style.height.px": "styleHeight()", "class.ecl-mega-menu__sublist": "this.cmpClass", "class.ecl-mega-menu__sublist--scrollable": "this.isScrollable", "style.top.px": "this.styleTop" } }, queries: [{ propertyName: "submenuItems", predicate: i0.forwardRef(() => EclMegaMenuSubitemComponent), isSignal: true }, { propertyName: "spacer", first: true, predicate: i0.forwardRef(() => EclMegaMenuSpacerDirective), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 }); }
|
|
612
624
|
}
|
|
613
625
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuSublistDirective, decorators: [{
|
|
614
626
|
type: Directive,
|
|
@@ -627,13 +639,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
627
639
|
}], styleTop: [{
|
|
628
640
|
type: HostBinding,
|
|
629
641
|
args: ['style.top.px']
|
|
630
|
-
}], submenuItems: [{
|
|
631
|
-
type: ContentChildren,
|
|
632
|
-
args: [forwardRef(() => EclMegaMenuSubitemComponent)]
|
|
633
|
-
}], spacer: [{
|
|
634
|
-
type: ContentChild,
|
|
635
|
-
args: [forwardRef(() => EclMegaMenuSpacerDirective)]
|
|
636
|
-
}], megaMenuSubItemClicked: [{
|
|
642
|
+
}], submenuItems: [{ type: i0.ContentChildren, args: [forwardRef(() => EclMegaMenuSubitemComponent), { isSignal: true }] }], spacer: [{ type: i0.ContentChild, args: [forwardRef(() => EclMegaMenuSpacerDirective), { isSignal: true }] }], megaMenuSubItemClicked: [{
|
|
637
643
|
type: Output
|
|
638
644
|
}] } });
|
|
639
645
|
|
|
@@ -661,6 +667,11 @@ class EclMegaMenuInfoComponent extends ECLBaseDirective {
|
|
|
661
667
|
this.doc = inject(DOCUMENT$1);
|
|
662
668
|
this.window = this.doc.defaultView;
|
|
663
669
|
this.destroy$ = new Subject();
|
|
670
|
+
/**
|
|
671
|
+
* When the info panel contains link.
|
|
672
|
+
*/
|
|
673
|
+
this.linkItem = contentChild(forwardRef(() => EclLinkDirective), /* @ts-ignore */
|
|
674
|
+
...(ngDevMode ? [{ debugName: "linkItem" }] : /* istanbul ignore next */ []));
|
|
664
675
|
this.eclMegaMenuDataService = inject(EclMegaMenuDataService);
|
|
665
676
|
}
|
|
666
677
|
/**
|
|
@@ -669,7 +680,7 @@ class EclMegaMenuInfoComponent extends ECLBaseDirective {
|
|
|
669
680
|
get cssClasses() {
|
|
670
681
|
return [
|
|
671
682
|
super.getCssClasses('ecl-mega-menu__info'),
|
|
672
|
-
this.linkItem ? 'ecl-mega-menu__info--has-link' : '',
|
|
683
|
+
this.linkItem() ? 'ecl-mega-menu__info--has-link' : '',
|
|
673
684
|
]
|
|
674
685
|
.join(' ')
|
|
675
686
|
.trim();
|
|
@@ -677,8 +688,8 @@ class EclMegaMenuInfoComponent extends ECLBaseDirective {
|
|
|
677
688
|
ngAfterViewInit() {
|
|
678
689
|
if (isPlatformBrowser(this.platformId)) {
|
|
679
690
|
// Sets class of the sub link, if any.
|
|
680
|
-
if (this.linkItem) {
|
|
681
|
-
setTimeout(() => this.linkItem.class = 'ecl-mega-menu__info-link');
|
|
691
|
+
if (this.linkItem()) {
|
|
692
|
+
setTimeout(() => this.linkItem().class = 'ecl-mega-menu__info-link');
|
|
682
693
|
}
|
|
683
694
|
// Emits the bottom value of the element. Needed to calculate the size of the sublist. (for the same parent menu item)
|
|
684
695
|
this.publishSize();
|
|
@@ -715,7 +726,7 @@ class EclMegaMenuInfoComponent extends ECLBaseDirective {
|
|
|
715
726
|
}
|
|
716
727
|
}
|
|
717
728
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuInfoComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
718
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
729
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: EclMegaMenuInfoComponent, isStandalone: true, selector: "div[eclMegaMenuInfo]", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.opacity": "eclMegaMenuInfoStyleOpacity()", "class": "this.cssClasses", "style.height.px": "this.eclMegaMenuInfoStyleHeight" } }, queries: [{ propertyName: "linkItem", first: true, predicate: i0.forwardRef(() => EclLinkDirective), descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<span class=\"ecl-mega-menu__info-title\" [attr.id]=\"titleId() || null\">{{ title() }}</span>\n<div class=\"ecl-mega-menu__info-scrollable\">\n <div class=\"ecl-mega-menu__info-content\"><ng-content></ng-content>\n </div>\n</div>" }); }
|
|
719
730
|
}
|
|
720
731
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuInfoComponent, decorators: [{
|
|
721
732
|
type: Component,
|
|
@@ -728,10 +739,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
728
739
|
}], eclMegaMenuInfoStyleHeight: [{
|
|
729
740
|
type: HostBinding,
|
|
730
741
|
args: ['style.height.px']
|
|
731
|
-
}], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], titleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleId", required: false }] }], linkItem: [{
|
|
732
|
-
type: ContentChild,
|
|
733
|
-
args: [forwardRef(() => EclLinkDirective)]
|
|
734
|
-
}] } });
|
|
742
|
+
}], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], titleId: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleId", required: false }] }], linkItem: [{ type: i0.ContentChild, args: [forwardRef(() => EclLinkDirective), { isSignal: true }] }] } });
|
|
735
743
|
|
|
736
744
|
/**
|
|
737
745
|
* This component represents a mega menu item. Adds functionality and styling, according to ECL standards.
|
|
@@ -743,8 +751,8 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
743
751
|
get cssClasses() {
|
|
744
752
|
return [
|
|
745
753
|
super.getCssClasses('ecl-mega-menu__item'),
|
|
746
|
-
this.eclMegaMenuSublist ? 'ecl-mega-menu__item--has-children' : '',
|
|
747
|
-
this.eclMegaMenuContainer ? 'ecl-mega-menu__item--has-container' : '',
|
|
754
|
+
this.eclMegaMenuSublist() ? 'ecl-mega-menu__item--has-children' : '',
|
|
755
|
+
this.eclMegaMenuContainer() ? 'ecl-mega-menu__item--has-container' : '',
|
|
748
756
|
this.isCurrent ? 'ecl-mega-menu__item--current' : '',
|
|
749
757
|
this.isExpanded ? 'ecl-mega-menu__item--expanded' : '',
|
|
750
758
|
this.isPromotional() ? 'ecl-mega-menu__item--promotional' : '',
|
|
@@ -785,6 +793,45 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
785
793
|
...(ngDevMode ? [{ debugName: "linkExtraAttributes" }] : /* istanbul ignore next */ []));
|
|
786
794
|
this.megaMenuItemClicked = new EventEmitter();
|
|
787
795
|
this.megaMenuItemKeydown = new EventEmitter();
|
|
796
|
+
/**
|
|
797
|
+
* The wrapper around the subitems, if any.
|
|
798
|
+
*/
|
|
799
|
+
this.eclMegaMenuMega = viewChild('eclMegaMenuMega', /* @ts-ignore */
|
|
800
|
+
...(ngDevMode ? [{ debugName: "eclMegaMenuMega" }] : /* istanbul ignore next */ []));
|
|
801
|
+
/**
|
|
802
|
+
* This elemend hold some extra content, different from subitems. For example just some text or some custom links, etc.
|
|
803
|
+
*/
|
|
804
|
+
this.mainPanel = viewChild('mainPanel', /* @ts-ignore */
|
|
805
|
+
...(ngDevMode ? [{ debugName: "mainPanel" }] : /* istanbul ignore next */ []));
|
|
806
|
+
/**
|
|
807
|
+
* Actual link of the menu item. If the menu has no children, but redirects/loads another page.
|
|
808
|
+
*/
|
|
809
|
+
this.menuLink = viewChild(EclLinkDirective, /* @ts-ignore */
|
|
810
|
+
...(ngDevMode ? [{ debugName: "menuLink" }] : /* istanbul ignore next */ []));
|
|
811
|
+
/**
|
|
812
|
+
* Element, tat is rendered if the menu item has children.
|
|
813
|
+
*/
|
|
814
|
+
this.menuBtn = viewChild('menuBtn', /* @ts-ignore */
|
|
815
|
+
...(ngDevMode ? [{ debugName: "menuBtn" }] : /* istanbul ignore next */ []));
|
|
816
|
+
/**
|
|
817
|
+
* Element, that would contain some info about the current item or it's children. First in the container.
|
|
818
|
+
*/
|
|
819
|
+
this.eclMegaMenuInfo = contentChild(forwardRef(() => EclMegaMenuInfoComponent), /* @ts-ignore */
|
|
820
|
+
...(ngDevMode ? [{ debugName: "eclMegaMenuInfo" }] : /* istanbul ignore next */ []));
|
|
821
|
+
/**
|
|
822
|
+
* Element, that holds the sub items of the current menu items.
|
|
823
|
+
*/
|
|
824
|
+
this.eclMegaMenuSublist = contentChild(forwardRef(() => EclMegaMenuSublistDirective), /* @ts-ignore */
|
|
825
|
+
...(ngDevMode ? [{ debugName: "eclMegaMenuSublist" }] : /* istanbul ignore next */ []));
|
|
826
|
+
// Get all the sublists including childrens's sublist, to detect if it's only one level submenu.
|
|
827
|
+
this.eclMegaMenuSublists = contentChildren(forwardRef(() => EclMegaMenuSublistDirective), { ...(ngDevMode ? { debugName: "eclMegaMenuSublists" } : /* istanbul ignore next */ {}), descendants: true });
|
|
828
|
+
this.eclMegaMenuFeatured = contentChild(forwardRef(() => EclMegaMenuFeaturedComponent), { ...(ngDevMode ? { debugName: "eclMegaMenuFeatured" } : /* istanbul ignore next */ {}), descendants: false });
|
|
829
|
+
/**
|
|
830
|
+
* Component, that consist of some custom info, text or whatever. When the menu item has no children, but still some
|
|
831
|
+
* sub container is displayed.
|
|
832
|
+
*/
|
|
833
|
+
this.eclMegaMenuContainer = contentChild(forwardRef(() => EclMegaMenuContainerDirective), /* @ts-ignore */
|
|
834
|
+
...(ngDevMode ? [{ debugName: "eclMegaMenuContainer" }] : /* istanbul ignore next */ []));
|
|
788
835
|
this.containerStyleHeight = null;
|
|
789
836
|
this.isCurrent = false;
|
|
790
837
|
this.isMobileBreakpoint = false;
|
|
@@ -806,23 +853,25 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
806
853
|
this.eclMegaMenuDataService.eclMegaMenuInfoBottomYSubject$.pipe(takeUntil(this.destroy$)).subscribe(value => {
|
|
807
854
|
this.calculateSublistStyle(value);
|
|
808
855
|
});
|
|
809
|
-
|
|
810
|
-
|
|
856
|
+
const menuLink = this.menuLink();
|
|
857
|
+
if (menuLink) {
|
|
858
|
+
this.eclMegaMenuService.setExtraAttributesForLink(menuLink.el.nativeElement, this.linkExtraAttributes());
|
|
811
859
|
}
|
|
812
860
|
this.observeBreakpointChanges();
|
|
813
861
|
this.observeResizeWindow();
|
|
814
862
|
});
|
|
815
863
|
}
|
|
816
864
|
ngAfterContentInit() {
|
|
817
|
-
this.eclMegaMenuSublist?.megaMenuSubItemClicked.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
865
|
+
this.eclMegaMenuSublist()?.megaMenuSubItemClicked.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
818
866
|
if (!this.isExpanded) {
|
|
819
867
|
return;
|
|
820
868
|
}
|
|
821
869
|
if (!this.isMobileBreakpoint) {
|
|
822
870
|
// Only hide/show the level-2 panel when switching sub-items
|
|
823
|
-
const expandedSubItem = this.eclMegaMenuSublist.submenuItems.find(item => item.hasChildren && item.isExpanded);
|
|
824
|
-
|
|
825
|
-
|
|
871
|
+
const expandedSubItem = this.eclMegaMenuSublist().submenuItems().find(item => item.hasChildren && item.isExpanded);
|
|
872
|
+
const megaMenuLevel2 = expandedSubItem.megaMenuLevel2();
|
|
873
|
+
if (expandedSubItem && megaMenuLevel2) {
|
|
874
|
+
megaMenuLevel2.nativeElement.style.opacity = '0';
|
|
826
875
|
}
|
|
827
876
|
}
|
|
828
877
|
setTimeout(() => this.checkDropdownHeight(false), 100);
|
|
@@ -833,29 +882,31 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
833
882
|
this.destroy$.unsubscribe();
|
|
834
883
|
}
|
|
835
884
|
get hasNoInfo() {
|
|
836
|
-
return !this.eclMegaMenuInfo;
|
|
885
|
+
return !this.eclMegaMenuInfo();
|
|
837
886
|
}
|
|
838
887
|
get hasChildren() {
|
|
839
|
-
return !!this.eclMegaMenuSublist || !!this.eclMegaMenuContainer;
|
|
888
|
+
return !!this.eclMegaMenuSublist() || !!this.eclMegaMenuContainer();
|
|
840
889
|
}
|
|
841
890
|
get hasSublist() {
|
|
842
|
-
return !!this.eclMegaMenuSublist;
|
|
891
|
+
return !!this.eclMegaMenuSublist();
|
|
843
892
|
}
|
|
844
893
|
get hasFeatured() {
|
|
845
|
-
return !!this.eclMegaMenuFeatured;
|
|
894
|
+
return !!this.eclMegaMenuFeatured();
|
|
846
895
|
}
|
|
847
896
|
get hasContainer() {
|
|
848
|
-
return !!this.eclMegaMenuContainer;
|
|
897
|
+
return !!this.eclMegaMenuContainer();
|
|
849
898
|
}
|
|
850
899
|
/**
|
|
851
900
|
* Set the focus on the sub element - link or button.
|
|
852
901
|
*/
|
|
853
902
|
onFocus() {
|
|
854
|
-
|
|
855
|
-
|
|
903
|
+
const menuLink = this.menuLink();
|
|
904
|
+
const menuBtn = this.menuBtn();
|
|
905
|
+
if (menuLink) {
|
|
906
|
+
menuLink.onFocus();
|
|
856
907
|
}
|
|
857
|
-
else if (
|
|
858
|
-
|
|
908
|
+
else if (menuBtn) {
|
|
909
|
+
menuBtn.onFocus();
|
|
859
910
|
}
|
|
860
911
|
}
|
|
861
912
|
/**
|
|
@@ -865,8 +916,9 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
865
916
|
if (this.hasChildren) {
|
|
866
917
|
this.isCurrent = !this.isCurrent;
|
|
867
918
|
this.isExpanded = !this.isExpanded;
|
|
868
|
-
|
|
869
|
-
|
|
919
|
+
const eclMegaMenuSublist = this.eclMegaMenuSublist();
|
|
920
|
+
if (eclMegaMenuSublist) {
|
|
921
|
+
eclMegaMenuSublist.onParentMegaMenuItemClick(this.isExpanded);
|
|
870
922
|
}
|
|
871
923
|
if (this.isExpanded) {
|
|
872
924
|
this.eclHeaderMenuComunicationService.updateExpanded(this.isExpanded);
|
|
@@ -892,8 +944,9 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
892
944
|
onMegaMenuItemCollapse() {
|
|
893
945
|
this.isCurrent = false;
|
|
894
946
|
this.isExpanded = false;
|
|
895
|
-
|
|
896
|
-
|
|
947
|
+
const eclMegaMenuSublist = this.eclMegaMenuSublist();
|
|
948
|
+
if (eclMegaMenuSublist) {
|
|
949
|
+
eclMegaMenuSublist.onParentMegaMenuItemClick(this.isExpanded);
|
|
897
950
|
}
|
|
898
951
|
this.resetComputedHeights();
|
|
899
952
|
}
|
|
@@ -928,9 +981,10 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
928
981
|
}
|
|
929
982
|
}
|
|
930
983
|
calculateSublistStyle(bottomInfo) {
|
|
931
|
-
|
|
984
|
+
const eclMegaMenuSublist = this.eclMegaMenuSublist();
|
|
985
|
+
if (this.isMobileBreakpoint && eclMegaMenuSublist) {
|
|
932
986
|
const availableHeight = this.window.innerHeight - bottomInfo - 16;
|
|
933
|
-
|
|
987
|
+
eclMegaMenuSublist.styleTop = availableHeight;
|
|
934
988
|
}
|
|
935
989
|
}
|
|
936
990
|
calculateWrapperStyle() {
|
|
@@ -952,9 +1006,10 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
952
1006
|
* the elements should flow naturally.
|
|
953
1007
|
*/
|
|
954
1008
|
resetComputedHeights() {
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1009
|
+
const eclMegaMenuInfo = this.eclMegaMenuInfo();
|
|
1010
|
+
if (eclMegaMenuInfo) {
|
|
1011
|
+
eclMegaMenuInfo.eclMegaMenuInfoStyleHeight = null;
|
|
1012
|
+
eclMegaMenuInfo.eclMegaMenuInfoStyleOpacity.set(null);
|
|
958
1013
|
}
|
|
959
1014
|
this.megaMenuMegaStyleHeight.set(null);
|
|
960
1015
|
this.megaMenuMegaStyleOpacity.set(null);
|
|
@@ -962,19 +1017,22 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
962
1017
|
this.wrapperStyleTop = null;
|
|
963
1018
|
this.containerStyleHeight = null;
|
|
964
1019
|
// Reset featured panel height
|
|
965
|
-
|
|
966
|
-
|
|
1020
|
+
const eclMegaMenuFeatured = this.eclMegaMenuFeatured();
|
|
1021
|
+
if (eclMegaMenuFeatured) {
|
|
1022
|
+
eclMegaMenuFeatured.eclMegaMenuFeaturedStyleHeight = null;
|
|
967
1023
|
}
|
|
968
1024
|
// Reset sublist and sub-items heights
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1025
|
+
const eclMegaMenuSublist = this.eclMegaMenuSublist();
|
|
1026
|
+
if (eclMegaMenuSublist) {
|
|
1027
|
+
eclMegaMenuSublist.styleHeight.set(null);
|
|
1028
|
+
eclMegaMenuSublist.styleTop = null;
|
|
1029
|
+
eclMegaMenuSublist.isScrollable = false;
|
|
973
1030
|
// Reset level-2 heights on each subitem
|
|
974
|
-
|
|
1031
|
+
eclMegaMenuSublist.submenuItems()?.forEach(subItem => {
|
|
975
1032
|
subItem.level2StyleHeight = null;
|
|
976
|
-
|
|
977
|
-
|
|
1033
|
+
const eclMegaMenuFeatured = subItem.eclMegaMenuFeatured();
|
|
1034
|
+
if (eclMegaMenuFeatured) {
|
|
1035
|
+
eclMegaMenuFeatured.eclMegaMenuFeaturedStyleHeight = null;
|
|
978
1036
|
}
|
|
979
1037
|
});
|
|
980
1038
|
}
|
|
@@ -983,11 +1041,12 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
983
1041
|
if (this.isMobileBreakpoint) {
|
|
984
1042
|
return;
|
|
985
1043
|
}
|
|
986
|
-
if (this.eclMegaMenuMega) {
|
|
1044
|
+
if (this.eclMegaMenuMega()) {
|
|
987
1045
|
this.megaMenuMegaStyleOpacity.set(0);
|
|
988
1046
|
}
|
|
989
|
-
|
|
990
|
-
|
|
1047
|
+
const eclMegaMenuInfo = this.eclMegaMenuInfo();
|
|
1048
|
+
if (eclMegaMenuInfo) {
|
|
1049
|
+
eclMegaMenuInfo.eclMegaMenuInfoStyleOpacity.set(0);
|
|
991
1050
|
}
|
|
992
1051
|
}
|
|
993
1052
|
/**
|
|
@@ -997,38 +1056,42 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
997
1056
|
* - If no featured, panel 2: height is set on the level-2 div
|
|
998
1057
|
*/
|
|
999
1058
|
calculateMobileHeight() {
|
|
1000
|
-
|
|
1059
|
+
const eclMegaMenuMega = this.eclMegaMenuMega();
|
|
1060
|
+
if (!this.isMobileBreakpoint || !eclMegaMenuMega) {
|
|
1001
1061
|
return;
|
|
1002
1062
|
}
|
|
1063
|
+
const eclMegaMenuSublistValue = this.eclMegaMenuSublist();
|
|
1003
1064
|
if (this.hasFeatured) {
|
|
1004
1065
|
// Has featured → set height on the mega div, no scrollable on sublist
|
|
1005
|
-
const megaRect =
|
|
1066
|
+
const megaRect = eclMegaMenuMega.nativeElement.getBoundingClientRect();
|
|
1006
1067
|
const megaTop = megaRect.top;
|
|
1007
1068
|
this.megaMenuMegaStyleHeight.set(this.window.innerHeight - megaTop);
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1069
|
+
const eclMegaMenuSublist = this.eclMegaMenuSublist();
|
|
1070
|
+
if (eclMegaMenuSublist) {
|
|
1071
|
+
eclMegaMenuSublist.isScrollable = false;
|
|
1072
|
+
eclMegaMenuSublist.styleHeight.set(null);
|
|
1011
1073
|
}
|
|
1012
1074
|
}
|
|
1013
|
-
else if (
|
|
1075
|
+
else if (eclMegaMenuSublistValue) {
|
|
1014
1076
|
this.megaMenuMegaStyleHeight.set(null);
|
|
1015
1077
|
// Check if a sub-item with children is expanded (panel 2)
|
|
1016
|
-
const expandedSubItem =
|
|
1017
|
-
|
|
1078
|
+
const expandedSubItem = eclMegaMenuSublistValue.submenuItems().find(item => item.hasChildren && item.isExpanded);
|
|
1079
|
+
const megaMenuLevel2 = expandedSubItem.megaMenuLevel2();
|
|
1080
|
+
if (expandedSubItem && megaMenuLevel2) {
|
|
1018
1081
|
// No featured, panel 2 → set height on the level-2 div
|
|
1019
|
-
const subMegaRect =
|
|
1082
|
+
const subMegaRect = megaMenuLevel2.nativeElement.getBoundingClientRect();
|
|
1020
1083
|
const subMegaTop = subMegaRect.top;
|
|
1021
1084
|
expandedSubItem.level2StyleHeight = this.window.innerHeight - subMegaTop;
|
|
1022
1085
|
// Clear sublist height and scrollable since panel 2 is now showing
|
|
1023
|
-
|
|
1024
|
-
|
|
1086
|
+
eclMegaMenuSublistValue.isScrollable = false;
|
|
1087
|
+
eclMegaMenuSublistValue.styleHeight.set(null);
|
|
1025
1088
|
}
|
|
1026
1089
|
else {
|
|
1027
1090
|
// No featured, panel 1 → set height on the sublist
|
|
1028
|
-
const sublistRect =
|
|
1091
|
+
const sublistRect = eclMegaMenuSublistValue.el.nativeElement.getBoundingClientRect();
|
|
1029
1092
|
const sublistTop = sublistRect.top;
|
|
1030
|
-
|
|
1031
|
-
|
|
1093
|
+
eclMegaMenuSublistValue.styleHeight.set(this.window.innerHeight - sublistTop);
|
|
1094
|
+
eclMegaMenuSublistValue.isScrollable = true;
|
|
1032
1095
|
}
|
|
1033
1096
|
}
|
|
1034
1097
|
else {
|
|
@@ -1044,8 +1107,9 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
1044
1107
|
this.hidePanels();
|
|
1045
1108
|
}
|
|
1046
1109
|
let infoPanelHeight = 0;
|
|
1047
|
-
|
|
1048
|
-
|
|
1110
|
+
const eclMegaMenuInfo = this.eclMegaMenuInfo();
|
|
1111
|
+
if (eclMegaMenuInfo) {
|
|
1112
|
+
eclMegaMenuInfo.eclMegaMenuInfoStyleHeight = null;
|
|
1049
1113
|
}
|
|
1050
1114
|
const heights = [];
|
|
1051
1115
|
let height = 0;
|
|
@@ -1055,12 +1119,12 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
1055
1119
|
let featuredHeight2 = 0;
|
|
1056
1120
|
if (this.hasContainer) {
|
|
1057
1121
|
const viewportHeight = this.window.innerHeight;
|
|
1058
|
-
const mainTop = this.mainPanel.nativeElement.getBoundingClientRect().top;
|
|
1122
|
+
const mainTop = this.mainPanel().nativeElement.getBoundingClientRect().top;
|
|
1059
1123
|
this.containerStyleHeight = viewportHeight - mainTop;
|
|
1060
1124
|
}
|
|
1061
1125
|
else {
|
|
1062
|
-
if (
|
|
1063
|
-
infoPanelHeight =
|
|
1126
|
+
if (eclMegaMenuInfo) {
|
|
1127
|
+
infoPanelHeight = eclMegaMenuInfo.getInfoPanelScrollHeight() + 16;
|
|
1064
1128
|
if (this.isLarge) {
|
|
1065
1129
|
heights.push(infoPanelHeight);
|
|
1066
1130
|
}
|
|
@@ -1068,37 +1132,41 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
1068
1132
|
subItemsHeight = infoPanelHeight;
|
|
1069
1133
|
featuredHeight = infoPanelHeight;
|
|
1070
1134
|
}
|
|
1071
|
-
|
|
1135
|
+
eclMegaMenuInfo.eclMegaMenuInfoStyleOpacity.set(1);
|
|
1072
1136
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1137
|
+
const eclMegaMenuMega = this.eclMegaMenuMega();
|
|
1138
|
+
if (eclMegaMenuMega) {
|
|
1139
|
+
const eclMegaMenuSublist = this.eclMegaMenuSublist();
|
|
1140
|
+
if (eclMegaMenuSublist && eclMegaMenuSublist.submenuItems().length > 0) {
|
|
1075
1141
|
if (this.isOneLevelOnly()) {
|
|
1076
|
-
itemsHeight =
|
|
1142
|
+
itemsHeight = eclMegaMenuSublist.el.nativeElement.offsetHeight;
|
|
1077
1143
|
}
|
|
1078
1144
|
else {
|
|
1079
|
-
|
|
1145
|
+
eclMegaMenuSublist.submenuItems().forEach((item) => {
|
|
1080
1146
|
itemsHeight += item.getMegaMenuSubItemHeight();
|
|
1081
1147
|
});
|
|
1082
|
-
if (
|
|
1148
|
+
if (eclMegaMenuSublist.spacer()) {
|
|
1083
1149
|
itemsHeight += 25;
|
|
1084
1150
|
}
|
|
1085
1151
|
}
|
|
1086
1152
|
heights.push(itemsHeight);
|
|
1087
1153
|
}
|
|
1088
|
-
const expandedSubItem =
|
|
1154
|
+
const expandedSubItem = eclMegaMenuSublist.submenuItems().find(item => item.hasChildren && item.isExpanded);
|
|
1155
|
+
const eclMegaMenuFeatured = expandedSubItem.eclMegaMenuFeatured();
|
|
1089
1156
|
if (expandedSubItem !== undefined) {
|
|
1090
|
-
expandedSubItem.submenu.submenuItems.forEach(item => {
|
|
1157
|
+
expandedSubItem.submenu().submenuItems().forEach(item => {
|
|
1091
1158
|
subItemsHeight += item.getMegaMenuSubItemHeight();
|
|
1092
1159
|
});
|
|
1093
1160
|
heights.push(subItemsHeight);
|
|
1094
|
-
if (
|
|
1095
|
-
featuredHeight +=
|
|
1161
|
+
if (eclMegaMenuFeatured) {
|
|
1162
|
+
featuredHeight += eclMegaMenuFeatured.getEclMegaMenuFeaturedHeight();
|
|
1096
1163
|
featuredHeight += 5;
|
|
1097
1164
|
heights.push(featuredHeight);
|
|
1098
1165
|
}
|
|
1099
1166
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1167
|
+
const eclMegaMenuFeaturedValue = this.eclMegaMenuFeatured();
|
|
1168
|
+
if (eclMegaMenuFeaturedValue) {
|
|
1169
|
+
featuredHeight2 = eclMegaMenuFeaturedValue.getEclMegaMenuFeaturedHeight();
|
|
1102
1170
|
heights.push(featuredHeight2);
|
|
1103
1171
|
}
|
|
1104
1172
|
const maxHeight = Math.max(...heights);
|
|
@@ -1112,18 +1180,18 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
1112
1180
|
else {
|
|
1113
1181
|
height = maxHeight;
|
|
1114
1182
|
}
|
|
1115
|
-
this.wrapperStyleHeight =
|
|
1183
|
+
this.wrapperStyleHeight = eclMegaMenuMega && eclMegaMenuInfo && !this.isLarge ?
|
|
1116
1184
|
height + infoPanelHeight : height;
|
|
1117
1185
|
if (this.wrapperStyleHeight > availableHeight)
|
|
1118
1186
|
this.wrapperStyleHeight = availableHeight;
|
|
1119
|
-
if (
|
|
1187
|
+
if (eclMegaMenuMega && this.isLarge) {
|
|
1120
1188
|
this.megaMenuMegaStyleHeight.set(height);
|
|
1121
1189
|
}
|
|
1122
|
-
else if (
|
|
1190
|
+
else if (eclMegaMenuMega && eclMegaMenuInfo) {
|
|
1123
1191
|
this.megaMenuMegaStyleHeight.set(this.wrapperStyleHeight - infoPanelHeight);
|
|
1124
1192
|
}
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1193
|
+
if (eclMegaMenuInfo && this.isLarge) {
|
|
1194
|
+
eclMegaMenuInfo.eclMegaMenuInfoStyleHeight = height;
|
|
1127
1195
|
}
|
|
1128
1196
|
if (expandedSubItem !== undefined) {
|
|
1129
1197
|
if (this.isLarge) {
|
|
@@ -1132,24 +1200,25 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
1132
1200
|
else {
|
|
1133
1201
|
expandedSubItem.level2StyleHeight = height - infoPanelHeight;
|
|
1134
1202
|
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1203
|
+
const megaMenuLevel2 = expandedSubItem.megaMenuLevel2();
|
|
1204
|
+
if (megaMenuLevel2) {
|
|
1205
|
+
megaMenuLevel2.nativeElement.style.opacity = '1';
|
|
1137
1206
|
}
|
|
1138
|
-
if (
|
|
1207
|
+
if (eclMegaMenuFeatured) {
|
|
1139
1208
|
if (this.isLarge) {
|
|
1140
|
-
|
|
1209
|
+
eclMegaMenuFeatured.eclMegaMenuFeaturedStyleHeight = height;
|
|
1141
1210
|
}
|
|
1142
1211
|
else {
|
|
1143
|
-
|
|
1212
|
+
eclMegaMenuFeatured.eclMegaMenuFeaturedStyleHeight = height - infoPanelHeight;
|
|
1144
1213
|
}
|
|
1145
1214
|
}
|
|
1146
1215
|
}
|
|
1147
|
-
if (
|
|
1216
|
+
if (eclMegaMenuFeaturedValue) {
|
|
1148
1217
|
if (this.isLarge) {
|
|
1149
|
-
|
|
1218
|
+
eclMegaMenuFeaturedValue.eclMegaMenuFeaturedStyleHeight = height;
|
|
1150
1219
|
}
|
|
1151
1220
|
else {
|
|
1152
|
-
|
|
1221
|
+
eclMegaMenuFeaturedValue.eclMegaMenuFeaturedStyleHeight = this.wrapperStyleHeight - infoPanelHeight;
|
|
1153
1222
|
}
|
|
1154
1223
|
}
|
|
1155
1224
|
this.megaMenuMegaStyleOpacity.set(1);
|
|
@@ -1190,7 +1259,7 @@ class EclMegaMenuItemComponent extends ECLBaseDirective {
|
|
|
1190
1259
|
});
|
|
1191
1260
|
}
|
|
1192
1261
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1193
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EclMegaMenuItemComponent, isStandalone: true, selector: "li[eclMegaMenuItem]", inputs: { isPromotional: { classPropertyName: "isPromotional", publicName: "isPromotional", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: false, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, isOneLevelOnly: { classPropertyName: "isOneLevelOnly", publicName: "isOneLevelOnly", isSignal: true, isRequired: false, transformFunction: null }, linkExtraAttributes: { classPropertyName: "linkExtraAttributes", publicName: "linkExtraAttributes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { megaMenuItemClicked: "megaMenuItemClicked", megaMenuItemKeydown: "megaMenuItemKeydown" }, host: { properties: { "class": "this.cssClasses", "attr.aria-haspopup": "this.hasPopup" } }, queries: [{ propertyName: "eclMegaMenuInfo", first: true, predicate: i0.forwardRef(() => EclMegaMenuInfoComponent), descendants: true }, { propertyName: "eclMegaMenuSublist", first: true, predicate: i0.forwardRef(() => EclMegaMenuSublistDirective), descendants: true }, { propertyName: "
|
|
1262
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: EclMegaMenuItemComponent, isStandalone: true, selector: "li[eclMegaMenuItem]", inputs: { isPromotional: { classPropertyName: "isPromotional", publicName: "isPromotional", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, queryParamsHandling: { classPropertyName: "queryParamsHandling", publicName: "queryParamsHandling", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: false, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, isOneLevelOnly: { classPropertyName: "isOneLevelOnly", publicName: "isOneLevelOnly", isSignal: true, isRequired: false, transformFunction: null }, linkExtraAttributes: { classPropertyName: "linkExtraAttributes", publicName: "linkExtraAttributes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { megaMenuItemClicked: "megaMenuItemClicked", megaMenuItemKeydown: "megaMenuItemKeydown" }, host: { properties: { "class": "this.cssClasses", "attr.aria-haspopup": "this.hasPopup" } }, queries: [{ propertyName: "eclMegaMenuInfo", first: true, predicate: i0.forwardRef(() => EclMegaMenuInfoComponent), descendants: true, isSignal: true }, { propertyName: "eclMegaMenuSublist", first: true, predicate: i0.forwardRef(() => EclMegaMenuSublistDirective), descendants: true, isSignal: true }, { propertyName: "eclMegaMenuSublists", predicate: i0.forwardRef(() => EclMegaMenuSublistDirective), descendants: true, isSignal: true }, { propertyName: "eclMegaMenuFeatured", first: true, predicate: i0.forwardRef(() => EclMegaMenuFeaturedComponent), isSignal: true }, { propertyName: "eclMegaMenuContainer", first: true, predicate: i0.forwardRef(() => EclMegaMenuContainerDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "eclMegaMenuMega", first: true, predicate: ["eclMegaMenuMega"], descendants: true, isSignal: true }, { propertyName: "mainPanel", first: true, predicate: ["mainPanel"], descendants: true, isSignal: true }, { propertyName: "menuLink", first: true, predicate: EclLinkDirective, descendants: true, isSignal: true }, { propertyName: "menuBtn", first: true, predicate: ["menuBtn"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (hasChildren) {\n<button #menuBtn eclButton variant=\"primary\" class=\"ecl-mega-menu__link\" (click)=\"onMegaMenuItemClick()\"\n (keydown)=\"onKeydown($event)\">\n <span eclButtonLabel>{{label()}}</span>\n <ecl-icon icon=\"corner-arrow\" transform=\"rotate-90\" size=\"2xs\"></ecl-icon>\n <ecl-icon icon=\"arrow-left\" transform=\"flip-horizontal\" size=\"s\"></ecl-icon>\n</button>\n} @else if (href) {\n<a eclLink #menuLink variant=\"standalone\" [href]=\"href\" [target]=\"target()\" class=\"ecl-mega-menu__link\"\n (keydown)=\"onKeydown($event)\" (click)=\"onMegaMenuItemClick()\">\n <span eclLinkLabel>{{label()}}</span>\n</a>\n} @else {\n<a eclLink #menuLink variant=\"standalone\" [attr.tabindex]=\"tabindex || 0\" [routerLink]=\"routerLink()\"\n [queryParams]=\"queryParams()\" [queryParamsHandling]=\"queryParamsHandling()\" class=\"ecl-mega-menu__link\"\n (keydown)=\"onKeydown($event)\" (click)=\"onMegaMenuItemClick()\">\n <span eclLinkLabel>{{label()}}</span>\n</a>\n}\n\n@if (hasSublist) {\n<div class=\"ecl-mega-menu__wrapper\" [style.height.px]=\"wrapperStyleHeight\" [style.top.px]=\"wrapperStyleTop\">\n <div class=\"ecl-container\">\n <ng-content select=\"[eclMegaMenuInfo]\"></ng-content>\n <div #eclMegaMenuMega class=\"ecl-mega-menu__mega\" [class.ecl-mega-menu__mega--no-info]=\"hasNoInfo\"\n [class.ecl-mega-menu__mega--has-featured]=\"hasFeatured\" [style.height.px]=\"megaMenuMegaStyleHeight()\"\n [style.opacity]=\"megaMenuMegaStyleOpacity()\">\n <ng-content select=\"[eclMegaMenuSublist]\"></ng-content>\n <ng-content select=\"[eclMegaMenuFeatured]\"></ng-content>\n </div>\n </div>\n</div>\n}\n\n@if (hasContainer) {\n<div #mainPanel class=\"ecl-mega-menu__mega ecl-mega-menu__mega-container\">\n <div class=\"ecl-container\" [style.height.px]=\"containerStyleHeight\">\n <div class=\"ecl-mega-menu__mega-container-scrollable\">\n <ng-content select=\"[eclMegaMenuContainer]\"></ng-content>\n </div>\n </div>\n</div>\n}", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: i1.EclButtonComponent, selector: "button[eclButton], button[ecl-button], a[eclButton]", inputs: ["isIconOnly", "variant", "eclStyle", "size", "containerStyleClass"] }, { kind: "directive", type: i1.EclButtonLabelDirective, selector: "[eclButtonLabel]" }, { kind: "component", type: i2.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "directive", type: i3.EclLinkDirective, selector: "[eclLink]", inputs: ["extraAttributes", "isInverted", "isIconOnly", "isHighlight", "isNoVisited", "isBranded", "variant"] }, { kind: "directive", type: i3.EclLinkLabelDirective, selector: "[eclLinkLabel]" }] }); }
|
|
1194
1263
|
}
|
|
1195
1264
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuItemComponent, decorators: [{
|
|
1196
1265
|
type: Component,
|
|
@@ -1207,34 +1276,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1207
1276
|
type: Output
|
|
1208
1277
|
}], megaMenuItemKeydown: [{
|
|
1209
1278
|
type: Output
|
|
1210
|
-
}], eclMegaMenuMega: [{
|
|
1211
|
-
type: ViewChild,
|
|
1212
|
-
args: ['eclMegaMenuMega']
|
|
1213
|
-
}], mainPanel: [{
|
|
1214
|
-
type: ViewChild,
|
|
1215
|
-
args: ['mainPanel']
|
|
1216
|
-
}], menuLink: [{
|
|
1217
|
-
type: ViewChild,
|
|
1218
|
-
args: [EclLinkDirective]
|
|
1219
|
-
}], menuBtn: [{
|
|
1220
|
-
type: ViewChild,
|
|
1221
|
-
args: ['menuBtn']
|
|
1222
|
-
}], eclMegaMenuInfo: [{
|
|
1223
|
-
type: ContentChild,
|
|
1224
|
-
args: [forwardRef(() => EclMegaMenuInfoComponent)]
|
|
1225
|
-
}], eclMegaMenuSublist: [{
|
|
1226
|
-
type: ContentChild,
|
|
1227
|
-
args: [forwardRef(() => EclMegaMenuSublistDirective)]
|
|
1228
|
-
}], eclMegaMenuSublists: [{
|
|
1229
|
-
type: ContentChildren,
|
|
1230
|
-
args: [forwardRef(() => EclMegaMenuSublistDirective), { descendants: true }]
|
|
1231
|
-
}], eclMegaMenuFeatured: [{
|
|
1232
|
-
type: ContentChild,
|
|
1233
|
-
args: [forwardRef(() => EclMegaMenuFeaturedComponent), { descendants: false }]
|
|
1234
|
-
}], eclMegaMenuContainer: [{
|
|
1235
|
-
type: ContentChild,
|
|
1236
|
-
args: [forwardRef(() => EclMegaMenuContainerDirective)]
|
|
1237
|
-
}] } });
|
|
1279
|
+
}], eclMegaMenuMega: [{ type: i0.ViewChild, args: ['eclMegaMenuMega', { isSignal: true }] }], mainPanel: [{ type: i0.ViewChild, args: ['mainPanel', { isSignal: true }] }], menuLink: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EclLinkDirective), { isSignal: true }] }], menuBtn: [{ type: i0.ViewChild, args: ['menuBtn', { isSignal: true }] }], eclMegaMenuInfo: [{ type: i0.ContentChild, args: [forwardRef(() => EclMegaMenuInfoComponent), { isSignal: true }] }], eclMegaMenuSublist: [{ type: i0.ContentChild, args: [forwardRef(() => EclMegaMenuSublistDirective), { isSignal: true }] }], eclMegaMenuSublists: [{ type: i0.ContentChildren, args: [forwardRef(() => EclMegaMenuSublistDirective), { ...{ descendants: true }, isSignal: true }] }], eclMegaMenuFeatured: [{ type: i0.ContentChild, args: [forwardRef(() => EclMegaMenuFeaturedComponent), { ...{ descendants: false }, isSignal: true }] }], eclMegaMenuContainer: [{ type: i0.ContentChild, args: [forwardRef(() => EclMegaMenuContainerDirective), { isSignal: true }] }] } });
|
|
1238
1280
|
|
|
1239
1281
|
/**
|
|
1240
1282
|
* The 'eclMegaMenu' is an advanced navigation component designed for complex sites with deep hierarchies.
|
|
@@ -1277,6 +1319,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1277
1319
|
* The event that is emitted, when a menu item is selected.
|
|
1278
1320
|
*/
|
|
1279
1321
|
this.megaMenuItemSelect = output();
|
|
1322
|
+
this.menuItems = contentChildren(forwardRef(() => EclMegaMenuItemComponent), { ...(ngDevMode ? { debugName: "menuItems" } : /* istanbul ignore next */ {}), descendants: true });
|
|
1280
1323
|
/**
|
|
1281
1324
|
* If the menu is in mobile mode.
|
|
1282
1325
|
*/
|
|
@@ -1335,7 +1378,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1335
1378
|
}
|
|
1336
1379
|
ngDoCheck() {
|
|
1337
1380
|
// For each added menu item - subscribe to item events.
|
|
1338
|
-
const diff = this.differ.diff(this.menuItems);
|
|
1381
|
+
const diff = this.differ.diff(this.menuItems());
|
|
1339
1382
|
if (diff) {
|
|
1340
1383
|
diff.forEachItem((item) => {
|
|
1341
1384
|
this.connectMegaMenuItemEvents(item.item);
|
|
@@ -1370,8 +1413,8 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1370
1413
|
this.isOpenMobile = true;
|
|
1371
1414
|
this.eclHeaderMenuComunicationService.updateOpen(true);
|
|
1372
1415
|
// Focus first element
|
|
1373
|
-
if (this.menuItems.length > 0) {
|
|
1374
|
-
this.menuItems.
|
|
1416
|
+
if (this.menuItems().length > 0) {
|
|
1417
|
+
this.menuItems().at(0).onFocus();
|
|
1375
1418
|
}
|
|
1376
1419
|
}
|
|
1377
1420
|
}
|
|
@@ -1379,7 +1422,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1379
1422
|
this.enableScroll();
|
|
1380
1423
|
// Collapse any expanded menu item (and its sub-items) so that
|
|
1381
1424
|
// reopening the menu always shows the top-level list cleanly.
|
|
1382
|
-
const expandedItem = this.menuItems?.find(item => item.isExpanded);
|
|
1425
|
+
const expandedItem = this.menuItems()?.find(item => item.isExpanded);
|
|
1383
1426
|
if (expandedItem) {
|
|
1384
1427
|
expandedItem.onMegaMenuItemCollapse();
|
|
1385
1428
|
}
|
|
@@ -1422,11 +1465,11 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1422
1465
|
this.isStartPanel = false;
|
|
1423
1466
|
this.isTwoPanels = false;
|
|
1424
1467
|
this.isOnePanel = true;
|
|
1425
|
-
const currentItem = this.menuItems.find(item => item.isExpanded);
|
|
1426
|
-
const currentSubItem = currentItem.eclMegaMenuSublist.submenuItems.find(item => item.isExpanded);
|
|
1468
|
+
const currentItem = this.menuItems().find(item => item.isExpanded);
|
|
1469
|
+
const currentSubItem = currentItem.eclMegaMenuSublist().submenuItems().find(item => item.isExpanded);
|
|
1427
1470
|
this.hasSecondaryFeatured = false;
|
|
1428
1471
|
if (this.isMobileOrTablet) {
|
|
1429
|
-
currentItem.eclMegaMenuSublist.submenuItems.filter(item => !item.isExpanded).forEach(el => {
|
|
1472
|
+
currentItem.eclMegaMenuSublist().submenuItems().filter(item => !item.isExpanded).forEach(el => {
|
|
1430
1473
|
el.onShow();
|
|
1431
1474
|
});
|
|
1432
1475
|
}
|
|
@@ -1436,7 +1479,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1436
1479
|
onMegaMenuBackToStartPanel() {
|
|
1437
1480
|
this.isOnePanel = false;
|
|
1438
1481
|
this.isStartPanel = true;
|
|
1439
|
-
const currentItem = this.menuItems.find(item => item.isExpanded);
|
|
1482
|
+
const currentItem = this.menuItems().find(item => item.isExpanded);
|
|
1440
1483
|
currentItem.isCurrent = false;
|
|
1441
1484
|
currentItem.isExpanded = false;
|
|
1442
1485
|
this.eclHeaderMenuComunicationService.updateExpanded(false);
|
|
@@ -1465,7 +1508,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1465
1508
|
}
|
|
1466
1509
|
onMegaMenuItemClicked(item) {
|
|
1467
1510
|
this.hasSecondaryFeatured = false;
|
|
1468
|
-
this.menuItems.filter(megaItem => megaItem !== item).forEach(item => item.onMegaMenuItemCollapse());
|
|
1511
|
+
this.menuItems().filter(megaItem => megaItem !== item).forEach(item => item.onMegaMenuItemCollapse());
|
|
1469
1512
|
if (item.hasChildren) {
|
|
1470
1513
|
if (item.isExpanded) {
|
|
1471
1514
|
if (this.isMobileOrTablet) {
|
|
@@ -1474,7 +1517,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1474
1517
|
this.isStartPanel = false;
|
|
1475
1518
|
}
|
|
1476
1519
|
else {
|
|
1477
|
-
if (item.eclMegaMenuSublist?.submenuItems.
|
|
1520
|
+
if (item.eclMegaMenuSublist()?.submenuItems().at(0).hasChildren) {
|
|
1478
1521
|
this.isOnePanel = false;
|
|
1479
1522
|
this.isTwoPanels = true;
|
|
1480
1523
|
}
|
|
@@ -1497,7 +1540,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1497
1540
|
this.megaMenuItemSelect.emit(item);
|
|
1498
1541
|
}
|
|
1499
1542
|
onMegaMenuItemKeydown(item, evt) {
|
|
1500
|
-
const itemIndex = this.menuItems
|
|
1543
|
+
const itemIndex = this.menuItems().findIndex(elem => elem === item);
|
|
1501
1544
|
switch (evt.key) {
|
|
1502
1545
|
case KeyCode.ARROW_DOWN: {
|
|
1503
1546
|
evt.preventDefault();
|
|
@@ -1541,7 +1584,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1541
1584
|
}
|
|
1542
1585
|
closeMenuAndAnyOpenSubMenu() {
|
|
1543
1586
|
if (this.isExpanded) {
|
|
1544
|
-
const expandedItem = this.menuItems.find(item => item.isExpanded);
|
|
1587
|
+
const expandedItem = this.menuItems().find(item => item.isExpanded);
|
|
1545
1588
|
if (expandedItem !== undefined) {
|
|
1546
1589
|
expandedItem.onMegaMenuItemCollapse();
|
|
1547
1590
|
}
|
|
@@ -1557,12 +1600,12 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1557
1600
|
}
|
|
1558
1601
|
focusOnPrevSibling(index) {
|
|
1559
1602
|
if (index > 0) {
|
|
1560
|
-
this.menuItems.
|
|
1603
|
+
this.menuItems().at(index - 1).onFocus();
|
|
1561
1604
|
}
|
|
1562
1605
|
}
|
|
1563
1606
|
focusOnNextSibling(index) {
|
|
1564
|
-
if (index < this.menuItems.length - 1) {
|
|
1565
|
-
this.menuItems.
|
|
1607
|
+
if (index < this.menuItems().length - 1) {
|
|
1608
|
+
this.menuItems().at(index + 1).onFocus();
|
|
1566
1609
|
}
|
|
1567
1610
|
}
|
|
1568
1611
|
subscribeToAppShellBreakpoints() {
|
|
@@ -1618,7 +1661,7 @@ class EclMegaMenuComponent extends ECLBaseDirective {
|
|
|
1618
1661
|
}
|
|
1619
1662
|
}
|
|
1620
1663
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1621
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1664
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: EclMegaMenuComponent, isStandalone: true, selector: "nav[eclMegaMenu]", outputs: { megaMenuItemSelect: "megaMenuItemSelect" }, host: { listeners: { "eclClickOutside": "onClickOutsideMegaMenu()" }, properties: { "class": "this.cssClasses", "attr.data-expanded": "this.expandedAttr", "attr.role": "this.role" } }, queries: [{ propertyName: "menuItems", predicate: i0.forwardRef(() => EclMegaMenuItemComponent), descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i1$1.ECLBaseDirective }, { directive: i1$1.ECLClickOutsideDirective, outputs: ["eclClickOutside", "eclClickOutside"] }], ngImport: i0, template: "<div class=\"ecl-mega-menu__overlay\" [style.top.px]=\"overlayStyleTop\"></div>\n<div class=\"ecl-container ecl-mega-menu__container\">\n <button class=\"ecl-button ecl-button--tertiary ecl-mega-menu__open ecl-button--icon-only\"\n type=\"button\" [attr.aria-expanded]=\"isMobileExpanded\" (click)=\"onMegaMenuMobileOpen()\">\n <ecl-icon icon=\"hamburger\" size=\"m\"></ecl-icon>\n <ecl-icon icon=\"close\" size=\"m\"></ecl-icon>\n <span class=\"ecl-button__label\">{{ (isOpenMobile ? 'ecl.common.CLOSE' : 'ecl.menu.MENU') | translate }}</span>\n </button>\n <section class=\"ecl-mega-menu__inner\" [class.ecl-mega-menu__inner--expanded]=\"!isStartPanel && isExpanded\"\n aria-label=\"ecl mega menu\" [style.top.px]=\"innerStyleTop\">\n <header class=\"ecl-mega-menu__inner-header\">\n <button eclButton variant=\"tertiary\" eclStyle=\"neutral\" class=\"ecl-mega-menu__back\" type=\"submit\" (click)=\"onMegaMenuBack()\">\n <ecl-icon icon=\"corner-arrow\" transform=\"rotate-270\"></ecl-icon>\n <span eclButtonLabel>Back</span>\n </button>\n </header>\n <ng-content></ng-content>\n </section>\n</div>", dependencies: [{ kind: "component", type: i1.EclButtonComponent, selector: "button[eclButton], button[ecl-button], a[eclButton]", inputs: ["isIconOnly", "variant", "eclStyle", "size", "containerStyleClass"] }, { kind: "directive", type: i1.EclButtonLabelDirective, selector: "[eclButtonLabel]" }, { kind: "component", type: i2.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
|
1622
1665
|
}
|
|
1623
1666
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: EclMegaMenuComponent, decorators: [{
|
|
1624
1667
|
type: Component,
|
|
@@ -1640,10 +1683,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1640
1683
|
}], role: [{
|
|
1641
1684
|
type: HostBinding,
|
|
1642
1685
|
args: ['attr.role']
|
|
1643
|
-
}], megaMenuItemSelect: [{ type: i0.Output, args: ["megaMenuItemSelect"] }], menuItems: [{
|
|
1644
|
-
type: ContentChildren,
|
|
1645
|
-
args: [forwardRef(() => EclMegaMenuItemComponent), { descendants: true }]
|
|
1646
|
-
}], onClickOutsideMegaMenu: [{
|
|
1686
|
+
}], megaMenuItemSelect: [{ type: i0.Output, args: ["megaMenuItemSelect"] }], menuItems: [{ type: i0.ContentChildren, args: [forwardRef(() => EclMegaMenuItemComponent), { ...{ descendants: true }, isSignal: true }] }], onClickOutsideMegaMenu: [{
|
|
1647
1687
|
type: HostListener,
|
|
1648
1688
|
args: ['eclClickOutside']
|
|
1649
1689
|
}] } });
|