@skyux/popovers 5.9.0 → 5.9.3

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/esm2015/index.js CHANGED
@@ -11,6 +11,7 @@ export * from './lib/modules/popover/types/popover-message-type';
11
11
  export * from './lib/modules/popover/types/popover-placement';
12
12
  export * from './lib/modules/popover/types/popover-position';
13
13
  export * from './lib/modules/popover/types/popover-trigger';
14
+ export * from './lib/modules/popover/types/popover-type';
14
15
  // Components and directives must be exported to support Angular's "partial" Ivy compiler.
15
16
  // Obscure names are used to indicate types are not part of the public API.
16
17
  export { SkyDropdownItemComponent as λ1 } from './lib/modules/dropdown/dropdown-item.component';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/popovers/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4DAA4D,CAAC;AAC3E,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wCAAwC,CAAC;AAEvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kDAAkD,CAAC;AACjE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAE5D,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,wBAAwB,IAAI,EAAE,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,0BAA0B,IAAI,EAAE,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,oBAAoB,IAAI,EAAE,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,wBAAwB,IAAI,EAAE,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,0BAA0B,IAAI,EAAE,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,mBAAmB,IAAI,EAAE,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,mBAAmB,IAAI,EAAE,EAAE,MAAM,yCAAyC,CAAC","sourcesContent":["export * from './lib/modules/dropdown/types/dropdown-horizontal-alignment';\nexport * from './lib/modules/dropdown/types/dropdown-menu-change';\nexport * from './lib/modules/dropdown/types/dropdown-message';\nexport * from './lib/modules/dropdown/types/dropdown-message-type';\nexport * from './lib/modules/dropdown/types/dropdown-trigger-type';\nexport * from './lib/modules/dropdown/dropdown.module';\n\nexport * from './lib/modules/popover/popover.module';\nexport * from './lib/modules/popover/types/popover-alignment';\nexport * from './lib/modules/popover/types/popover-message';\nexport * from './lib/modules/popover/types/popover-message-type';\nexport * from './lib/modules/popover/types/popover-placement';\nexport * from './lib/modules/popover/types/popover-position';\nexport * from './lib/modules/popover/types/popover-trigger';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyDropdownItemComponent as λ1 } from './lib/modules/dropdown/dropdown-item.component';\nexport { SkyDropdownButtonComponent as λ2 } from './lib/modules/dropdown/dropdown-button.component';\nexport { SkyDropdownComponent as λ3 } from './lib/modules/dropdown/dropdown.component';\nexport { SkyDropdownMenuComponent as λ4 } from './lib/modules/dropdown/dropdown-menu.component';\nexport { SkyPopoverContentComponent as λ5 } from './lib/modules/popover/popover-content.component';\nexport { SkyPopoverComponent as λ6 } from './lib/modules/popover/popover.component';\nexport { SkyPopoverDirective as λ7 } from './lib/modules/popover/popover.directive';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/components/popovers/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4DAA4D,CAAC;AAC3E,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AACnE,cAAc,wCAAwC,CAAC;AAEvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kDAAkD,CAAC;AACjE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,0CAA0C,CAAC;AAEzD,0FAA0F;AAC1F,2EAA2E;AAC3E,OAAO,EAAE,wBAAwB,IAAI,EAAE,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,0BAA0B,IAAI,EAAE,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,oBAAoB,IAAI,EAAE,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,wBAAwB,IAAI,EAAE,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,0BAA0B,IAAI,EAAE,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,mBAAmB,IAAI,EAAE,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,mBAAmB,IAAI,EAAE,EAAE,MAAM,yCAAyC,CAAC","sourcesContent":["export * from './lib/modules/dropdown/types/dropdown-horizontal-alignment';\nexport * from './lib/modules/dropdown/types/dropdown-menu-change';\nexport * from './lib/modules/dropdown/types/dropdown-message';\nexport * from './lib/modules/dropdown/types/dropdown-message-type';\nexport * from './lib/modules/dropdown/types/dropdown-trigger-type';\nexport * from './lib/modules/dropdown/dropdown.module';\n\nexport * from './lib/modules/popover/popover.module';\nexport * from './lib/modules/popover/types/popover-alignment';\nexport * from './lib/modules/popover/types/popover-message';\nexport * from './lib/modules/popover/types/popover-message-type';\nexport * from './lib/modules/popover/types/popover-placement';\nexport * from './lib/modules/popover/types/popover-position';\nexport * from './lib/modules/popover/types/popover-trigger';\nexport * from './lib/modules/popover/types/popover-type';\n\n// Components and directives must be exported to support Angular's \"partial\" Ivy compiler.\n// Obscure names are used to indicate types are not part of the public API.\nexport { SkyDropdownItemComponent as λ1 } from './lib/modules/dropdown/dropdown-item.component';\nexport { SkyDropdownButtonComponent as λ2 } from './lib/modules/dropdown/dropdown-button.component';\nexport { SkyDropdownComponent as λ3 } from './lib/modules/dropdown/dropdown.component';\nexport { SkyDropdownMenuComponent as λ4 } from './lib/modules/dropdown/dropdown-menu.component';\nexport { SkyPopoverContentComponent as λ5 } from './lib/modules/popover/popover-content.component';\nexport { SkyPopoverComponent as λ6 } from './lib/modules/popover/popover.component';\nexport { SkyPopoverDirective as λ7 } from './lib/modules/popover/popover.directive';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,KAAK,EAGL,QAAQ,EACR,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,eAAe,EAGf,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;AAGvE;;GAEG;AAOH,MAAM,OAAO,oBAAoB;IAyL/B,YACU,cAAiC,EACjC,YAA6B,EAC7B,cAAiC,EACrB,QAA0B;QAHtC,mBAAc,GAAd,cAAc,CAAmB;QACjC,iBAAY,GAAZ,YAAY,CAAiB;QAC7B,mBAAc,GAAd,cAAc,CAAmB;QACrB,aAAQ,GAAR,QAA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,KAAK;gBAQK,mBAAmB;sBAD7B,KAAK;gBAeC,aAAa;sBADnB,KAAK;gBAOC,KAAK;sBADX,KAAK;gBAcK,OAAO;sBADjB,KAAK;gBAqBK,uBAAuB;sBAHjC,SAAS;uBAAC,yBAAyB,EAAE;wBACpC,IAAI,EAAE,UAAU;qBACjB;gBA0BO,wBAAwB;sBAJ/B,SAAS;uBAAC,0BAA0B,EAAE;wBACrC,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE,IAAI;qBACb;gBAOO,aAAa;sBAJpB,SAAS;uBAAC,eAAe,EAAE;wBAC1B,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixService,\n SkyAffixer,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { parseAffixHorizontalAlignment } from './dropdown-extensions';\nimport { SkyDropdownHorizontalAlignment } from './types/dropdown-horizontal-alignment';\nimport { SkyDropdownMessage } from './types/dropdown-message';\nimport { SkyDropdownMessageType } from './types/dropdown-message-type';\nimport { SkyDropdownTriggerType } from './types/dropdown-trigger-type';\n\n/**\n * Creates a dropdown menu that displays menu items that users may select.\n */\n@Component({\n selector: 'sky-dropdown',\n templateUrl: './dropdown.component.html',\n styleUrls: ['./dropdown.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDropdownComponent implements OnInit, OnDestroy {\n /**\n * Specifies a background color for the dropdown button. Available values are `default` and\n * `primary`. These values set the background color from the\n * [secondary and primary button classes](https://developer.blackbaud.com/skyux/components/button) respectively.\n * @default \"default\"\n */\n @Input()\n public set buttonStyle(value: string) {\n this._buttonStyle = value;\n }\n\n public get buttonStyle(): string {\n return this._buttonStyle || 'default';\n }\n\n /**\n * Specifies the type of button to render as the dropdown's trigger element. To display a button\n * with text and a caret, specify `select` and then enter the button text in a\n * `sky-dropdown-button` element. To display a round button with an ellipsis, specify\n * `context-menu`. And to display a button with a [Font Awesome icon](http://fontawesome.io/icons/), specify the icon's class name.\n * For example, to display the `fa-filter` icon, specify `filter`.\n * @default \"select\"\n */\n @Input()\n public set buttonType(value: string) {\n this._buttonType = value;\n }\n\n public get buttonType(): string {\n return this._buttonType || 'select';\n }\n\n /**\n * Indicates whether to disable the dropdown button.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n /**\n * Indicates whether to close the dropdown when users click away from the menu.\n * @default true\n */\n @Input()\n public set dismissOnBlur(value: boolean) {\n this._dismissOnBlur = value;\n }\n\n public get dismissOnBlur(): boolean {\n if (this._dismissOnBlur === undefined) {\n return true;\n }\n\n return this._dismissOnBlur;\n }\n\n /**\n * Specifies an ARIA label for the dropdown. This sets the dropdown's `aria-label` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n */\n @Input()\n public label: string;\n\n /**\n * Specifies the horizontal alignment of the dropdown menu in relation to the dropdown button.\n * @default \"left\"\n */\n @Input()\n public set horizontalAlignment(value: SkyDropdownHorizontalAlignment) {\n this._horizontalAlignment = value;\n }\n\n public get horizontalAlignment(): SkyDropdownHorizontalAlignment {\n return this._horizontalAlignment || 'left';\n }\n\n /**\n * Provides an observable to send commands to the dropdown. The commands should respect\n * the [[SkyDropdownMessage]] type.\n */\n\n @Input()\n public messageStream = new Subject<SkyDropdownMessage>();\n\n /**\n * Specifies a title to display in a tooltip when users hover the mouse over the dropdown button.\n */\n @Input()\n public title: string;\n\n /**\n * Specifies how users interact with the dropdown button to expose the dropdown menu.\n * We recommend the default `click` value because the `hover` value can pose\n * [accessibility](https://developer.blackbaud.com/skyux/learn/accessibility) issues\n * for users on touch devices such as phones and tablets.\n * @deprecated We recommend against using this property. If you choose to use the deprecated\n * `hover` value anyway, we recommend that you not use it in combination with the `title`\n * property. (This property will be removed in the next major version release.)\n * @default \"click\"\n */\n @Input()\n public set trigger(value: SkyDropdownTriggerType) {\n this._trigger = value;\n }\n\n public get trigger(): SkyDropdownTriggerType {\n return this._trigger || 'click';\n }\n\n public set isOpen(value: boolean) {\n this._isOpen = value;\n this.changeDetector.markForCheck();\n }\n\n public get isOpen(): boolean {\n return this._isOpen || false;\n }\n\n @ViewChild('menuContainerElementRef', {\n read: ElementRef,\n })\n public set menuContainerElementRef(value: ElementRef) {\n if (value) {\n this._menuContainerElementRef = value;\n this.destroyAffixer();\n this.createAffixer();\n this.changeDetector.markForCheck();\n }\n }\n\n public get menuContainerElementRef(): ElementRef {\n return this._menuContainerElementRef;\n }\n\n public isMouseEnter = false;\n\n public isVisible = false;\n\n public menuId: string;\n\n public menuAriaRole: string;\n\n @ViewChild('menuContainerTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private menuContainerTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButton', {\n read: ElementRef,\n static: true,\n })\n private triggerButton: ElementRef;\n\n private affixer: SkyAffixer;\n\n private ngUnsubscribe = new Subject();\n\n private overlay: SkyOverlayInstance;\n\n private _buttonStyle: string;\n\n private _buttonType: string;\n\n private _disabled: boolean;\n\n private _dismissOnBlur: boolean;\n\n private _horizontalAlignment: SkyDropdownHorizontalAlignment;\n\n private _isOpen = false;\n\n private _menuContainerElementRef: ElementRef;\n\n private _trigger: SkyDropdownTriggerType;\n\n private _positionTimeout: number;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private affixService: SkyAffixService,\n private overlayService: SkyOverlayService,\n @Optional() private themeSvc?: SkyThemeService\n ) {}\n\n public ngOnInit(): void {\n this.addEventListeners();\n\n this.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyDropdownMessage) => {\n this.handleIncomingMessages(message);\n });\n\n // Load proper icons on theme change.\n this.themeSvc?.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.destroyAffixer();\n this.destroyOverlay();\n clearTimeout(this._positionTimeout);\n\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n }\n\n private addEventListeners(): void {\n const buttonElement = this.triggerButton.nativeElement;\n\n observableFromEvent(buttonElement, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Close);\n } else {\n this.sendMessage(SkyDropdownMessageType.Open);\n // Wait for dropdown to open, then set focus on first item.\n setTimeout(() => {\n this.sendMessage(SkyDropdownMessageType.FocusFirstItem);\n });\n }\n });\n\n observableFromEvent(buttonElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n /*istanbul ignore else*/\n if (this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Close);\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n event.stopPropagation();\n }\n break;\n\n case 'tab':\n if (this.isOpen && this.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n break;\n\n case 'arrowup':\n case 'up':\n if (!this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Open);\n this.sendMessage(SkyDropdownMessageType.FocusLastItem);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n\n case 'enter':\n case 'arrowdown':\n case 'down':\n case ' ': // Spacebar.\n /*istanbul ignore else*/\n if (!this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Open);\n this.sendMessage(SkyDropdownMessageType.FocusFirstItem);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n }\n });\n\n observableFromEvent(buttonElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.isMouseEnter = true;\n if (this.trigger === 'hover') {\n this.sendMessage(SkyDropdownMessageType.Open);\n }\n });\n\n observableFromEvent(buttonElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.isMouseEnter = false;\n if (this.trigger === 'hover') {\n // Allow the dropdown menu to set isMouseEnter before checking if the close action\n // should be taken.\n setTimeout(() => {\n if (!this.isMouseEnter) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n }\n });\n }\n\n private createOverlay(): void {\n if (this.overlay) {\n return;\n }\n\n const overlay = this.overlayService.create({\n enableScroll: true,\n enablePointerEvents: true,\n });\n\n overlay.attachTemplate(this.menuContainerTemplateRef);\n\n overlay.backdropClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n if (this.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n\n this.overlay = overlay;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(\n this.menuContainerElementRef\n );\n\n affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => {\n this.isVisible = change.placement !== null;\n this.changeDetector.markForCheck();\n });\n\n this.affixer = affixer;\n }\n\n private handleIncomingMessages(message: SkyDropdownMessage): void {\n if (!this.disabled) {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyDropdownMessageType.Open:\n this.isOpen = true;\n this.positionDropdownMenu();\n break;\n\n case SkyDropdownMessageType.Close:\n this.isOpen = false;\n this.destroyOverlay();\n break;\n\n case SkyDropdownMessageType.Reposition:\n // Only reposition the dropdown if it is already open.\n /* istanbul ignore else */\n if (this.isOpen && this.affixer) {\n this.affixer.reaffix();\n }\n break;\n\n case SkyDropdownMessageType.FocusTriggerButton:\n this.triggerButton.nativeElement.focus();\n break;\n }\n }\n }\n\n private sendMessage(type: SkyDropdownMessageType): void {\n this.messageStream.next({ type });\n }\n\n private positionDropdownMenu(): void {\n this.isVisible = false;\n this.createOverlay();\n this.changeDetector.markForCheck();\n\n // Explicitly declare the `setTimeout` from the `window` object in order to use the DOM typings\n // during a unit test (instead of confusing this with Node's `setTimeout`).\n this._positionTimeout = window.setTimeout(() => {\n this.affixer.affixTo(this.triggerButton.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: parseAffixHorizontalAlignment(\n this.horizontalAlignment\n ),\n isSticky: true,\n placement: 'below',\n });\n\n this.isVisible = true;\n this.changeDetector.markForCheck();\n });\n }\n}\n","<div class=\"sky-dropdown\">\n <button\n class=\"sky-btn sky-dropdown-button\"\n type=\"button\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? menuId : null\"\n [attr.aria-haspopup]=\"menuAriaRole\"\n [attr.aria-label]=\"\n label || ('skyux_dropdown_context_menu_default_label' | skyLibResources)\n \"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [ngClass]=\"[\n 'sky-dropdown-button-type-' + buttonType,\n 'sky-btn-' + buttonStyle\n ]\"\n #triggerButton\n >\n <ng-container [ngSwitch]=\"buttonType\">\n <ng-template ngSwitchCase=\"context-menu\">\n <sky-icon *skyThemeIf=\"'default'\" icon=\"ellipsis-h\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"ellipsis\"\n iconType=\"skyux\"\n ></sky-icon>\n </ng-template>\n\n <ng-template ngSwitchDefault>\n <div\n *ngIf=\"buttonType === 'select' || buttonType === 'tab' || !buttonType\"\n class=\"sky-dropdown-button-container\"\n >\n <div class=\"sky-dropdown-button-content-container\">\n <ng-content select=\"sky-dropdown-button\"> </ng-content>\n </div>\n <div class=\"sky-dropdown-button-icon-container\">\n <sky-icon\n *skyThemeIf=\"'default'\"\n class=\"sky-dropdown-caret\"\n icon=\"caret-down\"\n >\n </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n class=\"sky-dropdown-caret\"\n icon=\"chevron-down\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </div>\n </div>\n <div\n *ngIf=\"buttonType !== 'select' && buttonType !== 'tab' && buttonType\"\n >\n <sky-icon [icon]=\"buttonType\" size=\"lg\"></sky-icon>\n </div>\n </ng-template>\n </ng-container>\n </button>\n</div>\n\n<ng-template #menuContainerTemplateRef>\n <div\n class=\"sky-dropdown-menu-container\"\n [class.hidden]=\"!isVisible\"\n #menuContainerElementRef\n >\n <ng-content select=\"sky-dropdown-menu\"></ng-content>\n </div>\n</ng-template>\n"]}
