@skyux/popovers 5.9.3 → 5.9.6

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.
Files changed (33) hide show
  1. package/bundles/skyux-popovers-testing.umd.js +12 -6
  2. package/bundles/skyux-popovers.umd.js +1531 -1536
  3. package/documentation.json +317 -284
  4. package/esm2015/lib/modules/dropdown/dropdown-item.component.js.map +1 -1
  5. package/esm2015/lib/modules/dropdown/dropdown-menu.component.js +1 -4
  6. package/esm2015/lib/modules/dropdown/dropdown-menu.component.js.map +1 -1
  7. package/esm2015/lib/modules/dropdown/dropdown.component.js +10 -7
  8. package/esm2015/lib/modules/dropdown/dropdown.component.js.map +1 -1
  9. package/esm2015/lib/modules/popover/popover-content.component.js +18 -34
  10. package/esm2015/lib/modules/popover/popover-content.component.js.map +1 -1
  11. package/esm2015/lib/modules/popover/popover.component.js +11 -2
  12. package/esm2015/lib/modules/popover/popover.component.js.map +1 -1
  13. package/esm2015/lib/modules/popover/popover.directive.js +0 -1
  14. package/esm2015/lib/modules/popover/popover.directive.js.map +1 -1
  15. package/esm2015/testing/dropdown/dropdown-fixture.js +7 -1
  16. package/esm2015/testing/dropdown/dropdown-fixture.js.map +1 -1
  17. package/esm2015/testing/dropdown/popovers-fixture-dropdown.js.map +1 -1
  18. package/esm2015/testing/popover/popover-fixture.js +8 -8
  19. package/esm2015/testing/popover/popover-fixture.js.map +1 -1
  20. package/fesm2015/skyux-popovers-testing.js +15 -9
  21. package/fesm2015/skyux-popovers-testing.js.map +1 -1
  22. package/fesm2015/skyux-popovers.js +40 -49
  23. package/fesm2015/skyux-popovers.js.map +1 -1
  24. package/lib/modules/dropdown/dropdown-item.component.d.ts +1 -1
  25. package/lib/modules/dropdown/dropdown-menu.component.d.ts +3 -3
  26. package/lib/modules/dropdown/dropdown.component.d.ts +12 -12
  27. package/lib/modules/popover/popover-content.component.d.ts +13 -12
  28. package/lib/modules/popover/popover.component.d.ts +6 -4
  29. package/lib/modules/popover/popover.directive.d.ts +3 -5
  30. package/package.json +6 -6
  31. package/testing/dropdown/dropdown-fixture.d.ts +7 -7
  32. package/testing/dropdown/popovers-fixture-dropdown.d.ts +2 -2
  33. package/testing/popover/popover-fixture.d.ts +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-item.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown-item.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown-item.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,KAAK,EACL,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;;;AAEvB;;GAEG;AAQH,MAAM,OAAO,wBAAwB;IA4BnC,YACS,UAAsB,EACrB,cAAiC,EACjC,QAAmB;QAFpB,eAAU,GAAV,UAAU,CAAY;QACrB,mBAAc,GAAd,cAAc,CAAmB;QACjC,aAAQ,GAAR,QAAQ,CAAW;QATtB,aAAQ,GAAG,KAAK,CAAC;QAEjB,eAAU,GAAG,KAAK,CAAC;IAQvB,CAAC;IA/BJ;;;;;;;OAOG;IACH,IACW,QAAQ,CAAC,KAAa;QAC/B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC;IACtC,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACjE,CAAC;IAcM,eAAe;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAEtC,0CAA0C;QAC1C,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACzC,0BAA0B;QAC1B,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;SAC5D;QAED,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;IACtC,CAAC;IAEM,YAAY,CAAC,iBAA0B;QAC5C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,iBAAiB,EAAE;YACrB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;SAC5B;QAED,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;IACtC,CAAC;IAEM,WAAW;QAChB,mCAAmC;QACnC,MAAM,WAAW,GACf,IAAI,CAAC,aAAa;YAClB,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;QACvD,kBAAkB;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;;sHArEU,wBAAwB;0GAAxB,wBAAwB,2FCrBrC,6NAUA;4FDWa,wBAAwB;kBAPpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,WAAW,EAAE,gCAAgC;oBAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;yJAWY,QAAQ;sBADlB,KAAK","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n Renderer2,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Specifies the items to display on the dropdown menu.\n */\n@Component({\n selector: 'sky-dropdown-item',\n templateUrl: './dropdown-item.component.html',\n styleUrls: ['./dropdown-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyDropdownItemComponent implements AfterViewInit {\n /**\n * Specifies an ARIA role for the dropdown menu item\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)\n * by indicating how the item functions and what it controls. For information about\n * how an ARIA role indicates what an item represents on a web page, see the\n * [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).\n * @default \"menuitem\"\n */\n @Input()\n public set ariaRole(value: string) {\n this._ariaRole = value;\n }\n\n public get ariaRole(): string {\n return this._ariaRole || 'menuitem';\n }\n\n public get buttonElement(): HTMLButtonElement {\n return this.elementRef.nativeElement.querySelector('button,a');\n }\n\n public isActive = false;\n\n public isDisabled = false;\n\n private _ariaRole: string;\n\n public constructor(\n public elementRef: ElementRef,\n private changeDetector: ChangeDetectorRef,\n private renderer: Renderer2\n ) {}\n\n public ngAfterViewInit(): void {\n this.isDisabled = !this.isFocusable();\n\n // Make sure anchor elements are tab-able.\n const buttonElement = this.buttonElement;\n /* istanbul ignore else */\n if (buttonElement) {\n this.renderer.setAttribute(buttonElement, 'tabIndex', '0');\n }\n\n this.changeDetector.detectChanges();\n }\n\n public focusElement(enableNativeFocus: boolean): void {\n this.isActive = true;\n\n if (enableNativeFocus) {\n this.buttonElement.focus();\n }\n\n this.changeDetector.detectChanges();\n }\n\n public isFocusable(): boolean {\n /*tslint:disable no-null-keyword */\n const isFocusable =\n this.buttonElement &&\n this.buttonElement.getAttribute('disabled') === null;\n /*tslint:enable */\n return isFocusable;\n }\n\n public resetState(): void {\n this.isActive = false;\n this.changeDetector.markForCheck();\n }\n}\n","<div\n class=\"sky-dropdown-item\"\n [attr.role]=\"ariaRole\"\n [ngClass]=\"{\n 'sky-dropdown-item-active': isActive,\n 'sky-dropdown-item-disabled': isDisabled\n }\"\n>\n <ng-content> </ng-content>\n</div>\n"]}
1
+ {"version":3,"file":"dropdown-item.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown-item.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/d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CAAC;IACtC,CAAC;IAEM,WAAW;QAChB,mCAAmC;QACnC,MAAM,WAAW,GACf,IAAI,CAAC,aAAa;YAClB,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;QACvD,kBAAkB;QAClB,OAAO,WAAW,CAAC;IACrB,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;;sHArEU,wBAAwB;0GAAxB,wBAAwB,2FCrBrC,6NAUA;4FDWa,wBAAwB;kBAPpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,WAAW,EAAE,gCAAgC;oBAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;yJAWY,QAAQ;sBADlB,KAAK","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n Renderer2,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Specifies the items to display on the dropdown menu.\n */\n@Component({\n selector: 'sky-dropdown-item',\n templateUrl: './dropdown-item.component.html',\n styleUrls: ['./dropdown-item.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyDropdownItemComponent implements AfterViewInit {\n /**\n * Specifies an ARIA role for the dropdown menu item\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)\n * by indicating how the item functions and what it controls. For information about\n * how an ARIA role indicates what an item represents on a web page, see the\n * [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).\n * @default \"menuitem\"\n */\n @Input()\n public set ariaRole(value: string | undefined) {\n this._ariaRole = value;\n }\n\n public get ariaRole(): string {\n return this._ariaRole || 'menuitem';\n }\n\n public get buttonElement(): HTMLButtonElement {\n return this.elementRef.nativeElement.querySelector('button,a');\n }\n\n public isActive = false;\n\n public isDisabled = false;\n\n private _ariaRole: string | undefined;\n\n public constructor(\n public elementRef: ElementRef,\n private changeDetector: ChangeDetectorRef,\n private renderer: Renderer2\n ) {}\n\n public ngAfterViewInit(): void {\n this.isDisabled = !this.isFocusable();\n\n // Make sure anchor elements are tab-able.\n const buttonElement = this.buttonElement;\n /* istanbul ignore else */\n if (buttonElement) {\n this.renderer.setAttribute(buttonElement, 'tabIndex', '0');\n }\n\n this.changeDetector.detectChanges();\n }\n\n public focusElement(enableNativeFocus: boolean): void {\n this.isActive = true;\n\n if (enableNativeFocus) {\n this.buttonElement.focus();\n }\n\n this.changeDetector.detectChanges();\n }\n\n public isFocusable(): boolean {\n /*tslint:disable no-null-keyword */\n const isFocusable =\n this.buttonElement &&\n this.buttonElement.getAttribute('disabled') === null;\n /*tslint:enable */\n return isFocusable;\n }\n\n public resetState(): void {\n this.isActive = false;\n this.changeDetector.markForCheck();\n }\n}\n","<div\n class=\"sky-dropdown-item\"\n [attr.role]=\"ariaRole\"\n [ngClass]=\"{\n 'sky-dropdown-item-active': isActive,\n 'sky-dropdown-item-disabled': isDisabled\n }\"\n>\n <ng-content> </ng-content>\n</div>\n"]}
@@ -129,7 +129,6 @@ export class SkyDropdownMenuComponent {
129
129
  ngOnDestroy() {
130
130
  this.ngUnsubscribe.next();
131
131
  this.ngUnsubscribe.complete();
132
- this.ngUnsubscribe = undefined;
133
132
  }
134
133
  focusFirstItem() {
135
134
  if (!this.hasFocusableItems) {
@@ -201,9 +200,7 @@ export class SkyDropdownMenuComponent {
201
200
  });
202
201
  }
203
202
  getItemByIndex(index) {
204
- return this.menuItems.find((item, i) => {
205
- return i === index;
206
- });
203
+ return this.menuItems.find((_, i) => i === index);
207
204
  }
208
205
  selectItemByEventTarget(target) {
209
206
  const selectedItem = this.menuItems.find((item, i) => {
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown-menu.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown-menu.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,EAEL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;;;AAEvE,IAAI,MAAM,GAAG,CAAC,CAAC;AACf;;;GAGG;AAQH,MAAM,OAAO,wBAAwB;IAyFnC,YACU,cAAiC,EACjC,UAAsB,EACV,iBAAuC;QAFnD,mBAAc,GAAd,cAAc,CAAmB;QACjC,eAAU,GAAV,UAAU,CAAY;QACV,sBAAiB,GAAjB,iBAAiB,CAAsB;QA7C7D;;;;WAIG;QAEI,gBAAW,GAAG,IAAI,YAAY,EAAyB,CAAC;QAExD,mBAAc,GAAG,qBAAqB,EAAE,MAAM,EAAE,CAAC;QA0BhD,kBAAa,GAAG,IAAI,OAAO,EAAE,CAAC;QAI9B,eAAU,GAAG,CAAC,CAAC;IAQpB,CAAC;IApFJ;;;;;;;;OAQG;IACH,IACW,QAAQ,CAAC,KAAa;QAC/B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC;IAClC,CAAC;IAED;;;;;;OA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IACE,IAAI,CAAC,iBAAiB,CAAC,OAAO,KAAK,OAAO;oBAC1C,IAAI,CAAC,iBAAiB,CAAC,YAAY,KAAK,KAAK,EAC7C;oBACA,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;iBAChD;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;;sHAvVU,wBAAwB;0GAAxB,wBAAwB,kOA8ElB,wBAAwB,gDCnH3C,+MAQA;4FD6Ba,wBAAwB;kBAPpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,WAAW,EAAE,gCAAgC;oBAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;;0BA6FI,QAAQ;4CArFJ,cAAc;sBADpB,KAAK;gBAaK,QAAQ;sBADlB,KAAK;gBAiBK,cAAc;sBADxB,KAAK;gBAmBC,WAAW;sBADjB,MAAM;gBA2BA,SAAS;sBADf,eAAe;uBAAC,wBAAwB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyDropdownItemComponent } from './dropdown-item.component';\nimport { SkyDropdownComponent } from './dropdown.component';\nimport { SkyDropdownMenuChange } from './types/dropdown-menu-change';\nimport { SkyDropdownMessage } from './types/dropdown-message';\nimport { SkyDropdownMessageType } from './types/dropdown-message-type';\n\nlet nextId = 0;\n/**\n * Creates a menu that contains dropdown menu items.\n *\n */\n@Component({\n selector: 'sky-dropdown-menu',\n templateUrl: './dropdown-menu.component.html',\n styleUrls: ['./dropdown-menu.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyDropdownMenuComponent implements AfterContentInit, OnDestroy {\n /**\n * Specifies the HTML element ID (without the leading `#`) of the element that labels\n * the dropdown menu. This sets the dropdown menu's `aria-labelledby` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n */\n @Input()\n public ariaLabelledBy: string;\n\n /**\n * Specifies an ARIA role for the dropdown menu\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)\n * by indicating how the dropdown menu functions and what it controls. The dropdown button\n * inherits this value to set its `aria-haspopup` property. For information\n * about how an ARIA role indicates what an item represents on a web page, see the\n * [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).\n * @default \"menu\"\n */\n @Input()\n public set ariaRole(value: string) {\n this._ariaRole = value;\n }\n\n public get ariaRole(): string {\n return this._ariaRole || 'menu';\n }\n\n /**\n * Indicates whether to use the browser's native focus function when users navigate through menu\n * items with the keyboard. To disable the native focus function, set this property to `false`.\n * For example, to let users interact with the dropdown menu but keep the keyboard focus on a\n * different element, set this property to `false`.\n * @default true\n */\n @Input()\n public set useNativeFocus(value: boolean) {\n this._useNativeFocus = value;\n }\n\n public get useNativeFocus(): boolean {\n if (this._useNativeFocus === undefined) {\n return true;\n }\n\n return this._useNativeFocus;\n }\n\n /**\n * Fires when the dropdown menu's active index or selected item changes. This event provides an\n * observable to emit changes, and the response is of\n * the SkyDropdownMenuChange type.\n */\n @Output()\n public menuChanges = new EventEmitter<SkyDropdownMenuChange>();\n\n public dropdownMenuId = `sky-dropdown-menu-${++nextId}`;\n\n private get hasFocusableItems(): boolean {\n const found = this.menuItems.find((item) => item.isFocusable());\n return found !== undefined;\n }\n\n public set menuIndex(value: number) {\n if (value < 0) {\n value = this.menuItems.length - 1;\n }\n\n if (value >= this.menuItems.length) {\n value = 0;\n }\n\n this._menuIndex = value;\n }\n\n public get menuIndex(): number {\n return this._menuIndex;\n }\n\n @ContentChildren(SkyDropdownItemComponent, { descendants: true })\n public menuItems: QueryList<SkyDropdownItemComponent>;\n\n private ngUnsubscribe = new Subject();\n\n private _ariaRole: string;\n\n private _menuIndex = 0;\n\n private _useNativeFocus: boolean;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private elementRef: ElementRef,\n @Optional() private dropdownComponent: SkyDropdownComponent\n ) {}\n\n public ngAfterContentInit(): void {\n /* istanbul ignore else */\n if (this.dropdownComponent) {\n this.dropdownComponent.menuId = this.dropdownMenuId;\n this.dropdownComponent.menuAriaRole = this.ariaRole;\n\n this.dropdownComponent.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyDropdownMessage) => {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyDropdownMessageType.Open:\n case SkyDropdownMessageType.Close:\n this.reset();\n break;\n\n case SkyDropdownMessageType.FocusFirstItem:\n this.focusFirstItem();\n break;\n\n case SkyDropdownMessageType.FocusNextItem:\n this.focusNextItem();\n break;\n\n case SkyDropdownMessageType.FocusPreviousItem:\n this.focusPreviousItem();\n break;\n\n case SkyDropdownMessageType.FocusLastItem:\n this.focusLastItem();\n break;\n }\n });\n\n this.menuChanges\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change: SkyDropdownMenuChange) => {\n // Close the dropdown when a menu item is selected.\n if (change.selectedItem) {\n this.sendMessage(SkyDropdownMessageType.Close);\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n }\n\n if (change.items) {\n // Update the popover style and position whenever the number of items changes.\n this.sendMessage(SkyDropdownMessageType.Reposition);\n }\n });\n }\n\n // Reset dropdown whenever the menu items change.\n this.menuItems.changes\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((items: QueryList<SkyDropdownItemComponent>) => {\n this.reset();\n this.menuChanges.emit({\n items: items.toArray(),\n });\n });\n\n this.addEventListeners();\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n }\n\n public focusFirstItem(): void {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex = 0;\n\n const firstItem = this.getItemByIndex(this.menuIndex);\n if (firstItem && firstItem.isFocusable()) {\n this.focusItem(firstItem);\n } else {\n this.focusNextItem();\n }\n }\n\n public focusLastItem(): void {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex = this.menuItems.length - 1;\n\n const lastItem = this.getItemByIndex(this.menuIndex);\n if (lastItem && lastItem.isFocusable()) {\n this.focusItem(lastItem);\n } else {\n this.focusPreviousItem();\n }\n }\n\n public focusPreviousItem(): void {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex--;\n\n const previousItem = this.getItemByIndex(this.menuIndex);\n if (previousItem && previousItem.isFocusable()) {\n this.focusItem(previousItem);\n } else {\n this.focusPreviousItem();\n }\n }\n\n public focusNextItem() {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex++;\n\n const nextItem = this.getItemByIndex(this.menuIndex);\n if (nextItem && nextItem.isFocusable()) {\n this.focusItem(nextItem);\n } else {\n this.focusNextItem();\n }\n }\n\n public reset(): void {\n this._menuIndex = -1;\n this.resetItemsActiveState();\n this.changeDetector.markForCheck();\n }\n\n private resetItemsActiveState() {\n this.menuItems.forEach((item: SkyDropdownItemComponent) => {\n item.resetState();\n });\n }\n\n private focusItem(item: SkyDropdownItemComponent): void {\n this.resetItemsActiveState();\n item.focusElement(this.useNativeFocus);\n this.menuChanges.emit({\n activeIndex: this.menuIndex,\n });\n }\n\n private getItemByIndex(index: number): SkyDropdownItemComponent {\n return this.menuItems.find((item: any, i: number) => {\n return i === index;\n });\n }\n\n private selectItemByEventTarget(target: EventTarget): void {\n const selectedItem = this.menuItems.find(\n (item: SkyDropdownItemComponent, i: number) => {\n const found = item.elementRef.nativeElement.contains(target);\n\n if (found) {\n this.menuIndex = i;\n this.menuChanges.next({\n activeIndex: this.menuIndex,\n });\n }\n\n return found;\n }\n );\n\n /* istanbul ignore else */\n if (selectedItem) {\n this.menuChanges.next({\n selectedItem,\n });\n }\n }\n\n private sendMessage(type: SkyDropdownMessageType): void {\n this.dropdownComponent.messageStream.next({ type });\n }\n\n private addEventListeners(): void {\n const dropdownMenuElement = this.elementRef.nativeElement;\n\n observableFromEvent(dropdownMenuElement, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: MouseEvent) => {\n this.selectItemByEventTarget(event.target);\n });\n\n observableFromEvent(dropdownMenuElement, '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.sendMessage(SkyDropdownMessageType.Close);\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n event.stopPropagation();\n event.preventDefault();\n break;\n\n case 'arrowdown':\n case 'down':\n this.focusNextItem();\n event.preventDefault();\n break;\n\n case 'arrowup':\n case 'up':\n this.focusPreviousItem();\n event.preventDefault();\n break;\n\n case 'tab':\n if (this.dropdownComponent.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n break;\n }\n });\n\n observableFromEvent(dropdownMenuElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.dropdownComponent.isMouseEnter = true;\n });\n\n observableFromEvent(dropdownMenuElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.dropdownComponent.isMouseEnter = false;\n // Allow the dropdown component to set isMouseEnter before checking if the close action\n // should be taken.\n setTimeout(() => {\n if (\n this.dropdownComponent.trigger === 'hover' &&\n this.dropdownComponent.isMouseEnter === false\n ) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n });\n }\n}\n","<div\n class=\"sky-dropdown-menu sky-shadow sky-elevation-4\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.role]=\"ariaRole\"\n [id]=\"dropdownMenuId\"\n>\n <ng-content> </ng-content>\n</div>\n"]}
1
+ {"version":3,"file":"dropdown-menu.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown-menu.component.ts","../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown-menu.component.html"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,UAAU,EACV,YAAY,EACZ,KAAK,EAEL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;;;AAEvE,IAAI,MAAM,GAAG,CAAC,CAAC;AACf;;;GAGG;AAQH,MAAM,OAAO,wBAAwB;IAyFnC,YACU,cAAiC,EACjC,UAAsB,EACV,iBAAuC;QAFnD,mBAAc,GAAd,cAAc,CAAmB;QACjC,eAAU,GAAV,UAAU,CAAY;QACV,sBAAiB,GAAjB,iBAAiB,CAAsB;QA7C7D;;;;WAIG;QAEI,gBAAW,GAAG,IAAI,YAAY,EAAyB,CAAC;QAExD,mBAAc,GAAG,qBAAqB,EAAE,MAAM,EAAE,CAAC;QA0BhD,kBAAa,GAAG,IAAI,OAAO,EAAE,CAAC;QAI9B,eAAU,GAAG,CAAC,CAAC;IAQpB,CAAC;IApFJ;;;;;;;;OAQG;IACH,IACW,QAAQ,CAAC,KAAyB;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AG,KAAK,CAAC;YAC5C,uFAAuF;YACvF,mBAAmB;YACnB,UAAU,CAAC,GAAG,EAAE;gBACd,IACE,IAAI,CAAC,iBAAiB,CAAC,OAAO,KAAK,OAAO;oBAC1C,IAAI,CAAC,iBAAiB,CAAC,YAAY,KAAK,KAAK,EAC7C;oBACA,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;iBAChD;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;;sHApVU,wBAAwB;0GAAxB,wBAAwB,kOA8ElB,wBAAwB,gDCnH3C,+MAQA;4FD6Ba,wBAAwB;kBAPpC,SAAS;mBAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,WAAW,EAAE,gCAAgC;oBAC7C,SAAS,EAAE,CAAC,gCAAgC,CAAC;oBAC7C,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;iBACtC;;0BA6FI,QAAQ;4CArFJ,cAAc;sBADpB,KAAK;gBAaK,QAAQ;sBADlB,KAAK;gBAiBK,cAAc;sBADxB,KAAK;gBAmBC,WAAW;sBADjB,MAAM;gBA2BA,SAAS;sBADf,eAAe;uBAAC,wBAAwB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE","sourcesContent":["import {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyDropdownItemComponent } from './dropdown-item.component';\nimport { SkyDropdownComponent } from './dropdown.component';\nimport { SkyDropdownMenuChange } from './types/dropdown-menu-change';\nimport { SkyDropdownMessage } from './types/dropdown-message';\nimport { SkyDropdownMessageType } from './types/dropdown-message-type';\n\nlet nextId = 0;\n/**\n * Creates a menu that contains dropdown menu items.\n *\n */\n@Component({\n selector: 'sky-dropdown-menu',\n templateUrl: './dropdown-menu.component.html',\n styleUrls: ['./dropdown-menu.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class SkyDropdownMenuComponent implements AfterContentInit, OnDestroy {\n /**\n * Specifies the HTML element ID (without the leading `#`) of the element that labels\n * the dropdown menu. This sets the dropdown menu's `aria-labelledby` attribute\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n */\n @Input()\n public ariaLabelledBy: string | undefined;\n\n /**\n * Specifies an ARIA role for the dropdown menu\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility)\n * by indicating how the dropdown menu functions and what it controls. The dropdown button\n * inherits this value to set its `aria-haspopup` property. For information\n * about how an ARIA role indicates what an item represents on a web page, see the\n * [WAI-ARIA roles model](https://www.w3.org/WAI/PF/aria/roles).\n * @default \"menu\"\n */\n @Input()\n public set ariaRole(value: string | undefined) {\n this._ariaRole = value;\n }\n\n public get ariaRole(): string {\n return this._ariaRole || 'menu';\n }\n\n /**\n * Indicates whether to use the browser's native focus function when users navigate through menu\n * items with the keyboard. To disable the native focus function, set this property to `false`.\n * For example, to let users interact with the dropdown menu but keep the keyboard focus on a\n * different element, set this property to `false`.\n * @default true\n */\n @Input()\n public set useNativeFocus(value: boolean | undefined) {\n this._useNativeFocus = value;\n }\n\n public get useNativeFocus(): boolean {\n if (this._useNativeFocus === undefined) {\n return true;\n }\n\n return this._useNativeFocus;\n }\n\n /**\n * Fires when the dropdown menu's active index or selected item changes. This event provides an\n * observable to emit changes, and the response is of\n * the SkyDropdownMenuChange type.\n */\n @Output()\n public menuChanges = new EventEmitter<SkyDropdownMenuChange>();\n\n public dropdownMenuId = `sky-dropdown-menu-${++nextId}`;\n\n private get hasFocusableItems(): boolean {\n const found = this.menuItems.find((item) => item.isFocusable());\n return found !== undefined;\n }\n\n public set menuIndex(value: number) {\n if (value < 0) {\n value = this.menuItems.length - 1;\n }\n\n if (value >= this.menuItems.length) {\n value = 0;\n }\n\n this._menuIndex = value;\n }\n\n public get menuIndex(): number {\n return this._menuIndex;\n }\n\n @ContentChildren(SkyDropdownItemComponent, { descendants: true })\n public menuItems!: QueryList<SkyDropdownItemComponent>;\n\n private ngUnsubscribe = new Subject();\n\n private _ariaRole: string | undefined;\n\n private _menuIndex = 0;\n\n private _useNativeFocus: boolean | undefined;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private elementRef: ElementRef,\n @Optional() private dropdownComponent: SkyDropdownComponent\n ) {}\n\n public ngAfterContentInit(): void {\n /* istanbul ignore else */\n if (this.dropdownComponent) {\n this.dropdownComponent.menuId = this.dropdownMenuId;\n this.dropdownComponent.menuAriaRole = this.ariaRole;\n\n this.dropdownComponent.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyDropdownMessage) => {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyDropdownMessageType.Open:\n case SkyDropdownMessageType.Close:\n this.reset();\n break;\n\n case SkyDropdownMessageType.FocusFirstItem:\n this.focusFirstItem();\n break;\n\n case SkyDropdownMessageType.FocusNextItem:\n this.focusNextItem();\n break;\n\n case SkyDropdownMessageType.FocusPreviousItem:\n this.focusPreviousItem();\n break;\n\n case SkyDropdownMessageType.FocusLastItem:\n this.focusLastItem();\n break;\n }\n });\n\n this.menuChanges\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change: SkyDropdownMenuChange) => {\n // Close the dropdown when a menu item is selected.\n if (change.selectedItem) {\n this.sendMessage(SkyDropdownMessageType.Close);\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n }\n\n if (change.items) {\n // Update the popover style and position whenever the number of items changes.\n this.sendMessage(SkyDropdownMessageType.Reposition);\n }\n });\n }\n\n // Reset dropdown whenever the menu items change.\n this.menuItems.changes\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((items: QueryList<SkyDropdownItemComponent>) => {\n this.reset();\n this.menuChanges.emit({\n items: items.toArray(),\n });\n });\n\n this.addEventListeners();\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public focusFirstItem(): void {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex = 0;\n\n const firstItem = this.getItemByIndex(this.menuIndex);\n if (firstItem && firstItem.isFocusable()) {\n this.focusItem(firstItem);\n } else {\n this.focusNextItem();\n }\n }\n\n public focusLastItem(): void {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex = this.menuItems.length - 1;\n\n const lastItem = this.getItemByIndex(this.menuIndex);\n if (lastItem && lastItem.isFocusable()) {\n this.focusItem(lastItem);\n } else {\n this.focusPreviousItem();\n }\n }\n\n public focusPreviousItem(): void {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex--;\n\n const previousItem = this.getItemByIndex(this.menuIndex);\n if (previousItem && previousItem.isFocusable()) {\n this.focusItem(previousItem);\n } else {\n this.focusPreviousItem();\n }\n }\n\n public focusNextItem() {\n if (!this.hasFocusableItems) {\n return;\n }\n\n this.menuIndex++;\n\n const nextItem = this.getItemByIndex(this.menuIndex);\n if (nextItem && nextItem.isFocusable()) {\n this.focusItem(nextItem);\n } else {\n this.focusNextItem();\n }\n }\n\n public reset(): void {\n this._menuIndex = -1;\n this.resetItemsActiveState();\n this.changeDetector.markForCheck();\n }\n\n private resetItemsActiveState() {\n this.menuItems.forEach((item: SkyDropdownItemComponent) => {\n item.resetState();\n });\n }\n\n private focusItem(item: SkyDropdownItemComponent): void {\n this.resetItemsActiveState();\n item.focusElement(this.useNativeFocus);\n this.menuChanges.emit({\n activeIndex: this.menuIndex,\n });\n }\n\n private getItemByIndex(index: number): SkyDropdownItemComponent | undefined {\n return this.menuItems.find((_, i) => i === index);\n }\n\n private selectItemByEventTarget(target: EventTarget): void {\n const selectedItem = this.menuItems.find(\n (item: SkyDropdownItemComponent, i: number) => {\n const found = item.elementRef.nativeElement.contains(target);\n\n if (found) {\n this.menuIndex = i;\n this.menuChanges.next({\n activeIndex: this.menuIndex,\n });\n }\n\n return found;\n }\n );\n\n /* istanbul ignore else */\n if (selectedItem) {\n this.menuChanges.next({\n selectedItem,\n });\n }\n }\n\n private sendMessage(type: SkyDropdownMessageType): void {\n this.dropdownComponent.messageStream.next({ type });\n }\n\n private addEventListeners(): void {\n const dropdownMenuElement = this.elementRef.nativeElement;\n\n observableFromEvent<MouseEvent>(dropdownMenuElement, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event) => {\n this.selectItemByEventTarget(event.target as EventTarget);\n });\n\n observableFromEvent<KeyboardEvent>(dropdownMenuElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event) => {\n const key = event.key.toLowerCase();\n\n /*tslint:disable-next-line:switch-default*/\n switch (key) {\n case 'escape':\n this.sendMessage(SkyDropdownMessageType.Close);\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n event.stopPropagation();\n event.preventDefault();\n break;\n\n case 'arrowdown':\n case 'down':\n this.focusNextItem();\n event.preventDefault();\n break;\n\n case 'arrowup':\n case 'up':\n this.focusPreviousItem();\n event.preventDefault();\n break;\n\n case 'tab':\n if (this.dropdownComponent.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n break;\n }\n });\n\n observableFromEvent(dropdownMenuElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.dropdownComponent.isMouseEnter = true;\n });\n\n observableFromEvent(dropdownMenuElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.dropdownComponent.isMouseEnter = false;\n // Allow the dropdown component to set isMouseEnter before checking if the close action\n // should be taken.\n setTimeout(() => {\n if (\n this.dropdownComponent.trigger === 'hover' &&\n this.dropdownComponent.isMouseEnter === false\n ) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n });\n }\n}\n","<div\n class=\"sky-dropdown-menu sky-shadow sky-elevation-4\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.role]=\"ariaRole\"\n [id]=\"dropdownMenuId\"\n>\n <ng-content> </ng-content>\n</div>\n"]}
@@ -1,3 +1,5 @@
1
+ var _SkyDropdownComponent_positionTimeout;
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
1
3
  import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, Optional, TemplateRef, ViewChild, } from '@angular/core';
2
4
  import { SkyAffixAutoFitContext, SkyAffixService, SkyOverlayService, } from '@skyux/core';
3
5
  import { SkyThemeService } from '@skyux/theme';
@@ -29,6 +31,7 @@ export class SkyDropdownComponent {
29
31
  this.isVisible = false;
30
32
  this.ngUnsubscribe = new Subject();
31
33
  this._isOpen = false;
34
+ _SkyDropdownComponent_positionTimeout.set(this, void 0);
32
35
  }
33
36
  /**
34
37
  * Specifies a background color for the dropdown button. Available values are `default` and
@@ -116,7 +119,7 @@ export class SkyDropdownComponent {
116
119
  if (value) {
117
120
  this._menuContainerElementRef = value;
118
121
  this.destroyAffixer();
119
- this.createAffixer();
122
+ this.createAffixer(value);
120
123
  this.changeDetector.markForCheck();
121
124
  }
122
125
  }
@@ -139,10 +142,9 @@ export class SkyDropdownComponent {
139
142
  ngOnDestroy() {
140
143
  this.destroyAffixer();
141
144
  this.destroyOverlay();
142
- clearTimeout(this._positionTimeout);
145
+ clearTimeout(__classPrivateFieldGet(this, _SkyDropdownComponent_positionTimeout, "f"));
143
146
  this.ngUnsubscribe.next();
144
147
  this.ngUnsubscribe.complete();
145
- this.ngUnsubscribe = undefined;
146
148
  }
147
149
  addEventListeners() {
148
150
  const buttonElement = this.triggerButton.nativeElement;
@@ -255,8 +257,8 @@ export class SkyDropdownComponent {
255
257
  this.overlay = undefined;
256
258
  }
257
259
  }
258
- createAffixer() {
259
- const affixer = this.affixService.createAffixer(this.menuContainerElementRef);
260
+ createAffixer(menuContainerElementRef) {
261
+ const affixer = this.affixService.createAffixer(menuContainerElementRef);
260
262
  affixer.placementChange
261
263
  .pipe(takeUntil(this.ngUnsubscribe))
262
264
  .subscribe((change) => {
@@ -299,7 +301,7 @@ export class SkyDropdownComponent {
299
301
  this.changeDetector.markForCheck();
300
302
  // Explicitly declare the `setTimeout` from the `window` object in order to use the DOM typings
301
303
  // during a unit test (instead of confusing this with Node's `setTimeout`).
302
- this._positionTimeout = window.setTimeout(() => {
304
+ __classPrivateFieldSet(this, _SkyDropdownComponent_positionTimeout, window.setTimeout(() => {
303
305
  this.affixer.affixTo(this.triggerButton.nativeElement, {
304
306
  autoFitContext: SkyAffixAutoFitContext.Viewport,
305
307
  enableAutoFit: true,
@@ -309,9 +311,10 @@ export class SkyDropdownComponent {
309
311
  });
310
312
  this.isVisible = true;
311
313
  this.changeDetector.markForCheck();
312
- });
314
+ }), "f");
313
315
  }
314
316
  }
317
+ _SkyDropdownComponent_positionTimeout = new WeakMap();
315
318
  SkyDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDropdownComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.SkyAffixService }, { token: i1.SkyOverlayService }, { token: i2.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
316
319
  SkyDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyDropdownComponent, selector: "sky-dropdown", inputs: { buttonStyle: "buttonStyle", buttonType: "buttonType", disabled: "disabled", dismissOnBlur: "dismissOnBlur", label: "label", horizontalAlignment: "horizontalAlignment", messageStream: "messageStream", title: "title", trigger: "trigger" }, viewQueries: [{ propertyName: "menuContainerElementRef", first: true, predicate: ["menuContainerElementRef"], descendants: true, read: ElementRef }, { propertyName: "menuContainerTemplateRef", first: true, predicate: ["menuContainerTemplateRef"], descendants: true, read: TemplateRef, static: true }, { propertyName: "triggerButton", first: true, predicate: ["triggerButton"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<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", styles: [".sky-dropdown-button-type-tab{background-color:transparent;border:none;border-radius:4px 4px 0 0;color:#686c73;cursor:pointer;display:inline-block;font-weight:600;line-height:1.8;padding:8px 16px;background-color:#0974a1;color:#fff;max-width:100%;text-align:left}.sky-dropdown-button-type-tab:hover:not(.sky-btn-tab-disabled){background-color:#eeeeef;color:#212327;text-decoration:none}.sky-dropdown-button-type-tab.sky-btn-tab-disabled{background-color:#cdcfd2;cursor:default;outline:none;text-decoration:none}.sky-dropdown-button-type-tab.sky-btn-tab-disabled:hover{color:#686c73;cursor:default;text-decoration:none}.sky-dropdown-button-type-tab:hover:not(.sky-btn-tab-disabled){background-color:#0974a1;color:#fff}.sky-dropdown-button-type-context-menu{border-radius:50%;padding:3px 8px}.sky-dropdown-caret{margin-left:10px}.sky-dropdown-button-container{display:flex}.sky-dropdown-button-content-container{flex-shrink:1;overflow:hidden;text-overflow:ellipsis}.sky-dropdown-button-icon-container{flex-grow:1}.sky-dropdown-menu-container{position:fixed}.hidden{visibility:hidden}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab{border:none;border-radius:0;font-weight:400;padding:10px 15px;transition:box-shadow .15s;background-color:transparent;color:#212327}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab:hover:not(.sky-btn-tab-disabled):not(.sky-btn-tab-selected):not(.sky-dropdown-button-type-tab):not(:focus){background-color:transparent;border-bottom:solid 1px #00b4f1;padding-bottom:9px}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab:focus{background-color:transparent;outline:none}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab:focus:not(:active){outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab:active{border-bottom:solid 3px #00b4f1;padding-bottom:7px}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab:not(:active){border-bottom:solid 3px #1870B8;padding-bottom:7px}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab:hover:not(.sky-btn-tab-disabled){background-color:transparent;color:#212327}:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab .sky-btn-tab-close,:host-context(.sky-theme-modern) .sky-dropdown-button-type-tab .sky-tab-header-count{color:#686c73}:host-context(.sky-theme-modern) .sky-dropdown-caret{margin-left:10px}.sky-theme-modern .sky-dropdown-button-type-tab{border:none;border-radius:0;font-weight:400;padding:10px 15px;transition:box-shadow .15s;background-color:transparent;color:#212327}.sky-theme-modern .sky-dropdown-button-type-tab:hover:not(.sky-btn-tab-disabled):not(.sky-btn-tab-selected):not(.sky-dropdown-button-type-tab):not(:focus){background-color:transparent;border-bottom:solid 1px #00b4f1;padding-bottom:9px}.sky-theme-modern .sky-dropdown-button-type-tab:focus{background-color:transparent;outline:none}.sky-theme-modern .sky-dropdown-button-type-tab:focus:not(:active){outline:solid 2px #1870B8;outline-offset:-2px;box-shadow:0 1px 8px #0000004d}.sky-theme-modern .sky-dropdown-button-type-tab:active{border-bottom:solid 3px #00b4f1;padding-bottom:7px}.sky-theme-modern .sky-dropdown-button-type-tab:not(:active){border-bottom:solid 3px #1870B8;padding-bottom:7px}.sky-theme-modern .sky-dropdown-button-type-tab:hover:not(.sky-btn-tab-disabled){background-color:transparent;color:#212327}.sky-theme-modern .sky-dropdown-button-type-tab .sky-btn-tab-close,.sky-theme-modern .sky-dropdown-button-type-tab .sky-tab-header-count{color:#686c73}.sky-theme-modern .sky-dropdown-caret{margin-left:10px}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-dropdown-button-type-tab{color:#fff}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-dropdown-button-type-tab:hover{color:#fff}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-dropdown-button-type-tab .sky-btn-tab-close,:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-dropdown-button-type-tab .sky-tab-header-count{color:#efefef}.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-button-type-tab{color:#fff}.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-button-type-tab:hover{color:#fff}.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-button-type-tab .sky-btn-tab-close,.sky-theme-modern.sky-theme-mode-dark .sky-dropdown-button-type-tab .sky-tab-header-count{color:#efefef}\n"], components: [{ type: i3.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
317
320
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDropdownComponent, decorators: [{
@@ -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,I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ACL,CAAC;;kHA9ZU,oBAAoB;sGAApB,oBAAoB,2ZA8HvB,UAAU,+HAwBV,WAAW,uHAMX,UAAU,2CCnMpB,wrEAuEA;4FDhCa,oBAAoB;kBANhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;oBACxB,WAAW,EAAE,2BAA2B;oBACxC,SAAS,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"]}
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,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AA6B,CAChD,IAAI,CAAC,mBAAmB,CACzB;gBACD,QAAQ,EAAE,IAAI;gBACd,SAAS,EAAE,OAAO;aACnB,CAAC,CAAC;YAEH,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;QACrC,CAAC,CAAC,MAAA,CAAC;IACL,CAAC;;;kHA7ZU,oBAAoB;sGAApB,oBAAoB,2ZAgIvB,UAAU,+HAwBV,WAAW,uHAMX,UAAU,2CCrMpB,wrEAuEA;4FDhCa,oBAAoB;kBANhC,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;oBACxB,WAAW,EAAE,2BAA2B;oBACxC,SAAS,EAAE,CAAC,2BAA2B,CAAC;oBACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;0BAgMI,QAAQ;4CAvLA,WAAW;sBADrB,KAAK;gBAkBK,UAAU;sBADpB,KAAK;gBAcK,QAAQ;sBADlB,KAAK;gBAcK,aAAa;sBADvB,KAAK;gBAkBC,KAAK;sBADX,KAAK;gBAQK,mBAAmB;sBAD7B,KAAK;gBAiBC,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 | undefined) {\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 | undefined) {\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 | undefined) {\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 | undefined;\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(\n value: SkyDropdownHorizontalAlignment | undefined\n ) {\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 | undefined;\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 | undefined) {\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 | undefined) {\n if (value) {\n this._menuContainerElementRef = value;\n this.destroyAffixer();\n this.createAffixer(value);\n this.changeDetector.markForCheck();\n }\n }\n\n public get menuContainerElementRef(): ElementRef | undefined {\n return this._menuContainerElementRef;\n }\n\n public isMouseEnter = false;\n\n public isVisible = false;\n\n public menuId: string | undefined;\n\n public menuAriaRole: string | undefined;\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 | undefined;\n\n private ngUnsubscribe = new Subject();\n\n private overlay: SkyOverlayInstance | undefined;\n\n private _buttonStyle: string | undefined;\n\n private _buttonType: string | undefined;\n\n private _disabled: boolean | undefined;\n\n private _dismissOnBlur: boolean | undefined;\n\n private _horizontalAlignment: SkyDropdownHorizontalAlignment | undefined;\n\n private _isOpen = false;\n\n private _menuContainerElementRef: ElementRef | undefined;\n\n private _trigger: SkyDropdownTriggerType | undefined;\n\n #positionTimeout: number | undefined;\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 }\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<KeyboardEvent>(buttonElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event) => {\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(menuContainerElementRef: ElementRef): void {\n const affixer = this.affixService.createAffixer(menuContainerElementRef);\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"]}
@@ -28,7 +28,7 @@ export class SkyPopoverContentComponent {
28
28
  this.dismissOnBlur = true;
29
29
  this.enableAnimations = true;
30
30
  this.isOpen = false;
31
- this.popoverType = 'info';
31
+ this.placement = null;
32
32
  this.ngUnsubscribe = new Subject();
33
33
  this._closed = new Subject();
34
34
  this._isMouseEnter = new Subject();
@@ -47,9 +47,7 @@ export class SkyPopoverContentComponent {
47
47
  return this._isMouseEnter.asObservable();
48
48
  }
49
49
  ngOnInit() {
50
- var _a;
51
- /*istanbul ignore next*/
52
- this.contentTarget.createEmbeddedView((_a = this.context) === null || _a === void 0 ? void 0 : _a.contentTemplateRef);
50
+ this.contentTarget.createEmbeddedView(this.context.contentTemplateRef);
53
51
  this.addEventListeners();
54
52
  /*istanbul ignore else*/
55
53
  if (this.themeSvc) {
@@ -71,27 +69,19 @@ export class SkyPopoverContentComponent {
71
69
  /* istanbul ignore else */
72
70
  if (this.affixer) {
73
71
  this.affixer.destroy();
72
+ this.affixer = undefined;
74
73
  }
75
- this._closed =
76
- this._isMouseEnter =
77
- this._opened =
78
- this.affixer =
79
- this.ngUnsubscribe =
80
- undefined;
81
74
  }
82
75
  onAnimationEvent(event) {
83
- var _a, _b;
84
76
  if (event.fromState === 'void') {
85
77
  return;
86
78
  }
87
79
  if (event.phaseName === 'done') {
88
80
  if (event.toState === 'open') {
89
- /*istanbul ignore next*/
90
- (_a = this._opened) === null || _a === void 0 ? void 0 : _a.next();
81
+ this._opened.next();
91
82
  }
92
83
  else {
93
- /*istanbul ignore next*/
94
- (_b = this._closed) === null || _b === void 0 ? void 0 : _b.next();
84
+ this._closed.next();
95
85
  }
96
86
  }
97
87
  }
@@ -102,9 +92,7 @@ export class SkyPopoverContentComponent {
102
92
  this.horizontalAlignment = config.horizontalAlignment;
103
93
  this.placement = config.placement;
104
94
  this.popoverTitle = config.popoverTitle;
105
- if (config.popoverType) {
106
- this.popoverType = config.popoverType;
107
- }
95
+ this.popoverType = config.popoverType;
108
96
  this.changeDetector.markForCheck();
109
97
  // Indicates if the popover should be displayed statically.
110
98
  // Please note: This feature is internal-only and used by the visual tests to capture multiple
@@ -117,11 +105,7 @@ export class SkyPopoverContentComponent {
117
105
  }
118
106
  // Let the styles render before gauging the affix dimensions.
119
107
  setTimeout(() => {
120
- var _a;
121
- /*istanbul ignore next*/
122
- if (!((_a = this.popoverRef) === null || _a === void 0 ? void 0 : _a.nativeElement) ||
123
- !this.ngUnsubscribe ||
124
- this.ngUnsubscribe.isStopped) {
108
+ if (!this.popoverRef.nativeElement || this.ngUnsubscribe.isStopped) {
125
109
  return;
126
110
  }
127
111
  if (!this.affixer) {
@@ -173,13 +157,15 @@ export class SkyPopoverContentComponent {
173
157
  this.affixer = affixer;
174
158
  }
175
159
  updateArrowOffset() {
176
- const { top, left } = this.adapterService.getArrowCoordinates({
177
- caller: this.caller,
178
- popover: this.popoverRef,
179
- popoverArrow: this.arrowRef,
180
- }, this.placement, this.themeName);
181
- this.arrowTop = top;
182
- this.arrowLeft = left;
160
+ if (this.placement) {
161
+ const { top, left } = this.adapterService.getArrowCoordinates({
162
+ caller: this.caller,
163
+ popover: this.popoverRef,
164
+ popoverArrow: this.arrowRef,
165
+ }, this.placement, this.themeName);
166
+ this.arrowTop = top;
167
+ this.arrowLeft = left;
168
+ }
183
169
  }
184
170
  isFocusLeavingElement(event) {
185
171
  const focusableItems = this.coreAdapterService.getFocusableChildren(this.elementRef.nativeElement);
@@ -227,7 +213,7 @@ export class SkyPopoverContentComponent {
227
213
  });
228
214
  }
229
215
  }
230
- SkyPopoverContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverContentComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.SkyAffixService }, { token: i1.SkyCoreAdapterService }, { token: i2.SkyPopoverAdapterService }, { token: i3.SkyPopoverContext, optional: true }, { token: i4.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
216
+ SkyPopoverContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverContentComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.SkyAffixService }, { token: i1.SkyCoreAdapterService }, { token: i2.SkyPopoverAdapterService }, { token: i3.SkyPopoverContext }, { token: i4.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
231
217
  SkyPopoverContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyPopoverContentComponent, selector: "sky-popover-content", providers: [SkyPopoverAdapterService], viewQueries: [{ propertyName: "arrowRef", first: true, predicate: ["arrowRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "popoverRef", first: true, predicate: ["popoverRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "contentTarget", first: true, predicate: ["contentTarget"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<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", styles: [".sky-popover-container{position:fixed;min-width:276px;max-width:276px}.sky-popover-container.sky-popover-hidden{visibility:hidden;opacity:0;pointer-events:none!important}.sky-popover-container.sky-popover-hidden *{pointer-events:none!important}.sky-popover-container.sky-popover-static .sky-popover-arrow{position:absolute}.sky-popover-container:focus{outline:none}@media (max-width: 276px){.sky-popover-container{max-width:100%;min-width:auto}}.sky-popover{background-color:#fff}.sky-popover-header{padding-bottom:0}.sky-popover-header+.sky-popover-body{padding-top:2px}.sky-popover-title{margin:0}.sky-popover-arrow{width:0;height:0;position:fixed;border:10px solid transparent}.sky-popover-placement-above{padding-bottom:10px}.sky-popover-placement-above .sky-popover{border-bottom:10px solid #00b4f1}.sky-popover-placement-above .sky-popover-arrow{border-bottom:0;border-top-color:#00b4f1;bottom:0;left:50%;margin-left:-10px}.sky-popover-placement-above.sky-popover-danger .sky-popover{border-bottom-color:#ef4044}.sky-popover-placement-above.sky-popover-danger .sky-popover-arrow{border-top-color:#ef4044}.sky-popover-placement-below{padding-top:10px}.sky-popover-placement-below .sky-popover{border-top:10px solid #00b4f1}.sky-popover-placement-below .sky-popover-arrow{border-top:0;border-bottom-color:#00b4f1;top:0;left:50%;margin-left:-10px}.sky-popover-placement-below.sky-popover-danger .sky-popover{border-top-color:#ef4044}.sky-popover-placement-below.sky-popover-danger .sky-popover-arrow{border-bottom-color:#ef4044}.sky-popover-placement-right{padding-left:10px}.sky-popover-placement-right .sky-popover{border-left:10px solid #00b4f1}.sky-popover-placement-right .sky-popover-arrow{border-left:0;border-right-color:#00b4f1;left:0;top:50%;margin-top:-10px}.sky-popover-placement-right.sky-popover-danger .sky-popover{border-left-color:#ef4044}.sky-popover-placement-right.sky-popover-danger .sky-popover-arrow{border-right-color:#ef4044}.sky-popover-placement-left{padding-right:10px}.sky-popover-placement-left .sky-popover{border-right:10px solid #00b4f1}.sky-popover-placement-left .sky-popover-arrow{border-right:0;border-left-color:#00b4f1;right:0;top:50%;margin-top:-10px}.sky-popover-placement-left.sky-popover-danger .sky-popover{border-right-color:#ef4044}.sky-popover-placement-left.sky-popover-danger .sky-popover-arrow{border-left-color:#ef4044}.sky-popover-placement-above.sky-popover-alignment-left .sky-popover-arrow,.sky-popover-placement-below.sky-popover-alignment-left .sky-popover-arrow{left:40px;right:auto}.sky-popover-placement-above.sky-popover-alignment-right .sky-popover-arrow,.sky-popover-placement-below.sky-popover-alignment-right .sky-popover-arrow{left:auto;right:40px}.sky-popover-max-height .sky-popover{overflow-y:auto;overflow-x:hidden;min-height:35px;max-height:calc(50vh - 50px)}:host-context(.sky-theme-modern) .sky-popover{border-radius:6px}:host-context(.sky-theme-modern) .sky-popover-arrow{transform:rotate(45deg);border-color:transparent}:host-context(.sky-theme-modern) .sky-popover-placement-above{padding-bottom:10px}:host-context(.sky-theme-modern) .sky-popover-placement-above .sky-popover{border-bottom:6px solid #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-above .sky-popover-arrow{bottom:1px;border-radius:0 0 3px;border-bottom:solid 10px #00b4f1;border-right:solid 10px #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-above.sky-popover-danger .sky-popover{border-bottom-color:#ef4044}:host-context(.sky-theme-modern) .sky-popover-placement-above.sky-popover-danger .sky-popover-arrow{border-bottom-color:#ef4044;border-right-color:#ef4044;border-top-color:transparent;border-left-color:transparent}:host-context(.sky-theme-modern) .sky-popover-placement-below{padding-top:10px}:host-context(.sky-theme-modern) .sky-popover-placement-below .sky-popover{border-top:6px solid #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-below .sky-popover-arrow{top:1px;border-radius:3px 0 0;border-top:solid 10px #00b4f1;border-left:solid 10px #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-below.sky-popover-danger .sky-popover{border-top-color:#ef4044}:host-context(.sky-theme-modern) .sky-popover-placement-below.sky-popover-danger .sky-popover-arrow{border-top-color:#ef4044;border-left-color:#ef4044;border-bottom-color:transparent;border-right-color:transparent}:host-context(.sky-theme-modern) .sky-popover-placement-right{padding-left:10px}:host-context(.sky-theme-modern) .sky-popover-placement-right .sky-popover{border-left:6px solid #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-right .sky-popover-arrow{left:1px;border-radius:0 0 0 3px;border-bottom:solid 10px #00b4f1;border-left:solid 10px #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-right.sky-popover-danger .sky-popover{border-left-color:#ef4044}:host-context(.sky-theme-modern) .sky-popover-placement-right.sky-popover-danger .sky-popover-arrow{border-bottom-color:#ef4044;border-left-color:#ef4044;border-top-color:transparent;border-right-color:transparent}:host-context(.sky-theme-modern) .sky-popover-placement-left{padding-right:10px}:host-context(.sky-theme-modern) .sky-popover-placement-left .sky-popover{border-right:6px solid #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-left .sky-popover-arrow{right:1px;border-radius:0 3px 0 0;border-top:solid 10px #00b4f1;border-right:solid 10px #00b4f1}:host-context(.sky-theme-modern) .sky-popover-placement-left.sky-popover-danger .sky-popover{border-right-color:#ef4044}:host-context(.sky-theme-modern) .sky-popover-placement-left.sky-popover-danger .sky-popover-arrow{border-top-color:#ef4044;border-right-color:#ef4044;border-bottom-color:transparent;border-left-color:transparent}.sky-theme-modern .sky-popover{border-radius:6px}.sky-theme-modern .sky-popover-arrow{transform:rotate(45deg);border-color:transparent}.sky-theme-modern .sky-popover-placement-above{padding-bottom:10px}.sky-theme-modern .sky-popover-placement-above .sky-popover{border-bottom:6px solid #00b4f1}.sky-theme-modern .sky-popover-placement-above .sky-popover-arrow{bottom:1px;border-radius:0 0 3px;border-bottom:solid 10px #00b4f1;border-right:solid 10px #00b4f1}.sky-theme-modern .sky-popover-placement-above.sky-popover-danger .sky-popover{border-bottom-color:#ef4044}.sky-theme-modern .sky-popover-placement-above.sky-popover-danger .sky-popover-arrow{border-bottom-color:#ef4044;border-right-color:#ef4044;border-top-color:transparent;border-left-color:transparent}.sky-theme-modern .sky-popover-placement-below{padding-top:10px}.sky-theme-modern .sky-popover-placement-below .sky-popover{border-top:6px solid #00b4f1}.sky-theme-modern .sky-popover-placement-below .sky-popover-arrow{top:1px;border-radius:3px 0 0;border-top:solid 10px #00b4f1;border-left:solid 10px #00b4f1}.sky-theme-modern .sky-popover-placement-below.sky-popover-danger .sky-popover{border-top-color:#ef4044}.sky-theme-modern .sky-popover-placement-below.sky-popover-danger .sky-popover-arrow{border-top-color:#ef4044;border-left-color:#ef4044;border-bottom-color:transparent;border-right-color:transparent}.sky-theme-modern .sky-popover-placement-right{padding-left:10px}.sky-theme-modern .sky-popover-placement-right .sky-popover{border-left:6px solid #00b4f1}.sky-theme-modern .sky-popover-placement-right .sky-popover-arrow{left:1px;border-radius:0 0 0 3px;border-bottom:solid 10px #00b4f1;border-left:solid 10px #00b4f1}.sky-theme-modern .sky-popover-placement-right.sky-popover-danger .sky-popover{border-left-color:#ef4044}.sky-theme-modern .sky-popover-placement-right.sky-popover-danger .sky-popover-arrow{border-bottom-color:#ef4044;border-left-color:#ef4044;border-top-color:transparent;border-right-color:transparent}.sky-theme-modern .sky-popover-placement-left{padding-right:10px}.sky-theme-modern .sky-popover-placement-left .sky-popover{border-right:6px solid #00b4f1}.sky-theme-modern .sky-popover-placement-left .sky-popover-arrow{right:1px;border-radius:0 3px 0 0;border-top:solid 10px #00b4f1;border-right:solid 10px #00b4f1}.sky-theme-modern .sky-popover-placement-left.sky-popover-danger .sky-popover{border-right-color:#ef4044}.sky-theme-modern .sky-popover-placement-left.sky-popover-danger .sky-popover-arrow{border-top-color:#ef4044;border-right-color:#ef4044;border-bottom-color:transparent;border-left-color:transparent}\n"], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [skyPopoverAnimation] });
232
218
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverContentComponent, decorators: [{
233
219
  type: Component,
@@ -238,9 +224,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
238
224
  animations: [skyPopoverAnimation],
239
225
  providers: [SkyPopoverAdapterService],
240
226
  }]
241
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.SkyAffixService }, { type: i1.SkyCoreAdapterService }, { type: i2.SkyPopoverAdapterService }, { type: i3.SkyPopoverContext, decorators: [{
242
- type: Optional
243
- }] }, { type: i4.SkyThemeService, decorators: [{
227
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.SkyAffixService }, { type: i1.SkyCoreAdapterService }, { type: i2.SkyPopoverAdapterService }, { type: i3.SkyPopoverContext }, { type: i4.SkyThemeService, decorators: [{
244
228
  type: Optional
245
229
  }] }]; }, propDecorators: { arrowRef: [{
246
230
  type: ViewChild,
@@ -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,UA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M,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
+ {"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,iBAAi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AAwF;gBACxF,oFAAoF;gBACpF,cAAc;gBACd,KAAK,KAAK;oBACR,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;wBACvB,OAAO;qBACR;oBAED,wBAAwB;oBACxB,IAAI,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE;wBACrC,IAAI,CAAC,KAAK,EAAE,CAAC;wBACb,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;wBAClC,KAAK,CAAC,cAAc,EAAE,CAAC;wBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;qBACzB;oBACD,MAAM;aACT;QACH,CAAC,CAAC,CAAC;IACP,CAAC;;wHA9SU,0BAA0B;4GAA1B,0BAA0B,8CAF1B,CAAC,wBAAwB,CAAC,2GA0C7B,UAAU,iHAMV,UAAU,uHAMV,gBAAgB,2CCjG1B,2kDA2DA,y+QDjBc,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;;0BA2EI,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';\nimport { SkyPopoverType } from './types/popover-type';\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 | undefined;\n\n public arrowLeft: number | undefined;\n\n public arrowTop: number | undefined;\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 | null = null;\n\n public popoverTitle: string | undefined;\n\n public popoverType!: SkyPopoverType;\n\n public themeName: string | undefined;\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 private context: SkyPopoverContext,\n @Optional() private themeSvc?: SkyThemeService\n ) {}\n\n public ngOnInit(): void {\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 this.affixer = undefined;\n }\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 this._opened.next();\n } else {\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: SkyPopoverType;\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 this.popoverType = config.popoverType;\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 if (!this.popoverRef.nativeElement || this.ngUnsubscribe.isStopped) {\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 as SkyPopoverPlacement),\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 if (this.placement) {\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\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<KeyboardEvent>(hostElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event) => {\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"]}