@eui/ecl 21.0.0-alpha.30 → 21.0.0-alpha.32
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/assets/i18n-ecl/bg.json +1 -0
- package/assets/i18n-ecl/cs.json +1 -0
- package/assets/i18n-ecl/da.json +1 -0
- package/assets/i18n-ecl/de.json +1 -0
- package/assets/i18n-ecl/el.json +1 -0
- package/assets/i18n-ecl/en.json +1 -0
- package/assets/i18n-ecl/es.json +1 -0
- package/assets/i18n-ecl/et.json +1 -0
- package/assets/i18n-ecl/fi.json +1 -0
- package/assets/i18n-ecl/fr.json +1 -0
- package/assets/i18n-ecl/ga.json +1 -0
- package/assets/i18n-ecl/hr.json +1 -0
- package/assets/i18n-ecl/hu.json +1 -0
- package/assets/i18n-ecl/it.json +1 -0
- package/assets/i18n-ecl/lt.json +1 -0
- package/assets/i18n-ecl/lv.json +1 -0
- package/assets/i18n-ecl/mt.json +1 -0
- package/assets/i18n-ecl/nl.json +1 -0
- package/assets/i18n-ecl/pl.json +1 -0
- package/assets/i18n-ecl/pt.json +1 -0
- package/assets/i18n-ecl/ro.json +1 -0
- package/assets/i18n-ecl/sk.json +1 -0
- package/assets/i18n-ecl/sl.json +1 -0
- package/assets/i18n-ecl/sv.json +1 -0
- package/components/ecl-accordion/index.d.ts +8 -4
- package/components/ecl-accordion/index.d.ts.map +1 -1
- package/components/ecl-banner/index.d.ts +8 -1
- package/components/ecl-banner/index.d.ts.map +1 -1
- package/components/ecl-divider/index.d.ts +31 -0
- package/components/ecl-divider/index.d.ts.map +1 -0
- package/components/ecl-divider/package.json +3 -0
- package/components/ecl-featured/index.d.ts +13 -35
- package/components/ecl-featured/index.d.ts.map +1 -1
- package/components/ecl-feedback-message/index.d.ts.map +1 -1
- package/components/ecl-mega-menu/index.d.ts +7 -3
- package/components/ecl-mega-menu/index.d.ts.map +1 -1
- package/components/ecl-menu/index.d.ts +12 -4
- package/components/ecl-menu/index.d.ts.map +1 -1
- package/components/ecl-popover/index.d.ts +17 -12
- package/components/ecl-popover/index.d.ts.map +1 -1
- package/components/ecl-site-footer/index.d.ts +61 -32
- package/components/ecl-site-footer/index.d.ts.map +1 -1
- package/components/ecl-site-header/index.d.ts +6 -3
- package/components/ecl-site-header/index.d.ts.map +1 -1
- package/components/ecl-social-media-follow/index.d.ts +3 -1
- package/components/ecl-social-media-follow/index.d.ts.map +1 -1
- package/core/index.d.ts +7 -1
- package/core/index.d.ts.map +1 -1
- package/docs/changelog.html +152 -0
- package/docs/components/EclAccordionComponent.html +43 -2
- package/docs/components/EclAccordionItemComponent.html +3 -3
- package/docs/components/EclAppComponent.html +2 -2
- package/docs/components/EclBannerComponent.html +33 -2
- package/docs/components/EclBlockquoteComponent.html +2 -2
- package/docs/components/EclBreadcrumbComponent.html +2 -2
- package/docs/components/EclBreadcrumbSegmentComponent.html +2 -2
- package/docs/components/EclButtonComponent.html +2 -2
- package/docs/components/EclCardBodyComponent.html +2 -2
- package/docs/components/EclCardComponent.html +2 -2
- package/docs/components/EclCarouselComponent.html +2 -2
- package/docs/components/EclCarouselItemComponent.html +2 -2
- package/docs/components/EclCategoryFilterComponent.html +2 -2
- package/docs/components/EclCategoryFilterItemComponent.html +2 -2
- package/docs/components/EclCategoryFilterListComponent.html +2 -2
- package/docs/components/EclCheckboxHelpComponent.html +2 -2
- package/docs/components/EclCheckboxLabelComponent.html +3 -3
- package/docs/components/EclContentBlockComponent.html +2 -2
- package/docs/components/EclContentItemComponent.html +2 -2
- package/docs/components/EclDateBlockComponent.html +2 -2
- package/docs/components/EclDescriptionListDefinitionComponent.html +2 -2
- package/docs/components/EclExpandableComponent.html +2 -2
- package/docs/components/EclFactFiguresComponent.html +2 -2
- package/docs/components/EclFactFiguresDescriptionComponent.html +2 -2
- package/docs/components/EclFactFiguresItemComponent.html +2 -2
- package/docs/components/EclFactFiguresTitleComponent.html +2 -2
- package/docs/components/EclFactFiguresValueComponent.html +2 -2
- package/docs/components/EclFactFiguresViewAllComponent.html +2 -2
- package/docs/components/EclFeaturedComponent.html +33 -15
- package/docs/components/EclFeaturedItemComponent.html +27 -3
- package/docs/components/EclFeaturedItemDescriptionComponent.html +2 -2
- package/docs/components/EclFileComponent.html +2 -2
- package/docs/components/EclFileItemComponent.html +2 -2
- package/docs/components/EclFileItemsComponent.html +2 -2
- package/docs/components/EclFileTaxonomyComponent.html +2 -2
- package/docs/components/EclFormGroupComponent.html +2 -2
- package/docs/components/EclFormLabelComponent.html +3 -3
- package/docs/components/EclGalleryComponent.html +3 -3
- package/docs/components/EclGalleryFooterComponent.html +2 -2
- package/docs/components/EclGalleryItemComponent.html +3 -3
- package/docs/components/EclIconComponent.html +2 -2
- package/docs/components/EclInpageNavigationComponent.html +2 -2
- package/docs/components/EclInpageNavigationItemComponent.html +2 -2
- package/docs/components/EclListIllustrationComponent.html +2 -2
- package/docs/components/EclListIllustrationItemComponent.html +2 -2
- package/docs/components/EclLoadingIndicatorComponent.html +2 -2
- package/docs/components/EclMediaContainerComponent.html +2 -2
- package/docs/components/EclMegaMenuComponent.html +46 -2
- package/docs/components/EclMegaMenuFeaturedComponent.html +2 -2
- package/docs/components/EclMegaMenuInfoComponent.html +2 -2
- package/docs/components/EclMegaMenuItemComponent.html +2 -2
- package/docs/components/EclMegaMenuSubitemComponent.html +2 -2
- package/docs/components/EclMenuComponent.html +194 -14
- package/docs/components/EclMenuItemComponent.html +3 -3
- package/docs/components/EclMenuMegaComponent.html +2 -2
- package/docs/components/EclMenuMegaItemComponent.html +2 -2
- package/docs/components/EclModalBodyComponent.html +2 -2
- package/docs/components/EclModalComponent.html +2 -2
- package/docs/components/EclModalFooterComponent.html +2 -2
- package/docs/components/EclModalHeaderComponent.html +2 -2
- package/docs/components/EclMultiselectComponent.html +2 -2
- package/docs/components/EclMultiselectDropdownComponent.html +2 -2
- package/docs/components/EclMultiselectInputComponent.html +2 -2
- package/docs/components/EclMultiselectOptgroupComponent.html +2 -2
- package/docs/components/EclMultiselectOptionComponent.html +2 -2
- package/docs/components/EclNavigationListComponent.html +2 -2
- package/docs/components/EclNavigationListItemComponent.html +2 -2
- package/docs/components/EclNewsTickerComponent.html +2 -2
- package/docs/components/EclNewsTickerItemComponent.html +2 -2
- package/docs/components/EclNotificationComponent.html +3 -3
- package/docs/components/EclPageHeaderComponent.html +2 -2
- package/docs/components/EclPaginationComponent.html +2 -2
- package/docs/components/EclPaginationItemComponent.html +2 -2
- package/docs/components/EclPopoverComponent.html +96 -27
- package/docs/components/EclRadioHelpComponent.html +2 -2
- package/docs/components/EclRadioLabelComponent.html +2 -2
- package/docs/components/EclRangeBubbleComponent.html +2 -2
- package/docs/components/EclRangeValueComponent.html +2 -2
- package/docs/components/EclRatingFieldComponent.html +2 -2
- package/docs/components/EclSearchFormComponent.html +3 -3
- package/docs/components/EclSelectContainerComponent.html +2 -2
- package/docs/components/EclSiteFooterComponent.html +47 -5
- package/docs/components/{EclSocialMediaShareComponent.html → EclSiteFooterCoreComponent.html} +31 -40
- package/docs/components/EclSiteFooterFixedContentEUComponent.html +2 -2
- package/docs/components/EclSiteFooterRowCommonComponent.html +647 -0
- package/docs/components/EclSiteHeaderActionComponent.html +2 -2
- package/docs/components/EclSiteHeaderBannerTopComponent.html +2 -2
- package/docs/components/EclSiteHeaderComponent.html +33 -3
- package/docs/components/EclSiteHeaderCustomActionComponent.html +2 -2
- package/docs/components/EclSiteHeaderEnvironmentComponent.html +2 -2
- package/docs/components/EclSiteHeaderLanguageComponent.html +3 -3
- package/docs/components/EclSiteHeaderLanguagePopoverComponent.html +3 -3
- package/docs/components/EclSiteHeaderLoginComponent.html +3 -3
- package/docs/components/EclSiteHeaderNotificationComponent.html +2 -2
- package/docs/components/EclSiteHeaderSearchComponent.html +2 -2
- package/docs/components/EclSocialMediaFollowComponent.html +2 -2
- package/docs/components/EclSocialMediaFollowItemComponent.html +16 -3
- package/docs/components/EclSplashPageComponent.html +2 -2
- package/docs/components/EclSplashPageLanguageCategoryComponent.html +2 -2
- package/docs/components/EclSplashPageLanguageContainerComponent.html +2 -2
- package/docs/components/EclSplashPageLanguageLinkComponent.html +2 -2
- package/docs/components/EclStickyContainerComponent.html +2 -2
- package/docs/components/EclTabComponent.html +2 -2
- package/docs/components/EclTabLabelComponent.html +2 -2
- package/docs/components/EclTabMoreComponent.html +2 -2
- package/docs/components/EclTableSortButtonComponent.html +2 -2
- package/docs/components/EclTabsComponent.html +2 -2
- package/docs/components/EclTagComponent.html +2 -2
- package/docs/components/EclTimelineComponent.html +2 -2
- package/docs/components/EclTimelineItemComponent.html +2 -2
- package/docs/components/EclTimelineItemTogglerComponent.html +2 -2
- package/docs/directives/EclBannerDescriptionLinkDirective.html +65 -1
- package/docs/directives/EclBannerTitleLinkDirective.html +64 -1
- package/docs/directives/{EclSeparatorDirective.html → EclDividerDirective.html} +4 -4
- package/docs/directives/EclSiteFooterColumnDirective.html +1 -1
- package/docs/directives/{EclSiteFooterContentDirective.html → EclSiteFooterDescriptionNameDirective.html} +10 -18
- package/docs/directives/EclSiteFooterRowDirective.html +1 -1
- package/docs/directives/EclSiteFooterSectionDirective.html +341 -8
- package/docs/directives/{EclFeaturedItemFooterLinkDirective.html → EclSiteFooterSocialMediaDirective.html} +14 -14
- package/docs/js/menu-wc.js +45 -112
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/{classes/EclSocialMediaShareItemClickEvent.html → miscellaneous/functions.html} +56 -80
- package/docs/miscellaneous/variables.html +100 -104
- package/docs/modules/{EclSeparatorModule.html → EclDividerModule.html} +6 -6
- package/docs/modules.html +12 -24
- package/docs/overview.html +4 -4
- package/docs/properties.html +1 -1
- package/fesm2022/eui-ecl-components-ecl-accordion.mjs +63 -45
- package/fesm2022/eui-ecl-components-ecl-accordion.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-app.mjs +2 -2
- package/fesm2022/eui-ecl-components-ecl-app.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-banner.mjs +22 -6
- package/fesm2022/eui-ecl-components-ecl-banner.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-checkbox.mjs +2 -2
- package/fesm2022/eui-ecl-components-ecl-checkbox.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-divider.mjs +57 -0
- package/fesm2022/eui-ecl-components-ecl-divider.mjs.map +1 -0
- package/fesm2022/eui-ecl-components-ecl-featured.mjs +21 -83
- package/fesm2022/eui-ecl-components-ecl-featured.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-feedback-message.mjs +1 -0
- package/fesm2022/eui-ecl-components-ecl-feedback-message.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-form-label.mjs +2 -2
- package/fesm2022/eui-ecl-components-ecl-form-label.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-gallery.mjs +4 -4
- package/fesm2022/eui-ecl-components-ecl-gallery.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs +45 -18
- package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-menu.mjs +57 -22
- package/fesm2022/eui-ecl-components-ecl-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-notification.mjs +2 -2
- package/fesm2022/eui-ecl-components-ecl-notification.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-popover.mjs +169 -98
- package/fesm2022/eui-ecl-components-ecl-popover.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-search-form.mjs +2 -2
- package/fesm2022/eui-ecl-components-ecl-search-form.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs +251 -161
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-header.mjs +43 -43
- package/fesm2022/eui-ecl-components-ecl-site-header.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-social-media-follow.mjs +7 -3
- package/fesm2022/eui-ecl-components-ecl-social-media-follow.mjs.map +1 -1
- package/fesm2022/eui-ecl-core.mjs +153 -139
- package/fesm2022/eui-ecl-core.mjs.map +1 -1
- package/fesm2022/eui-ecl.mjs +46 -49
- package/fesm2022/eui-ecl.mjs.map +1 -1
- package/index.d.ts +44 -45
- package/index.d.ts.map +1 -1
- package/package.json +43 -47
- package/components/ecl-separator/index.d.ts +0 -31
- package/components/ecl-separator/index.d.ts.map +0 -1
- package/components/ecl-separator/package.json +0 -3
- package/components/ecl-social-media-share/index.d.ts +0 -54
- package/components/ecl-social-media-share/index.d.ts.map +0 -1
- package/components/ecl-social-media-share/package.json +0 -3
- package/docs/components/EclFeaturedItemFooterComponent.html +0 -560
- package/docs/components/EclSiteFooterFixedContentECComponent.html +0 -591
- package/docs/components/EclSocialMediaShareItemComponent.html +0 -829
- package/docs/directives/EclFeaturedItemFooterPictureDirective.html +0 -502
- package/docs/directives/EclSocialMediaShareLinkDirective.html +0 -553
- package/docs/modules/EclSocialMediaShareModule.html +0 -321
- package/fesm2022/eui-ecl-components-ecl-separator.mjs +0 -57
- package/fesm2022/eui-ecl-components-ecl-separator.mjs.map +0 -1
- package/fesm2022/eui-ecl-components-ecl-social-media-share.mjs +0 -136
- package/fesm2022/eui-ecl-components-ecl-social-media-share.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-ecl-components-ecl-notification.mjs","sources":["../../components/ecl-notification/events/ecl-notification-close.event.ts","../../components/ecl-notification/ecl-notification.component.ts","../../components/ecl-notification/ecl-notification.component.html","../../components/ecl-notification/ecl-notification-title.directive.ts","../../components/ecl-notification/ecl-notification.module.ts","../../components/ecl-notification/index.ts","../../components/ecl-notification/eui-ecl-components-ecl-notification.ts"],"sourcesContent":["import { EclBaseEvent } from '@eui/ecl/core';\n\n/**\n * Event emitted when the notification is closed.\n *\n * Can be used to prevent default close behavior by calling `event.preventDefault()`.\n */\nexport class EclNotificationCloseEvent extends EclBaseEvent {\n}\n","import { Component, Input, Output, EventEmitter, HostBinding, booleanAttribute, inject } from '@angular/core';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { EclThemeService } from '@eui/ecl/core';\nimport { EclNotificationCloseEvent } from './events/ecl-notification-close.event';\nimport { AsyncPipe, TitleCasePipe } from '@angular/common';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { EUI_ECL_BUTTON } from '@eui/ecl/components/ecl-button';\nimport { EUI_ECL_ICON } from '@eui/ecl/components/ecl-icon';\n\n@Component({\n selector: 'ecl-notification',\n templateUrl: './ecl-notification.component.html',\n imports: [\n AsyncPipe,\n TitleCasePipe,\n ...EUI_ECL_ICON,\n ...EUI_ECL_BUTTON,\n TranslateModule,\n ],\n})\nexport class EclNotificationComponent extends ECLBaseDirective {\n eclThemeService = inject(EclThemeService);\n\n /**\n * The title of the notification. This is displayed inside the component.\n */\n @Input() notificationTitle: string;\n\n /**\n * Defines the visual style of the notification.\n * Can be one of: 'info' | 'success' | 'warning' | 'error'.\n * Default is 'info'.\n */\n @Input() variant: 'info' | 'success' | 'warning' | 'error' = 'info';\n\n /**\n * Controls the visibility of the notification.\n * When false, the component is hidden using CSS utility class.\n */\n @Input({ transform: booleanAttribute }) isVisible = true;\n\n /**\n * Indicates whether the close button is displayed.\n */\n @Input({ transform: booleanAttribute }) isCloseable = true;\n\n /**\n * Emits an event when the close button is clicked.\n * Consumers can call `preventDefault()` on the emitted event to prevent the notification from closing.\n */\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() close = new EventEmitter<EclNotificationCloseEvent>();\n\n /**\n * The ARIA role for the component. Set to \"alert\" by default.\n */\n @HostBinding('attr.role')\n role = 'alert';\n\n private variantTitleIconMapping = new Map<string, { title: string, icon: string }>([\n ['info', { title: 'information', icon: 'information' }],\n ['success', { title: 'success', icon: 'check-filled' }],\n ['warning', { title: 'warning', icon: 'warning' }],\n ['error', { title: 'error', icon: 'error' }],\n ]);\n\n /**\n * Applies the `ecl-u-d-none` utility class when the notification is not visible.\n */\n @HostBinding('class.ecl-u-d-none')\n get isHidden(): boolean {\n return !this.isVisible;\n }\n\n /**\n * Computes the CSS classes applied to the host element, including the modifier for the current variant.\n */\n @HostBinding('class')\n get cssClasses(): string {\n return [super.getCssClasses('ecl-notification'), this.variant ? `ecl-notification--${this.variant}` : ''].join(' ').trim();\n }\n\n /**\n * Returns the default title text based on the current variant.\n */\n get title(): string {\n return this.titleAndIconBaseOnVariant.title;\n }\n\n /**\n * Returns the icon name based on the current variant.\n */\n get icon(): string {\n return this.titleAndIconBaseOnVariant.icon;\n }\n\n /**\n * Returns a mapping of title and icon based on the current variant.\n */\n get titleAndIconBaseOnVariant(): { title: string, icon: string } {\n return this.variantTitleIconMapping.get(this.variant) || { title: 'information', icon: 'information' };\n }\n\n /**\n * Handles the click event on the close button.\n * Emits a `close` event with an instance of `EclNotificationCloseEvent`.\n * If the event is not prevented, the notification is hidden.\n */\n onCloseClick(evt: Event): void {\n const event = new EclNotificationCloseEvent();\n this.close.next(event);\n if (!event.defaultPrevented) {\n this.isVisible = false;\n }\n }\n}\n","@if( eclThemeService.isEC$ | async ){\n <ecl-icon size=\"l\" class=\"ecl-notification__icon\" [icon]=\"icon\" [title]=\"title | titlecase \"></ecl-icon>\n} @else {\n <ecl-icon size=\"m\" class=\"ecl-notification__icon\" [icon]=\"icon\" [title]=\"title | titlecase \"></ecl-icon>\n}\n\n<div class=\"ecl-notification__content\">\n @if(isCloseable){\n <button eclButton variant=\"tertiary\" class=\"ecl-notification__close\" isIconOnly (click)=\"onCloseClick($event)\">\n <span eclButtonLabel>\n {{ 'ecl.common.CLOSE' | translate }}\n </span>\n <ecl-icon icon=\"close\" size=\"m\"></ecl-icon>\n </button>\n }\n\n <ng-content select=\"[eclNotificationTitle]\"></ng-content>\n <div class=\"ecl-notification__description\"><ng-content></ng-content></div>\n</div>\n","import { Directive, HostBinding } from '@angular/core';\nimport { ECLBaseDirective } from '@eui/ecl/core';\n\n/**\n * Directive applied to a notification title element.\n * Adds the appropriate ECL class for styling the notification title.\n */\n@Directive({\n selector: '[eclNotificationTitle]',\n})\nexport class EclNotificationTitleDirective extends ECLBaseDirective {\n /**\n * Host binding for applying the ECL notification title CSS class.\n */\n @HostBinding('class')\n get cssClasses(): string {\n return [super.getCssClasses('ecl-notification__title')].join(' ').trim();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { EclNotificationComponent } from './ecl-notification.component';\nimport { EclNotificationTitleDirective } from './ecl-notification-title.directive';\n\n/**\n * @description\n * Module that provides the EclNotification component and its dependencies.\n *\n * @deprecated Use {@link EUI_ECL_NOTIFICATION} instead.\n */\n@NgModule({\n imports: [EclNotificationComponent, EclNotificationTitleDirective],\n exports: [EclNotificationComponent, EclNotificationTitleDirective],\n})\nexport class EclNotificationModule {}\n","import { EclNotificationComponent } from './ecl-notification.component';\nimport { EclNotificationTitleDirective } from './ecl-notification-title.directive';\n\nexport * from './ecl-notification.module';\nexport * from './ecl-notification.component';\nexport * from './ecl-notification-title.directive';\nexport * from './events/ecl-notification-close.event';\n\nexport const EUI_ECL_NOTIFICATION = [\n EclNotificationComponent,\n EclNotificationTitleDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA;;;;AAIG;AACG,MAAO,yBAA0B,SAAQ,YAAY,CAAA;AAC1D;;ACYK,MAAO,wBAAyB,SAAQ,gBAAgB,CAAA;AAX9D,IAAA,WAAA,GAAA;;AAYI,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AAOzC;;;;AAIG;QACM,IAAA,CAAA,OAAO,GAA6C,MAAM;AAEnE;;;AAGG;QACqC,IAAA,CAAA,SAAS,GAAG,IAAI;AAExD;;AAEG;QACqC,IAAA,CAAA,WAAW,GAAG,IAAI;AAE1D;;;AAGG;;AAEO,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAA6B;AAE/D;;AAEG;QAEH,IAAA,CAAA,IAAI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BAAqB,YAHtB,wBAAwB,CAAA,EAAA,CAAA,CAAA;;kGAGvB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,wBAAwB,EAAE,6BAA6B,CAAC;AAClE,oBAAA,OAAO,EAAE,CAAC,wBAAwB,EAAE,6BAA6B,CAAC;AACnE,iBAAA;;;ACLM,MAAM,oBAAoB,GAAG;IAClC,wBAAwB;IACxB,6BAA6B;;;ACV/B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"eui-ecl-components-ecl-notification.mjs","sources":["../../components/ecl-notification/events/ecl-notification-close.event.ts","../../components/ecl-notification/ecl-notification.component.ts","../../components/ecl-notification/ecl-notification.component.html","../../components/ecl-notification/ecl-notification-title.directive.ts","../../components/ecl-notification/ecl-notification.module.ts","../../components/ecl-notification/index.ts","../../components/ecl-notification/eui-ecl-components-ecl-notification.ts"],"sourcesContent":["import { EclBaseEvent } from '@eui/ecl/core';\n\n/**\n * Event emitted when the notification is closed.\n *\n * Can be used to prevent default close behavior by calling `event.preventDefault()`.\n */\nexport class EclNotificationCloseEvent extends EclBaseEvent {\n}\n","import { Component, Input, Output, EventEmitter, HostBinding, booleanAttribute, inject } from '@angular/core';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { EclThemeService } from '@eui/ecl/core';\nimport { EclNotificationCloseEvent } from './events/ecl-notification-close.event';\nimport { AsyncPipe, TitleCasePipe } from '@angular/common';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { EUI_ECL_BUTTON } from '@eui/ecl/components/ecl-button';\nimport { EUI_ECL_ICON } from '@eui/ecl/components/ecl-icon';\n\n@Component({\n selector: 'ecl-notification',\n templateUrl: './ecl-notification.component.html',\n imports: [\n AsyncPipe,\n TitleCasePipe,\n ...EUI_ECL_ICON,\n ...EUI_ECL_BUTTON,\n TranslateModule,\n ],\n})\nexport class EclNotificationComponent extends ECLBaseDirective {\n eclThemeService = inject(EclThemeService);\n\n /**\n * The title of the notification. This is displayed inside the component.\n */\n @Input() notificationTitle: string;\n\n /**\n * Defines the visual style of the notification.\n * Can be one of: 'info' | 'success' | 'warning' | 'error'.\n * Default is 'info'.\n */\n @Input() variant: 'info' | 'success' | 'warning' | 'error' = 'info';\n\n /**\n * Controls the visibility of the notification.\n * When false, the component is hidden using CSS utility class.\n */\n @Input({ transform: booleanAttribute }) isVisible = true;\n\n /**\n * Indicates whether the close button is displayed.\n */\n @Input({ transform: booleanAttribute }) isCloseable = true;\n\n /**\n * Emits an event when the close button is clicked.\n * Consumers can call `preventDefault()` on the emitted event to prevent the notification from closing.\n */\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() close = new EventEmitter<EclNotificationCloseEvent>();\n\n /**\n * The ARIA role for the component. Set to \"alert\" by default.\n */\n @HostBinding('attr.role')\n role = 'alert';\n\n private variantTitleIconMapping = new Map<string, { title: string, icon: string }>([\n ['info', { title: 'information', icon: 'information' }],\n ['success', { title: 'success', icon: 'check-filled' }],\n ['warning', { title: 'warning', icon: 'warning' }],\n ['error', { title: 'error', icon: 'error' }],\n ]);\n\n /**\n * Applies the `ecl-u-d-none` utility class when the notification is not visible.\n */\n @HostBinding('class.ecl-u-d-none')\n get isHidden(): boolean {\n return !this.isVisible;\n }\n\n /**\n * Computes the CSS classes applied to the host element, including the modifier for the current variant.\n */\n @HostBinding('class')\n get cssClasses(): string {\n return [super.getCssClasses('ecl-notification'), this.variant ? `ecl-notification--${this.variant}` : ''].join(' ').trim();\n }\n\n /**\n * Returns the default title text based on the current variant.\n */\n get title(): string {\n return this.titleAndIconBaseOnVariant.title;\n }\n\n /**\n * Returns the icon name based on the current variant.\n */\n get icon(): string {\n return this.titleAndIconBaseOnVariant.icon;\n }\n\n /**\n * Returns a mapping of title and icon based on the current variant.\n */\n get titleAndIconBaseOnVariant(): { title: string, icon: string } {\n return this.variantTitleIconMapping.get(this.variant) || { title: 'information', icon: 'information' };\n }\n\n /**\n * Handles the click event on the close button.\n * Emits a `close` event with an instance of `EclNotificationCloseEvent`.\n * If the event is not prevented, the notification is hidden.\n */\n onCloseClick(evt: Event): void {\n const event = new EclNotificationCloseEvent();\n this.close.next(event);\n if (!event.defaultPrevented) {\n this.isVisible = false;\n }\n }\n}\n","@if( eclThemeService.isEC$ | async ){\n <ecl-icon size=\"l\" class=\"ecl-notification__icon\" [icon]=\"icon\" [title]=\"title | titlecase \"></ecl-icon>\n} @else {\n <ecl-icon size=\"m\" class=\"ecl-notification__icon\" [icon]=\"icon\" [title]=\"title | titlecase \"></ecl-icon>\n}\n\n<div class=\"ecl-notification__content\">\n @if(isCloseable){\n <button eclButton variant=\"tertiary\" class=\"ecl-notification__close ecl-button--neutral\" isIconOnly (click)=\"onCloseClick($event)\">\n <span eclButtonLabel>\n {{ 'ecl.common.CLOSE' | translate }}\n </span>\n <ecl-icon icon=\"close\" size=\"m\"></ecl-icon>\n </button>\n }\n\n <ng-content select=\"[eclNotificationTitle]\"></ng-content>\n <div class=\"ecl-notification__description\"><ng-content></ng-content></div>\n</div>\n","import { Directive, HostBinding } from '@angular/core';\nimport { ECLBaseDirective } from '@eui/ecl/core';\n\n/**\n * Directive applied to a notification title element.\n * Adds the appropriate ECL class for styling the notification title.\n */\n@Directive({\n selector: '[eclNotificationTitle]',\n})\nexport class EclNotificationTitleDirective extends ECLBaseDirective {\n /**\n * Host binding for applying the ECL notification title CSS class.\n */\n @HostBinding('class')\n get cssClasses(): string {\n return [super.getCssClasses('ecl-notification__title')].join(' ').trim();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { EclNotificationComponent } from './ecl-notification.component';\nimport { EclNotificationTitleDirective } from './ecl-notification-title.directive';\n\n/**\n * @description\n * Module that provides the EclNotification component and its dependencies.\n *\n * @deprecated Use {@link EUI_ECL_NOTIFICATION} instead.\n */\n@NgModule({\n imports: [EclNotificationComponent, EclNotificationTitleDirective],\n exports: [EclNotificationComponent, EclNotificationTitleDirective],\n})\nexport class EclNotificationModule {}\n","import { EclNotificationComponent } from './ecl-notification.component';\nimport { EclNotificationTitleDirective } from './ecl-notification-title.directive';\n\nexport * from './ecl-notification.module';\nexport * from './ecl-notification.component';\nexport * from './ecl-notification-title.directive';\nexport * from './events/ecl-notification-close.event';\n\nexport const EUI_ECL_NOTIFICATION = [\n EclNotificationComponent,\n EclNotificationTitleDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEA;;;;AAIG;AACG,MAAO,yBAA0B,SAAQ,YAAY,CAAA;AAC1D;;ACYK,MAAO,wBAAyB,SAAQ,gBAAgB,CAAA;AAX9D,IAAA,WAAA,GAAA;;AAYI,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AAOzC;;;;AAIG;QACM,IAAA,CAAA,OAAO,GAA6C,MAAM;AAEnE;;;AAGG;QACqC,IAAA,CAAA,SAAS,GAAG,IAAI;AAExD;;AAEG;QACqC,IAAA,CAAA,WAAW,GAAG,IAAI;AAE1D;;;AAGG;;AAEO,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAA6B;AAE/D;;AAEG;QAEH,IAAA,CAAA,IAAI,GAAG,OAAO;QAEN,IAAA,CAAA,uBAAuB,GAAG,IAAI,GAAG,CAA0C;YAC/E,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;YACvD,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;YACvD,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;YAClD,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC/C,SAAA,CAAC;AAmDL,IAAA;AAjDG;;AAEG;AACH,IAAA,IACI,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ContentChild, ViewChild, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, EventEmitter, HostListener, HostBinding, Output, Directive, output, Renderer2, ContentChild, ViewChild, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { Subject, takeUntil } from 'rxjs';
|
|
4
4
|
import * as i1 from '@eui/ecl/core';
|
|
5
5
|
import { ECLBaseDirective, ECLClickOutsideDirective } from '@eui/ecl/core';
|
|
@@ -80,6 +80,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.5",
|
|
|
80
80
|
class EclPopoverComponent extends ECLBaseDirective {
|
|
81
81
|
constructor() {
|
|
82
82
|
super(...arguments);
|
|
83
|
+
this.onOpen = output();
|
|
84
|
+
this.onClose = output();
|
|
83
85
|
/**
|
|
84
86
|
* Controls visibility of the popover. `true` means hidden.
|
|
85
87
|
*/
|
|
@@ -93,6 +95,8 @@ class EclPopoverComponent extends ECLBaseDirective {
|
|
|
93
95
|
this.pushBottomClass = 'ecl-popover--push-bottom';
|
|
94
96
|
this.pushLeftClass = 'ecl-popover--push-left';
|
|
95
97
|
this.pushRightClass = 'ecl-popover--push-right';
|
|
98
|
+
this.toggleRect = null;
|
|
99
|
+
this.scrollableParent = null;
|
|
96
100
|
this.el = inject(ElementRef);
|
|
97
101
|
this.renderer = inject(Renderer2);
|
|
98
102
|
}
|
|
@@ -108,9 +112,15 @@ class EclPopoverComponent extends ECLBaseDirective {
|
|
|
108
112
|
*/
|
|
109
113
|
ngAfterContentInit() {
|
|
110
114
|
this.eclPopoverToggle?.click.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
111
|
-
this.isHidden
|
|
115
|
+
if (this.isHidden) {
|
|
116
|
+
this.doOpen();
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.doClose();
|
|
120
|
+
}
|
|
112
121
|
this.checkPosition(); // TODO: wrap on a platformBrowser check as it calls window and document
|
|
113
122
|
});
|
|
123
|
+
this.scrollableParent = this.getClosestScrollableParent(this.eclPopoverToggle.hostElementRef.nativeElement);
|
|
114
124
|
}
|
|
115
125
|
/**
|
|
116
126
|
* Lifecycle hook that cleans up subscriptions on destroy.
|
|
@@ -132,14 +142,14 @@ class EclPopoverComponent extends ECLBaseDirective {
|
|
|
132
142
|
*/
|
|
133
143
|
onClickOutsidePopover() {
|
|
134
144
|
if (!this.isHidden) {
|
|
135
|
-
this.
|
|
145
|
+
this.doClose();
|
|
136
146
|
}
|
|
137
147
|
}
|
|
138
148
|
/**
|
|
139
149
|
* Closes the popover when the Escape key is pressed.
|
|
140
150
|
*/
|
|
141
151
|
onEscapeKeydownHandler() {
|
|
142
|
-
this.
|
|
152
|
+
this.doClose();
|
|
143
153
|
}
|
|
144
154
|
/**
|
|
145
155
|
* Recalculates popover position when the window is resized.
|
|
@@ -154,11 +164,70 @@ class EclPopoverComponent extends ECLBaseDirective {
|
|
|
154
164
|
this.checkPosition();
|
|
155
165
|
}
|
|
156
166
|
/**
|
|
157
|
-
*
|
|
167
|
+
* Protected method used to close the popover and reset related styles.
|
|
158
168
|
*/
|
|
159
|
-
|
|
169
|
+
doClose() {
|
|
160
170
|
this.isHidden = true;
|
|
161
|
-
this.
|
|
171
|
+
this.resetStyles();
|
|
172
|
+
this.onClose.emit();
|
|
173
|
+
}
|
|
174
|
+
doOpen() {
|
|
175
|
+
this.isHidden = false;
|
|
176
|
+
this.onOpen.emit();
|
|
177
|
+
}
|
|
178
|
+
getClosestScrollableParent(element) {
|
|
179
|
+
let parent = element.parentElement;
|
|
180
|
+
while (parent) {
|
|
181
|
+
const { overflowY, overflowX } = getComputedStyle(parent);
|
|
182
|
+
const isScrollableY = (overflowY === 'auto' || overflowY === 'scroll') &&
|
|
183
|
+
parent.scrollHeight > parent.clientHeight;
|
|
184
|
+
const isScrollableX = (overflowX === 'auto' || overflowX === 'scroll') &&
|
|
185
|
+
parent.scrollWidth > parent.clientWidth;
|
|
186
|
+
if (isScrollableY || isScrollableX) {
|
|
187
|
+
return parent; // Found the closest scrollable parent
|
|
188
|
+
}
|
|
189
|
+
parent = parent.parentElement;
|
|
190
|
+
}
|
|
191
|
+
return document.body;
|
|
192
|
+
}
|
|
193
|
+
calculateAvailableSpace(toggleElement, scrollableParent = null) {
|
|
194
|
+
// Get the bounding rect for the toggle element
|
|
195
|
+
this.toggleRect = toggleElement.getBoundingClientRect();
|
|
196
|
+
// If no scrollable parent is provided, use the viewport
|
|
197
|
+
const containerRect = scrollableParent
|
|
198
|
+
? scrollableParent.getBoundingClientRect()
|
|
199
|
+
: {
|
|
200
|
+
top: 0,
|
|
201
|
+
left: 0,
|
|
202
|
+
right: window.innerWidth,
|
|
203
|
+
bottom: window.innerHeight,
|
|
204
|
+
};
|
|
205
|
+
const containerWidth = containerRect.right - containerRect.left;
|
|
206
|
+
const containerHeight = containerRect.bottom - containerRect.top;
|
|
207
|
+
// Calculate the space available in the four directions
|
|
208
|
+
const containerBottom = Math.max(0, window.innerHeight - containerRect.bottom);
|
|
209
|
+
const toggleBottom = Math.max(0, window.innerHeight - this.toggleRect.bottom);
|
|
210
|
+
const spaceBottom = Math.max(0, toggleBottom - containerBottom);
|
|
211
|
+
// Top Space (from toggle's top to container's top)
|
|
212
|
+
const containerTop = Math.max(0, containerRect.top);
|
|
213
|
+
const toggleTop = Math.max(0, this.toggleRect.top);
|
|
214
|
+
const spaceTop = Math.max(0, toggleTop - containerTop);
|
|
215
|
+
// Right Space (from toggle's right to container's right)
|
|
216
|
+
const containerRight = Math.max(0, window.innerWidth - containerRect.right);
|
|
217
|
+
const toggleRight = Math.max(0, window.innerWidth - this.toggleRect.right);
|
|
218
|
+
const spaceRight = Math.max(0, toggleRight - containerRight);
|
|
219
|
+
// Left Space (from toggle's left to container's left)
|
|
220
|
+
const containerLeft = Math.max(0, containerRect.left);
|
|
221
|
+
const toggleLeft = Math.max(0, this.toggleRect.left);
|
|
222
|
+
const spaceLeft = Math.max(0, toggleLeft - containerLeft);
|
|
223
|
+
return {
|
|
224
|
+
containerWidth,
|
|
225
|
+
containerHeight,
|
|
226
|
+
spaceTop,
|
|
227
|
+
spaceBottom,
|
|
228
|
+
spaceLeft,
|
|
229
|
+
spaceRight,
|
|
230
|
+
};
|
|
162
231
|
}
|
|
163
232
|
checkPosition() {
|
|
164
233
|
setTimeout(() => {
|
|
@@ -168,69 +237,58 @@ class EclPopoverComponent extends ECLBaseDirective {
|
|
|
168
237
|
});
|
|
169
238
|
}
|
|
170
239
|
positionPopover() {
|
|
171
|
-
this.
|
|
172
|
-
const
|
|
173
|
-
const toggleRect = toggleElement.getBoundingClientRect();
|
|
174
|
-
const screenHeight = window.innerHeight;
|
|
175
|
-
const screenWidth = window.innerWidth;
|
|
176
|
-
// Calculate available space in each direction
|
|
177
|
-
const spaceTop = toggleRect.top;
|
|
178
|
-
const spaceBottom = screenHeight - toggleRect.bottom;
|
|
179
|
-
const spaceLeft = toggleRect.left;
|
|
180
|
-
const spaceRight = screenWidth - toggleRect.right;
|
|
240
|
+
this.resetStyles();
|
|
241
|
+
const { containerWidth, spaceTop, spaceBottom, spaceLeft, spaceRight } = this.calculateAvailableSpace(this.eclPopoverToggle.getHostElement(), this.scrollableParent);
|
|
181
242
|
// Find the direction with the most available space
|
|
182
|
-
|
|
183
|
-
|
|
243
|
+
const positioningClass = 'ecl-popover--';
|
|
244
|
+
let direction = '';
|
|
245
|
+
if (spaceTop > spaceBottom &&
|
|
246
|
+
spaceTop > spaceLeft &&
|
|
247
|
+
spaceTop > spaceRight) {
|
|
248
|
+
direction = 'top';
|
|
184
249
|
}
|
|
185
|
-
else if (
|
|
186
|
-
|
|
250
|
+
else if (spaceBottom > spaceLeft && spaceBottom > spaceRight) {
|
|
251
|
+
direction = 'bottom';
|
|
187
252
|
}
|
|
188
253
|
else if (spaceLeft > spaceRight) {
|
|
189
|
-
|
|
190
|
-
this.renderer.addClass(this.el.nativeElement, this.leftClass);
|
|
254
|
+
direction = 'left';
|
|
191
255
|
}
|
|
192
256
|
else {
|
|
193
|
-
|
|
194
|
-
this.renderer.addClass(this.el.nativeElement, this.rightClass);
|
|
257
|
+
direction = 'right';
|
|
195
258
|
}
|
|
196
|
-
this.
|
|
197
|
-
this.handlePushClass(screenWidth, screenHeight);
|
|
198
|
-
}
|
|
199
|
-
handleScrollableWidth(spaceLeft, spaceRight, screenWidth) {
|
|
259
|
+
this.renderer.addClass(this.el.nativeElement, `${positioningClass}${direction}`);
|
|
200
260
|
// Try to use as much of the available width, respecting the max-width set.
|
|
201
|
-
const
|
|
202
|
-
const styles = getComputedStyle(scrollable);
|
|
261
|
+
const styles = window.getComputedStyle(this.eclPopoverScrollableElement.nativeElement);
|
|
203
262
|
const maxWidth = parseInt(styles.getPropertyValue('max-width'), 10);
|
|
204
263
|
const minWidth = parseInt(styles.getPropertyValue('min-width'), 10);
|
|
205
264
|
const padding = parseInt(styles.getPropertyValue('padding-left'), 10) * 2;
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
265
|
+
// We consider 90% of the biggest space available
|
|
266
|
+
const horizontalSpace = Math.max(spaceLeft, spaceRight) * 0.9;
|
|
267
|
+
let targetWidth;
|
|
268
|
+
// If the available space is larger than maxWidth (plus padding), set to maxWidth
|
|
269
|
+
if (maxWidth + padding < horizontalSpace ||
|
|
270
|
+
(direction !== 'left' &&
|
|
271
|
+
direction !== 'right' &&
|
|
272
|
+
containerWidth > maxWidth)) {
|
|
273
|
+
targetWidth = maxWidth;
|
|
215
274
|
}
|
|
216
|
-
|
|
217
|
-
|
|
275
|
+
// If the available space is smaller than minWidth (plus padding), set to minWidth
|
|
276
|
+
else if (horizontalSpace < minWidth + padding) {
|
|
277
|
+
targetWidth = minWidth;
|
|
218
278
|
}
|
|
219
|
-
|
|
220
|
-
|
|
279
|
+
// Otherwise, set the width to the available space minus the padding
|
|
280
|
+
else if (direction === 'left' || direction === 'right') {
|
|
281
|
+
targetWidth = horizontalSpace - padding;
|
|
221
282
|
}
|
|
222
283
|
else {
|
|
223
|
-
|
|
284
|
+
targetWidth = (horizontalSpace - padding) * 2;
|
|
224
285
|
}
|
|
286
|
+
// Ensure the width does not exceed available space
|
|
287
|
+
this.renderer.setStyle(this.eclPopoverScrollableElement.nativeElement, 'width', `${targetWidth}px`);
|
|
288
|
+
this.handlePushClass(direction);
|
|
225
289
|
}
|
|
226
|
-
|
|
290
|
+
resetStyles() {
|
|
227
291
|
const popoverContainer = this.eclPopoverContainerElement.nativeElement;
|
|
228
|
-
this.isPushLeft = false;
|
|
229
|
-
this.isPushRight = false;
|
|
230
|
-
this.isPushTop = false;
|
|
231
|
-
this.isPushBottom = false;
|
|
232
|
-
this.isLeft = false;
|
|
233
|
-
this.isRight = false;
|
|
234
292
|
this.popoverPosition = null;
|
|
235
293
|
this.renderer.removeClass(this.el.nativeElement, this.topClass);
|
|
236
294
|
this.renderer.removeClass(this.el.nativeElement, this.bottomClass);
|
|
@@ -240,6 +298,7 @@ class EclPopoverComponent extends ECLBaseDirective {
|
|
|
240
298
|
this.renderer.removeClass(this.el.nativeElement, this.pushBottomClass);
|
|
241
299
|
this.renderer.removeClass(this.el.nativeElement, this.pushLeftClass);
|
|
242
300
|
this.renderer.removeClass(this.el.nativeElement, this.pushRightClass);
|
|
301
|
+
this.renderer.removeStyle(popoverContainer, '--ecl-popover-position');
|
|
243
302
|
this.renderer.removeStyle(popoverContainer, 'top');
|
|
244
303
|
this.renderer.removeStyle(popoverContainer, 'right');
|
|
245
304
|
this.renderer.removeStyle(popoverContainer, 'left');
|
|
@@ -247,64 +306,76 @@ class EclPopoverComponent extends ECLBaseDirective {
|
|
|
247
306
|
this.renderer.removeStyle(popoverContainer, 'transform');
|
|
248
307
|
this.renderer.removeStyle(this.eclPopoverScrollableElement.nativeElement, 'width');
|
|
249
308
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
309
|
+
/**
|
|
310
|
+
* Check whether the popover is going out of its scrollable container and apply the needed repositioning.
|
|
311
|
+
*
|
|
312
|
+
* @param {string} direction
|
|
313
|
+
*/
|
|
314
|
+
handlePushClass(direction) {
|
|
315
|
+
requestAnimationFrame(() => {
|
|
316
|
+
const popoverRect = this.eclPopoverContainerElement.nativeElement.getBoundingClientRect();
|
|
317
|
+
const scrollableRect = this.scrollableParent.getBoundingClientRect();
|
|
318
|
+
const containerBottom = scrollableRect.bottom > window.innerHeight ? 0 : window.innerHeight - scrollableRect.bottom;
|
|
319
|
+
const containerTop = scrollableRect.top > window.innerHeight ? 0 : scrollableRect.top;
|
|
320
|
+
const leftOverflow = scrollableRect.left > popoverRect.left;
|
|
321
|
+
const rightOverflow = scrollableRect.right < popoverRect.right;
|
|
322
|
+
const topOverflow = popoverRect.top < containerTop;
|
|
323
|
+
const bottomOverflow = containerBottom > window.innerHeight - popoverRect.bottom;
|
|
324
|
+
if (direction === 'left' || direction === 'right') {
|
|
325
|
+
if (topOverflow) {
|
|
326
|
+
this.renderer.addClass(this.el.nativeElement, this.pushTopClass);
|
|
327
|
+
// Push the popover to the top edge of the container
|
|
328
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'top', `-${Math.round(this.toggleRect.top)}px`);
|
|
329
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'bottom', '');
|
|
330
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'transform', '');
|
|
331
|
+
}
|
|
332
|
+
if (bottomOverflow) {
|
|
333
|
+
this.renderer.addClass(this.el.nativeElement, this.pushBottomClass);
|
|
334
|
+
// Push the popover to the bottom edge of the container
|
|
335
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'bottom', `-${window.innerHeight - this.toggleRect.bottom - containerBottom}px`);
|
|
336
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'top', '');
|
|
337
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'transform', '');
|
|
338
|
+
}
|
|
274
339
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
340
|
+
else {
|
|
341
|
+
if (leftOverflow) {
|
|
342
|
+
this.renderer.addClass(this.el.nativeElement, this.pushLeftClass);
|
|
343
|
+
// Push the popover 8px to the left edge of the container
|
|
344
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'left', `-${this.toggleRect.left - scrollableRect.left - 8}px`);
|
|
345
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'right', 'auto');
|
|
346
|
+
}
|
|
347
|
+
if (rightOverflow) {
|
|
348
|
+
this.renderer.addClass(this.el.nativeElement, this.pushRightClass);
|
|
349
|
+
// Push the popover 8px to the right edge of the container
|
|
350
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'right', `-${scrollableRect.right - this.toggleRect.right - 8}px`);
|
|
351
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, 'left', 'auto');
|
|
352
|
+
}
|
|
281
353
|
}
|
|
282
|
-
|
|
283
|
-
|
|
354
|
+
this.handleArrowPosition(direction);
|
|
355
|
+
});
|
|
284
356
|
}
|
|
285
|
-
handleArrowPosition() {
|
|
286
|
-
const toggleElement = this.eclPopoverToggle.getHostElement();
|
|
287
|
-
const toggleRect = toggleElement.getBoundingClientRect();
|
|
357
|
+
handleArrowPosition(direction) {
|
|
288
358
|
const popoverRect = this.eclPopoverContainerElement.nativeElement.getBoundingClientRect();
|
|
289
|
-
if (
|
|
290
|
-
if (this.
|
|
291
|
-
this.
|
|
359
|
+
if (direction === 'left' || direction === 'right') {
|
|
360
|
+
if (this.el.nativeElement.classList.contains(this.pushBottomClass)) {
|
|
361
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, '--ecl-popover-position', `${Math.round(this.toggleRect.top - popoverRect.top + this.toggleRect.height / 2)}px`);
|
|
292
362
|
}
|
|
293
|
-
else if (this.
|
|
294
|
-
this.
|
|
363
|
+
else if (this.el.nativeElement.classList.contains(this.pushTopClass)) {
|
|
364
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, '--ecl-popover-position', `${Math.round(popoverRect.top + this.toggleRect.top + this.toggleRect.height / 2)}px`);
|
|
295
365
|
}
|
|
296
366
|
}
|
|
297
367
|
else {
|
|
298
|
-
|
|
299
|
-
|
|
368
|
+
// eslint-disable-next-line no-lonely-if
|
|
369
|
+
if (this.el.nativeElement.classList.contains(this.pushRightClass)) {
|
|
370
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, '--ecl-popover-position', `${Math.round(popoverRect.right - (this.toggleRect.right - this.toggleRect.width / 2))}px`);
|
|
300
371
|
}
|
|
301
|
-
else if (this.
|
|
302
|
-
this.
|
|
372
|
+
else if (this.el.nativeElement.classList.contains(this.pushLeftClass)) {
|
|
373
|
+
this.renderer.setStyle(this.eclPopoverContainerElement.nativeElement, '--ecl-popover-position', `${Math.round(this.toggleRect.left - popoverRect.left + this.toggleRect.width / 2)}px`);
|
|
303
374
|
}
|
|
304
375
|
}
|
|
305
376
|
}
|
|
306
377
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.5", ngImport: i0, type: EclPopoverComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
307
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0-next.5", type: EclPopoverComponent, isStandalone: true, selector: "ecl-popover", host: { listeners: { "eclClickOutside": "onClickOutsidePopover()", "document:keydown.escape": "onEscapeKeydownHandler()", "window:resize": "onWindowResize()", "document:scroll": "onDocumentScroll()" }, properties: { "class": "this.cssClasses" } }, queries: [{ propertyName: "eclPopoverToggle", first: true, predicate: EclPopoverToggleDirective, descendants: true }], viewQueries: [{ propertyName: "eclPopoverContainerElement", first: true, predicate: ["container"], descendants: true }, { propertyName: "eclPopoverScrollableElement", first: true, predicate: ["scrollable"], descendants: true }], usesInheritance: true, hostDirectives: [{ directive: i1.ECLClickOutsideDirective, outputs: ["eclClickOutside", "eclClickOutside"] }], ngImport: i0, template: "<ng-content select=\"[eclPopoverToggle]\"></ng-content>\n\n<div #container class=\"ecl-popover__container\" [style.--ecl-popover-position]=\"popoverPosition\" [hidden]=\"isHidden\"
|
|
378
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0-next.5", type: EclPopoverComponent, isStandalone: true, selector: "ecl-popover", outputs: { onOpen: "onOpen", onClose: "onClose" }, host: { listeners: { "eclClickOutside": "onClickOutsidePopover()", "document:keydown.escape": "onEscapeKeydownHandler()", "window:resize": "onWindowResize()", "document:scroll": "onDocumentScroll()" }, properties: { "class": "this.cssClasses" } }, queries: [{ propertyName: "eclPopoverToggle", first: true, predicate: EclPopoverToggleDirective, descendants: true }], viewQueries: [{ propertyName: "eclPopoverContainerElement", first: true, predicate: ["container"], descendants: true }, { propertyName: "eclPopoverScrollableElement", first: true, predicate: ["scrollable"], descendants: true }], usesInheritance: true, hostDirectives: [{ directive: i1.ECLClickOutsideDirective, outputs: ["eclClickOutside", "eclClickOutside"] }], ngImport: i0, template: "<ng-content select=\"[eclPopoverToggle]\"></ng-content>\n\n<div #container class=\"ecl-popover__container\" [style.--ecl-popover-position]=\"popoverPosition\" [hidden]=\"isHidden\"\n [attr.id]=\"popoverToggleAriaControls\">\n <div #scrollable class=\"ecl-popover__scrollable\">\n <button eclButton variant=\"tertiary\" (click)=\"doClose()\" class=\"ecl-popover__close\" isIconOnly>\n <span eclButtonLabel>Close</span>\n <ecl-icon icon=\"close\" size=\"m\"></ecl-icon>\n </button>\n <ng-content select=\"[eclPopoverContent]\"></ng-content>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i2.EclButtonComponent, selector: "button[eclButton], button[ecl-button], a[eclButton]", inputs: ["isIconOnly", "variant", "containerStyleClass"] }, { kind: "directive", type: i2.EclButtonLabelDirective, selector: "[eclButtonLabel]" }, { kind: "component", type: i3.EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }] }); }
|
|
308
379
|
}
|
|
309
380
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.5", ngImport: i0, type: EclPopoverComponent, decorators: [{
|
|
310
381
|
type: Component,
|
|
@@ -317,7 +388,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.5",
|
|
|
317
388
|
], imports: [
|
|
318
389
|
...EUI_ECL_BUTTON,
|
|
319
390
|
...EUI_ECL_ICON,
|
|
320
|
-
], template: "<ng-content select=\"[eclPopoverToggle]\"></ng-content>\n\n<div #container class=\"ecl-popover__container\" [style.--ecl-popover-position]=\"popoverPosition\" [hidden]=\"isHidden\"
|
|
391
|
+
], template: "<ng-content select=\"[eclPopoverToggle]\"></ng-content>\n\n<div #container class=\"ecl-popover__container\" [style.--ecl-popover-position]=\"popoverPosition\" [hidden]=\"isHidden\"\n [attr.id]=\"popoverToggleAriaControls\">\n <div #scrollable class=\"ecl-popover__scrollable\">\n <button eclButton variant=\"tertiary\" (click)=\"doClose()\" class=\"ecl-popover__close\" isIconOnly>\n <span eclButtonLabel>Close</span>\n <ecl-icon icon=\"close\" size=\"m\"></ecl-icon>\n </button>\n <ng-content select=\"[eclPopoverContent]\"></ng-content>\n </div>\n</div>\n" }]
|
|
321
392
|
}], propDecorators: { eclPopoverContainerElement: [{
|
|
322
393
|
type: ViewChild,
|
|
323
394
|
args: ['container']
|