1
+ {"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,KAAK,EAGL,QAAQ,EACR,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EACtB,eAAe,EAGf,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;AAG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AAS,EAAE,CAAC,2BAA2B,CAAC;oBACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;0BA8LI,QAAQ;4CArLA,WAAW;sBADrB,KAAK;gBAkBK,UAAU;sBADpB,KAAK;gBAcK,QAAQ;sBADlB,KAAK;gBAcK,aAAa;sBADvB,KAAK;gBAkBC,KAAK;sBADX,KAAK;gBAQK,mBAAmB;sBAD7B,KAAK;gBAeC,aAAa;sBADnB,KAAK;gBAOC,KAAK;sBADX,KAAK;gBAcK,OAAO;sBADjB,KAAK;gBAqBK,uBAAuB;sBAHjC,SAAS;uBAAC,yBAAyB,EAAE;wBACpC,IAAI,EAAE,UAAU;qBACjB;gBA0BO,wBAAwB;sBAJ/B,SAAS;uBAAC,0BAA0B,EAAE;wBACrC,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE,IAAI;qBACb;gBAOO,aAAa;sBAJpB,SAAS;uBAAC,eAAe,EAAE;wBAC1B,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixService,\n SkyAffixer,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { parseAffixHorizontalAlignment } from './dropdown-extensions';\nimport { SkyDropdownHorizontalAlignment } from './types/dropdown-horizontal-alignment';\nimport { SkyDropdownMessage } from './types/dropdown-message';\nimport { SkyDropdownMessageType } from './types/dropdown-message-type';\nimport { SkyDropdownTriggerType } from './types/dropdown-trigger-type';\n\n/**\n * Creates a dropdown menu that displays menu items that users may select.\n */\n@Component({\n selector: 'sky-dropdown',\n templateUrl: './dropdown.component.html',\n styleUrls: ['./dropdown.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDropdownComponent implements OnInit, OnDestroy {\n /**\n * Specifies a background color for the dropdown button. Available values are `default` and\n * `primary`. These values set the background color from the\n * [secondary and primary button classes](https://developer.blackbaud.com/skyux/components/button) respectively.\n * @default \"default\"\n */\n @Input()\n public set buttonStyle(value: string) {\n this._buttonStyle = value;\n }\n\n public get buttonStyle(): string {\n return this._buttonStyle || 'default';\n }\n\n /**\n * Specifies the type of button to render as the dropdown's trigger element. To display a button\n * with text and a caret, specify `select` and then enter the button text in a\n * `sky-dropdown-button` element. To display a round button with an ellipsis, specify\n * `context-menu`. And to display a button with a [Font Awesome icon](http://fontawesome.io/icons/), specify the icon's class name.\n * For example, to display the `fa-filter` icon, specify `filter`.\n * @default \"select\"\n */\n @Input()\n public set buttonType(value: string) {\n this._buttonType = value;\n }\n\n public get buttonType(): string {\n return this._buttonType || 'select';\n }\n\n /**\n * Indicates whether to disable the dropdown button.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n /**\n * Indicates whether to close the dropdown when users click away from the menu.\n * @default true\n */\n @Input()\n public set dismissOnBlur(value: boolean) {\n this._dismissOnBlur = value;\n }\n\n public get dismissOnBlur(): boolean {\n if (this._dismissOnBlur === undefined) {\n return true;\n }\n\n return this._dismissOnBlur;\n }\n\n /**\n * Specifies an ARIA label for the dropdown. This sets the dropdown's `aria-label` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n */\n @Input()\n public label: string;\n\n /**\n * Specifies the horizontal alignment of the dropdown menu in relation to the dropdown button.\n * @default \"left\"\n */\n @Input()\n public set horizontalAlignment(value: SkyDropdownHorizontalAlignment) {\n this._horizontalAlignment = value;\n }\n\n public get horizontalAlignment(): SkyDropdownHorizontalAlignment {\n return this._horizontalAlignment || 'left';\n }\n\n /**\n * Provides an observable to send commands to the dropdown. The commands should respect\n * the [[SkyDropdownMessage]] type.\n */\n\n @Input()\n public messageStream = new Subject<SkyDropdownMessage>();\n\n /**\n * Specifies a title to display in a tooltip when users hover the mouse over the dropdown button.\n */\n @Input()\n public title: string;\n\n /**\n * Specifies how users interact with the dropdown button to expose the dropdown menu.\n * We recommend the default `click` value because the `hover` value can pose\n * [accessibility](https://developer.blackbaud.com/skyux/learn/accessibility) issues\n * for users on touch devices such as phones and tablets.\n * @deprecated We recommend against using this property. If you choose to use the deprecated\n * `hover` value anyway, we recommend that you not use it in combination with the `title`\n * property. (This property will be removed in the next major version release.)\n * @default \"click\"\n */\n @Input()\n public set trigger(value: SkyDropdownTriggerType) {\n this._trigger = value;\n }\n\n public get trigger(): SkyDropdownTriggerType {\n return this._trigger || 'click';\n }\n\n public set isOpen(value: boolean) {\n this._isOpen = value;\n this.changeDetector.markForCheck();\n }\n\n public get isOpen(): boolean {\n return this._isOpen || false;\n }\n\n @ViewChild('menuContainerElementRef', {\n read: ElementRef,\n })\n public set menuContainerElementRef(value: ElementRef) {\n if (value) {\n this._menuContainerElementRef = value;\n this.destroyAffixer();\n this.createAffixer();\n this.changeDetector.markForCheck();\n }\n }\n\n public get menuContainerElementRef(): ElementRef {\n return this._menuContainerElementRef;\n }\n\n public isMouseEnter = false;\n\n public isVisible = false;\n\n public menuId: string;\n\n public menuAriaRole: string;\n\n @ViewChild('menuContainerTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private menuContainerTemplateRef: TemplateRef<unknown>;\n\n @ViewChild('triggerButton', {\n read: ElementRef,\n static: true,\n })\n private triggerButton: ElementRef;\n\n private affixer: SkyAffixer;\n\n private ngUnsubscribe = new Subject();\n\n private overlay: SkyOverlayInstance;\n\n private _buttonStyle: string;\n\n private _buttonType: string;\n\n private _disabled: boolean;\n\n private _dismissOnBlur: boolean;\n\n private _horizontalAlignment: SkyDropdownHorizontalAlignment;\n\n private _isOpen = false;\n\n private _menuContainerElementRef: ElementRef;\n\n private _trigger: SkyDropdownTriggerType;\n\n private _positionTimeout: number;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private affixService: SkyAffixService,\n private overlayService: SkyOverlayService,\n @Optional() private themeSvc?: SkyThemeService\n ) {}\n\n public ngOnInit(): void {\n this.addEventListeners();\n\n this.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyDropdownMessage) => {\n this.handleIncomingMessages(message);\n });\n\n // Load proper icons on theme change.\n this.themeSvc?.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.destroyAffixer();\n this.destroyOverlay();\n clearTimeout(this._positionTimeout);\n\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n }\n\n private addEventListeners(): void {\n const buttonElement = this.triggerButton.nativeElement;\n\n observableFromEvent(buttonElement, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Close);\n } else {\n this.sendMessage(SkyDropdownMessageType.Open);\n // Wait for dropdown to open, then set focus on first item.\n setTimeout(() => {\n this.sendMessage(SkyDropdownMessageType.FocusFirstItem);\n });\n }\n });\n\n observableFromEvent(buttonElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n /*istanbul ignore else*/\n if (this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Close);\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n event.stopPropagation();\n }\n break;\n\n case 'tab':\n if (this.isOpen && this.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n break;\n\n case 'arrowup':\n case 'up':\n if (!this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Open);\n this.sendMessage(SkyDropdownMessageType.FocusLastItem);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n\n case 'enter':\n case 'arrowdown':\n case 'down':\n case ' ': // Spacebar.\n /*istanbul ignore else*/\n if (!this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Open);\n this.sendMessage(SkyDropdownMessageType.FocusFirstItem);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n }\n });\n\n observableFromEvent(buttonElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.isMouseEnter = true;\n if (this.trigger === 'hover') {\n this.sendMessage(SkyDropdownMessageType.Open);\n }\n });\n\n observableFromEvent(buttonElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.isMouseEnter = false;\n if (this.trigger === 'hover') {\n // Allow the dropdown menu to set isMouseEnter before checking if the close action\n // should be taken.\n setTimeout(() => {\n if (!this.isMouseEnter) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n }\n });\n }\n\n private createOverlay(): void {\n if (this.overlay) {\n return;\n }\n\n const overlay = this.overlayService.create({\n enableScroll: true,\n enablePointerEvents: true,\n });\n\n overlay.attachTemplate(this.menuContainerTemplateRef);\n\n overlay.backdropClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n if (this.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n\n this.overlay = overlay;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(\n this.menuContainerElementRef\n );\n\n affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => {\n this.isVisible = change.placement !== null;\n this.changeDetector.markForCheck();\n });\n\n this.affixer = affixer;\n }\n\n private handleIncomingMessages(message: SkyDropdownMessage): void {\n if (!this.disabled) {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyDropdownMessageType.Open:\n this.isOpen = true;\n this.positionDropdownMenu();\n break;\n\n case SkyDropdownMessageType.Close:\n this.isOpen = false;\n this.destroyOverlay();\n break;\n\n case SkyDropdownMessageType.Reposition:\n // Only reposition the dropdown if it is already open.\n /* istanbul ignore else */\n if (this.isOpen && this.affixer) {\n this.affixer.reaffix();\n }\n break;\n\n case SkyDropdownMessageType.FocusTriggerButton:\n this.triggerButton.nativeElement.focus();\n break;\n }\n }\n }\n\n private sendMessage(type: SkyDropdownMessageType): void {\n this.messageStream.next({ type });\n }\n\n private positionDropdownMenu(): void {\n this.isVisible = false;\n this.createOverlay();\n this.changeDetector.markForCheck();\n\n // Explicitly declare the `setTimeout` from the `window` object in order to use the DOM typings\n // during a unit test (instead of confusing this with Node's `setTimeout`).\n this._positionTimeout = window.setTimeout(() => {\n this.affixer.affixTo(this.triggerButton.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: parseAffixHorizontalAlignment(\n this.horizontalAlignment\n ),\n isSticky: true,\n placement: 'below',\n });\n\n this.isVisible = true;\n this.changeDetector.markForCheck();\n });\n }\n}\n","<div class=\"sky-dropdown\">\n <button\n class=\"sky-btn sky-dropdown-button\"\n type=\"button\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? menuId : null\"\n [attr.aria-haspopup]=\"menuAriaRole\"\n [attr.aria-label]=\"\n label || ('skyux_dropdown_context_menu_default_label' | skyLibResources)\n \"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [ngClass]=\"[\n 'sky-dropdown-button-type-' + buttonType,\n 'sky-btn-' + buttonStyle\n ]\"\n #triggerButton\n >\n <ng-container [ngSwitch]=\"buttonType\">\n <ng-template ngSwitchCase=\"context-menu\">\n <sky-icon *skyThemeIf=\"'default'\" icon=\"ellipsis-h\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"ellipsis\"\n iconType=\"skyux\"\n ></sky-icon>\n </ng-template>\n\n <ng-template ngSwitchDefault>\n <div\n *ngIf=\"buttonType === 'select' || buttonType === 'tab' || !buttonType\"\n class=\"sky-dropdown-button-container\"\n >\n <div class=\"sky-dropdown-button-content-container\">\n <ng-content select=\"sky-dropdown-button\"> </ng-content>\n </div>\n <div class=\"sky-dropdown-button-icon-container\">\n <sky-icon\n *skyThemeIf=\"'default'\"\n class=\"sky-dropdown-caret\"\n icon=\"caret-down\"\n >\n </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n class=\"sky-dropdown-caret\"\n icon=\"chevron-down\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </div>\n </div>\n <div\n *ngIf=\"buttonType !== 'select' && buttonType !== 'tab' && buttonType\"\n >\n <sky-icon [icon]=\"buttonType\" size=\"lg\"></sky-icon>\n </div>\n </ng-template>\n </ng-container>\n </button>\n</div>\n\n<ng-template #menuContainerTemplateRef>\n <div\n class=\"sky-dropdown-menu-container\"\n [class.hidden]=\"!isVisible\"\n #menuContainerElementRef\n >\n <ng-content select=\"sky-dropdown-menu\"></ng-content>\n </div>\n</ng-template>\n"]}
@@ -134,18 +134,11 @@ export class SkyPopoverContentComponent {
134
134
  isSticky: true,
135
135
  placement: parseAffixPlacement(this.placement),
136
136
  };
137
- // Ensure that we are positioning the vertical alginment correctly. These
138
- // are the default alignments for all popovers but ensure that we are future proof here.
137
+ // Ensure vertical alignment is set according to the popover's placement value.
139
138
  if (affixOptions.placement === 'left' ||
140
139
  affixOptions.placement === 'right') {
141
140
  affixOptions.verticalAlignment = 'middle';
142
141
  }
143
- else if (affixOptions.placement === 'above') {
144
- affixOptions.verticalAlignment = 'bottom';
145
- }
146
- else {
147
- affixOptions.verticalAlignment = 'top';
148
- }
149
142
  this.affixer.affixTo(this.caller.nativeElement, affixOptions);
150
143
  this.updateArrowOffset();
151
144
  this.isOpen = true;
@@ -1 +1 @@
1
- {"version":3,"file":"popover-content.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-content.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-content.component.html"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EAGV,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EAEtB,eAAe,EAEf,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAc,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;;;;;;;AAI9B;;GAEG;AAQH,MAAM,OAAO,0BAA0B;IAmErC,YACU,cAAiC,EACjC,UAAsB,EACtB,YAA6B,EAC7B,kBAAyC,EACzC,cAAwC,EAC5B,OAA2B,EAC3B,QAA0B;QANtC,mBAAc,GAAd,cAAc,CAAmB;QACjC,eAAU,GAAV,UAAU,CAAY;QACtB,iBAAY,GAAZ,YAAY,CAAiB;QAC7B,uBAAkB,GAAlB,kBAAkB,CAAuB;QACzC,mBAAc,GAAd,cAAc,CAA0B;QAC5B,YAAO,GAAP,OAAO,CAAoB;QAC3B,aAAQ,GAAR,QAAQ,CAAkB;QAnDzC,kBAAa,GAAG,IAAI,CAAC;QAErB,qBAAgB,GAAG,IAAI,CA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;mBAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,WAAW,EAAE,kCAAkC;oBAC/C,SAAS,EAAE,CAAC,kCAAkC,CAAC;oBAC/C,UAAU,EAAE,CAAC,mBAAmB,CAAC;oBACjC,SAAS,EAAE,CAAC,wBAAwB,CAAC;iBACtC;;0BA0EI,QAAQ;;0BACR,QAAQ;4CA/BH,QAAQ;sBAJf,SAAS;uBAAC,UAAU,EAAE;wBACrB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,UAAU;sBAJjB,SAAS;uBAAC,YAAY,EAAE;wBACvB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,aAAa;sBAJpB,SAAS;uBAAC,eAAe,EAAE;wBAC1B,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import { AnimationEvent } from '@angular/animations';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixConfig,\n SkyAffixService,\n SkyAffixer,\n SkyCoreAdapterService,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Observable, Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyPopoverAdapterService } from './popover-adapter.service';\nimport { skyPopoverAnimation } from './popover-animation';\nimport { SkyPopoverAnimationState } from './popover-animation-state';\nimport { SkyPopoverContext } from './popover-context';\nimport {\n parseAffixHorizontalAlignment,\n parseAffixPlacement,\n} from './popover-extensions';\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverPlacement } from './types/popover-placement';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-popover-content',\n templateUrl: './popover-content.component.html',\n styleUrls: ['./popover-content.component.scss'],\n animations: [skyPopoverAnimation],\n providers: [SkyPopoverAdapterService],\n})\nexport class SkyPopoverContentComponent implements OnInit, OnDestroy {\n public get animationState(): SkyPopoverAnimationState {\n return this.isOpen ? 'open' : 'closed';\n }\n\n public get closed(): Observable<void> {\n return this._closed.asObservable();\n }\n\n public get opened(): Observable<void> {\n return this._opened.asObservable();\n }\n\n public get isMouseEnter(): Observable<boolean> {\n return this._isMouseEnter.asObservable();\n }\n\n public affixer: SkyAffixer;\n\n public arrowLeft: number;\n\n public arrowTop: number;\n\n public dismissOnBlur = true;\n\n public enableAnimations = true;\n\n public horizontalAlignment: SkyPopoverAlignment;\n\n public isOpen = false;\n\n public placement: SkyPopoverPlacement;\n\n public popoverTitle: string;\n\n public popoverType: 'danger' | 'info' = 'info';\n\n public themeName: string;\n\n @ViewChild('arrowRef', {\n read: ElementRef,\n static: true,\n })\n private arrowRef: ElementRef;\n\n @ViewChild('popoverRef', {\n read: ElementRef,\n static: true,\n })\n private popoverRef: ElementRef;\n\n @ViewChild('contentTarget', {\n read: ViewContainerRef,\n static: true,\n })\n private contentTarget: ViewContainerRef;\n\n private caller: ElementRef;\n\n private ngUnsubscribe = new Subject<void>();\n\n private _closed = new Subject<void>();\n\n private _isMouseEnter = new Subject<boolean>();\n\n private _opened = new Subject<void>();\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private elementRef: ElementRef,\n private affixService: SkyAffixService,\n private coreAdapterService: SkyCoreAdapterService,\n private adapterService: SkyPopoverAdapterService,\n @Optional() private context?: SkyPopoverContext,\n @Optional() private themeSvc?: SkyThemeService\n ) {}\n\n public ngOnInit(): void {\n /*istanbul ignore next*/\n this.contentTarget.createEmbeddedView(this.context?.contentTemplateRef);\n this.addEventListeners();\n\n /*istanbul ignore else*/\n if (this.themeSvc) {\n this.themeSvc.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((themeSettings) => {\n /*istanbul ignore next*/\n this.themeName = themeSettings.currentSettings?.theme?.name;\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n\n this._closed.complete();\n this._isMouseEnter.complete();\n this._opened.complete();\n\n /* istanbul ignore else */\n if (this.affixer) {\n this.affixer.destroy();\n }\n\n this._closed =\n this._isMouseEnter =\n this._opened =\n this.affixer =\n this.ngUnsubscribe =\n undefined;\n }\n\n public onAnimationEvent(event: AnimationEvent): void {\n if (event.fromState === 'void') {\n return;\n }\n\n if (event.phaseName === 'done') {\n if (event.toState === 'open') {\n /*istanbul ignore next*/\n this._opened?.next();\n } else {\n /*istanbul ignore next*/\n this._closed?.next();\n }\n }\n }\n\n public open(\n caller: ElementRef,\n config: {\n dismissOnBlur: boolean;\n enableAnimations: boolean;\n horizontalAlignment: SkyPopoverAlignment;\n isStatic: boolean;\n placement: SkyPopoverPlacement;\n popoverTitle: string;\n popoverType?: 'danger' | 'info';\n }\n ): void {\n this.caller = caller;\n this.dismissOnBlur = config.dismissOnBlur;\n this.enableAnimations = config.enableAnimations;\n this.horizontalAlignment = config.horizontalAlignment;\n this.placement = config.placement;\n this.popoverTitle = config.popoverTitle;\n if (config.popoverType) {\n this.popoverType = config.popoverType;\n }\n\n this.changeDetector.markForCheck();\n\n // Indicates if the popover should be displayed statically.\n // Please note: This feature is internal-only and used by the visual tests to capture multiple\n // states simultaneously without the overhead of event listeners.\n /* istanbul ignore if */\n if (config.isStatic) {\n this.isOpen = true;\n this.changeDetector.markForCheck();\n return;\n }\n\n // Let the styles render before gauging the affix dimensions.\n setTimeout(() => {\n /*istanbul ignore next*/\n if (\n !this.popoverRef?.nativeElement ||\n !this.ngUnsubscribe ||\n this.ngUnsubscribe.isStopped\n ) {\n return;\n }\n\n if (!this.affixer) {\n this.setupAffixer();\n }\n\n const affixOptions: SkyAffixConfig = {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: parseAffixHorizontalAlignment(\n this.horizontalAlignment\n ),\n isSticky: true,\n placement: parseAffixPlacement(this.placement),\n };\n\n // Ensure that we are positioning the vertical alginment correctly. These\n // are the default alignments for all popovers but ensure that we are future proof here.\n if (\n affixOptions.placement === 'left' ||\n affixOptions.placement === 'right'\n ) {\n affixOptions.verticalAlignment = 'middle';\n } else if (affixOptions.placement === 'above') {\n affixOptions.verticalAlignment = 'bottom';\n } else {\n affixOptions.verticalAlignment = 'top';\n }\n\n this.affixer.affixTo(this.caller.nativeElement, affixOptions);\n\n this.updateArrowOffset();\n\n this.isOpen = true;\n this.changeDetector.markForCheck();\n });\n }\n\n public close(): void {\n this.isOpen = false;\n this.changeDetector.markForCheck();\n }\n\n public applyFocus(): void {\n if (this.isOpen) {\n this.coreAdapterService.getFocusableChildrenAndApplyFocus(\n this.popoverRef,\n '.sky-popover',\n true\n );\n }\n }\n\n private setupAffixer(): void {\n const affixer = this.affixService.createAffixer(this.popoverRef);\n\n affixer.offsetChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.updateArrowOffset();\n this.changeDetector.markForCheck();\n });\n\n affixer.overflowScroll.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.updateArrowOffset();\n this.changeDetector.markForCheck();\n });\n\n affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => {\n this.placement = change.placement;\n this.changeDetector.markForCheck();\n });\n\n this.affixer = affixer;\n }\n\n private updateArrowOffset(): void {\n const { top, left } = this.adapterService.getArrowCoordinates(\n {\n caller: this.caller,\n popover: this.popoverRef,\n popoverArrow: this.arrowRef,\n },\n this.placement,\n this.themeName\n );\n\n this.arrowTop = top;\n this.arrowLeft = left;\n }\n\n private isFocusLeavingElement(event: KeyboardEvent): boolean {\n const focusableItems = this.coreAdapterService.getFocusableChildren(\n this.elementRef.nativeElement\n );\n\n const isFirstItem = focusableItems[0] === event.target && event.shiftKey;\n\n const isLastItem =\n focusableItems[focusableItems.length - 1] === event.target &&\n !event.shiftKey;\n\n return focusableItems.length === 0 || isFirstItem || isLastItem;\n }\n\n private addEventListeners(): void {\n const hostElement = this.elementRef.nativeElement;\n\n observableFromEvent(hostElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => this._isMouseEnter.next(true));\n\n observableFromEvent(hostElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => this._isMouseEnter.next(false));\n\n observableFromEvent(hostElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n this.close();\n this.caller.nativeElement.focus();\n event.preventDefault();\n event.stopPropagation();\n break;\n\n // Since the popover now lives in an overlay at the bottom of the document body, we need\n // to handle the tab key ourselves. Otherwise, focus would be moved to the browser's\n // search bar.\n case 'tab':\n if (!this.dismissOnBlur) {\n return;\n }\n\n /*istanbul ignore else*/\n if (this.isFocusLeavingElement(event)) {\n this.close();\n this.caller.nativeElement.focus();\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n }\n });\n }\n}\n","<div\n class=\"sky-popover-container sky-popover-max-height\"\n [@.disabled]=\"!enableAnimations\"\n [@skyPopoverAnimation]=\"animationState\"\n [class.sky-popover-hidden]=\"!placement\"\n [ngClass]=\"[\n 'sky-popover-alignment-' + horizontalAlignment,\n 'sky-popover-placement-' + placement,\n 'sky-popover-' + popoverType\n ]\"\n (@skyPopoverAnimation.done)=\"onAnimationEvent($event)\"\n (@skyPopoverAnimation.start)=\"onAnimationEvent($event)\"\n #popoverRef\n>\n <div\n class=\"sky-popover\"\n tabindex=\"-1\"\n [skyThemeClass]=\"{\n 'sky-rounded-corners sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n >\n <header\n *ngIf=\"popoverTitle\"\n class=\"sky-popover-header\"\n [skyThemeClass]=\"{\n 'sky-padding-even-default': 'default',\n 'sky-padding-even-lg sky-margin-stacked-lg': 'modern'\n }\"\n >\n <h1\n *ngIf=\"popoverTitle\"\n class=\"sky-popover-title\"\n [skyThemeClass]=\"{\n 'sky-emphasized': 'default',\n 'sky-font-emphasized': 'modern'\n }\"\n >\n {{ popoverTitle }}\n </h1>\n </header>\n <div\n class=\"sky-popover-body\"\n [skyThemeClass]=\"{\n 'sky-padding-even-default': 'default',\n 'sky-padding-even-lg': 'modern'\n }\"\n >\n <ng-container #contentTarget></ng-container>\n </div>\n <span\n aria-hidden=\"true\"\n class=\"sky-popover-arrow\"\n [style.left.px]=\"arrowLeft\"\n [style.top.px]=\"arrowTop\"\n #arrowRef\n ></span>\n </div>\n</div>\n"]}
1
+ {"version":3,"file":"popover-content.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-content.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-content.component.html"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,UAAU,EAGV,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBAAsB,EAEtB,eAAe,EAEf,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAc,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;;;;;;;AAI9B;;GAEG;AAQH,MAAM,OAAO,0BAA0B;IAmErC,YACU,cAAiC,EACjC,UAAsB,EACtB,YAA6B,EAC7B,kBAAyC,EACzC,cAAwC,EAC5B,OAA2B,EA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AwB,CAAC,2GA0C7B,UAAU,iHAMV,UAAU,uHAMV,gBAAgB,2CChG1B,2kDA2DA,y+QDlBc,CAAC,mBAAmB,CAAC;4FAGtB,0BAA0B;kBAPtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,WAAW,EAAE,kCAAkC;oBAC/C,SAAS,EAAE,CAAC,kCAAkC,CAAC;oBAC/C,UAAU,EAAE,CAAC,mBAAmB,CAAC;oBACjC,SAAS,EAAE,CAAC,wBAAwB,CAAC;iBACtC;;0BA0EI,QAAQ;;0BACR,QAAQ;4CA/BH,QAAQ;sBAJf,SAAS;uBAAC,UAAU,EAAE;wBACrB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,UAAU;sBAJjB,SAAS;uBAAC,YAAY,EAAE;wBACvB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,aAAa;sBAJpB,SAAS;uBAAC,eAAe,EAAE;wBAC1B,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import { AnimationEvent } from '@angular/animations';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixConfig,\n SkyAffixService,\n SkyAffixer,\n SkyCoreAdapterService,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Observable, Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyPopoverAdapterService } from './popover-adapter.service';\nimport { skyPopoverAnimation } from './popover-animation';\nimport { SkyPopoverAnimationState } from './popover-animation-state';\nimport { SkyPopoverContext } from './popover-context';\nimport {\n parseAffixHorizontalAlignment,\n parseAffixPlacement,\n} from './popover-extensions';\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverPlacement } from './types/popover-placement';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-popover-content',\n templateUrl: './popover-content.component.html',\n styleUrls: ['./popover-content.component.scss'],\n animations: [skyPopoverAnimation],\n providers: [SkyPopoverAdapterService],\n})\nexport class SkyPopoverContentComponent implements OnInit, OnDestroy {\n public get animationState(): SkyPopoverAnimationState {\n return this.isOpen ? 'open' : 'closed';\n }\n\n public get closed(): Observable<void> {\n return this._closed.asObservable();\n }\n\n public get opened(): Observable<void> {\n return this._opened.asObservable();\n }\n\n public get isMouseEnter(): Observable<boolean> {\n return this._isMouseEnter.asObservable();\n }\n\n public affixer: SkyAffixer;\n\n public arrowLeft: number;\n\n public arrowTop: number;\n\n public dismissOnBlur = true;\n\n public enableAnimations = true;\n\n public horizontalAlignment: SkyPopoverAlignment;\n\n public isOpen = false;\n\n public placement: SkyPopoverPlacement;\n\n public popoverTitle: string;\n\n public popoverType: 'danger' | 'info' = 'info';\n\n public themeName: string;\n\n @ViewChild('arrowRef', {\n read: ElementRef,\n static: true,\n })\n private arrowRef: ElementRef;\n\n @ViewChild('popoverRef', {\n read: ElementRef,\n static: true,\n })\n private popoverRef: ElementRef;\n\n @ViewChild('contentTarget', {\n read: ViewContainerRef,\n static: true,\n })\n private contentTarget: ViewContainerRef;\n\n private caller: ElementRef;\n\n private ngUnsubscribe = new Subject<void>();\n\n private _closed = new Subject<void>();\n\n private _isMouseEnter = new Subject<boolean>();\n\n private _opened = new Subject<void>();\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private elementRef: ElementRef,\n private affixService: SkyAffixService,\n private coreAdapterService: SkyCoreAdapterService,\n private adapterService: SkyPopoverAdapterService,\n @Optional() private context?: SkyPopoverContext,\n @Optional() private themeSvc?: SkyThemeService\n ) {}\n\n public ngOnInit(): void {\n /*istanbul ignore next*/\n this.contentTarget.createEmbeddedView(this.context?.contentTemplateRef);\n this.addEventListeners();\n\n /*istanbul ignore else*/\n if (this.themeSvc) {\n this.themeSvc.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((themeSettings) => {\n /*istanbul ignore next*/\n this.themeName = themeSettings.currentSettings?.theme?.name;\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n\n this._closed.complete();\n this._isMouseEnter.complete();\n this._opened.complete();\n\n /* istanbul ignore else */\n if (this.affixer) {\n this.affixer.destroy();\n }\n\n this._closed =\n this._isMouseEnter =\n this._opened =\n this.affixer =\n this.ngUnsubscribe =\n undefined;\n }\n\n public onAnimationEvent(event: AnimationEvent): void {\n if (event.fromState === 'void') {\n return;\n }\n\n if (event.phaseName === 'done') {\n if (event.toState === 'open') {\n /*istanbul ignore next*/\n this._opened?.next();\n } else {\n /*istanbul ignore next*/\n this._closed?.next();\n }\n }\n }\n\n public open(\n caller: ElementRef,\n config: {\n dismissOnBlur: boolean;\n enableAnimations: boolean;\n horizontalAlignment: SkyPopoverAlignment;\n isStatic: boolean;\n placement: SkyPopoverPlacement;\n popoverTitle: string;\n popoverType?: 'danger' | 'info';\n }\n ): void {\n this.caller = caller;\n this.dismissOnBlur = config.dismissOnBlur;\n this.enableAnimations = config.enableAnimations;\n this.horizontalAlignment = config.horizontalAlignment;\n this.placement = config.placement;\n this.popoverTitle = config.popoverTitle;\n if (config.popoverType) {\n this.popoverType = config.popoverType;\n }\n\n this.changeDetector.markForCheck();\n\n // Indicates if the popover should be displayed statically.\n // Please note: This feature is internal-only and used by the visual tests to capture multiple\n // states simultaneously without the overhead of event listeners.\n /* istanbul ignore if */\n if (config.isStatic) {\n this.isOpen = true;\n this.changeDetector.markForCheck();\n return;\n }\n\n // Let the styles render before gauging the affix dimensions.\n setTimeout(() => {\n /*istanbul ignore next*/\n if (\n !this.popoverRef?.nativeElement ||\n !this.ngUnsubscribe ||\n this.ngUnsubscribe.isStopped\n ) {\n return;\n }\n\n if (!this.affixer) {\n this.setupAffixer();\n }\n\n const affixOptions: SkyAffixConfig = {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: parseAffixHorizontalAlignment(\n this.horizontalAlignment\n ),\n isSticky: true,\n placement: parseAffixPlacement(this.placement),\n };\n\n // Ensure vertical alignment is set according to the popover's placement value.\n if (\n affixOptions.placement === 'left' ||\n affixOptions.placement === 'right'\n ) {\n affixOptions.verticalAlignment = 'middle';\n }\n\n this.affixer.affixTo(this.caller.nativeElement, affixOptions);\n\n this.updateArrowOffset();\n\n this.isOpen = true;\n this.changeDetector.markForCheck();\n });\n }\n\n public close(): void {\n this.isOpen = false;\n this.changeDetector.markForCheck();\n }\n\n public applyFocus(): void {\n if (this.isOpen) {\n this.coreAdapterService.getFocusableChildrenAndApplyFocus(\n this.popoverRef,\n '.sky-popover',\n true\n );\n }\n }\n\n private setupAffixer(): void {\n const affixer = this.affixService.createAffixer(this.popoverRef);\n\n affixer.offsetChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.updateArrowOffset();\n this.changeDetector.markForCheck();\n });\n\n affixer.overflowScroll.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.updateArrowOffset();\n this.changeDetector.markForCheck();\n });\n\n affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => {\n this.placement = change.placement;\n this.changeDetector.markForCheck();\n });\n\n this.affixer = affixer;\n }\n\n private updateArrowOffset(): void {\n const { top, left } = this.adapterService.getArrowCoordinates(\n {\n caller: this.caller,\n popover: this.popoverRef,\n popoverArrow: this.arrowRef,\n },\n this.placement,\n this.themeName\n );\n\n this.arrowTop = top;\n this.arrowLeft = left;\n }\n\n private isFocusLeavingElement(event: KeyboardEvent): boolean {\n const focusableItems = this.coreAdapterService.getFocusableChildren(\n this.elementRef.nativeElement\n );\n\n const isFirstItem = focusableItems[0] === event.target && event.shiftKey;\n\n const isLastItem =\n focusableItems[focusableItems.length - 1] === event.target &&\n !event.shiftKey;\n\n return focusableItems.length === 0 || isFirstItem || isLastItem;\n }\n\n private addEventListeners(): void {\n const hostElement = this.elementRef.nativeElement;\n\n observableFromEvent(hostElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => this._isMouseEnter.next(true));\n\n observableFromEvent(hostElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => this._isMouseEnter.next(false));\n\n observableFromEvent(hostElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n this.close();\n this.caller.nativeElement.focus();\n event.preventDefault();\n event.stopPropagation();\n break;\n\n // Since the popover now lives in an overlay at the bottom of the document body, we need\n // to handle the tab key ourselves. Otherwise, focus would be moved to the browser's\n // search bar.\n case 'tab':\n if (!this.dismissOnBlur) {\n return;\n }\n\n /*istanbul ignore else*/\n if (this.isFocusLeavingElement(event)) {\n this.close();\n this.caller.nativeElement.focus();\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n }\n });\n }\n}\n","<div\n class=\"sky-popover-container sky-popover-max-height\"\n [@.disabled]=\"!enableAnimations\"\n [@skyPopoverAnimation]=\"animationState\"\n [class.sky-popover-hidden]=\"!placement\"\n [ngClass]=\"[\n 'sky-popover-alignment-' + horizontalAlignment,\n 'sky-popover-placement-' + placement,\n 'sky-popover-' + popoverType\n ]\"\n (@skyPopoverAnimation.done)=\"onAnimationEvent($event)\"\n (@skyPopoverAnimation.start)=\"onAnimationEvent($event)\"\n #popoverRef\n>\n <div\n class=\"sky-popover\"\n tabindex=\"-1\"\n [skyThemeClass]=\"{\n 'sky-rounded-corners sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n >\n <header\n *ngIf=\"popoverTitle\"\n class=\"sky-popover-header\"\n [skyThemeClass]=\"{\n 'sky-padding-even-default': 'default',\n 'sky-padding-even-lg sky-margin-stacked-lg': 'modern'\n }\"\n >\n <h1\n *ngIf=\"popoverTitle\"\n class=\"sky-popover-title\"\n [skyThemeClass]=\"{\n 'sky-emphasized': 'default',\n 'sky-font-emphasized': 'modern'\n }\"\n >\n {{ popoverTitle }}\n </h1>\n </header>\n <div\n class=\"sky-popover-body\"\n [skyThemeClass]=\"{\n 'sky-padding-even-default': 'default',\n 'sky-padding-even-lg': 'modern'\n }\"\n >\n <ng-container #contentTarget></ng-container>\n </div>\n <span\n aria-hidden=\"true\"\n class=\"sky-popover-arrow\"\n [style.left.px]=\"arrowLeft\"\n [style.top.px]=\"arrowTop\"\n #arrowRef\n ></span>\n </div>\n</div>\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"popover-context.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-context.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAG5B,YAAY,IAA8C;QACxD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;IACpD,CAAC;CACF","sourcesContent":["import { TemplateRef } from '@angular/core';\n\n/**\n * @dynamic\n * @internal\n */\nexport class SkyPopoverContext {\n public readonly contentTemplateRef: TemplateRef<any>;\n\n constructor(args: { contentTemplateRef: TemplateRef<any> }) {\n this.contentTemplateRef = args.contentTemplateRef;\n }\n}\n"]}
1
+ {"version":3,"file":"popover-context.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-context.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAG5B,YAAY,IAAkD;QAC5D,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;IACpD,CAAC;CACF","sourcesContent":["import { TemplateRef } from '@angular/core';\n\n/**\n * @dynamic\n * @internal\n */\nexport class SkyPopoverContext {\n public readonly contentTemplateRef: TemplateRef<unknown>;\n\n constructor(args: { contentTemplateRef: TemplateRef<unknown> }) {\n this.contentTemplateRef = args.contentTemplateRef;\n }\n}\n"]}
@@ -34,8 +34,7 @@ export class SkyPopoverComponent {
34
34
  }
35
35
  /**
36
36
  * Specifies the horizontal alignment of the popover in relation to the trigger element.
37
- * The `skyPopoverAlignment` property on the popover directive overwrites this property.
38
- * Options include:`"center"`, `"right"`, and `'"left"`.
37
+ * The `skyPopoverAlignment` property on the popover directive takes precedence over this property when specified.
39
38
  * @default "center"
40
39
  */
41
40
  set alignment(value) {
@@ -60,8 +59,7 @@ export class SkyPopoverComponent {
60
59
  }
61
60
  /**
62
61
  * Specifies the placement of the popover in relation to the trigger element.
63
- * The `skyPopoverPlacement` property on the popover directive overwrites this property.
64
- * Options include:`"above"`, `"below"`, `"right"`, and `"left"`.
62
+ * The `skyPopoverPlacement` property on the popover directive takes precedence over this property when specified.
65
63
  * @default "above"
66
64
  */
67
65
  set placement(value) {
@@ -1 +1 @@
1
- {"version":3,"file":"popover.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;;AAQtD,MAAM,OAAO,mBAAmB;IA8G9B,YAAoB,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;QA/CrD;;WAEG;QAEI,kBAAa,GAAG,IAAI,YAAY,EAAuB,CAAC;QAE/D;;WAEG;QAEI,kBAAa,GAAG,IAAI,YAAY,EAAuB,CAA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,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;;iHAnOU,mBAAmB;qGAAnB,mBAAmB,6WA2FtB,WAAW,2CCnHrB,2EAGA;4FDqBa,mBAAmB;kBAJ/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,aAAa;oBACvB,WAAW,EAAE,0BAA0B;iBACxC;wGASY,SAAS;sBADnB,KAAK;gBAeK,aAAa;sBADvB,KAAK;gBAoBK,SAAS;sBADnB,KAAK;gBAaC,YAAY;sBADlB,KAAK;gBASC,WAAW;sBADjB,KAAK;gBAOC,aAAa;sBADnB,MAAM;gBAOA,aAAa;sBADnB,MAAM;gBAsBC,WAAW;sBAJlB,SAAS;uBAAC,aAAa,EAAE;wBACxB,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { SkyOverlayInstance, SkyOverlayService } from '@skyux/core';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyPopoverContentComponent } from './popover-content.component';\nimport { SkyPopoverContext } from './popover-context';\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverPlacement } from './types/popover-placement';\n\n@Component({\n selector: 'sky-popover',\n templateUrl: './popover.component.html',\n})\nexport class SkyPopoverComponent implements OnDestroy {\n /**\n * Specifies the horizontal alignment of the popover in relation to the trigger element.\n * The `skyPopoverAlignment` property on the popover directive overwrites this property.\n * Options include:`\"center\"`, `\"right\"`, and `'\"left\"`.\n * @default \"center\"\n */\n @Input()\n public set alignment(value: SkyPopoverAlignment) {\n this._alignment = value;\n }\n\n public get alignment(): SkyPopoverAlignment {\n return this._alignment || 'center';\n }\n\n /**\n * Indicates whether to close the popover when it loses focus.\n * To require users to click a trigger button to close the popover, set this input to false.\n * @default true\n */\n @Input()\n public set dismissOnBlur(value: boolean) {\n this._dismissOnBlur = value;\n }\n\n public get dismissOnBlur(): boolean {\n if (this._dismissOnBlur === undefined) {\n return true;\n }\n\n return this._dismissOnBlur;\n }\n\n /**\n * Specifies the placement of the popover in relation to the trigger element.\n * The `skyPopoverPlacement` property on the popover directive overwrites this property.\n * Options include:`\"above\"`, `\"below\"`, `\"right\"`, and `\"left\"`.\n * @default \"above\"\n */\n @Input()\n public set placement(value: SkyPopoverPlacement) {\n this._placement = value;\n }\n\n public get placement(): SkyPopoverPlacement {\n return this._placement || 'above';\n }\n\n /**\n * Specifies a title for the popover.\n */\n @Input()\n public popoverTitle: string;\n\n /**\n * Specifies the type of popover.\n * Options include `\"info\"` and `\"danger\"`.\n * @default \"info\"\n */\n @Input()\n public popoverType: 'danger' | 'info';\n\n /**\n * Fires when users close the popover.\n */\n @Output()\n public popoverClosed = new EventEmitter<SkyPopoverComponent>();\n\n /**\n * Fires when users open the popover.\n */\n @Output()\n public popoverOpened = new EventEmitter<SkyPopoverComponent>();\n\n /**\n * Indicates that the popover is in the process of being opened or closed.\n * @internal\n */\n public isActive = false;\n\n /**\n * Used by unit tests to disable animations since the component is injected at the bottom of the\n * document body.\n * @internal\n */\n public enableAnimations = true;\n\n public isMouseEnter = false;\n\n @ViewChild('templateRef', {\n read: TemplateRef,\n static: true,\n })\n private templateRef: TemplateRef<any>;\n\n private contentRef: SkyPopoverContentComponent;\n\n private isMarkedForCloseOnMouseLeave = false;\n\n private ngUnsubscribe = new Subject<void>();\n\n private overlay: SkyOverlayInstance;\n\n private _alignment: SkyPopoverAlignment;\n\n private _dismissOnBlur: boolean;\n\n private _placement: SkyPopoverPlacement;\n\n constructor(private overlayService: SkyOverlayService) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n /**\n * Positions the popover next to a given caller element.\n * @param caller The element that opened the popover.\n * @param placement The placement of the popover.\n * @param alignment The horizontal alignment of the popover.\n * @internal\n */\n public positionNextTo(\n caller: ElementRef,\n placement?: SkyPopoverPlacement,\n alignment?: SkyPopoverAlignment\n ): void {\n if (!this.overlay) {\n this.setupOverlay();\n }\n\n this.placement = placement ?? this.placement;\n this.alignment = alignment ?? this.alignment;\n this.isActive = true;\n\n this.contentRef.open(caller, {\n dismissOnBlur: this.dismissOnBlur,\n enableAnimations: this.enableAnimations,\n horizontalAlignment: this.alignment,\n isStatic: false,\n placement: this.placement,\n popoverTitle: this.popoverTitle,\n popoverType: this.popoverType,\n });\n }\n\n /**\n * Closes the popover.\n * @internal\n */\n public close(): void {\n /*istanbul ignore next*/\n this.contentRef?.close();\n }\n\n /**\n * Brings focus to the popover element if its open.\n * @internal\n */\n public applyFocus(): void {\n /*istanbul ignore next*/\n this.contentRef?.applyFocus();\n }\n\n /**\n * Adds a flag to the popover to close when the mouse leaves the popover's bounds.\n * @internal\n */\n public markForCloseOnMouseLeave(): void {\n this.isMarkedForCloseOnMouseLeave = true;\n }\n\n private setupOverlay(): void {\n const overlay = this.overlayService.create({\n enableScroll: true,\n enablePointerEvents: true,\n });\n\n overlay.backdropClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n if (this.dismissOnBlur) {\n this.close();\n }\n });\n\n const contentRef = overlay.attachComponent(SkyPopoverContentComponent, [\n {\n provide: SkyPopoverContext,\n useValue: new SkyPopoverContext({\n contentTemplateRef: this.templateRef,\n }),\n },\n ]);\n\n contentRef.opened.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.popoverOpened.emit(this);\n });\n\n contentRef.closed.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n /*istanbul ignore else*/\n if (this.isActive) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n this.isActive = false;\n this.popoverClosed.emit(this);\n }\n });\n\n contentRef.isMouseEnter\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((isMouseEnter) => {\n this.isMouseEnter = isMouseEnter;\n if (this.isMarkedForCloseOnMouseLeave) {\n this.isMarkedForCloseOnMouseLeave = false;\n this.close();\n }\n });\n\n this.overlay = overlay;\n this.contentRef = contentRef;\n }\n}\n","<ng-template #templateRef>\n <ng-content></ng-content>\n</ng-template>\n"]}
1
+ {"version":3,"file":"popover.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;;AAStD,MAAM,OAAO,mBAAmB;IA2G9B,YAAoB,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;QA/CrD;;WAEG;QAEI,kBAAa,GAAG,IAAI,YAAY,EAAuB,CAAC;QAE/D;;WAEG;QAEI,kBAAa,GAAG,IAAI,YAAY,EAAuB,CAAC;QAE/D;;;WAGG;QACI,aAAQ,GAAG,KAAK,CAAC;QAExB;;;;WAIG;QACI,qBAAgB,GAAG,IAAI,CAAC;QAExB,iBAAY,GAAG,KAAK,CAAC;QAUpB,iCAA4B,GAAG,KAAK,CAAC;QAErC,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;IAUY,CAAC;IA1GzD;;;;OAIG;IACH,IACW,SAAS,CAAC,KAA0B;QAC7C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,IAAW,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AK;gBAQC,WAAW;sBADjB,KAAK;gBAOC,aAAa;sBADnB,MAAM;gBAOA,aAAa;sBADnB,MAAM;gBAsBC,WAAW;sBAJlB,SAAS;uBAAC,aAAa,EAAE;wBACxB,IAAI,EAAE,WAAW;wBACjB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { SkyOverlayInstance, SkyOverlayService } from '@skyux/core';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyPopoverContentComponent } from './popover-content.component';\nimport { SkyPopoverContext } from './popover-context';\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverPlacement } from './types/popover-placement';\nimport { SkyPopoverType } from './types/popover-type';\n\n@Component({\n selector: 'sky-popover',\n templateUrl: './popover.component.html',\n})\nexport class SkyPopoverComponent implements OnDestroy {\n /**\n * Specifies the horizontal alignment of the popover in relation to the trigger element.\n * The `skyPopoverAlignment` property on the popover directive takes precedence over this property when specified.\n * @default \"center\"\n */\n @Input()\n public set alignment(value: SkyPopoverAlignment) {\n this._alignment = value;\n }\n\n public get alignment(): SkyPopoverAlignment {\n return this._alignment || 'center';\n }\n\n /**\n * Indicates whether to close the popover when it loses focus.\n * To require users to click a trigger button to close the popover, set this input to false.\n * @default true\n */\n @Input()\n public set dismissOnBlur(value: boolean) {\n this._dismissOnBlur = value;\n }\n\n public get dismissOnBlur(): boolean {\n if (this._dismissOnBlur === undefined) {\n return true;\n }\n\n return this._dismissOnBlur;\n }\n\n /**\n * Specifies the placement of the popover in relation to the trigger element.\n * The `skyPopoverPlacement` property on the popover directive takes precedence over this property when specified.\n * @default \"above\"\n */\n @Input()\n public set placement(value: SkyPopoverPlacement) {\n this._placement = value;\n }\n\n public get placement(): SkyPopoverPlacement {\n return this._placement || 'above';\n }\n\n /**\n * Specifies a title for the popover.\n */\n @Input()\n public popoverTitle: string;\n\n /**\n * Specifies the type of popover.\n * @default \"info\"\n */\n @Input()\n public popoverType: SkyPopoverType;\n\n /**\n * Fires when users close the popover.\n */\n @Output()\n public popoverClosed = new EventEmitter<SkyPopoverComponent>();\n\n /**\n * Fires when users open the popover.\n */\n @Output()\n public popoverOpened = new EventEmitter<SkyPopoverComponent>();\n\n /**\n * Indicates that the popover is in the process of being opened or closed.\n * @internal\n */\n public isActive = false;\n\n /**\n * Used by unit tests to disable animations since the component is injected at the bottom of the\n * document body.\n * @internal\n */\n public enableAnimations = true;\n\n public isMouseEnter = false;\n\n @ViewChild('templateRef', {\n read: TemplateRef,\n static: true,\n })\n private templateRef: TemplateRef<unknown>;\n\n private contentRef: SkyPopoverContentComponent;\n\n private isMarkedForCloseOnMouseLeave = false;\n\n private ngUnsubscribe = new Subject<void>();\n\n private overlay: SkyOverlayInstance;\n\n private _alignment: SkyPopoverAlignment;\n\n private _dismissOnBlur: boolean;\n\n private _placement: SkyPopoverPlacement;\n\n constructor(private overlayService: SkyOverlayService) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n /**\n * Positions the popover next to a given caller element.\n * @param caller The element that opened the popover.\n * @param placement The placement of the popover.\n * @param alignment The horizontal alignment of the popover.\n * @internal\n */\n public positionNextTo(\n caller: ElementRef,\n placement?: SkyPopoverPlacement,\n alignment?: SkyPopoverAlignment\n ): void {\n if (!this.overlay) {\n this.setupOverlay();\n }\n\n this.placement = placement ?? this.placement;\n this.alignment = alignment ?? this.alignment;\n this.isActive = true;\n\n this.contentRef.open(caller, {\n dismissOnBlur: this.dismissOnBlur,\n enableAnimations: this.enableAnimations,\n horizontalAlignment: this.alignment,\n isStatic: false,\n placement: this.placement,\n popoverTitle: this.popoverTitle,\n popoverType: this.popoverType,\n });\n }\n\n /**\n * Closes the popover.\n * @internal\n */\n public close(): void {\n /*istanbul ignore next*/\n this.contentRef?.close();\n }\n\n /**\n * Brings focus to the popover element if its open.\n * @internal\n */\n public applyFocus(): void {\n /*istanbul ignore next*/\n this.contentRef?.applyFocus();\n }\n\n /**\n * Adds a flag to the popover to close when the mouse leaves the popover's bounds.\n * @internal\n */\n public markForCloseOnMouseLeave(): void {\n this.isMarkedForCloseOnMouseLeave = true;\n }\n\n private setupOverlay(): void {\n const overlay = this.overlayService.create({\n enableScroll: true,\n enablePointerEvents: true,\n });\n\n overlay.backdropClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n if (this.dismissOnBlur) {\n this.close();\n }\n });\n\n const contentRef = overlay.attachComponent(SkyPopoverContentComponent, [\n {\n provide: SkyPopoverContext,\n useValue: new SkyPopoverContext({\n contentTemplateRef: this.templateRef,\n }),\n },\n ]);\n\n contentRef.opened.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.popoverOpened.emit(this);\n });\n\n contentRef.closed.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n /*istanbul ignore else*/\n if (this.isActive) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n this.isActive = false;\n this.popoverClosed.emit(this);\n }\n });\n\n contentRef.isMouseEnter\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((isMouseEnter) => {\n this.isMouseEnter = isMouseEnter;\n if (this.isMarkedForCloseOnMouseLeave) {\n this.isMarkedForCloseOnMouseLeave = false;\n this.close();\n }\n });\n\n this.overlay = overlay;\n this.contentRef = contentRef;\n }\n}\n","<ng-template #templateRef>\n <ng-content></ng-content>\n</ng-template>\n"]}
@@ -1,3 +1,5 @@
1
+ var _SkyPopoverDirective_messageStreamSub;
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
1
3
  import { Directive, ElementRef, Input } from '@angular/core';
2
4
  import { Subject, fromEvent as observableFromEvent } from 'rxjs';
3
5
  import { takeUntil } from 'rxjs/operators';
@@ -7,11 +9,20 @@ import * as i0 from "@angular/core";
7
9
  export class SkyPopoverDirective {
8
10
  constructor(elementRef) {
9
11
  this.elementRef = elementRef;
10
- /**
11
- * Provides an observable to send commands to the popover that respect the `SkyPopoverMessage` type.
12
- */
13
- this.skyPopoverMessageStream = new Subject();
12
+ this._skyPopoverMessageStream = new Subject();
13
+ _SkyPopoverDirective_messageStreamSub.set(this, void 0);
14
14
  this.ngUnsubscribe = new Subject();
15
+ this.subscribeMessageStream();
16
+ }
17
+ /**
18
+ * Provides an RxJS `Subject` to send commands to the popover that respect the `SkyPopoverMessage` type.
19
+ */
20
+ set skyPopoverMessageStream(value) {
21
+ this._skyPopoverMessageStream = value !== null && value !== void 0 ? value : new Subject();
22
+ this.subscribeMessageStream();
23
+ }
24
+ get skyPopoverMessageStream() {
25
+ return this._skyPopoverMessageStream;
15
26
  }
16
27
  /**
17
28
  * Specifies the user action that displays the popover.
@@ -27,6 +38,7 @@ export class SkyPopoverDirective {
27
38
  }
28
39
  ngOnDestroy() {
29
40
  this.removeEventListeners();
41
+ this.unsubscribeMessageStream();
30
42
  }
31
43
  togglePopover() {
32
44
  if (this.skyPopover.isActive) {
@@ -51,11 +63,6 @@ export class SkyPopoverDirective {
51
63
  }
52
64
  addEventListeners() {
53
65
  const element = this.elementRef.nativeElement;
54
- this.skyPopoverMessageStream
55
- .pipe(takeUntil(this.ngUnsubscribe))
56
- .subscribe((message) => {
57
- this.handleIncomingMessages(message);
58
- });
59
66
  observableFromEvent(element, 'keydown')
60
67
  .pipe(takeUntil(this.ngUnsubscribe))
61
68
  .subscribe((event) => {
@@ -154,7 +161,20 @@ export class SkyPopoverDirective {
154
161
  sendMessage(messageType) {
155
162
  this.skyPopoverMessageStream.next({ type: messageType });
156
163
  }
164
+ subscribeMessageStream() {
165
+ this.unsubscribeMessageStream();
166
+ __classPrivateFieldSet(this, _SkyPopoverDirective_messageStreamSub, this.skyPopoverMessageStream.subscribe((message) => {
167
+ this.handleIncomingMessages(message);
168
+ }), "f");
169
+ }
170
+ unsubscribeMessageStream() {
171
+ if (__classPrivateFieldGet(this, _SkyPopoverDirective_messageStreamSub, "f")) {
172
+ __classPrivateFieldGet(this, _SkyPopoverDirective_messageStreamSub, "f").unsubscribe();
173
+ __classPrivateFieldSet(this, _SkyPopoverDirective_messageStreamSub, undefined, "f");
174
+ }
175
+ }
157
176
  }
177
+ _SkyPopoverDirective_messageStreamSub = new WeakMap();
158
178
  SkyPopoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
159
179
  SkyPopoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyPopoverDirective, selector: "[skyPopover]", inputs: { skyPopover: "skyPopover", skyPopoverAlignment: "skyPopoverAlignment", skyPopoverMessageStream: "skyPopoverMessageStream", skyPopoverPlacement: "skyPopoverPlacement", skyPopoverTrigger: "skyPopoverTrigger" }, ngImport: i0 });
160
180
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverDirective, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"popover.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;;AAOrE,MAAM,OAAO,mBAAmB;IA8C9B,YAAoB,UAAsB;QAA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AS,CAAC;IACjC,CAAC;IAEO,sBAAsB,CAAC,OAA0B;QACvD,6CAA6C;QAC7C,QAAQ,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,qBAAqB,CAAC,IAAI;gBAC7B,IAAI,CAAC,eAAe,EAAE,CAAC;gBACvB,MAAM;YAER,KAAK,qBAAqB,CAAC,KAAK;gBAC9B,wBAAwB;gBACxB,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;oBAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;iBACrB;gBACD,MAAM;YAER,KAAK,qBAAqB,CAAC,UAAU;gBACnC,qDAAqD;gBACrD,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;oBAC5B,IAAI,CAAC,eAAe,EAAE,CAAC;iBACxB;gBACD,MAAM;YAER,KAAK,qBAAqB,CAAC,KAAK;gBAC9B,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;gBAC7B,MAAM;SACT;IACH,CAAC;IAEO,WAAW,CAAC,WAAkC;QACpD,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAC3D,CAAC;;iHAhNU,mBAAmB;qGAAnB,mBAAmB;4FAAnB,mBAAmB;kBAH/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;iBACzB;iGAOQ,UAAU;sBADhB,KAAK;gBASC,mBAAmB;sBADzB,KAAK;gBAOC,uBAAuB;sBAD7B,KAAK;gBASC,mBAAmB;sBADzB,KAAK;gBAOK,iBAAiB;sBAD3B,KAAK","sourcesContent":["import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';\n\nimport { Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyPopoverComponent } from './popover.component';\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverMessage } from './types/popover-message';\nimport { SkyPopoverMessageType } from './types/popover-message-type';\nimport { SkyPopoverPlacement } from './types/popover-placement';\nimport { SkyPopoverTrigger } from './types/popover-trigger';\n\n@Directive({\n selector: '[skyPopover]',\n})\nexport class SkyPopoverDirective implements OnInit, OnDestroy {\n /**\n * References the popover component to display. Add this directive to the trigger element that opens the popover.\n * @required\n */\n @Input()\n public skyPopover: SkyPopoverComponent;\n\n /**\n * Specifies the horizontal alignment of the popover in relation to the trigger element.\n * Options include:`\"center\"`, `\"right\"`, and `\"left\"`.\n * @default \"center\"\n */\n @Input()\n public skyPopoverAlignment: SkyPopoverAlignment;\n\n /**\n * Provides an observable to send commands to the popover that respect the `SkyPopoverMessage` type.\n */\n @Input()\n public skyPopoverMessageStream = new Subject<SkyPopoverMessage>();\n\n /**\n * Specifies the placement of the popover in relation to the trigger element.\n * Options include:`\"above\"`, `\"below\"`, `\"right\"`, and `\"left\"`.\n * @default \"above\"\n */\n @Input()\n public skyPopoverPlacement: SkyPopoverPlacement;\n\n /**\n * Specifies the user action that displays the popover.\n */\n @Input()\n public set skyPopoverTrigger(value: SkyPopoverTrigger) {\n this._trigger = value;\n }\n\n public get skyPopoverTrigger(): SkyPopoverTrigger {\n return this._trigger || 'click';\n }\n\n private ngUnsubscribe = new Subject<void>();\n\n private _trigger: SkyPopoverTrigger;\n\n constructor(private elementRef: ElementRef) {}\n\n public ngOnInit(): void {\n this.addEventListeners();\n }\n\n public ngOnDestroy(): void {\n this.removeEventListeners();\n }\n\n public togglePopover(): void {\n if (this.skyPopover.isActive) {\n this.sendMessage(SkyPopoverMessageType.Close);\n return;\n }\n\n this.sendMessage(SkyPopoverMessageType.Open);\n }\n\n private positionPopover(): void {\n this.skyPopover.positionNextTo(\n this.elementRef,\n this.skyPopoverPlacement,\n this.skyPopoverAlignment\n );\n }\n\n private closePopover(): void {\n this.skyPopover.close();\n }\n\n private closePopoverOrMarkForClose(): void {\n if (this.skyPopover.isMouseEnter) {\n this.skyPopover.markForCloseOnMouseLeave();\n } else {\n this.sendMessage(SkyPopoverMessageType.Close);\n }\n }\n\n private addEventListeners(): void {\n const element = this.elementRef.nativeElement;\n\n this.skyPopoverMessageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message) => {\n this.handleIncomingMessages(message);\n });\n\n observableFromEvent(element, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n if (!this.skyPopover.isActive) {\n return;\n }\n\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n this.sendMessage(SkyPopoverMessageType.Close);\n event.preventDefault();\n event.stopPropagation();\n break;\n\n case 'tab':\n if (this.skyPopover.dismissOnBlur) {\n this.sendMessage(SkyPopoverMessageType.Close);\n }\n break;\n\n case 'arrowdown':\n case 'arrowleft':\n case 'arrowright':\n case 'arrowup':\n case 'down':\n case 'left':\n case 'right':\n case 'up':\n this.sendMessage(SkyPopoverMessageType.Focus);\n event.stopPropagation();\n event.preventDefault();\n break;\n }\n });\n\n observableFromEvent(element, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.skyPopover) {\n this.togglePopover();\n }\n });\n\n observableFromEvent(element, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.skyPopover) {\n this.skyPopover.isMouseEnter = true;\n if (\n !this.skyPopover.isActive &&\n this.skyPopoverTrigger === 'mouseenter'\n ) {\n this.sendMessage(SkyPopoverMessageType.Open);\n }\n }\n });\n\n observableFromEvent(element, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.skyPopover) {\n this.skyPopover.isMouseEnter = false;\n if (\n this.skyPopover.isActive &&\n this.skyPopoverTrigger === 'mouseenter'\n ) {\n // Give the popover a chance to set its isMouseEnter flag before checking to see\n // if it should be closed.\n setTimeout(() => {\n this.closePopoverOrMarkForClose();\n });\n }\n }\n });\n }\n\n private removeEventListeners(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n }\n\n private handleIncomingMessages(message: SkyPopoverMessage): void {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyPopoverMessageType.Open:\n this.positionPopover();\n break;\n\n case SkyPopoverMessageType.Close:\n /*istanbul ignore else*/\n if (this.skyPopover.isActive) {\n this.closePopover();\n }\n break;\n\n case SkyPopoverMessageType.Reposition:\n // Only reposition the popover if it is already open.\n if (this.skyPopover.isActive) {\n this.positionPopover();\n }\n break;\n\n case SkyPopoverMessageType.Focus:\n this.skyPopover.applyFocus();\n break;\n }\n }\n\n private sendMessage(messageType: SkyPopoverMessageType): void {\n this.skyPopoverMessageStream.next({ type: messageType });\n }\n}\n"]}
1
+ {"version":3,"file":"popover.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover.directive.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAgB,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;;AAOrE,MAAM,OAAO,mBAAmB;IAyD9B,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QA3BlC,6BAAwB,GAAG,IAAI,OAAO,EAAqB,CAAC;QAEpE,wDAA4C;QAqBpC,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;QAK1C,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAChC,CAAC;IA5CD;;OAEG;IACH,IACW,uBAAuB,CAChC,KAA6C;QAE7C,IAAI,CAAC,wBAAwB,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,OAAO,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ElementRef, Input, OnDestroy, OnInit } from '@angular/core';\n\nimport { Subject, Subscription, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyPopoverComponent } from './popover.component';\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverMessage } from './types/popover-message';\nimport { SkyPopoverMessageType } from './types/popover-message-type';\nimport { SkyPopoverPlacement } from './types/popover-placement';\nimport { SkyPopoverTrigger } from './types/popover-trigger';\n\n@Directive({\n selector: '[skyPopover]',\n})\nexport class SkyPopoverDirective implements OnInit, OnDestroy {\n /**\n * References the popover component to display. Add this directive to the trigger element that opens the popover.\n * @required\n */\n @Input()\n public skyPopover: SkyPopoverComponent;\n\n /**\n * Specifies the horizontal alignment of the popover in relation to the trigger element.\n * @default \"center\"\n */\n @Input()\n public skyPopoverAlignment: SkyPopoverAlignment;\n\n /**\n * Provides an RxJS `Subject` to send commands to the popover that respect the `SkyPopoverMessage` type.\n */\n @Input()\n public set skyPopoverMessageStream(\n value: Subject<SkyPopoverMessage> | undefined\n ) {\n this._skyPopoverMessageStream = value ?? new Subject<SkyPopoverMessage>();\n this.subscribeMessageStream();\n }\n\n public get skyPopoverMessageStream(): Subject<SkyPopoverMessage> {\n return this._skyPopoverMessageStream;\n }\n\n private _skyPopoverMessageStream = new Subject<SkyPopoverMessage>();\n\n #messageStreamSub: Subscription | undefined;\n\n /**\n * Specifies the placement of the popover in relation to the trigger element.\n * @default \"above\"\n */\n @Input()\n public skyPopoverPlacement: SkyPopoverPlacement;\n\n /**\n * Specifies the user action that displays the popover.\n */\n @Input()\n public set skyPopoverTrigger(value: SkyPopoverTrigger) {\n this._trigger = value;\n }\n\n public get skyPopoverTrigger(): SkyPopoverTrigger {\n return this._trigger || 'click';\n }\n\n private ngUnsubscribe = new Subject<void>();\n\n private _trigger: SkyPopoverTrigger;\n\n constructor(private elementRef: ElementRef) {\n this.subscribeMessageStream();\n }\n\n public ngOnInit(): void {\n this.addEventListeners();\n }\n\n public ngOnDestroy(): void {\n this.removeEventListeners();\n this.unsubscribeMessageStream();\n }\n\n public togglePopover(): void {\n if (this.skyPopover.isActive) {\n this.sendMessage(SkyPopoverMessageType.Close);\n return;\n }\n\n this.sendMessage(SkyPopoverMessageType.Open);\n }\n\n private positionPopover(): void {\n this.skyPopover.positionNextTo(\n this.elementRef,\n this.skyPopoverPlacement,\n this.skyPopoverAlignment\n );\n }\n\n private closePopover(): void {\n this.skyPopover.close();\n }\n\n private closePopoverOrMarkForClose(): void {\n if (this.skyPopover.isMouseEnter) {\n this.skyPopover.markForCloseOnMouseLeave();\n } else {\n this.sendMessage(SkyPopoverMessageType.Close);\n }\n }\n\n private addEventListeners(): void {\n const element = this.elementRef.nativeElement;\n\n observableFromEvent(element, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n if (!this.skyPopover.isActive) {\n return;\n }\n\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n this.sendMessage(SkyPopoverMessageType.Close);\n event.preventDefault();\n event.stopPropagation();\n break;\n\n case 'tab':\n if (this.skyPopover.dismissOnBlur) {\n this.sendMessage(SkyPopoverMessageType.Close);\n }\n break;\n\n case 'arrowdown':\n case 'arrowleft':\n case 'arrowright':\n case 'arrowup':\n case 'down':\n case 'left':\n case 'right':\n case 'up':\n this.sendMessage(SkyPopoverMessageType.Focus);\n event.stopPropagation();\n event.preventDefault();\n break;\n }\n });\n\n observableFromEvent(element, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.skyPopover) {\n this.togglePopover();\n }\n });\n\n observableFromEvent(element, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.skyPopover) {\n this.skyPopover.isMouseEnter = true;\n if (\n !this.skyPopover.isActive &&\n this.skyPopoverTrigger === 'mouseenter'\n ) {\n this.sendMessage(SkyPopoverMessageType.Open);\n }\n }\n });\n\n observableFromEvent(element, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.skyPopover) {\n this.skyPopover.isMouseEnter = false;\n if (\n this.skyPopover.isActive &&\n this.skyPopoverTrigger === 'mouseenter'\n ) {\n // Give the popover a chance to set its isMouseEnter flag before checking to see\n // if it should be closed.\n setTimeout(() => {\n this.closePopoverOrMarkForClose();\n });\n }\n }\n });\n }\n\n private removeEventListeners(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n }\n\n private handleIncomingMessages(message: SkyPopoverMessage): void {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyPopoverMessageType.Open:\n this.positionPopover();\n break;\n\n case SkyPopoverMessageType.Close:\n /*istanbul ignore else*/\n if (this.skyPopover.isActive) {\n this.closePopover();\n }\n break;\n\n case SkyPopoverMessageType.Reposition:\n // Only reposition the popover if it is already open.\n if (this.skyPopover.isActive) {\n this.positionPopover();\n }\n break;\n\n case SkyPopoverMessageType.Focus:\n this.skyPopover.applyFocus();\n break;\n }\n }\n\n private sendMessage(messageType: SkyPopoverMessageType): void {\n this.skyPopoverMessageStream.next({ type: messageType });\n }\n\n private subscribeMessageStream(): void {\n this.unsubscribeMessageStream();\n\n this.#messageStreamSub = this.skyPopoverMessageStream.subscribe(\n (message) => {\n this.handleIncomingMessages(message);\n }\n );\n }\n\n private unsubscribeMessageStream(): void {\n if (this.#messageStreamSub) {\n this.#messageStreamSub.unsubscribe();\n this.#messageStreamSub = undefined;\n }\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=popover-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-type.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/popovers/src/lib/modules/popover/types/popover-type.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The style type of the popover.\n */\nexport type SkyPopoverType = 'danger' | 'info';\n"]}